Files
pyMC_Repeater/repeater/web/html/assets/index-DJUYEmmJ.js
T

3951 lines
5.3 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.
(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const J of document.querySelectorAll('link[rel="modulepreload"]'))j(J);new MutationObserver(J=>{for(const mt of J)if(mt.type==="childList")for(const kt of mt.addedNodes)kt.tagName==="LINK"&&kt.rel==="modulepreload"&&j(kt)}).observe(document,{childList:!0,subtree:!0});function z(J){const mt={};return J.integrity&&(mt.integrity=J.integrity),J.referrerPolicy&&(mt.referrerPolicy=J.referrerPolicy),J.crossOrigin==="use-credentials"?mt.credentials="include":J.crossOrigin==="anonymous"?mt.credentials="omit":mt.credentials="same-origin",mt}function j(J){if(J.ep)return;J.ep=!0;const mt=z(J);fetch(J.href,mt)}})();/**
* @vue/shared v3.5.18
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**//*! #__NO_SIDE_EFFECTS__ */function SA(d){const l=Object.create(null);for(const z of d.split(","))l[z]=1;return z=>z in l}const mf={},n_=[],ug=()=>{},j$=()=>!1,_4=d=>d.charCodeAt(0)===111&&d.charCodeAt(1)===110&&(d.charCodeAt(2)>122||d.charCodeAt(2)<97),EA=d=>d.startsWith("onUpdate:"),op=Object.assign,CA=(d,l)=>{const z=d.indexOf(l);z>-1&&d.splice(z,1)},U$=Object.prototype.hasOwnProperty,Fh=(d,l)=>U$.call(d,l),ru=Array.isArray,i_=d=>$2(d)==="[object Map]",b4=d=>$2(d)==="[object Set]",_C=d=>$2(d)==="[object Date]",Uu=d=>typeof d=="function",sd=d=>typeof d=="string",Sm=d=>typeof d=="symbol",gf=d=>d!==null&&typeof d=="object",fz=d=>(gf(d)||Uu(d))&&Uu(d.then)&&Uu(d.catch),dz=Object.prototype.toString,$2=d=>dz.call(d),V$=d=>$2(d).slice(8,-1),pz=d=>$2(d)==="[object Object]",LA=d=>sd(d)&&d!=="NaN"&&d[0]!=="-"&&""+parseInt(d,10)===d,m2=SA(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),w4=d=>{const l=Object.create(null);return z=>l[z]||(l[z]=d(z))},H$=/-(\w)/g,cm=w4(d=>d.replace(H$,(l,z)=>z?z.toUpperCase():"")),W$=/\B([A-Z])/g,Ey=w4(d=>d.replace(W$,"-$1").toLowerCase()),k4=w4(d=>d.charAt(0).toUpperCase()+d.slice(1)),h8=w4(d=>d?`on${k4(d)}`:""),f1=(d,l)=>!Object.is(d,l),U5=(d,...l)=>{for(let z=0;z<d.length;z++)d[z](...l)},Z8=(d,l,z,j=!1)=>{Object.defineProperty(d,l,{configurable:!0,enumerable:!1,writable:j,value:z})},Q5=d=>{const l=parseFloat(d);return isNaN(l)?d:l},q$=d=>{const l=sd(d)?Number(d):NaN;return isNaN(l)?d:l};let bC;const T4=()=>bC||(bC=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function av(d){if(ru(d)){const l={};for(let z=0;z<d.length;z++){const j=d[z],J=sd(j)?Y$(j):av(j);if(J)for(const mt in J)l[mt]=J[mt]}return l}else if(sd(d)||gf(d))return d}const Z$=/;(?![^(]*\))/g,$$=/:([^]+)/,G$=/\/\*[^]*?\*\//g;function Y$(d){const l={};return d.replace(G$,"").split(Z$).forEach(z=>{if(z){const j=z.split($$);j.length>1&&(l[j[0].trim()]=j[1].trim())}}),l}function Xs(d){let l="";if(sd(d))l=d;else if(ru(d))for(let z=0;z<d.length;z++){const j=Xs(d[z]);j&&(l+=j+" ")}else if(gf(d))for(const z in d)d[z]&&(l+=z+" ");return l.trim()}const K$="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",X$=SA(K$);function mz(d){return!!d||d===""}function J$(d,l){if(d.length!==l.length)return!1;let z=!0;for(let j=0;z&&j<d.length;j++)z=u_(d[j],l[j]);return z}function u_(d,l){if(d===l)return!0;let z=_C(d),j=_C(l);if(z||j)return z&&j?d.getTime()===l.getTime():!1;if(z=Sm(d),j=Sm(l),z||j)return d===l;if(z=ru(d),j=ru(l),z||j)return z&&j?J$(d,l):!1;if(z=gf(d),j=gf(l),z||j){if(!z||!j)return!1;const J=Object.keys(d).length,mt=Object.keys(l).length;if(J!==mt)return!1;for(const kt in d){const Dt=d.hasOwnProperty(kt),Gt=l.hasOwnProperty(kt);if(Dt&&!Gt||!Dt&&Gt||!u_(d[kt],l[kt]))return!1}}return String(d)===String(l)}function Q$(d,l){return d.findIndex(z=>u_(z,l))}const gz=d=>!!(d&&d.__v_isRef===!0),aa=d=>sd(d)?d:d==null?"":ru(d)||gf(d)&&(d.toString===dz||!Uu(d.toString))?gz(d)?aa(d.value):JSON.stringify(d,vz,2):String(d),vz=(d,l)=>gz(l)?vz(d,l.value):i_(l)?{[`Map(${l.size})`]:[...l.entries()].reduce((z,[j,J],mt)=>(z[f8(j,mt)+" =>"]=J,z),{})}:b4(l)?{[`Set(${l.size})`]:[...l.values()].map(z=>f8(z))}:Sm(l)?f8(l):gf(l)&&!ru(l)&&!pz(l)?String(l):l,f8=(d,l="")=>{var z;return Sm(d)?`Symbol(${(z=d.description)!=null?z:l})`:d};/**
* @vue/reactivity v3.5.18
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let qp;class yz{constructor(l=!1){this.detached=l,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=qp,!l&&qp&&(this.index=(qp.scopes||(qp.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let l,z;if(this.scopes)for(l=0,z=this.scopes.length;l<z;l++)this.scopes[l].pause();for(l=0,z=this.effects.length;l<z;l++)this.effects[l].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let l,z;if(this.scopes)for(l=0,z=this.scopes.length;l<z;l++)this.scopes[l].resume();for(l=0,z=this.effects.length;l<z;l++)this.effects[l].resume()}}run(l){if(this._active){const z=qp;try{return qp=this,l()}finally{qp=z}}}on(){++this._on===1&&(this.prevScope=qp,qp=this)}off(){this._on>0&&--this._on===0&&(qp=this.prevScope,this.prevScope=void 0)}stop(l){if(this._active){this._active=!1;let z,j;for(z=0,j=this.effects.length;z<j;z++)this.effects[z].stop();for(this.effects.length=0,z=0,j=this.cleanups.length;z<j;z++)this.cleanups[z]();if(this.cleanups.length=0,this.scopes){for(z=0,j=this.scopes.length;z<j;z++)this.scopes[z].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!l){const J=this.parent.scopes.pop();J&&J!==this&&(this.parent.scopes[this.index]=J,J.index=this.index)}this.parent=void 0}}}function xz(d){return new yz(d)}function _z(){return qp}function tG(d,l=!1){qp&&qp.cleanups.push(d)}let kf;const d8=new WeakSet;class bz{constructor(l){this.fn=l,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,qp&&qp.active&&qp.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,d8.has(this)&&(d8.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||kz(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,wC(this),Tz(this);const l=kf,z=Mm;kf=this,Mm=!0;try{return this.fn()}finally{Az(this),kf=l,Mm=z,this.flags&=-3}}stop(){if(this.flags&1){for(let l=this.deps;l;l=l.nextDep)IA(l);this.deps=this.depsTail=void 0,wC(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?d8.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){$8(this)&&this.run()}get dirty(){return $8(this)}}let wz=0,g2,v2;function kz(d,l=!1){if(d.flags|=8,l){d.next=v2,v2=d;return}d.next=g2,g2=d}function PA(){wz++}function zA(){if(--wz>0)return;if(v2){let l=v2;for(v2=void 0;l;){const z=l.next;l.next=void 0,l.flags&=-9,l=z}}let d;for(;g2;){let l=g2;for(g2=void 0;l;){const z=l.next;if(l.next=void 0,l.flags&=-9,l.flags&1)try{l.trigger()}catch(j){d||(d=j)}l=z}}if(d)throw d}function Tz(d){for(let l=d.deps;l;l=l.nextDep)l.version=-1,l.prevActiveLink=l.dep.activeLink,l.dep.activeLink=l}function Az(d){let l,z=d.depsTail,j=z;for(;j;){const J=j.prevDep;j.version===-1?(j===z&&(z=J),IA(j),eG(j)):l=j,j.dep.activeLink=j.prevActiveLink,j.prevActiveLink=void 0,j=J}d.deps=l,d.depsTail=z}function $8(d){for(let l=d.deps;l;l=l.nextDep)if(l.dep.version!==l.version||l.dep.computed&&(Mz(l.dep.computed)||l.dep.version!==l.version))return!0;return!!d._dirty}function Mz(d){if(d.flags&4&&!(d.flags&16)||(d.flags&=-17,d.globalVersion===C2)||(d.globalVersion=C2,!d.isSSR&&d.flags&128&&(!d.deps&&!d._dirty||!$8(d))))return;d.flags|=2;const l=d.dep,z=kf,j=Mm;kf=d,Mm=!0;try{Tz(d);const J=d.fn(d._value);(l.version===0||f1(J,d._value))&&(d.flags|=128,d._value=J,l.version++)}catch(J){throw l.version++,J}finally{kf=z,Mm=j,Az(d),d.flags&=-3}}function IA(d,l=!1){const{dep:z,prevSub:j,nextSub:J}=d;if(j&&(j.nextSub=J,d.prevSub=void 0),J&&(J.prevSub=j,d.nextSub=void 0),z.subs===d&&(z.subs=j,!j&&z.computed)){z.computed.flags&=-5;for(let mt=z.computed.deps;mt;mt=mt.nextDep)IA(mt,!0)}!l&&!--z.sc&&z.map&&z.map.delete(z.key)}function eG(d){const{prevDep:l,nextDep:z}=d;l&&(l.nextDep=z,d.prevDep=void 0),z&&(z.prevDep=l,d.nextDep=void 0)}let Mm=!0;const Sz=[];function nv(){Sz.push(Mm),Mm=!1}function iv(){const d=Sz.pop();Mm=d===void 0?!0:d}function wC(d){const{cleanup:l}=d;if(d.cleanup=void 0,l){const z=kf;kf=void 0;try{l()}finally{kf=z}}}let C2=0;class rG{constructor(l,z){this.sub=l,this.dep=z,this.version=z.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class OA{constructor(l){this.computed=l,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(l){if(!kf||!Mm||kf===this.computed)return;let z=this.activeLink;if(z===void 0||z.sub!==kf)z=this.activeLink=new rG(kf,this),kf.deps?(z.prevDep=kf.depsTail,kf.depsTail.nextDep=z,kf.depsTail=z):kf.deps=kf.depsTail=z,Ez(z);else if(z.version===-1&&(z.version=this.version,z.nextDep)){const j=z.nextDep;j.prevDep=z.prevDep,z.prevDep&&(z.prevDep.nextDep=j),z.prevDep=kf.depsTail,z.nextDep=void 0,kf.depsTail.nextDep=z,kf.depsTail=z,kf.deps===z&&(kf.deps=j)}return z}trigger(l){this.version++,C2++,this.notify(l)}notify(l){PA();try{for(let z=this.subs;z;z=z.prevSub)z.sub.notify()&&z.sub.dep.notify()}finally{zA()}}}function Ez(d){if(d.dep.sc++,d.sub.flags&4){const l=d.dep.computed;if(l&&!d.dep.subs){l.flags|=20;for(let j=l.deps;j;j=j.nextDep)Ez(j)}const z=d.dep.subs;z!==d&&(d.prevSub=z,z&&(z.nextSub=d)),d.dep.subs=d}}const t4=new WeakMap,xy=Symbol(""),G8=Symbol(""),L2=Symbol("");function Zp(d,l,z){if(Mm&&kf){let j=t4.get(d);j||t4.set(d,j=new Map);let J=j.get(z);J||(j.set(z,J=new OA),J.map=j,J.key=z),J.track()}}function Jg(d,l,z,j,J,mt){const kt=t4.get(d);if(!kt){C2++;return}const Dt=Gt=>{Gt&&Gt.trigger()};if(PA(),l==="clear")kt.forEach(Dt);else{const Gt=ru(d),re=Gt&&LA(z);if(Gt&&z==="length"){const pe=Number(j);kt.forEach((Ne,or)=>{(or==="length"||or===L2||!Sm(or)&&or>=pe)&&Dt(Ne)})}else switch((z!==void 0||kt.has(void 0))&&Dt(kt.get(z)),re&&Dt(kt.get(L2)),l){case"add":Gt?re&&Dt(kt.get("length")):(Dt(kt.get(xy)),i_(d)&&Dt(kt.get(G8)));break;case"delete":Gt||(Dt(kt.get(xy)),i_(d)&&Dt(kt.get(G8)));break;case"set":i_(d)&&Dt(kt.get(xy));break}}zA()}function nG(d,l){const z=t4.get(d);return z&&z.get(l)}function Yx(d){const l=ju(d);return l===d?l:(Zp(l,"iterate",L2),sm(d)?l:l.map(zp))}function A4(d){return Zp(d=ju(d),"iterate",L2),d}const iG={__proto__:null,[Symbol.iterator](){return p8(this,Symbol.iterator,zp)},concat(...d){return Yx(this).concat(...d.map(l=>ru(l)?Yx(l):l))},entries(){return p8(this,"entries",d=>(d[1]=zp(d[1]),d))},every(d,l){return Wg(this,"every",d,l,void 0,arguments)},filter(d,l){return Wg(this,"filter",d,l,z=>z.map(zp),arguments)},find(d,l){return Wg(this,"find",d,l,zp,arguments)},findIndex(d,l){return Wg(this,"findIndex",d,l,void 0,arguments)},findLast(d,l){return Wg(this,"findLast",d,l,zp,arguments)},findLastIndex(d,l){return Wg(this,"findLastIndex",d,l,void 0,arguments)},forEach(d,l){return Wg(this,"forEach",d,l,void 0,arguments)},includes(...d){return m8(this,"includes",d)},indexOf(...d){return m8(this,"indexOf",d)},join(d){return Yx(this).join(d)},lastIndexOf(...d){return m8(this,"lastIndexOf",d)},map(d,l){return Wg(this,"map",d,l,void 0,arguments)},pop(){return Gb(this,"pop")},push(...d){return Gb(this,"push",d)},reduce(d,...l){return kC(this,"reduce",d,l)},reduceRight(d,...l){return kC(this,"reduceRight",d,l)},shift(){return Gb(this,"shift")},some(d,l){return Wg(this,"some",d,l,void 0,arguments)},splice(...d){return Gb(this,"splice",d)},toReversed(){return Yx(this).toReversed()},toSorted(d){return Yx(this).toSorted(d)},toSpliced(...d){return Yx(this).toSpliced(...d)},unshift(...d){return Gb(this,"unshift",d)},values(){return p8(this,"values",zp)}};function p8(d,l,z){const j=A4(d),J=j[l]();return j!==d&&!sm(d)&&(J._next=J.next,J.next=()=>{const mt=J._next();return mt.value&&(mt.value=z(mt.value)),mt}),J}const aG=Array.prototype;function Wg(d,l,z,j,J,mt){const kt=A4(d),Dt=kt!==d&&!sm(d),Gt=kt[l];if(Gt!==aG[l]){const Ne=Gt.apply(d,mt);return Dt?zp(Ne):Ne}let re=z;kt!==d&&(Dt?re=function(Ne,or){return z.call(this,zp(Ne),or,d)}:z.length>2&&(re=function(Ne,or){return z.call(this,Ne,or,d)}));const pe=Gt.call(kt,re,j);return Dt&&J?J(pe):pe}function kC(d,l,z,j){const J=A4(d);let mt=z;return J!==d&&(sm(d)?z.length>3&&(mt=function(kt,Dt,Gt){return z.call(this,kt,Dt,Gt,d)}):mt=function(kt,Dt,Gt){return z.call(this,kt,zp(Dt),Gt,d)}),J[l](mt,...j)}function m8(d,l,z){const j=ju(d);Zp(j,"iterate",L2);const J=j[l](...z);return(J===-1||J===!1)&&RA(z[0])?(z[0]=ju(z[0]),j[l](...z)):J}function Gb(d,l,z=[]){nv(),PA();const j=ju(d)[l].apply(d,z);return zA(),iv(),j}const oG=SA("__proto__,__v_isRef,__isVue"),Cz=new Set(Object.getOwnPropertyNames(Symbol).filter(d=>d!=="arguments"&&d!=="caller").map(d=>Symbol[d]).filter(Sm));function sG(d){Sm(d)||(d=String(d));const l=ju(this);return Zp(l,"has",d),l.hasOwnProperty(d)}class Lz{constructor(l=!1,z=!1){this._isReadonly=l,this._isShallow=z}get(l,z,j){if(z==="__v_skip")return l.__v_skip;const J=this._isReadonly,mt=this._isShallow;if(z==="__v_isReactive")return!J;if(z==="__v_isReadonly")return J;if(z==="__v_isShallow")return mt;if(z==="__v_raw")return j===(J?mt?vG:Oz:mt?Iz:zz).get(l)||Object.getPrototypeOf(l)===Object.getPrototypeOf(j)?l:void 0;const kt=ru(l);if(!J){let Gt;if(kt&&(Gt=iG[z]))return Gt;if(z==="hasOwnProperty")return sG}const Dt=Reflect.get(l,z,Ud(l)?l:j);return(Sm(z)?Cz.has(z):oG(z))||(J||Zp(l,"get",z),mt)?Dt:Ud(Dt)?kt&&LA(z)?Dt:Dt.value:gf(Dt)?J?Fz(Dt):ky(Dt):Dt}}class Pz extends Lz{constructor(l=!1){super(!1,l)}set(l,z,j,J){let mt=l[z];if(!this._isShallow){const Gt=m1(mt);if(!sm(j)&&!m1(j)&&(mt=ju(mt),j=ju(j)),!ru(l)&&Ud(mt)&&!Ud(j))return Gt?!1:(mt.value=j,!0)}const kt=ru(l)&&LA(z)?Number(z)<l.length:Fh(l,z),Dt=Reflect.set(l,z,j,Ud(l)?l:J);return l===ju(J)&&(kt?f1(j,mt)&&Jg(l,"set",z,j):Jg(l,"add",z,j)),Dt}deleteProperty(l,z){const j=Fh(l,z);l[z];const J=Reflect.deleteProperty(l,z);return J&&j&&Jg(l,"delete",z,void 0),J}has(l,z){const j=Reflect.has(l,z);return(!Sm(z)||!Cz.has(z))&&Zp(l,"has",z),j}ownKeys(l){return Zp(l,"iterate",ru(l)?"length":xy),Reflect.ownKeys(l)}}class lG extends Lz{constructor(l=!1){super(!0,l)}set(l,z){return!0}deleteProperty(l,z){return!0}}const uG=new Pz,cG=new lG,hG=new Pz(!0);const Y8=d=>d,b5=d=>Reflect.getPrototypeOf(d);function fG(d,l,z){return function(...j){const J=this.__v_raw,mt=ju(J),kt=i_(mt),Dt=d==="entries"||d===Symbol.iterator&&kt,Gt=d==="keys"&&kt,re=J[d](...j),pe=z?Y8:l?e4:zp;return!l&&Zp(mt,"iterate",Gt?G8:xy),{next(){const{value:Ne,done:or}=re.next();return or?{value:Ne,done:or}:{value:Dt?[pe(Ne[0]),pe(Ne[1])]:pe(Ne),done:or}},[Symbol.iterator](){return this}}}}function w5(d){return function(...l){return d==="delete"?!1:d==="clear"?void 0:this}}function dG(d,l){const z={get(J){const mt=this.__v_raw,kt=ju(mt),Dt=ju(J);d||(f1(J,Dt)&&Zp(kt,"get",J),Zp(kt,"get",Dt));const{has:Gt}=b5(kt),re=l?Y8:d?e4:zp;if(Gt.call(kt,J))return re(mt.get(J));if(Gt.call(kt,Dt))return re(mt.get(Dt));mt!==kt&&mt.get(J)},get size(){const J=this.__v_raw;return!d&&Zp(ju(J),"iterate",xy),Reflect.get(J,"size",J)},has(J){const mt=this.__v_raw,kt=ju(mt),Dt=ju(J);return d||(f1(J,Dt)&&Zp(kt,"has",J),Zp(kt,"has",Dt)),J===Dt?mt.has(J):mt.has(J)||mt.has(Dt)},forEach(J,mt){const kt=this,Dt=kt.__v_raw,Gt=ju(Dt),re=l?Y8:d?e4:zp;return!d&&Zp(Gt,"iterate",xy),Dt.forEach((pe,Ne)=>J.call(mt,re(pe),re(Ne),kt))}};return op(z,d?{add:w5("add"),set:w5("set"),delete:w5("delete"),clear:w5("clear")}:{add(J){!l&&!sm(J)&&!m1(J)&&(J=ju(J));const mt=ju(this);return b5(mt).has.call(mt,J)||(mt.add(J),Jg(mt,"add",J,J)),this},set(J,mt){!l&&!sm(mt)&&!m1(mt)&&(mt=ju(mt));const kt=ju(this),{has:Dt,get:Gt}=b5(kt);let re=Dt.call(kt,J);re||(J=ju(J),re=Dt.call(kt,J));const pe=Gt.call(kt,J);return kt.set(J,mt),re?f1(mt,pe)&&Jg(kt,"set",J,mt):Jg(kt,"add",J,mt),this},delete(J){const mt=ju(this),{has:kt,get:Dt}=b5(mt);let Gt=kt.call(mt,J);Gt||(J=ju(J),Gt=kt.call(mt,J)),Dt&&Dt.call(mt,J);const re=mt.delete(J);return Gt&&Jg(mt,"delete",J,void 0),re},clear(){const J=ju(this),mt=J.size!==0,kt=J.clear();return mt&&Jg(J,"clear",void 0,void 0),kt}}),["keys","values","entries",Symbol.iterator].forEach(J=>{z[J]=fG(J,d,l)}),z}function DA(d,l){const z=dG(d,l);return(j,J,mt)=>J==="__v_isReactive"?!d:J==="__v_isReadonly"?d:J==="__v_raw"?j:Reflect.get(Fh(z,J)&&J in j?z:j,J,mt)}const pG={get:DA(!1,!1)},mG={get:DA(!1,!0)},gG={get:DA(!0,!1)};const zz=new WeakMap,Iz=new WeakMap,Oz=new WeakMap,vG=new WeakMap;function yG(d){switch(d){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xG(d){return d.__v_skip||!Object.isExtensible(d)?0:yG(V$(d))}function ky(d){return m1(d)?d:FA(d,!1,uG,pG,zz)}function Dz(d){return FA(d,!1,hG,mG,Iz)}function Fz(d){return FA(d,!0,cG,gG,Oz)}function FA(d,l,z,j,J){if(!gf(d)||d.__v_raw&&!(l&&d.__v_isReactive))return d;const mt=xG(d);if(mt===0)return d;const kt=J.get(d);if(kt)return kt;const Dt=new Proxy(d,mt===2?j:z);return J.set(d,Dt),Dt}function d1(d){return m1(d)?d1(d.__v_raw):!!(d&&d.__v_isReactive)}function m1(d){return!!(d&&d.__v_isReadonly)}function sm(d){return!!(d&&d.__v_isShallow)}function RA(d){return d?!!d.__v_raw:!1}function ju(d){const l=d&&d.__v_raw;return l?ju(l):d}function BA(d){return!Fh(d,"__v_skip")&&Object.isExtensible(d)&&Z8(d,"__v_skip",!0),d}const zp=d=>gf(d)?ky(d):d,e4=d=>gf(d)?Fz(d):d;function Ud(d){return d?d.__v_isRef===!0:!1}function lo(d){return Rz(d,!1)}function _G(d){return Rz(d,!0)}function Rz(d,l){return Ud(d)?d:new bG(d,l)}class bG{constructor(l,z){this.dep=new OA,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=z?l:ju(l),this._value=z?l:zp(l),this.__v_isShallow=z}get value(){return this.dep.track(),this._value}set value(l){const z=this._rawValue,j=this.__v_isShallow||sm(l)||m1(l);l=j?l:ju(l),f1(l,z)&&(this._rawValue=l,this._value=j?l:zp(l),this.dep.trigger())}}function Ju(d){return Ud(d)?d.value:d}const wG={get:(d,l,z)=>l==="__v_raw"?d:Ju(Reflect.get(d,l,z)),set:(d,l,z,j)=>{const J=d[l];return Ud(J)&&!Ud(z)?(J.value=z,!0):Reflect.set(d,l,z,j)}};function Bz(d){return d1(d)?d:new Proxy(d,wG)}function kG(d){const l=ru(d)?new Array(d.length):{};for(const z in d)l[z]=AG(d,z);return l}class TG{constructor(l,z,j){this._object=l,this._key=z,this._defaultValue=j,this.__v_isRef=!0,this._value=void 0}get value(){const l=this._object[this._key];return this._value=l===void 0?this._defaultValue:l}set value(l){this._object[this._key]=l}get dep(){return nG(ju(this._object),this._key)}}function AG(d,l,z){const j=d[l];return Ud(j)?j:new TG(d,l,z)}class MG{constructor(l,z,j){this.fn=l,this.setter=z,this._value=void 0,this.dep=new OA(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=C2-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!z,this.isSSR=j}notify(){if(this.flags|=16,!(this.flags&8)&&kf!==this)return kz(this,!0),!0}get value(){const l=this.dep.track();return Mz(this),l&&(l.version=this.dep.version),this._value}set value(l){this.setter&&this.setter(l)}}function SG(d,l,z=!1){let j,J;return Uu(d)?j=d:(j=d.get,J=d.set),new MG(j,J,z)}const k5={},r4=new WeakMap;let cy;function EG(d,l=!1,z=cy){if(z){let j=r4.get(z);j||r4.set(z,j=[]),j.push(d)}}function CG(d,l,z=mf){const{immediate:j,deep:J,once:mt,scheduler:kt,augmentJob:Dt,call:Gt}=z,re=ei=>J?ei:sm(ei)||J===!1||J===0?Qg(ei,1):Qg(ei);let pe,Ne,or,_r,Fr=!1,zr=!1;if(Ud(d)?(Ne=()=>d.value,Fr=sm(d)):d1(d)?(Ne=()=>re(d),Fr=!0):ru(d)?(zr=!0,Fr=d.some(ei=>d1(ei)||sm(ei)),Ne=()=>d.map(ei=>{if(Ud(ei))return ei.value;if(d1(ei))return re(ei);if(Uu(ei))return Gt?Gt(ei,2):ei()})):Uu(d)?l?Ne=Gt?()=>Gt(d,2):d:Ne=()=>{if(or){nv();try{or()}finally{iv()}}const ei=cy;cy=pe;try{return Gt?Gt(d,3,[_r]):d(_r)}finally{cy=ei}}:Ne=ug,l&&J){const ei=Ne,jn=J===!0?1/0:J;Ne=()=>Qg(ei(),jn)}const Wr=_z(),An=()=>{pe.stop(),Wr&&Wr.active&&CA(Wr.effects,pe)};if(mt&&l){const ei=l;l=(...jn)=>{ei(...jn),An()}}let Ft=zr?new Array(d.length).fill(k5):k5;const kn=ei=>{if(!(!(pe.flags&1)||!pe.dirty&&!ei))if(l){const jn=pe.run();if(J||Fr||(zr?jn.some((ai,Qi)=>f1(ai,Ft[Qi])):f1(jn,Ft))){or&&or();const ai=cy;cy=pe;try{const Qi=[jn,Ft===k5?void 0:zr&&Ft[0]===k5?[]:Ft,_r];Ft=jn,Gt?Gt(l,3,Qi):l(...Qi)}finally{cy=ai}}}else pe.run()};return Dt&&Dt(kn),pe=new bz(Ne),pe.scheduler=kt?()=>kt(kn,!1):kn,_r=ei=>EG(ei,!1,pe),or=pe.onStop=()=>{const ei=r4.get(pe);if(ei){if(Gt)Gt(ei,4);else for(const jn of ei)jn();r4.delete(pe)}},l?j?kn(!0):Ft=pe.run():kt?kt(kn.bind(null,!0),!0):pe.run(),An.pause=pe.pause.bind(pe),An.resume=pe.resume.bind(pe),An.stop=An,An}function Qg(d,l=1/0,z){if(l<=0||!gf(d)||d.__v_skip||(z=z||new Set,z.has(d)))return d;if(z.add(d),l--,Ud(d))Qg(d.value,l,z);else if(ru(d))for(let j=0;j<d.length;j++)Qg(d[j],l,z);else if(b4(d)||i_(d))d.forEach(j=>{Qg(j,l,z)});else if(pz(d)){for(const j in d)Qg(d[j],l,z);for(const j of Object.getOwnPropertySymbols(d))Object.prototype.propertyIsEnumerable.call(d,j)&&Qg(d[j],l,z)}return d}/**
* @vue/runtime-core v3.5.18
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function G2(d,l,z,j){try{return j?d(...j):d()}catch(J){M4(J,l,z)}}function Em(d,l,z,j){if(Uu(d)){const J=G2(d,l,z,j);return J&&fz(J)&&J.catch(mt=>{M4(mt,l,z)}),J}if(ru(d)){const J=[];for(let mt=0;mt<d.length;mt++)J.push(Em(d[mt],l,z,j));return J}}function M4(d,l,z,j=!0){const J=l?l.vnode:null,{errorHandler:mt,throwUnhandledErrorInProduction:kt}=l&&l.appContext.config||mf;if(l){let Dt=l.parent;const Gt=l.proxy,re=`https://vuejs.org/error-reference/#runtime-${z}`;for(;Dt;){const pe=Dt.ec;if(pe){for(let Ne=0;Ne<pe.length;Ne++)if(pe[Ne](d,Gt,re)===!1)return}Dt=Dt.parent}if(mt){nv(),G2(mt,null,10,[d,Gt,re]),iv();return}}LG(d,z,J,j,kt)}function LG(d,l,z,j=!0,J=!1){if(J)throw d;console.error(d)}const f0=[];let ig=-1;const a_=[];let n1=null,t_=0;const Nz=Promise.resolve();let n4=null;function Z0(d){const l=n4||Nz;return d?l.then(this?d.bind(this):d):l}function PG(d){let l=ig+1,z=f0.length;for(;l<z;){const j=l+z>>>1,J=f0[j],mt=P2(J);mt<d||mt===d&&J.flags&2?l=j+1:z=j}return l}function NA(d){if(!(d.flags&1)){const l=P2(d),z=f0[f0.length-1];!z||!(d.flags&2)&&l>=P2(z)?f0.push(d):f0.splice(PG(l),0,d),d.flags|=1,jz()}}function jz(){n4||(n4=Nz.then(Vz))}function zG(d){ru(d)?a_.push(...d):n1&&d.id===-1?n1.splice(t_+1,0,d):d.flags&1||(a_.push(d),d.flags|=1),jz()}function TC(d,l,z=ig+1){for(;z<f0.length;z++){const j=f0[z];if(j&&j.flags&2){if(d&&j.id!==d.uid)continue;f0.splice(z,1),z--,j.flags&4&&(j.flags&=-2),j(),j.flags&4||(j.flags&=-2)}}}function Uz(d){if(a_.length){const l=[...new Set(a_)].sort((z,j)=>P2(z)-P2(j));if(a_.length=0,n1){n1.push(...l);return}for(n1=l,t_=0;t_<n1.length;t_++){const z=n1[t_];z.flags&4&&(z.flags&=-2),z.flags&8||z(),z.flags&=-2}n1=null,t_=0}}const P2=d=>d.id==null?d.flags&2?-1:1/0:d.id;function Vz(d){try{for(ig=0;ig<f0.length;ig++){const l=f0[ig];l&&!(l.flags&8)&&(l.flags&4&&(l.flags&=-2),G2(l,l.i,l.i?15:14),l.flags&4||(l.flags&=-2))}}finally{for(;ig<f0.length;ig++){const l=f0[ig];l&&(l.flags&=-2)}ig=-1,f0.length=0,Uz(),n4=null,(f0.length||a_.length)&&Vz()}}let Ip=null,Hz=null;function i4(d){const l=Ip;return Ip=d,Hz=d&&d.type.__scopeId||null,l}function Y2(d,l=Ip,z){if(!l||d._n)return d;const j=(...J)=>{j._d&&BC(-1);const mt=i4(l);let kt;try{kt=d(...J)}finally{i4(mt),j._d&&BC(1)}return kt};return j._n=!0,j._c=!0,j._d=!0,j}function $p(d,l){if(Ip===null)return d;const z=z4(Ip),j=d.dirs||(d.dirs=[]);for(let J=0;J<l.length;J++){let[mt,kt,Dt,Gt=mf]=l[J];mt&&(Uu(mt)&&(mt={mounted:mt,updated:mt}),mt.deep&&Qg(kt),j.push({dir:mt,instance:z,value:kt,oldValue:void 0,arg:Dt,modifiers:Gt}))}return d}function ny(d,l,z,j){const J=d.dirs,mt=l&&l.dirs;for(let kt=0;kt<J.length;kt++){const Dt=J[kt];mt&&(Dt.oldValue=mt[kt].value);let Gt=Dt.dir[j];Gt&&(nv(),Em(Gt,z,8,[d.el,Dt,d,l]),iv())}}const Wz=Symbol("_vte"),qz=d=>d.__isTeleport,y2=d=>d&&(d.disabled||d.disabled===""),AC=d=>d&&(d.defer||d.defer===""),MC=d=>typeof SVGElement<"u"&&d instanceof SVGElement,SC=d=>typeof MathMLElement=="function"&&d instanceof MathMLElement,K8=(d,l)=>{const z=d&&d.to;return sd(z)?l?l(z):null:z},Zz={name:"Teleport",__isTeleport:!0,process(d,l,z,j,J,mt,kt,Dt,Gt,re){const{mc:pe,pc:Ne,pbc:or,o:{insert:_r,querySelector:Fr,createText:zr,createComment:Wr}}=re,An=y2(l.props);let{shapeFlag:Ft,children:kn,dynamicChildren:ei}=l;if(d==null){const jn=l.el=zr(""),ai=l.anchor=zr("");_r(jn,z,j),_r(ai,z,j);const Qi=(un,ia)=>{Ft&16&&(J&&J.isCE&&(J.ce._teleportTarget=un),pe(kn,un,ia,J,mt,kt,Dt,Gt))},Gi=()=>{const un=l.target=K8(l.props,Fr),ia=Gz(un,l,zr,_r);un&&(kt!=="svg"&&MC(un)?kt="svg":kt!=="mathml"&&SC(un)&&(kt="mathml"),An||(Qi(un,ia),V5(l,!1)))};An&&(Qi(z,ai),V5(l,!0)),AC(l.props)?(l.el.__isMounted=!1,c0(()=>{Gi(),delete l.el.__isMounted},mt)):Gi()}else{if(AC(l.props)&&d.el.__isMounted===!1){c0(()=>{Zz.process(d,l,z,j,J,mt,kt,Dt,Gt,re)},mt);return}l.el=d.el,l.targetStart=d.targetStart;const jn=l.anchor=d.anchor,ai=l.target=d.target,Qi=l.targetAnchor=d.targetAnchor,Gi=y2(d.props),un=Gi?z:ai,ia=Gi?jn:Qi;if(kt==="svg"||MC(ai)?kt="svg":(kt==="mathml"||SC(ai))&&(kt="mathml"),ei?(or(d.dynamicChildren,ei,un,J,mt,kt,Dt),WA(d,l,!0)):Gt||Ne(d,l,un,ia,J,mt,kt,Dt,!1),An)Gi?l.props&&d.props&&l.props.to!==d.props.to&&(l.props.to=d.props.to):T5(l,z,jn,re,1);else if((l.props&&l.props.to)!==(d.props&&d.props.to)){const fa=l.target=K8(l.props,Fr);fa&&T5(l,fa,null,re,0)}else Gi&&T5(l,ai,Qi,re,1);V5(l,An)}},remove(d,l,z,{um:j,o:{remove:J}},mt){const{shapeFlag:kt,children:Dt,anchor:Gt,targetStart:re,targetAnchor:pe,target:Ne,props:or}=d;if(Ne&&(J(re),J(pe)),mt&&J(Gt),kt&16){const _r=mt||!y2(or);for(let Fr=0;Fr<Dt.length;Fr++){const zr=Dt[Fr];j(zr,l,z,_r,!!zr.dynamicChildren)}}},move:T5,hydrate:IG};function T5(d,l,z,{o:{insert:j},m:J},mt=2){mt===0&&j(d.targetAnchor,l,z);const{el:kt,anchor:Dt,shapeFlag:Gt,children:re,props:pe}=d,Ne=mt===2;if(Ne&&j(kt,l,z),(!Ne||y2(pe))&&Gt&16)for(let or=0;or<re.length;or++)J(re[or],l,z,2);Ne&&j(Dt,l,z)}function IG(d,l,z,j,J,mt,{o:{nextSibling:kt,parentNode:Dt,querySelector:Gt,insert:re,createText:pe}},Ne){const or=l.target=K8(l.props,Gt);if(or){const _r=y2(l.props),Fr=or._lpa||or.firstChild;if(l.shapeFlag&16)if(_r)l.anchor=Ne(kt(d),l,Dt(d),z,j,J,mt),l.targetStart=Fr,l.targetAnchor=Fr&&kt(Fr);else{l.anchor=kt(d);let zr=Fr;for(;zr;){if(zr&&zr.nodeType===8){if(zr.data==="teleport start anchor")l.targetStart=zr;else if(zr.data==="teleport anchor"){l.targetAnchor=zr,or._lpa=l.targetAnchor&&kt(l.targetAnchor);break}}zr=kt(zr)}l.targetAnchor||Gz(or,l,pe,re),Ne(Fr&&kt(Fr),l,or,z,j,J,mt)}V5(l,_r)}return l.anchor&&kt(l.anchor)}const $z=Zz;function V5(d,l){const z=d.ctx;if(z&&z.ut){let j,J;for(l?(j=d.el,J=d.anchor):(j=d.targetStart,J=d.targetAnchor);j&&j!==J;)j.nodeType===1&&j.setAttribute("data-v-owner",z.uid),j=j.nextSibling;z.ut()}}function Gz(d,l,z,j){const J=l.targetStart=z(""),mt=l.targetAnchor=z("");return J[Wz]=mt,d&&(j(J,d),j(mt,d)),mt}const i1=Symbol("_leaveCb"),A5=Symbol("_enterCb");function Yz(){const d={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return t0(()=>{d.isMounted=!0}),dg(()=>{d.isUnmounting=!0}),d}const im=[Function,Array],Kz={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:im,onEnter:im,onAfterEnter:im,onEnterCancelled:im,onBeforeLeave:im,onLeave:im,onAfterLeave:im,onLeaveCancelled:im,onBeforeAppear:im,onAppear:im,onAfterAppear:im,onAppearCancelled:im},Xz=d=>{const l=d.subTree;return l.component?Xz(l.component):l},OG={name:"BaseTransition",props:Kz,setup(d,{slots:l}){const z=P4(),j=Yz();return()=>{const J=l.default&&jA(l.default(),!0);if(!J||!J.length)return;const mt=Jz(J),kt=ju(d),{mode:Dt}=kt;if(j.isLeaving)return g8(mt);const Gt=EC(mt);if(!Gt)return g8(mt);let re=z2(Gt,kt,j,z,Ne=>re=Ne);Gt.type!==Gp&&Ty(Gt,re);let pe=z.subTree&&EC(z.subTree);if(pe&&pe.type!==Gp&&!py(Gt,pe)&&Xz(z).type!==Gp){let Ne=z2(pe,kt,j,z);if(Ty(pe,Ne),Dt==="out-in"&&Gt.type!==Gp)return j.isLeaving=!0,Ne.afterLeave=()=>{j.isLeaving=!1,z.job.flags&8||z.update(),delete Ne.afterLeave,pe=void 0},g8(mt);Dt==="in-out"&&Gt.type!==Gp?Ne.delayLeave=(or,_r,Fr)=>{const zr=Qz(j,pe);zr[String(pe.key)]=pe,or[i1]=()=>{_r(),or[i1]=void 0,delete re.delayedLeave,pe=void 0},re.delayedLeave=()=>{Fr(),delete re.delayedLeave,pe=void 0}}:pe=void 0}else pe&&(pe=void 0);return mt}}};function Jz(d){let l=d[0];if(d.length>1){for(const z of d)if(z.type!==Gp){l=z;break}}return l}const DG=OG;function Qz(d,l){const{leavingVNodes:z}=d;let j=z.get(l.type);return j||(j=Object.create(null),z.set(l.type,j)),j}function z2(d,l,z,j,J){const{appear:mt,mode:kt,persisted:Dt=!1,onBeforeEnter:Gt,onEnter:re,onAfterEnter:pe,onEnterCancelled:Ne,onBeforeLeave:or,onLeave:_r,onAfterLeave:Fr,onLeaveCancelled:zr,onBeforeAppear:Wr,onAppear:An,onAfterAppear:Ft,onAppearCancelled:kn}=l,ei=String(d.key),jn=Qz(z,d),ai=(un,ia)=>{un&&Em(un,j,9,ia)},Qi=(un,ia)=>{const fa=ia[1];ai(un,ia),ru(un)?un.every(Li=>Li.length<=1)&&fa():un.length<=1&&fa()},Gi={mode:kt,persisted:Dt,beforeEnter(un){let ia=Gt;if(!z.isMounted)if(mt)ia=Wr||Gt;else return;un[i1]&&un[i1](!0);const fa=jn[ei];fa&&py(d,fa)&&fa.el[i1]&&fa.el[i1](),ai(ia,[un])},enter(un){let ia=re,fa=pe,Li=Ne;if(!z.isMounted)if(mt)ia=An||re,fa=Ft||pe,Li=kn||Ne;else return;let yi=!1;const ra=un[A5]=Da=>{yi||(yi=!0,Da?ai(Li,[un]):ai(fa,[un]),Gi.delayedLeave&&Gi.delayedLeave(),un[A5]=void 0)};ia?Qi(ia,[un,ra]):ra()},leave(un,ia){const fa=String(d.key);if(un[A5]&&un[A5](!0),z.isUnmounting)return ia();ai(or,[un]);let Li=!1;const yi=un[i1]=ra=>{Li||(Li=!0,ia(),ra?ai(zr,[un]):ai(Fr,[un]),un[i1]=void 0,jn[fa]===d&&delete jn[fa])};jn[fa]=d,_r?Qi(_r,[un,yi]):yi()},clone(un){const ia=z2(un,l,z,j,J);return J&&J(ia),ia}};return Gi}function g8(d){if(S4(d))return d=g1(d),d.children=null,d}function EC(d){if(!S4(d))return qz(d.type)&&d.children?Jz(d.children):d;if(d.component)return d.component.subTree;const{shapeFlag:l,children:z}=d;if(z){if(l&16)return z[0];if(l&32&&Uu(z.default))return z.default()}}function Ty(d,l){d.shapeFlag&6&&d.component?(d.transition=l,Ty(d.component.subTree,l)):d.shapeFlag&128?(d.ssContent.transition=l.clone(d.ssContent),d.ssFallback.transition=l.clone(d.ssFallback)):d.transition=l}function jA(d,l=!1,z){let j=[],J=0;for(let mt=0;mt<d.length;mt++){let kt=d[mt];const Dt=z==null?kt.key:String(z)+String(kt.key!=null?kt.key:mt);kt.type===Ou?(kt.patchFlag&128&&J++,j=j.concat(jA(kt.children,l,Dt))):(l||kt.type!==Gp)&&j.push(Dt!=null?g1(kt,{key:Dt}):kt)}if(J>1)for(let mt=0;mt<j.length;mt++)j[mt].patchFlag=-2;return j}/*! #__NO_SIDE_EFFECTS__ */function Th(d,l){return Uu(d)?op({name:d.name},l,{setup:d}):d}function tI(d){d.ids=[d.ids[0]+d.ids[2]+++"-",0,0]}function x2(d,l,z,j,J=!1){if(ru(d)){d.forEach((Fr,zr)=>x2(Fr,l&&(ru(l)?l[zr]:l),z,j,J));return}if(o_(j)&&!J){j.shapeFlag&512&&j.type.__asyncResolved&&j.component.subTree.component&&x2(d,l,z,j.component.subTree);return}const mt=j.shapeFlag&4?z4(j.component):j.el,kt=J?null:mt,{i:Dt,r:Gt}=d,re=l&&l.r,pe=Dt.refs===mf?Dt.refs={}:Dt.refs,Ne=Dt.setupState,or=ju(Ne),_r=Ne===mf?()=>!1:Fr=>Fh(or,Fr);if(re!=null&&re!==Gt&&(sd(re)?(pe[re]=null,_r(re)&&(Ne[re]=null)):Ud(re)&&(re.value=null)),Uu(Gt))G2(Gt,Dt,12,[kt,pe]);else{const Fr=sd(Gt),zr=Ud(Gt);if(Fr||zr){const Wr=()=>{if(d.f){const An=Fr?_r(Gt)?Ne[Gt]:pe[Gt]:Gt.value;J?ru(An)&&CA(An,mt):ru(An)?An.includes(mt)||An.push(mt):Fr?(pe[Gt]=[mt],_r(Gt)&&(Ne[Gt]=pe[Gt])):(Gt.value=[mt],d.k&&(pe[d.k]=Gt.value))}else Fr?(pe[Gt]=kt,_r(Gt)&&(Ne[Gt]=kt)):zr&&(Gt.value=kt,d.k&&(pe[d.k]=kt))};kt?(Wr.id=-1,c0(Wr,z)):Wr()}}}T4().requestIdleCallback;T4().cancelIdleCallback;const o_=d=>!!d.type.__asyncLoader,S4=d=>d.type.__isKeepAlive;function FG(d,l){eI(d,"a",l)}function RG(d,l){eI(d,"da",l)}function eI(d,l,z=Yp){const j=d.__wdc||(d.__wdc=()=>{let J=z;for(;J;){if(J.isDeactivated)return;J=J.parent}return d()});if(E4(l,j,z),z){let J=z.parent;for(;J&&J.parent;)S4(J.parent.vnode)&&BG(j,l,z,J),J=J.parent}}function BG(d,l,z,j){const J=E4(l,d,j,!0);K2(()=>{CA(j[l],J)},z)}function E4(d,l,z=Yp,j=!1){if(z){const J=z[d]||(z[d]=[]),mt=l.__weh||(l.__weh=(...kt)=>{nv();const Dt=X2(z),Gt=Em(l,z,d,kt);return Dt(),iv(),Gt});return j?J.unshift(mt):J.push(mt),mt}}const ov=d=>(l,z=Yp)=>{(!D2||d==="sp")&&E4(d,(...j)=>l(...j),z)},NG=ov("bm"),t0=ov("m"),jG=ov("bu"),rI=ov("u"),dg=ov("bum"),K2=ov("um"),UG=ov("sp"),VG=ov("rtg"),HG=ov("rtc");function WG(d,l=Yp){E4("ec",d,l)}const nI="components";function UA(d,l){return aI(nI,d,!0,l)||d}const iI=Symbol.for("v-ndc");function a4(d){return sd(d)?aI(nI,d,!1)||d:d||iI}function aI(d,l,z=!0,j=!1){const J=Ip||Yp;if(J){const mt=J.type;{const Dt=zY(mt,!1);if(Dt&&(Dt===l||Dt===cm(l)||Dt===k4(cm(l))))return mt}const kt=CC(J[d]||mt[d],l)||CC(J.appContext[d],l);return!kt&&j?mt:kt}}function CC(d,l){return d&&(d[l]||d[cm(l)]||d[k4(cm(l))])}function sf(d,l,z,j){let J;const mt=z,kt=ru(d);if(kt||sd(d)){const Dt=kt&&d1(d);let Gt=!1,re=!1;Dt&&(Gt=!sm(d),re=m1(d),d=A4(d)),J=new Array(d.length);for(let pe=0,Ne=d.length;pe<Ne;pe++)J[pe]=l(Gt?re?e4(zp(d[pe])):zp(d[pe]):d[pe],pe,void 0,mt)}else if(typeof d=="number"){J=new Array(d);for(let Dt=0;Dt<d;Dt++)J[Dt]=l(Dt+1,Dt,void 0,mt)}else if(gf(d))if(d[Symbol.iterator])J=Array.from(d,(Dt,Gt)=>l(Dt,Gt,void 0,mt));else{const Dt=Object.keys(d);J=new Array(Dt.length);for(let Gt=0,re=Dt.length;Gt<re;Gt++){const pe=Dt[Gt];J[Gt]=l(d[pe],pe,Gt,mt)}}else J=[];return J}function qG(d,l,z={},j,J){if(Ip.ce||Ip.parent&&o_(Ip.parent)&&Ip.parent.ce)return z.name=l,zi(),hm(Ou,null,[gu("slot",z,j)],64);let mt=d[l];mt&&mt._c&&(mt._d=!1),zi();const kt=mt&&oI(mt(z)),Dt=z.key||kt&&kt.key,Gt=hm(Ou,{key:(Dt&&!Sm(Dt)?Dt:`_${l}`)+(!kt&&j?"_fb":"")},kt||[],kt&&d._===1?64:-2);return mt&&mt._c&&(mt._d=!0),Gt}function oI(d){return d.some(l=>O2(l)?!(l.type===Gp||l.type===Ou&&!oI(l.children)):!0)?d:null}const X8=d=>d?AI(d)?z4(d):X8(d.parent):null,_2=op(Object.create(null),{$:d=>d,$el:d=>d.vnode.el,$data:d=>d.data,$props:d=>d.props,$attrs:d=>d.attrs,$slots:d=>d.slots,$refs:d=>d.refs,$parent:d=>X8(d.parent),$root:d=>X8(d.root),$host:d=>d.ce,$emit:d=>d.emit,$options:d=>lI(d),$forceUpdate:d=>d.f||(d.f=()=>{NA(d.update)}),$nextTick:d=>d.n||(d.n=Z0.bind(d.proxy)),$watch:d=>dY.bind(d)}),v8=(d,l)=>d!==mf&&!d.__isScriptSetup&&Fh(d,l),ZG={get({_:d},l){if(l==="__v_skip")return!0;const{ctx:z,setupState:j,data:J,props:mt,accessCache:kt,type:Dt,appContext:Gt}=d;let re;if(l[0]!=="$"){const _r=kt[l];if(_r!==void 0)switch(_r){case 1:return j[l];case 2:return J[l];case 4:return z[l];case 3:return mt[l]}else{if(v8(j,l))return kt[l]=1,j[l];if(J!==mf&&Fh(J,l))return kt[l]=2,J[l];if((re=d.propsOptions[0])&&Fh(re,l))return kt[l]=3,mt[l];if(z!==mf&&Fh(z,l))return kt[l]=4,z[l];J8&&(kt[l]=0)}}const pe=_2[l];let Ne,or;if(pe)return l==="$attrs"&&Zp(d.attrs,"get",""),pe(d);if((Ne=Dt.__cssModules)&&(Ne=Ne[l]))return Ne;if(z!==mf&&Fh(z,l))return kt[l]=4,z[l];if(or=Gt.config.globalProperties,Fh(or,l))return or[l]},set({_:d},l,z){const{data:j,setupState:J,ctx:mt}=d;return v8(J,l)?(J[l]=z,!0):j!==mf&&Fh(j,l)?(j[l]=z,!0):Fh(d.props,l)||l[0]==="$"&&l.slice(1)in d?!1:(mt[l]=z,!0)},has({_:{data:d,setupState:l,accessCache:z,ctx:j,appContext:J,propsOptions:mt}},kt){let Dt;return!!z[kt]||d!==mf&&Fh(d,kt)||v8(l,kt)||(Dt=mt[0])&&Fh(Dt,kt)||Fh(j,kt)||Fh(_2,kt)||Fh(J.config.globalProperties,kt)},defineProperty(d,l,z){return z.get!=null?d._.accessCache[l]=0:Fh(z,"value")&&this.set(d,l,z.value,null),Reflect.defineProperty(d,l,z)}};function LC(d){return ru(d)?d.reduce((l,z)=>(l[z]=null,l),{}):d}let J8=!0;function $G(d){const l=lI(d),z=d.proxy,j=d.ctx;J8=!1,l.beforeCreate&&PC(l.beforeCreate,d,"bc");const{data:J,computed:mt,methods:kt,watch:Dt,provide:Gt,inject:re,created:pe,beforeMount:Ne,mounted:or,beforeUpdate:_r,updated:Fr,activated:zr,deactivated:Wr,beforeDestroy:An,beforeUnmount:Ft,destroyed:kn,unmounted:ei,render:jn,renderTracked:ai,renderTriggered:Qi,errorCaptured:Gi,serverPrefetch:un,expose:ia,inheritAttrs:fa,components:Li,directives:yi,filters:ra}=l;if(re&&GG(re,j,null),kt)for(const Ei in kt){const Va=kt[Ei];Uu(Va)&&(j[Ei]=Va.bind(z))}if(J){const Ei=J.call(z,z);gf(Ei)&&(d.data=ky(Ei))}if(J8=!0,mt)for(const Ei in mt){const Va=mt[Ei],ss=Uu(Va)?Va.bind(z,z):Uu(Va.get)?Va.get.bind(z,z):ug,mo=!Uu(Va)&&Uu(Va.set)?Va.set.bind(z):ug,ko=Yo({get:ss,set:mo});Object.defineProperty(j,Ei,{enumerable:!0,configurable:!0,get:()=>ko.value,set:pl=>ko.value=pl})}if(Dt)for(const Ei in Dt)sI(Dt[Ei],j,z,Ei);if(Gt){const Ei=Uu(Gt)?Gt.call(z):Gt;Reflect.ownKeys(Ei).forEach(Va=>{H5(Va,Ei[Va])})}pe&&PC(pe,d,"c");function Ni(Ei,Va){ru(Va)?Va.forEach(ss=>Ei(ss.bind(z))):Va&&Ei(Va.bind(z))}if(Ni(NG,Ne),Ni(t0,or),Ni(jG,_r),Ni(rI,Fr),Ni(FG,zr),Ni(RG,Wr),Ni(WG,Gi),Ni(HG,ai),Ni(VG,Qi),Ni(dg,Ft),Ni(K2,ei),Ni(UG,un),ru(ia))if(ia.length){const Ei=d.exposed||(d.exposed={});ia.forEach(Va=>{Object.defineProperty(Ei,Va,{get:()=>z[Va],set:ss=>z[Va]=ss,enumerable:!0})})}else d.exposed||(d.exposed={});jn&&d.render===ug&&(d.render=jn),fa!=null&&(d.inheritAttrs=fa),Li&&(d.components=Li),yi&&(d.directives=yi),un&&tI(d)}function GG(d,l,z=ug){ru(d)&&(d=Q8(d));for(const j in d){const J=d[j];let mt;gf(J)?"default"in J?mt=lm(J.from||j,J.default,!0):mt=lm(J.from||j):mt=lm(J),Ud(mt)?Object.defineProperty(l,j,{enumerable:!0,configurable:!0,get:()=>mt.value,set:kt=>mt.value=kt}):l[j]=mt}}function PC(d,l,z){Em(ru(d)?d.map(j=>j.bind(l.proxy)):d.bind(l.proxy),l,z)}function sI(d,l,z,j){let J=j.includes(".")?_I(z,j):()=>z[j];if(sd(d)){const mt=l[d];Uu(mt)&&um(J,mt)}else if(Uu(d))um(J,d.bind(z));else if(gf(d))if(ru(d))d.forEach(mt=>sI(mt,l,z,j));else{const mt=Uu(d.handler)?d.handler.bind(z):l[d.handler];Uu(mt)&&um(J,mt,d)}}function lI(d){const l=d.type,{mixins:z,extends:j}=l,{mixins:J,optionsCache:mt,config:{optionMergeStrategies:kt}}=d.appContext,Dt=mt.get(l);let Gt;return Dt?Gt=Dt:!J.length&&!z&&!j?Gt=l:(Gt={},J.length&&J.forEach(re=>o4(Gt,re,kt,!0)),o4(Gt,l,kt)),gf(l)&&mt.set(l,Gt),Gt}function o4(d,l,z,j=!1){const{mixins:J,extends:mt}=l;mt&&o4(d,mt,z,!0),J&&J.forEach(kt=>o4(d,kt,z,!0));for(const kt in l)if(!(j&&kt==="expose")){const Dt=YG[kt]||z&&z[kt];d[kt]=Dt?Dt(d[kt],l[kt]):l[kt]}return d}const YG={data:zC,props:IC,emits:IC,methods:u2,computed:u2,beforeCreate:u0,created:u0,beforeMount:u0,mounted:u0,beforeUpdate:u0,updated:u0,beforeDestroy:u0,beforeUnmount:u0,destroyed:u0,unmounted:u0,activated:u0,deactivated:u0,errorCaptured:u0,serverPrefetch:u0,components:u2,directives:u2,watch:XG,provide:zC,inject:KG};function zC(d,l){return l?d?function(){return op(Uu(d)?d.call(this,this):d,Uu(l)?l.call(this,this):l)}:l:d}function KG(d,l){return u2(Q8(d),Q8(l))}function Q8(d){if(ru(d)){const l={};for(let z=0;z<d.length;z++)l[d[z]]=d[z];return l}return d}function u0(d,l){return d?[...new Set([].concat(d,l))]:l}function u2(d,l){return d?op(Object.create(null),d,l):l}function IC(d,l){return d?ru(d)&&ru(l)?[...new Set([...d,...l])]:op(Object.create(null),LC(d),LC(l??{})):l}function XG(d,l){if(!d)return l;if(!l)return d;const z=op(Object.create(null),d);for(const j in l)z[j]=u0(d[j],l[j]);return z}function uI(){return{app:null,config:{isNativeTag:j$,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let JG=0;function QG(d,l){return function(j,J=null){Uu(j)||(j=op({},j)),J!=null&&!gf(J)&&(J=null);const mt=uI(),kt=new WeakSet,Dt=[];let Gt=!1;const re=mt.app={_uid:JG++,_component:j,_props:J,_container:null,_context:mt,_instance:null,version:OY,get config(){return mt.config},set config(pe){},use(pe,...Ne){return kt.has(pe)||(pe&&Uu(pe.install)?(kt.add(pe),pe.install(re,...Ne)):Uu(pe)&&(kt.add(pe),pe(re,...Ne))),re},mixin(pe){return mt.mixins.includes(pe)||mt.mixins.push(pe),re},component(pe,Ne){return Ne?(mt.components[pe]=Ne,re):mt.components[pe]},directive(pe,Ne){return Ne?(mt.directives[pe]=Ne,re):mt.directives[pe]},mount(pe,Ne,or){if(!Gt){const _r=re._ceVNode||gu(j,J);return _r.appContext=mt,or===!0?or="svg":or===!1&&(or=void 0),d(_r,pe,or),Gt=!0,re._container=pe,pe.__vue_app__=re,z4(_r.component)}},onUnmount(pe){Dt.push(pe)},unmount(){Gt&&(Em(Dt,re._instance,16),d(null,re._container),delete re._container.__vue_app__)},provide(pe,Ne){return mt.provides[pe]=Ne,re},runWithContext(pe){const Ne=_y;_y=re;try{return pe()}finally{_y=Ne}}};return re}}let _y=null;function H5(d,l){if(Yp){let z=Yp.provides;const j=Yp.parent&&Yp.parent.provides;j===z&&(z=Yp.provides=Object.create(j)),z[d]=l}}function lm(d,l,z=!1){const j=P4();if(j||_y){let J=_y?_y._context.provides:j?j.parent==null||j.ce?j.vnode.appContext&&j.vnode.appContext.provides:j.parent.provides:void 0;if(J&&d in J)return J[d];if(arguments.length>1)return z&&Uu(l)?l.call(j&&j.proxy):l}}function tY(){return!!(P4()||_y)}const cI={},hI=()=>Object.create(cI),fI=d=>Object.getPrototypeOf(d)===cI;function eY(d,l,z,j=!1){const J={},mt=hI();d.propsDefaults=Object.create(null),dI(d,l,J,mt);for(const kt in d.propsOptions[0])kt in J||(J[kt]=void 0);z?d.props=j?J:Dz(J):d.type.props?d.props=J:d.props=mt,d.attrs=mt}function rY(d,l,z,j){const{props:J,attrs:mt,vnode:{patchFlag:kt}}=d,Dt=ju(J),[Gt]=d.propsOptions;let re=!1;if((j||kt>0)&&!(kt&16)){if(kt&8){const pe=d.vnode.dynamicProps;for(let Ne=0;Ne<pe.length;Ne++){let or=pe[Ne];if(C4(d.emitsOptions,or))continue;const _r=l[or];if(Gt)if(Fh(mt,or))_r!==mt[or]&&(mt[or]=_r,re=!0);else{const Fr=cm(or);J[Fr]=tA(Gt,Dt,Fr,_r,d,!1)}else _r!==mt[or]&&(mt[or]=_r,re=!0)}}}else{dI(d,l,J,mt)&&(re=!0);let pe;for(const Ne in Dt)(!l||!Fh(l,Ne)&&((pe=Ey(Ne))===Ne||!Fh(l,pe)))&&(Gt?z&&(z[Ne]!==void 0||z[pe]!==void 0)&&(J[Ne]=tA(Gt,Dt,Ne,void 0,d,!0)):delete J[Ne]);if(mt!==Dt)for(const Ne in mt)(!l||!Fh(l,Ne))&&(delete mt[Ne],re=!0)}re&&Jg(d.attrs,"set","")}function dI(d,l,z,j){const[J,mt]=d.propsOptions;let kt=!1,Dt;if(l)for(let Gt in l){if(m2(Gt))continue;const re=l[Gt];let pe;J&&Fh(J,pe=cm(Gt))?!mt||!mt.includes(pe)?z[pe]=re:(Dt||(Dt={}))[pe]=re:C4(d.emitsOptions,Gt)||(!(Gt in j)||re!==j[Gt])&&(j[Gt]=re,kt=!0)}if(mt){const Gt=ju(z),re=Dt||mf;for(let pe=0;pe<mt.length;pe++){const Ne=mt[pe];z[Ne]=tA(J,Gt,Ne,re[Ne],d,!Fh(re,Ne))}}return kt}function tA(d,l,z,j,J,mt){const kt=d[z];if(kt!=null){const Dt=Fh(kt,"default");if(Dt&&j===void 0){const Gt=kt.default;if(kt.type!==Function&&!kt.skipFactory&&Uu(Gt)){const{propsDefaults:re}=J;if(z in re)j=re[z];else{const pe=X2(J);j=re[z]=Gt.call(null,l),pe()}}else j=Gt;J.ce&&J.ce._setProp(z,j)}kt[0]&&(mt&&!Dt?j=!1:kt[1]&&(j===""||j===Ey(z))&&(j=!0))}return j}const nY=new WeakMap;function pI(d,l,z=!1){const j=z?nY:l.propsCache,J=j.get(d);if(J)return J;const mt=d.props,kt={},Dt=[];let Gt=!1;if(!Uu(d)){const pe=Ne=>{Gt=!0;const[or,_r]=pI(Ne,l,!0);op(kt,or),_r&&Dt.push(..._r)};!z&&l.mixins.length&&l.mixins.forEach(pe),d.extends&&pe(d.extends),d.mixins&&d.mixins.forEach(pe)}if(!mt&&!Gt)return gf(d)&&j.set(d,n_),n_;if(ru(mt))for(let pe=0;pe<mt.length;pe++){const Ne=cm(mt[pe]);OC(Ne)&&(kt[Ne]=mf)}else if(mt)for(const pe in mt){const Ne=cm(pe);if(OC(Ne)){const or=mt[pe],_r=kt[Ne]=ru(or)||Uu(or)?{type:or}:op({},or),Fr=_r.type;let zr=!1,Wr=!0;if(ru(Fr))for(let An=0;An<Fr.length;++An){const Ft=Fr[An],kn=Uu(Ft)&&Ft.name;if(kn==="Boolean"){zr=!0;break}else kn==="String"&&(Wr=!1)}else zr=Uu(Fr)&&Fr.name==="Boolean";_r[0]=zr,_r[1]=Wr,(zr||Fh(_r,"default"))&&Dt.push(Ne)}}const re=[kt,Dt];return gf(d)&&j.set(d,re),re}function OC(d){return d[0]!=="$"&&!m2(d)}const VA=d=>d==="_"||d==="__"||d==="_ctx"||d==="$stable",HA=d=>ru(d)?d.map(og):[og(d)],iY=(d,l,z)=>{if(l._n)return l;const j=Y2((...J)=>HA(l(...J)),z);return j._c=!1,j},mI=(d,l,z)=>{const j=d._ctx;for(const J in d){if(VA(J))continue;const mt=d[J];if(Uu(mt))l[J]=iY(J,mt,j);else if(mt!=null){const kt=HA(mt);l[J]=()=>kt}}},gI=(d,l)=>{const z=HA(l);d.slots.default=()=>z},vI=(d,l,z)=>{for(const j in l)(z||!VA(j))&&(d[j]=l[j])},aY=(d,l,z)=>{const j=d.slots=hI();if(d.vnode.shapeFlag&32){const J=l.__;J&&Z8(j,"__",J,!0);const mt=l._;mt?(vI(j,l,z),z&&Z8(j,"_",mt,!0)):mI(l,j)}else l&&gI(d,l)},oY=(d,l,z)=>{const{vnode:j,slots:J}=d;let mt=!0,kt=mf;if(j.shapeFlag&32){const Dt=l._;Dt?z&&Dt===1?mt=!1:vI(J,l,z):(mt=!l.$stable,mI(l,J)),kt=l}else l&&(gI(d,l),kt={default:1});if(mt)for(const Dt in J)!VA(Dt)&&kt[Dt]==null&&delete J[Dt]},c0=_Y;function sY(d){return lY(d)}function lY(d,l){const z=T4();z.__VUE__=!0;const{insert:j,remove:J,patchProp:mt,createElement:kt,createText:Dt,createComment:Gt,setText:re,setElementText:pe,parentNode:Ne,nextSibling:or,setScopeId:_r=ug,insertStaticContent:Fr}=d,zr=(gi,bi,li,co=null,vo=null,yo=null,ms=void 0,ns=null,Ko=!!bi.dynamicChildren)=>{if(gi===bi)return;gi&&!py(gi,bi)&&(co=Ea(gi),pl(gi,vo,yo,!0),gi=null),bi.patchFlag===-2&&(Ko=!1,bi.dynamicChildren=null);const{type:Oo,ref:wl,shapeFlag:ws}=bi;switch(Oo){case L4:Wr(gi,bi,li,co);break;case Gp:An(gi,bi,li,co);break;case W5:gi==null&&Ft(bi,li,co,ms);break;case Ou:Li(gi,bi,li,co,vo,yo,ms,ns,Ko);break;default:ws&1?jn(gi,bi,li,co,vo,yo,ms,ns,Ko):ws&6?yi(gi,bi,li,co,vo,yo,ms,ns,Ko):(ws&64||ws&128)&&Oo.process(gi,bi,li,co,vo,yo,ms,ns,Ko,Ps)}wl!=null&&vo?x2(wl,gi&&gi.ref,yo,bi||gi,!bi):wl==null&&gi&&gi.ref!=null&&x2(gi.ref,null,yo,gi,!0)},Wr=(gi,bi,li,co)=>{if(gi==null)j(bi.el=Dt(bi.children),li,co);else{const vo=bi.el=gi.el;bi.children!==gi.children&&re(vo,bi.children)}},An=(gi,bi,li,co)=>{gi==null?j(bi.el=Gt(bi.children||""),li,co):bi.el=gi.el},Ft=(gi,bi,li,co)=>{[gi.el,gi.anchor]=Fr(gi.children,bi,li,co,gi.el,gi.anchor)},kn=({el:gi,anchor:bi},li,co)=>{let vo;for(;gi&&gi!==bi;)vo=or(gi),j(gi,li,co),gi=vo;j(bi,li,co)},ei=({el:gi,anchor:bi})=>{let li;for(;gi&&gi!==bi;)li=or(gi),J(gi),gi=li;J(bi)},jn=(gi,bi,li,co,vo,yo,ms,ns,Ko)=>{bi.type==="svg"?ms="svg":bi.type==="math"&&(ms="mathml"),gi==null?ai(bi,li,co,vo,yo,ms,ns,Ko):un(gi,bi,vo,yo,ms,ns,Ko)},ai=(gi,bi,li,co,vo,yo,ms,ns)=>{let Ko,Oo;const{props:wl,shapeFlag:ws,transition:Il,dirs:du}=gi;if(Ko=gi.el=kt(gi.type,yo,wl&&wl.is,wl),ws&8?pe(Ko,gi.children):ws&16&&Gi(gi.children,Ko,null,co,vo,y8(gi,yo),ms,ns),du&&ny(gi,null,co,"created"),Qi(Ko,gi,gi.scopeId,ms,co),wl){for(const Fc in wl)Fc!=="value"&&!m2(Fc)&&mt(Ko,Fc,null,wl[Fc],yo,co);"value"in wl&&mt(Ko,"value",null,wl.value,yo),(Oo=wl.onVnodeBeforeMount)&&Qm(Oo,co,gi)}du&&ny(gi,null,co,"beforeMount");const Hu=uY(vo,Il);Hu&&Il.beforeEnter(Ko),j(Ko,bi,li),((Oo=wl&&wl.onVnodeMounted)||Hu||du)&&c0(()=>{Oo&&Qm(Oo,co,gi),Hu&&Il.enter(Ko),du&&ny(gi,null,co,"mounted")},vo)},Qi=(gi,bi,li,co,vo)=>{if(li&&_r(gi,li),co)for(let yo=0;yo<co.length;yo++)_r(gi,co[yo]);if(vo){let yo=vo.subTree;if(bi===yo||wI(yo.type)&&(yo.ssContent===bi||yo.ssFallback===bi)){const ms=vo.vnode;Qi(gi,ms,ms.scopeId,ms.slotScopeIds,vo.parent)}}},Gi=(gi,bi,li,co,vo,yo,ms,ns,Ko=0)=>{for(let Oo=Ko;Oo<gi.length;Oo++){const wl=gi[Oo]=ns?a1(gi[Oo]):og(gi[Oo]);zr(null,wl,bi,li,co,vo,yo,ms,ns)}},un=(gi,bi,li,co,vo,yo,ms)=>{const ns=bi.el=gi.el;let{patchFlag:Ko,dynamicChildren:Oo,dirs:wl}=bi;Ko|=gi.patchFlag&16;const ws=gi.props||mf,Il=bi.props||mf;let du;if(li&&iy(li,!1),(du=Il.onVnodeBeforeUpdate)&&Qm(du,li,bi,gi),wl&&ny(bi,gi,li,"beforeUpdate"),li&&iy(li,!0),(ws.innerHTML&&Il.innerHTML==null||ws.textContent&&Il.textContent==null)&&pe(ns,""),Oo?ia(gi.dynamicChildren,Oo,ns,li,co,y8(bi,vo),yo):ms||Va(gi,bi,ns,null,li,co,y8(bi,vo),yo,!1),Ko>0){if(Ko&16)fa(ns,ws,Il,li,vo);else if(Ko&2&&ws.class!==Il.class&&mt(ns,"class",null,Il.class,vo),Ko&4&&mt(ns,"style",ws.style,Il.style,vo),Ko&8){const Hu=bi.dynamicProps;for(let Fc=0;Fc<Hu.length;Fc++){const kc=Hu[Fc],Vd=ws[kc],kd=Il[kc];(kd!==Vd||kc==="value")&&mt(ns,kc,Vd,kd,vo,li)}}Ko&1&&gi.children!==bi.children&&pe(ns,bi.children)}else!ms&&Oo==null&&fa(ns,ws,Il,li,vo);((du=Il.onVnodeUpdated)||wl)&&c0(()=>{du&&Qm(du,li,bi,gi),wl&&ny(bi,gi,li,"updated")},co)},ia=(gi,bi,li,co,vo,yo,ms)=>{for(let ns=0;ns<bi.length;ns++){const Ko=gi[ns],Oo=bi[ns],wl=Ko.el&&(Ko.type===Ou||!py(Ko,Oo)||Ko.shapeFlag&198)?Ne(Ko.el):li;zr(Ko,Oo,wl,null,co,vo,yo,ms,!0)}},fa=(gi,bi,li,co,vo)=>{if(bi!==li){if(bi!==mf)for(const yo in bi)!m2(yo)&&!(yo in li)&&mt(gi,yo,bi[yo],null,vo,co);for(const yo in li){if(m2(yo))continue;const ms=li[yo],ns=bi[yo];ms!==ns&&yo!=="value"&&mt(gi,yo,ns,ms,vo,co)}"value"in li&&mt(gi,"value",bi.value,li.value,vo)}},Li=(gi,bi,li,co,vo,yo,ms,ns,Ko)=>{const Oo=bi.el=gi?gi.el:Dt(""),wl=bi.anchor=gi?gi.anchor:Dt("");let{patchFlag:ws,dynamicChildren:Il,slotScopeIds:du}=bi;du&&(ns=ns?ns.concat(du):du),gi==null?(j(Oo,li,co),j(wl,li,co),Gi(bi.children||[],li,wl,vo,yo,ms,ns,Ko)):ws>0&&ws&64&&Il&&gi.dynamicChildren?(ia(gi.dynamicChildren,Il,li,vo,yo,ms,ns),(bi.key!=null||vo&&bi===vo.subTree)&&WA(gi,bi,!0)):Va(gi,bi,li,wl,vo,yo,ms,ns,Ko)},yi=(gi,bi,li,co,vo,yo,ms,ns,Ko)=>{bi.slotScopeIds=ns,gi==null?bi.shapeFlag&512?vo.ctx.activate(bi,li,co,ms,Ko):ra(bi,li,co,vo,yo,ms,Ko):Da(gi,bi,Ko)},ra=(gi,bi,li,co,vo,yo,ms)=>{const ns=gi.component=SY(gi,co,vo);if(S4(gi)&&(ns.ctx.renderer=Ps),EY(ns,!1,ms),ns.asyncDep){if(vo&&vo.registerDep(ns,Ni,ms),!gi.el){const Ko=ns.subTree=gu(Gp);An(null,Ko,bi,li),gi.placeholder=Ko.el}}else Ni(ns,gi,bi,li,vo,yo,ms)},Da=(gi,bi,li)=>{const co=bi.component=gi.component;if(yY(gi,bi,li))if(co.asyncDep&&!co.asyncResolved){Ei(co,bi,li);return}else co.next=bi,co.update();else bi.el=gi.el,co.vnode=bi},Ni=(gi,bi,li,co,vo,yo,ms)=>{const ns=()=>{if(gi.isMounted){let{next:ws,bu:Il,u:du,parent:Hu,vnode:Fc}=gi;{const d0=yI(gi);if(d0){ws&&(ws.el=Fc.el,Ei(gi,ws,ms)),d0.asyncDep.then(()=>{gi.isUnmounted||ns()});return}}let kc=ws,Vd;iy(gi,!1),ws?(ws.el=Fc.el,Ei(gi,ws,ms)):ws=Fc,Il&&U5(Il),(Vd=ws.props&&ws.props.onVnodeBeforeUpdate)&&Qm(Vd,Hu,ws,Fc),iy(gi,!0);const kd=FC(gi),e0=gi.subTree;gi.subTree=kd,zr(e0,kd,Ne(e0.el),Ea(e0),gi,vo,yo),ws.el=kd.el,kc===null&&xY(gi,kd.el),du&&c0(du,vo),(Vd=ws.props&&ws.props.onVnodeUpdated)&&c0(()=>Qm(Vd,Hu,ws,Fc),vo)}else{let ws;const{el:Il,props:du}=bi,{bm:Hu,m:Fc,parent:kc,root:Vd,type:kd}=gi,e0=o_(bi);iy(gi,!1),Hu&&U5(Hu),!e0&&(ws=du&&du.onVnodeBeforeMount)&&Qm(ws,kc,bi),iy(gi,!0);{Vd.ce&&Vd.ce._def.shadowRoot!==!1&&Vd.ce._injectChildStyle(kd);const d0=gi.subTree=FC(gi);zr(null,d0,li,co,gi,vo,yo),bi.el=d0.el}if(Fc&&c0(Fc,vo),!e0&&(ws=du&&du.onVnodeMounted)){const d0=bi;c0(()=>Qm(ws,kc,d0),vo)}(bi.shapeFlag&256||kc&&o_(kc.vnode)&&kc.vnode.shapeFlag&256)&&gi.a&&c0(gi.a,vo),gi.isMounted=!0,bi=li=co=null}};gi.scope.on();const Ko=gi.effect=new bz(ns);gi.scope.off();const Oo=gi.update=Ko.run.bind(Ko),wl=gi.job=Ko.runIfDirty.bind(Ko);wl.i=gi,wl.id=gi.uid,Ko.scheduler=()=>NA(wl),iy(gi,!0),Oo()},Ei=(gi,bi,li)=>{bi.component=gi;const co=gi.vnode.props;gi.vnode=bi,gi.next=null,rY(gi,bi.props,co,li),oY(gi,bi.children,li),nv(),TC(gi),iv()},Va=(gi,bi,li,co,vo,yo,ms,ns,Ko=!1)=>{const Oo=gi&&gi.children,wl=gi?gi.shapeFlag:0,ws=bi.children,{patchFlag:Il,shapeFlag:du}=bi;if(Il>0){if(Il&128){mo(Oo,ws,li,co,vo,yo,ms,ns,Ko);return}else if(Il&256){ss(Oo,ws,li,co,vo,yo,ms,ns,Ko);return}}du&8?(wl&16&&Ta(Oo,vo,yo),ws!==Oo&&pe(li,ws)):wl&16?du&16?mo(Oo,ws,li,co,vo,yo,ms,ns,Ko):Ta(Oo,vo,yo,!0):(wl&8&&pe(li,""),du&16&&Gi(ws,li,co,vo,yo,ms,ns,Ko))},ss=(gi,bi,li,co,vo,yo,ms,ns,Ko)=>{gi=gi||n_,bi=bi||n_;const Oo=gi.length,wl=bi.length,ws=Math.min(Oo,wl);let Il;for(Il=0;Il<ws;Il++){const du=bi[Il]=Ko?a1(bi[Il]):og(bi[Il]);zr(gi[Il],du,li,null,vo,yo,ms,ns,Ko)}Oo>wl?Ta(gi,vo,yo,!0,!1,ws):Gi(bi,li,co,vo,yo,ms,ns,Ko,ws)},mo=(gi,bi,li,co,vo,yo,ms,ns,Ko)=>{let Oo=0;const wl=bi.length;let ws=gi.length-1,Il=wl-1;for(;Oo<=ws&&Oo<=Il;){const du=gi[Oo],Hu=bi[Oo]=Ko?a1(bi[Oo]):og(bi[Oo]);if(py(du,Hu))zr(du,Hu,li,null,vo,yo,ms,ns,Ko);else break;Oo++}for(;Oo<=ws&&Oo<=Il;){const du=gi[ws],Hu=bi[Il]=Ko?a1(bi[Il]):og(bi[Il]);if(py(du,Hu))zr(du,Hu,li,null,vo,yo,ms,ns,Ko);else break;ws--,Il--}if(Oo>ws){if(Oo<=Il){const du=Il+1,Hu=du<wl?bi[du].el:co;for(;Oo<=Il;)zr(null,bi[Oo]=Ko?a1(bi[Oo]):og(bi[Oo]),li,Hu,vo,yo,ms,ns,Ko),Oo++}}else if(Oo>Il)for(;Oo<=ws;)pl(gi[Oo],vo,yo,!0),Oo++;else{const du=Oo,Hu=Oo,Fc=new Map;for(Oo=Hu;Oo<=Il;Oo++){const sp=bi[Oo]=Ko?a1(bi[Oo]):og(bi[Oo]);sp.key!=null&&Fc.set(sp.key,Oo)}let kc,Vd=0;const kd=Il-Hu+1;let e0=!1,d0=0;const Pm=new Array(kd);for(Oo=0;Oo<kd;Oo++)Pm[Oo]=0;for(Oo=du;Oo<=ws;Oo++){const sp=gi[Oo];if(Vd>=kd){pl(sp,vo,yo,!0);continue}let p0;if(sp.key!=null)p0=Fc.get(sp.key);else for(kc=Hu;kc<=Il;kc++)if(Pm[kc-Hu]===0&&py(sp,bi[kc])){p0=kc;break}p0===void 0?pl(sp,vo,yo,!0):(Pm[p0-Hu]=Oo+1,p0>=d0?d0=p0:e0=!0,zr(sp,bi[p0],li,null,vo,yo,ms,ns,Ko),Vd++)}const uv=e0?cY(Pm):n_;for(kc=uv.length-1,Oo=kd-1;Oo>=0;Oo--){const sp=Hu+Oo,p0=bi[sp],zm=bi[sp+1],zy=sp+1<wl?zm.el||zm.placeholder:co;Pm[Oo]===0?zr(null,p0,li,zy,vo,yo,ms,ns,Ko):e0&&(kc<0||Oo!==uv[kc]?ko(p0,li,zy,2):kc--)}}},ko=(gi,bi,li,co,vo=null)=>{const{el:yo,type:ms,transition:ns,children:Ko,shapeFlag:Oo}=gi;if(Oo&6){ko(gi.component.subTree,bi,li,co);return}if(Oo&128){gi.suspense.move(bi,li,co);return}if(Oo&64){ms.move(gi,bi,li,Ps);return}if(ms===Ou){j(yo,bi,li);for(let ws=0;ws<Ko.length;ws++)ko(Ko[ws],bi,li,co);j(gi.anchor,bi,li);return}if(ms===W5){kn(gi,bi,li);return}if(co!==2&&Oo&1&&ns)if(co===0)ns.beforeEnter(yo),j(yo,bi,li),c0(()=>ns.enter(yo),vo);else{const{leave:ws,delayLeave:Il,afterLeave:du}=ns,Hu=()=>{gi.ctx.isUnmounted?J(yo):j(yo,bi,li)},Fc=()=>{ws(yo,()=>{Hu(),du&&du()})};Il?Il(yo,Hu,Fc):Fc()}else j(yo,bi,li)},pl=(gi,bi,li,co=!1,vo=!1)=>{const{type:yo,props:ms,ref:ns,children:Ko,dynamicChildren:Oo,shapeFlag:wl,patchFlag:ws,dirs:Il,cacheIndex:du}=gi;if(ws===-2&&(vo=!1),ns!=null&&(nv(),x2(ns,null,li,gi,!0),iv()),du!=null&&(bi.renderCache[du]=void 0),wl&256){bi.ctx.deactivate(gi);return}const Hu=wl&1&&Il,Fc=!o_(gi);let kc;if(Fc&&(kc=ms&&ms.onVnodeBeforeUnmount)&&Qm(kc,bi,gi),wl&6)fo(gi.component,li,co);else{if(wl&128){gi.suspense.unmount(li,co);return}Hu&&ny(gi,null,bi,"beforeUnmount"),wl&64?gi.type.remove(gi,bi,li,Ps,co):Oo&&!Oo.hasOnce&&(yo!==Ou||ws>0&&ws&64)?Ta(Oo,bi,li,!1,!0):(yo===Ou&&ws&384||!vo&&wl&16)&&Ta(Ko,bi,li),co&&fu(gi)}(Fc&&(kc=ms&&ms.onVnodeUnmounted)||Hu)&&c0(()=>{kc&&Qm(kc,bi,gi),Hu&&ny(gi,null,bi,"unmounted")},li)},fu=gi=>{const{type:bi,el:li,anchor:co,transition:vo}=gi;if(bi===Ou){qo(li,co);return}if(bi===W5){ei(gi);return}const yo=()=>{J(li),vo&&!vo.persisted&&vo.afterLeave&&vo.afterLeave()};if(gi.shapeFlag&1&&vo&&!vo.persisted){const{leave:ms,delayLeave:ns}=vo,Ko=()=>ms(li,yo);ns?ns(gi.el,yo,Ko):Ko()}else yo()},qo=(gi,bi)=>{let li;for(;gi!==bi;)li=or(gi),J(gi),gi=li;J(bi)},fo=(gi,bi,li)=>{const{bum:co,scope:vo,job:yo,subTree:ms,um:ns,m:Ko,a:Oo,parent:wl,slots:{__:ws}}=gi;DC(Ko),DC(Oo),co&&U5(co),wl&&ru(ws)&&ws.forEach(Il=>{wl.renderCache[Il]=void 0}),vo.stop(),yo&&(yo.flags|=8,pl(ms,gi,bi,li)),ns&&c0(ns,bi),c0(()=>{gi.isUnmounted=!0},bi),bi&&bi.pendingBranch&&!bi.isUnmounted&&gi.asyncDep&&!gi.asyncResolved&&gi.suspenseId===bi.pendingId&&(bi.deps--,bi.deps===0&&bi.resolve())},Ta=(gi,bi,li,co=!1,vo=!1,yo=0)=>{for(let ms=yo;ms<gi.length;ms++)pl(gi[ms],bi,li,co,vo)},Ea=gi=>{if(gi.shapeFlag&6)return Ea(gi.component.subTree);if(gi.shapeFlag&128)return gi.suspense.next();const bi=or(gi.anchor||gi.el),li=bi&&bi[Wz];return li?or(li):bi};let go=!1;const Ao=(gi,bi,li)=>{gi==null?bi._vnode&&pl(bi._vnode,null,null,!0):zr(bi._vnode||null,gi,bi,null,null,null,li),bi._vnode=gi,go||(go=!0,TC(),Uz(),go=!1)},Ps={p:zr,um:pl,m:ko,r:fu,mt:ra,mc:Gi,pc:Va,pbc:ia,n:Ea,o:d};return{render:Ao,hydrate:void 0,createApp:QG(Ao)}}function y8({type:d,props:l},z){return z==="svg"&&d==="foreignObject"||z==="mathml"&&d==="annotation-xml"&&l&&l.encoding&&l.encoding.includes("html")?void 0:z}function iy({effect:d,job:l},z){z?(d.flags|=32,l.flags|=4):(d.flags&=-33,l.flags&=-5)}function uY(d,l){return(!d||d&&!d.pendingBranch)&&l&&!l.persisted}function WA(d,l,z=!1){const j=d.children,J=l.children;if(ru(j)&&ru(J))for(let mt=0;mt<j.length;mt++){const kt=j[mt];let Dt=J[mt];Dt.shapeFlag&1&&!Dt.dynamicChildren&&((Dt.patchFlag<=0||Dt.patchFlag===32)&&(Dt=J[mt]=a1(J[mt]),Dt.el=kt.el),!z&&Dt.patchFlag!==-2&&WA(kt,Dt)),Dt.type===L4&&(Dt.el=kt.el),Dt.type===Gp&&!Dt.el&&(Dt.el=kt.el)}}function cY(d){const l=d.slice(),z=[0];let j,J,mt,kt,Dt;const Gt=d.length;for(j=0;j<Gt;j++){const re=d[j];if(re!==0){if(J=z[z.length-1],d[J]<re){l[j]=J,z.push(j);continue}for(mt=0,kt=z.length-1;mt<kt;)Dt=mt+kt>>1,d[z[Dt]]<re?mt=Dt+1:kt=Dt;re<d[z[mt]]&&(mt>0&&(l[j]=z[mt-1]),z[mt]=j)}}for(mt=z.length,kt=z[mt-1];mt-- >0;)z[mt]=kt,kt=l[kt];return z}function yI(d){const l=d.subTree.component;if(l)return l.asyncDep&&!l.asyncResolved?l:yI(l)}function DC(d){if(d)for(let l=0;l<d.length;l++)d[l].flags|=8}const hY=Symbol.for("v-scx"),fY=()=>lm(hY);function um(d,l,z){return xI(d,l,z)}function xI(d,l,z=mf){const{immediate:j,deep:J,flush:mt,once:kt}=z,Dt=op({},z),Gt=l&&j||!l&&mt!=="post";let re;if(D2){if(mt==="sync"){const _r=fY();re=_r.__watcherHandles||(_r.__watcherHandles=[])}else if(!Gt){const _r=()=>{};return _r.stop=ug,_r.resume=ug,_r.pause=ug,_r}}const pe=Yp;Dt.call=(_r,Fr,zr)=>Em(_r,pe,Fr,zr);let Ne=!1;mt==="post"?Dt.scheduler=_r=>{c0(_r,pe&&pe.suspense)}:mt!=="sync"&&(Ne=!0,Dt.scheduler=(_r,Fr)=>{Fr?_r():NA(_r)}),Dt.augmentJob=_r=>{l&&(_r.flags|=4),Ne&&(_r.flags|=2,pe&&(_r.id=pe.uid,_r.i=pe))};const or=CG(d,l,Dt);return D2&&(re?re.push(or):Gt&&or()),or}function dY(d,l,z){const j=this.proxy,J=sd(d)?d.includes(".")?_I(j,d):()=>j[d]:d.bind(j,j);let mt;Uu(l)?mt=l:(mt=l.handler,z=l);const kt=X2(this),Dt=xI(J,mt.bind(j),z);return kt(),Dt}function _I(d,l){const z=l.split(".");return()=>{let j=d;for(let J=0;J<z.length&&j;J++)j=j[z[J]];return j}}const pY=(d,l)=>l==="modelValue"||l==="model-value"?d.modelModifiers:d[`${l}Modifiers`]||d[`${cm(l)}Modifiers`]||d[`${Ey(l)}Modifiers`];function mY(d,l,...z){if(d.isUnmounted)return;const j=d.vnode.props||mf;let J=z;const mt=l.startsWith("update:"),kt=mt&&pY(j,l.slice(7));kt&&(kt.trim&&(J=z.map(pe=>sd(pe)?pe.trim():pe)),kt.number&&(J=z.map(Q5)));let Dt,Gt=j[Dt=h8(l)]||j[Dt=h8(cm(l))];!Gt&&mt&&(Gt=j[Dt=h8(Ey(l))]),Gt&&Em(Gt,d,6,J);const re=j[Dt+"Once"];if(re){if(!d.emitted)d.emitted={};else if(d.emitted[Dt])return;d.emitted[Dt]=!0,Em(re,d,6,J)}}function bI(d,l,z=!1){const j=l.emitsCache,J=j.get(d);if(J!==void 0)return J;const mt=d.emits;let kt={},Dt=!1;if(!Uu(d)){const Gt=re=>{const pe=bI(re,l,!0);pe&&(Dt=!0,op(kt,pe))};!z&&l.mixins.length&&l.mixins.forEach(Gt),d.extends&&Gt(d.extends),d.mixins&&d.mixins.forEach(Gt)}return!mt&&!Dt?(gf(d)&&j.set(d,null),null):(ru(mt)?mt.forEach(Gt=>kt[Gt]=null):op(kt,mt),gf(d)&&j.set(d,kt),kt)}function C4(d,l){return!d||!_4(l)?!1:(l=l.slice(2).replace(/Once$/,""),Fh(d,l[0].toLowerCase()+l.slice(1))||Fh(d,Ey(l))||Fh(d,l))}function FC(d){const{type:l,vnode:z,proxy:j,withProxy:J,propsOptions:[mt],slots:kt,attrs:Dt,emit:Gt,render:re,renderCache:pe,props:Ne,data:or,setupState:_r,ctx:Fr,inheritAttrs:zr}=d,Wr=i4(d);let An,Ft;try{if(z.shapeFlag&4){const ei=J||j,jn=ei;An=og(re.call(jn,ei,pe,Ne,_r,or,Fr)),Ft=Dt}else{const ei=l;An=og(ei.length>1?ei(Ne,{attrs:Dt,slots:kt,emit:Gt}):ei(Ne,null)),Ft=l.props?Dt:gY(Dt)}}catch(ei){b2.length=0,M4(ei,d,1),An=gu(Gp)}let kn=An;if(Ft&&zr!==!1){const ei=Object.keys(Ft),{shapeFlag:jn}=kn;ei.length&&jn&7&&(mt&&ei.some(EA)&&(Ft=vY(Ft,mt)),kn=g1(kn,Ft,!1,!0))}return z.dirs&&(kn=g1(kn,null,!1,!0),kn.dirs=kn.dirs?kn.dirs.concat(z.dirs):z.dirs),z.transition&&Ty(kn,z.transition),An=kn,i4(Wr),An}const gY=d=>{let l;for(const z in d)(z==="class"||z==="style"||_4(z))&&((l||(l={}))[z]=d[z]);return l},vY=(d,l)=>{const z={};for(const j in d)(!EA(j)||!(j.slice(9)in l))&&(z[j]=d[j]);return z};function yY(d,l,z){const{props:j,children:J,component:mt}=d,{props:kt,children:Dt,patchFlag:Gt}=l,re=mt.emitsOptions;if(l.dirs||l.transition)return!0;if(z&&Gt>=0){if(Gt&1024)return!0;if(Gt&16)return j?RC(j,kt,re):!!kt;if(Gt&8){const pe=l.dynamicProps;for(let Ne=0;Ne<pe.length;Ne++){const or=pe[Ne];if(kt[or]!==j[or]&&!C4(re,or))return!0}}}else return(J||Dt)&&(!Dt||!Dt.$stable)?!0:j===kt?!1:j?kt?RC(j,kt,re):!0:!!kt;return!1}function RC(d,l,z){const j=Object.keys(l);if(j.length!==Object.keys(d).length)return!0;for(let J=0;J<j.length;J++){const mt=j[J];if(l[mt]!==d[mt]&&!C4(z,mt))return!0}return!1}function xY({vnode:d,parent:l},z){for(;l;){const j=l.subTree;if(j.suspense&&j.suspense.activeBranch===d&&(j.el=d.el),j===d)(d=l.vnode).el=z,l=l.parent;else break}}const wI=d=>d.__isSuspense;function _Y(d,l){l&&l.pendingBranch?ru(d)?l.effects.push(...d):l.effects.push(d):zG(d)}const Ou=Symbol.for("v-fgt"),L4=Symbol.for("v-txt"),Gp=Symbol.for("v-cmt"),W5=Symbol.for("v-stc"),b2=[];let $0=null;function zi(d=!1){b2.push($0=d?null:[])}function bY(){b2.pop(),$0=b2[b2.length-1]||null}let I2=1;function BC(d,l=!1){I2+=d,d<0&&$0&&l&&($0.hasOnce=!0)}function kI(d){return d.dynamicChildren=I2>0?$0||n_:null,bY(),I2>0&&$0&&$0.push(d),d}function Vi(d,l,z,j,J,mt){return kI(Re(d,l,z,j,J,mt,!0))}function hm(d,l,z,j,J){return kI(gu(d,l,z,j,J,!0))}function O2(d){return d?d.__v_isVNode===!0:!1}function py(d,l){return d.type===l.type&&d.key===l.key}const TI=({key:d})=>d??null,q5=({ref:d,ref_key:l,ref_for:z})=>(typeof d=="number"&&(d=""+d),d!=null?sd(d)||Ud(d)||Uu(d)?{i:Ip,r:d,k:l,f:!!z}:d:null);function Re(d,l=null,z=null,j=0,J=null,mt=d===Ou?0:1,kt=!1,Dt=!1){const Gt={__v_isVNode:!0,__v_skip:!0,type:d,props:l,key:l&&TI(l),ref:l&&q5(l),scopeId:Hz,slotScopeIds:null,children:z,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:mt,patchFlag:j,dynamicProps:J,dynamicChildren:null,appContext:null,ctx:Ip};return Dt?(qA(Gt,z),mt&128&&d.normalize(Gt)):z&&(Gt.shapeFlag|=sd(z)?8:16),I2>0&&!kt&&$0&&(Gt.patchFlag>0||mt&6)&&Gt.patchFlag!==32&&$0.push(Gt),Gt}const gu=wY;function wY(d,l=null,z=null,j=0,J=null,mt=!1){if((!d||d===iI)&&(d=Gp),O2(d)){const Dt=g1(d,l,!0);return z&&qA(Dt,z),I2>0&&!mt&&$0&&(Dt.shapeFlag&6?$0[$0.indexOf(d)]=Dt:$0.push(Dt)),Dt.patchFlag=-2,Dt}if(IY(d)&&(d=d.__vccOpts),l){l=kY(l);let{class:Dt,style:Gt}=l;Dt&&!sd(Dt)&&(l.class=Xs(Dt)),gf(Gt)&&(RA(Gt)&&!ru(Gt)&&(Gt=op({},Gt)),l.style=av(Gt))}const kt=sd(d)?1:wI(d)?128:qz(d)?64:gf(d)?4:Uu(d)?2:0;return Re(d,l,z,j,J,kt,mt,!0)}function kY(d){return d?RA(d)||fI(d)?op({},d):d:null}function g1(d,l,z=!1,j=!1){const{props:J,ref:mt,patchFlag:kt,children:Dt,transition:Gt}=d,re=l?TY(J||{},l):J,pe={__v_isVNode:!0,__v_skip:!0,type:d.type,props:re,key:re&&TI(re),ref:l&&l.ref?z&&mt?ru(mt)?mt.concat(q5(l)):[mt,q5(l)]:q5(l):mt,scopeId:d.scopeId,slotScopeIds:d.slotScopeIds,children:Dt,target:d.target,targetStart:d.targetStart,targetAnchor:d.targetAnchor,staticCount:d.staticCount,shapeFlag:d.shapeFlag,patchFlag:l&&d.type!==Ou?kt===-1?16:kt|16:kt,dynamicProps:d.dynamicProps,dynamicChildren:d.dynamicChildren,appContext:d.appContext,dirs:d.dirs,transition:Gt,component:d.component,suspense:d.suspense,ssContent:d.ssContent&&g1(d.ssContent),ssFallback:d.ssFallback&&g1(d.ssFallback),placeholder:d.placeholder,el:d.el,anchor:d.anchor,ctx:d.ctx,ce:d.ce};return Gt&&j&&Ty(pe,Gt.clone(pe)),pe}function nc(d=" ",l=0){return gu(L4,null,d,l)}function Ff(d,l){const z=gu(W5,null,d);return z.staticCount=l,z}function bs(d="",l=!1){return l?(zi(),hm(Gp,null,d)):gu(Gp,null,d)}function og(d){return d==null||typeof d=="boolean"?gu(Gp):ru(d)?gu(Ou,null,d.slice()):O2(d)?a1(d):gu(L4,null,String(d))}function a1(d){return d.el===null&&d.patchFlag!==-1||d.memo?d:g1(d)}function qA(d,l){let z=0;const{shapeFlag:j}=d;if(l==null)l=null;else if(ru(l))z=16;else if(typeof l=="object")if(j&65){const J=l.default;J&&(J._c&&(J._d=!1),qA(d,J()),J._c&&(J._d=!0));return}else{z=32;const J=l._;!J&&!fI(l)?l._ctx=Ip:J===3&&Ip&&(Ip.slots._===1?l._=1:(l._=2,d.patchFlag|=1024))}else Uu(l)?(l={default:l,_ctx:Ip},z=32):(l=String(l),j&64?(z=16,l=[nc(l)]):z=8);d.children=l,d.shapeFlag|=z}function TY(...d){const l={};for(let z=0;z<d.length;z++){const j=d[z];for(const J in j)if(J==="class")l.class!==j.class&&(l.class=Xs([l.class,j.class]));else if(J==="style")l.style=av([l.style,j.style]);else if(_4(J)){const mt=l[J],kt=j[J];kt&&mt!==kt&&!(ru(mt)&&mt.includes(kt))&&(l[J]=mt?[].concat(mt,kt):kt)}else J!==""&&(l[J]=j[J])}return l}function Qm(d,l,z,j=null){Em(d,l,7,[z,j])}const AY=uI();let MY=0;function SY(d,l,z){const j=d.type,J=(l?l.appContext:d.appContext)||AY,mt={uid:MY++,vnode:d,type:j,parent:l,appContext:J,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new yz(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:l?l.provides:Object.create(J.provides),ids:l?l.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:pI(j,J),emitsOptions:bI(j,J),emit:null,emitted:null,propsDefaults:mf,inheritAttrs:j.inheritAttrs,ctx:mf,data:mf,props:mf,attrs:mf,slots:mf,refs:mf,setupState:mf,setupContext:null,suspense:z,suspenseId:z?z.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return mt.ctx={_:mt},mt.root=l?l.root:mt,mt.emit=mY.bind(null,mt),d.ce&&d.ce(mt),mt}let Yp=null;const P4=()=>Yp||Ip;let s4,eA;{const d=T4(),l=(z,j)=>{let J;return(J=d[z])||(J=d[z]=[]),J.push(j),mt=>{J.length>1?J.forEach(kt=>kt(mt)):J[0](mt)}};s4=l("__VUE_INSTANCE_SETTERS__",z=>Yp=z),eA=l("__VUE_SSR_SETTERS__",z=>D2=z)}const X2=d=>{const l=Yp;return s4(d),d.scope.on(),()=>{d.scope.off(),s4(l)}},NC=()=>{Yp&&Yp.scope.off(),s4(null)};function AI(d){return d.vnode.shapeFlag&4}let D2=!1;function EY(d,l=!1,z=!1){l&&eA(l);const{props:j,children:J}=d.vnode,mt=AI(d);eY(d,j,mt,l),aY(d,J,z||l);const kt=mt?CY(d,l):void 0;return l&&eA(!1),kt}function CY(d,l){const z=d.type;d.accessCache=Object.create(null),d.proxy=new Proxy(d.ctx,ZG);const{setup:j}=z;if(j){nv();const J=d.setupContext=j.length>1?PY(d):null,mt=X2(d),kt=G2(j,d,0,[d.props,J]),Dt=fz(kt);if(iv(),mt(),(Dt||d.sp)&&!o_(d)&&tI(d),Dt){if(kt.then(NC,NC),l)return kt.then(Gt=>{jC(d,Gt)}).catch(Gt=>{M4(Gt,d,0)});d.asyncDep=kt}else jC(d,kt)}else MI(d)}function jC(d,l,z){Uu(l)?d.type.__ssrInlineRender?d.ssrRender=l:d.render=l:gf(l)&&(d.setupState=Bz(l)),MI(d)}function MI(d,l,z){const j=d.type;d.render||(d.render=j.render||ug);{const J=X2(d);nv();try{$G(d)}finally{iv(),J()}}}const LY={get(d,l){return Zp(d,"get",""),d[l]}};function PY(d){const l=z=>{d.exposed=z||{}};return{attrs:new Proxy(d.attrs,LY),slots:d.slots,emit:d.emit,expose:l}}function z4(d){return d.exposed?d.exposeProxy||(d.exposeProxy=new Proxy(Bz(BA(d.exposed)),{get(l,z){if(z in l)return l[z];if(z in _2)return _2[z](d)},has(l,z){return z in l||z in _2}})):d.proxy}function zY(d,l=!0){return Uu(d)?d.displayName||d.name:d.name||l&&d.__name}function IY(d){return Uu(d)&&"__vccOpts"in d}const Yo=(d,l)=>SG(d,l,D2);function ZA(d,l,z){const j=arguments.length;return j===2?gf(l)&&!ru(l)?O2(l)?gu(d,null,[l]):gu(d,l):gu(d,null,l):(j>3?z=Array.prototype.slice.call(arguments,2):j===3&&O2(z)&&(z=[z]),gu(d,l,z))}const OY="3.5.18";/**
* @vue/runtime-dom v3.5.18
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let rA;const UC=typeof window<"u"&&window.trustedTypes;if(UC)try{rA=UC.createPolicy("vue",{createHTML:d=>d})}catch{}const SI=rA?d=>rA.createHTML(d):d=>d,DY="http://www.w3.org/2000/svg",FY="http://www.w3.org/1998/Math/MathML",Kg=typeof document<"u"?document:null,VC=Kg&&Kg.createElement("template"),RY={insert:(d,l,z)=>{l.insertBefore(d,z||null)},remove:d=>{const l=d.parentNode;l&&l.removeChild(d)},createElement:(d,l,z,j)=>{const J=l==="svg"?Kg.createElementNS(DY,d):l==="mathml"?Kg.createElementNS(FY,d):z?Kg.createElement(d,{is:z}):Kg.createElement(d);return d==="select"&&j&&j.multiple!=null&&J.setAttribute("multiple",j.multiple),J},createText:d=>Kg.createTextNode(d),createComment:d=>Kg.createComment(d),setText:(d,l)=>{d.nodeValue=l},setElementText:(d,l)=>{d.textContent=l},parentNode:d=>d.parentNode,nextSibling:d=>d.nextSibling,querySelector:d=>Kg.querySelector(d),setScopeId(d,l){d.setAttribute(l,"")},insertStaticContent(d,l,z,j,J,mt){const kt=z?z.previousSibling:l.lastChild;if(J&&(J===mt||J.nextSibling))for(;l.insertBefore(J.cloneNode(!0),z),!(J===mt||!(J=J.nextSibling)););else{VC.innerHTML=SI(j==="svg"?`<svg>${d}</svg>`:j==="mathml"?`<math>${d}</math>`:d);const Dt=VC.content;if(j==="svg"||j==="mathml"){const Gt=Dt.firstChild;for(;Gt.firstChild;)Dt.appendChild(Gt.firstChild);Dt.removeChild(Gt)}l.insertBefore(Dt,z)}return[kt?kt.nextSibling:l.firstChild,z?z.previousSibling:l.lastChild]}},Jv="transition",Yb="animation",c_=Symbol("_vtc"),EI={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},CI=op({},Kz,EI),BY=d=>(d.displayName="Transition",d.props=CI,d),LI=BY((d,{slots:l})=>ZA(DG,PI(d),l)),ay=(d,l=[])=>{ru(d)?d.forEach(z=>z(...l)):d&&d(...l)},HC=d=>d?ru(d)?d.some(l=>l.length>1):d.length>1:!1;function PI(d){const l={};for(const Li in d)Li in EI||(l[Li]=d[Li]);if(d.css===!1)return l;const{name:z="v",type:j,duration:J,enterFromClass:mt=`${z}-enter-from`,enterActiveClass:kt=`${z}-enter-active`,enterToClass:Dt=`${z}-enter-to`,appearFromClass:Gt=mt,appearActiveClass:re=kt,appearToClass:pe=Dt,leaveFromClass:Ne=`${z}-leave-from`,leaveActiveClass:or=`${z}-leave-active`,leaveToClass:_r=`${z}-leave-to`}=d,Fr=NY(J),zr=Fr&&Fr[0],Wr=Fr&&Fr[1],{onBeforeEnter:An,onEnter:Ft,onEnterCancelled:kn,onLeave:ei,onLeaveCancelled:jn,onBeforeAppear:ai=An,onAppear:Qi=Ft,onAppearCancelled:Gi=kn}=l,un=(Li,yi,ra,Da)=>{Li._enterCancelled=Da,e1(Li,yi?pe:Dt),e1(Li,yi?re:kt),ra&&ra()},ia=(Li,yi)=>{Li._isLeaving=!1,e1(Li,Ne),e1(Li,_r),e1(Li,or),yi&&yi()},fa=Li=>(yi,ra)=>{const Da=Li?Qi:Ft,Ni=()=>un(yi,Li,ra);ay(Da,[yi,Ni]),WC(()=>{e1(yi,Li?Gt:mt),rg(yi,Li?pe:Dt),HC(Da)||qC(yi,j,zr,Ni)})};return op(l,{onBeforeEnter(Li){ay(An,[Li]),rg(Li,mt),rg(Li,kt)},onBeforeAppear(Li){ay(ai,[Li]),rg(Li,Gt),rg(Li,re)},onEnter:fa(!1),onAppear:fa(!0),onLeave(Li,yi){Li._isLeaving=!0;const ra=()=>ia(Li,yi);rg(Li,Ne),Li._enterCancelled?(rg(Li,or),nA()):(nA(),rg(Li,or)),WC(()=>{Li._isLeaving&&(e1(Li,Ne),rg(Li,_r),HC(ei)||qC(Li,j,Wr,ra))}),ay(ei,[Li,ra])},onEnterCancelled(Li){un(Li,!1,void 0,!0),ay(kn,[Li])},onAppearCancelled(Li){un(Li,!0,void 0,!0),ay(Gi,[Li])},onLeaveCancelled(Li){ia(Li),ay(jn,[Li])}})}function NY(d){if(d==null)return null;if(gf(d))return[x8(d.enter),x8(d.leave)];{const l=x8(d);return[l,l]}}function x8(d){return q$(d)}function rg(d,l){l.split(/\s+/).forEach(z=>z&&d.classList.add(z)),(d[c_]||(d[c_]=new Set)).add(l)}function e1(d,l){l.split(/\s+/).forEach(j=>j&&d.classList.remove(j));const z=d[c_];z&&(z.delete(l),z.size||(d[c_]=void 0))}function WC(d){requestAnimationFrame(()=>{requestAnimationFrame(d)})}let jY=0;function qC(d,l,z,j){const J=d._endId=++jY,mt=()=>{J===d._endId&&j()};if(z!=null)return setTimeout(mt,z);const{type:kt,timeout:Dt,propCount:Gt}=zI(d,l);if(!kt)return j();const re=kt+"end";let pe=0;const Ne=()=>{d.removeEventListener(re,or),mt()},or=_r=>{_r.target===d&&++pe>=Gt&&Ne()};setTimeout(()=>{pe<Gt&&Ne()},Dt+1),d.addEventListener(re,or)}function zI(d,l){const z=window.getComputedStyle(d),j=Fr=>(z[Fr]||"").split(", "),J=j(`${Jv}Delay`),mt=j(`${Jv}Duration`),kt=ZC(J,mt),Dt=j(`${Yb}Delay`),Gt=j(`${Yb}Duration`),re=ZC(Dt,Gt);let pe=null,Ne=0,or=0;l===Jv?kt>0&&(pe=Jv,Ne=kt,or=mt.length):l===Yb?re>0&&(pe=Yb,Ne=re,or=Gt.length):(Ne=Math.max(kt,re),pe=Ne>0?kt>re?Jv:Yb:null,or=pe?pe===Jv?mt.length:Gt.length:0);const _r=pe===Jv&&/\b(transform|all)(,|$)/.test(j(`${Jv}Property`).toString());return{type:pe,timeout:Ne,propCount:or,hasTransform:_r}}function ZC(d,l){for(;d.length<l.length;)d=d.concat(d);return Math.max(...l.map((z,j)=>$C(z)+$C(d[j])))}function $C(d){return d==="auto"?0:Number(d.slice(0,-1).replace(",","."))*1e3}function nA(){return document.body.offsetHeight}function UY(d,l,z){const j=d[c_];j&&(l=(l?[l,...j]:[...j]).join(" ")),l==null?d.removeAttribute("class"):z?d.setAttribute("class",l):d.className=l}const l4=Symbol("_vod"),II=Symbol("_vsh"),Kb={beforeMount(d,{value:l},{transition:z}){d[l4]=d.style.display==="none"?"":d.style.display,z&&l?z.beforeEnter(d):Xb(d,l)},mounted(d,{value:l},{transition:z}){z&&l&&z.enter(d)},updated(d,{value:l,oldValue:z},{transition:j}){!l!=!z&&(j?l?(j.beforeEnter(d),Xb(d,!0),j.enter(d)):j.leave(d,()=>{Xb(d,!1)}):Xb(d,l))},beforeUnmount(d,{value:l}){Xb(d,l)}};function Xb(d,l){d.style.display=l?d[l4]:"none",d[II]=!l}const VY=Symbol(""),HY=/(^|;)\s*display\s*:/;function WY(d,l,z){const j=d.style,J=sd(z);let mt=!1;if(z&&!J){if(l)if(sd(l))for(const kt of l.split(";")){const Dt=kt.slice(0,kt.indexOf(":")).trim();z[Dt]==null&&Z5(j,Dt,"")}else for(const kt in l)z[kt]==null&&Z5(j,kt,"");for(const kt in z)kt==="display"&&(mt=!0),Z5(j,kt,z[kt])}else if(J){if(l!==z){const kt=j[VY];kt&&(z+=";"+kt),j.cssText=z,mt=HY.test(z)}}else l&&d.removeAttribute("style");l4 in d&&(d[l4]=mt?j.display:"",d[II]&&(j.display="none"))}const GC=/\s*!important$/;function Z5(d,l,z){if(ru(z))z.forEach(j=>Z5(d,l,j));else if(z==null&&(z=""),l.startsWith("--"))d.setProperty(l,z);else{const j=qY(d,l);GC.test(z)?d.setProperty(Ey(j),z.replace(GC,""),"important"):d[j]=z}}const YC=["Webkit","Moz","ms"],_8={};function qY(d,l){const z=_8[l];if(z)return z;let j=cm(l);if(j!=="filter"&&j in d)return _8[l]=j;j=k4(j);for(let J=0;J<YC.length;J++){const mt=YC[J]+j;if(mt in d)return _8[l]=mt}return l}const KC="http://www.w3.org/1999/xlink";function XC(d,l,z,j,J,mt=X$(l)){j&&l.startsWith("xlink:")?z==null?d.removeAttributeNS(KC,l.slice(6,l.length)):d.setAttributeNS(KC,l,z):z==null||mt&&!mz(z)?d.removeAttribute(l):d.setAttribute(l,mt?"":Sm(z)?String(z):z)}function JC(d,l,z,j,J){if(l==="innerHTML"||l==="textContent"){z!=null&&(d[l]=l==="innerHTML"?SI(z):z);return}const mt=d.tagName;if(l==="value"&&mt!=="PROGRESS"&&!mt.includes("-")){const Dt=mt==="OPTION"?d.getAttribute("value")||"":d.value,Gt=z==null?d.type==="checkbox"?"on":"":String(z);(Dt!==Gt||!("_value"in d))&&(d.value=Gt),z==null&&d.removeAttribute(l),d._value=z;return}let kt=!1;if(z===""||z==null){const Dt=typeof d[l];Dt==="boolean"?z=mz(z):z==null&&Dt==="string"?(z="",kt=!0):Dt==="number"&&(z=0,kt=!0)}try{d[l]=z}catch{}kt&&d.removeAttribute(J||l)}function s1(d,l,z,j){d.addEventListener(l,z,j)}function ZY(d,l,z,j){d.removeEventListener(l,z,j)}const QC=Symbol("_vei");function $Y(d,l,z,j,J=null){const mt=d[QC]||(d[QC]={}),kt=mt[l];if(j&&kt)kt.value=j;else{const[Dt,Gt]=GY(l);if(j){const re=mt[l]=XY(j,J);s1(d,Dt,re,Gt)}else kt&&(ZY(d,Dt,kt,Gt),mt[l]=void 0)}}const tL=/(?:Once|Passive|Capture)$/;function GY(d){let l;if(tL.test(d)){l={};let j;for(;j=d.match(tL);)d=d.slice(0,d.length-j[0].length),l[j[0].toLowerCase()]=!0}return[d[2]===":"?d.slice(3):Ey(d.slice(2)),l]}let b8=0;const YY=Promise.resolve(),KY=()=>b8||(YY.then(()=>b8=0),b8=Date.now());function XY(d,l){const z=j=>{if(!j._vts)j._vts=Date.now();else if(j._vts<=z.attached)return;Em(JY(j,z.value),l,5,[j])};return z.value=d,z.attached=KY(),z}function JY(d,l){if(ru(l)){const z=d.stopImmediatePropagation;return d.stopImmediatePropagation=()=>{z.call(d),d._stopped=!0},l.map(j=>J=>!J._stopped&&j&&j(J))}else return l}const eL=d=>d.charCodeAt(0)===111&&d.charCodeAt(1)===110&&d.charCodeAt(2)>96&&d.charCodeAt(2)<123,QY=(d,l,z,j,J,mt)=>{const kt=J==="svg";l==="class"?UY(d,j,kt):l==="style"?WY(d,z,j):_4(l)?EA(l)||$Y(d,l,z,j,mt):(l[0]==="."?(l=l.slice(1),!0):l[0]==="^"?(l=l.slice(1),!1):tK(d,l,j,kt))?(JC(d,l,j),!d.tagName.includes("-")&&(l==="value"||l==="checked"||l==="selected")&&XC(d,l,j,kt,mt,l!=="value")):d._isVueCE&&(/[A-Z]/.test(l)||!sd(j))?JC(d,cm(l),j,mt,l):(l==="true-value"?d._trueValue=j:l==="false-value"&&(d._falseValue=j),XC(d,l,j,kt))};function tK(d,l,z,j){if(j)return!!(l==="innerHTML"||l==="textContent"||l in d&&eL(l)&&Uu(z));if(l==="spellcheck"||l==="draggable"||l==="translate"||l==="autocorrect"||l==="form"||l==="list"&&d.tagName==="INPUT"||l==="type"&&d.tagName==="TEXTAREA")return!1;if(l==="width"||l==="height"){const J=d.tagName;if(J==="IMG"||J==="VIDEO"||J==="CANVAS"||J==="SOURCE")return!1}return eL(l)&&sd(z)?!1:l in d}const OI=new WeakMap,DI=new WeakMap,u4=Symbol("_moveCb"),rL=Symbol("_enterCb"),eK=d=>(delete d.props.mode,d),rK=eK({name:"TransitionGroup",props:op({},CI,{tag:String,moveClass:String}),setup(d,{slots:l}){const z=P4(),j=Yz();let J,mt;return rI(()=>{if(!J.length)return;const kt=d.moveClass||`${d.name||"v"}-move`;if(!sK(J[0].el,z.vnode.el,kt)){J=[];return}J.forEach(iK),J.forEach(aK);const Dt=J.filter(oK);nA(),Dt.forEach(Gt=>{const re=Gt.el,pe=re.style;rg(re,kt),pe.transform=pe.webkitTransform=pe.transitionDuration="";const Ne=re[u4]=or=>{or&&or.target!==re||(!or||/transform$/.test(or.propertyName))&&(re.removeEventListener("transitionend",Ne),re[u4]=null,e1(re,kt))};re.addEventListener("transitionend",Ne)}),J=[]}),()=>{const kt=ju(d),Dt=PI(kt);let Gt=kt.tag||Ou;if(J=[],mt)for(let re=0;re<mt.length;re++){const pe=mt[re];pe.el&&pe.el instanceof Element&&(J.push(pe),Ty(pe,z2(pe,Dt,j,z)),OI.set(pe,pe.el.getBoundingClientRect()))}mt=l.default?jA(l.default()):[];for(let re=0;re<mt.length;re++){const pe=mt[re];pe.key!=null&&Ty(pe,z2(pe,Dt,j,z))}return gu(Gt,null,mt)}}}),nK=rK;function iK(d){const l=d.el;l[u4]&&l[u4](),l[rL]&&l[rL]()}function aK(d){DI.set(d,d.el.getBoundingClientRect())}function oK(d){const l=OI.get(d),z=DI.get(d),j=l.left-z.left,J=l.top-z.top;if(j||J){const mt=d.el.style;return mt.transform=mt.webkitTransform=`translate(${j}px,${J}px)`,mt.transitionDuration="0s",d}}function sK(d,l,z){const j=d.cloneNode(),J=d[c_];J&&J.forEach(Dt=>{Dt.split(/\s+/).forEach(Gt=>Gt&&j.classList.remove(Gt))}),z.split(/\s+/).forEach(Dt=>Dt&&j.classList.add(Dt)),j.style.display="none";const mt=l.nodeType===1?l:l.parentNode;mt.appendChild(j);const{hasTransform:kt}=zI(j);return mt.removeChild(j),kt}const h_=d=>{const l=d.props["onUpdate:modelValue"]||!1;return ru(l)?z=>U5(l,z):l};function lK(d){d.target.composing=!0}function nL(d){const l=d.target;l.composing&&(l.composing=!1,l.dispatchEvent(new Event("input")))}const rv=Symbol("_assign"),$A={created(d,{modifiers:{lazy:l,trim:z,number:j}},J){d[rv]=h_(J);const mt=j||J.props&&J.props.type==="number";s1(d,l?"change":"input",kt=>{if(kt.target.composing)return;let Dt=d.value;z&&(Dt=Dt.trim()),mt&&(Dt=Q5(Dt)),d[rv](Dt)}),z&&s1(d,"change",()=>{d.value=d.value.trim()}),l||(s1(d,"compositionstart",lK),s1(d,"compositionend",nL),s1(d,"change",nL))},mounted(d,{value:l}){d.value=l??""},beforeUpdate(d,{value:l,oldValue:z,modifiers:{lazy:j,trim:J,number:mt}},kt){if(d[rv]=h_(kt),d.composing)return;const Dt=(mt||d.type==="number")&&!/^0\d/.test(d.value)?Q5(d.value):d.value,Gt=l??"";Dt!==Gt&&(document.activeElement===d&&d.type!=="range"&&(j&&l===z||J&&d.value.trim()===Gt)||(d.value=Gt))}},F2={created(d,{value:l},z){d.checked=u_(l,z.props.value),d[rv]=h_(z),s1(d,"change",()=>{d[rv](R2(d))})},beforeUpdate(d,{value:l,oldValue:z},j){d[rv]=h_(j),l!==z&&(d.checked=u_(l,j.props.value))}},iA={deep:!0,created(d,{value:l,modifiers:{number:z}},j){const J=b4(l);s1(d,"change",()=>{const mt=Array.prototype.filter.call(d.options,kt=>kt.selected).map(kt=>z?Q5(R2(kt)):R2(kt));d[rv](d.multiple?J?new Set(mt):mt:mt[0]),d._assigning=!0,Z0(()=>{d._assigning=!1})}),d[rv]=h_(j)},mounted(d,{value:l}){iL(d,l)},beforeUpdate(d,l,z){d[rv]=h_(z)},updated(d,{value:l}){d._assigning||iL(d,l)}};function iL(d,l){const z=d.multiple,j=ru(l);if(!(z&&!j&&!b4(l))){for(let J=0,mt=d.options.length;J<mt;J++){const kt=d.options[J],Dt=R2(kt);if(z)if(j){const Gt=typeof Dt;Gt==="string"||Gt==="number"?kt.selected=l.some(re=>String(re)===String(Dt)):kt.selected=Q$(l,Dt)>-1}else kt.selected=l.has(Dt);else if(u_(R2(kt),l)){d.selectedIndex!==J&&(d.selectedIndex=J);return}}!z&&d.selectedIndex!==-1&&(d.selectedIndex=-1)}}function R2(d){return"_value"in d?d._value:d.value}const uK=["ctrl","shift","alt","meta"],cK={stop:d=>d.stopPropagation(),prevent:d=>d.preventDefault(),self:d=>d.target!==d.currentTarget,ctrl:d=>!d.ctrlKey,shift:d=>!d.shiftKey,alt:d=>!d.altKey,meta:d=>!d.metaKey,left:d=>"button"in d&&d.button!==0,middle:d=>"button"in d&&d.button!==1,right:d=>"button"in d&&d.button!==2,exact:(d,l)=>uK.some(z=>d[`${z}Key`]&&!l.includes(z))},hg=(d,l)=>{const z=d._withMods||(d._withMods={}),j=l.join(".");return z[j]||(z[j]=(J,...mt)=>{for(let kt=0;kt<l.length;kt++){const Dt=cK[l[kt]];if(Dt&&Dt(J,l))return}return d(J,...mt)})},hK=op({patchProp:QY},RY);let aL;function fK(){return aL||(aL=sY(hK))}const dK=(...d)=>{const l=fK().createApp(...d),{mount:z}=l;return l.mount=j=>{const J=mK(j);if(!J)return;const mt=l._component;!Uu(mt)&&!mt.render&&!mt.template&&(mt.template=J.innerHTML),J.nodeType===1&&(J.textContent="");const kt=z(J,!1,pK(J));return J instanceof Element&&(J.removeAttribute("v-cloak"),J.setAttribute("data-v-app","")),kt},l};function pK(d){if(d instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&d instanceof MathMLElement)return"mathml"}function mK(d){return sd(d)?document.querySelector(d):d}/*!
* pinia v3.0.4
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/let FI;const I4=d=>FI=d,RI=Symbol();function aA(d){return d&&typeof d=="object"&&Object.prototype.toString.call(d)==="[object Object]"&&typeof d.toJSON!="function"}var w2;(function(d){d.direct="direct",d.patchObject="patch object",d.patchFunction="patch function"})(w2||(w2={}));function gK(){const d=xz(!0),l=d.run(()=>lo({}));let z=[],j=[];const J=BA({install(mt){I4(J),J._a=mt,mt.provide(RI,J),mt.config.globalProperties.$pinia=J,j.forEach(kt=>z.push(kt)),j=[]},use(mt){return this._a?z.push(mt):j.push(mt),this},_p:z,_a:null,_e:d,_s:new Map,state:l});return J}const BI=()=>{};function oL(d,l,z,j=BI){d.add(l);const J=()=>{d.delete(l)&&j()};return!z&&_z()&&tG(J),J}function Kx(d,...l){d.forEach(z=>{z(...l)})}const vK=d=>d(),sL=Symbol(),w8=Symbol();function oA(d,l){d instanceof Map&&l instanceof Map?l.forEach((z,j)=>d.set(j,z)):d instanceof Set&&l instanceof Set&&l.forEach(d.add,d);for(const z in l){if(!l.hasOwnProperty(z))continue;const j=l[z],J=d[z];aA(J)&&aA(j)&&d.hasOwnProperty(z)&&!Ud(j)&&!d1(j)?d[z]=oA(J,j):d[z]=j}return d}const yK=Symbol();function xK(d){return!aA(d)||!Object.prototype.hasOwnProperty.call(d,yK)}const{assign:r1}=Object;function _K(d){return!!(Ud(d)&&d.effect)}function bK(d,l,z,j){const{state:J,actions:mt,getters:kt}=l,Dt=z.state.value[d];let Gt;function re(){Dt||(z.state.value[d]=J?J():{});const pe=kG(z.state.value[d]);return r1(pe,mt,Object.keys(kt||{}).reduce((Ne,or)=>(Ne[or]=BA(Yo(()=>{I4(z);const _r=z._s.get(d);return kt[or].call(_r,_r)})),Ne),{}))}return Gt=NI(d,re,l,z,j,!0),Gt}function NI(d,l,z={},j,J,mt){let kt;const Dt=r1({actions:{}},z),Gt={deep:!0};let re,pe,Ne=new Set,or=new Set,_r;const Fr=j.state.value[d];!mt&&!Fr&&(j.state.value[d]={}),lo({});let zr;function Wr(Gi){let un;re=pe=!1,typeof Gi=="function"?(Gi(j.state.value[d]),un={type:w2.patchFunction,storeId:d,events:_r}):(oA(j.state.value[d],Gi),un={type:w2.patchObject,payload:Gi,storeId:d,events:_r});const ia=zr=Symbol();Z0().then(()=>{zr===ia&&(re=!0)}),pe=!0,Kx(Ne,un,j.state.value[d])}const An=mt?function(){const{state:un}=z,ia=un?un():{};this.$patch(fa=>{r1(fa,ia)})}:BI;function Ft(){kt.stop(),Ne.clear(),or.clear(),j._s.delete(d)}const kn=(Gi,un="")=>{if(sL in Gi)return Gi[w8]=un,Gi;const ia=function(){I4(j);const fa=Array.from(arguments),Li=new Set,yi=new Set;function ra(Ei){Li.add(Ei)}function Da(Ei){yi.add(Ei)}Kx(or,{args:fa,name:ia[w8],store:jn,after:ra,onError:Da});let Ni;try{Ni=Gi.apply(this&&this.$id===d?this:jn,fa)}catch(Ei){throw Kx(yi,Ei),Ei}return Ni instanceof Promise?Ni.then(Ei=>(Kx(Li,Ei),Ei)).catch(Ei=>(Kx(yi,Ei),Promise.reject(Ei))):(Kx(Li,Ni),Ni)};return ia[sL]=!0,ia[w8]=un,ia},ei={_p:j,$id:d,$onAction:oL.bind(null,or),$patch:Wr,$reset:An,$subscribe(Gi,un={}){const ia=oL(Ne,Gi,un.detached,()=>fa()),fa=kt.run(()=>um(()=>j.state.value[d],Li=>{(un.flush==="sync"?pe:re)&&Gi({storeId:d,type:w2.direct,events:_r},Li)},r1({},Gt,un)));return ia},$dispose:Ft},jn=ky(ei);j._s.set(d,jn);const Qi=(j._a&&j._a.runWithContext||vK)(()=>j._e.run(()=>(kt=xz()).run(()=>l({action:kn}))));for(const Gi in Qi){const un=Qi[Gi];if(Ud(un)&&!_K(un)||d1(un))mt||(Fr&&xK(un)&&(Ud(un)?un.value=Fr[Gi]:oA(un,Fr[Gi])),j.state.value[d][Gi]=un);else if(typeof un=="function"){const ia=kn(un,Gi);Qi[Gi]=ia,Dt.actions[Gi]=un}}return r1(jn,Qi),r1(ju(jn),Qi),Object.defineProperty(jn,"$state",{get:()=>j.state.value[d],set:Gi=>{Wr(un=>{r1(un,Gi)})}}),j._p.forEach(Gi=>{r1(jn,kt.run(()=>Gi({store:jn,app:j._a,pinia:j,options:Dt})))}),Fr&&mt&&z.hydrate&&z.hydrate(jn.$state,Fr),re=!0,pe=!0,jn}/*! #__NO_SIDE_EFFECTS__ */function GA(d,l,z){let j;const J=typeof l=="function";j=J?z:l;function mt(kt,Dt){const Gt=tY();return kt=kt||(Gt?lm(RI,null):null),kt&&I4(kt),kt=FI,kt._s.has(d)||(J?NI(d,l,j,kt):bK(d,j,kt)),kt._s.get(d)}return mt.$id=d,mt}/*!
* vue-router v4.6.3
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/const e_=typeof document<"u";function jI(d){return typeof d=="object"||"displayName"in d||"props"in d||"__vccOpts"in d}function wK(d){return d.__esModule||d[Symbol.toStringTag]==="Module"||d.default&&jI(d.default)}const Dh=Object.assign;function k8(d,l){const z={};for(const j in l){const J=l[j];z[j]=Cm(J)?J.map(d):d(J)}return z}const k2=()=>{},Cm=Array.isArray;function lL(d,l){const z={};for(const j in d)z[j]=j in l?l[j]:d[j];return z}const UI=/#/g,kK=/&/g,TK=/\//g,AK=/=/g,MK=/\?/g,VI=/\+/g,SK=/%5B/g,EK=/%5D/g,HI=/%5E/g,CK=/%60/g,WI=/%7B/g,LK=/%7C/g,qI=/%7D/g,PK=/%20/g;function YA(d){return d==null?"":encodeURI(""+d).replace(LK,"|").replace(SK,"[").replace(EK,"]")}function zK(d){return YA(d).replace(WI,"{").replace(qI,"}").replace(HI,"^")}function sA(d){return YA(d).replace(VI,"%2B").replace(PK,"+").replace(UI,"%23").replace(kK,"%26").replace(CK,"`").replace(WI,"{").replace(qI,"}").replace(HI,"^")}function IK(d){return sA(d).replace(AK,"%3D")}function OK(d){return YA(d).replace(UI,"%23").replace(MK,"%3F")}function DK(d){return OK(d).replace(TK,"%2F")}function B2(d){if(d==null)return null;try{return decodeURIComponent(""+d)}catch{}return""+d}const FK=/\/$/,RK=d=>d.replace(FK,"");function T8(d,l,z="/"){let j,J={},mt="",kt="";const Dt=l.indexOf("#");let Gt=l.indexOf("?");return Gt=Dt>=0&&Gt>Dt?-1:Gt,Gt>=0&&(j=l.slice(0,Gt),mt=l.slice(Gt,Dt>0?Dt:l.length),J=d(mt.slice(1))),Dt>=0&&(j=j||l.slice(0,Dt),kt=l.slice(Dt,l.length)),j=UK(j??l,z),{fullPath:j+mt+kt,path:j,query:J,hash:B2(kt)}}function BK(d,l){const z=l.query?d(l.query):"";return l.path+(z&&"?")+z+(l.hash||"")}function uL(d,l){return!l||!d.toLowerCase().startsWith(l.toLowerCase())?d:d.slice(l.length)||"/"}function NK(d,l,z){const j=l.matched.length-1,J=z.matched.length-1;return j>-1&&j===J&&f_(l.matched[j],z.matched[J])&&ZI(l.params,z.params)&&d(l.query)===d(z.query)&&l.hash===z.hash}function f_(d,l){return(d.aliasOf||d)===(l.aliasOf||l)}function ZI(d,l){if(Object.keys(d).length!==Object.keys(l).length)return!1;for(const z in d)if(!jK(d[z],l[z]))return!1;return!0}function jK(d,l){return Cm(d)?cL(d,l):Cm(l)?cL(l,d):d===l}function cL(d,l){return Cm(l)?d.length===l.length&&d.every((z,j)=>z===l[j]):d.length===1&&d[0]===l}function UK(d,l){if(d.startsWith("/"))return d;if(!d)return l;const z=l.split("/"),j=d.split("/"),J=j[j.length-1];(J===".."||J===".")&&j.push("");let mt=z.length-1,kt,Dt;for(kt=0;kt<j.length;kt++)if(Dt=j[kt],Dt!==".")if(Dt==="..")mt>1&&mt--;else break;return z.slice(0,mt).join("/")+"/"+j.slice(kt).join("/")}const Qv={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let lA=function(d){return d.pop="pop",d.push="push",d}({}),A8=function(d){return d.back="back",d.forward="forward",d.unknown="",d}({});function VK(d){if(!d)if(e_){const l=document.querySelector("base");d=l&&l.getAttribute("href")||"/",d=d.replace(/^\w+:\/\/[^\/]+/,"")}else d="/";return d[0]!=="/"&&d[0]!=="#"&&(d="/"+d),RK(d)}const HK=/^[^#]+#/;function WK(d,l){return d.replace(HK,"#")+l}function qK(d,l){const z=document.documentElement.getBoundingClientRect(),j=d.getBoundingClientRect();return{behavior:l.behavior,left:j.left-z.left-(l.left||0),top:j.top-z.top-(l.top||0)}}const O4=()=>({left:window.scrollX,top:window.scrollY});function ZK(d){let l;if("el"in d){const z=d.el,j=typeof z=="string"&&z.startsWith("#"),J=typeof z=="string"?j?document.getElementById(z.slice(1)):document.querySelector(z):z;if(!J)return;l=qK(J,d)}else l=d;"scrollBehavior"in document.documentElement.style?window.scrollTo(l):window.scrollTo(l.left!=null?l.left:window.scrollX,l.top!=null?l.top:window.scrollY)}function hL(d,l){return(history.state?history.state.position-l:-1)+d}const uA=new Map;function $K(d,l){uA.set(d,l)}function GK(d){const l=uA.get(d);return uA.delete(d),l}function YK(d){return typeof d=="string"||d&&typeof d=="object"}function $I(d){return typeof d=="string"||typeof d=="symbol"}let xd=function(d){return d[d.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",d[d.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",d[d.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",d[d.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",d[d.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",d}({});const GI=Symbol("");xd.MATCHER_NOT_FOUND+"",xd.NAVIGATION_GUARD_REDIRECT+"",xd.NAVIGATION_ABORTED+"",xd.NAVIGATION_CANCELLED+"",xd.NAVIGATION_DUPLICATED+"";function d_(d,l){return Dh(new Error,{type:d,[GI]:!0},l)}function qg(d,l){return d instanceof Error&&GI in d&&(l==null||!!(d.type&l))}const KK=["params","query","hash"];function XK(d){if(typeof d=="string")return d;if(d.path!=null)return d.path;const l={};for(const z of KK)z in d&&(l[z]=d[z]);return JSON.stringify(l,null,2)}function JK(d){const l={};if(d===""||d==="?")return l;const z=(d[0]==="?"?d.slice(1):d).split("&");for(let j=0;j<z.length;++j){const J=z[j].replace(VI," "),mt=J.indexOf("="),kt=B2(mt<0?J:J.slice(0,mt)),Dt=mt<0?null:B2(J.slice(mt+1));if(kt in l){let Gt=l[kt];Cm(Gt)||(Gt=l[kt]=[Gt]),Gt.push(Dt)}else l[kt]=Dt}return l}function fL(d){let l="";for(let z in d){const j=d[z];if(z=IK(z),j==null){j!==void 0&&(l+=(l.length?"&":"")+z);continue}(Cm(j)?j.map(J=>J&&sA(J)):[j&&sA(j)]).forEach(J=>{J!==void 0&&(l+=(l.length?"&":"")+z,J!=null&&(l+="="+J))})}return l}function QK(d){const l={};for(const z in d){const j=d[z];j!==void 0&&(l[z]=Cm(j)?j.map(J=>J==null?null:""+J):j==null?j:""+j)}return l}const tX=Symbol(""),dL=Symbol(""),D4=Symbol(""),KA=Symbol(""),cA=Symbol("");function Jb(){let d=[];function l(j){return d.push(j),()=>{const J=d.indexOf(j);J>-1&&d.splice(J,1)}}function z(){d=[]}return{add:l,list:()=>d.slice(),reset:z}}function o1(d,l,z,j,J,mt=kt=>kt()){const kt=j&&(j.enterCallbacks[J]=j.enterCallbacks[J]||[]);return()=>new Promise((Dt,Gt)=>{const re=or=>{or===!1?Gt(d_(xd.NAVIGATION_ABORTED,{from:z,to:l})):or instanceof Error?Gt(or):YK(or)?Gt(d_(xd.NAVIGATION_GUARD_REDIRECT,{from:l,to:or})):(kt&&j.enterCallbacks[J]===kt&&typeof or=="function"&&kt.push(or),Dt())},pe=mt(()=>d.call(j&&j.instances[J],l,z,re));let Ne=Promise.resolve(pe);d.length<3&&(Ne=Ne.then(re)),Ne.catch(or=>Gt(or))})}function M8(d,l,z,j,J=mt=>mt()){const mt=[];for(const kt of d)for(const Dt in kt.components){let Gt=kt.components[Dt];if(!(l!=="beforeRouteEnter"&&!kt.instances[Dt]))if(jI(Gt)){const re=(Gt.__vccOpts||Gt)[l];re&&mt.push(o1(re,z,j,kt,Dt,J))}else{let re=Gt();mt.push(()=>re.then(pe=>{if(!pe)throw new Error(`Couldn't resolve component "${Dt}" at "${kt.path}"`);const Ne=wK(pe)?pe.default:pe;kt.mods[Dt]=pe,kt.components[Dt]=Ne;const or=(Ne.__vccOpts||Ne)[l];return or&&o1(or,z,j,kt,Dt,J)()}))}}return mt}function eX(d,l){const z=[],j=[],J=[],mt=Math.max(l.matched.length,d.matched.length);for(let kt=0;kt<mt;kt++){const Dt=l.matched[kt];Dt&&(d.matched.find(re=>f_(re,Dt))?j.push(Dt):z.push(Dt));const Gt=d.matched[kt];Gt&&(l.matched.find(re=>f_(re,Gt))||J.push(Gt))}return[z,j,J]}/*!
* vue-router v4.6.3
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/let rX=()=>location.protocol+"//"+location.host;function YI(d,l){const{pathname:z,search:j,hash:J}=l,mt=d.indexOf("#");if(mt>-1){let kt=J.includes(d.slice(mt))?d.slice(mt).length:1,Dt=J.slice(kt);return Dt[0]!=="/"&&(Dt="/"+Dt),uL(Dt,"")}return uL(z,d)+j+J}function nX(d,l,z,j){let J=[],mt=[],kt=null;const Dt=({state:or})=>{const _r=YI(d,location),Fr=z.value,zr=l.value;let Wr=0;if(or){if(z.value=_r,l.value=or,kt&&kt===Fr){kt=null;return}Wr=zr?or.position-zr.position:0}else j(_r);J.forEach(An=>{An(z.value,Fr,{delta:Wr,type:lA.pop,direction:Wr?Wr>0?A8.forward:A8.back:A8.unknown})})};function Gt(){kt=z.value}function re(or){J.push(or);const _r=()=>{const Fr=J.indexOf(or);Fr>-1&&J.splice(Fr,1)};return mt.push(_r),_r}function pe(){if(document.visibilityState==="hidden"){const{history:or}=window;if(!or.state)return;or.replaceState(Dh({},or.state,{scroll:O4()}),"")}}function Ne(){for(const or of mt)or();mt=[],window.removeEventListener("popstate",Dt),window.removeEventListener("pagehide",pe),document.removeEventListener("visibilitychange",pe)}return window.addEventListener("popstate",Dt),window.addEventListener("pagehide",pe),document.addEventListener("visibilitychange",pe),{pauseListeners:Gt,listen:re,destroy:Ne}}function pL(d,l,z,j=!1,J=!1){return{back:d,current:l,forward:z,replaced:j,position:window.history.length,scroll:J?O4():null}}function iX(d){const{history:l,location:z}=window,j={value:YI(d,z)},J={value:l.state};J.value||mt(j.value,{back:null,current:j.value,forward:null,position:l.length-1,replaced:!0,scroll:null},!0);function mt(Gt,re,pe){const Ne=d.indexOf("#"),or=Ne>-1?(z.host&&document.querySelector("base")?d:d.slice(Ne))+Gt:rX()+d+Gt;try{l[pe?"replaceState":"pushState"](re,"",or),J.value=re}catch(_r){console.error(_r),z[pe?"replace":"assign"](or)}}function kt(Gt,re){mt(Gt,Dh({},l.state,pL(J.value.back,Gt,J.value.forward,!0),re,{position:J.value.position}),!0),j.value=Gt}function Dt(Gt,re){const pe=Dh({},J.value,l.state,{forward:Gt,scroll:O4()});mt(pe.current,pe,!0),mt(Gt,Dh({},pL(j.value,Gt,null),{position:pe.position+1},re),!1),j.value=Gt}return{location:j,state:J,push:Dt,replace:kt}}function aX(d){d=VK(d);const l=iX(d),z=nX(d,l.state,l.location,l.replace);function j(mt,kt=!0){kt||z.pauseListeners(),history.go(mt)}const J=Dh({location:"",base:d,go:j,createHref:WK.bind(null,d)},l,z);return Object.defineProperty(J,"location",{enumerable:!0,get:()=>l.location.value}),Object.defineProperty(J,"state",{enumerable:!0,get:()=>l.state.value}),J}let gy=function(d){return d[d.Static=0]="Static",d[d.Param=1]="Param",d[d.Group=2]="Group",d}({});var ip=function(d){return d[d.Static=0]="Static",d[d.Param=1]="Param",d[d.ParamRegExp=2]="ParamRegExp",d[d.ParamRegExpEnd=3]="ParamRegExpEnd",d[d.EscapeNext=4]="EscapeNext",d}(ip||{});const oX={type:gy.Static,value:""},sX=/[a-zA-Z0-9_]/;function lX(d){if(!d)return[[]];if(d==="/")return[[oX]];if(!d.startsWith("/"))throw new Error(`Invalid path "${d}"`);function l(_r){throw new Error(`ERR (${z})/"${re}": ${_r}`)}let z=ip.Static,j=z;const J=[];let mt;function kt(){mt&&J.push(mt),mt=[]}let Dt=0,Gt,re="",pe="";function Ne(){re&&(z===ip.Static?mt.push({type:gy.Static,value:re}):z===ip.Param||z===ip.ParamRegExp||z===ip.ParamRegExpEnd?(mt.length>1&&(Gt==="*"||Gt==="+")&&l(`A repeatable param (${re}) must be alone in its segment. eg: '/:ids+.`),mt.push({type:gy.Param,value:re,regexp:pe,repeatable:Gt==="*"||Gt==="+",optional:Gt==="*"||Gt==="?"})):l("Invalid state to consume buffer"),re="")}function or(){re+=Gt}for(;Dt<d.length;){if(Gt=d[Dt++],Gt==="\\"&&z!==ip.ParamRegExp){j=z,z=ip.EscapeNext;continue}switch(z){case ip.Static:Gt==="/"?(re&&Ne(),kt()):Gt===":"?(Ne(),z=ip.Param):or();break;case ip.EscapeNext:or(),z=j;break;case ip.Param:Gt==="("?z=ip.ParamRegExp:sX.test(Gt)?or():(Ne(),z=ip.Static,Gt!=="*"&&Gt!=="?"&&Gt!=="+"&&Dt--);break;case ip.ParamRegExp:Gt===")"?pe[pe.length-1]=="\\"?pe=pe.slice(0,-1)+Gt:z=ip.ParamRegExpEnd:pe+=Gt;break;case ip.ParamRegExpEnd:Ne(),z=ip.Static,Gt!=="*"&&Gt!=="?"&&Gt!=="+"&&Dt--,pe="";break;default:l("Unknown state");break}}return z===ip.ParamRegExp&&l(`Unfinished custom RegExp for param "${re}"`),Ne(),kt(),J}const mL="[^/]+?",uX={sensitive:!1,strict:!1,start:!0,end:!0};var h0=function(d){return d[d._multiplier=10]="_multiplier",d[d.Root=90]="Root",d[d.Segment=40]="Segment",d[d.SubSegment=30]="SubSegment",d[d.Static=40]="Static",d[d.Dynamic=20]="Dynamic",d[d.BonusCustomRegExp=10]="BonusCustomRegExp",d[d.BonusWildcard=-50]="BonusWildcard",d[d.BonusRepeatable=-20]="BonusRepeatable",d[d.BonusOptional=-8]="BonusOptional",d[d.BonusStrict=.7000000000000001]="BonusStrict",d[d.BonusCaseSensitive=.25]="BonusCaseSensitive",d}(h0||{});const cX=/[.+*?^${}()[\]/\\]/g;function hX(d,l){const z=Dh({},uX,l),j=[];let J=z.start?"^":"";const mt=[];for(const re of d){const pe=re.length?[]:[h0.Root];z.strict&&!re.length&&(J+="/");for(let Ne=0;Ne<re.length;Ne++){const or=re[Ne];let _r=h0.Segment+(z.sensitive?h0.BonusCaseSensitive:0);if(or.type===gy.Static)Ne||(J+="/"),J+=or.value.replace(cX,"\\$&"),_r+=h0.Static;else if(or.type===gy.Param){const{value:Fr,repeatable:zr,optional:Wr,regexp:An}=or;mt.push({name:Fr,repeatable:zr,optional:Wr});const Ft=An||mL;if(Ft!==mL){_r+=h0.BonusCustomRegExp;try{`${Ft}`}catch(ei){throw new Error(`Invalid custom RegExp for param "${Fr}" (${Ft}): `+ei.message)}}let kn=zr?`((?:${Ft})(?:/(?:${Ft}))*)`:`(${Ft})`;Ne||(kn=Wr&&re.length<2?`(?:/${kn})`:"/"+kn),Wr&&(kn+="?"),J+=kn,_r+=h0.Dynamic,Wr&&(_r+=h0.BonusOptional),zr&&(_r+=h0.BonusRepeatable),Ft===".*"&&(_r+=h0.BonusWildcard)}pe.push(_r)}j.push(pe)}if(z.strict&&z.end){const re=j.length-1;j[re][j[re].length-1]+=h0.BonusStrict}z.strict||(J+="/?"),z.end?J+="$":z.strict&&!J.endsWith("/")&&(J+="(?:/|$)");const kt=new RegExp(J,z.sensitive?"":"i");function Dt(re){const pe=re.match(kt),Ne={};if(!pe)return null;for(let or=1;or<pe.length;or++){const _r=pe[or]||"",Fr=mt[or-1];Ne[Fr.name]=_r&&Fr.repeatable?_r.split("/"):_r}return Ne}function Gt(re){let pe="",Ne=!1;for(const or of d){(!Ne||!pe.endsWith("/"))&&(pe+="/"),Ne=!1;for(const _r of or)if(_r.type===gy.Static)pe+=_r.value;else if(_r.type===gy.Param){const{value:Fr,repeatable:zr,optional:Wr}=_r,An=Fr in re?re[Fr]:"";if(Cm(An)&&!zr)throw new Error(`Provided param "${Fr}" is an array but it is not repeatable (* or + modifiers)`);const Ft=Cm(An)?An.join("/"):An;if(!Ft)if(Wr)or.length<2&&(pe.endsWith("/")?pe=pe.slice(0,-1):Ne=!0);else throw new Error(`Missing required param "${Fr}"`);pe+=Ft}}return pe||"/"}return{re:kt,score:j,keys:mt,parse:Dt,stringify:Gt}}function fX(d,l){let z=0;for(;z<d.length&&z<l.length;){const j=l[z]-d[z];if(j)return j;z++}return d.length<l.length?d.length===1&&d[0]===h0.Static+h0.Segment?-1:1:d.length>l.length?l.length===1&&l[0]===h0.Static+h0.Segment?1:-1:0}function KI(d,l){let z=0;const j=d.score,J=l.score;for(;z<j.length&&z<J.length;){const mt=fX(j[z],J[z]);if(mt)return mt;z++}if(Math.abs(J.length-j.length)===1){if(gL(j))return 1;if(gL(J))return-1}return J.length-j.length}function gL(d){const l=d[d.length-1];return d.length>0&&l[l.length-1]<0}const dX={strict:!1,end:!0,sensitive:!1};function pX(d,l,z){const j=hX(lX(d.path),z),J=Dh(j,{record:d,parent:l,children:[],alias:[]});return l&&!J.record.aliasOf==!l.record.aliasOf&&l.children.push(J),J}function mX(d,l){const z=[],j=new Map;l=lL(dX,l);function J(Ne){return j.get(Ne)}function mt(Ne,or,_r){const Fr=!_r,zr=yL(Ne);zr.aliasOf=_r&&_r.record;const Wr=lL(l,Ne),An=[zr];if("alias"in Ne){const ei=typeof Ne.alias=="string"?[Ne.alias]:Ne.alias;for(const jn of ei)An.push(yL(Dh({},zr,{components:_r?_r.record.components:zr.components,path:jn,aliasOf:_r?_r.record:zr})))}let Ft,kn;for(const ei of An){const{path:jn}=ei;if(or&&jn[0]!=="/"){const ai=or.record.path,Qi=ai[ai.length-1]==="/"?"":"/";ei.path=or.record.path+(jn&&Qi+jn)}if(Ft=pX(ei,or,Wr),_r?_r.alias.push(Ft):(kn=kn||Ft,kn!==Ft&&kn.alias.push(Ft),Fr&&Ne.name&&!xL(Ft)&&kt(Ne.name)),XI(Ft)&&Gt(Ft),zr.children){const ai=zr.children;for(let Qi=0;Qi<ai.length;Qi++)mt(ai[Qi],Ft,_r&&_r.children[Qi])}_r=_r||Ft}return kn?()=>{kt(kn)}:k2}function kt(Ne){if($I(Ne)){const or=j.get(Ne);or&&(j.delete(Ne),z.splice(z.indexOf(or),1),or.children.forEach(kt),or.alias.forEach(kt))}else{const or=z.indexOf(Ne);or>-1&&(z.splice(or,1),Ne.record.name&&j.delete(Ne.record.name),Ne.children.forEach(kt),Ne.alias.forEach(kt))}}function Dt(){return z}function Gt(Ne){const or=yX(Ne,z);z.splice(or,0,Ne),Ne.record.name&&!xL(Ne)&&j.set(Ne.record.name,Ne)}function re(Ne,or){let _r,Fr={},zr,Wr;if("name"in Ne&&Ne.name){if(_r=j.get(Ne.name),!_r)throw d_(xd.MATCHER_NOT_FOUND,{location:Ne});Wr=_r.record.name,Fr=Dh(vL(or.params,_r.keys.filter(kn=>!kn.optional).concat(_r.parent?_r.parent.keys.filter(kn=>kn.optional):[]).map(kn=>kn.name)),Ne.params&&vL(Ne.params,_r.keys.map(kn=>kn.name))),zr=_r.stringify(Fr)}else if(Ne.path!=null)zr=Ne.path,_r=z.find(kn=>kn.re.test(zr)),_r&&(Fr=_r.parse(zr),Wr=_r.record.name);else{if(_r=or.name?j.get(or.name):z.find(kn=>kn.re.test(or.path)),!_r)throw d_(xd.MATCHER_NOT_FOUND,{location:Ne,currentLocation:or});Wr=_r.record.name,Fr=Dh({},or.params,Ne.params),zr=_r.stringify(Fr)}const An=[];let Ft=_r;for(;Ft;)An.unshift(Ft.record),Ft=Ft.parent;return{name:Wr,path:zr,params:Fr,matched:An,meta:vX(An)}}d.forEach(Ne=>mt(Ne));function pe(){z.length=0,j.clear()}return{addRoute:mt,resolve:re,removeRoute:kt,clearRoutes:pe,getRoutes:Dt,getRecordMatcher:J}}function vL(d,l){const z={};for(const j of l)j in d&&(z[j]=d[j]);return z}function yL(d){const l={path:d.path,redirect:d.redirect,name:d.name,meta:d.meta||{},aliasOf:d.aliasOf,beforeEnter:d.beforeEnter,props:gX(d),children:d.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in d?d.components||null:d.component&&{default:d.component}};return Object.defineProperty(l,"mods",{value:{}}),l}function gX(d){const l={},z=d.props||!1;if("component"in d)l.default=z;else for(const j in d.components)l[j]=typeof z=="object"?z[j]:z;return l}function xL(d){for(;d;){if(d.record.aliasOf)return!0;d=d.parent}return!1}function vX(d){return d.reduce((l,z)=>Dh(l,z.meta),{})}function yX(d,l){let z=0,j=l.length;for(;z!==j;){const mt=z+j>>1;KI(d,l[mt])<0?j=mt:z=mt+1}const J=xX(d);return J&&(j=l.lastIndexOf(J,j-1)),j}function xX(d){let l=d;for(;l=l.parent;)if(XI(l)&&KI(d,l)===0)return l}function XI({record:d}){return!!(d.name||d.components&&Object.keys(d.components).length||d.redirect)}function _L(d){const l=lm(D4),z=lm(KA),j=Yo(()=>{const Gt=Ju(d.to);return l.resolve(Gt)}),J=Yo(()=>{const{matched:Gt}=j.value,{length:re}=Gt,pe=Gt[re-1],Ne=z.matched;if(!pe||!Ne.length)return-1;const or=Ne.findIndex(f_.bind(null,pe));if(or>-1)return or;const _r=bL(Gt[re-2]);return re>1&&bL(pe)===_r&&Ne[Ne.length-1].path!==_r?Ne.findIndex(f_.bind(null,Gt[re-2])):or}),mt=Yo(()=>J.value>-1&&TX(z.params,j.value.params)),kt=Yo(()=>J.value>-1&&J.value===z.matched.length-1&&ZI(z.params,j.value.params));function Dt(Gt={}){if(kX(Gt)){const re=l[Ju(d.replace)?"replace":"push"](Ju(d.to)).catch(k2);return d.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>re),re}return Promise.resolve()}return{route:j,href:Yo(()=>j.value.href),isActive:mt,isExactActive:kt,navigate:Dt}}function _X(d){return d.length===1?d[0]:d}const bX=Th({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:_L,setup(d,{slots:l}){const z=ky(_L(d)),{options:j}=lm(D4),J=Yo(()=>({[wL(d.activeClass,j.linkActiveClass,"router-link-active")]:z.isActive,[wL(d.exactActiveClass,j.linkExactActiveClass,"router-link-exact-active")]:z.isExactActive}));return()=>{const mt=l.default&&_X(l.default(z));return d.custom?mt:ZA("a",{"aria-current":z.isExactActive?d.ariaCurrentValue:null,href:z.href,onClick:z.navigate,class:J.value},mt)}}}),wX=bX;function kX(d){if(!(d.metaKey||d.altKey||d.ctrlKey||d.shiftKey)&&!d.defaultPrevented&&!(d.button!==void 0&&d.button!==0)){if(d.currentTarget&&d.currentTarget.getAttribute){const l=d.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(l))return}return d.preventDefault&&d.preventDefault(),!0}}function TX(d,l){for(const z in l){const j=l[z],J=d[z];if(typeof j=="string"){if(j!==J)return!1}else if(!Cm(J)||J.length!==j.length||j.some((mt,kt)=>mt!==J[kt]))return!1}return!0}function bL(d){return d?d.aliasOf?d.aliasOf.path:d.path:""}const wL=(d,l,z)=>d??l??z,AX=Th({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(d,{attrs:l,slots:z}){const j=lm(cA),J=Yo(()=>d.route||j.value),mt=lm(dL,0),kt=Yo(()=>{let re=Ju(mt);const{matched:pe}=J.value;let Ne;for(;(Ne=pe[re])&&!Ne.components;)re++;return re}),Dt=Yo(()=>J.value.matched[kt.value]);H5(dL,Yo(()=>kt.value+1)),H5(tX,Dt),H5(cA,J);const Gt=lo();return um(()=>[Gt.value,Dt.value,d.name],([re,pe,Ne],[or,_r,Fr])=>{pe&&(pe.instances[Ne]=re,_r&&_r!==pe&&re&&re===or&&(pe.leaveGuards.size||(pe.leaveGuards=_r.leaveGuards),pe.updateGuards.size||(pe.updateGuards=_r.updateGuards))),re&&pe&&(!_r||!f_(pe,_r)||!or)&&(pe.enterCallbacks[Ne]||[]).forEach(zr=>zr(re))},{flush:"post"}),()=>{const re=J.value,pe=d.name,Ne=Dt.value,or=Ne&&Ne.components[pe];if(!or)return kL(z.default,{Component:or,route:re});const _r=Ne.props[pe],Fr=_r?_r===!0?re.params:typeof _r=="function"?_r(re):_r:null,Wr=ZA(or,Dh({},Fr,l,{onVnodeUnmounted:An=>{An.component.isUnmounted&&(Ne.instances[pe]=null)},ref:Gt}));return kL(z.default,{Component:Wr,route:re})||Wr}}});function kL(d,l){if(!d)return null;const z=d(l);return z.length===1?z[0]:z}const MX=AX;function SX(d){const l=mX(d.routes,d),z=d.parseQuery||JK,j=d.stringifyQuery||fL,J=d.history,mt=Jb(),kt=Jb(),Dt=Jb(),Gt=_G(Qv);let re=Qv;e_&&d.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const pe=k8.bind(null,Ea=>""+Ea),Ne=k8.bind(null,DK),or=k8.bind(null,B2);function _r(Ea,go){let Ao,Ps;return $I(Ea)?(Ao=l.getRecordMatcher(Ea),Ps=go):Ps=Ea,l.addRoute(Ps,Ao)}function Fr(Ea){const go=l.getRecordMatcher(Ea);go&&l.removeRoute(go)}function zr(){return l.getRoutes().map(Ea=>Ea.record)}function Wr(Ea){return!!l.getRecordMatcher(Ea)}function An(Ea,go){if(go=Dh({},go||Gt.value),typeof Ea=="string"){const li=T8(z,Ea,go.path),co=l.resolve({path:li.path},go),vo=J.createHref(li.fullPath);return Dh(li,co,{params:or(co.params),hash:B2(li.hash),redirectedFrom:void 0,href:vo})}let Ao;if(Ea.path!=null)Ao=Dh({},Ea,{path:T8(z,Ea.path,go.path).path});else{const li=Dh({},Ea.params);for(const co in li)li[co]==null&&delete li[co];Ao=Dh({},Ea,{params:Ne(li)}),go.params=Ne(go.params)}const Ps=l.resolve(Ao,go),$o=Ea.hash||"";Ps.params=pe(or(Ps.params));const gi=BK(j,Dh({},Ea,{hash:zK($o),path:Ps.path})),bi=J.createHref(gi);return Dh({fullPath:gi,hash:$o,query:j===fL?QK(Ea.query):Ea.query||{}},Ps,{redirectedFrom:void 0,href:bi})}function Ft(Ea){return typeof Ea=="string"?T8(z,Ea,Gt.value.path):Dh({},Ea)}function kn(Ea,go){if(re!==Ea)return d_(xd.NAVIGATION_CANCELLED,{from:go,to:Ea})}function ei(Ea){return Qi(Ea)}function jn(Ea){return ei(Dh(Ft(Ea),{replace:!0}))}function ai(Ea,go){const Ao=Ea.matched[Ea.matched.length-1];if(Ao&&Ao.redirect){const{redirect:Ps}=Ao;let $o=typeof Ps=="function"?Ps(Ea,go):Ps;return typeof $o=="string"&&($o=$o.includes("?")||$o.includes("#")?$o=Ft($o):{path:$o},$o.params={}),Dh({query:Ea.query,hash:Ea.hash,params:$o.path!=null?{}:Ea.params},$o)}}function Qi(Ea,go){const Ao=re=An(Ea),Ps=Gt.value,$o=Ea.state,gi=Ea.force,bi=Ea.replace===!0,li=ai(Ao,Ps);if(li)return Qi(Dh(Ft(li),{state:typeof li=="object"?Dh({},$o,li.state):$o,force:gi,replace:bi}),go||Ao);const co=Ao;co.redirectedFrom=go;let vo;return!gi&&NK(j,Ps,Ao)&&(vo=d_(xd.NAVIGATION_DUPLICATED,{to:co,from:Ps}),ko(Ps,Ps,!0,!1)),(vo?Promise.resolve(vo):ia(co,Ps)).catch(yo=>qg(yo)?qg(yo,xd.NAVIGATION_GUARD_REDIRECT)?yo:mo(yo):Va(yo,co,Ps)).then(yo=>{if(yo){if(qg(yo,xd.NAVIGATION_GUARD_REDIRECT))return Qi(Dh({replace:bi},Ft(yo.to),{state:typeof yo.to=="object"?Dh({},$o,yo.to.state):$o,force:gi}),go||co)}else yo=Li(co,Ps,!0,bi,$o);return fa(co,Ps,yo),yo})}function Gi(Ea,go){const Ao=kn(Ea,go);return Ao?Promise.reject(Ao):Promise.resolve()}function un(Ea){const go=qo.values().next().value;return go&&typeof go.runWithContext=="function"?go.runWithContext(Ea):Ea()}function ia(Ea,go){let Ao;const[Ps,$o,gi]=eX(Ea,go);Ao=M8(Ps.reverse(),"beforeRouteLeave",Ea,go);for(const li of Ps)li.leaveGuards.forEach(co=>{Ao.push(o1(co,Ea,go))});const bi=Gi.bind(null,Ea,go);return Ao.push(bi),Ta(Ao).then(()=>{Ao=[];for(const li of mt.list())Ao.push(o1(li,Ea,go));return Ao.push(bi),Ta(Ao)}).then(()=>{Ao=M8($o,"beforeRouteUpdate",Ea,go);for(const li of $o)li.updateGuards.forEach(co=>{Ao.push(o1(co,Ea,go))});return Ao.push(bi),Ta(Ao)}).then(()=>{Ao=[];for(const li of gi)if(li.beforeEnter)if(Cm(li.beforeEnter))for(const co of li.beforeEnter)Ao.push(o1(co,Ea,go));else Ao.push(o1(li.beforeEnter,Ea,go));return Ao.push(bi),Ta(Ao)}).then(()=>(Ea.matched.forEach(li=>li.enterCallbacks={}),Ao=M8(gi,"beforeRouteEnter",Ea,go,un),Ao.push(bi),Ta(Ao))).then(()=>{Ao=[];for(const li of kt.list())Ao.push(o1(li,Ea,go));return Ao.push(bi),Ta(Ao)}).catch(li=>qg(li,xd.NAVIGATION_CANCELLED)?li:Promise.reject(li))}function fa(Ea,go,Ao){Dt.list().forEach(Ps=>un(()=>Ps(Ea,go,Ao)))}function Li(Ea,go,Ao,Ps,$o){const gi=kn(Ea,go);if(gi)return gi;const bi=go===Qv,li=e_?history.state:{};Ao&&(Ps||bi?J.replace(Ea.fullPath,Dh({scroll:bi&&li&&li.scroll},$o)):J.push(Ea.fullPath,$o)),Gt.value=Ea,ko(Ea,go,Ao,bi),mo()}let yi;function ra(){yi||(yi=J.listen((Ea,go,Ao)=>{if(!fo.listening)return;const Ps=An(Ea),$o=ai(Ps,fo.currentRoute.value);if($o){Qi(Dh($o,{replace:!0,force:!0}),Ps).catch(k2);return}re=Ps;const gi=Gt.value;e_&&$K(hL(gi.fullPath,Ao.delta),O4()),ia(Ps,gi).catch(bi=>qg(bi,xd.NAVIGATION_ABORTED|xd.NAVIGATION_CANCELLED)?bi:qg(bi,xd.NAVIGATION_GUARD_REDIRECT)?(Qi(Dh(Ft(bi.to),{force:!0}),Ps).then(li=>{qg(li,xd.NAVIGATION_ABORTED|xd.NAVIGATION_DUPLICATED)&&!Ao.delta&&Ao.type===lA.pop&&J.go(-1,!1)}).catch(k2),Promise.reject()):(Ao.delta&&J.go(-Ao.delta,!1),Va(bi,Ps,gi))).then(bi=>{bi=bi||Li(Ps,gi,!1),bi&&(Ao.delta&&!qg(bi,xd.NAVIGATION_CANCELLED)?J.go(-Ao.delta,!1):Ao.type===lA.pop&&qg(bi,xd.NAVIGATION_ABORTED|xd.NAVIGATION_DUPLICATED)&&J.go(-1,!1)),fa(Ps,gi,bi)}).catch(k2)}))}let Da=Jb(),Ni=Jb(),Ei;function Va(Ea,go,Ao){mo(Ea);const Ps=Ni.list();return Ps.length?Ps.forEach($o=>$o(Ea,go,Ao)):console.error(Ea),Promise.reject(Ea)}function ss(){return Ei&&Gt.value!==Qv?Promise.resolve():new Promise((Ea,go)=>{Da.add([Ea,go])})}function mo(Ea){return Ei||(Ei=!Ea,ra(),Da.list().forEach(([go,Ao])=>Ea?Ao(Ea):go()),Da.reset()),Ea}function ko(Ea,go,Ao,Ps){const{scrollBehavior:$o}=d;if(!e_||!$o)return Promise.resolve();const gi=!Ao&&GK(hL(Ea.fullPath,0))||(Ps||!Ao)&&history.state&&history.state.scroll||null;return Z0().then(()=>$o(Ea,go,gi)).then(bi=>bi&&ZK(bi)).catch(bi=>Va(bi,Ea,go))}const pl=Ea=>J.go(Ea);let fu;const qo=new Set,fo={currentRoute:Gt,listening:!0,addRoute:_r,removeRoute:Fr,clearRoutes:l.clearRoutes,hasRoute:Wr,getRoutes:zr,resolve:An,options:d,push:ei,replace:jn,go:pl,back:()=>pl(-1),forward:()=>pl(1),beforeEach:mt.add,beforeResolve:kt.add,afterEach:Dt.add,onError:Ni.add,isReady:ss,install(Ea){Ea.component("RouterLink",wX),Ea.component("RouterView",MX),Ea.config.globalProperties.$router=fo,Object.defineProperty(Ea.config.globalProperties,"$route",{enumerable:!0,get:()=>Ju(Gt)}),e_&&!fu&&Gt.value===Qv&&(fu=!0,ei(J.location).catch(Ps=>{}));const go={};for(const Ps in Qv)Object.defineProperty(go,Ps,{get:()=>Gt.value[Ps],enumerable:!0});Ea.provide(D4,fo),Ea.provide(KA,Dz(go)),Ea.provide(cA,Gt);const Ao=Ea.unmount;qo.add(Ea),Ea.unmount=function(){qo.delete(Ea),qo.size<1&&(re=Qv,yi&&yi(),yi=null,Gt.value=Qv,fu=!1,Ei=!1),Ao()}}};function Ta(Ea){return Ea.reduce((go,Ao)=>go.then(()=>un(Ao)),Promise.resolve())}return fo}function JI(){return lm(D4)}function QI(d){return lm(KA)}function tO(d,l){return function(){return d.apply(l,arguments)}}const{toString:EX}=Object.prototype,{getPrototypeOf:XA}=Object,{iterator:F4,toStringTag:eO}=Symbol,R4=(d=>l=>{const z=EX.call(l);return d[z]||(d[z]=z.slice(8,-1).toLowerCase())})(Object.create(null)),Lm=d=>(d=d.toLowerCase(),l=>R4(l)===d),B4=d=>l=>typeof l===d,{isArray:y_}=Array,p_=B4("undefined");function J2(d){return d!==null&&!p_(d)&&d.constructor!==null&&!p_(d.constructor)&&S0(d.constructor.isBuffer)&&d.constructor.isBuffer(d)}const rO=Lm("ArrayBuffer");function CX(d){let l;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?l=ArrayBuffer.isView(d):l=d&&d.buffer&&rO(d.buffer),l}const LX=B4("string"),S0=B4("function"),nO=B4("number"),Q2=d=>d!==null&&typeof d=="object",PX=d=>d===!0||d===!1,$5=d=>{if(R4(d)!=="object")return!1;const l=XA(d);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(eO in d)&&!(F4 in d)},zX=d=>{if(!Q2(d)||J2(d))return!1;try{return Object.keys(d).length===0&&Object.getPrototypeOf(d)===Object.prototype}catch{return!1}},IX=Lm("Date"),OX=Lm("File"),DX=Lm("Blob"),FX=Lm("FileList"),RX=d=>Q2(d)&&S0(d.pipe),BX=d=>{let l;return d&&(typeof FormData=="function"&&d instanceof FormData||S0(d.append)&&((l=R4(d))==="formdata"||l==="object"&&S0(d.toString)&&d.toString()==="[object FormData]"))},NX=Lm("URLSearchParams"),[jX,UX,VX,HX]=["ReadableStream","Request","Response","Headers"].map(Lm),WX=d=>d.trim?d.trim():d.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function tw(d,l,{allOwnKeys:z=!1}={}){if(d===null||typeof d>"u")return;let j,J;if(typeof d!="object"&&(d=[d]),y_(d))for(j=0,J=d.length;j<J;j++)l.call(null,d[j],j,d);else{if(J2(d))return;const mt=z?Object.getOwnPropertyNames(d):Object.keys(d),kt=mt.length;let Dt;for(j=0;j<kt;j++)Dt=mt[j],l.call(null,d[Dt],Dt,d)}}function iO(d,l){if(J2(d))return null;l=l.toLowerCase();const z=Object.keys(d);let j=z.length,J;for(;j-- >0;)if(J=z[j],l===J.toLowerCase())return J;return null}const vy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,aO=d=>!p_(d)&&d!==vy;function hA(){const{caseless:d,skipUndefined:l}=aO(this)&&this||{},z={},j=(J,mt)=>{const kt=d&&iO(z,mt)||mt;$5(z[kt])&&$5(J)?z[kt]=hA(z[kt],J):$5(J)?z[kt]=hA({},J):y_(J)?z[kt]=J.slice():(!l||!p_(J))&&(z[kt]=J)};for(let J=0,mt=arguments.length;J<mt;J++)arguments[J]&&tw(arguments[J],j);return z}const qX=(d,l,z,{allOwnKeys:j}={})=>(tw(l,(J,mt)=>{z&&S0(J)?d[mt]=tO(J,z):d[mt]=J},{allOwnKeys:j}),d),ZX=d=>(d.charCodeAt(0)===65279&&(d=d.slice(1)),d),$X=(d,l,z,j)=>{d.prototype=Object.create(l.prototype,j),d.prototype.constructor=d,Object.defineProperty(d,"super",{value:l.prototype}),z&&Object.assign(d.prototype,z)},GX=(d,l,z,j)=>{let J,mt,kt;const Dt={};if(l=l||{},d==null)return l;do{for(J=Object.getOwnPropertyNames(d),mt=J.length;mt-- >0;)kt=J[mt],(!j||j(kt,d,l))&&!Dt[kt]&&(l[kt]=d[kt],Dt[kt]=!0);d=z!==!1&&XA(d)}while(d&&(!z||z(d,l))&&d!==Object.prototype);return l},YX=(d,l,z)=>{d=String(d),(z===void 0||z>d.length)&&(z=d.length),z-=l.length;const j=d.indexOf(l,z);return j!==-1&&j===z},KX=d=>{if(!d)return null;if(y_(d))return d;let l=d.length;if(!nO(l))return null;const z=new Array(l);for(;l-- >0;)z[l]=d[l];return z},XX=(d=>l=>d&&l instanceof d)(typeof Uint8Array<"u"&&XA(Uint8Array)),JX=(d,l)=>{const j=(d&&d[F4]).call(d);let J;for(;(J=j.next())&&!J.done;){const mt=J.value;l.call(d,mt[0],mt[1])}},QX=(d,l)=>{let z;const j=[];for(;(z=d.exec(l))!==null;)j.push(z);return j},tJ=Lm("HTMLFormElement"),eJ=d=>d.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(z,j,J){return j.toUpperCase()+J}),TL=(({hasOwnProperty:d})=>(l,z)=>d.call(l,z))(Object.prototype),rJ=Lm("RegExp"),oO=(d,l)=>{const z=Object.getOwnPropertyDescriptors(d),j={};tw(z,(J,mt)=>{let kt;(kt=l(J,mt,d))!==!1&&(j[mt]=kt||J)}),Object.defineProperties(d,j)},nJ=d=>{oO(d,(l,z)=>{if(S0(d)&&["arguments","caller","callee"].indexOf(z)!==-1)return!1;const j=d[z];if(S0(j)){if(l.enumerable=!1,"writable"in l){l.writable=!1;return}l.set||(l.set=()=>{throw Error("Can not rewrite read-only method '"+z+"'")})}})},iJ=(d,l)=>{const z={},j=J=>{J.forEach(mt=>{z[mt]=!0})};return y_(d)?j(d):j(String(d).split(l)),z},aJ=()=>{},oJ=(d,l)=>d!=null&&Number.isFinite(d=+d)?d:l;function sJ(d){return!!(d&&S0(d.append)&&d[eO]==="FormData"&&d[F4])}const lJ=d=>{const l=new Array(10),z=(j,J)=>{if(Q2(j)){if(l.indexOf(j)>=0)return;if(J2(j))return j;if(!("toJSON"in j)){l[J]=j;const mt=y_(j)?[]:{};return tw(j,(kt,Dt)=>{const Gt=z(kt,J+1);!p_(Gt)&&(mt[Dt]=Gt)}),l[J]=void 0,mt}}return j};return z(d,0)},uJ=Lm("AsyncFunction"),cJ=d=>d&&(Q2(d)||S0(d))&&S0(d.then)&&S0(d.catch),sO=((d,l)=>d?setImmediate:l?((z,j)=>(vy.addEventListener("message",({source:J,data:mt})=>{J===vy&&mt===z&&j.length&&j.shift()()},!1),J=>{j.push(J),vy.postMessage(z,"*")}))(`axios@${Math.random()}`,[]):z=>setTimeout(z))(typeof setImmediate=="function",S0(vy.postMessage)),hJ=typeof queueMicrotask<"u"?queueMicrotask.bind(vy):typeof process<"u"&&process.nextTick||sO,fJ=d=>d!=null&&S0(d[F4]),to={isArray:y_,isArrayBuffer:rO,isBuffer:J2,isFormData:BX,isArrayBufferView:CX,isString:LX,isNumber:nO,isBoolean:PX,isObject:Q2,isPlainObject:$5,isEmptyObject:zX,isReadableStream:jX,isRequest:UX,isResponse:VX,isHeaders:HX,isUndefined:p_,isDate:IX,isFile:OX,isBlob:DX,isRegExp:rJ,isFunction:S0,isStream:RX,isURLSearchParams:NX,isTypedArray:XX,isFileList:FX,forEach:tw,merge:hA,extend:qX,trim:WX,stripBOM:ZX,inherits:$X,toFlatObject:GX,kindOf:R4,kindOfTest:Lm,endsWith:YX,toArray:KX,forEachEntry:JX,matchAll:QX,isHTMLForm:tJ,hasOwnProperty:TL,hasOwnProp:TL,reduceDescriptors:oO,freezeMethods:nJ,toObjectSet:iJ,toCamelCase:eJ,noop:aJ,toFiniteNumber:oJ,findKey:iO,global:vy,isContextDefined:aO,isSpecCompliantForm:sJ,toJSONObject:lJ,isAsyncFn:uJ,isThenable:cJ,setImmediate:sO,asap:hJ,isIterable:fJ};function Qu(d,l,z,j,J){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=d,this.name="AxiosError",l&&(this.code=l),z&&(this.config=z),j&&(this.request=j),J&&(this.response=J,this.status=J.status?J.status:null)}to.inherits(Qu,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:to.toJSONObject(this.config),code:this.code,status:this.status}}});const lO=Qu.prototype,uO={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(d=>{uO[d]={value:d}});Object.defineProperties(Qu,uO);Object.defineProperty(lO,"isAxiosError",{value:!0});Qu.from=(d,l,z,j,J,mt)=>{const kt=Object.create(lO);to.toFlatObject(d,kt,function(pe){return pe!==Error.prototype},re=>re!=="isAxiosError");const Dt=d&&d.message?d.message:"Error",Gt=l==null&&d?d.code:l;return Qu.call(kt,Dt,Gt,z,j,J),d&&kt.cause==null&&Object.defineProperty(kt,"cause",{value:d,configurable:!0}),kt.name=d&&d.name||"Error",mt&&Object.assign(kt,mt),kt};const dJ=null;function fA(d){return to.isPlainObject(d)||to.isArray(d)}function cO(d){return to.endsWith(d,"[]")?d.slice(0,-2):d}function AL(d,l,z){return d?d.concat(l).map(function(J,mt){return J=cO(J),!z&&mt?"["+J+"]":J}).join(z?".":""):l}function pJ(d){return to.isArray(d)&&!d.some(fA)}const mJ=to.toFlatObject(to,{},null,function(l){return/^is[A-Z]/.test(l)});function N4(d,l,z){if(!to.isObject(d))throw new TypeError("target must be an object");l=l||new FormData,z=to.toFlatObject(z,{metaTokens:!0,dots:!1,indexes:!1},!1,function(zr,Wr){return!to.isUndefined(Wr[zr])});const j=z.metaTokens,J=z.visitor||pe,mt=z.dots,kt=z.indexes,Gt=(z.Blob||typeof Blob<"u"&&Blob)&&to.isSpecCompliantForm(l);if(!to.isFunction(J))throw new TypeError("visitor must be a function");function re(Fr){if(Fr===null)return"";if(to.isDate(Fr))return Fr.toISOString();if(to.isBoolean(Fr))return Fr.toString();if(!Gt&&to.isBlob(Fr))throw new Qu("Blob is not supported. Use a Buffer instead.");return to.isArrayBuffer(Fr)||to.isTypedArray(Fr)?Gt&&typeof Blob=="function"?new Blob([Fr]):Buffer.from(Fr):Fr}function pe(Fr,zr,Wr){let An=Fr;if(Fr&&!Wr&&typeof Fr=="object"){if(to.endsWith(zr,"{}"))zr=j?zr:zr.slice(0,-2),Fr=JSON.stringify(Fr);else if(to.isArray(Fr)&&pJ(Fr)||(to.isFileList(Fr)||to.endsWith(zr,"[]"))&&(An=to.toArray(Fr)))return zr=cO(zr),An.forEach(function(kn,ei){!(to.isUndefined(kn)||kn===null)&&l.append(kt===!0?AL([zr],ei,mt):kt===null?zr:zr+"[]",re(kn))}),!1}return fA(Fr)?!0:(l.append(AL(Wr,zr,mt),re(Fr)),!1)}const Ne=[],or=Object.assign(mJ,{defaultVisitor:pe,convertValue:re,isVisitable:fA});function _r(Fr,zr){if(!to.isUndefined(Fr)){if(Ne.indexOf(Fr)!==-1)throw Error("Circular reference detected in "+zr.join("."));Ne.push(Fr),to.forEach(Fr,function(An,Ft){(!(to.isUndefined(An)||An===null)&&J.call(l,An,to.isString(Ft)?Ft.trim():Ft,zr,or))===!0&&_r(An,zr?zr.concat(Ft):[Ft])}),Ne.pop()}}if(!to.isObject(d))throw new TypeError("data must be an object");return _r(d),l}function ML(d){const l={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(d).replace(/[!'()~]|%20|%00/g,function(j){return l[j]})}function JA(d,l){this._pairs=[],d&&N4(d,this,l)}const hO=JA.prototype;hO.append=function(l,z){this._pairs.push([l,z])};hO.toString=function(l){const z=l?function(j){return l.call(this,j,ML)}:ML;return this._pairs.map(function(J){return z(J[0])+"="+z(J[1])},"").join("&")};function gJ(d){return encodeURIComponent(d).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function fO(d,l,z){if(!l)return d;const j=z&&z.encode||gJ;to.isFunction(z)&&(z={serialize:z});const J=z&&z.serialize;let mt;if(J?mt=J(l,z):mt=to.isURLSearchParams(l)?l.toString():new JA(l,z).toString(j),mt){const kt=d.indexOf("#");kt!==-1&&(d=d.slice(0,kt)),d+=(d.indexOf("?")===-1?"?":"&")+mt}return d}class SL{constructor(){this.handlers=[]}use(l,z,j){return this.handlers.push({fulfilled:l,rejected:z,synchronous:j?j.synchronous:!1,runWhen:j?j.runWhen:null}),this.handlers.length-1}eject(l){this.handlers[l]&&(this.handlers[l]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(l){to.forEach(this.handlers,function(j){j!==null&&l(j)})}}const dO={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vJ=typeof URLSearchParams<"u"?URLSearchParams:JA,yJ=typeof FormData<"u"?FormData:null,xJ=typeof Blob<"u"?Blob:null,_J={isBrowser:!0,classes:{URLSearchParams:vJ,FormData:yJ,Blob:xJ},protocols:["http","https","file","blob","url","data"]},QA=typeof window<"u"&&typeof document<"u",dA=typeof navigator=="object"&&navigator||void 0,bJ=QA&&(!dA||["ReactNative","NativeScript","NS"].indexOf(dA.product)<0),wJ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kJ=QA&&window.location.href||"http://localhost",TJ=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:QA,hasStandardBrowserEnv:bJ,hasStandardBrowserWebWorkerEnv:wJ,navigator:dA,origin:kJ},Symbol.toStringTag,{value:"Module"})),Kp={...TJ,..._J};function AJ(d,l){return N4(d,new Kp.classes.URLSearchParams,{visitor:function(z,j,J,mt){return Kp.isNode&&to.isBuffer(z)?(this.append(j,z.toString("base64")),!1):mt.defaultVisitor.apply(this,arguments)},...l})}function MJ(d){return to.matchAll(/\w+|\[(\w*)]/g,d).map(l=>l[0]==="[]"?"":l[1]||l[0])}function SJ(d){const l={},z=Object.keys(d);let j;const J=z.length;let mt;for(j=0;j<J;j++)mt=z[j],l[mt]=d[mt];return l}function pO(d){function l(z,j,J,mt){let kt=z[mt++];if(kt==="__proto__")return!0;const Dt=Number.isFinite(+kt),Gt=mt>=z.length;return kt=!kt&&to.isArray(J)?J.length:kt,Gt?(to.hasOwnProp(J,kt)?J[kt]=[J[kt],j]:J[kt]=j,!Dt):((!J[kt]||!to.isObject(J[kt]))&&(J[kt]=[]),l(z,j,J[kt],mt)&&to.isArray(J[kt])&&(J[kt]=SJ(J[kt])),!Dt)}if(to.isFormData(d)&&to.isFunction(d.entries)){const z={};return to.forEachEntry(d,(j,J)=>{l(MJ(j),J,z,0)}),z}return null}function EJ(d,l,z){if(to.isString(d))try{return(l||JSON.parse)(d),to.trim(d)}catch(j){if(j.name!=="SyntaxError")throw j}return(z||JSON.stringify)(d)}const ew={transitional:dO,adapter:["xhr","http","fetch"],transformRequest:[function(l,z){const j=z.getContentType()||"",J=j.indexOf("application/json")>-1,mt=to.isObject(l);if(mt&&to.isHTMLForm(l)&&(l=new FormData(l)),to.isFormData(l))return J?JSON.stringify(pO(l)):l;if(to.isArrayBuffer(l)||to.isBuffer(l)||to.isStream(l)||to.isFile(l)||to.isBlob(l)||to.isReadableStream(l))return l;if(to.isArrayBufferView(l))return l.buffer;if(to.isURLSearchParams(l))return z.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),l.toString();let Dt;if(mt){if(j.indexOf("application/x-www-form-urlencoded")>-1)return AJ(l,this.formSerializer).toString();if((Dt=to.isFileList(l))||j.indexOf("multipart/form-data")>-1){const Gt=this.env&&this.env.FormData;return N4(Dt?{"files[]":l}:l,Gt&&new Gt,this.formSerializer)}}return mt||J?(z.setContentType("application/json",!1),EJ(l)):l}],transformResponse:[function(l){const z=this.transitional||ew.transitional,j=z&&z.forcedJSONParsing,J=this.responseType==="json";if(to.isResponse(l)||to.isReadableStream(l))return l;if(l&&to.isString(l)&&(j&&!this.responseType||J)){const kt=!(z&&z.silentJSONParsing)&&J;try{return JSON.parse(l,this.parseReviver)}catch(Dt){if(kt)throw Dt.name==="SyntaxError"?Qu.from(Dt,Qu.ERR_BAD_RESPONSE,this,null,this.response):Dt}}return l}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kp.classes.FormData,Blob:Kp.classes.Blob},validateStatus:function(l){return l>=200&&l<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};to.forEach(["delete","get","head","post","put","patch"],d=>{ew.headers[d]={}});const CJ=to.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),LJ=d=>{const l={};let z,j,J;return d&&d.split(`
`).forEach(function(kt){J=kt.indexOf(":"),z=kt.substring(0,J).trim().toLowerCase(),j=kt.substring(J+1).trim(),!(!z||l[z]&&CJ[z])&&(z==="set-cookie"?l[z]?l[z].push(j):l[z]=[j]:l[z]=l[z]?l[z]+", "+j:j)}),l},EL=Symbol("internals");function Qb(d){return d&&String(d).trim().toLowerCase()}function G5(d){return d===!1||d==null?d:to.isArray(d)?d.map(G5):String(d)}function PJ(d){const l=Object.create(null),z=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let j;for(;j=z.exec(d);)l[j[1]]=j[2];return l}const zJ=d=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(d.trim());function S8(d,l,z,j,J){if(to.isFunction(j))return j.call(this,l,z);if(J&&(l=z),!!to.isString(l)){if(to.isString(j))return l.indexOf(j)!==-1;if(to.isRegExp(j))return j.test(l)}}function IJ(d){return d.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(l,z,j)=>z.toUpperCase()+j)}function OJ(d,l){const z=to.toCamelCase(" "+l);["get","set","has"].forEach(j=>{Object.defineProperty(d,j+z,{value:function(J,mt,kt){return this[j].call(this,l,J,mt,kt)},configurable:!0})})}let E0=class{constructor(l){l&&this.set(l)}set(l,z,j){const J=this;function mt(Dt,Gt,re){const pe=Qb(Gt);if(!pe)throw new Error("header name must be a non-empty string");const Ne=to.findKey(J,pe);(!Ne||J[Ne]===void 0||re===!0||re===void 0&&J[Ne]!==!1)&&(J[Ne||Gt]=G5(Dt))}const kt=(Dt,Gt)=>to.forEach(Dt,(re,pe)=>mt(re,pe,Gt));if(to.isPlainObject(l)||l instanceof this.constructor)kt(l,z);else if(to.isString(l)&&(l=l.trim())&&!zJ(l))kt(LJ(l),z);else if(to.isObject(l)&&to.isIterable(l)){let Dt={},Gt,re;for(const pe of l){if(!to.isArray(pe))throw TypeError("Object iterator must return a key-value pair");Dt[re=pe[0]]=(Gt=Dt[re])?to.isArray(Gt)?[...Gt,pe[1]]:[Gt,pe[1]]:pe[1]}kt(Dt,z)}else l!=null&&mt(z,l,j);return this}get(l,z){if(l=Qb(l),l){const j=to.findKey(this,l);if(j){const J=this[j];if(!z)return J;if(z===!0)return PJ(J);if(to.isFunction(z))return z.call(this,J,j);if(to.isRegExp(z))return z.exec(J);throw new TypeError("parser must be boolean|regexp|function")}}}has(l,z){if(l=Qb(l),l){const j=to.findKey(this,l);return!!(j&&this[j]!==void 0&&(!z||S8(this,this[j],j,z)))}return!1}delete(l,z){const j=this;let J=!1;function mt(kt){if(kt=Qb(kt),kt){const Dt=to.findKey(j,kt);Dt&&(!z||S8(j,j[Dt],Dt,z))&&(delete j[Dt],J=!0)}}return to.isArray(l)?l.forEach(mt):mt(l),J}clear(l){const z=Object.keys(this);let j=z.length,J=!1;for(;j--;){const mt=z[j];(!l||S8(this,this[mt],mt,l,!0))&&(delete this[mt],J=!0)}return J}normalize(l){const z=this,j={};return to.forEach(this,(J,mt)=>{const kt=to.findKey(j,mt);if(kt){z[kt]=G5(J),delete z[mt];return}const Dt=l?IJ(mt):String(mt).trim();Dt!==mt&&delete z[mt],z[Dt]=G5(J),j[Dt]=!0}),this}concat(...l){return this.constructor.concat(this,...l)}toJSON(l){const z=Object.create(null);return to.forEach(this,(j,J)=>{j!=null&&j!==!1&&(z[J]=l&&to.isArray(j)?j.join(", "):j)}),z}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([l,z])=>l+": "+z).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(l){return l instanceof this?l:new this(l)}static concat(l,...z){const j=new this(l);return z.forEach(J=>j.set(J)),j}static accessor(l){const j=(this[EL]=this[EL]={accessors:{}}).accessors,J=this.prototype;function mt(kt){const Dt=Qb(kt);j[Dt]||(OJ(J,kt),j[Dt]=!0)}return to.isArray(l)?l.forEach(mt):mt(l),this}};E0.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);to.reduceDescriptors(E0.prototype,({value:d},l)=>{let z=l[0].toUpperCase()+l.slice(1);return{get:()=>d,set(j){this[z]=j}}});to.freezeMethods(E0);function E8(d,l){const z=this||ew,j=l||z,J=E0.from(j.headers);let mt=j.data;return to.forEach(d,function(Dt){mt=Dt.call(z,mt,J.normalize(),l?l.status:void 0)}),J.normalize(),mt}function mO(d){return!!(d&&d.__CANCEL__)}function x_(d,l,z){Qu.call(this,d??"canceled",Qu.ERR_CANCELED,l,z),this.name="CanceledError"}to.inherits(x_,Qu,{__CANCEL__:!0});function gO(d,l,z){const j=z.config.validateStatus;!z.status||!j||j(z.status)?d(z):l(new Qu("Request failed with status code "+z.status,[Qu.ERR_BAD_REQUEST,Qu.ERR_BAD_RESPONSE][Math.floor(z.status/100)-4],z.config,z.request,z))}function DJ(d){const l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(d);return l&&l[1]||""}function FJ(d,l){d=d||10;const z=new Array(d),j=new Array(d);let J=0,mt=0,kt;return l=l!==void 0?l:1e3,function(Gt){const re=Date.now(),pe=j[mt];kt||(kt=re),z[J]=Gt,j[J]=re;let Ne=mt,or=0;for(;Ne!==J;)or+=z[Ne++],Ne=Ne%d;if(J=(J+1)%d,J===mt&&(mt=(mt+1)%d),re-kt<l)return;const _r=pe&&re-pe;return _r?Math.round(or*1e3/_r):void 0}}function RJ(d,l){let z=0,j=1e3/l,J,mt;const kt=(re,pe=Date.now())=>{z=pe,J=null,mt&&(clearTimeout(mt),mt=null),d(...re)};return[(...re)=>{const pe=Date.now(),Ne=pe-z;Ne>=j?kt(re,pe):(J=re,mt||(mt=setTimeout(()=>{mt=null,kt(J)},j-Ne)))},()=>J&&kt(J)]}const c4=(d,l,z=3)=>{let j=0;const J=FJ(50,250);return RJ(mt=>{const kt=mt.loaded,Dt=mt.lengthComputable?mt.total:void 0,Gt=kt-j,re=J(Gt),pe=kt<=Dt;j=kt;const Ne={loaded:kt,total:Dt,progress:Dt?kt/Dt:void 0,bytes:Gt,rate:re||void 0,estimated:re&&Dt&&pe?(Dt-kt)/re:void 0,event:mt,lengthComputable:Dt!=null,[l?"download":"upload"]:!0};d(Ne)},z)},CL=(d,l)=>{const z=d!=null;return[j=>l[0]({lengthComputable:z,total:d,loaded:j}),l[1]]},LL=d=>(...l)=>to.asap(()=>d(...l)),BJ=Kp.hasStandardBrowserEnv?((d,l)=>z=>(z=new URL(z,Kp.origin),d.protocol===z.protocol&&d.host===z.host&&(l||d.port===z.port)))(new URL(Kp.origin),Kp.navigator&&/(msie|trident)/i.test(Kp.navigator.userAgent)):()=>!0,NJ=Kp.hasStandardBrowserEnv?{write(d,l,z,j,J,mt,kt){if(typeof document>"u")return;const Dt=[`${d}=${encodeURIComponent(l)}`];to.isNumber(z)&&Dt.push(`expires=${new Date(z).toUTCString()}`),to.isString(j)&&Dt.push(`path=${j}`),to.isString(J)&&Dt.push(`domain=${J}`),mt===!0&&Dt.push("secure"),to.isString(kt)&&Dt.push(`SameSite=${kt}`),document.cookie=Dt.join("; ")},read(d){if(typeof document>"u")return null;const l=document.cookie.match(new RegExp("(?:^|; )"+d+"=([^;]*)"));return l?decodeURIComponent(l[1]):null},remove(d){this.write(d,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function jJ(d){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(d)}function UJ(d,l){return l?d.replace(/\/?\/$/,"")+"/"+l.replace(/^\/+/,""):d}function vO(d,l,z){let j=!jJ(l);return d&&(j||z==!1)?UJ(d,l):l}const PL=d=>d instanceof E0?{...d}:d;function Ay(d,l){l=l||{};const z={};function j(re,pe,Ne,or){return to.isPlainObject(re)&&to.isPlainObject(pe)?to.merge.call({caseless:or},re,pe):to.isPlainObject(pe)?to.merge({},pe):to.isArray(pe)?pe.slice():pe}function J(re,pe,Ne,or){if(to.isUndefined(pe)){if(!to.isUndefined(re))return j(void 0,re,Ne,or)}else return j(re,pe,Ne,or)}function mt(re,pe){if(!to.isUndefined(pe))return j(void 0,pe)}function kt(re,pe){if(to.isUndefined(pe)){if(!to.isUndefined(re))return j(void 0,re)}else return j(void 0,pe)}function Dt(re,pe,Ne){if(Ne in l)return j(re,pe);if(Ne in d)return j(void 0,re)}const Gt={url:mt,method:mt,data:mt,baseURL:kt,transformRequest:kt,transformResponse:kt,paramsSerializer:kt,timeout:kt,timeoutMessage:kt,withCredentials:kt,withXSRFToken:kt,adapter:kt,responseType:kt,xsrfCookieName:kt,xsrfHeaderName:kt,onUploadProgress:kt,onDownloadProgress:kt,decompress:kt,maxContentLength:kt,maxBodyLength:kt,beforeRedirect:kt,transport:kt,httpAgent:kt,httpsAgent:kt,cancelToken:kt,socketPath:kt,responseEncoding:kt,validateStatus:Dt,headers:(re,pe,Ne)=>J(PL(re),PL(pe),Ne,!0)};return to.forEach(Object.keys({...d,...l}),function(pe){const Ne=Gt[pe]||J,or=Ne(d[pe],l[pe],pe);to.isUndefined(or)&&Ne!==Dt||(z[pe]=or)}),z}const yO=d=>{const l=Ay({},d);let{data:z,withXSRFToken:j,xsrfHeaderName:J,xsrfCookieName:mt,headers:kt,auth:Dt}=l;if(l.headers=kt=E0.from(kt),l.url=fO(vO(l.baseURL,l.url,l.allowAbsoluteUrls),d.params,d.paramsSerializer),Dt&&kt.set("Authorization","Basic "+btoa((Dt.username||"")+":"+(Dt.password?unescape(encodeURIComponent(Dt.password)):""))),to.isFormData(z)){if(Kp.hasStandardBrowserEnv||Kp.hasStandardBrowserWebWorkerEnv)kt.setContentType(void 0);else if(to.isFunction(z.getHeaders)){const Gt=z.getHeaders(),re=["content-type","content-length"];Object.entries(Gt).forEach(([pe,Ne])=>{re.includes(pe.toLowerCase())&&kt.set(pe,Ne)})}}if(Kp.hasStandardBrowserEnv&&(j&&to.isFunction(j)&&(j=j(l)),j||j!==!1&&BJ(l.url))){const Gt=J&&mt&&NJ.read(mt);Gt&&kt.set(J,Gt)}return l},VJ=typeof XMLHttpRequest<"u",HJ=VJ&&function(d){return new Promise(function(z,j){const J=yO(d);let mt=J.data;const kt=E0.from(J.headers).normalize();let{responseType:Dt,onUploadProgress:Gt,onDownloadProgress:re}=J,pe,Ne,or,_r,Fr;function zr(){_r&&_r(),Fr&&Fr(),J.cancelToken&&J.cancelToken.unsubscribe(pe),J.signal&&J.signal.removeEventListener("abort",pe)}let Wr=new XMLHttpRequest;Wr.open(J.method.toUpperCase(),J.url,!0),Wr.timeout=J.timeout;function An(){if(!Wr)return;const kn=E0.from("getAllResponseHeaders"in Wr&&Wr.getAllResponseHeaders()),jn={data:!Dt||Dt==="text"||Dt==="json"?Wr.responseText:Wr.response,status:Wr.status,statusText:Wr.statusText,headers:kn,config:d,request:Wr};gO(function(Qi){z(Qi),zr()},function(Qi){j(Qi),zr()},jn),Wr=null}"onloadend"in Wr?Wr.onloadend=An:Wr.onreadystatechange=function(){!Wr||Wr.readyState!==4||Wr.status===0&&!(Wr.responseURL&&Wr.responseURL.indexOf("file:")===0)||setTimeout(An)},Wr.onabort=function(){Wr&&(j(new Qu("Request aborted",Qu.ECONNABORTED,d,Wr)),Wr=null)},Wr.onerror=function(ei){const jn=ei&&ei.message?ei.message:"Network Error",ai=new Qu(jn,Qu.ERR_NETWORK,d,Wr);ai.event=ei||null,j(ai),Wr=null},Wr.ontimeout=function(){let ei=J.timeout?"timeout of "+J.timeout+"ms exceeded":"timeout exceeded";const jn=J.transitional||dO;J.timeoutErrorMessage&&(ei=J.timeoutErrorMessage),j(new Qu(ei,jn.clarifyTimeoutError?Qu.ETIMEDOUT:Qu.ECONNABORTED,d,Wr)),Wr=null},mt===void 0&&kt.setContentType(null),"setRequestHeader"in Wr&&to.forEach(kt.toJSON(),function(ei,jn){Wr.setRequestHeader(jn,ei)}),to.isUndefined(J.withCredentials)||(Wr.withCredentials=!!J.withCredentials),Dt&&Dt!=="json"&&(Wr.responseType=J.responseType),re&&([or,Fr]=c4(re,!0),Wr.addEventListener("progress",or)),Gt&&Wr.upload&&([Ne,_r]=c4(Gt),Wr.upload.addEventListener("progress",Ne),Wr.upload.addEventListener("loadend",_r)),(J.cancelToken||J.signal)&&(pe=kn=>{Wr&&(j(!kn||kn.type?new x_(null,d,Wr):kn),Wr.abort(),Wr=null)},J.cancelToken&&J.cancelToken.subscribe(pe),J.signal&&(J.signal.aborted?pe():J.signal.addEventListener("abort",pe)));const Ft=DJ(J.url);if(Ft&&Kp.protocols.indexOf(Ft)===-1){j(new Qu("Unsupported protocol "+Ft+":",Qu.ERR_BAD_REQUEST,d));return}Wr.send(mt||null)})},WJ=(d,l)=>{const{length:z}=d=d?d.filter(Boolean):[];if(l||z){let j=new AbortController,J;const mt=function(re){if(!J){J=!0,Dt();const pe=re instanceof Error?re:this.reason;j.abort(pe instanceof Qu?pe:new x_(pe instanceof Error?pe.message:pe))}};let kt=l&&setTimeout(()=>{kt=null,mt(new Qu(`timeout ${l} of ms exceeded`,Qu.ETIMEDOUT))},l);const Dt=()=>{d&&(kt&&clearTimeout(kt),kt=null,d.forEach(re=>{re.unsubscribe?re.unsubscribe(mt):re.removeEventListener("abort",mt)}),d=null)};d.forEach(re=>re.addEventListener("abort",mt));const{signal:Gt}=j;return Gt.unsubscribe=()=>to.asap(Dt),Gt}},qJ=function*(d,l){let z=d.byteLength;if(z<l){yield d;return}let j=0,J;for(;j<z;)J=j+l,yield d.slice(j,J),j=J},ZJ=async function*(d,l){for await(const z of $J(d))yield*qJ(z,l)},$J=async function*(d){if(d[Symbol.asyncIterator]){yield*d;return}const l=d.getReader();try{for(;;){const{done:z,value:j}=await l.read();if(z)break;yield j}}finally{await l.cancel()}},zL=(d,l,z,j)=>{const J=ZJ(d,l);let mt=0,kt,Dt=Gt=>{kt||(kt=!0,j&&j(Gt))};return new ReadableStream({async pull(Gt){try{const{done:re,value:pe}=await J.next();if(re){Dt(),Gt.close();return}let Ne=pe.byteLength;if(z){let or=mt+=Ne;z(or)}Gt.enqueue(new Uint8Array(pe))}catch(re){throw Dt(re),re}},cancel(Gt){return Dt(Gt),J.return()}},{highWaterMark:2})},IL=64*1024,{isFunction:M5}=to,GJ=(({Request:d,Response:l})=>({Request:d,Response:l}))(to.global),{ReadableStream:OL,TextEncoder:DL}=to.global,FL=(d,...l)=>{try{return!!d(...l)}catch{return!1}},YJ=d=>{d=to.merge.call({skipUndefined:!0},GJ,d);const{fetch:l,Request:z,Response:j}=d,J=l?M5(l):typeof fetch=="function",mt=M5(z),kt=M5(j);if(!J)return!1;const Dt=J&&M5(OL),Gt=J&&(typeof DL=="function"?(Fr=>zr=>Fr.encode(zr))(new DL):async Fr=>new Uint8Array(await new z(Fr).arrayBuffer())),re=mt&&Dt&&FL(()=>{let Fr=!1;const zr=new z(Kp.origin,{body:new OL,method:"POST",get duplex(){return Fr=!0,"half"}}).headers.has("Content-Type");return Fr&&!zr}),pe=kt&&Dt&&FL(()=>to.isReadableStream(new j("").body)),Ne={stream:pe&&(Fr=>Fr.body)};J&&["text","arrayBuffer","blob","formData","stream"].forEach(Fr=>{!Ne[Fr]&&(Ne[Fr]=(zr,Wr)=>{let An=zr&&zr[Fr];if(An)return An.call(zr);throw new Qu(`Response type '${Fr}' is not supported`,Qu.ERR_NOT_SUPPORT,Wr)})});const or=async Fr=>{if(Fr==null)return 0;if(to.isBlob(Fr))return Fr.size;if(to.isSpecCompliantForm(Fr))return(await new z(Kp.origin,{method:"POST",body:Fr}).arrayBuffer()).byteLength;if(to.isArrayBufferView(Fr)||to.isArrayBuffer(Fr))return Fr.byteLength;if(to.isURLSearchParams(Fr)&&(Fr=Fr+""),to.isString(Fr))return(await Gt(Fr)).byteLength},_r=async(Fr,zr)=>{const Wr=to.toFiniteNumber(Fr.getContentLength());return Wr??or(zr)};return async Fr=>{let{url:zr,method:Wr,data:An,signal:Ft,cancelToken:kn,timeout:ei,onDownloadProgress:jn,onUploadProgress:ai,responseType:Qi,headers:Gi,withCredentials:un="same-origin",fetchOptions:ia}=yO(Fr),fa=l||fetch;Qi=Qi?(Qi+"").toLowerCase():"text";let Li=WJ([Ft,kn&&kn.toAbortSignal()],ei),yi=null;const ra=Li&&Li.unsubscribe&&(()=>{Li.unsubscribe()});let Da;try{if(ai&&re&&Wr!=="get"&&Wr!=="head"&&(Da=await _r(Gi,An))!==0){let ko=new z(zr,{method:"POST",body:An,duplex:"half"}),pl;if(to.isFormData(An)&&(pl=ko.headers.get("content-type"))&&Gi.setContentType(pl),ko.body){const[fu,qo]=CL(Da,c4(LL(ai)));An=zL(ko.body,IL,fu,qo)}}to.isString(un)||(un=un?"include":"omit");const Ni=mt&&"credentials"in z.prototype,Ei={...ia,signal:Li,method:Wr.toUpperCase(),headers:Gi.normalize().toJSON(),body:An,duplex:"half",credentials:Ni?un:void 0};yi=mt&&new z(zr,Ei);let Va=await(mt?fa(yi,ia):fa(zr,Ei));const ss=pe&&(Qi==="stream"||Qi==="response");if(pe&&(jn||ss&&ra)){const ko={};["status","statusText","headers"].forEach(fo=>{ko[fo]=Va[fo]});const pl=to.toFiniteNumber(Va.headers.get("content-length")),[fu,qo]=jn&&CL(pl,c4(LL(jn),!0))||[];Va=new j(zL(Va.body,IL,fu,()=>{qo&&qo(),ra&&ra()}),ko)}Qi=Qi||"text";let mo=await Ne[to.findKey(Ne,Qi)||"text"](Va,Fr);return!ss&&ra&&ra(),await new Promise((ko,pl)=>{gO(ko,pl,{data:mo,headers:E0.from(Va.headers),status:Va.status,statusText:Va.statusText,config:Fr,request:yi})})}catch(Ni){throw ra&&ra(),Ni&&Ni.name==="TypeError"&&/Load failed|fetch/i.test(Ni.message)?Object.assign(new Qu("Network Error",Qu.ERR_NETWORK,Fr,yi),{cause:Ni.cause||Ni}):Qu.from(Ni,Ni&&Ni.code,Fr,yi)}}},KJ=new Map,xO=d=>{let l=d&&d.env||{};const{fetch:z,Request:j,Response:J}=l,mt=[j,J,z];let kt=mt.length,Dt=kt,Gt,re,pe=KJ;for(;Dt--;)Gt=mt[Dt],re=pe.get(Gt),re===void 0&&pe.set(Gt,re=Dt?new Map:YJ(l)),pe=re;return re};xO();const tM={http:dJ,xhr:HJ,fetch:{get:xO}};to.forEach(tM,(d,l)=>{if(d){try{Object.defineProperty(d,"name",{value:l})}catch{}Object.defineProperty(d,"adapterName",{value:l})}});const RL=d=>`- ${d}`,XJ=d=>to.isFunction(d)||d===null||d===!1;function JJ(d,l){d=to.isArray(d)?d:[d];const{length:z}=d;let j,J;const mt={};for(let kt=0;kt<z;kt++){j=d[kt];let Dt;if(J=j,!XJ(j)&&(J=tM[(Dt=String(j)).toLowerCase()],J===void 0))throw new Qu(`Unknown adapter '${Dt}'`);if(J&&(to.isFunction(J)||(J=J.get(l))))break;mt[Dt||"#"+kt]=J}if(!J){const kt=Object.entries(mt).map(([Gt,re])=>`adapter ${Gt} `+(re===!1?"is not supported by the environment":"is not available in the build"));let Dt=z?kt.length>1?`since :
`+kt.map(RL).join(`
`):" "+RL(kt[0]):"as no adapter specified";throw new Qu("There is no suitable adapter to dispatch the request "+Dt,"ERR_NOT_SUPPORT")}return J}const _O={getAdapter:JJ,adapters:tM};function C8(d){if(d.cancelToken&&d.cancelToken.throwIfRequested(),d.signal&&d.signal.aborted)throw new x_(null,d)}function BL(d){return C8(d),d.headers=E0.from(d.headers),d.data=E8.call(d,d.transformRequest),["post","put","patch"].indexOf(d.method)!==-1&&d.headers.setContentType("application/x-www-form-urlencoded",!1),_O.getAdapter(d.adapter||ew.adapter,d)(d).then(function(j){return C8(d),j.data=E8.call(d,d.transformResponse,j),j.headers=E0.from(j.headers),j},function(j){return mO(j)||(C8(d),j&&j.response&&(j.response.data=E8.call(d,d.transformResponse,j.response),j.response.headers=E0.from(j.response.headers))),Promise.reject(j)})}const bO="1.13.2",j4={};["object","boolean","number","function","string","symbol"].forEach((d,l)=>{j4[d]=function(j){return typeof j===d||"a"+(l<1?"n ":" ")+d}});const NL={};j4.transitional=function(l,z,j){function J(mt,kt){return"[Axios v"+bO+"] Transitional option '"+mt+"'"+kt+(j?". "+j:"")}return(mt,kt,Dt)=>{if(l===!1)throw new Qu(J(kt," has been removed"+(z?" in "+z:"")),Qu.ERR_DEPRECATED);return z&&!NL[kt]&&(NL[kt]=!0,console.warn(J(kt," has been deprecated since v"+z+" and will be removed in the near future"))),l?l(mt,kt,Dt):!0}};j4.spelling=function(l){return(z,j)=>(console.warn(`${j} is likely a misspelling of ${l}`),!0)};function QJ(d,l,z){if(typeof d!="object")throw new Qu("options must be an object",Qu.ERR_BAD_OPTION_VALUE);const j=Object.keys(d);let J=j.length;for(;J-- >0;){const mt=j[J],kt=l[mt];if(kt){const Dt=d[mt],Gt=Dt===void 0||kt(Dt,mt,d);if(Gt!==!0)throw new Qu("option "+mt+" must be "+Gt,Qu.ERR_BAD_OPTION_VALUE);continue}if(z!==!0)throw new Qu("Unknown option "+mt,Qu.ERR_BAD_OPTION)}}const Y5={assertOptions:QJ,validators:j4},tg=Y5.validators;let by=class{constructor(l){this.defaults=l||{},this.interceptors={request:new SL,response:new SL}}async request(l,z){try{return await this._request(l,z)}catch(j){if(j instanceof Error){let J={};Error.captureStackTrace?Error.captureStackTrace(J):J=new Error;const mt=J.stack?J.stack.replace(/^.+\n/,""):"";try{j.stack?mt&&!String(j.stack).endsWith(mt.replace(/^.+\n.+\n/,""))&&(j.stack+=`
`+mt):j.stack=mt}catch{}}throw j}}_request(l,z){typeof l=="string"?(z=z||{},z.url=l):z=l||{},z=Ay(this.defaults,z);const{transitional:j,paramsSerializer:J,headers:mt}=z;j!==void 0&&Y5.assertOptions(j,{silentJSONParsing:tg.transitional(tg.boolean),forcedJSONParsing:tg.transitional(tg.boolean),clarifyTimeoutError:tg.transitional(tg.boolean)},!1),J!=null&&(to.isFunction(J)?z.paramsSerializer={serialize:J}:Y5.assertOptions(J,{encode:tg.function,serialize:tg.function},!0)),z.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?z.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:z.allowAbsoluteUrls=!0),Y5.assertOptions(z,{baseUrl:tg.spelling("baseURL"),withXsrfToken:tg.spelling("withXSRFToken")},!0),z.method=(z.method||this.defaults.method||"get").toLowerCase();let kt=mt&&to.merge(mt.common,mt[z.method]);mt&&to.forEach(["delete","get","head","post","put","patch","common"],Fr=>{delete mt[Fr]}),z.headers=E0.concat(kt,mt);const Dt=[];let Gt=!0;this.interceptors.request.forEach(function(zr){typeof zr.runWhen=="function"&&zr.runWhen(z)===!1||(Gt=Gt&&zr.synchronous,Dt.unshift(zr.fulfilled,zr.rejected))});const re=[];this.interceptors.response.forEach(function(zr){re.push(zr.fulfilled,zr.rejected)});let pe,Ne=0,or;if(!Gt){const Fr=[BL.bind(this),void 0];for(Fr.unshift(...Dt),Fr.push(...re),or=Fr.length,pe=Promise.resolve(z);Ne<or;)pe=pe.then(Fr[Ne++],Fr[Ne++]);return pe}or=Dt.length;let _r=z;for(;Ne<or;){const Fr=Dt[Ne++],zr=Dt[Ne++];try{_r=Fr(_r)}catch(Wr){zr.call(this,Wr);break}}try{pe=BL.call(this,_r)}catch(Fr){return Promise.reject(Fr)}for(Ne=0,or=re.length;Ne<or;)pe=pe.then(re[Ne++],re[Ne++]);return pe}getUri(l){l=Ay(this.defaults,l);const z=vO(l.baseURL,l.url,l.allowAbsoluteUrls);return fO(z,l.params,l.paramsSerializer)}};to.forEach(["delete","get","head","options"],function(l){by.prototype[l]=function(z,j){return this.request(Ay(j||{},{method:l,url:z,data:(j||{}).data}))}});to.forEach(["post","put","patch"],function(l){function z(j){return function(mt,kt,Dt){return this.request(Ay(Dt||{},{method:l,headers:j?{"Content-Type":"multipart/form-data"}:{},url:mt,data:kt}))}}by.prototype[l]=z(),by.prototype[l+"Form"]=z(!0)});let tQ=class wO{constructor(l){if(typeof l!="function")throw new TypeError("executor must be a function.");let z;this.promise=new Promise(function(mt){z=mt});const j=this;this.promise.then(J=>{if(!j._listeners)return;let mt=j._listeners.length;for(;mt-- >0;)j._listeners[mt](J);j._listeners=null}),this.promise.then=J=>{let mt;const kt=new Promise(Dt=>{j.subscribe(Dt),mt=Dt}).then(J);return kt.cancel=function(){j.unsubscribe(mt)},kt},l(function(mt,kt,Dt){j.reason||(j.reason=new x_(mt,kt,Dt),z(j.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(l){if(this.reason){l(this.reason);return}this._listeners?this._listeners.push(l):this._listeners=[l]}unsubscribe(l){if(!this._listeners)return;const z=this._listeners.indexOf(l);z!==-1&&this._listeners.splice(z,1)}toAbortSignal(){const l=new AbortController,z=j=>{l.abort(j)};return this.subscribe(z),l.signal.unsubscribe=()=>this.unsubscribe(z),l.signal}static source(){let l;return{token:new wO(function(J){l=J}),cancel:l}}};function eQ(d){return function(z){return d.apply(null,z)}}function rQ(d){return to.isObject(d)&&d.isAxiosError===!0}const pA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pA).forEach(([d,l])=>{pA[l]=d});function kO(d){const l=new by(d),z=tO(by.prototype.request,l);return to.extend(z,by.prototype,l,{allOwnKeys:!0}),to.extend(z,l,null,{allOwnKeys:!0}),z.create=function(J){return kO(Ay(d,J))},z}const _d=kO(ew);_d.Axios=by;_d.CanceledError=x_;_d.CancelToken=tQ;_d.isCancel=mO;_d.VERSION=bO;_d.toFormData=N4;_d.AxiosError=Qu;_d.Cancel=_d.CanceledError;_d.all=function(l){return Promise.all(l)};_d.spread=eQ;_d.isAxiosError=rQ;_d.mergeConfig=Ay;_d.AxiosHeaders=E0;_d.formToJSON=d=>pO(to.isHTMLForm(d)?new FormData(d):d);_d.getAdapter=_O.getAdapter;_d.HttpStatusCode=pA;_d.default=_d;const{Axios:_vt,AxiosError:bvt,CanceledError:wvt,isCancel:kvt,CancelToken:Tvt,VERSION:Avt,all:Mvt,Cancel:Svt,isAxiosError:Evt,spread:Cvt,toFormData:Lvt,AxiosHeaders:Pvt,HttpStatusCode:zvt,formToJSON:Ivt,getAdapter:Ovt,mergeConfig:Dvt}=_d,nQ="/api",iQ="",aQ=nQ,oQ=iQ,my=_d.create({baseURL:aQ,timeout:5e3,headers:{"Content-Type":"application/json"}});my.interceptors.request.use(d=>d,d=>(console.error("API Request Error:",d),Promise.reject(d)));my.interceptors.response.use(d=>d,d=>(console.error("API Response Error:",d.response?.data||d.message),Promise.reject(d)));class Xh{static async get(l,z){try{return(await my.get(l,{params:z})).data}catch(j){throw this.handleError(j)}}static async post(l,z,j){try{return(await my.post(l,z,j)).data}catch(J){throw this.handleError(J)}}static async put(l,z,j){try{return(await my.put(l,z,j)).data}catch(J){throw this.handleError(J)}}static async delete(l,z){try{return(await my.delete(l,z)).data}catch(j){throw this.handleError(j)}}static async getTransportKeys(){return this.get("transport_keys")}static async createTransportKey(l,z,j,J,mt){const kt={name:l,flood_policy:z,parent_id:J,last_used:mt};return j!==void 0&&(kt.transport_key=j),this.post("transport_keys",kt)}static async getTransportKey(l){return this.get(`transport_key/${l}`)}static async updateTransportKey(l,z,j,J,mt,kt){return this.put(`transport_key/${l}`,{name:z,flood_policy:j,transport_key:J,parent_id:mt,last_used:kt})}static async deleteTransportKey(l){return this.delete(`transport_key/${l}`)}static async updateGlobalFloodPolicy(l){return this.post("global_flood_policy",{global_flood_allow:l})}static async getLogs(){try{return(await my.get("logs")).data}catch(l){throw this.handleError(l)}}static handleError(l){if(_d.isAxiosError(l)){if(l.response){const z=l.response.data?.error||l.response.data?.message||`HTTP ${l.response.status}`;return new Error(z)}else if(l.request)return new Error("Network error - no response received")}return new Error(l instanceof Error?l.message:"Unknown error occurred")}}const sv=GA("system",()=>{const d=lo(null),l=lo(!1),z=lo(null),j=lo(null),J=lo("forward"),mt=lo(!0),kt=lo(0),Dt=lo(10),Gt=lo(!1),re=Yo(()=>d.value?.config?.node_name??"Unknown"),pe=Yo(()=>{const yi=d.value?.public_key;return!yi||yi==="Unknown"?"Unknown":yi.length>=16?`${yi.slice(0,8)} ... ${yi.slice(-8)}`:`${yi}`}),Ne=Yo(()=>d.value!==null),or=Yo(()=>d.value?.version??"Unknown"),_r=Yo(()=>d.value?.core_version??"Unknown"),Fr=Yo(()=>d.value?.noise_floor_dbm??null),zr=Yo(()=>Dt.value>0?Math.min(kt.value/Dt.value*100,100):0),Wr=Yo(()=>J.value==="monitor"?{text:"Monitor Mode",title:"Monitoring only - not forwarding packets"}:mt.value?{text:"Active",title:"Forwarding with duty cycle enforcement"}:{text:"No Limits",title:"Forwarding without duty cycle enforcement"}),An=Yo(()=>J.value==="monitor"?{active:!1,warning:!0}:{active:!0,warning:!1}),Ft=Yo(()=>mt.value?{active:!0,warning:!1}:{active:!1,warning:!0}),kn=yi=>{Gt.value=yi};async function ei(){try{l.value=!0,z.value=null;const yi=await Xh.get("/stats");if(yi.success&&yi.data)return d.value=yi.data,j.value=new Date,jn(yi.data),yi.data;if(yi&&"version"in yi){const ra=yi;return d.value=ra,j.value=new Date,jn(ra),ra}else throw new Error(yi.error||"Failed to fetch stats")}catch(yi){throw z.value=yi instanceof Error?yi.message:"Unknown error occurred",console.error("Error fetching stats:",yi),yi}finally{l.value=!1}}function jn(yi){if(yi.config){const Da=yi.config.repeater?.mode;(Da==="forward"||Da==="monitor")&&(J.value=Da);const Ni=yi.config.duty_cycle;if(Ni){mt.value=Ni.enforcement_enabled!==!1;const Ei=Ni.max_airtime_percent;typeof Ei=="number"?Dt.value=Ei:Ei&&typeof Ei=="object"&&"parsedValue"in Ei&&(Dt.value=Ei.parsedValue||10)}}const ra=yi.utilization_percent;typeof ra=="number"?kt.value=ra:ra&&typeof ra=="object"&&"parsedValue"in ra&&(kt.value=ra.parsedValue||0)}async function ai(yi){try{const ra=await Xh.post("/set_mode",{mode:yi});if(ra.success)return J.value=yi,!0;throw new Error(ra.error||"Failed to set mode")}catch(ra){throw z.value=ra instanceof Error?ra.message:"Unknown error occurred",console.error("Error setting mode:",ra),ra}}async function Qi(yi){try{const ra=await Xh.post("/set_duty_cycle",{enabled:yi});if(ra.success)return mt.value=yi,!0;throw new Error(ra.error||"Failed to set duty cycle")}catch(ra){throw z.value=ra instanceof Error?ra.message:"Unknown error occurred",console.error("Error setting duty cycle:",ra),ra}}async function Gi(){try{const yi=await Xh.post("/send_advert",{},{timeout:1e4});if(yi.success)return console.log("Advertisement sent successfully:",yi.data),!0;throw new Error(yi.error||"Failed to send advert")}catch(yi){throw z.value=yi instanceof Error?yi.message:"Unknown error occurred",console.error("Error sending advert:",yi),yi}}async function un(){const yi=J.value==="forward"?"monitor":"forward";return await ai(yi)}async function ia(){return await Qi(!mt.value)}async function fa(yi=5e3){await ei();const ra=setInterval(async()=>{try{await ei()}catch(Da){console.error("Auto-refresh error:",Da)}},yi);return()=>clearInterval(ra)}function Li(){d.value=null,z.value=null,j.value=null,l.value=!1,J.value="forward",mt.value=!0,kt.value=0,Dt.value=10}return{stats:d,isLoading:l,error:z,lastUpdated:j,currentMode:J,dutyCycleEnabled:mt,dutyCycleUtilization:kt,dutyCycleMax:Dt,cadCalibrationRunning:Gt,nodeName:re,pubKey:pe,hasStats:Ne,version:or,coreVersion:_r,noiseFloorDbm:Fr,dutyCyclePercentage:zr,statusBadge:Wr,modeButtonState:An,dutyCycleButtonState:Ft,fetchStats:ei,setMode:ai,setDutyCycle:Qi,sendAdvert:Gi,toggleMode:un,toggleDutyCycle:ia,startAutoRefresh:fa,reset:Li,setCadCalibrationRunning:kn}}),ld=(d,l)=>{const z=d.__vccOpts||d;for(const[j,J]of l)z[j]=J;return z},sQ={},lQ={width:"23",height:"25",viewBox:"0 0 23 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function uQ(d,l){return zi(),Vi("svg",lQ,l[0]||(l[0]=[Re("path",{d:"M2.84279 2.25795C2.90709 1.12053 3.17879 0.625914 3.95795 0.228723C4.79631 -0.198778 6.11858 0.000168182 7.67449 0.788054C8.34465 1.12757 8.41289 1.13448 9.58736 0.983905C11.1485 0.783681 13.1582 0.784388 14.5991 0.985738C15.6887 1.13801 15.7603 1.1304 16.4321 0.790174C18.6406 -0.328212 20.3842 -0.255036 21.0156 0.982491C21.3308 1.6002 21.3893 3.20304 21.1449 4.52503C21.0094 5.25793 21.0238 5.34943 21.3502 5.83037C23.6466 9.21443 21.9919 14.6998 18.0569 16.7469C17.7558 16.9036 17.502 17.0005 17.2952 17.0795C16.6602 17.3219 16.4674 17.3956 16.7008 18.5117C16.8132 19.0486 16.9486 20.3833 17.0018 21.478C17.098 23.4567 17.0966 23.4705 16.7495 23.8742C16.2772 24.4233 15.5963 24.4326 15.135 23.8962C14.8341 23.5464 14.8047 23.3812 14.8047 22.0315C14.8047 20.037 14.5861 18.7113 14.0695 17.5753C13.4553 16.2235 13.9106 15.7194 15.3154 15.4173C17.268 14.9973 18.793 13.7923 19.643 11.9978C20.4511 10.2921 20.5729 7.93485 19.1119 6.50124C18.6964 6.00746 18.6674 5.56022 18.9641 4.21159C19.075 3.70754 19.168 3.05725 19.1707 2.76637C19.1749 2.30701 19.1331 2.23764 18.8509 2.23764C18.6724 2.23764 17.9902 2.49736 17.3352 2.81474L16.2897 3.32145C16.1947 3.36751 16.0883 3.38522 15.9834 3.37318C13.3251 3.06805 10.7991 3.06334 8.12774 3.37438C8.02244 3.38663 7.91563 3.36892 7.82025 3.32263L6.77535 2.81559C6.12027 2.49764 5.43813 2.23764 5.25963 2.23764C4.84693 2.23764 4.84072 2.54233 5.2169 4.35258C5.44669 5.45816 5.60133 5.70451 4.93703 6.58851C3.94131 7.91359 3.69258 9.55902 4.22654 11.2878C4.89952 13.4664 6.54749 14.9382 8.86436 15.4292C10.261 15.7253 10.6261 16.1115 10.0928 17.713C9.67293 18.9734 9.40748 19.2982 8.79738 19.2982C7.97649 19.2982 7.46228 18.5871 7.74527 17.843C7.86991 17.5151 7.83283 17.4801 7.06383 17.1996C4.71637 16.3437 2.9209 14.4254 2.10002 11.8959C1.46553 9.94098 1.74471 7.39642 2.76257 5.85843C3.10914 5.33477 3.1145 5.29036 2.95277 4.28787C2.86126 3.72037 2.81177 2.80699 2.84279 2.25795Z",fill:"white"},null,-1),Re("path",{d:"M2.02306 16.5589C1.68479 16.0516 0.999227 15.9144 0.491814 16.2527C-0.0155884 16.591 -0.152708 17.2765 0.185564 17.7839C0.435301 18.1586 0.734065 18.4663 0.987777 18.72C1.03455 18.7668 1.08 18.8119 1.12438 18.856C1.3369 19.0671 1.52455 19.2535 1.71302 19.4748C2.12986 19.964 2.54572 20.623 2.78206 21.8047C2.88733 22.3311 3.26569 22.6147 3.47533 22.7386C3.70269 22.8728 3.9511 22.952 4.15552 23.0036C4.57369 23.109 5.08133 23.1638 5.56309 23.1957C6.09196 23.2308 6.665 23.2422 7.17743 23.2453C7.1778 23.8547 7.67202 24.3487 8.28162 24.3487C8.89146 24.3487 9.38582 23.8543 9.38582 23.2445V22.1403C9.38582 21.5305 8.89146 21.0361 8.28162 21.0361C8.17753 21.0361 8.06491 21.0364 7.94562 21.0369C7.29761 21.0389 6.45295 21.0414 5.70905 20.9922C5.35033 20.9684 5.05544 20.9347 4.8392 20.8936C4.50619 19.5863 3.96821 18.7165 3.39415 18.0426C3.14038 17.7448 2.87761 17.4842 2.66387 17.2722C2.62385 17.2326 2.58556 17.1946 2.54935 17.1584C2.30273 16.9118 2.1414 16.7365 2.02306 16.5589Z",fill:"white"},null,-1)]))}const cQ=ld(sQ,[["render",uQ]]),hQ={},fQ={width:"17",height:"24",viewBox:"0 0 17 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dQ(d,l){return zi(),Vi("svg",fQ,l[0]||(l[0]=[Ff('<path d="M14.8437 5.58302L14.8272 5.57333L14.7891 5.56171C14.8044 5.57465 14.8236 5.58214 14.8437 5.58302Z" fill="white"></path><path d="M14.8529 5.57989C14.8504 5.57957 14.8479 5.57897 14.8455 5.57812C14.8453 5.57976 14.8453 5.58142 14.8455 5.58307C14.8481 5.58271 14.8507 5.58162 14.8529 5.57989Z" fill="white"></path><path d="M15.0703 7.29725L15.0981 7.28141L15.1084 7.27564L15.1178 7.26562C15.1002 7.27319 15.0841 7.28393 15.0703 7.29725Z" fill="white"></path><path d="M14.8955 5.61866L14.8684 5.59283L14.85 5.58282C14.8599 5.60027 14.8762 5.61314 14.8955 5.61866Z" fill="white"></path><path d="M8.07083 22.2586C8.04917 22.268 8.03015 22.2826 8.01562 22.3012L8.03273 22.2902C8.04437 22.2795 8.06081 22.2669 8.07083 22.2586Z" fill="white"></path><path d="M12.0329 21.4816C12.0329 21.4571 12.021 21.4616 12.0239 21.5488C12.0239 21.5417 12.0268 21.5346 12.0281 21.5278C12.0297 21.5123 12.031 21.4971 12.0329 21.4816Z" fill="white"></path><path d="M11.624 22.2586C11.6023 22.268 11.5833 22.2826 11.5687 22.3012L11.5859 22.2902C11.5975 22.2795 11.614 22.2669 11.624 22.2586Z" fill="white"></path><path d="M5.28005 22.4428C5.2636 22.4284 5.24346 22.4191 5.22192 22.4156C5.23937 22.424 5.2568 22.4324 5.26842 22.4389L5.28005 22.4428Z" fill="white"></path><path d="M4.64951 21.8411C4.64694 21.8157 4.63913 21.7911 4.62659 21.7687C4.63547 21.792 4.64291 21.8157 4.64886 21.8398L4.64951 21.8411Z" fill="white"></path><path d="M8.86811 11.0897C8.00609 11.4588 7.02779 11.8772 5.75984 11.8772C5.22942 11.8761 4.70159 11.8034 4.19067 11.6609L5.06759 20.6642C5.09864 21.0405 5.27006 21.3914 5.54784 21.6472C5.82562 21.9029 6.18941 22.0449 6.56705 22.0448C6.56705 22.0448 7.81043 22.1094 8.22527 22.1094C8.67185 22.1094 10.0108 22.0448 10.0108 22.0448C10.3883 22.0448 10.752 21.9028 11.0297 21.6471C11.3075 21.3913 11.4788 21.0405 11.5099 20.6642L12.4491 10.7152C12.0294 10.5718 11.6058 10.4766 11.1282 10.4766C10.3023 10.4763 9.63689 10.7607 8.86811 11.0897Z" fill="#FFDD00"></path><path d="M1.47656 7.24689L1.49141 7.26081L1.5011 7.26663C1.49364 7.25919 1.48541 7.25259 1.47656 7.24689Z" fill="white"></path><path d="M16.5048 6.41466L16.3727 5.74859C16.2542 5.15095 15.9853 4.58625 15.3718 4.37024C15.1752 4.30115 14.9521 4.27145 14.8013 4.12841C14.6505 3.98538 14.606 3.76324 14.5711 3.55725C14.5065 3.17917 14.4458 2.80076 14.3796 2.42332C14.3225 2.09884 14.2773 1.73431 14.1284 1.43662C13.9347 1.0369 13.5328 0.803142 13.133 0.648486C12.9282 0.572029 12.7192 0.507349 12.5069 0.454765C11.5083 0.1913 10.4584 0.0944382 9.43098 0.0392269C8.1978 -0.0288182 6.96138 -0.00831713 5.73115 0.100573C4.81548 0.183874 3.85106 0.284611 2.98091 0.60135C2.66288 0.717258 2.33517 0.856416 2.09334 1.10212C1.79662 1.40401 1.69976 1.87088 1.91641 2.24735C2.07041 2.5147 2.33129 2.70358 2.608 2.82853C2.96842 2.98952 3.34482 3.11204 3.73095 3.19402C4.80612 3.43165 5.91971 3.52496 7.01814 3.56468C8.23554 3.61381 9.45498 3.57399 10.6666 3.44554C10.9662 3.4126 11.2653 3.3731 11.5639 3.32704C11.9155 3.27312 12.1411 2.81335 12.0375 2.49306C11.9135 2.11013 11.5803 1.96161 11.2035 2.01941C11.148 2.02813 11.0928 2.0362 11.0372 2.04427L10.9972 2.05008C10.8695 2.06623 10.7419 2.08129 10.6143 2.09528C10.3506 2.12369 10.0863 2.14694 9.82128 2.16502C9.22788 2.20635 8.6328 2.2254 8.03808 2.22637C7.45368 2.22637 6.86898 2.2099 6.28584 2.17148C6.0198 2.15404 5.7544 2.13187 5.48964 2.10497C5.36921 2.09237 5.2491 2.07914 5.12899 2.06429L5.01469 2.04976L4.98983 2.0462L4.87134 2.02909C4.62919 1.99261 4.38703 1.95064 4.14746 1.89994C4.12328 1.89458 4.10166 1.88113 4.08616 1.86182C4.07066 1.8425 4.06222 1.81848 4.06222 1.79372C4.06222 1.76896 4.07066 1.74493 4.08616 1.72562C4.10166 1.7063 4.12328 1.69286 4.14746 1.68749H4.15198C4.35959 1.64326 4.56881 1.60549 4.77868 1.57255C4.84863 1.56157 4.9188 1.55081 4.98919 1.54027H4.99112C5.12254 1.53155 5.25459 1.50797 5.38535 1.49248C6.52302 1.37414 7.66752 1.33379 8.8107 1.37173C9.36576 1.38787 9.9204 1.42048 10.4729 1.47666C10.5917 1.48892 10.7099 1.50184 10.828 1.51637C10.8732 1.52186 10.9187 1.52831 10.9643 1.5338L11.056 1.54705C11.3233 1.58686 11.5892 1.63519 11.8538 1.69201C12.2458 1.77725 12.7491 1.80502 12.9235 2.23444C12.979 2.37069 13.0042 2.52212 13.0349 2.66515L13.0739 2.84758C13.075 2.85085 13.0757 2.85419 13.0762 2.85758C13.1686 3.28808 13.261 3.71858 13.3535 4.14908C13.3603 4.18088 13.3605 4.21374 13.354 4.24561C13.3475 4.27747 13.3346 4.30766 13.3159 4.33429C13.2973 4.36092 13.2733 4.38342 13.2455 4.40038C13.2178 4.41734 13.1869 4.42841 13.1546 4.43288H13.1521L13.0955 4.44063L13.0397 4.44806C12.8628 4.47109 12.6856 4.49261 12.5083 4.51263C12.1589 4.55245 11.809 4.58689 11.4586 4.61595C10.7623 4.67386 10.0645 4.71185 9.3654 4.72993C9.00918 4.7394 8.65302 4.74381 8.29704 4.74316C6.87996 4.74205 5.46407 4.65968 4.05641 4.49649C3.90401 4.47841 3.75161 4.45904 3.59922 4.43934C3.71739 4.45451 3.51334 4.42772 3.47201 4.4219C3.37514 4.40834 3.27829 4.39424 3.18142 4.37961C2.85629 4.33085 2.53309 4.2708 2.20861 4.21817C1.81631 4.1536 1.44113 4.18589 1.0863 4.37961C0.79503 4.53899 0.559289 4.78341 0.410525 5.08024C0.257483 5.39666 0.211958 5.74117 0.143509 6.08118C0.0750606 6.42114 -0.0314881 6.78696 0.008871 7.13598C0.095724 7.88922 0.622332 8.5014 1.37979 8.63832C2.09237 8.76744 2.80883 8.87208 3.52722 8.96118C6.3492 9.30678 9.20022 9.34812 12.031 9.08454C12.2616 9.063 12.4918 9.03954 12.7217 9.0141C12.7935 9.00624 12.8662 9.01452 12.9343 9.03834C13.0025 9.06216 13.0645 9.10092 13.1158 9.15186C13.1671 9.20274 13.2063 9.26442 13.2306 9.33246C13.2549 9.4005 13.2637 9.4731 13.2563 9.54492L13.1847 10.2417C13.0402 11.6497 12.8958 13.0574 12.7514 14.4652C12.6007 15.9435 12.449 17.4217 12.2965 18.8999C12.2534 19.3162 12.2104 19.7323 12.1673 20.1484C12.126 20.5582 12.1202 20.9808 12.0424 21.3857C11.9197 22.0223 11.4886 22.4134 10.8596 22.5564C10.2835 22.6875 9.6948 22.7564 9.10386 22.7617C8.44878 22.7653 7.794 22.7362 7.13886 22.7398C6.43956 22.7437 5.58295 22.6791 5.04311 22.1586C4.56881 21.7014 4.50326 20.9856 4.43869 20.3666C4.35259 19.5472 4.26724 18.7279 4.18265 17.9086L3.70803 13.3532L3.40097 10.4057C3.39581 10.357 3.39064 10.3088 3.3858 10.2598C3.349 9.90816 3.10006 9.564 2.70777 9.58176C2.37198 9.59658 1.99034 9.882 2.02973 10.2598L2.25736 12.445L2.72811 16.9652C2.86221 18.2492 2.99599 19.5334 3.12944 20.8177C3.15527 21.0638 3.17948 21.3104 3.2066 21.5564C3.35416 22.9009 4.38089 23.6254 5.65237 23.8295C6.39498 23.9489 7.15566 23.9735 7.90926 23.9857C8.87526 24.0013 9.85098 24.0384 10.8012 23.8634C12.2093 23.6051 13.2657 22.6649 13.4165 21.2065C13.4596 20.7854 13.5026 20.3643 13.5457 19.943C13.6888 18.55 13.8317 17.1568 13.9744 15.7634L14.4413 11.2109L14.6554 9.12456C14.666 9.02112 14.7097 8.9238 14.78 8.84712C14.8502 8.77044 14.9433 8.71836 15.0454 8.69868C15.448 8.6202 15.8329 8.48622 16.1192 8.1798C16.5752 7.69194 16.6659 7.05588 16.5048 6.41466ZM1.35913 6.86478C1.36526 6.86184 1.35396 6.91446 1.34912 6.939C1.34815 6.90192 1.35008 6.86898 1.35913 6.86478ZM1.39819 7.167C1.40143 7.16472 1.41111 7.17762 1.42112 7.1931C1.40594 7.17894 1.39658 7.16826 1.39819 7.167ZM1.43662 7.21764C1.4505 7.24122 1.45793 7.2561 1.43662 7.21764V7.21764ZM1.51378 7.28028H1.51572C1.51572 7.28256 1.51927 7.28484 1.52056 7.28706C1.51842 7.2846 1.51637 7.28232 1.51378 7.28028ZM15.0266 7.18668C14.882 7.3242 14.6641 7.38816 14.4487 7.42008C12.0337 7.77852 9.58332 7.95996 7.1418 7.87986C5.39439 7.82016 3.66541 7.62612 1.93546 7.38168C1.76594 7.3578 1.58223 7.32678 1.46567 7.20186C1.24612 6.96612 1.35396 6.49152 1.41111 6.20676C1.46341 5.94587 1.5635 5.59813 1.87379 5.561C2.3581 5.50418 2.92054 5.70856 3.39968 5.7812C3.97655 5.86924 4.55557 5.93973 5.13674 5.99268C7.61706 6.2187 10.139 6.18348 12.6083 5.85288C13.0584 5.79239 13.5069 5.72212 13.9538 5.64204C14.3519 5.57069 14.7932 5.4367 15.0338 5.849C15.1988 6.1299 15.2207 6.50574 15.1952 6.82314C15.1873 6.96138 15.1273 7.09146 15.0266 7.18668Z" fill="white"></path>',12)]))}const pQ=ld(hQ,[["render",dQ]]),rw=GA("packets",()=>{const d=lo(null),l=lo(null),z=lo([]),j=lo([]),J=lo(null),mt=lo(!1),kt=lo(null),Dt=lo(null),Gt=lo([]),re=lo([]),pe=Yo(()=>d.value!==null),Ne=Yo(()=>l.value!==null),or=Yo(()=>z.value.length>0),_r=Yo(()=>j.value.length>0),Fr=Yo(()=>J.value?.avg_noise_floor??0),zr=Yo(()=>d.value?.total_packets??0),Wr=Yo(()=>d.value?.avg_rssi??0),An=Yo(()=>d.value?.avg_snr??0),Ft=Yo(()=>l.value?.uptime_seconds??0),kn=Yo(()=>{if(!d.value?.packet_types)return[];const Ni=d.value.packet_types,Ei=Ni.reduce((Va,ss)=>Va+ss.count,0);return Ni.map(Va=>({type:Va.type.toString(),count:Va.count,percentage:Ei>0?Va.count/Ei*100:0}))}),ei=Yo(()=>{const Ni={};return z.value.forEach(Ei=>{Ni[Ei.type]||(Ni[Ei.type]=[]),Ni[Ei.type].push(Ei)}),Ni});async function jn(){try{const Ni=await Xh.get("/stats");if(Ni.success&&Ni.data){l.value=Ni.data;const Ei=new Date;return re.value.push({timestamp:Ei,stats:Ni.data}),re.value.length>50&&(re.value=re.value.slice(-50)),Ni.data}else if(Ni&&"version"in Ni){const Ei=Ni;l.value=Ei;const Va=new Date;return re.value.push({timestamp:Va,stats:Ei}),re.value.length>50&&(re.value=re.value.slice(-50)),Ei}else throw new Error(Ni.error||"Failed to fetch system stats")}catch(Ni){throw kt.value=Ni instanceof Error?Ni.message:"Unknown error occurred",console.error("Error fetching system stats:",Ni),Ni}}async function ai(Ni={hours:24}){try{const Ei=await Xh.get("/noise_floor_history",Ni);if(Ei.success&&Ei.data&&Ei.data.history)return j.value=Ei.data.history,Dt.value=new Date,Ei.data.history;throw new Error(Ei.error||"Failed to fetch noise floor history")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching noise floor history:",Ei),Ei}}async function Qi(Ni={hours:24}){try{const Ei=await Xh.get("/noise_floor_stats",Ni);if(Ei.success&&Ei.data&&Ei.data.stats)return J.value=Ei.data.stats,Dt.value=new Date,Ei.data.stats;throw new Error(Ei.error||"Failed to fetch noise floor stats")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching noise floor stats:",Ei),Ei}}const Gi=Yo(()=>!j.value||!Array.isArray(j.value)?[]:j.value.slice(-50).map(Ni=>Ni.noise_floor_dbm));async function un(Ni={hours:24}){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/packet_stats",Ni);if(Ei.success&&Ei.data){d.value=Ei.data;const Va=new Date;Gt.value.push({timestamp:Va,stats:Ei.data}),Gt.value.length>50&&(Gt.value=Gt.value.slice(-50)),Dt.value=Va}else throw new Error(Ei.error||"Failed to fetch packet stats")}catch(Ei){kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching packet stats:",Ei)}finally{mt.value=!1}}async function ia(Ni={limit:100}){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/recent_packets",Ni);if(Ei.success&&Ei.data)z.value=Ei.data,Dt.value=new Date;else throw new Error(Ei.error||"Failed to fetch recent packets")}catch(Ei){kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching recent packets:",Ei)}finally{mt.value=!1}}async function fa(Ni){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/filtered_packets",Ni);if(Ei.success&&Ei.data)return z.value=Ei.data,Dt.value=new Date,Ei.data;throw new Error(Ei.error||"Failed to fetch filtered packets")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching filtered packets:",Ei),Ei}finally{mt.value=!1}}async function Li(Ni){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/packet_by_hash",{packet_hash:Ni});if(Ei.success&&Ei.data)return Ei.data;throw new Error(Ei.error||"Packet not found")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching packet by hash:",Ei),Ei}finally{mt.value=!1}}const yi=Yo(()=>{const Ni=Gt.value,Ei=re.value;return{totalPackets:Ni.map(Va=>Va.stats.total_packets),transmittedPackets:Ni.map(Va=>Va.stats.transmitted_packets),droppedPackets:Ni.map(Va=>Va.stats.dropped_packets),avgRssi:Ni.map(Va=>Va.stats.avg_rssi),uptimeHours:Ei.map(Va=>Math.floor((Va.stats.uptime_seconds||0)/3600))}});async function ra(Ni=3e4){await Promise.all([jn(),un(),ia(),ai({hours:1}),Qi({hours:1})]);const Ei=setInterval(async()=>{try{await Promise.all([jn(),un(),ia(),ai({hours:1}),Qi({hours:1})])}catch(Va){console.error("Auto-refresh error:",Va)}},Ni);return()=>clearInterval(Ei)}function Da(){d.value=null,l.value=null,z.value=[],j.value=[],J.value=null,Gt.value=[],re.value=[],kt.value=null,Dt.value=null,mt.value=!1}return{packetStats:d,systemStats:l,recentPackets:z,noiseFloorHistory:j,noiseFloorStats:J,packetStatsHistory:Gt,systemStatsHistory:re,isLoading:mt,error:kt,lastUpdated:Dt,hasPacketStats:pe,hasSystemStats:Ne,hasRecentPackets:or,hasNoiseFloorData:_r,currentNoiseFloor:Fr,totalPackets:zr,averageRSSI:Wr,averageSNR:An,uptime:Ft,packetTypeBreakdown:kn,recentPacketsByType:ei,sparklineData:yi,noiseFloorSparklineData:Gi,fetchSystemStats:jn,fetchPacketStats:un,fetchRecentPackets:ia,fetchFilteredPackets:fa,getPacketByHash:Li,fetchNoiseFloorHistory:ai,fetchNoiseFloorStats:Qi,startAutoRefresh:ra,reset:Da}}),mQ={class:"glass-card-green p-5 relative overflow-hidden"},gQ={key:0,class:"absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-10 rounded-lg"},vQ={class:"flex items-baseline gap-2 mb-8"},yQ={class:"text-primary text-2xl font-medium"},xQ={class:"absolute bottom-0 left-5 w-[196px] h-[30px]",viewBox:"0 0 196 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_Q=["d"],bQ=["d"],wQ=["cy"],kQ=Th({__name:"RFNoiseFloor",setup(d){const l=rw(),z=sv(),j=lo(null),J=pe=>{if(pe.length<2)return"";const Ne=196,or=30,_r=4,Fr=-125,Wr=-105-Fr;let An="";return pe.forEach((Ft,kn)=>{const ei=kn/(pe.length-1)*Ne,jn=(Ft-Fr)/Wr,ai=or-jn*(or-_r*2)-_r;if(kn===0)An+=`M ${ei} ${ai}`;else{const Gi=((kn-1)/(pe.length-1)*Ne+ei)/2;An+=` Q ${Gi} ${ai} ${ei} ${ai}`}}),An},mt=async()=>{try{await Promise.all([l.fetchNoiseFloorHistory({hours:1}),l.fetchNoiseFloorStats({hours:1})])}catch(pe){console.error("Error fetching noise floor data:",pe)}};t0(()=>{mt(),j.value=window.setInterval(mt,5e3)}),dg(()=>{j.value&&clearInterval(j.value)});const kt=Yo(()=>{const pe=l.noiseFloorSparklineData;return pe&&pe.length>0?pe[pe.length-1]:l.noiseFloorStats?.avg_noise_floor??-116}),Dt=Yo(()=>l.noiseFloorSparklineData),Gt=Yo(()=>J(Dt.value)),re=Yo(()=>{if(Dt.value.length===0)return 15;const pe=Dt.value[Dt.value.length-1],Ne=-125,_r=-105-Ne;return 30-(pe-Ne)/_r*22-4});return(pe,Ne)=>(zi(),Vi("div",mQ,[Ju(z).cadCalibrationRunning?(zi(),Vi("div",gQ,Ne[0]||(Ne[0]=[Ff('<div class="text-center" data-v-ad12b3cb><div class="flex items-center justify-center gap-2 mb-2" data-v-ad12b3cb><svg class="w-4 h-4 text-primary animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ad12b3cb><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" data-v-ad12b3cb></path></svg><span class="text-primary text-sm font-medium" data-v-ad12b3cb>CAD Calibration</span></div><p class="text-white/70 text-xs" data-v-ad12b3cb>In Progress</p></div>',1)]))):bs("",!0),Ne[4]||(Ne[4]=Re("p",{class:"text-dark-text text-xs uppercase mb-2"},"RF NOISE FLOOR",-1)),Re("div",vQ,[Re("span",yQ,aa(kt.value),1),Ne[1]||(Ne[1]=Re("span",{class:"text-dark-text text-xs uppercase"},"dBm",-1))]),(zi(),Vi("svg",xQ,[Ne[3]||(Ne[3]=Ff('<defs data-v-ad12b3cb><linearGradient id="rf-noise-gradient" x1="0" y1="0" x2="0" y2="30" gradientUnits="userSpaceOnUse" data-v-ad12b3cb><stop stop-color="#B1FFFF" stop-opacity="0.8" data-v-ad12b3cb></stop><stop offset="1" stop-color="#6A9999" stop-opacity="0" data-v-ad12b3cb></stop></linearGradient><filter id="line-glow" data-v-ad12b3cb><feGaussianBlur stdDeviation="1" result="coloredBlur" data-v-ad12b3cb></feGaussianBlur><feMerge data-v-ad12b3cb><feMergeNode in="coloredBlur" data-v-ad12b3cb></feMergeNode><feMergeNode in="SourceGraphic" data-v-ad12b3cb></feMergeNode></feMerge></filter></defs>',1)),Dt.value.length>1?(zi(),Vi("path",{key:0,d:`${Gt.value} L 196 30 L 0 30 Z`,fill:"url(#rf-noise-gradient)",class:"transition-all duration-500 ease-out"},null,8,_Q)):bs("",!0),Dt.value.length>1?(zi(),Vi("path",{key:1,d:Gt.value,stroke:"#B1FFFF","stroke-width":"2",fill:"none",filter:"url(#line-glow)",class:"transition-all duration-500 ease-out"},null,8,bQ)):bs("",!0),Dt.value.length>0?(zi(),Vi("circle",{key:2,cx:196,cy:re.value,r:"2",fill:"#B1FFFF",class:"animate-pulse"},Ne[2]||(Ne[2]=[Re("animate",{attributeName:"r",values:"2;3;2",dur:"2s",repeatCount:"indefinite"},null,-1)]),8,wQ)):bs("",!0)]))]))}}),TQ=ld(kQ,[["__scopeId","data-v-ad12b3cb"]]),AQ={},MQ={width:"800px",height:"800px",viewBox:"0 -1.5 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"w-full h-full"};function SQ(d,l){return zi(),Vi("svg",MQ,l[0]||(l[0]=[Re("g",{id:"Page-1",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[Re("g",{transform:"translate(-420.000000, -3641.000000)",fill:"currentColor"},[Re("g",{id:"icons",transform:"translate(56.000000, 160.000000)"},[Re("path",{d:"M378.195439,3483.828 L376.781439,3485.242 C378.195439,3486.656 378.294439,3489.588 376.880439,3491.002 L378.294439,3492.417 C380.415439,3490.295 380.316439,3485.949 378.195439,3483.828 M381.023439,3481 L379.609439,3482.414 C382.438439,3485.242 382.537439,3491.002 379.708439,3493.831 L381.122439,3495.245 C385.365439,3491.002 384.559439,3484.535 381.023439,3481 M375.432439,3486.737 C375.409439,3486.711 375.392439,3486.682 375.367439,3486.656 L375.363439,3486.66 C374.582439,3485.879 373.243439,3485.952 372.536439,3486.659 C371.829439,3487.366 371.831439,3488.778 372.538439,3489.485 C372.547439,3489.494 372.558439,3489.499 372.567439,3489.508 C372.590439,3489.534 372.607439,3489.563 372.632439,3489.588 L372.636439,3489.585 C373.201439,3490.15 373.000439,3488.284 373.000439,3498 L375.000439,3498 C375.000439,3488.058 374.753439,3490.296 375.463439,3489.586 C376.170439,3488.879 376.168439,3487.467 375.461439,3486.76 C375.452439,3486.751 375.441439,3486.746 375.432439,3486.737 M371.119439,3485.242 L369.705439,3483.828 C367.584439,3485.949 367.683439,3490.295 369.804439,3492.417 L371.218439,3491.002 C369.804439,3489.588 369.705439,3486.656 371.119439,3485.242 M368.390439,3493.831 L366.976439,3495.245 C363.440439,3491.709 362.634439,3485.242 366.877439,3481 L368.291439,3482.414 C365.462439,3485.242 365.561439,3491.002 368.390439,3493.831",id:"radio_tower-[#1019]"})])])],-1)]))}const EQ=ld(AQ,[["render",SQ]]),CQ={class:"text-center"},LQ={class:"relative flex items-center justify-center mb-8"},PQ={class:"relative w-32 h-32"},zQ={class:"absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2"},IQ={key:0,class:"absolute inset-0 flex items-center justify-center"},OQ={key:1,class:"absolute inset-0 flex items-center justify-center"},DQ={key:2,class:"absolute inset-0"},FQ={class:"mb-6"},RQ={key:0,class:"text-white text-lg"},BQ={key:1,class:"text-accent-green text-lg font-medium"},NQ={key:2,class:"text-secondary text-lg"},jQ={key:3,class:"text-accent-red text-lg"},UQ={key:4,class:"text-dark-text"},VQ={key:5,class:"mt-3"},HQ={key:0,class:"text-secondary text-sm"},WQ={key:1,class:"text-accent-red text-sm"},qQ={key:0,class:"flex gap-3"},ZQ={key:1,class:"text-dark-text text-sm"},$Q=Th({name:"AdvertModal",__name:"AdvertModal",props:{isOpen:{type:Boolean},isLoading:{type:Boolean},isSuccess:{type:Boolean},error:{default:null}},emits:["close","send"],setup(d,{emit:l}){const z=d,j=l,J=lo(!1),mt=lo(!1),kt=lo(!1);um(()=>z.isOpen,pe=>{pe?(J.value=!0,setTimeout(()=>{mt.value=!0},50)):(mt.value=!1,kt.value=!1,setTimeout(()=>{J.value=!1},300))},{immediate:!0}),um(()=>z.isLoading,pe=>{pe||setTimeout(()=>{kt.value=!1},1e3)});const Dt=()=>{z.isLoading||j("close")},Gt=()=>{z.isLoading||(kt.value=!0,j("send"))},re=pe=>pe?.includes("Network error - no response received")||pe?.includes("timeout");return(pe,Ne)=>(zi(),hm($z,{to:"body"},[J.value?(zi(),Vi("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:hg(Dt,["self"])},[Re("div",{class:Xs(["absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity duration-300",mt.value?"opacity-100":"opacity-0"])},null,2),Re("div",{class:Xs(["relative glass-card rounded-[20px] p-8 max-w-md w-full transform transition-all duration-300",mt.value?"scale-100 opacity-100":"scale-95 opacity-0"])},[pe.isLoading?bs("",!0):(zi(),Vi("button",{key:0,onClick:Dt,class:"absolute top-4 right-4 text-dark-text hover:text-white transition-colors p-2"},Ne[0]||(Ne[0]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))),Re("div",CQ,[Ne[6]||(Ne[6]=Re("h2",{class:"text-white text-xl font-semibold mb-6"},"Send Advertisement",-1)),Re("div",LQ,[Re("div",PQ,[Re("div",zQ,[gu(EQ,{class:Xs(["w-16 h-16 transition-all duration-500",[pe.isLoading?"animate-pulse":"",pe.isSuccess?"text-accent-green":pe.error&&!re(pe.error)?"text-accent-red":"text-primary"]]),style:av({filter:pe.isLoading?"drop-shadow(0 0 8px currentColor)":pe.isSuccess?"drop-shadow(0 0 8px #A5E5B6)":pe.error&&!re(pe.error)?"drop-shadow(0 0 8px #FB787B)":"drop-shadow(0 0 4px #AAE8E8)"})},null,8,["class","style"])]),pe.isLoading||pe.isSuccess?(zi(),Vi("div",IQ,[Re("div",{class:Xs(["absolute w-16 h-16 rounded-full border-2 animate-ping",[pe.isSuccess?"border-accent-green/60":"border-primary/60"]]),style:{"animation-duration":"1.5s"}},null,2),Re("div",{class:Xs(["absolute w-24 h-24 rounded-full border-2 animate-ping",[pe.isSuccess?"border-accent-green/40":"border-primary/40"]]),style:{"animation-duration":"2s","animation-delay":"0.3s"}},null,2),Re("div",{class:Xs(["absolute w-32 h-32 rounded-full border-2 animate-ping",[pe.isSuccess?"border-accent-green/20":"border-primary/20"]]),style:{"animation-duration":"2.5s","animation-delay":"0.6s"}},null,2)])):bs("",!0),kt.value?(zi(),Vi("div",OQ,Ne[1]||(Ne[1]=[Re("div",{class:"absolute w-8 h-8 rounded-full border-4 border-secondary animate-ping-fast"},null,-1),Re("div",{class:"absolute w-16 h-16 rounded-full border-3 border-secondary/70 animate-ping-fast",style:{"animation-delay":"0.1s"}},null,-1),Re("div",{class:"absolute w-24 h-24 rounded-full border-2 border-secondary/50 animate-ping-fast",style:{"animation-delay":"0.2s"}},null,-1),Re("div",{class:"absolute w-32 h-32 rounded-full border-2 border-secondary/30 animate-ping-fast",style:{"animation-delay":"0.3s"}},null,-1)]))):bs("",!0),pe.isLoading||pe.isSuccess?(zi(),Vi("div",DQ,[Re("div",{class:Xs(["absolute top-2 right-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"0.5s"}},Ne[2]||(Ne[2]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Re("div",{class:Xs(["absolute bottom-2 left-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"1s"}},Ne[3]||(Ne[3]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Re("div",{class:Xs(["absolute top-1/2 right-1 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"1.5s",transform:"translateY(-50%)"}},Ne[4]||(Ne[4]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Re("div",{class:Xs(["absolute top-3 left-3 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"2s"}},Ne[5]||(Ne[5]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2)])):bs("",!0)])]),Re("div",FQ,[pe.isLoading?(zi(),Vi("p",RQ," Broadcasting advertisement... ")):pe.isSuccess?(zi(),Vi("p",BQ," Advertisement sent successfully! ")):pe.error&&re(pe.error)?(zi(),Vi("p",NQ," Advertisement likely sent ")):pe.error?(zi(),Vi("p",jQ," Failed to send advertisement ")):(zi(),Vi("p",UQ," This will broadcast your node's presence to nearby nodes. ")),pe.error?(zi(),Vi("div",VQ,[re(pe.error)?(zi(),Vi("p",HQ," Network timeout occurred, but the advertisement may have been successfully transmitted to nearby nodes. ")):(zi(),Vi("p",WQ,aa(pe.error),1))])):bs("",!0)]),!pe.isLoading&&!pe.isSuccess?(zi(),Vi("div",qQ,[Re("button",{onClick:Dt,class:"flex-1 glass-card border border-dark-border hover:border-primary rounded-[10px] px-6 py-3 text-dark-text hover:text-white transition-all duration-200"}," Cancel "),Re("button",{onClick:Gt,class:Xs(["flex-1 rounded-[10px] px-6 py-3 font-medium transition-all duration-200 shadow-lg",[pe.error&&re(pe.error)?"bg-secondary hover:bg-secondary/90 text-dark-bg hover:shadow-secondary/20":"bg-primary hover:bg-primary/90 text-dark-bg hover:shadow-primary/20"]])},aa(pe.error&&re(pe.error)?"Try Again":"Send Advertisement"),3)])):bs("",!0),pe.isSuccess?(zi(),Vi("div",ZQ," Closing automatically... ")):bs("",!0)])],2)])):bs("",!0)]))}}),GQ=ld($Q,[["__scopeId","data-v-a5eb8c7f"]]),YQ={},KQ={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function XQ(d,l){return zi(),Vi("svg",KQ,l[0]||(l[0]=[Ff('<g clip-path="url(#clip0_78_684)"><path d="M7.00008 4.66699C6.53859 4.66699 6.08747 4.80384 5.70375 5.06023C5.32004 5.31662 5.02097 5.68104 4.84436 6.1074C4.66776 6.53376 4.62155 7.00291 4.71158 7.45554C4.80162 7.90816 5.02384 8.32392 5.35017 8.65024C5.67649 8.97656 6.09225 9.19879 6.54487 9.28883C6.99749 9.37886 7.46665 9.33265 7.89301 9.15604C8.31937 8.97944 8.68379 8.68037 8.94018 8.29666C9.19657 7.91294 9.33342 7.46182 9.33342 7.00033C9.33342 6.38149 9.08758 5.78799 8.65 5.35041C8.21241 4.91282 7.61892 4.66699 7.00008 4.66699ZM7.00008 8.16699C6.76934 8.16699 6.54377 8.09857 6.35192 7.97037C6.16006 7.84218 6.01053 7.65997 5.92222 7.44679C5.83392 7.23361 5.81082 6.99903 5.85583 6.77272C5.90085 6.54641 6.01196 6.33853 6.17513 6.17537C6.33829 6.01221 6.54617 5.90109 6.77248 5.85608C6.99879 5.81106 7.23337 5.83416 7.44655 5.92247C7.65973 6.01077 7.84194 6.1603 7.97013 6.35216C8.09833 6.54402 8.16675 6.76958 8.16675 7.00033C8.16675 7.30974 8.04383 7.60649 7.82504 7.82528C7.60625 8.04408 7.3095 8.16699 7.00008 8.16699Z" fill="white"></path><path d="M12.4215 8.10833L12.1625 7.959C12.2791 7.32459 12.2791 6.67424 12.1625 6.03983L12.4215 5.8905C12.6206 5.77559 12.7952 5.62258 12.9353 5.4402C13.0753 5.25782 13.178 5.04965 13.2376 4.82756C13.2972 4.60547 13.3125 4.37383 13.2825 4.14584C13.2526 3.91786 13.178 3.698 13.0631 3.49883C12.9482 3.29966 12.7952 3.12507 12.6128 2.98504C12.4305 2.845 12.2223 2.74225 12.0002 2.68267C11.7781 2.62309 11.5465 2.60783 11.3185 2.63777C11.0905 2.66771 10.8706 2.74226 10.6715 2.85717L10.4119 3.00708C9.92161 2.5882 9.35819 2.26348 8.74996 2.04925V1.75C8.74996 1.28587 8.56559 0.840752 8.2374 0.512563C7.90921 0.184374 7.46409 0 6.99996 0C6.53584 0 6.09072 0.184374 5.76253 0.512563C5.43434 0.840752 5.24996 1.28587 5.24996 1.75V2.04925C4.64177 2.26425 4.07854 2.58977 3.58863 3.00942L3.32788 2.85833C2.92564 2.62627 2.44768 2.5635 1.99915 2.68384C1.55063 2.80417 1.16828 3.09775 0.936214 3.5C0.70415 3.90224 0.641381 4.3802 0.761717 4.82873C0.882053 5.27725 1.17564 5.6596 1.57788 5.89167L1.83688 6.041C1.72028 6.67541 1.72028 7.32576 1.83688 7.96017L1.57788 8.1095C1.17564 8.34156 0.882053 8.72392 0.761717 9.17244C0.641381 9.62096 0.70415 10.0989 0.936214 10.5012C1.16828 10.9034 1.55063 11.197 1.99915 11.3173C2.44768 11.4377 2.92564 11.3749 3.32788 11.1428L3.58746 10.9929C4.07791 11.4119 4.64154 11.7366 5.24996 11.9507V12.25C5.24996 12.7141 5.43434 13.1592 5.76253 13.4874C6.09072 13.8156 6.53584 14 6.99996 14C7.46409 14 7.90921 13.8156 8.2374 13.4874C8.56559 13.1592 8.74996 12.7141 8.74996 12.25V11.9507C9.35816 11.7358 9.92139 11.4102 10.4113 10.9906L10.672 11.1411C11.0743 11.3731 11.5523 11.4359 12.0008 11.3156C12.4493 11.1952 12.8317 10.9017 13.0637 10.4994C13.2958 10.0972 13.3585 9.61921 13.2382 9.17069C13.1179 8.72217 12.8243 8.33981 12.422 8.10775L12.4215 8.10833ZM10.9351 5.90567C11.1327 6.62145 11.1327 7.37738 10.9351 8.09317C10.9006 8.21775 10.9085 8.35026 10.9575 8.46989C11.0065 8.58952 11.0938 8.68948 11.2058 8.75408L11.8381 9.11925C11.9722 9.1966 12.07 9.32404 12.1101 9.47353C12.1502 9.62302 12.1293 9.78232 12.0519 9.91638C11.9746 10.0504 11.8471 10.1483 11.6976 10.1884C11.5481 10.2285 11.3889 10.2075 11.2548 10.1302L10.6213 9.76383C10.5092 9.69893 10.3788 9.67316 10.2504 9.69059C10.1221 9.70801 10.0032 9.76764 9.91255 9.86008C9.39333 10.3901 8.73922 10.7683 8.0208 10.9538C7.8954 10.9861 7.78429 11.0591 7.70498 11.1615C7.62566 11.2638 7.58265 11.3896 7.58271 11.5191V12.25C7.58271 12.4047 7.52126 12.5531 7.41186 12.6625C7.30246 12.7719 7.15409 12.8333 6.99938 12.8333C6.84467 12.8333 6.6963 12.7719 6.5869 12.6625C6.47751 12.5531 6.41605 12.4047 6.41605 12.25V11.5197C6.41611 11.3902 6.3731 11.2644 6.29378 11.162C6.21447 11.0597 6.10336 10.9867 5.97796 10.9544C5.2595 10.7681 4.60557 10.3891 4.0868 9.85833C3.9961 9.76589 3.87723 9.70626 3.74891 9.68884C3.62058 9.67141 3.49011 9.69718 3.37805 9.76208L2.74571 10.1278C2.67935 10.1667 2.60594 10.1921 2.52972 10.2026C2.4535 10.213 2.37597 10.2082 2.3016 10.1886C2.22722 10.1689 2.15747 10.1347 2.09636 10.088C2.03525 10.0413 1.98398 9.9829 1.94552 9.91628C1.90705 9.84965 1.88214 9.77608 1.87223 9.69979C1.86231 9.6235 1.86759 9.54601 1.88774 9.47176C1.9079 9.39752 1.94254 9.328 1.98967 9.2672C2.03681 9.2064 2.0955 9.15552 2.16238 9.1175L2.79471 8.75233C2.90668 8.68773 2.99402 8.58777 3.04302 8.46814C3.09201 8.34851 3.09987 8.216 3.06538 8.09142C2.86784 7.37563 2.86784 6.6197 3.06538 5.90392C3.09925 5.7796 3.09101 5.64756 3.04194 5.52842C2.99287 5.40928 2.90573 5.30974 2.79413 5.24533L2.1618 4.88017C2.02774 4.80281 1.92991 4.67537 1.88981 4.52588C1.84972 4.37639 1.87065 4.2171 1.94801 4.08304C2.02536 3.94899 2.1528 3.85115 2.30229 3.81106C2.45178 3.77096 2.61107 3.79189 2.74513 3.86925L3.37863 4.23558C3.49039 4.30063 3.62059 4.32671 3.74877 4.30971C3.87696 4.29271 3.99586 4.2336 4.0868 4.14167C4.60601 3.61162 5.26013 3.23343 5.97855 3.04792C6.10433 3.01558 6.21573 2.94219 6.29508 2.83938C6.37444 2.73656 6.41721 2.61021 6.41663 2.48033V1.75C6.41663 1.59529 6.47809 1.44692 6.58749 1.33752C6.69688 1.22812 6.84525 1.16667 6.99996 1.16667C7.15467 1.16667 7.30305 1.22812 7.41244 1.33752C7.52184 1.44692 7.5833 1.59529 7.5833 1.75V2.48033C7.58323 2.60981 7.62625 2.73563 7.70556 2.83796C7.78488 2.9403 7.89598 3.01334 8.02138 3.04558C8.74005 3.23176 9.39419 3.61077 9.91313 4.14167C10.0038 4.23411 10.1227 4.29374 10.251 4.31116C10.3793 4.32859 10.5098 4.30282 10.6219 4.23792L11.2542 3.87217C11.3206 3.83326 11.394 3.80786 11.4702 3.79744C11.5464 3.78702 11.624 3.79178 11.6983 3.81144C11.7727 3.83111 11.8425 3.86529 11.9036 3.91202C11.9647 3.95875 12.0159 4.0171 12.0544 4.08373C12.0929 4.15035 12.1178 4.22392 12.1277 4.30021C12.1376 4.3765 12.1323 4.45399 12.1122 4.52824C12.092 4.60248 12.0574 4.672 12.0103 4.7328C11.9631 4.7936 11.9044 4.84448 11.8375 4.8825L11.2052 5.24767C11.0938 5.31224 11.0069 5.41186 10.9581 5.53099C10.9092 5.65012 10.9012 5.78206 10.9351 5.90625V5.90567Z" fill="white"></path></g><defs><clipPath id="clip0_78_684"><rect width="14" height="14" fill="white"></rect></clipPath></defs>',2)]))}const TO=ld(YQ,[["render",XQ]]),JQ={},QQ={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ttt(d,l){return zi(),Vi("svg",QQ,l[0]||(l[0]=[Ff('<path d="M2.625 11.3752V12.8335H1.75C1.59529 12.8335 1.44692 12.7721 1.33752 12.6627C1.22812 12.5533 1.16667 12.4049 1.16667 12.2502V11.3752H2.625ZM3.79167 10.2085H0V12.2502C0 12.7143 0.184374 13.1594 0.512563 13.4876C0.840752 13.8158 1.28587 14.0002 1.75 14.0002H3.79167V10.2085Z" fill="#AAE8E8"></path><path d="M12.8332 11.3752V12.2502C12.8332 12.4049 12.7718 12.5533 12.6624 12.6627C12.553 12.7721 12.4046 12.8335 12.2499 12.8335H11.3749V11.3752H12.8332ZM13.9999 10.2085H10.2083V14.0002H12.2499C12.714 14.0002 13.1592 13.8158 13.4873 13.4876C13.8155 13.1594 13.9999 12.7143 13.9999 12.2502V10.2085Z" fill="#AAE8E8"></path><path d="M2.625 6.27067V7.729H1.16667V6.27067H2.625ZM3.79167 5.104H0V8.89566H3.79167V5.104Z" fill="#AAE8E8"></path><path d="M12.8332 6.27067V7.729H11.3749V6.27067H12.8332ZM13.9999 5.104H10.2083V8.89566H13.9999V5.104Z" fill="#AAE8E8"></path><path d="M2.625 1.16667V2.625H1.16667V1.75C1.16667 1.59529 1.22812 1.44692 1.33752 1.33752C1.44692 1.22812 1.59529 1.16667 1.75 1.16667H2.625ZM3.79167 0H1.75C1.28587 0 0.840752 0.184374 0.512563 0.512563C0.184374 0.840752 0 1.28587 0 1.75L0 3.79167H3.79167V0Z" fill="#AAE8E8"></path><path d="M7.72924 11.3752V12.8335H6.27091V11.3752H7.72924ZM8.89591 10.2085H5.10425V14.0002H8.89591V10.2085Z" fill="#AAE8E8"></path><path d="M7.72924 6.27067V7.729H6.27091V6.27067H7.72924ZM8.89591 5.104H5.10425V8.89566H8.89591V5.104Z" fill="#AAE8E8"></path><path d="M7.72924 1.16667V2.625H6.27091V1.16667H7.72924ZM8.89591 0H5.10425V3.79167H8.89591V0Z" fill="#AAE8E8"></path><path d="M12.2499 1.16667C12.4046 1.16667 12.553 1.22812 12.6624 1.33752C12.7718 1.44692 12.8332 1.59529 12.8332 1.75V2.625H11.3749V1.16667H12.2499ZM12.2499 0H10.2083V3.79167H13.9999V1.75C13.9999 1.28587 13.8155 0.840752 13.4873 0.512563C13.1592 0.184374 12.714 0 12.2499 0V0Z" fill="#AAE8E8"></path>',9)]))}const AO=ld(JQ,[["render",ttt]]),ett={},rtt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ntt(d,l){return zi(),Vi("svg",rtt,l[0]||(l[0]=[Ff('<g clip-path="url(#clip0_78_678)"><path d="M7 0C5.61553 0 4.26216 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.003033 5.6003 -0.13559 7.00777 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C13.998 5.1441 13.2599 3.36479 11.9475 2.05247C10.6352 0.74015 8.8559 0.0020073 7 0V0ZM7 12.8333C5.84628 12.8333 4.71846 12.4912 3.75918 11.8502C2.79989 11.2093 2.05222 10.2982 1.61071 9.23232C1.16919 8.16642 1.05368 6.99353 1.27876 5.86197C1.50384 4.73042 2.05941 3.69102 2.87521 2.87521C3.69102 2.0594 4.73042 1.50383 5.86198 1.27875C6.99353 1.05367 8.16642 1.16919 9.23232 1.6107C10.2982 2.05221 11.2093 2.79989 11.8502 3.75917C12.4912 4.71846 12.8333 5.84628 12.8333 7C12.8316 8.54658 12.2165 10.0293 11.1229 11.1229C10.0293 12.2165 8.54658 12.8316 7 12.8333Z" fill="white"></path><path d="M6.99992 5.8335H6.41658C6.26187 5.8335 6.1135 5.89495 6.00411 6.00435C5.89471 6.11375 5.83325 6.26212 5.83325 6.41683C5.83325 6.57154 5.89471 6.71991 6.00411 6.82931C6.1135 6.9387 6.26187 7.00016 6.41658 7.00016H6.99992V10.5002C6.99992 10.6549 7.06137 10.8032 7.17077 10.9126C7.28017 11.022 7.42854 11.0835 7.58325 11.0835C7.73796 11.0835 7.88633 11.022 7.99573 10.9126C8.10512 10.8032 8.16658 10.6549 8.16658 10.5002V7.00016C8.16658 6.69074 8.04366 6.394 7.82487 6.17521C7.60608 5.95641 7.30933 5.8335 6.99992 5.8335Z" fill="white"></path><path d="M7 4.6665C7.48325 4.6665 7.875 4.27475 7.875 3.7915C7.875 3.30825 7.48325 2.9165 7 2.9165C6.51675 2.9165 6.125 3.30825 6.125 3.7915C6.125 4.27475 6.51675 4.6665 7 4.6665Z" fill="white"></path></g><defs><clipPath id="clip0_78_678"><rect width="14" height="14" fill="white"></rect></clipPath></defs>',2)]))}const MO=ld(ett,[["render",ntt]]),itt={},att={width:"11",height:"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ott(d,l){return zi(),Vi("svg",att,l[0]||(l[0]=[Re("path",{d:"M9.81633 1.99133L8.5085 0.683492C8.29229 0.466088 8.03511 0.293723 7.75185 0.176372C7.46859 0.059021 7.16486 -0.000985579 6.85825 -0.000175002H1.75C1.28587 -0.000175002 0.840752 0.184199 0.512563 0.512388C0.184375 0.840577 0 1.2857 0 1.74983V13.9998H10.5V3.64099C10.4985 3.02248 10.2528 2.4296 9.81633 1.99133ZM8.9915 2.81616C9.02083 2.84799 9.04829 2.88149 9.07375 2.91649H7.58333V1.42608C7.61834 1.45153 7.65184 1.479 7.68367 1.50833L8.9915 2.81616ZM1.16667 12.8332V1.74983C1.16667 1.59512 1.22812 1.44674 1.33752 1.33735C1.44692 1.22795 1.59529 1.16649 1.75 1.16649H6.41667V4.08316H9.33333V12.8332H1.16667ZM2.33333 9.33316H8.16667V5.83316H2.33333V9.33316ZM3.5 6.99983H7V8.16649H3.5V6.99983ZM2.33333 10.4998H8.16667V11.6665H2.33333V10.4998Z",fill:"white"},null,-1)]))}const SO=ld(itt,[["render",ott]]),stt={},ltt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function utt(d,l){return zi(),Vi("svg",ltt,l[0]||(l[0]=[Ff('<g clip-path="url(#clip0_78_669)"><path d="M14 14H1.75C1.28587 14 0.840752 13.8156 0.512563 13.4874C0.184374 13.1592 0 12.7141 0 12.25L0 0H1.16667V12.25C1.16667 12.4047 1.22812 12.5531 1.33752 12.6625C1.44692 12.7719 1.59529 12.8333 1.75 12.8333H14V14Z" fill="white"></path><path d="M9.33318 6.41702H8.1665V11.667H9.33318V6.41702Z" fill="white"></path><path d="M4.66666 6.41702H3.5V11.667H4.66666V6.41702Z" fill="white"></path><path d="M11.6667 3.5H10.5V11.6667H11.6667V3.5Z" fill="white"></path><path d="M7.00016 3.5H5.8335V11.6667H7.00016V3.5Z" fill="white"></path></g><defs><clipPath id="clip0_78_669"><rect width="14" height="14" fill="white"></rect></clipPath></defs>',2)]))}const EO=ld(stt,[["render",utt]]),ctt={},htt={width:"11",height:"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ftt(d,l){return zi(),Vi("svg",htt,l[0]||(l[0]=[Re("path",{d:"M10.5 14.0004H9.33333V11.0586C9.33287 10.6013 9.15099 10.1628 8.82761 9.83942C8.50422 9.51603 8.06575 9.33415 7.60842 9.33369H2.89158C2.43425 9.33415 1.99578 9.51603 1.67239 9.83942C1.34901 10.1628 1.16713 10.6013 1.16667 11.0586V14.0004H0V11.0586C0.000926233 10.292 0.305872 9.55705 0.847948 9.01497C1.39002 8.47289 2.12497 8.16795 2.89158 8.16702H7.60842C8.37503 8.16795 9.10998 8.47289 9.65205 9.01497C10.1941 9.55705 10.4991 10.292 10.5 11.0586V14.0004Z",fill:"white"},null,-1),Re("path",{d:"M5.25 6.99997C4.55777 6.99997 3.88108 6.7947 3.30551 6.41011C2.72993 6.02553 2.28133 5.4789 2.01642 4.83936C1.75152 4.19982 1.6822 3.49609 1.81725 2.81716C1.9523 2.13822 2.28564 1.51458 2.77513 1.0251C3.26461 0.535614 3.88825 0.202271 4.56719 0.0672226C5.24612 -0.0678257 5.94985 0.00148598 6.58939 0.266393C7.22894 0.531299 7.77556 0.979903 8.16015 1.55548C8.54473 2.13105 8.75 2.80774 8.75 3.49997C8.74908 4.42794 8.38003 5.31765 7.72385 5.97382C7.06768 6.63 6.17798 6.99904 5.25 6.99997ZM5.25 1.16664C4.78851 1.16664 4.33739 1.30349 3.95367 1.55988C3.56996 1.81627 3.27089 2.18068 3.09428 2.60704C2.91768 3.0334 2.87147 3.50256 2.9615 3.95518C3.05153 4.4078 3.27376 4.82357 3.60009 5.14989C3.92641 5.47621 4.34217 5.69844 4.79479 5.78847C5.24741 5.8785 5.71657 5.83229 6.14293 5.65569C6.56929 5.47909 6.93371 5.18002 7.1901 4.7963C7.44649 4.41259 7.58334 3.96146 7.58334 3.49997C7.58334 2.88113 7.3375 2.28764 6.89992 1.85006C6.46233 1.41247 5.86884 1.16664 5.25 1.16664Z",fill:"white"},null,-1)]))}const CO=ld(ctt,[["render",ftt]]),dtt={},ptt={width:"11",height:"13",viewBox:"0 0 11 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function mtt(d,l){return zi(),Vi("svg",ptt,l[0]||(l[0]=[Re("path",{d:"M6.77889 9.16667H10.1122V12.5M4.11222 3.83333H0.77889V0.5M10.3906 4.50227C10.0168 3.57711 9.39097 2.77536 8.58423 2.18815C7.77749 1.60094 6.82233 1.25168 5.82707 1.18034C4.8318 1.109 3.83627 1.31827 2.95402 1.78441C2.07177 2.25055 1.3381 2.95503 0.836182 3.81742M0.500244 8.49805C0.874034 9.42321 1.49986 10.225 2.30661 10.8122C3.11335 11.3994 4.06948 11.7482 5.06474 11.8195C6.06001 11.8909 7.05473 11.6816 7.93697 11.2155C8.81922 10.7494 9.55239 10.045 10.0543 9.18262",stroke:"white","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const gtt=ld(dtt,[["render",mtt]]),vtt={},ytt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function xtt(d,l){return zi(),Vi("svg",ytt,l[0]||(l[0]=[Ff('<g clip-path="url(#clip0_78_695)"><path d="M13.4167 12.8333H2.91667C2.45254 12.8333 2.00742 12.649 1.67923 12.3208C1.35104 11.9926 1.16667 11.5475 1.16667 11.0833V0.583333C1.16667 0.428624 1.10521 0.280251 0.995812 0.170854C0.886416 0.0614582 0.738043 0 0.583333 0C0.428624 0 0.280251 0.0614582 0.170854 0.170854C0.0614582 0.280251 0 0.428624 0 0.583333L0 11.0833C0.00092625 11.8566 0.308514 12.5979 0.855295 13.1447C1.40208 13.6915 2.1434 13.9991 2.91667 14H13.4167C13.5714 14 13.7197 13.9385 13.8291 13.8291C13.9385 13.7197 14 13.5714 14 13.4167C14 13.262 13.9385 13.1136 13.8291 13.0042C13.7197 12.8948 13.5714 12.8333 13.4167 12.8333Z" fill="white"></path><path d="M3.50008 11.6666C3.65479 11.6666 3.80316 11.6052 3.91256 11.4958C4.02195 11.3864 4.08341 11.238 4.08341 11.0833V6.99996C4.08341 6.84525 4.02195 6.69688 3.91256 6.58748C3.80316 6.47808 3.65479 6.41663 3.50008 6.41663C3.34537 6.41663 3.197 6.47808 3.0876 6.58748C2.97821 6.69688 2.91675 6.84525 2.91675 6.99996V11.0833C2.91675 11.238 2.97821 11.3864 3.0876 11.4958C3.197 11.6052 3.34537 11.6666 3.50008 11.6666Z" fill="white"></path><path d="M5.83325 5.83333V11.0833C5.83325 11.238 5.89471 11.3864 6.00411 11.4958C6.1135 11.6052 6.26188 11.6667 6.41659 11.6667C6.5713 11.6667 6.71967 11.6052 6.82907 11.4958C6.93847 11.3864 6.99993 11.238 6.99993 11.0833V5.83333C6.99993 5.67862 6.93847 5.53025 6.82907 5.42085C6.71967 5.31146 6.5713 5.25 6.41659 5.25C6.26188 5.25 6.1135 5.31146 6.00411 5.42085C5.89471 5.53025 5.83325 5.67862 5.83325 5.83333Z" fill="white"></path><path d="M8.75 7.58333V11.0833C8.75 11.238 8.81146 11.3864 8.92086 11.4958C9.03025 11.6052 9.17863 11.6667 9.33334 11.6667C9.48805 11.6667 9.63642 11.6052 9.74582 11.4958C9.85522 11.3864 9.91667 11.238 9.91667 11.0833V7.58333C9.91667 7.42862 9.85522 7.28025 9.74582 7.17085C9.63642 7.06146 9.48805 7 9.33334 7C9.17863 7 9.03025 7.06146 8.92086 7.17085C8.81146 7.28025 8.75 7.42862 8.75 7.58333Z" fill="white"></path><path d="M11.6667 5.24996V11.0833C11.6667 11.238 11.7282 11.3864 11.8376 11.4958C11.947 11.6052 12.0954 11.6666 12.2501 11.6666C12.4048 11.6666 12.5532 11.6052 12.6626 11.4958C12.772 11.3864 12.8334 11.238 12.8334 11.0833V5.24996C12.8334 5.09525 12.772 4.94688 12.6626 4.83748C12.5532 4.72808 12.4048 4.66663 12.2501 4.66663C12.0954 4.66663 11.947 4.72808 11.8376 4.83748C11.7282 4.94688 11.6667 5.09525 11.6667 5.24996Z" fill="white"></path><path d="M3.49996 5.24997C3.65465 5.24994 3.803 5.18846 3.91237 5.07906L6.00421 2.98722C6.11539 2.8813 6.26306 2.82222 6.41662 2.82222C6.57018 2.82222 6.71786 2.8813 6.82904 2.98722L8.09604 4.25422C8.42421 4.5823 8.86925 4.7666 9.33329 4.7666C9.79733 4.7666 10.2424 4.5823 10.5705 4.25422L13.829 0.995723C13.9353 0.885705 13.9941 0.738354 13.9928 0.585406C13.9914 0.432458 13.9301 0.28615 13.8219 0.177996C13.7138 0.0698408 13.5675 0.00849224 13.4145 0.00716316C13.2616 0.00583409 13.1142 0.0646308 13.0042 0.17089L9.74571 3.42881C9.63632 3.53816 9.48797 3.5996 9.33329 3.5996C9.17861 3.5996 9.03026 3.53816 8.92087 3.42881L7.65387 2.16239C7.3257 1.83432 6.88066 1.65001 6.41662 1.65001C5.95259 1.65001 5.50755 1.83432 5.17937 2.16239L3.08754 4.25422C3.00599 4.3358 2.95045 4.43973 2.92795 4.55287C2.90545 4.66601 2.917 4.78328 2.96115 4.88985C3.00529 4.99643 3.08003 5.08752 3.17594 5.15162C3.27185 5.21572 3.3846 5.24995 3.49996 5.24997Z" fill="white"></path></g><defs><clipPath id="clip0_78_695"><rect width="14" height="14" fill="white"></rect></clipPath></defs>',2)]))}const _tt=ld(vtt,[["render",xtt]]),btt={class:"w-[285px] flex-shrink-0 p-[15px] hidden lg:block"},wtt={class:"glass-card h-full p-6"},ktt={class:"mb-12"},Ttt={class:"text-[#C3C3C3] text-sm"},Att=["title"],Mtt={class:"text-[#C3C3C3] text-sm mt-1"},Stt={class:"mb-8"},Ett={class:"mb-8"},Ctt={class:"space-y-2"},Ltt=["onClick"],Ptt={class:"mb-8"},ztt={class:"space-y-2"},Itt=["onClick"],Ott=["disabled"],Dtt={class:"flex items-center gap-3"},Ftt=["disabled"],Rtt={class:"flex items-center gap-3"},Btt={class:"mb-4"},Ntt={class:"flex items-center gap-2"},jtt={class:"glass-card px-2 py-1 text-dark-text text-xs font-medium rounded border border-dark-border"},Utt={class:"glass-card px-2 py-1 text-dark-text text-xs font-medium rounded border border-dark-border"},Vtt={key:0,class:"mb-4"},Htt={class:"text-dark-text text-xs mb-2"},Wtt={class:"text-white"},qtt={class:"w-full h-1 bg-white/10 rounded-full overflow-hidden"},Ztt={class:"flex items-center justify-between"},$tt={class:"flex items-center gap-2 text-dark-text text-xs"},Gtt={class:"flex items-center gap-2"},Ytt={href:"https://github.com/rightup",target:"_blank",class:"inline-block"},Ktt={href:"https://buymeacoffee.com/rightup",target:"_blank",class:"inline-block"},Xtt=Th({name:"SidebarNav",__name:"Sidebar",setup(d){const l=JI(),z=QI(),j=sv(),J=lo(!1),mt=lo(!1),kt=lo(!1),Dt=lo(!1),Gt=lo(!1),re=lo(null);let pe=null;t0(async()=>{pe=await j.startAutoRefresh(5e3)}),K2(()=>{pe&&pe()});const Ne={dashboard:AO,neighbors:CO,statistics:EO,configuration:TO,logs:SO,help:MO},or=[{name:"Dashboard",icon:"dashboard",route:"/"},{name:"Neighbors",icon:"neighbors",route:"/neighbors"},{name:"Statistics",icon:"statistics",route:"/statistics"},{name:"Configuration",icon:"configuration",route:"/configuration"},{name:"Logs",icon:"logs",route:"/logs"},{name:"Help",icon:"help",route:"/help"}],_r=Yo(()=>jn=>z.path===jn),Fr=jn=>{l.push(jn)},zr=async()=>{J.value=!0,re.value=null;try{await j.sendAdvert(),Gt.value=!0,setTimeout(()=>{Wr()},2e3)}catch(jn){re.value=jn instanceof Error?jn.message:"Unknown error occurred",console.error("Failed to send advert:",jn)}finally{J.value=!1}},Wr=()=>{Dt.value=!1,Gt.value=!1,re.value=null,J.value=!1},An=async()=>{if(!mt.value){mt.value=!0;try{await j.toggleMode()}catch(jn){console.error("Failed to toggle mode:",jn)}finally{mt.value=!1}}},Ft=async()=>{if(!kt.value){kt.value=!0;try{await j.toggleDutyCycle()}catch(jn){console.error("Failed to toggle duty cycle:",jn)}finally{kt.value=!1}}},kn=lo(new Date().toLocaleTimeString());setInterval(()=>{kn.value=new Date().toLocaleTimeString()},1e3);const ei=Yo(()=>{const jn=j.dutyCyclePercentage;let ai="#A5E5B6";return jn>90?ai="#FB787B":jn>70&&(ai="#FFC246"),{width:jn===0?"2px":`${Math.max(jn,2)}%`,backgroundColor:ai}});return(jn,ai)=>(zi(),Vi(Ou,null,[Re("aside",btt,[Re("div",wtt,[Re("div",ktt,[ai[1]||(ai[1]=Re("h1",{class:"text-white text-[22px] font-bold mb-2"},"pyMC Repeater",-1)),Re("p",Ttt,[nc(aa(Ju(j).nodeName)+" ",1),Re("span",{class:Xs(["inline-block w-2 h-2 rounded-full ml-2",Ju(j).statusBadge.text==="Active"?"bg-accent-green":Ju(j).statusBadge.text==="Monitor Mode"?"bg-secondary":"bg-accent-red"]),title:Ju(j).statusBadge.title},null,10,Att)]),Re("p",Mtt,"<"+aa(Ju(j).pubKey)+">",1)]),ai[10]||(ai[10]=Re("div",{class:"border-t border-dark-border mb-6"},null,-1)),Re("div",Stt,[ai[3]||(ai[3]=Re("p",{class:"text-dark-text text-xs uppercase mb-4"},"Actions",-1)),Re("button",{onClick:ai[0]||(ai[0]=Qi=>Dt.value=!0),class:"w-full bg-white rounded-[10px] py-3 px-4 flex items-center gap-2 text-sm font-medium text-[#212122] hover:bg-gray-100 transition-colors"},ai[2]||(ai[2]=[Re("svg",{class:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M7 0C5.61553 0 4.26216 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.003033 5.6003 -0.13559 7.00777 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C13.998 5.1441 13.2599 3.36479 11.9475 2.05247C10.6352 0.74015 8.8559 0.0020073 7 0V0ZM7 12.8333C5.84628 12.8333 4.71846 12.4912 3.75918 11.8502C2.79989 11.2093 2.05222 10.2982 1.61071 9.23232C1.16919 8.16642 1.05368 6.99353 1.27876 5.86197C1.50384 4.73042 2.05941 3.69102 2.87521 2.87521C3.69102 2.0594 4.73042 1.50383 5.86198 1.27875C6.99353 1.05367 8.16642 1.16919 9.23232 1.6107C10.2982 2.05221 11.2093 2.79989 11.8502 3.75917C12.4912 4.71846 12.8333 5.84628 12.8333 7C12.8316 8.54658 12.2165 10.0293 11.1229 11.1229C10.0293 12.2165 8.54658 12.8316 7 12.8333ZM8.16667 7C8.1676 7.20501 8.11448 7.40665 8.01268 7.58461C7.91087 7.76256 7.76397 7.91054 7.58677 8.01365C7.40957 8.11676 7.20833 8.17136 7.00332 8.17194C6.7983 8.17252 6.59675 8.11906 6.41897 8.01696C6.24119 7.91485 6.09346 7.7677 5.99065 7.59033C5.88784 7.41295 5.83358 7.21162 5.83335 7.0066C5.83312 6.80159 5.88691 6.60013 5.98932 6.42252C6.09172 6.24491 6.23912 6.09743 6.41667 5.99492V3.5H7.58334V5.99492C7.76016 6.09659 7.90713 6.24298 8.00952 6.41939C8.1119 6.5958 8.1661 6.79603 8.16667 7Z",fill:"#212122"})],-1),nc(" Send Advert ",-1)]))]),Re("div",Ett,[ai[4]||(ai[4]=Re("p",{class:"text-dark-text text-xs uppercase mb-4"},"Monitoring",-1)),Re("div",Ctt,[(zi(!0),Vi(Ou,null,sf(or.slice(0,3),Qi=>(zi(),Vi("button",{key:Qi.name,onClick:Gi=>Fr(Qi.route),class:Xs([_r.value(Qi.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(Ne[Qi.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(Qi.name),1)],10,Ltt))),128))])]),Re("div",Ptt,[ai[5]||(ai[5]=Re("p",{class:"text-dark-text text-xs uppercase mb-4"},"System",-1)),Re("div",ztt,[(zi(!0),Vi(Ou,null,sf(or.slice(3),Qi=>(zi(),Vi("button",{key:Qi.name,onClick:Gi=>Fr(Qi.route),class:Xs([_r.value(Qi.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(Ne[Qi.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(Qi.name),1)],10,Itt))),128))])]),gu(TQ,{"current-value":Ju(j).noiseFloorDbm||-116,"update-interval":3e3,class:"mb-6"},null,8,["current-value"]),Re("button",{onClick:An,disabled:mt.value,class:Xs(["p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group",Ju(j).modeButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[Re("div",Dtt,[gu(gtt,{class:"w-4 h-4 text-white group-hover:text-primary transition-colors"}),ai[6]||(ai[6]=Re("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Mode",-1))]),Re("span",{class:Xs(["text-xs font-medium group-hover:text-white transition-colors",Ju(j).modeButtonState.warning?"text-accent-red":"text-accent-green"])},aa(mt.value?"Changing...":Ju(j).currentMode.charAt(0).toUpperCase()+Ju(j).currentMode.slice(1)),3)],10,Ott),Re("button",{onClick:Ft,disabled:kt.value,class:Xs(["p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group",Ju(j).dutyCycleButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[Re("div",Rtt,[gu(_tt,{class:"w-3.5 h-3.5 text-white group-hover:text-primary transition-colors"}),ai[7]||(ai[7]=Re("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Duty Cycle",-1))]),Re("span",{class:Xs(["text-xs font-medium group-hover:text-white transition-colors",Ju(j).dutyCycleButtonState.warning?"text-accent-red":"text-primary"])},aa(kt.value?"Changing...":Ju(j).dutyCycleEnabled?"Enabled":"Disabled"),3)],10,Ftt),Re("div",Btt,[Re("div",Ntt,[Re("span",jtt," R:v"+aa(Ju(j).version),1),Re("span",Utt," C:v"+aa(Ju(j).coreVersion),1)])]),ai[11]||(ai[11]=Re("div",{class:"border-t border-accent-green mb-4"},null,-1)),Ju(j).dutyCycleEnabled?(zi(),Vi("div",Vtt,[Re("p",Htt,[ai[8]||(ai[8]=nc(" Duty Cycle: ",-1)),Re("span",Wtt,aa(Ju(j).dutyCycleUtilization.toFixed(1))+"% / "+aa(Ju(j).dutyCycleMax.toFixed(1))+"%",1)]),Re("div",qtt,[Re("div",{class:"h-full rounded-full transition-all duration-300",style:av(ei.value)},null,4)])])):bs("",!0),Re("div",Ztt,[Re("div",$tt,[ai[9]||(ai[9]=Re("svg",{class:"w-3 h-3",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M6.5 13C5.59722 13 4.75174 12.8286 3.96355 12.4858C3.17537 12.143 2.48926 11.6795 1.90522 11.0955C1.32119 10.5115 0.85776 9.82535 0.514945 9.03717C0.172131 8.24898 0.000482491 7.40326 1.0101e-06 6.5C-0.000480471 5.59674 0.171168 4.75126 0.514945 3.96356C0.858723 3.17585 1.32191 2.48974 1.9045 1.90522C2.48709 1.3207 3.1732 0.857278 3.96283 0.514944C4.75246 0.172611 5.59818 0.000962963 6.5 0C7.48703 0 8.42303 0.210648 9.30799 0.631944C10.193 1.05324 10.9421 1.64907 11.5555 2.41944V1.44444C11.5555 1.23981 11.6249 1.06841 11.7635 0.930222C11.9022 0.792037 12.0736 0.722704 12.2778 0.722222C12.4819 0.721741 12.6536 0.791074 12.7927 0.930222C12.9319 1.06937 13.001 1.24078 13 1.44444V4.33333C13 4.53796 12.9307 4.70961 12.792 4.84828C12.6533 4.98694 12.4819 5.05604 12.2778 5.05556H9.38888C9.18425 5.05556 9.01285 4.98622 8.87466 4.84756C8.73647 4.70889 8.66714 4.53748 8.66666 4.33333C8.66618 4.12919 8.73551 3.95778 8.87466 3.81911C9.01381 3.68044 9.18521 3.61111 9.38888 3.61111H10.6528C10.1593 2.93704 9.55138 2.40741 8.82916 2.02222C8.10694 1.63704 7.33055 1.44444 6.5 1.44444C5.09166 1.44444 3.89711 1.93507 2.91633 2.91633C1.93555 3.89759 1.44493 5.09215 1.44444 6.5C1.44396 7.90785 1.93459 9.10265 2.91633 10.0844C3.89807 11.0661 5.09263 11.5565 6.5 11.5556C7.64351 11.5556 8.66666 11.2125 9.56944 10.5264C10.4722 9.84028 11.068 8.95555 11.3569 7.87222C11.4171 7.67963 11.5255 7.53519 11.6819 7.43889C11.8384 7.34259 12.013 7.30648 12.2055 7.33055C12.4102 7.35463 12.5727 7.44178 12.693 7.592C12.8134 7.74222 12.8495 7.90785 12.8014 8.08889C12.4523 9.5213 11.694 10.698 10.5264 11.6191C9.35879 12.5402 8.01666 13.0005 6.5 13ZM7.22222 6.21111L9.02777 8.01667C9.16018 8.14907 9.22638 8.31759 9.22638 8.52222C9.22638 8.72685 9.16018 8.89537 9.02777 9.02778C8.89536 9.16018 8.72685 9.22639 8.52222 9.22639C8.31759 9.22639 8.14907 9.16018 8.01666 9.02778L5.99444 7.00556C5.92222 6.93333 5.86805 6.8522 5.83194 6.76217C5.79583 6.67213 5.77777 6.57872 5.77777 6.48194V3.61111C5.77777 3.40648 5.84711 3.23507 5.98577 3.09689C6.12444 2.9587 6.29585 2.88937 6.5 2.88889C6.70414 2.88841 6.87579 2.95774 7.01494 3.09689C7.15409 3.23604 7.22318 3.40744 7.22222 3.61111V6.21111Z",fill:"currentColor"})],-1)),nc(" Last Updated: "+aa(kn.value),1)]),Re("div",Gtt,[Re("a",Ytt,[gu(cQ,{class:"w-4 h-4 text-dark-text hover:text-white transition-colors"})]),Re("a",Ktt,[gu(pQ,{class:"w-4 h-4 text-dark-text hover:text-white transition-colors"})])])])])]),gu(GQ,{isOpen:Dt.value,isLoading:J.value,isSuccess:Gt.value,error:re.value,onClose:Wr,onSend:zr},null,8,["isOpen","isLoading","isSuccess","error"])],64))}}),Jtt={key:0,class:"fixed inset-0 z-40 lg:hidden"},Qtt={class:"absolute left-0 top-0 bottom-0 w-72 p-4"},tet={class:"glass-card h-full p-6 overflow-auto"},eet={class:"mb-4"},ret={class:"space-y-2 mb-3"},net=["onClick"],iet={class:"mb-4"},aet={class:"space-y-2 mb-3"},oet=["onClick"],set=Th({name:"MobileSidebar",__name:"MobileSidebar",props:{showMobileSidebar:{type:Boolean}},emits:["update:showMobileSidebar"],setup(d,{emit:l}){const z=l,j=JI(),J=QI(),mt={dashboard:AO,neighbors:CO,statistics:EO,configuration:TO,logs:SO,help:MO},kt=[{name:"Dashboard",icon:"dashboard",route:"/"},{name:"Neighbors",icon:"neighbors",route:"/neighbors"},{name:"Statistics",icon:"statistics",route:"/statistics"},{name:"Configuration",icon:"configuration",route:"/configuration"},{name:"Logs",icon:"logs",route:"/logs"},{name:"Help",icon:"help",route:"/help"}],Dt=pe=>J.path===pe,Gt=pe=>{j.push(pe),re()},re=()=>{z("update:showMobileSidebar",!1)};return(pe,Ne)=>pe.showMobileSidebar?(zi(),Vi("div",Jtt,[Re("div",{class:"absolute inset-0 bg-black/50",onClick:re}),Re("div",Qtt,[Re("div",tet,[Re("div",{class:"mb-6 flex items-center justify-between"},[Ne[0]||(Ne[0]=Re("div",null,[Re("h1",{class:"text-white text-[20px] font-bold"},"pyMC Repeater"),Re("p",{class:"text-[#C3C3C3] text-sm"},[nc("phenix-rep56 "),Re("span",{class:"inline-block w-2 h-2 rounded-full bg-[#95F3AE] ml-2"})])],-1)),Re("button",{onClick:re,class:"text-dark-text"},"✕")]),Ne[5]||(Ne[5]=Re("div",{class:"border-t border-dark-border mb-4"},null,-1)),Re("div",null,[Ne[3]||(Ne[3]=Ff('<div class="mb-6"><h1 class="text-white text-[20px] font-bold mb-1">pyMC Repeater</h1><p class="text-[#C3C3C3] text-sm">phenix-rep56 <span class="inline-block w-2 h-2 rounded-full bg-[#95F3AE] ml-2"></span></p><p class="text-[#C3C3C3] text-sm mt-1">&lt;94eib04...4563ghbjbjn&gt;</p></div><div class="border-t border-dark-border mb-4"></div><div class="mb-4"><p class="text-dark-text text-xs uppercase mb-2">Actions</p><button class="w-full bg-white rounded-[10px] py-3 px-4 flex items-center gap-2 text-sm font-medium text-[#212122] hover:bg-gray-100 transition-colors mb-2">Send Advert</button></div>',3)),Re("div",eet,[Ne[1]||(Ne[1]=Re("p",{class:"text-dark-text text-xs uppercase mb-2"},"Monitoring",-1)),Re("div",ret,[(zi(!0),Vi(Ou,null,sf(kt.slice(0,3),or=>(zi(),Vi("button",{key:or.name,onClick:_r=>Gt(or.route),class:Xs([Dt(or.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(mt[or.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(or.name),1)],10,net))),128))])]),Re("div",iet,[Ne[2]||(Ne[2]=Re("p",{class:"text-dark-text text-xs uppercase mb-2"},"System",-1)),Re("div",aet,[(zi(!0),Vi(Ou,null,sf(kt.slice(3),or=>(zi(),Vi("button",{key:or.name,onClick:_r=>Gt(or.route),class:Xs([Dt(or.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(mt[or.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(or.name),1)],10,oet))),128))])]),Ne[4]||(Ne[4]=Ff('<div class="glass-card-green p-5 relative overflow-hidden mb-4"><p class="text-dark-text text-xs uppercase mb-2">RF NOISE FLOOR</p><div class="flex items-baseline gap-2 mb-2"><span class="text-primary text-2xl font-medium">-116.0</span><span class="text-dark-text text-xs uppercase">dbm</span></div></div><div class="glass-card-green p-4 flex items-center justify-between mb-3"><div class="flex items-center gap-3"><span class="text-white text-sm">Mode</span></div><span class="text-accent-green text-xs font-medium">Forward</span></div><div class="glass-card-green p-4 flex items-center justify-between mb-3"><div class="flex items-center gap-3"><span class="text-white text-sm">Duty Cycle</span></div><span class="text-primary text-xs font-medium">Enabled</span></div><div class="flex gap-2 mb-4"><span class="bg-primary text-dark-bg text-xs font-medium px-2 py-0.5 rounded">Active</span><span class="bg-[#212122] text-[#D9D9D9] text-xs font-medium px-2 py-0.5 rounded">Vl.0.2</span></div><div class="border-t border-accent-green mb-4"></div><p class="text-dark-text text-xs mb-2">Duty Cycle: <span class="text-white">0.0% / 6.0%</span></p><p class="text-dark-text text-xs">Last Updated: 18:55:24</p>',7))])])])])):bs("",!0)}}),uet={class:"glass-card p-6 mb-5 rounded-[20px] relative z-10"},cet={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},het={class:"flex items-center gap-3"},fet={class:"text-right mr-4"},det={key:0,class:"flex items-center gap-2"},pet={key:1,class:"space-y-1"},met={class:"text-dark-text text-sm"},get={class:"text-primary font-medium"},vet={key:0,class:"text-xs text-dark-text/80"},yet={key:0},xet={key:1,class:"text-xs text-dark-text/60"},_et={key:2},bet={key:0,class:"text-xs text-dark-text/60"},wet=["disabled"],ket={class:"flex items-center justify-between mb-3"},Tet={class:"flex items-center gap-2"},Aet=["disabled"],Met=["disabled"],Eet={class:"space-y-3 text-sm"},Cet={key:0,class:"bg-[#0B1014] p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red"},Let={class:"flex items-center justify-between"},Pet={class:"text-accent-red font-bold"},zet={class:"text-xs text-gray-400 mt-1"},Iet={key:1,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 border-l-2 border-l-accent-green"},Oet={class:"flex items-center justify-between"},Det={class:"text-accent-green font-bold"},Fet={key:0,class:"text-xs text-gray-400 mt-1"},Ret={key:2,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10"},Bet={key:3,class:"bg-[#0B1014] p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red"},Net={class:"text-xs text-gray-400"},jet={class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 border-l-2 border-l-primary"},Uet={class:"flex items-center justify-between"},Vet={class:"text-primary font-bold"},Het={key:0,class:"text-xs text-gray-400 mt-1"},Wet={class:"flex items-center justify-between"},qet={class:"text-white font-medium"},Zet={key:0,class:"mt-2"},$et={class:"text-xs text-gray-400"},Get={class:"text-gray-300"},Yet={key:4,class:"bg-[#0B1014] p-4 rounded-lg border border-white/10 text-center"},Ket={key:5,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 text-center"},Xet=Th({name:"TopBar",__name:"TopBar",emits:["toggleMobileSidebar"],setup(d,{emit:l}){const z=l,j=sv(),J=lo(!1),mt=lo(null),kt=lo({hasUpdate:!1,currentVersion:"",latestVersion:"",isChecking:!1,lastChecked:null,error:null}),Dt=lo({}),Gt=lo(!0),re=lo(null),pe=["Chat Node","Repeater","Room Server"];function Ne(Gi){const un=Gi.target;mt.value&&!mt.value.contains(un)&&(J.value=!1)}const or=async()=>{try{Gt.value=!0;const Gi={};for(const un of pe)try{const ia=await Xh.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(un)}&hours=168`);ia.success&&Array.isArray(ia.data)?Gi[un]=ia.data:Gi[un]=[]}catch(ia){console.error(`Error fetching ${un} nodes:`,ia),Gi[un]=[]}Dt.value=Gi,re.value=new Date}catch(Gi){console.error("Error updating tracked nodes:",Gi)}finally{Gt.value=!1}},_r=async()=>{if(!kt.value.isChecking)try{kt.value.isChecking=!0,kt.value.error=null,await j.fetchStats();const Gi=j.version;if(!Gi||Gi==="Unknown"){kt.value.error="Unable to determine current version";return}const ia=await fetch("https://raw.githubusercontent.com/rightup/pyMC_Repeater/main/repeater/__init__.py");if(!ia.ok)throw new Error(`GitHub request failed: ${ia.status}`);const Li=(await ia.text()).match(/__version__\s*=\s*["']([^"']+)["']/);if(!Li)throw new Error("Could not parse version from GitHub file");const yi=Li[1];kt.value.currentVersion=Gi,kt.value.latestVersion=yi,kt.value.lastChecked=new Date,kt.value.hasUpdate=Gi!==yi}catch(Gi){console.error("Error checking for updates:",Gi),kt.value.error=Gi instanceof Error?Gi.message:"Failed to check for updates"}finally{kt.value.isChecking=!1}},Fr=Yo(()=>Object.values(Dt.value).reduce((un,ia)=>un+ia.length,0)),zr=Yo(()=>pe.map(un=>({type:un,count:Dt.value[un]?.length||0})).filter(un=>un.count>0)),Wr=Yo(()=>kt.value.hasUpdate||Fr.value>0),An=Gi=>({"Chat Node":"text-blue-400",Repeater:"text-accent-green","Room Server":"text-accent-purple"})[Gi]||"text-gray-400",Ft=Gi=>{const un=Dt.value[Gi]||[];return un.length===0?"None":un.reduce((fa,Li)=>Li.last_seen>fa.last_seen?Li:fa,un[0]).node_name||"Unknown Node"};let kn=null,ei=null;const jn=()=>{kn&&clearInterval(kn),kn=setInterval(()=>{or()},3e4),ei&&clearInterval(ei),ei=setInterval(()=>{_r()},6e5)},ai=()=>{kn&&(clearInterval(kn),kn=null),ei&&(clearInterval(ei),ei=null)};t0(()=>{document.addEventListener("click",Ne),or(),_r(),jn()}),dg(()=>{document.removeEventListener("click",Ne),ai()});const Qi=()=>{z("toggleMobileSidebar")};return(Gi,un)=>(zi(),Vi("div",uet,[Re("div",cet,[Re("div",{class:"flex items-center gap-3"},[Re("button",{onClick:Qi,class:"lg:hidden w-10 h-10 rounded bg-[#1A1E1F] flex items-center justify-center hover:bg-[#2A2E2F] transition-colors"},un[2]||(un[2]=[Re("svg",{class:"w-5 h-5 text-white",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M3 6h14M3 10h14M3 14h14",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])),un[3]||(un[3]=Re("div",null,[Re("h1",{class:"text-white text-[35px] font-bold mb-2"},"Welcome👋")],-1))]),Re("div",het,[Re("div",fet,[Gt.value?(zi(),Vi("div",det,un[4]||(un[4]=[Re("div",{class:"animate-spin rounded-full h-3 w-3 border-b-2 border-primary"},null,-1),Re("p",{class:"text-dark-text text-sm"},"Loading tracking data...",-1)]))):Fr.value>0?(zi(),Vi("div",pet,[Re("p",met,[un[5]||(un[5]=nc(" Tracking: ",-1)),Re("span",get,aa(Fr.value)+" node"+aa(Fr.value===1?"":"s"),1)]),zr.value.length>1?(zi(),Vi("div",vet,[(zi(!0),Vi(Ou,null,sf(zr.value,(ia,fa)=>(zi(),Vi("span",{key:ia.type,class:"inline"},[nc(aa(ia.count)+" "+aa(ia.type)+aa(ia.count===1?"":"s"),1),fa<zr.value.length-1?(zi(),Vi("span",yet,", ")):bs("",!0)]))),128))])):bs("",!0),re.value?(zi(),Vi("div",xet," Updated "+aa(re.value.toLocaleTimeString()),1)):bs("",!0)])):(zi(),Vi("div",_et,[un[6]||(un[6]=Re("p",{class:"text-dark-text text-sm"},[nc("Tracking: "),Re("span",{class:"text-gray-500"},"0 nodes")],-1)),re.value?(zi(),Vi("div",bet," Last checked "+aa(re.value.toLocaleTimeString()),1)):bs("",!0)]))]),Re("button",{onClick:or,disabled:Gt.value,class:"w-[35px] h-[35px] rounded bg-[#1A1E1F] flex items-center justify-center hover:bg-[#2A2E2F] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh tracking data"},[(zi(),Vi("svg",{class:Xs(["w-5 h-5",{"animate-spin":Gt.value}]),viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},un[7]||(un[7]=[Re("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.2479 9.53093C15.7161 11.0616 13.4135 11.3171 11.5992 10.3403L3.70385 18.2325C3.16949 18.7663 2.30331 18.7663 1.76829 18.2325C1.2346 17.698 1.2346 16.8333 1.76829 16.2988L9.66501 8.40662C8.68891 6.59438 8.94475 4.29439 10.4759 2.76373C11.394 1.84627 12.592 1.40989 13.7946 1.39521C12.5347 2.73504 12.5513 4.83819 13.8619 6.14799C15.1718 7.45713 17.2759 7.47381 18.6164 6.21472C18.6018 7.41643 18.166 8.61347 17.2479 9.53093ZM19.43 3.5851C19.0928 3.96409 18.5332 4.44651 17.731 5.18115C16.8815 6.02988 15.6789 6.02988 14.8293 5.18115C13.9792 4.33108 13.9792 3.13005 14.8293 2.28064C15.6122 1.49796 16.4537 0.571146 16.4404 0.567142C14.165 -0.482435 11.3833 -0.0767378 9.50844 1.79689C7.79944 3.50437 7.3124 5.96383 8.03132 8.10635L0.801532 15.3326C-0.267177 16.4002 -0.267177 18.1317 0.801532 19.1993C1.87024 20.2669 3.60255 20.2669 4.67126 19.1993L11.9004 11.9737C14.0458 12.6937 16.5063 12.2053 18.2153 10.4978C20.0876 8.62615 20.4767 5.85707 19.43 3.5851Z",fill:"white"},null,-1)]),2))],8,wet),Re("button",{onClick:un[0]||(un[0]=hg(ia=>J.value=!J.value,["stop"])),class:"w-[35px] h-[35px] rounded bg-[#1A1E1F] flex items-center justify-center hover:bg-[#2A2E2F] transition-colors relative"},[un[8]||(un[8]=Re("svg",{class:"w-5 h-5",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M12.5 14.1667V15C12.5 16.3807 11.3807 17.5 9.99998 17.5C8.61927 17.5 7.49998 16.3807 7.49998 15V14.1667M12.5 14.1667L7.49998 14.1667M12.5 14.1667H15.8333C16.2936 14.1667 16.6666 13.7936 16.6666 13.3333V12.845C16.6666 12.624 16.5788 12.4122 16.4225 12.2559L15.9969 11.8302C15.8921 11.7255 15.8333 11.5833 15.8333 11.4351V8.33333C15.8333 8.1863 15.828 8.04045 15.817 7.89674M7.49998 14.1667L4.16665 14.1668C3.70641 14.1668 3.33331 13.7934 3.33331 13.3332V12.8451C3.33331 12.6241 3.42118 12.4124 3.57745 12.2561L4.00307 11.8299C4.10781 11.7251 4.16665 11.5835 4.16665 11.4353V8.33331C4.16665 5.11167 6.77831 2.5 9.99998 2.5C10.593 2.5 11.1653 2.58848 11.7045 2.75297M15.817 7.89674C16.8223 7.32275 17.5 6.24051 17.5 5C17.5 3.15905 16.0076 1.66666 14.1666 1.66666C13.1914 1.66666 12.3141 2.08544 11.7045 2.75297M15.817 7.89674C15.3304 8.17457 14.7671 8.33333 14.1666 8.33333C12.3257 8.33333 10.8333 6.84095 10.8333 5C10.8333 4.13425 11.1634 3.34558 11.7045 2.75297M15.817 7.89674C15.817 7.89674 15.817 7.89675 15.817 7.89674ZM11.7045 2.75297C11.7049 2.75309 11.7053 2.75321 11.7057 2.75333",stroke:"white","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),Wr.value?(zi(),Vi("span",{key:0,class:Xs(["absolute top-2 right-2 w-2 h-2 rounded-full",kt.value.hasUpdate?"bg-accent-red animate-pulse":"bg-primary"])},null,2)):bs("",!0)]),J.value?(zi(),Vi("div",{key:0,ref_key:"notifRef",ref:mt,class:"absolute right-6 top-14 z-[100] w-80 bg-[#1A1E1F] border border-white/20 rounded-[15px] p-4 shadow-2xl backdrop-blur-sm",onClick:un[1]||(un[1]=hg(()=>{},["stop"]))},[Re("div",ket,[un[10]||(un[10]=Re("p",{class:"text-white font-semibold"},"System Status",-1)),Re("div",Tet,[Re("button",{onClick:_r,disabled:kt.value.isChecking,class:"text-xs text-primary hover:text-primary/80 disabled:opacity-50",title:"Check for updates"},aa(kt.value.isChecking?"Checking...":"Check Updates"),9,Aet),un[9]||(un[9]=Re("span",{class:"text-dark-text text-xs"},"•",-1)),Re("button",{onClick:or,disabled:Gt.value,class:"text-xs text-primary hover:text-primary/80 disabled:opacity-50"},aa(Gt.value?"Updating...":"Refresh"),9,Met)])]),Re("div",Eet,[kt.value.hasUpdate?(zi(),Vi("div",Cet,[Re("div",Let,[un[11]||(un[11]=Re("span",{class:"text-white font-medium"},"Update Available",-1)),Re("span",Pet,aa(kt.value.latestVersion),1)]),Re("div",zet," Current: "+aa(kt.value.currentVersion),1),un[12]||(un[12]=Re("div",{class:"text-xs text-gray-300 mt-2"},[Re("a",{href:"https://github.com/rightup/pyMC_Repeater",target:"_blank",class:"text-accent-red hover:text-accent-red/80 underline"}," Goto Github→ ")],-1))])):kt.value.currentVersion&&!kt.value.isChecking?(zi(),Vi("div",Iet,[Re("div",Oet,[un[13]||(un[13]=Re("span",{class:"text-white font-medium"},"Up to Date",-1)),Re("span",Det,aa(kt.value.currentVersion),1)]),kt.value.lastChecked?(zi(),Vi("div",Fet," Last checked: "+aa(kt.value.lastChecked.toLocaleTimeString()),1)):bs("",!0)])):kt.value.isChecking?(zi(),Vi("div",Ret,un[14]||(un[14]=[Re("div",{class:"flex items-center justify-center gap-2"},[Re("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-primary"}),Re("span",{class:"text-gray-300"},"Checking for updates...")],-1)]))):kt.value.error?(zi(),Vi("div",Bet,[un[15]||(un[15]=Re("div",{class:"text-white font-medium mb-1"},"Update Check Failed",-1)),Re("div",Net,aa(kt.value.error),1)])):bs("",!0),un[20]||(un[20]=Re("div",{class:"border-t border-white/10"},null,-1)),un[21]||(un[21]=Re("div",{class:"text-white font-medium text-sm mb-2"},"Mesh Network Status",-1)),Re("div",jet,[Re("div",Uet,[un[16]||(un[16]=Re("span",{class:"text-white font-medium"},"Total Tracked Nodes",-1)),Re("span",Vet,aa(Fr.value),1)]),re.value?(zi(),Vi("div",Het," Last updated: "+aa(re.value.toLocaleString()),1)):bs("",!0)]),(zi(!0),Vi(Ou,null,sf(zr.value,ia=>(zi(),Vi("div",{key:ia.type,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10"},[Re("div",Wet,[Re("span",qet,aa(ia.type)+aa(ia.count===1?"":"s"),1),Re("span",{class:Xs([An(ia.type),"font-bold"])},aa(ia.count),3)]),Dt.value[ia.type]?.length>0?(zi(),Vi("div",Zet,[Re("div",$et,[un[17]||(un[17]=nc(" Latest: ",-1)),Re("span",Get,aa(Ft(ia.type)),1)])])):bs("",!0)]))),128)),Fr.value===0&&!Gt.value?(zi(),Vi("div",Yet,un[18]||(un[18]=[Re("div",{class:"text-gray-400"},[Re("svg",{class:"w-8 h-8 mx-auto mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.172 16.172a4 4 0 015.656 0M9 12h6m-6-4h6m2 5.291A7.962 7.962 0 0112 15c-2.034 0-3.9.785-5.291 2.09M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]),Re("span",null,"No mesh nodes detected")],-1)]))):bs("",!0),Gt.value?(zi(),Vi("div",Ket,un[19]||(un[19]=[Re("div",{class:"flex items-center justify-center gap-2"},[Re("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-primary"}),Re("span",{class:"text-gray-300"},"Scanning mesh network...")],-1)]))):bs("",!0)])],512)):bs("",!0)])])]))}}),Jet=ld(Xet,[["__scopeId","data-v-0a06f286"]]),Qet={class:"min-h-screen bg-dark-bg overflow-hidden relative font-sans"},trt={class:"relative flex min-h-screen"},ert={class:"flex-1 p-4 lg:p-[15px] overflow-y-auto"},rrt=Th({name:"DashboardLayout",__name:"DashboardLayout",setup(d){const l=lo(!1),z=()=>{l.value=!l.value},j=()=>{l.value=!1};return(J,mt)=>{const kt=UA("router-view");return zi(),Vi("div",Qet,[mt[1]||(mt[1]=Re("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/25 to-cyan-200/10 blur-[120px] opacity-80 -top-[79px] left-[575px] mix-blend-screen pointer-events-none"},null,-1)),mt[2]||(mt[2]=Re("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/25 to-cyan-200/10 blur-[120px] opacity-75 -top-[94px] -left-[92px] mix-blend-screen pointer-events-none"},null,-1)),mt[3]||(mt[3]=Re("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/25 to-cyan-200/10 blur-[120px] opacity-80 top-[373px] left-[246px] mix-blend-screen pointer-events-none"},null,-1)),Re("div",trt,[gu(Xtt,{class:"hidden lg:block"}),gu(set,{showMobileSidebar:l.value,"onUpdate:showMobileSidebar":mt[0]||(mt[0]=Dt=>l.value=Dt),onClose:j},null,8,["showMobileSidebar"]),Re("main",ert,[gu(Jet,{onToggleMobileSidebar:z}),gu(kt)])])])}}}),nrt=Th({__name:"App",setup(d){return(l,z)=>(zi(),hm(rrt))}}),irt={class:"sparkline-container"},art={class:"text-white text-sm font-semibold mb-4"},ort={class:"flex items-end gap-4"},srt=["id","width","height","viewBox"],lrt=["id"],urt=["stop-color"],crt=["stop-color"],hrt=["d","fill"],frt=["d","stroke"],drt=["cx","cy","fill"],prt=Th({name:"SparklineChart",__name:"Sparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},width:{default:131},height:{default:37},animate:{type:Boolean,default:!0},showChart:{type:Boolean,default:!0}},setup(d){const l=d,z=Yo(()=>{if(l.data&&l.data.length>0)return l.data;const kt=typeof l.value=="number"?l.value:10,Dt=20,Gt=kt*.3;return Array.from({length:Dt},(re,pe)=>{const Ne=Math.sin(pe/Dt*Math.PI*2)*Gt*.5,or=(Math.random()-.5)*Gt*.3;return Math.max(0,kt+Ne+or)})}),j=Yo(()=>{const kt=z.value;if(kt.length<2)return"";const Dt=Math.max(...kt),Gt=Math.min(...kt),re=Dt-Gt||1,pe=l.width/(kt.length-1);let Ne="";return kt.forEach((or,_r)=>{const Fr=_r*pe,zr=l.height-(or-Gt)/re*l.height;if(_r===0)Ne+=`M ${Fr} ${zr}`;else{const An=((_r-1)*pe+Fr)/2;Ne+=` Q ${An} ${zr} ${Fr} ${zr}`}}),Ne}),J=lo("");t0(()=>{J.value=j.value}),um(()=>l.data,(kt,Dt)=>{const Gt=!Dt||kt.length!==Dt.length||Math.abs(kt.length-Dt.length)>5;l.animate&&Gt?(J.value="",setTimeout(()=>{J.value=j.value},50)):J.value=j.value});const mt=Yo(()=>`sparkline-${l.title.replace(/\s+/g,"-").toLowerCase()}`);return(kt,Dt)=>(zi(),Vi("div",irt,[Re("p",art,aa(kt.title),1),Re("div",ort,[Re("span",{class:"text-[30px] font-bold",style:av({color:kt.color})},[nc(aa(kt.value),1),qG(kt.$slots,"unit",{},void 0)],4),kt.showChart?(zi(),Vi("svg",{key:0,id:mt.value,class:"mb-3 sparkline-svg",width:kt.width,height:kt.height,viewBox:`0 0 ${kt.width} ${kt.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("defs",null,[Re("linearGradient",{id:`gradient-${mt.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[Re("stop",{offset:"0%","stop-color":kt.color,"stop-opacity":"0.3"},null,8,urt),Re("stop",{offset:"100%","stop-color":kt.color,"stop-opacity":"0.1"},null,8,crt)],8,lrt)]),Re("path",{d:`${J.value} L ${kt.width} ${kt.height} L 0 ${kt.height} Z`,fill:`url(#gradient-${mt.value})`,class:"sparkline-fill"},null,8,hrt),Re("path",{d:J.value,stroke:kt.color,"stroke-width":"2",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:Xs(["sparkline-path",{"animate-draw":kt.animate}])},null,10,frt),z.value.length>0?(zi(),Vi("circle",{key:0,cx:kt.width,cy:kt.height-(z.value[z.value.length-1]-Math.min(...z.value))/(Math.max(...z.value)-Math.min(...z.value)||1)*kt.height,r:"2",fill:kt.color,class:Xs(["sparkline-dot",{"animate-pulse":kt.animate}])},null,10,drt)):bs("",!0)],8,srt)):bs("",!0)])]))}}),r_=ld(prt,[["__scopeId","data-v-574bf55e"]]),mrt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-5"},grt=Th({name:"StatsCards",__name:"StatsCards",setup(d){const l=rw(),z=lo(null),j=Yo(()=>{const kt=l.packetStats,Dt=l.systemStats,Gt=re=>{const pe=Math.floor(re/86400),Ne=Math.floor(re%86400/3600),or=Math.floor(re%3600/60);return pe>0?`${pe}d ${Ne}h`:Ne>0?`${Ne}h ${or}m`:`${or}m`};return{packetsReceived:kt?.total_packets||0,packetsForwarded:kt?.transmitted_packets||0,uptimeFormatted:Dt?Gt(Dt.uptime_seconds||0):"0m",uptimeHours:Dt?Math.floor((Dt.uptime_seconds||0)/3600):0,droppedPackets:kt?.dropped_packets||0,signalQuality:Math.round((kt?.avg_rssi||0)+120)}}),J=Yo(()=>l.sparklineData),mt=async()=>{try{await Promise.all([l.fetchSystemStats(),l.fetchPacketStats({hours:24})])}catch(kt){console.error("Error fetching stats:",kt)}};return t0(()=>{mt(),z.value=window.setInterval(mt,5e3)}),dg(()=>{z.value&&clearInterval(z.value)}),(kt,Dt)=>(zi(),Vi("div",mrt,[gu(r_,{title:"RX Packets",value:j.value.packetsReceived,color:"#AAE8E8",data:J.value.totalPackets},null,8,["value","data"]),gu(r_,{title:"Forward",value:j.value.packetsForwarded,color:"#FFC246",data:J.value.transmittedPackets},null,8,["value","data"]),gu(r_,{title:"Up Time",value:j.value.uptimeFormatted,color:"#EBA0FC",data:[],showChart:!1},null,8,["value"]),gu(r_,{title:"Dropped",value:j.value.droppedPackets,color:"#FB787B",data:J.value.droppedPackets},null,8,["value","data"])]))}}),vrt={class:"glass-card rounded-[10px] p-6"},yrt={class:"h-80 relative"},xrt={key:0,class:"absolute inset-0 flex items-center justify-center"},_rt={key:1,class:"absolute inset-0 flex items-center justify-center"},brt={class:"text-red-400"},wrt={key:2,class:"absolute inset-0 flex items-center justify-center"},krt={key:3,class:"h-full flex items-end justify-around gap-2 px-4"},Trt={class:"relative w-full h-64 flex flex-col justify-end"},Art={class:"text-white text-xs font-semibold drop-shadow-lg backdrop-blur-sm bg-black/20 px-2 py-0.5 rounded-md border border-white/10"},Mrt={class:"mt-2 text-center"},Srt={class:"text-white text-xs font-medium leading-tight"},Ert={key:0,class:"mt-4 text-sm text-white text-center"},Crt=Th({name:"SignalQualityChart",__name:"SignalQualityChart",setup(d){const l=lo([]),z=lo(null),j=lo(!0),J=lo(null),mt=["rgba(59, 130, 246, 0.8)","rgba(16, 185, 129, 0.8)","rgba(139, 92, 246, 0.8)","rgba(245, 158, 11, 0.8)","rgba(239, 68, 68, 0.8)","rgba(6, 182, 212, 0.8)","rgba(249, 115, 22, 0.8)","rgba(132, 204, 22, 0.8)","rgba(236, 72, 153, 0.8)","rgba(107, 114, 128, 0.8)"],kt=async()=>{try{J.value=null;const Gt=await Xh.get("/packet_type_graph_data");if(Gt?.success&&Gt?.data){const re=Gt.data;if(re?.series){const pe=[];re.series.forEach((Ne,or)=>{let _r=0;Ne.data&&Array.isArray(Ne.data)&&(_r=Ne.data.reduce((Fr,zr)=>Fr+(zr[1]||0),0)),_r>0&&pe.push({name:Ne.name||`Type ${Ne.type}`,type:Ne.type,count:_r,color:mt[or%mt.length]})}),pe.sort((Ne,or)=>or.count-Ne.count),l.value=pe,j.value=!1}else console.error("No series data found in response"),J.value="No series data in server response",j.value=!1}else console.error("Invalid API response structure:",Gt),J.value="Invalid response from server",j.value=!1}catch(Gt){console.error("Failed to fetch packet type data:",Gt),J.value=Gt instanceof Error?Gt.message:"Failed to load data",j.value=!1}},Dt=Gt=>{if(l.value.length===0)return 0;const re=Math.max(...l.value.map(pe=>pe.count));return Math.max(Gt/re*100,2)};return t0(()=>{kt(),z.value=setInterval(()=>{kt()},3e4)}),dg(()=>{z.value&&clearInterval(z.value)}),(Gt,re)=>(zi(),Vi("div",vrt,[re[2]||(re[2]=Re("h3",{class:"text-white text-xl font-semibold mb-4"},"Packet Types",-1)),re[3]||(re[3]=Re("p",{class:"text-white text-sm uppercase mb-4"},"Distribution by Type",-1)),Re("div",yrt,[j.value?(zi(),Vi("div",xrt,re[0]||(re[0]=[Re("div",{class:"text-white"},"Loading packet types...",-1)]))):J.value?(zi(),Vi("div",_rt,[Re("div",brt,aa(J.value),1)])):l.value.length===0?(zi(),Vi("div",wrt,re[1]||(re[1]=[Re("div",{class:"text-white"},"No packet data available",-1)]))):(zi(),Vi("div",krt,[(zi(!0),Vi(Ou,null,sf(l.value,pe=>(zi(),Vi("div",{key:pe.type,class:"flex flex-col items-center flex-1 max-w-20 h-full"},[Re("div",Trt,[Re("div",{class:"w-full rounded-t-[10px] transition-all duration-500 ease-out flex items-end justify-center pb-1 backdrop-blur-[50px] shadow-lg border border-white/20 hover:border-white/30",style:av({height:Dt(pe.count)+"%",background:`linear-gradient(135deg,
${pe.color} 0%,
${pe.color.replace("0.8","0.6")} 30%,
${pe.color.replace("0.8","0.4")} 70%,
${pe.color.replace("0.8","0.3")} 100%),
linear-gradient(91deg, rgba(34, 34, 34, 0.43) 1.17%, rgba(135, 135, 136, 0.10) 99.82%)`,backgroundBlendMode:"overlay, normal",minHeight:"8px",boxShadow:`
0 8px 32px ${pe.color.replace("0.8","0.3")},
0 4px 15px rgba(0, 0, 0, 0.4),
inset 0 1px 0 rgba(255, 255, 255, 0.3),
inset 0 -1px 0 rgba(0, 0, 0, 0.2)
`})},[Re("span",Art,aa(pe.count),1)],4)]),Re("div",Mrt,[Re("div",Srt,aa(pe.name.replace(/\([^)]*\)/g,"").trim()),1)])]))),128))]))]),l.value.length>0?(zi(),Vi("div",Ert," Total packet types: "+aa(l.value.length)+" | Total packets: "+aa(l.value.reduce((pe,Ne)=>pe+Ne.count,0)),1)):bs("",!0)]))}}),Lrt=ld(Crt,[["__scopeId","data-v-dc58fd68"]]),Prt={class:"glass-card rounded-[10px] p-6"},zrt={class:"relative h-48"},Irt={class:"mt-4 grid grid-cols-2 gap-4"},Ort={class:"text-center"},Drt={class:"text-2xl font-bold text-white"},Frt={class:"text-center"},Rrt={class:"text-2xl font-bold text-white"},Brt={class:"mt-3 grid grid-cols-3 gap-3 text-center"},Nrt={class:"text-sm font-semibold text-accent-purple"},jrt={class:"text-sm font-semibold text-accent-red"},Urt={class:"text-sm font-semibold text-white"},Vrt=Th({name:"PerformanceChart",__name:"PerformanceChart",setup(d){const l=rw(),z=lo(null),j=lo([]),J=lo(null),mt=lo(!0),kt=async()=>{try{mt.value=!0;const Gt=await Xh.get("/recent_packets",{limit:50});if(!Gt.success){j.value=[],mt.value=!1,Z0(()=>{Dt()});return}const re=Gt.data||[],pe=Date.now(),Ne=24,or=12,_r=Ne*60*60*1e3/or,Fr=[];for(let zr=0;zr<or;zr++){const Wr=pe-Ne*60*60*1e3+zr*_r,An=Wr+_r,Ft=re.filter(jn=>{const ai=jn.timestamp*1e3;return ai>=Wr&&ai<An}),kn=Ft.filter(jn=>!jn.transmitted).length,ei=Ft.filter(jn=>jn.transmitted).length;Fr.push({time:new Date(Wr+_r/2).toISOString(),rxPackets:kn,txPackets:ei})}j.value=Fr,mt.value=!1,Z0(()=>{Dt()})}catch{j.value=[],mt.value=!1,Z0(()=>{Dt()})}},Dt=()=>{if(!z.value)return;const Gt=z.value,re=Gt.getContext("2d");if(!re)return;const pe=Gt.parentElement;if(!pe)return;const Ne=pe.getBoundingClientRect(),or=Ne.width,_r=Ne.height;Gt.width=or*window.devicePixelRatio,Gt.height=_r*window.devicePixelRatio,Gt.style.width=or+"px",Gt.style.height=_r+"px",re.scale(window.devicePixelRatio,window.devicePixelRatio);const Fr=20;if(re.clearRect(0,0,or,_r),mt.value){re.fillStyle="#666",re.font="16px sans-serif",re.textAlign="center",re.fillText("Loading chart data...",or/2,_r/2);return}if(j.value.length===0){re.fillStyle="#666",re.font="16px sans-serif",re.textAlign="center",re.fillText("No data available",or/2,_r/2);return}const zr=j.value.every(Gi=>Gi.rxPackets===0&&Gi.txPackets===0),Wr=or-Fr*2,An=_r-Fr*2,Ft=j.value.flatMap(Gi=>[Gi.rxPackets,Gi.txPackets]),kn=Math.min(...Ft),ei=Math.max(...Ft),jn=kn,ai=ei,Qi=Math.max(ai-jn,1);if(re.strokeStyle="rgba(255, 255, 255, 0.1)",re.lineWidth=1,jn<=0&&ai>=0){re.strokeStyle="rgba(255, 255, 255, 0.3)",re.lineWidth=2;const Gi=_r-Fr-(0-jn)/Qi*An;re.beginPath(),re.moveTo(Fr,Gi),re.lineTo(or-Fr,Gi),re.stroke(),Gi>20&&Gi<_r-20&&(re.fillStyle="rgba(255, 255, 255, 0.7)",re.font="10px system-ui",re.textAlign="left",re.fillText("0",Fr+2,Gi-2)),re.strokeStyle="rgba(255, 255, 255, 0.1)",re.lineWidth=1}for(let Gi=0;Gi<=5;Gi++){const un=Fr+An*Gi/5;re.beginPath(),re.moveTo(Fr,un),re.lineTo(or-Fr,un),re.stroke()}for(let Gi=0;Gi<=6;Gi++){const un=Fr+Wr*Gi/6;re.beginPath(),re.moveTo(un,Fr),re.lineTo(un,_r-Fr),re.stroke()}j.value.length>1&&(re.strokeStyle="#EBA0FC",re.lineWidth=2,re.beginPath(),j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.rxPackets-jn)/Qi*An;un===0?re.moveTo(ia,fa):re.lineTo(ia,fa)}),re.stroke(),re.fillStyle="#EBA0FC",j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.rxPackets-jn)/Qi*An;re.beginPath(),re.arc(ia,fa,2,0,2*Math.PI),re.fill()})),j.value.length>1&&(re.strokeStyle="#FB787B",re.lineWidth=2,re.beginPath(),j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.txPackets-jn)/Qi*An;un===0?re.moveTo(ia,fa):re.lineTo(ia,fa)}),re.stroke(),re.fillStyle="#FB787B",j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.txPackets-jn)/Qi*An;re.beginPath(),re.arc(ia,fa,2,0,2*Math.PI),re.fill()})),re.fillStyle="rgba(255, 255, 255, 0.6)",re.font="12px system-ui",re.textAlign="center",zr&&(re.fillStyle="rgba(255, 255, 255, 0.6)",re.font="14px system-ui",re.textAlign="center",re.fillText("No packet activity in last 24 hours",or/2,_r-15))};return t0(()=>{kt(),J.value=window.setInterval(kt,3e4),Z0(()=>{Dt(),setTimeout(()=>{Dt()},100)}),window.addEventListener("resize",Dt)}),dg(()=>{J.value&&clearInterval(J.value),window.removeEventListener("resize",Dt)}),(Gt,re)=>(zi(),Vi("div",Prt,[re[5]||(re[5]=Ff('<h3 class="text-white text-xl font-semibold mb-4" data-v-2ece57e8>Performance Metrics</h3><p class="text-white text-sm uppercase mb-4" data-v-2ece57e8>Packet Activity (Last 24 Hours)</p><div class="flex items-center gap-6 mb-4" data-v-2ece57e8><div class="flex items-center gap-2" data-v-2ece57e8><div class="w-7 h-2 rounded bg-accent-purple" data-v-2ece57e8></div><span class="text-white text-sm" data-v-2ece57e8>Received</span></div><div class="flex items-center gap-2" data-v-2ece57e8><div class="w-7 h-2 rounded bg-accent-red" data-v-2ece57e8></div><span class="text-white text-sm" data-v-2ece57e8>Transmitted</span></div></div>',3)),Re("div",zrt,[Re("canvas",{ref_key:"chartRef",ref:z,class:"absolute inset-0 w-full h-full"},null,512)]),Re("div",Irt,[Re("div",Ort,[Re("div",Drt,aa(Ju(l).packetStats?.total_packets||0),1),re[0]||(re[0]=Re("div",{class:"text-xs text-white/70 uppercase tracking-wide"},"Total Received",-1))]),Re("div",Frt,[Re("div",Rrt,aa(Ju(l).packetStats?.transmitted_packets||0),1),re[1]||(re[1]=Re("div",{class:"text-xs text-white/70 uppercase tracking-wide"},"Total Transmitted",-1))])]),Re("div",Brt,[Re("div",null,[Re("div",Nrt,aa(j.value.length>0?Math.round(j.value.reduce((pe,Ne)=>pe+Ne.rxPackets,0)/j.value.length*100)/100:0),1),re[2]||(re[2]=Re("div",{class:"text-xs text-white/60"},"Avg RX/hr",-1))]),Re("div",null,[Re("div",jrt,aa(j.value.length>0?Math.round(j.value.reduce((pe,Ne)=>pe+Ne.txPackets,0)/j.value.length*100)/100:0),1),re[3]||(re[3]=Re("div",{class:"text-xs text-white/60"},"Avg TX/hr",-1))]),Re("div",null,[Re("div",Urt,aa(Ju(l).packetStats?.dropped_packets||0),1),re[4]||(re[4]=Re("div",{class:"text-xs text-white/60"},"Dropped",-1))])])]))}}),Hrt=ld(Vrt,[["__scopeId","data-v-2ece57e8"]]),Wrt={class:"relative w-full max-w-4xl max-h-[90vh] overflow-hidden"},qrt={class:"glass-card rounded-[20px] p-8 backdrop-blur-[50px] shadow-2xl border border-white/20"},Zrt={class:"flex items-center justify-between mb-6"},$rt={class:"text-white/70 text-sm"},Grt={class:"max-h-[70vh] overflow-y-auto custom-scrollbar"},Yrt={class:"mb-6"},Krt={class:"glass-card bg-white/5 rounded-[15px] p-4"},Xrt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Jrt={class:"space-y-3"},Qrt={class:"flex justify-between py-2 border-b border-white/10"},tnt={class:"text-white font-mono text-sm"},ent={class:"flex justify-between py-2 border-b border-white/10"},rnt={class:"text-white font-mono text-xs break-all"},nnt={key:0,class:"flex justify-between py-2 border-b border-white/10"},int={class:"text-white font-mono text-xs"},ant={class:"space-y-3"},ont={class:"flex justify-between py-2 border-b border-white/10"},snt={class:"text-white font-semibold"},lnt={class:"flex justify-between py-2 border-b border-white/10"},unt={class:"text-white font-semibold"},cnt={class:"flex justify-between py-2 border-b border-white/10"},hnt={class:"mb-6"},fnt={class:"glass-card bg-white/5 rounded-[15px] p-4"},dnt={class:"space-y-3"},pnt={class:"flex justify-between py-2 border-b border-white/10"},mnt={class:"text-white"},gnt={key:0,class:"pt-2"},vnt={class:"glass-card bg-black/30 rounded-[10px] p-4 mb-4"},ynt={class:"w-full overflow-x-auto"},xnt={class:"text-white/90 text-xs font-mono whitespace-pre leading-relaxed min-w-full"},_nt={class:"flex items-center justify-between mb-3"},bnt={class:"text-white/80 text-sm font-semibold"},wnt={class:"text-white/60 text-xs"},knt={class:"glass-card bg-black/40 rounded-[8px] p-3 mb-3 overflow-x-auto"},Tnt={class:"font-mono text-sm text-white whitespace-pre min-w-full"},Ant={class:"glass-card bg-white/5 rounded-[10px] overflow-hidden"},Mnt={class:"text-cyan-400 text-sm font-mono"},Snt={class:"text-white text-sm"},Ent={class:"text-white text-sm font-semibold"},Cnt={class:"text-orange-400 text-sm font-mono"},Lnt={key:0,class:"text-white/60 text-xs italic mt-2 px-1"},Pnt={key:1,class:"py-2"},znt={class:"mb-6"},Int={class:"glass-card bg-white/5 rounded-[15px] p-4"},Ont={class:"space-y-4"},Dnt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Fnt={class:"flex justify-between py-2 border-b border-white/10"},Rnt={class:"flex justify-between py-2 border-b border-white/10"},Bnt={key:0,class:"py-2"},Nnt={class:"glass-card bg-black/20 rounded-[10px] p-4"},jnt={class:"flex items-center flex-wrap gap-2"},Unt={class:"relative group"},Vnt={class:"relative px-3 py-2 bg-gradient-to-br from-blue-500/20 to-cyan-500/20 border border-cyan-400/40 rounded-lg transform transition-all hover:scale-105"},Hnt={class:"font-mono text-xs font-semibold text-white/90"},Wnt={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},qnt={key:0,class:"mx-2 text-cyan-400/60"},Znt={key:1,class:"py-2"},$nt={class:"text-white/70 text-sm mb-2 flex items-center"},Gnt={key:0,class:"w-4 h-4 ml-2 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ynt={key:1,class:"text-yellow-400 text-xs ml-1"},Knt={class:"glass-card bg-black/20 rounded-[10px] p-4"},Xnt={class:"flex items-center flex-wrap gap-2"},Jnt={class:"relative group"},Qnt={key:0,class:"absolute -top-1 -right-1 w-2 h-2 bg-yellow-400 rounded-full animate-pulse"},tit={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},eit={key:0,class:"mx-1 text-orange-400/60"},rit={class:"mb-6"},nit={class:"glass-card bg-white/5 rounded-[15px] p-4"},iit={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"},ait={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},oit={class:"text-lg font-bold text-white"},sit={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},lit={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},uit={class:"text-lg font-bold text-white"},cit={class:"mb-4"},hit={class:"flex items-center gap-3"},fit={class:"flex gap-1"},dit={class:"text-white/80 text-sm capitalize"},pit={key:0,class:"mb-4"},mit={class:"text-white/70 text-sm mb-3"},git={class:"space-y-2"},vit={class:"flex items-center gap-3"},yit={class:"text-white/60 text-sm"},xit={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},_it={class:"space-y-2"},bit={class:"flex justify-between py-2 border-b border-white/10"},wit={class:"text-white"},kit={class:"flex justify-between py-2 border-b border-white/10"},Tit={class:"space-y-2"},Ait={class:"flex justify-between py-2 border-b border-white/10"},Mit={key:0,class:"flex justify-between py-2 border-b border-white/10"},Sit={class:"text-red-400 text-sm"},Eit={class:"mt-6 pt-4 border-t border-white/10 flex justify-end"},Cit=Th({name:"PacketDetailsModal",__name:"PacketDetailsModal",props:{packet:{},isOpen:{type:Boolean},localHash:{}},emits:["close"],setup(d,{emit:l}){const z=d,j=l,J=Ft=>new Date(Ft*1e3).toLocaleString(),mt=Ft=>Ft.transmitted?Ft.is_duplicate?"text-amber-400":Ft.drop_reason?"text-red-400":"text-green-400":"text-red-400",kt=Ft=>Ft.transmitted?Ft.is_duplicate?"Duplicate":Ft.drop_reason?"Dropped":"Forwarded":"Dropped",Dt=Ft=>({0:"Request",1:"Response",2:"Plain Text Message",3:"Acknowledgment",4:"Node Advertisement",5:"Group Text Message",6:"Group Datagram",7:"Anonymous Request",8:"Returned Path",9:"Trace",10:"Multi-part Packet",15:"Custom Packet"})[Ft]||`Unknown Type (${Ft})`,Gt=Ft=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[Ft]||`Unknown Route (${Ft})`,re=Ft=>{if(!Ft)return"None";const ei=Ft.replace(/\s+/g,"").toUpperCase().match(/.{2}/g)||[],jn=[];for(let ai=0;ai<ei.length;ai+=32){const Qi=ei.slice(ai,ai+32).join(" ");jn.push(Qi)}return jn.join(`
`)||Ft},pe=(Ft,kn,ei)=>{try{let jn=0;const ai=kn.length/2;if(ai>=100){if(kn.length>=jn+64){const Qi=kn.slice(jn,jn+64);Ft.push({name:"Public Key",byteRange:`${(ei+jn)/2}-${(ei+jn+63)/2}`,hexData:Qi.match(/.{8}/g)?.join(" ")||Qi,description:"Ed25519 public key of the node (32 bytes)",fields:[{bits:"0-255",name:"Ed25519 Public Key",value:`${Qi.slice(0,16)}...${Qi.slice(-16)}`,binary:"32 bytes (256 bits)"}]}),jn+=64}if(kn.length>=jn+8){const Qi=kn.slice(jn,jn+8),Gi=parseInt(Qi,16),un=new Date(Gi*1e3);Ft.push({name:"Timestamp",byteRange:`${(ei+jn)/2}-${(ei+jn+7)/2}`,hexData:Qi.match(/.{2}/g)?.join(" ")||Qi,description:"Unix timestamp of advertisement",fields:[{bits:"0-31",name:"Unix Timestamp",value:`${Gi} (${un.toLocaleString()})`,binary:Gi.toString(2).padStart(32,"0")}]}),jn+=8}if(kn.length>=jn+128){const Qi=kn.slice(jn,jn+128);Ft.push({name:"Signature",byteRange:`${(ei+jn)/2}-${(ei+jn+127)/2}`,hexData:Qi.match(/.{8}/g)?.join(" ")||Qi,description:"Ed25519 signature of public key, timestamp, and appdata",fields:[{bits:"0-511",name:"Ed25519 Signature",value:`${Qi.slice(0,16)}...${Qi.slice(-16)}`,binary:"64 bytes (512 bits)"}]}),jn+=128}if(kn.length>jn){const Qi=kn.slice(jn);Ne(Ft,Qi,ei+jn)}}else Ft.push({name:"ADVERT AppData (Partial)",byteRange:`${ei/2}-${ei/2+ai-1}`,hexData:kn.match(/.{2}/g)?.join(" ")||kn,description:`Partial ADVERT data - appears to be just AppData portion (${ai} bytes)`,fields:[{bits:`0-${ai*8-1}`,name:"Partial Data",value:`${ai} bytes - attempting to decode as AppData`,binary:`${ai} bytes (${ai*8} bits)`}]}),Ne(Ft,kn,ei)}catch(jn){Ft.push({name:"ADVERT Parse Error",byteRange:"N/A",hexData:kn.slice(0,32)+"...",description:"Failed to parse ADVERT payload structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${jn instanceof Error?jn.message:"Unknown error"}`,binary:"Invalid"}]})}},Ne=(Ft,kn,ei)=>{try{const jn=kn.length/2;Ft.push({name:"AppData",byteRange:`${ei/2}-${ei/2+jn-1}`,hexData:kn.match(/.{2}/g)?.join(" ")||kn,description:`Node advertisement application data (${jn} bytes)`,fields:[{bits:`0-${jn*8-1}`,name:"Application Data",value:`${jn} bytes (contains flags, location, name, etc.)`,binary:`${jn} bytes (${jn*8} bits)`}]});let ai=0;if(kn.length>=2){const Qi=parseInt(kn.slice(ai,ai+2),16),Gi=[],un=!!(Qi&16),ia=!!(Qi&32),fa=!!(Qi&64),Li=!!(Qi&128);if(Qi&1&&Gi.push("is chat node"),Qi&2&&Gi.push("is repeater"),Qi&4&&Gi.push("is room server"),Qi&8&&Gi.push("is sensor"),un&&Gi.push("has location"),ia&&Gi.push("has feature 1"),fa&&Gi.push("has feature 2"),Li&&Gi.push("has name"),Ft.push({name:"AppData Flags",byteRange:`${(ei+ai)/2}`,hexData:`0x${kn.slice(ai,ai+2)}`,description:"Flags indicating which optional fields are present",fields:[{bits:"0-7",name:"Flags",value:Gi.join(", ")||"none",binary:Qi.toString(2).padStart(8,"0")}]}),ai+=2,un&&kn.length>=ai+16){const yi=kn.slice(ai,ai+8),ra=[];for(let fu=6;fu>=0;fu-=2)ra.push(yi.slice(fu,fu+2));const Da=parseInt(ra.join(""),16),Ni=Da>2147483647?Da-4294967296:Da,Ei=Ni/1e6,Va=kn.slice(ai+8,ai+16),ss=[];for(let fu=6;fu>=0;fu-=2)ss.push(Va.slice(fu,fu+2));const mo=parseInt(ss.join(""),16),ko=mo>2147483647?mo-4294967296:mo,pl=ko/1e6;Ft.push({name:"Location Data",byteRange:`${(ei+ai)/2}-${(ei+ai+15)/2}`,hexData:`${yi.match(/.{2}/g)?.join(" ")||yi} ${Va.match(/.{2}/g)?.join(" ")||Va}`,description:"GPS coordinates (latitude and longitude)",fields:[{bits:"0-31",name:"Latitude",value:`${Ei.toFixed(6)}° (raw: ${Ni})`,binary:Ni.toString(2).padStart(32,"0")},{bits:"32-63",name:"Longitude",value:`${pl.toFixed(6)}° (raw: ${ko})`,binary:ko.toString(2).padStart(32,"0")}]}),ai+=16}if(ia&&kn.length>=ai+4){const yi=kn.slice(ai,ai+4),ra=parseInt(yi,16);Ft.push({name:"Feature 1",byteRange:`${(ei+ai)/2}-${(ei+ai+3)/2}`,hexData:yi.match(/.{2}/g)?.join(" ")||yi,description:"Reserved feature 1 (2 bytes)",fields:[{bits:"0-15",name:"Feature 1 Value",value:`${ra}`,binary:ra.toString(2).padStart(16,"0")}]}),ai+=4}if(fa&&kn.length>=ai+4){const yi=kn.slice(ai,ai+4),ra=parseInt(yi,16);Ft.push({name:"Feature 2",byteRange:`${(ei+ai)/2}-${(ei+ai+3)/2}`,hexData:yi.match(/.{2}/g)?.join(" ")||yi,description:"Reserved feature 2 (2 bytes)",fields:[{bits:"0-15",name:"Feature 2 Value",value:`${ra}`,binary:ra.toString(2).padStart(16,"0")}]}),ai+=4}if(Li&&kn.length>ai){const yi=kn.slice(ai),ra=yi.match(/.{2}/g)||[],Da=ra.map(Ni=>{const Ei=parseInt(Ni,16);return Ei>=32&&Ei<=126?String.fromCharCode(Ei):"."}).join("").replace(/\.+$/,"");Ft.push({name:"Node Name",byteRange:`${(ei+ai)/2}-${(ei+kn.length-1)/2}`,hexData:yi.match(/.{2}/g)?.join(" ")||yi,description:`Node name string (${ra.length} bytes)`,fields:[{bits:`0-${ra.length*8-1}`,name:"Node Name",value:`"${Da}"`,binary:`ASCII text (${ra.length} bytes)`}]})}}}catch(jn){Ft.push({name:"AppData Parse Error",byteRange:"N/A",hexData:kn.slice(0,Math.min(32,kn.length)),description:"Failed to parse AppData structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${jn instanceof Error?jn.message:"Unknown error"}`,binary:"Invalid"}]})}},or=Ft=>{if(!Ft)return[];if(Array.isArray(Ft))return Ft;if(typeof Ft=="string")try{return JSON.parse(Ft)}catch{return[]}return[]},_r=Ft=>{const kn=[];if(!Ft)return kn;try{const ei=Ft.raw_packet;if(ei){const jn=ei.replace(/\s+/g,"").toUpperCase();let ai=0;if(jn.length>=2){const Qi=jn.slice(ai,ai+2),Gi=parseInt(Qi,16),un=Gi&3,ia=(Gi&60)>>2,fa=(Gi&192)>>6,Li={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},yi={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};if(kn.push({name:"Header",byteRange:"0",hexData:`0x${Qi}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:Li[un]||"Unknown",binary:un.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:yi[ia]||"Unknown",binary:ia.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:fa.toString(),binary:fa.toString(2).padStart(2,"0")}]}),ai+=2,(un===0||un===3)&&jn.length>=ai+8){const Da=jn.slice(ai,ai+8),Ni=parseInt(Da.slice(0,4),16),Ei=parseInt(Da.slice(4,8),16);kn.push({name:"Transport Codes",byteRange:"1-4",hexData:`${Da.slice(0,4)} ${Da.slice(4,8)}`,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-15",name:"Code 1",value:Ni.toString(),binary:Ni.toString(2).padStart(16,"0")},{bits:"16-31",name:"Code 2",value:Ei.toString(),binary:Ei.toString(2).padStart(16,"0")}]}),ai+=8}if(jn.length>=ai+2){const Da=jn.slice(ai,ai+2),Ni=parseInt(Da,16);if(kn.push({name:"Path Length",byteRange:`${ai/2}`,hexData:`0x${Da}`,description:`${Ni} bytes of path data`,fields:[{bits:"0-7",name:"Path Length",value:`${Ni} bytes`,binary:Ni.toString(2).padStart(8,"0")}]}),ai+=2,Ni>0&&jn.length>=ai+Ni*2){const Ei=jn.slice(ai,ai+Ni*2);kn.push({name:"Path Data",byteRange:`${ai/2}-${(ai+Ni*2-2)/2}`,hexData:Ei.match(/.{2}/g)?.join(" ")||Ei,description:"Routing path information",fields:[{bits:`0-${Ni*8-1}`,name:"Route Path",value:`${Ni} bytes of routing data`,binary:`${Ni} bytes (${Ni*8} bits)`}]}),ai+=Ni*2}}if(jn.length>ai){const Da=jn.slice(ai),Ni=Da.length/2;ia===4?pe(kn,Da,ai):kn.push({name:"Payload Data",byteRange:`${ai/2}-${ai/2+Ni-1}`,hexData:Da.match(/.{2}/g)?.join(" ")||Da,description:"Application data content",fields:[{bits:`0-${Ni*8-1}`,name:"Application Data",value:`${Ni} bytes`,binary:`${Ni} bytes (${Ni*8} bits)`}]})}}}else{if(Ft.header){const jn=Ft.header.replace(/0x/gi,"").replace(/\s+/g,"").toUpperCase(),ai=parseInt(jn,16),Qi=ai&3,Gi=(ai&60)>>2,un=(ai&192)>>6,ia={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},fa={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};kn.push({name:"Header",byteRange:"0",hexData:`0x${jn}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:ia[Qi]||"Unknown",binary:Qi.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:fa[Gi]||"Unknown",binary:Gi.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:un.toString(),binary:un.toString(2).padStart(2,"0")}]}),Ft.transport_codes&&kn.push({name:"Transport Codes",byteRange:"1-4",hexData:Ft.transport_codes,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-31",name:"Transport Codes",value:Ft.transport_codes,binary:"Available in separate field"}]}),Ft.original_path&&Ft.original_path.length>0&&kn.push({name:"Original Path",byteRange:"?",hexData:Ft.original_path.join(" "),description:`Original routing path (${Ft.original_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${Ft.original_path.length} nodes`,binary:"Available as node list"}]}),Ft.forwarded_path&&Ft.forwarded_path.length>0&&kn.push({name:"Forwarded Path",byteRange:"?",hexData:Ft.forwarded_path.join(" "),description:`Forwarded routing path (${Ft.forwarded_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${Ft.forwarded_path.length} nodes`,binary:"Available as node list"}]})}if(Ft.payload){const jn=Ft.payload.replace(/\s+/g,"").toUpperCase(),ai=jn.length/2;Ft.type===4?pe(kn,jn,0):kn.push({name:"Payload Data",byteRange:`0-${ai-1}`,hexData:jn.match(/.{2}/g)?.join(" ")||jn,description:`Application data content (${ai} bytes)`,fields:[{bits:`0-${ai*8-1}`,name:"Application Data",value:`${ai} bytes`,binary:`${ai} bytes (${ai*8} bits)`}]})}}}catch{kn.push({name:"Parse Error",byteRange:"N/A",hexData:"Error",description:"Unable to parse packet structure",fields:[{bits:"N/A",name:"Error",value:"Parse failed",binary:"Invalid"}]})}return kn},Fr=Ft=>Ft>=10?"text-green-400":Ft>=5?"text-cyan-400":Ft>=0?"text-yellow-400":"text-red-400",zr=(Ft,kn=8)=>{const jn={7:-7.5,8:-10,9:-12.5,10:-15,11:-17.5,12:-20}[kn]||-10;let ai,Qi;return Ft>=jn+10?(ai=4,Qi="signal-excellent"):Ft>=jn+5?(ai=3,Qi="signal-good"):Ft>=jn?(ai=2,Qi="signal-fair"):(ai=1,Qi="signal-poor"),{level:ai,className:Qi}},Wr=Ft=>{Ft.key==="Escape"&&j("close")},An=Ft=>{Ft.target===Ft.currentTarget&&j("close")};return(Ft,kn)=>(zi(),hm($z,{to:"body"},[gu(LI,{name:"modal",appear:""},{default:Y2(()=>[Ft.isOpen&&Ft.packet?(zi(),Vi("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:An,onKeydown:Wr,tabindex:"0"},[kn[36]||(kn[36]=Re("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md"},null,-1)),Re("div",Wrt,[Re("div",qrt,[Re("div",Zrt,[Re("div",null,[kn[2]||(kn[2]=Re("h2",{class:"text-2xl font-bold text-white mb-1"},"Packet Details",-1)),Re("p",$rt,aa(Dt(Ft.packet.type))+" - "+aa(Gt(Ft.packet.route)),1)]),Re("button",{onClick:kn[0]||(kn[0]=ei=>j("close")),class:"w-8 h-8 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 transition-colors duration-200 text-white/70 hover:text-white"},kn[3]||(kn[3]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("div",Grt,[Re("div",Yrt,[kn[10]||(kn[10]=Re("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Re("div",{class:"w-2 h-2 rounded-full bg-cyan-400 mr-3"}),nc(" Basic Information ")],-1)),Re("div",Krt,[Re("div",Xrt,[Re("div",Jrt,[Re("div",Qrt,[kn[4]||(kn[4]=Re("span",{class:"text-white/70 text-sm"},"Timestamp",-1)),Re("span",tnt,aa(J(Ft.packet.timestamp)),1)]),Re("div",ent,[kn[5]||(kn[5]=Re("span",{class:"text-white/70 text-sm"},"Packet Hash",-1)),Re("span",rnt,aa(Ft.packet.packet_hash),1)]),Ft.packet.header?(zi(),Vi("div",nnt,[kn[6]||(kn[6]=Re("span",{class:"text-white/70 text-sm"},"Header",-1)),Re("span",int,aa(Ft.packet.header),1)])):bs("",!0)]),Re("div",ant,[Re("div",ont,[kn[7]||(kn[7]=Re("span",{class:"text-white/70 text-sm"},"Type",-1)),Re("span",snt,aa(Ft.packet.type)+" ("+aa(Dt(Ft.packet.type))+")",1)]),Re("div",lnt,[kn[8]||(kn[8]=Re("span",{class:"text-white/70 text-sm"},"Route",-1)),Re("span",unt,aa(Ft.packet.route)+" ("+aa(Gt(Ft.packet.route))+")",1)]),Re("div",cnt,[kn[9]||(kn[9]=Re("span",{class:"text-white/70 text-sm"},"Status",-1)),Re("span",{class:Xs(["font-semibold",mt(Ft.packet)])},aa(kt(Ft.packet)),3)])])])])]),Re("div",hnt,[kn[16]||(kn[16]=Re("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Re("div",{class:"w-2 h-2 rounded-full bg-orange-400 mr-3"}),nc(" Payload Data ")],-1)),Re("div",fnt,[Re("div",dnt,[Re("div",pnt,[kn[11]||(kn[11]=Re("span",{class:"text-white/70 text-sm"},"Payload Length",-1)),Re("span",mnt,aa(Ft.packet.payload_length||Ft.packet.length)+" bytes",1)]),Ft.packet.payload?(zi(),Vi("div",gnt,[kn[14]||(kn[14]=Re("div",{class:"text-white/70 text-sm mb-3"},"Payload Analysis",-1)),Re("div",vnt,[kn[12]||(kn[12]=Re("div",{class:"text-white/70 text-xs mb-2 font-semibold"},"Raw Hex Data",-1)),Re("div",ynt,[Re("pre",xnt,aa(re(Ft.packet.payload)),1)])]),(zi(!0),Vi(Ou,null,sf(_r(Ft.packet).filter(ei=>!ei.name.includes("Parse Error")),(ei,jn)=>(zi(),Vi("div",{key:jn,class:"mb-4"},[Re("div",_nt,[Re("h4",bnt,aa(ei.name),1),Re("span",wnt,"Bytes "+aa(ei.byteRange),1)]),Re("div",knt,[Re("div",Tnt,aa(ei.hexData),1)]),Re("div",Ant,[kn[13]||(kn[13]=Re("div",{class:"grid grid-cols-4 gap-4 p-3 bg-white/10 text-white/70 text-xs font-semibold uppercase tracking-wide"},[Re("div",null,"Bits"),Re("div",null,"Field"),Re("div",null,"Value"),Re("div",null,"Binary")],-1)),(zi(!0),Vi(Ou,null,sf(ei.fields,(ai,Qi)=>(zi(),Vi("div",{key:Qi,class:"grid grid-cols-4 gap-4 p-3 border-b border-white/5 last:border-b-0 hover:bg-white/5 transition-colors"},[Re("div",Mnt,aa(ai.bits),1),Re("div",Snt,aa(ai.name),1),Re("div",Ent,aa(ai.value),1),Re("div",Cnt,aa(ai.binary),1)]))),128))]),ei.description?(zi(),Vi("div",Lnt,aa(ei.description),1)):bs("",!0)]))),128))])):(zi(),Vi("div",Pnt,kn[15]||(kn[15]=[Re("span",{class:"text-white/70 text-sm"},"Payload:",-1),Re("span",{class:"text-white/50 ml-2"},"None",-1)])))])])]),Re("div",znt,[kn[24]||(kn[24]=Re("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Re("div",{class:"w-2 h-2 rounded-full bg-purple-400 mr-3"}),nc(" Path Information ")],-1)),Re("div",Int,[Re("div",Ont,[Re("div",Dnt,[Re("div",Fnt,[kn[17]||(kn[17]=Re("span",{class:"text-white/70 text-sm"},"Source Hash",-1)),Re("span",{class:Xs(["text-white font-mono text-xs",z.localHash&&Ft.packet.src_hash===z.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},aa(Ft.packet.src_hash||"Unknown"),3)]),Re("div",Rnt,[kn[18]||(kn[18]=Re("span",{class:"text-white/70 text-sm"},"Destination Hash",-1)),Re("span",{class:Xs(["text-white font-mono text-xs",z.localHash&&Ft.packet.dst_hash===z.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},aa(Ft.packet.dst_hash||"Broadcast"),3)])]),or(Ft.packet.original_path).length>0?(zi(),Vi("div",Bnt,[kn[20]||(kn[20]=Re("div",{class:"text-white/70 text-sm mb-2"},"Original Path",-1)),Re("div",Nnt,[Re("div",jnt,[(zi(!0),Vi(Ou,null,sf(or(Ft.packet.original_path),(ei,jn)=>(zi(),Vi("div",{key:jn,class:"flex items-center"},[Re("div",Unt,[Re("div",Vnt,[Re("div",Hnt,aa(ei.length<=2?ei.toUpperCase():ei.slice(0,2).toUpperCase()),1)]),Re("div",Wnt," Node: "+aa(ei),1)]),jn<or(Ft.packet.original_path).length-1?(zi(),Vi("div",qnt,kn[19]||(kn[19]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M9 5l7 7-7 7"})],-1)]))):bs("",!0)]))),128))])])])):bs("",!0),Ft.packet.transmitted&&or(Ft.packet.forwarded_path).length>0?(zi(),Vi("div",Znt,[Re("div",$nt,[kn[22]||(kn[22]=nc(" Forwarded Path ",-1)),JSON.stringify(or(Ft.packet.original_path))!==JSON.stringify(or(Ft.packet.forwarded_path))?(zi(),Vi("svg",Gnt,kn[21]||(kn[21]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):bs("",!0),JSON.stringify(or(Ft.packet.original_path))!==JSON.stringify(or(Ft.packet.forwarded_path))?(zi(),Vi("span",Ynt,"(Modified)")):bs("",!0)]),Re("div",Knt,[Re("div",Xnt,[(zi(!0),Vi(Ou,null,sf(or(Ft.packet.forwarded_path),(ei,jn)=>(zi(),Vi("div",{key:jn,class:"flex items-center"},[Re("div",Jnt,[Re("div",{class:Xs(["relative px-3 py-2 bg-gradient-to-br from-orange-500/20 to-yellow-500/20 border border-orange-400/40 rounded-lg transform transition-all hover:scale-105",z.localHash&&ei===z.localHash?"bg-gradient-to-br from-yellow-400/30 to-orange-400/30 border-yellow-300 shadow-yellow-400/20 shadow-lg":"hover:border-orange-400/60"])},[Re("div",{class:Xs(["font-mono text-xs font-semibold",z.localHash&&ei===z.localHash?"text-yellow-200":"text-white/90"])},aa(ei.slice(0,2).toUpperCase()),3),z.localHash&&ei===z.localHash?(zi(),Vi("div",Qnt)):bs("",!0)],2),Re("div",tit,aa(ei),1)]),jn<or(Ft.packet.forwarded_path).length-1?(zi(),Vi("div",eit,kn[23]||(kn[23]=[Re("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)]))):bs("",!0)]))),128))])])])):bs("",!0)])])]),Re("div",rit,[kn[35]||(kn[35]=Re("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Re("div",{class:"w-2 h-2 rounded-full bg-green-400 mr-3"}),nc(" Signal & Processing ")],-1)),Re("div",nit,[Re("div",iit,[Re("div",ait,[kn[25]||(kn[25]=Re("div",{class:"text-white/70 text-xs mb-1"},"RSSI",-1)),Re("div",oit,aa(Ft.packet.rssi),1),kn[26]||(kn[26]=Re("div",{class:"text-white/60 text-xs"},"dBm",-1))]),Re("div",sit,[kn[27]||(kn[27]=Re("div",{class:"text-white/70 text-xs mb-1"},"SNR",-1)),Re("div",{class:Xs(["text-lg font-bold",Fr(Ft.packet.snr)])},aa(Ft.packet.snr.toFixed(1)),3),kn[28]||(kn[28]=Re("div",{class:"text-white/60 text-xs"},"dB",-1))]),Re("div",lit,[kn[29]||(kn[29]=Re("div",{class:"text-white/70 text-xs mb-1"},"Score",-1)),Re("div",uit,aa(Ft.packet.score.toFixed(3)),1)])]),Re("div",cit,[kn[30]||(kn[30]=Re("div",{class:"text-white/70 text-sm mb-2"},"Signal Quality",-1)),Re("div",hit,[Re("div",fit,[(zi(),Vi(Ou,null,sf(4,ei=>Re("div",{key:ei,class:Xs(["w-2 h-6 rounded-sm transition-all duration-300",ei<=zr(Ft.packet.snr).level?{"signal-excellent":"bg-green-400","signal-good":"bg-cyan-400","signal-fair":"bg-yellow-400","signal-poor":"bg-red-400"}[zr(Ft.packet.snr).className]:"bg-white/10"])},null,2)),64))]),Re("span",dit,aa(zr(Ft.packet.snr).className.replace("signal-","")),1)])]),Ft.packet.is_trace&&Ft.packet.path_snr_details&&Ft.packet.path_snr_details.length>0?(zi(),Vi("div",pit,[Re("div",mit,"Path SNR Details ("+aa(Ft.packet.path_snr_details.length)+" hops)",1),Re("div",git,[(zi(!0),Vi(Ou,null,sf(Ft.packet.path_snr_details,(ei,jn)=>(zi(),Vi("div",{key:jn,class:"flex items-center justify-between p-2 glass-card bg-black/20 rounded-[8px]"},[Re("div",vit,[Re("span",yit,aa(jn+1)+".",1),Re("span",{class:Xs(["font-mono text-xs text-white",z.localHash&&ei.hash===z.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},aa(ei.hash),3)]),Re("span",{class:Xs(["text-sm font-bold",Fr(ei.snr_db)])},aa(ei.snr_db.toFixed(1))+"dB ",3)]))),128))])])):bs("",!0),Re("div",xit,[Re("div",_it,[Re("div",bit,[kn[31]||(kn[31]=Re("span",{class:"text-white/70 text-sm"},"TX Delay",-1)),Re("span",wit,aa(Number(Ft.packet.tx_delay_ms)>0?Number(Ft.packet.tx_delay_ms).toFixed(1)+"ms":"-"),1)]),Re("div",kit,[kn[32]||(kn[32]=Re("span",{class:"text-white/70 text-sm"},"Transmitted",-1)),Re("span",{class:Xs(Ft.packet.transmitted?"text-green-400":"text-red-400")},aa(Ft.packet.transmitted?"Yes":"No"),3)])]),Re("div",Tit,[Re("div",Ait,[kn[33]||(kn[33]=Re("span",{class:"text-white/70 text-sm"},"Is Duplicate",-1)),Re("span",{class:Xs(Ft.packet.is_duplicate?"text-amber-400":"text-white/60")},aa(Ft.packet.is_duplicate?"Yes":"No"),3)]),Ft.packet.drop_reason?(zi(),Vi("div",Mit,[kn[34]||(kn[34]=Re("span",{class:"text-white/70 text-sm"},"Drop Reason",-1)),Re("span",Sit,aa(Ft.packet.drop_reason),1)])):bs("",!0)])])])])]),Re("div",Eit,[Re("button",{onClick:kn[1]||(kn[1]=ei=>j("close")),class:"px-6 py-2 bg-gradient-to-r from-cyan-500/20 to-cyan-400/20 hover:from-cyan-500/30 hover:to-cyan-400/30 border border-cyan-400/30 rounded-[10px] text-white transition-all duration-200 backdrop-blur-sm"}," Close ")])])])],32)):bs("",!0)]),_:1})]))}}),Lit=ld(Cit,[["__scopeId","data-v-3b73bfd6"]]),Pit={class:"glass-card rounded-[20px] p-6"},zit={class:"flex justify-between items-center mb-6"},Iit={class:"flex items-center gap-3"},Oit={class:"text-dark-text text-sm"},Dit=["title"],Fit={key:1,class:"text-primary text-sm"},Rit={key:2,class:"text-accent-red text-sm"},Bit={class:"flex items-center gap-3"},Nit={class:"flex flex-col"},jit=["value"],Uit={class:"flex flex-col"},Vit=["value"],Hit={class:"flex flex-col"},Wit={class:"flex flex-col"},qit=["disabled"],Zit={class:"space-y-4 overflow-hidden"},$it=["onClick"],Git={class:"grid grid-cols-12 gap-2 items-center"},Yit={class:"col-span-1 text-white text-sm"},Kit={class:"col-span-1 flex items-center gap-2"},Xit={class:"text-white text-xs"},Jit={class:"col-span-2"},Qit={class:"col-span-1 text-white text-xs"},tat={class:"col-span-2"},eat={class:"space-y-1"},rat={class:"inline-block px-2 py-0.5 rounded bg-[#588187] text-accent-cyan text-xs"},nat={class:"col-span-1 text-white text-xs"},iat={class:"col-span-1 text-white text-xs"},aat={class:"col-span-1 text-white text-xs"},oat={class:"col-span-1 text-white text-xs"},sat={class:"col-span-1"},lat={key:0,class:"text-accent-red text-[8px] italic truncate"},uat={key:0,class:"flex justify-between items-center mt-6 pt-4 border-t border-dark-border"},cat={class:"flex items-center gap-4"},hat={class:"text-dark-text text-sm"},fat={key:0,class:"flex items-center gap-2"},dat=["disabled"],pat={class:"text-dark-text text-xs"},mat={class:"flex items-center gap-2"},gat=["disabled"],vat={class:"flex items-center gap-1"},yat={key:1,class:"text-dark-text text-sm px-2"},xat=["onClick"],_at={key:2,class:"text-dark-text text-sm px-2"},bat=["disabled"],wat={key:1,class:"flex justify-center mt-6 pt-4 border-t border-dark-border"},kat={class:"flex items-center gap-4"},Tat={class:"text-dark-text text-sm"},Aat={class:"text-dark-text text-xs"},Mat={key:2,class:"flex justify-center mt-6 pt-4 border-t border-dark-border"},t2=10,oy=1e3,Sat=Th({name:"PacketTable",__name:"PacketTable",setup(d){const l=rw(),z=lo(1),j=lo(null),J=lo(100),mt=lo(!1),kt=lo(null),Dt=lo(!1),Gt=ss=>{kt.value=ss,Dt.value=!0},re=()=>{Dt.value=!1,kt.value=null},pe=lo("all"),Ne=lo("all"),or=lo(!1),_r=lo(null),Fr=["all","0","1","2","3","4","5","6","7","8","9"],zr=["all","1","2"],Wr=Yo(()=>{let ss=l.recentPackets;if(pe.value!=="all"){const mo=parseInt(pe.value);ss=ss.filter(ko=>ko.type===mo)}if(Ne.value!=="all"){const mo=parseInt(Ne.value);ss=ss.filter(ko=>ko.route===mo)}return or.value&&_r.value!==null&&(ss=ss.filter(mo=>mo.timestamp>=_r.value)),ss}),An=Yo(()=>{const ss=(z.value-1)*t2,mo=ss+t2;return Wr.value.slice(ss,mo)}),Ft=Yo(()=>Math.ceil(Wr.value.length/t2)),kn=Yo(()=>z.value===Ft.value),ei=Yo(()=>l.recentPackets.length>=J.value&&J.value<oy),jn=Yo(()=>kn.value&&ei.value&&!mt.value),ai=ss=>new Date(ss*1e3).toLocaleTimeString("en-US",{hour12:!1}),Qi=ss=>({0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE"})[ss]||`TYPE_${ss}`,Gi=ss=>({0:"T-Flood",1:"Flood",2:"Direct",3:"T-Direct"})[ss]||`Route ${ss}`,un=ss=>ss.transmitted?"text-accent-green":"text-primary",ia=ss=>ss.drop_reason?"Dropped":ss.transmitted?"Forward":"Received",fa=ss=>ss===1?"bg-[#223231] text-accent-cyan":"bg-secondary/30 text-secondary",Li=ss=>({0:"bg-primary",1:"bg-accent-green",2:"bg-secondary",3:"bg-accent-purple",4:"bg-accent-red",5:"bg-accent-cyan",6:"bg-primary",7:"bg-accent-purple",8:"bg-accent-green",9:"bg-secondary"})[ss]||"bg-gray-500",yi=ss=>({0:"border-l-primary",1:"border-l-accent-green",2:"border-l-secondary",3:"border-l-accent-purple",4:"border-l-accent-red",5:"border-l-accent-cyan",6:"border-l-primary",7:"border-l-accent-purple",8:"border-l-accent-green",9:"border-l-secondary"})[ss]||"border-l-gray-500",ra=()=>{pe.value="all",Ne.value="all",or.value=!1,_r.value=null,z.value=1},Da=()=>{or.value?(or.value=!1,_r.value=null):(or.value=!0,_r.value=Date.now()/1e3),z.value=1},Ni=Yo(()=>_r.value?new Date(_r.value*1e3).toLocaleTimeString():""),Ei=async ss=>{try{const mo=ss||J.value;await l.fetchRecentPackets({limit:mo})}catch(mo){console.error("Error fetching packet data:",mo)}},Va=async()=>{if(!(mt.value||J.value>=oy)){mt.value=!0;try{const ss=Math.min(J.value+200,oy);J.value=ss,await Ei(ss)}catch(ss){console.error("Error loading more records:",ss)}finally{mt.value=!1}}};return t0(async()=>{await Ei(),j.value=window.setInterval(Ei,5e3)}),dg(()=>{j.value&&clearInterval(j.value)}),(ss,mo)=>(zi(),Vi(Ou,null,[Re("div",Pit,[Re("div",zit,[Re("div",Iit,[mo[6]||(mo[6]=Re("h3",{class:"text-white text-xl font-semibold"},"Recent Packets",-1)),Re("span",Oit," ("+aa(Wr.value.length)+" of "+aa(Ju(l).recentPackets.length)+") ",1),or.value?(zi(),Vi("span",{key:0,class:"text-primary text-sm bg-primary/10 px-2 py-1 rounded-md border border-primary/20",title:`Filter activated at ${Ni.value}`}," Live Mode (since "+aa(Ni.value)+") ",9,Dit)):bs("",!0),Ju(l).isLoading?(zi(),Vi("span",Fit,"Loading...")):bs("",!0),Ju(l).error?(zi(),Vi("span",Rit,aa(Ju(l).error),1)):bs("",!0)]),Re("div",Bit,[Re("div",Nit,[mo[7]||(mo[7]=Re("label",{class:"text-dark-text text-xs mb-1"},"Type",-1)),$p(Re("select",{"onUpdate:modelValue":mo[0]||(mo[0]=ko=>pe.value=ko),class:"glass-card border border-dark-border rounded-[10px] px-3 py-2 text-white text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(zi(),Vi(Ou,null,sf(Fr,ko=>Re("option",{key:ko,value:ko,class:"bg-[#1A1E1F] text-white"},aa(ko==="all"?"All Types":`Type ${ko} (${Qi(parseInt(ko))})`),9,jit)),64))],512),[[iA,pe.value]])]),Re("div",Uit,[mo[8]||(mo[8]=Re("label",{class:"text-dark-text text-xs mb-1"},"Route",-1)),$p(Re("select",{"onUpdate:modelValue":mo[1]||(mo[1]=ko=>Ne.value=ko),class:"glass-card border border-dark-border rounded-[10px] px-3 py-2 text-white text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(zi(),Vi(Ou,null,sf(zr,ko=>Re("option",{key:ko,value:ko,class:"bg-[#1A1E1F] text-white"},aa(ko==="all"?"All Routes":`Route ${ko} (${Gi(parseInt(ko))})`),9,Vit)),64))],512),[[iA,Ne.value]])]),Re("div",Hit,[mo[9]||(mo[9]=Re("label",{class:"text-dark-text text-xs mb-1"},"Filter",-1)),Re("button",{onClick:Da,class:Xs(["glass-card border rounded-[10px] px-4 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 min-w-[120px]",{"border-primary bg-primary/10 text-primary":or.value,"border-dark-border text-dark-text hover:border-primary hover:text-white hover:bg-primary/5":!or.value}])},aa(or.value?"New Only":"Show New"),3)]),Re("div",Wit,[mo[10]||(mo[10]=Re("label",{class:"text-transparent text-xs mb-1"},".",-1)),Re("button",{onClick:ra,class:Xs(["glass-card border border-dark-border hover:border-primary rounded-[10px] px-4 py-2 text-dark-text hover:text-white text-sm transition-all duration-200 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20",{"opacity-50 cursor-not-allowed hover:border-dark-border hover:text-dark-text":pe.value==="all"&&Ne.value==="all"&&!or.value,"hover:bg-primary/10":pe.value!=="all"||Ne.value!=="all"||or.value}]),disabled:pe.value==="all"&&Ne.value==="all"&&!or.value}," Reset ",10,qit)])])]),mo[14]||(mo[14]=Ff('<div class="grid grid-cols-12 gap-2 pb-3 border-b border-dark-border text-dark-text text-xs uppercase mb-4" data-v-d363f6a5><div class="col-span-1" data-v-d363f6a5>Time</div><div class="col-span-1" data-v-d363f6a5>Type</div><div class="col-span-2" data-v-d363f6a5>Route</div><div class="col-span-1" data-v-d363f6a5>LEN</div><div class="col-span-2" data-v-d363f6a5>Path/Hashes</div><div class="col-span-1" data-v-d363f6a5>RSSI</div><div class="col-span-1" data-v-d363f6a5>SNR</div><div class="col-span-1" data-v-d363f6a5>Score</div><div class="col-span-1" data-v-d363f6a5>TX Delay</div><div class="col-span-1" data-v-d363f6a5>Status</div></div>',1)),Re("div",Zit,[gu(nK,{name:"packet-list",tag:"div",class:"space-y-4",appear:""},{default:Y2(()=>[(zi(!0),Vi(Ou,null,sf(An.value,(ko,pl)=>(zi(),Vi("div",{key:`${ko.packet_hash}_${ko.timestamp}_${pl}`,class:Xs(["packet-row border-b border-dark-border/50 pb-4 hover:bg-white/5 transition-colors duration-200 cursor-pointer rounded-[10px] p-2 border-l-4",yi(ko.type)]),onClick:fu=>Gt(ko)},[Re("div",Git,[Re("div",Yit,aa(ai(ko.timestamp)),1),Re("div",Kit,[Re("div",{class:Xs(["w-2 h-2 rounded-full",Li(ko.type)])},null,2),Re("span",Xit,aa(Qi(ko.type)),1)]),Re("div",Jit,[Re("span",{class:Xs(["inline-block px-2 py-1 rounded text-xs font-medium",fa(ko.route)])},aa(Gi(ko.route)),3)]),Re("div",Qit,aa(ko.length)+"B",1),Re("div",tat,[Re("div",eat,[Re("span",rat,aa(ko.src_hash?.slice(-4)||"????")+" → "+aa(ko.dst_hash?.slice(-4)||"????"),1)])]),Re("div",nat,aa(ko.rssi.toFixed(0)),1),Re("div",iat,aa(ko.snr.toFixed(1))+"dB",1),Re("div",aat,aa(ko.score.toFixed(2)),1),Re("div",oat,aa(Number(ko.tx_delay_ms)>0?Number(ko.tx_delay_ms).toFixed(1)+"ms":""),1),Re("div",sat,[Re("div",null,[Re("span",{class:Xs(["text-xs font-medium",un(ko)])},aa(ia(ko)),3),ko.drop_reason?(zi(),Vi("p",lat,aa(ko.drop_reason),1)):bs("",!0)])])])],10,$it))),128))]),_:1})]),Ft.value>1?(zi(),Vi("div",uat,[Re("div",cat,[Re("span",hat," Showing "+aa((z.value-1)*t2+1)+" - "+aa(Math.min(z.value*t2,Wr.value.length))+" of "+aa(Wr.value.length)+" packets ",1),jn.value?(zi(),Vi("div",fat,[mo[11]||(mo[11]=Re("span",{class:"text-dark-text text-xs"},"•",-1)),Re("button",{onClick:Va,disabled:mt.value,class:Xs(["glass-card border border-primary rounded-[8px] px-3 py-1.5 text-xs transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 hover:bg-primary/5",{"text-primary border-primary cursor-pointer":!mt.value,"text-dark-text border-dark-border cursor-not-allowed opacity-50":mt.value}])},aa(mt.value?"Loading...":`Load ${Math.min(200,oy-J.value)} more`),11,dat),Re("span",pat,"("+aa(J.value)+"/"+aa(oy)+" max)",1)])):bs("",!0)]),Re("div",mat,[Re("button",{onClick:mo[2]||(mo[2]=ko=>z.value=z.value-1),disabled:z.value<=1,class:Xs(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20",{"border-dark-border text-dark-text cursor-not-allowed opacity-50":z.value<=1,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":z.value>1}])}," Previous ",10,gat),Re("div",vat,[z.value>3?(zi(),Vi("button",{key:0,onClick:mo[3]||(mo[3]=ko=>z.value=1),class:"glass-card border border-dark-border hover:border-primary rounded-[8px] px-3 py-2 text-sm text-white hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"}," 1 ")):bs("",!0),z.value>4?(zi(),Vi("span",yat,"...")):bs("",!0),(zi(!0),Vi(Ou,null,sf(Array.from({length:Math.min(5,Ft.value)},(ko,pl)=>Math.max(1,Math.min(z.value-2,Ft.value-4))+pl).filter(ko=>ko<=Ft.value),ko=>(zi(),Vi("button",{key:ko,onClick:pl=>z.value=ko,class:Xs(["glass-card border rounded-[8px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20",{"border-primary bg-primary/10 text-primary":z.value===ko,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":z.value!==ko}])},aa(ko),11,xat))),128)),z.value<Ft.value-3?(zi(),Vi("span",_at,"...")):bs("",!0),z.value<Ft.value-2?(zi(),Vi("button",{key:3,onClick:mo[4]||(mo[4]=ko=>z.value=Ft.value),class:"glass-card border border-dark-border hover:border-primary rounded-[8px] px-3 py-2 text-sm text-white hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"},aa(Ft.value),1)):bs("",!0)]),Re("button",{onClick:mo[5]||(mo[5]=ko=>z.value=z.value+1),disabled:z.value>=Ft.value,class:Xs(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20",{"border-dark-border text-dark-text cursor-not-allowed opacity-50":z.value>=Ft.value,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":z.value<Ft.value}])}," Next ",10,bat)])])):ei.value&&!mt.value?(zi(),Vi("div",wat,[Re("div",kat,[Re("span",Tat," Showing "+aa(Wr.value.length)+" packets ",1),mo[12]||(mo[12]=Re("span",{class:"text-dark-text text-xs"},"•",-1)),Re("button",{onClick:Va,class:"glass-card border border-primary rounded-[8px] px-4 py-2 text-sm text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"}," Load "+aa(Math.min(200,oy-J.value))+" more records ",1),Re("span",Aat,"("+aa(J.value)+"/"+aa(oy)+" max)",1)])])):mt.value?(zi(),Vi("div",Mat,mo[13]||(mo[13]=[Re("div",{class:"flex items-center gap-2"},[Re("div",{class:"w-4 h-4 border-2 border-primary border-t-transparent rounded-full animate-spin"}),Re("span",{class:"text-primary text-sm"},"Loading more records...")],-1)]))):bs("",!0)]),gu(Lit,{packet:kt.value,isOpen:Dt.value,onClose:re},null,8,["packet","isOpen"])],64))}}),Eat=ld(Sat,[["__scopeId","data-v-d363f6a5"]]),Cat={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 mb-2"},Lat=Th({name:"DashboardView",__name:"Dashboard",setup(d){return(l,z)=>(zi(),Vi("div",null,[gu(grt),Re("div",Cat,[gu(Hrt),gu(Lrt)]),gu(Eat)]))}});function LO(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var c2={exports:{}};/* @preserve
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/var Pat=c2.exports,jL;function zat(){return jL||(jL=1,function(d,l){(function(z,j){j(l)})(Pat,function(z){var j="1.9.4";function J(ct){var Bt,me,Qe,Pr;for(me=1,Qe=arguments.length;me<Qe;me++){Pr=arguments[me];for(Bt in Pr)ct[Bt]=Pr[Bt]}return ct}var mt=Object.create||function(){function ct(){}return function(Bt){return ct.prototype=Bt,new ct}}();function kt(ct,Bt){var me=Array.prototype.slice;if(ct.bind)return ct.bind.apply(ct,me.call(arguments,1));var Qe=me.call(arguments,2);return function(){return ct.apply(Bt,Qe.length?Qe.concat(me.call(arguments)):arguments)}}var Dt=0;function Gt(ct){return"_leaflet_id"in ct||(ct._leaflet_id=++Dt),ct._leaflet_id}function re(ct,Bt,me){var Qe,Pr,Tn,ji;return ji=function(){Qe=!1,Pr&&(Tn.apply(me,Pr),Pr=!1)},Tn=function(){Qe?Pr=arguments:(ct.apply(me,arguments),setTimeout(ji,Bt),Qe=!0)},Tn}function pe(ct,Bt,me){var Qe=Bt[1],Pr=Bt[0],Tn=Qe-Pr;return ct===Qe&&me?ct:((ct-Pr)%Tn+Tn)%Tn+Pr}function Ne(){return!1}function or(ct,Bt){if(Bt===!1)return ct;var me=Math.pow(10,Bt===void 0?6:Bt);return Math.round(ct*me)/me}function _r(ct){return ct.trim?ct.trim():ct.replace(/^\s+|\s+$/g,"")}function Fr(ct){return _r(ct).split(/\s+/)}function zr(ct,Bt){Object.prototype.hasOwnProperty.call(ct,"options")||(ct.options=ct.options?mt(ct.options):{});for(var me in Bt)ct.options[me]=Bt[me];return ct.options}function Wr(ct,Bt,me){var Qe=[];for(var Pr in ct)Qe.push(encodeURIComponent(me?Pr.toUpperCase():Pr)+"="+encodeURIComponent(ct[Pr]));return(!Bt||Bt.indexOf("?")===-1?"?":"&")+Qe.join("&")}var An=/\{ *([\w_ -]+) *\}/g;function Ft(ct,Bt){return ct.replace(An,function(me,Qe){var Pr=Bt[Qe];if(Pr===void 0)throw new Error("No value provided for variable "+me);return typeof Pr=="function"&&(Pr=Pr(Bt)),Pr})}var kn=Array.isArray||function(ct){return Object.prototype.toString.call(ct)==="[object Array]"};function ei(ct,Bt){for(var me=0;me<ct.length;me++)if(ct[me]===Bt)return me;return-1}var jn="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function ai(ct){return window["webkit"+ct]||window["moz"+ct]||window["ms"+ct]}var Qi=0;function Gi(ct){var Bt=+new Date,me=Math.max(0,16-(Bt-Qi));return Qi=Bt+me,window.setTimeout(ct,me)}var un=window.requestAnimationFrame||ai("RequestAnimationFrame")||Gi,ia=window.cancelAnimationFrame||ai("CancelAnimationFrame")||ai("CancelRequestAnimationFrame")||function(ct){window.clearTimeout(ct)};function fa(ct,Bt,me){if(me&&un===Gi)ct.call(Bt);else return un.call(window,kt(ct,Bt))}function Li(ct){ct&&ia.call(window,ct)}var yi={__proto__:null,extend:J,create:mt,bind:kt,get lastId(){return Dt},stamp:Gt,throttle:re,wrapNum:pe,falseFn:Ne,formatNum:or,trim:_r,splitWords:Fr,setOptions:zr,getParamString:Wr,template:Ft,isArray:kn,indexOf:ei,emptyImageUrl:jn,requestFn:un,cancelFn:ia,requestAnimFrame:fa,cancelAnimFrame:Li};function ra(){}ra.extend=function(ct){var Bt=function(){zr(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},me=Bt.__super__=this.prototype,Qe=mt(me);Qe.constructor=Bt,Bt.prototype=Qe;for(var Pr in this)Object.prototype.hasOwnProperty.call(this,Pr)&&Pr!=="prototype"&&Pr!=="__super__"&&(Bt[Pr]=this[Pr]);return ct.statics&&J(Bt,ct.statics),ct.includes&&(Da(ct.includes),J.apply(null,[Qe].concat(ct.includes))),J(Qe,ct),delete Qe.statics,delete Qe.includes,Qe.options&&(Qe.options=me.options?mt(me.options):{},J(Qe.options,ct.options)),Qe._initHooks=[],Qe.callInitHooks=function(){if(!this._initHooksCalled){me.callInitHooks&&me.callInitHooks.call(this),this._initHooksCalled=!0;for(var Tn=0,ji=Qe._initHooks.length;Tn<ji;Tn++)Qe._initHooks[Tn].call(this)}},Bt},ra.include=function(ct){var Bt=this.prototype.options;return J(this.prototype,ct),ct.options&&(this.prototype.options=Bt,this.mergeOptions(ct.options)),this},ra.mergeOptions=function(ct){return J(this.prototype.options,ct),this},ra.addInitHook=function(ct){var Bt=Array.prototype.slice.call(arguments,1),me=typeof ct=="function"?ct:function(){this[ct].apply(this,Bt)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(me),this};function Da(ct){if(!(typeof L>"u"||!L||!L.Mixin)){ct=kn(ct)?ct:[ct];for(var Bt=0;Bt<ct.length;Bt++)ct[Bt]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Ni={on:function(ct,Bt,me){if(typeof ct=="object")for(var Qe in ct)this._on(Qe,ct[Qe],Bt);else{ct=Fr(ct);for(var Pr=0,Tn=ct.length;Pr<Tn;Pr++)this._on(ct[Pr],Bt,me)}return this},off:function(ct,Bt,me){if(!arguments.length)delete this._events;else if(typeof ct=="object")for(var Qe in ct)this._off(Qe,ct[Qe],Bt);else{ct=Fr(ct);for(var Pr=arguments.length===1,Tn=0,ji=ct.length;Tn<ji;Tn++)Pr?this._off(ct[Tn]):this._off(ct[Tn],Bt,me)}return this},_on:function(ct,Bt,me,Qe){if(typeof Bt!="function"){console.warn("wrong listener type: "+typeof Bt);return}if(this._listens(ct,Bt,me)===!1){me===this&&(me=void 0);var Pr={fn:Bt,ctx:me};Qe&&(Pr.once=!0),this._events=this._events||{},this._events[ct]=this._events[ct]||[],this._events[ct].push(Pr)}},_off:function(ct,Bt,me){var Qe,Pr,Tn;if(this._events&&(Qe=this._events[ct],!!Qe)){if(arguments.length===1){if(this._firingCount)for(Pr=0,Tn=Qe.length;Pr<Tn;Pr++)Qe[Pr].fn=Ne;delete this._events[ct];return}if(typeof Bt!="function"){console.warn("wrong listener type: "+typeof Bt);return}var ji=this._listens(ct,Bt,me);if(ji!==!1){var Na=Qe[ji];this._firingCount&&(Na.fn=Ne,this._events[ct]=Qe=Qe.slice()),Qe.splice(ji,1)}}},fire:function(ct,Bt,me){if(!this.listens(ct,me))return this;var Qe=J({},Bt,{type:ct,target:this,sourceTarget:Bt&&Bt.sourceTarget||this});if(this._events){var Pr=this._events[ct];if(Pr){this._firingCount=this._firingCount+1||1;for(var Tn=0,ji=Pr.length;Tn<ji;Tn++){var Na=Pr[Tn],Ya=Na.fn;Na.once&&this.off(ct,Ya,Na.ctx),Ya.call(Na.ctx||this,Qe)}this._firingCount--}}return me&&this._propagateEvent(Qe),this},listens:function(ct,Bt,me,Qe){typeof ct!="string"&&console.warn('"string" type argument expected');var Pr=Bt;typeof Bt!="function"&&(Qe=!!Bt,Pr=void 0,me=void 0);var Tn=this._events&&this._events[ct];if(Tn&&Tn.length&&this._listens(ct,Pr,me)!==!1)return!0;if(Qe){for(var ji in this._eventParents)if(this._eventParents[ji].listens(ct,Bt,me,Qe))return!0}return!1},_listens:function(ct,Bt,me){if(!this._events)return!1;var Qe=this._events[ct]||[];if(!Bt)return!!Qe.length;me===this&&(me=void 0);for(var Pr=0,Tn=Qe.length;Pr<Tn;Pr++)if(Qe[Pr].fn===Bt&&Qe[Pr].ctx===me)return Pr;return!1},once:function(ct,Bt,me){if(typeof ct=="object")for(var Qe in ct)this._on(Qe,ct[Qe],Bt,!0);else{ct=Fr(ct);for(var Pr=0,Tn=ct.length;Pr<Tn;Pr++)this._on(ct[Pr],Bt,me,!0)}return this},addEventParent:function(ct){return this._eventParents=this._eventParents||{},this._eventParents[Gt(ct)]=ct,this},removeEventParent:function(ct){return this._eventParents&&delete this._eventParents[Gt(ct)],this},_propagateEvent:function(ct){for(var Bt in this._eventParents)this._eventParents[Bt].fire(ct.type,J({layer:ct.target,propagatedFrom:ct.target},ct),!0)}};Ni.addEventListener=Ni.on,Ni.removeEventListener=Ni.clearAllEventListeners=Ni.off,Ni.addOneTimeEventListener=Ni.once,Ni.fireEvent=Ni.fire,Ni.hasEventListeners=Ni.listens;var Ei=ra.extend(Ni);function Va(ct,Bt,me){this.x=me?Math.round(ct):ct,this.y=me?Math.round(Bt):Bt}var ss=Math.trunc||function(ct){return ct>0?Math.floor(ct):Math.ceil(ct)};Va.prototype={clone:function(){return new Va(this.x,this.y)},add:function(ct){return this.clone()._add(mo(ct))},_add:function(ct){return this.x+=ct.x,this.y+=ct.y,this},subtract:function(ct){return this.clone()._subtract(mo(ct))},_subtract:function(ct){return this.x-=ct.x,this.y-=ct.y,this},divideBy:function(ct){return this.clone()._divideBy(ct)},_divideBy:function(ct){return this.x/=ct,this.y/=ct,this},multiplyBy:function(ct){return this.clone()._multiplyBy(ct)},_multiplyBy:function(ct){return this.x*=ct,this.y*=ct,this},scaleBy:function(ct){return new Va(this.x*ct.x,this.y*ct.y)},unscaleBy:function(ct){return new Va(this.x/ct.x,this.y/ct.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=ss(this.x),this.y=ss(this.y),this},distanceTo:function(ct){ct=mo(ct);var Bt=ct.x-this.x,me=ct.y-this.y;return Math.sqrt(Bt*Bt+me*me)},equals:function(ct){return ct=mo(ct),ct.x===this.x&&ct.y===this.y},contains:function(ct){return ct=mo(ct),Math.abs(ct.x)<=Math.abs(this.x)&&Math.abs(ct.y)<=Math.abs(this.y)},toString:function(){return"Point("+or(this.x)+", "+or(this.y)+")"}};function mo(ct,Bt,me){return ct instanceof Va?ct:kn(ct)?new Va(ct[0],ct[1]):ct==null?ct:typeof ct=="object"&&"x"in ct&&"y"in ct?new Va(ct.x,ct.y):new Va(ct,Bt,me)}function ko(ct,Bt){if(ct)for(var me=Bt?[ct,Bt]:ct,Qe=0,Pr=me.length;Qe<Pr;Qe++)this.extend(me[Qe])}ko.prototype={extend:function(ct){var Bt,me;if(!ct)return this;if(ct instanceof Va||typeof ct[0]=="number"||"x"in ct)Bt=me=mo(ct);else if(ct=pl(ct),Bt=ct.min,me=ct.max,!Bt||!me)return this;return!this.min&&!this.max?(this.min=Bt.clone(),this.max=me.clone()):(this.min.x=Math.min(Bt.x,this.min.x),this.max.x=Math.max(me.x,this.max.x),this.min.y=Math.min(Bt.y,this.min.y),this.max.y=Math.max(me.y,this.max.y)),this},getCenter:function(ct){return mo((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,ct)},getBottomLeft:function(){return mo(this.min.x,this.max.y)},getTopRight:function(){return mo(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(ct){var Bt,me;return typeof ct[0]=="number"||ct instanceof Va?ct=mo(ct):ct=pl(ct),ct instanceof ko?(Bt=ct.min,me=ct.max):Bt=me=ct,Bt.x>=this.min.x&&me.x<=this.max.x&&Bt.y>=this.min.y&&me.y<=this.max.y},intersects:function(ct){ct=pl(ct);var Bt=this.min,me=this.max,Qe=ct.min,Pr=ct.max,Tn=Pr.x>=Bt.x&&Qe.x<=me.x,ji=Pr.y>=Bt.y&&Qe.y<=me.y;return Tn&&ji},overlaps:function(ct){ct=pl(ct);var Bt=this.min,me=this.max,Qe=ct.min,Pr=ct.max,Tn=Pr.x>Bt.x&&Qe.x<me.x,ji=Pr.y>Bt.y&&Qe.y<me.y;return Tn&&ji},isValid:function(){return!!(this.min&&this.max)},pad:function(ct){var Bt=this.min,me=this.max,Qe=Math.abs(Bt.x-me.x)*ct,Pr=Math.abs(Bt.y-me.y)*ct;return pl(mo(Bt.x-Qe,Bt.y-Pr),mo(me.x+Qe,me.y+Pr))},equals:function(ct){return ct?(ct=pl(ct),this.min.equals(ct.getTopLeft())&&this.max.equals(ct.getBottomRight())):!1}};function pl(ct,Bt){return!ct||ct instanceof ko?ct:new ko(ct,Bt)}function fu(ct,Bt){if(ct)for(var me=Bt?[ct,Bt]:ct,Qe=0,Pr=me.length;Qe<Pr;Qe++)this.extend(me[Qe])}fu.prototype={extend:function(ct){var Bt=this._southWest,me=this._northEast,Qe,Pr;if(ct instanceof fo)Qe=ct,Pr=ct;else if(ct instanceof fu){if(Qe=ct._southWest,Pr=ct._northEast,!Qe||!Pr)return this}else return ct?this.extend(Ta(ct)||qo(ct)):this;return!Bt&&!me?(this._southWest=new fo(Qe.lat,Qe.lng),this._northEast=new fo(Pr.lat,Pr.lng)):(Bt.lat=Math.min(Qe.lat,Bt.lat),Bt.lng=Math.min(Qe.lng,Bt.lng),me.lat=Math.max(Pr.lat,me.lat),me.lng=Math.max(Pr.lng,me.lng)),this},pad:function(ct){var Bt=this._southWest,me=this._northEast,Qe=Math.abs(Bt.lat-me.lat)*ct,Pr=Math.abs(Bt.lng-me.lng)*ct;return new fu(new fo(Bt.lat-Qe,Bt.lng-Pr),new fo(me.lat+Qe,me.lng+Pr))},getCenter:function(){return new fo((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new fo(this.getNorth(),this.getWest())},getSouthEast:function(){return new fo(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(ct){typeof ct[0]=="number"||ct instanceof fo||"lat"in ct?ct=Ta(ct):ct=qo(ct);var Bt=this._southWest,me=this._northEast,Qe,Pr;return ct instanceof fu?(Qe=ct.getSouthWest(),Pr=ct.getNorthEast()):Qe=Pr=ct,Qe.lat>=Bt.lat&&Pr.lat<=me.lat&&Qe.lng>=Bt.lng&&Pr.lng<=me.lng},intersects:function(ct){ct=qo(ct);var Bt=this._southWest,me=this._northEast,Qe=ct.getSouthWest(),Pr=ct.getNorthEast(),Tn=Pr.lat>=Bt.lat&&Qe.lat<=me.lat,ji=Pr.lng>=Bt.lng&&Qe.lng<=me.lng;return Tn&&ji},overlaps:function(ct){ct=qo(ct);var Bt=this._southWest,me=this._northEast,Qe=ct.getSouthWest(),Pr=ct.getNorthEast(),Tn=Pr.lat>Bt.lat&&Qe.lat<me.lat,ji=Pr.lng>Bt.lng&&Qe.lng<me.lng;return Tn&&ji},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(ct,Bt){return ct?(ct=qo(ct),this._southWest.equals(ct.getSouthWest(),Bt)&&this._northEast.equals(ct.getNorthEast(),Bt)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function qo(ct,Bt){return ct instanceof fu?ct:new fu(ct,Bt)}function fo(ct,Bt,me){if(isNaN(ct)||isNaN(Bt))throw new Error("Invalid LatLng object: ("+ct+", "+Bt+")");this.lat=+ct,this.lng=+Bt,me!==void 0&&(this.alt=+me)}fo.prototype={equals:function(ct,Bt){if(!ct)return!1;ct=Ta(ct);var me=Math.max(Math.abs(this.lat-ct.lat),Math.abs(this.lng-ct.lng));return me<=(Bt===void 0?1e-9:Bt)},toString:function(ct){return"LatLng("+or(this.lat,ct)+", "+or(this.lng,ct)+")"},distanceTo:function(ct){return go.distance(this,Ta(ct))},wrap:function(){return go.wrapLatLng(this)},toBounds:function(ct){var Bt=180*ct/40075017,me=Bt/Math.cos(Math.PI/180*this.lat);return qo([this.lat-Bt,this.lng-me],[this.lat+Bt,this.lng+me])},clone:function(){return new fo(this.lat,this.lng,this.alt)}};function Ta(ct,Bt,me){return ct instanceof fo?ct:kn(ct)&&typeof ct[0]!="object"?ct.length===3?new fo(ct[0],ct[1],ct[2]):ct.length===2?new fo(ct[0],ct[1]):null:ct==null?ct:typeof ct=="object"&&"lat"in ct?new fo(ct.lat,"lng"in ct?ct.lng:ct.lon,ct.alt):Bt===void 0?null:new fo(ct,Bt,me)}var Ea={latLngToPoint:function(ct,Bt){var me=this.projection.project(ct),Qe=this.scale(Bt);return this.transformation._transform(me,Qe)},pointToLatLng:function(ct,Bt){var me=this.scale(Bt),Qe=this.transformation.untransform(ct,me);return this.projection.unproject(Qe)},project:function(ct){return this.projection.project(ct)},unproject:function(ct){return this.projection.unproject(ct)},scale:function(ct){return 256*Math.pow(2,ct)},zoom:function(ct){return Math.log(ct/256)/Math.LN2},getProjectedBounds:function(ct){if(this.infinite)return null;var Bt=this.projection.bounds,me=this.scale(ct),Qe=this.transformation.transform(Bt.min,me),Pr=this.transformation.transform(Bt.max,me);return new ko(Qe,Pr)},infinite:!1,wrapLatLng:function(ct){var Bt=this.wrapLng?pe(ct.lng,this.wrapLng,!0):ct.lng,me=this.wrapLat?pe(ct.lat,this.wrapLat,!0):ct.lat,Qe=ct.alt;return new fo(me,Bt,Qe)},wrapLatLngBounds:function(ct){var Bt=ct.getCenter(),me=this.wrapLatLng(Bt),Qe=Bt.lat-me.lat,Pr=Bt.lng-me.lng;if(Qe===0&&Pr===0)return ct;var Tn=ct.getSouthWest(),ji=ct.getNorthEast(),Na=new fo(Tn.lat-Qe,Tn.lng-Pr),Ya=new fo(ji.lat-Qe,ji.lng-Pr);return new fu(Na,Ya)}},go=J({},Ea,{wrapLng:[-180,180],R:6371e3,distance:function(ct,Bt){var me=Math.PI/180,Qe=ct.lat*me,Pr=Bt.lat*me,Tn=Math.sin((Bt.lat-ct.lat)*me/2),ji=Math.sin((Bt.lng-ct.lng)*me/2),Na=Tn*Tn+Math.cos(Qe)*Math.cos(Pr)*ji*ji,Ya=2*Math.atan2(Math.sqrt(Na),Math.sqrt(1-Na));return this.R*Ya}}),Ao=6378137,Ps={R:Ao,MAX_LATITUDE:85.0511287798,project:function(ct){var Bt=Math.PI/180,me=this.MAX_LATITUDE,Qe=Math.max(Math.min(me,ct.lat),-me),Pr=Math.sin(Qe*Bt);return new Va(this.R*ct.lng*Bt,this.R*Math.log((1+Pr)/(1-Pr))/2)},unproject:function(ct){var Bt=180/Math.PI;return new fo((2*Math.atan(Math.exp(ct.y/this.R))-Math.PI/2)*Bt,ct.x*Bt/this.R)},bounds:function(){var ct=Ao*Math.PI;return new ko([-ct,-ct],[ct,ct])}()};function $o(ct,Bt,me,Qe){if(kn(ct)){this._a=ct[0],this._b=ct[1],this._c=ct[2],this._d=ct[3];return}this._a=ct,this._b=Bt,this._c=me,this._d=Qe}$o.prototype={transform:function(ct,Bt){return this._transform(ct.clone(),Bt)},_transform:function(ct,Bt){return Bt=Bt||1,ct.x=Bt*(this._a*ct.x+this._b),ct.y=Bt*(this._c*ct.y+this._d),ct},untransform:function(ct,Bt){return Bt=Bt||1,new Va((ct.x/Bt-this._b)/this._a,(ct.y/Bt-this._d)/this._c)}};function gi(ct,Bt,me,Qe){return new $o(ct,Bt,me,Qe)}var bi=J({},go,{code:"EPSG:3857",projection:Ps,transformation:function(){var ct=.5/(Math.PI*Ps.R);return gi(ct,.5,-ct,.5)}()}),li=J({},bi,{code:"EPSG:900913"});function co(ct){return document.createElementNS("http://www.w3.org/2000/svg",ct)}function vo(ct,Bt){var me="",Qe,Pr,Tn,ji,Na,Ya;for(Qe=0,Tn=ct.length;Qe<Tn;Qe++){for(Na=ct[Qe],Pr=0,ji=Na.length;Pr<ji;Pr++)Ya=Na[Pr],me+=(Pr?"L":"M")+Ya.x+" "+Ya.y;me+=Bt?El.svg?"z":"x":""}return me||"M0 0"}var yo=document.documentElement.style,ms="ActiveXObject"in window,ns=ms&&!document.addEventListener,Ko="msLaunchUri"in navigator&&!("documentMode"in document),Oo=r0("webkit"),wl=r0("android"),ws=r0("android 2")||r0("android 3"),Il=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),du=wl&&r0("Google")&&Il<537&&!("AudioNode"in window),Hu=!!window.opera,Fc=!Ko&&r0("chrome"),kc=r0("gecko")&&!Oo&&!Hu&&!ms,Vd=!Fc&&r0("safari"),kd=r0("phantom"),e0="OTransition"in yo,d0=navigator.platform.indexOf("Win")===0,Pm=ms&&"transition"in yo,uv="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ws,sp="MozPerspective"in yo,p0=!window.L_DISABLE_3D&&(Pm||uv||sp)&&!e0&&!kd,zm=typeof orientation<"u"||r0("mobile"),zy=zm&&Oo,K4=zm&&uv,sw=!window.PointerEvent&&window.MSPointerEvent,lw=!!(window.PointerEvent||sw),uw="ontouchstart"in window||!!window.TouchEvent,X4=!window.L_NO_TOUCH&&(uw||lw),J4=zm&&Hu,Q4=zm&&kc,t6=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,e6=function(){var ct=!1;try{var Bt=Object.defineProperty({},"passive",{get:function(){ct=!0}});window.addEventListener("testPassiveEventSupport",Ne,Bt),window.removeEventListener("testPassiveEventSupport",Ne,Bt)}catch{}return ct}(),r6=function(){return!!document.createElement("canvas").getContext}(),b_=!!(document.createElementNS&&co("svg").createSVGRect),n6=!!b_&&function(){var ct=document.createElement("div");return ct.innerHTML="<svg/>",(ct.firstChild&&ct.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),i6=!b_&&function(){try{var ct=document.createElement("div");ct.innerHTML='<v:shape adj="1"/>';var Bt=ct.firstChild;return Bt.style.behavior="url(#default#VML)",Bt&&typeof Bt.adj=="object"}catch{return!1}}(),cw=navigator.platform.indexOf("Mac")===0,w_=navigator.platform.indexOf("Linux")===0;function r0(ct){return navigator.userAgent.toLowerCase().indexOf(ct)>=0}var El={ie:ms,ielt9:ns,edge:Ko,webkit:Oo,android:wl,android23:ws,androidStock:du,opera:Hu,chrome:Fc,gecko:kc,safari:Vd,phantom:kd,opera12:e0,win:d0,ie3d:Pm,webkit3d:uv,gecko3d:sp,any3d:p0,mobile:zm,mobileWebkit:zy,mobileWebkit3d:K4,msPointer:sw,pointer:lw,touch:X4,touchNative:uw,mobileOpera:J4,mobileGecko:Q4,retina:t6,passiveEvents:e6,canvas:r6,svg:b_,vml:i6,inlineSvg:n6,mac:cw,linux:w_},Yc=El.msPointer?"MSPointerDown":"pointerdown",Td=El.msPointer?"MSPointerMove":"pointermove",k_=El.msPointer?"MSPointerUp":"pointerup",$u=El.msPointer?"MSPointerCancel":"pointercancel",y1={touchstart:Yc,touchmove:Td,touchend:k_,touchcancel:$u},hw={touchstart:s6,touchmove:G0,touchend:G0,touchcancel:G0},cv={},Iy=!1;function x1(ct,Bt,me){return Bt==="touchstart"&&T_(),hw[Bt]?(me=hw[Bt].bind(this,me),ct.addEventListener(y1[Bt],me,!1),me):(console.warn("wrong event specified:",Bt),Ne)}function a6(ct,Bt,me){if(!y1[Bt]){console.warn("wrong event specified:",Bt);return}ct.removeEventListener(y1[Bt],me,!1)}function Xo(ct){cv[ct.pointerId]=ct}function o6(ct){cv[ct.pointerId]&&(cv[ct.pointerId]=ct)}function _1(ct){delete cv[ct.pointerId]}function T_(){Iy||(document.addEventListener(Yc,Xo,!0),document.addEventListener(Td,o6,!0),document.addEventListener(k_,_1,!0),document.addEventListener($u,_1,!0),Iy=!0)}function G0(ct,Bt){if(Bt.pointerType!==(Bt.MSPOINTER_TYPE_MOUSE||"mouse")){Bt.touches=[];for(var me in cv)Bt.touches.push(cv[me]);Bt.changedTouches=[Bt],ct(Bt)}}function s6(ct,Bt){Bt.MSPOINTER_TYPE_TOUCH&&Bt.pointerType===Bt.MSPOINTER_TYPE_TOUCH&&mc(Bt),G0(ct,Bt)}function l6(ct){var Bt={},me,Qe;for(Qe in ct)me=ct[Qe],Bt[Qe]=me&&me.bind?me.bind(ct):me;return ct=Bt,Bt.type="dblclick",Bt.detail=2,Bt.isTrusted=!1,Bt._simulated=!0,Bt}var u6=200;function c6(ct,Bt){ct.addEventListener("dblclick",Bt);var me=0,Qe;function Pr(Tn){if(Tn.detail!==1){Qe=Tn.detail;return}if(!(Tn.pointerType==="mouse"||Tn.sourceCapabilities&&!Tn.sourceCapabilities.firesTouchEvents)){var ji=mw(Tn);if(!(ji.some(function(Ya){return Ya instanceof HTMLLabelElement&&Ya.attributes.for})&&!ji.some(function(Ya){return Ya instanceof HTMLInputElement||Ya instanceof HTMLSelectElement}))){var Na=Date.now();Na-me<=u6?(Qe++,Qe===2&&Bt(l6(Tn))):Qe=1,me=Na}}}return ct.addEventListener("click",Pr),{dblclick:Bt,simDblclick:Pr}}function A_(ct,Bt){ct.removeEventListener("dblclick",Bt.dblclick),ct.removeEventListener("click",Bt.simDblclick)}var M_=Dm(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),b1=Dm(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),fw=b1==="webkitTransition"||b1==="OTransition"?b1+"End":"transitionend";function dw(ct){return typeof ct=="string"?document.getElementById(ct):ct}function w1(ct,Bt){var me=ct.style[Bt]||ct.currentStyle&&ct.currentStyle[Bt];if((!me||me==="auto")&&document.defaultView){var Qe=document.defaultView.getComputedStyle(ct,null);me=Qe?Qe[Bt]:null}return me==="auto"?null:me}function Cc(ct,Bt,me){var Qe=document.createElement(ct);return Qe.className=Bt||"",me&&me.appendChild(Qe),Qe}function Tf(ct){var Bt=ct.parentNode;Bt&&Bt.removeChild(ct)}function Oy(ct){for(;ct.firstChild;)ct.removeChild(ct.firstChild)}function hv(ct){var Bt=ct.parentNode;Bt&&Bt.lastChild!==ct&&Bt.appendChild(ct)}function bn(ct){var Bt=ct.parentNode;Bt&&Bt.firstChild!==ct&&Bt.insertBefore(ct,Bt.firstChild)}function S_(ct,Bt){if(ct.classList!==void 0)return ct.classList.contains(Bt);var me=Om(ct);return me.length>0&&new RegExp("(^|\\s)"+Bt+"(\\s|$)").test(me)}function Wu(ct,Bt){if(ct.classList!==void 0)for(var me=Fr(Bt),Qe=0,Pr=me.length;Qe<Pr;Qe++)ct.classList.add(me[Qe]);else if(!S_(ct,Bt)){var Tn=Om(ct);Im(ct,(Tn?Tn+" ":"")+Bt)}}function Rf(ct,Bt){ct.classList!==void 0?ct.classList.remove(Bt):Im(ct,_r((" "+Om(ct)+" ").replace(" "+Bt+" "," ")))}function Im(ct,Bt){ct.className.baseVal===void 0?ct.className=Bt:ct.className.baseVal=Bt}function Om(ct){return ct.correspondingElement&&(ct=ct.correspondingElement),ct.className.baseVal===void 0?ct.className:ct.className.baseVal}function m0(ct,Bt){"opacity"in ct.style?ct.style.opacity=Bt:"filter"in ct.style&&pw(ct,Bt)}function pw(ct,Bt){var me=!1,Qe="DXImageTransform.Microsoft.Alpha";try{me=ct.filters.item(Qe)}catch{if(Bt===1)return}Bt=Math.round(Bt*100),me?(me.Enabled=Bt!==100,me.Opacity=Bt):ct.style.filter+=" progid:"+Qe+"(opacity="+Bt+")"}function Dm(ct){for(var Bt=document.documentElement.style,me=0;me<ct.length;me++)if(ct[me]in Bt)return ct[me];return!1}function pu(ct,Bt,me){var Qe=Bt||new Va(0,0);ct.style[M_]=(El.ie3d?"translate("+Qe.x+"px,"+Qe.y+"px)":"translate3d("+Qe.x+"px,"+Qe.y+"px,0)")+(me?" scale("+me+")":"")}function ic(ct,Bt){ct._leaflet_pos=Bt,El.any3d?pu(ct,Bt):(ct.style.left=Bt.x+"px",ct.style.top=Bt.y+"px")}function Rc(ct){return ct._leaflet_pos||new Va(0,0)}var C0,pg,ud;if("onselectstart"in document)C0=function(){Pu(window,"selectstart",mc)},pg=function(){Bh(window,"selectstart",mc)};else{var k1=Dm(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);C0=function(){if(k1){var ct=document.documentElement.style;ud=ct[k1],ct[k1]="none"}},pg=function(){k1&&(document.documentElement.style[k1]=ud,ud=void 0)}}function Kc(){Pu(window,"dragstart",mc)}function Op(){Bh(window,"dragstart",mc)}var Af,tc;function Hd(ct){for(;ct.tabIndex===-1;)ct=ct.parentNode;ct.style&&(fh(),Af=ct,tc=ct.style.outlineStyle,ct.style.outlineStyle="none",Pu(window,"keydown",fh))}function fh(){Af&&(Af.style.outlineStyle=tc,Af=void 0,tc=void 0,Bh(window,"keydown",fh))}function Ad(ct){do ct=ct.parentNode;while((!ct.offsetWidth||!ct.offsetHeight)&&ct!==document.body);return ct}function T1(ct){var Bt=ct.getBoundingClientRect();return{x:Bt.width/ct.offsetWidth||1,y:Bt.height/ct.offsetHeight||1,boundingClientRect:Bt}}var Tc={__proto__:null,TRANSFORM:M_,TRANSITION:b1,TRANSITION_END:fw,get:dw,getStyle:w1,create:Cc,remove:Tf,empty:Oy,toFront:hv,toBack:bn,hasClass:S_,addClass:Wu,removeClass:Rf,setClass:Im,getClass:Om,setOpacity:m0,testProp:Dm,setTransform:pu,setPosition:ic,getPosition:Rc,get disableTextSelection(){return C0},get enableTextSelection(){return pg},disableImageDrag:Kc,enableImageDrag:Op,preventOutline:Hd,restoreOutline:fh,getSizedParentNode:Ad,getScale:T1};function Pu(ct,Bt,me,Qe){if(Bt&&typeof Bt=="object")for(var Pr in Bt)Dy(ct,Pr,Bt[Pr],me);else{Bt=Fr(Bt);for(var Tn=0,ji=Bt.length;Tn<ji;Tn++)Dy(ct,Bt[Tn],me,Qe)}return this}var L0="_leaflet_events";function Bh(ct,Bt,me,Qe){if(arguments.length===1)mg(ct),delete ct[L0];else if(Bt&&typeof Bt=="object")for(var Pr in Bt)Md(ct,Pr,Bt[Pr],me);else if(Bt=Fr(Bt),arguments.length===2)mg(ct,function(Na){return ei(Bt,Na)!==-1});else for(var Tn=0,ji=Bt.length;Tn<ji;Tn++)Md(ct,Bt[Tn],me,Qe);return this}function mg(ct,Bt){for(var me in ct[L0]){var Qe=me.split(/\d/)[0];(!Bt||Bt(Qe))&&Md(ct,Qe,null,null,me)}}var gg={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Dy(ct,Bt,me,Qe){var Pr=Bt+Gt(me)+(Qe?"_"+Gt(Qe):"");if(ct[L0]&&ct[L0][Pr])return this;var Tn=function(Na){return me.call(Qe||ct,Na||window.event)},ji=Tn;!El.touchNative&&El.pointer&&Bt.indexOf("touch")===0?Tn=x1(ct,Bt,Tn):El.touch&&Bt==="dblclick"?Tn=c6(ct,Tn):"addEventListener"in ct?Bt==="touchstart"||Bt==="touchmove"||Bt==="wheel"||Bt==="mousewheel"?ct.addEventListener(gg[Bt]||Bt,Tn,El.passiveEvents?{passive:!1}:!1):Bt==="mouseenter"||Bt==="mouseleave"?(Tn=function(Na){Na=Na||window.event,yg(ct,Na)&&ji(Na)},ct.addEventListener(gg[Bt],Tn,!1)):ct.addEventListener(Bt,ji,!1):ct.attachEvent("on"+Bt,Tn),ct[L0]=ct[L0]||{},ct[L0][Pr]=Tn}function Md(ct,Bt,me,Qe,Pr){Pr=Pr||Bt+Gt(me)+(Qe?"_"+Gt(Qe):"");var Tn=ct[L0]&&ct[L0][Pr];if(!Tn)return this;!El.touchNative&&El.pointer&&Bt.indexOf("touch")===0?a6(ct,Bt,Tn):El.touch&&Bt==="dblclick"?A_(ct,Tn):"removeEventListener"in ct?ct.removeEventListener(gg[Bt]||Bt,Tn,!1):ct.detachEvent("on"+Bt,Tn),ct[L0][Pr]=null}function n0(ct){return ct.stopPropagation?ct.stopPropagation():ct.originalEvent?ct.originalEvent._stopped=!0:ct.cancelBubble=!0,this}function dm(ct){return Dy(ct,"wheel",n0),this}function fv(ct){return Pu(ct,"mousedown touchstart dblclick contextmenu",n0),ct._leaflet_disable_click=!0,this}function mc(ct){return ct.preventDefault?ct.preventDefault():ct.returnValue=!1,this}function vg(ct){return mc(ct),n0(ct),this}function mw(ct){if(ct.composedPath)return ct.composedPath();for(var Bt=[],me=ct.target;me;)Bt.push(me),me=me.parentNode;return Bt}function Jd(ct,Bt){if(!Bt)return new Va(ct.clientX,ct.clientY);var me=T1(Bt),Qe=me.boundingClientRect;return new Va((ct.clientX-Qe.left)/me.x-Bt.clientLeft,(ct.clientY-Qe.top)/me.y-Bt.clientTop)}var Xc=El.linux&&El.chrome?window.devicePixelRatio:El.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Ac(ct){return El.edge?ct.wheelDeltaY/2:ct.deltaY&&ct.deltaMode===0?-ct.deltaY/Xc:ct.deltaY&&ct.deltaMode===1?-ct.deltaY*20:ct.deltaY&&ct.deltaMode===2?-ct.deltaY*60:ct.deltaX||ct.deltaZ?0:ct.wheelDelta?(ct.wheelDeltaY||ct.wheelDelta)/2:ct.detail&&Math.abs(ct.detail)<32765?-ct.detail*20:ct.detail?ct.detail/-32765*60:0}function yg(ct,Bt){var me=Bt.relatedTarget;if(!me)return!0;try{for(;me&&me!==ct;)me=me.parentNode}catch{return!1}return me!==ct}var Dp={__proto__:null,on:Pu,off:Bh,stopPropagation:n0,disableScrollPropagation:dm,disableClickPropagation:fv,preventDefault:mc,stop:vg,getPropagationPath:mw,getMousePosition:Jd,getWheelDelta:Ac,isExternalTarget:yg,addListener:Pu,removeListener:Bh},A1=Ei.extend({run:function(ct,Bt,me,Qe){this.stop(),this._el=ct,this._inProgress=!0,this._duration=me||.25,this._easeOutPower=1/Math.max(Qe||.5,.2),this._startPos=Rc(ct),this._offset=Bt.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=fa(this._animate,this),this._step()},_step:function(ct){var Bt=+new Date-this._startTime,me=this._duration*1e3;Bt<me?this._runFrame(this._easeOut(Bt/me),ct):(this._runFrame(1),this._complete())},_runFrame:function(ct,Bt){var me=this._startPos.add(this._offset.multiplyBy(ct));Bt&&me._round(),ic(this._el,me),this.fire("step")},_complete:function(){Li(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(ct){return 1-Math.pow(1-ct,this._easeOutPower)}}),Mc=Ei.extend({options:{crs:bi,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(ct,Bt){Bt=zr(this,Bt),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(ct),this._initLayout(),this._onResize=kt(this._onResize,this),this._initEvents(),Bt.maxBounds&&this.setMaxBounds(Bt.maxBounds),Bt.zoom!==void 0&&(this._zoom=this._limitZoom(Bt.zoom)),Bt.center&&Bt.zoom!==void 0&&this.setView(Ta(Bt.center),Bt.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=b1&&El.any3d&&!El.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Pu(this._proxy,fw,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(ct,Bt,me){if(Bt=Bt===void 0?this._zoom:this._limitZoom(Bt),ct=this._limitCenter(Ta(ct),Bt,this.options.maxBounds),me=me||{},this._stop(),this._loaded&&!me.reset&&me!==!0){me.animate!==void 0&&(me.zoom=J({animate:me.animate},me.zoom),me.pan=J({animate:me.animate,duration:me.duration},me.pan));var Qe=this._zoom!==Bt?this._tryAnimatedZoom&&this._tryAnimatedZoom(ct,Bt,me.zoom):this._tryAnimatedPan(ct,me.pan);if(Qe)return clearTimeout(this._sizeTimer),this}return this._resetView(ct,Bt,me.pan&&me.pan.noMoveStart),this},setZoom:function(ct,Bt){return this._loaded?this.setView(this.getCenter(),ct,{zoom:Bt}):(this._zoom=ct,this)},zoomIn:function(ct,Bt){return ct=ct||(El.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+ct,Bt)},zoomOut:function(ct,Bt){return ct=ct||(El.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-ct,Bt)},setZoomAround:function(ct,Bt,me){var Qe=this.getZoomScale(Bt),Pr=this.getSize().divideBy(2),Tn=ct instanceof Va?ct:this.latLngToContainerPoint(ct),ji=Tn.subtract(Pr).multiplyBy(1-1/Qe),Na=this.containerPointToLatLng(Pr.add(ji));return this.setView(Na,Bt,{zoom:me})},_getBoundsCenterZoom:function(ct,Bt){Bt=Bt||{},ct=ct.getBounds?ct.getBounds():qo(ct);var me=mo(Bt.paddingTopLeft||Bt.padding||[0,0]),Qe=mo(Bt.paddingBottomRight||Bt.padding||[0,0]),Pr=this.getBoundsZoom(ct,!1,me.add(Qe));if(Pr=typeof Bt.maxZoom=="number"?Math.min(Bt.maxZoom,Pr):Pr,Pr===1/0)return{center:ct.getCenter(),zoom:Pr};var Tn=Qe.subtract(me).divideBy(2),ji=this.project(ct.getSouthWest(),Pr),Na=this.project(ct.getNorthEast(),Pr),Ya=this.unproject(ji.add(Na).divideBy(2).add(Tn),Pr);return{center:Ya,zoom:Pr}},fitBounds:function(ct,Bt){if(ct=qo(ct),!ct.isValid())throw new Error("Bounds are not valid.");var me=this._getBoundsCenterZoom(ct,Bt);return this.setView(me.center,me.zoom,Bt)},fitWorld:function(ct){return this.fitBounds([[-90,-180],[90,180]],ct)},panTo:function(ct,Bt){return this.setView(ct,this._zoom,{pan:Bt})},panBy:function(ct,Bt){if(ct=mo(ct).round(),Bt=Bt||{},!ct.x&&!ct.y)return this.fire("moveend");if(Bt.animate!==!0&&!this.getSize().contains(ct))return this._resetView(this.unproject(this.project(this.getCenter()).add(ct)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new A1,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),Bt.noMoveStart||this.fire("movestart"),Bt.animate!==!1){Wu(this._mapPane,"leaflet-pan-anim");var me=this._getMapPanePos().subtract(ct).round();this._panAnim.run(this._mapPane,me,Bt.duration||.25,Bt.easeLinearity)}else this._rawPanBy(ct),this.fire("move").fire("moveend");return this},flyTo:function(ct,Bt,me){if(me=me||{},me.animate===!1||!El.any3d)return this.setView(ct,Bt,me);this._stop();var Qe=this.project(this.getCenter()),Pr=this.project(ct),Tn=this.getSize(),ji=this._zoom;ct=Ta(ct),Bt=Bt===void 0?ji:Bt;var Na=Math.max(Tn.x,Tn.y),Ya=Na*this.getZoomScale(ji,Bt),xo=Pr.distanceTo(Qe)||1,Vs=1.42,xl=Vs*Vs;function Du(cd){var Xy=cd?-1:1,$_=cd?Ya:Na,w6=Ya*Ya-Na*Na+Xy*xl*xl*xo*xo,Ow=2*$_*xl*xo,G_=w6/Ow,Dw=Math.sqrt(G_*G_+1)-G_,k6=Dw<1e-9?-18:Math.log(Dw);return k6}function Sd(cd){return(Math.exp(cd)-Math.exp(-cd))/2}function Bf(cd){return(Math.exp(cd)+Math.exp(-cd))/2}function _0(cd){return Sd(cd)/Bf(cd)}var wp=Du(0);function jm(cd){return Na*(Bf(wp)/Bf(wp+Vs*cd))}function Yy(cd){return Na*(Bf(wp)*_0(wp+Vs*cd)-Sd(wp))/xl}function Ky(cd){return 1-Math.pow(1-cd,1.5)}var Z_=Date.now(),Iw=(Du(1)-wp)/Vs,b6=me.duration?1e3*me.duration:1e3*Iw*.8;function Mf(){var cd=(Date.now()-Z_)/b6,Xy=Ky(cd)*Iw;cd<=1?(this._flyToFrame=fa(Mf,this),this._move(this.unproject(Qe.add(Pr.subtract(Qe).multiplyBy(Yy(Xy)/xo)),ji),this.getScaleZoom(Na/jm(Xy),ji),{flyTo:!0})):this._move(ct,Bt)._moveEnd(!0)}return this._moveStart(!0,me.noMoveStart),Mf.call(this),this},flyToBounds:function(ct,Bt){var me=this._getBoundsCenterZoom(ct,Bt);return this.flyTo(me.center,me.zoom,Bt)},setMaxBounds:function(ct){return ct=qo(ct),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),ct.isValid()?(this.options.maxBounds=ct,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(ct){var Bt=this.options.minZoom;return this.options.minZoom=ct,this._loaded&&Bt!==ct&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(ct):this},setMaxZoom:function(ct){var Bt=this.options.maxZoom;return this.options.maxZoom=ct,this._loaded&&Bt!==ct&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(ct):this},panInsideBounds:function(ct,Bt){this._enforcingBounds=!0;var me=this.getCenter(),Qe=this._limitCenter(me,this._zoom,qo(ct));return me.equals(Qe)||this.panTo(Qe,Bt),this._enforcingBounds=!1,this},panInside:function(ct,Bt){Bt=Bt||{};var me=mo(Bt.paddingTopLeft||Bt.padding||[0,0]),Qe=mo(Bt.paddingBottomRight||Bt.padding||[0,0]),Pr=this.project(this.getCenter()),Tn=this.project(ct),ji=this.getPixelBounds(),Na=pl([ji.min.add(me),ji.max.subtract(Qe)]),Ya=Na.getSize();if(!Na.contains(Tn)){this._enforcingBounds=!0;var xo=Tn.subtract(Na.getCenter()),Vs=Na.extend(Tn).getSize().subtract(Ya);Pr.x+=xo.x<0?-Vs.x:Vs.x,Pr.y+=xo.y<0?-Vs.y:Vs.y,this.panTo(this.unproject(Pr),Bt),this._enforcingBounds=!1}return this},invalidateSize:function(ct){if(!this._loaded)return this;ct=J({animate:!1,pan:!0},ct===!0?{animate:!0}:ct);var Bt=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var me=this.getSize(),Qe=Bt.divideBy(2).round(),Pr=me.divideBy(2).round(),Tn=Qe.subtract(Pr);return!Tn.x&&!Tn.y?this:(ct.animate&&ct.pan?this.panBy(Tn):(ct.pan&&this._rawPanBy(Tn),this.fire("move"),ct.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(kt(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:Bt,newSize:me}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(ct){if(ct=this._locateOptions=J({timeout:1e4,watch:!1},ct),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var Bt=kt(this._handleGeolocationResponse,this),me=kt(this._handleGeolocationError,this);return ct.watch?this._locationWatchId=navigator.geolocation.watchPosition(Bt,me,ct):navigator.geolocation.getCurrentPosition(Bt,me,ct),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(ct){if(this._container._leaflet_id){var Bt=ct.code,me=ct.message||(Bt===1?"permission denied":Bt===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:Bt,message:"Geolocation error: "+me+"."})}},_handleGeolocationResponse:function(ct){if(this._container._leaflet_id){var Bt=ct.coords.latitude,me=ct.coords.longitude,Qe=new fo(Bt,me),Pr=Qe.toBounds(ct.coords.accuracy*2),Tn=this._locateOptions;if(Tn.setView){var ji=this.getBoundsZoom(Pr);this.setView(Qe,Tn.maxZoom?Math.min(ji,Tn.maxZoom):ji)}var Na={latlng:Qe,bounds:Pr,timestamp:ct.timestamp};for(var Ya in ct.coords)typeof ct.coords[Ya]=="number"&&(Na[Ya]=ct.coords[Ya]);this.fire("locationfound",Na)}},addHandler:function(ct,Bt){if(!Bt)return this;var me=this[ct]=new Bt(this);return this._handlers.push(me),this.options[ct]&&me.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Tf(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Li(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var ct;for(ct in this._layers)this._layers[ct].remove();for(ct in this._panes)Tf(this._panes[ct]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(ct,Bt){var me="leaflet-pane"+(ct?" leaflet-"+ct.replace("Pane","")+"-pane":""),Qe=Cc("div",me,Bt||this._mapPane);return ct&&(this._panes[ct]=Qe),Qe},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var ct=this.getPixelBounds(),Bt=this.unproject(ct.getBottomLeft()),me=this.unproject(ct.getTopRight());return new fu(Bt,me)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(ct,Bt,me){ct=qo(ct),me=mo(me||[0,0]);var Qe=this.getZoom()||0,Pr=this.getMinZoom(),Tn=this.getMaxZoom(),ji=ct.getNorthWest(),Na=ct.getSouthEast(),Ya=this.getSize().subtract(me),xo=pl(this.project(Na,Qe),this.project(ji,Qe)).getSize(),Vs=El.any3d?this.options.zoomSnap:1,xl=Ya.x/xo.x,Du=Ya.y/xo.y,Sd=Bt?Math.max(xl,Du):Math.min(xl,Du);return Qe=this.getScaleZoom(Sd,Qe),Vs&&(Qe=Math.round(Qe/(Vs/100))*(Vs/100),Qe=Bt?Math.ceil(Qe/Vs)*Vs:Math.floor(Qe/Vs)*Vs),Math.max(Pr,Math.min(Tn,Qe))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Va(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(ct,Bt){var me=this._getTopLeftPoint(ct,Bt);return new ko(me,me.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(ct){return this.options.crs.getProjectedBounds(ct===void 0?this.getZoom():ct)},getPane:function(ct){return typeof ct=="string"?this._panes[ct]:ct},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(ct,Bt){var me=this.options.crs;return Bt=Bt===void 0?this._zoom:Bt,me.scale(ct)/me.scale(Bt)},getScaleZoom:function(ct,Bt){var me=this.options.crs;Bt=Bt===void 0?this._zoom:Bt;var Qe=me.zoom(ct*me.scale(Bt));return isNaN(Qe)?1/0:Qe},project:function(ct,Bt){return Bt=Bt===void 0?this._zoom:Bt,this.options.crs.latLngToPoint(Ta(ct),Bt)},unproject:function(ct,Bt){return Bt=Bt===void 0?this._zoom:Bt,this.options.crs.pointToLatLng(mo(ct),Bt)},layerPointToLatLng:function(ct){var Bt=mo(ct).add(this.getPixelOrigin());return this.unproject(Bt)},latLngToLayerPoint:function(ct){var Bt=this.project(Ta(ct))._round();return Bt._subtract(this.getPixelOrigin())},wrapLatLng:function(ct){return this.options.crs.wrapLatLng(Ta(ct))},wrapLatLngBounds:function(ct){return this.options.crs.wrapLatLngBounds(qo(ct))},distance:function(ct,Bt){return this.options.crs.distance(Ta(ct),Ta(Bt))},containerPointToLayerPoint:function(ct){return mo(ct).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(ct){return mo(ct).add(this._getMapPanePos())},containerPointToLatLng:function(ct){var Bt=this.containerPointToLayerPoint(mo(ct));return this.layerPointToLatLng(Bt)},latLngToContainerPoint:function(ct){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Ta(ct)))},mouseEventToContainerPoint:function(ct){return Jd(ct,this._container)},mouseEventToLayerPoint:function(ct){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(ct))},mouseEventToLatLng:function(ct){return this.layerPointToLatLng(this.mouseEventToLayerPoint(ct))},_initContainer:function(ct){var Bt=this._container=dw(ct);if(Bt){if(Bt._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Pu(Bt,"scroll",this._onScroll,this),this._containerId=Gt(Bt)},_initLayout:function(){var ct=this._container;this._fadeAnimated=this.options.fadeAnimation&&El.any3d,Wu(ct,"leaflet-container"+(El.touch?" leaflet-touch":"")+(El.retina?" leaflet-retina":"")+(El.ielt9?" leaflet-oldie":"")+(El.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var Bt=w1(ct,"position");Bt!=="absolute"&&Bt!=="relative"&&Bt!=="fixed"&&Bt!=="sticky"&&(ct.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var ct=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ic(this._mapPane,new Va(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Wu(ct.markerPane,"leaflet-zoom-hide"),Wu(ct.shadowPane,"leaflet-zoom-hide"))},_resetView:function(ct,Bt,me){ic(this._mapPane,new Va(0,0));var Qe=!this._loaded;this._loaded=!0,Bt=this._limitZoom(Bt),this.fire("viewprereset");var Pr=this._zoom!==Bt;this._moveStart(Pr,me)._move(ct,Bt)._moveEnd(Pr),this.fire("viewreset"),Qe&&this.fire("load")},_moveStart:function(ct,Bt){return ct&&this.fire("zoomstart"),Bt||this.fire("movestart"),this},_move:function(ct,Bt,me,Qe){Bt===void 0&&(Bt=this._zoom);var Pr=this._zoom!==Bt;return this._zoom=Bt,this._lastCenter=ct,this._pixelOrigin=this._getNewPixelOrigin(ct),Qe?me&&me.pinch&&this.fire("zoom",me):((Pr||me&&me.pinch)&&this.fire("zoom",me),this.fire("move",me)),this},_moveEnd:function(ct){return ct&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Li(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(ct){ic(this._mapPane,this._getMapPanePos().subtract(ct))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(ct){this._targets={},this._targets[Gt(this._container)]=this;var Bt=ct?Bh:Pu;Bt(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&Bt(window,"resize",this._onResize,this),El.any3d&&this.options.transform3DLimit&&(ct?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Li(this._resizeRequest),this._resizeRequest=fa(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var ct=this._getMapPanePos();Math.max(Math.abs(ct.x),Math.abs(ct.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(ct,Bt){for(var me=[],Qe,Pr=Bt==="mouseout"||Bt==="mouseover",Tn=ct.target||ct.srcElement,ji=!1;Tn;){if(Qe=this._targets[Gt(Tn)],Qe&&(Bt==="click"||Bt==="preclick")&&this._draggableMoved(Qe)){ji=!0;break}if(Qe&&Qe.listens(Bt,!0)&&(Pr&&!yg(Tn,ct)||(me.push(Qe),Pr))||Tn===this._container)break;Tn=Tn.parentNode}return!me.length&&!ji&&!Pr&&this.listens(Bt,!0)&&(me=[this]),me},_isClickDisabled:function(ct){for(;ct&&ct!==this._container;){if(ct._leaflet_disable_click)return!0;ct=ct.parentNode}},_handleDOMEvent:function(ct){var Bt=ct.target||ct.srcElement;if(!(!this._loaded||Bt._leaflet_disable_events||ct.type==="click"&&this._isClickDisabled(Bt))){var me=ct.type;me==="mousedown"&&Hd(Bt),this._fireDOMEvent(ct,me)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(ct,Bt,me){if(ct.type==="click"){var Qe=J({},ct);Qe.type="preclick",this._fireDOMEvent(Qe,Qe.type,me)}var Pr=this._findEventTargets(ct,Bt);if(me){for(var Tn=[],ji=0;ji<me.length;ji++)me[ji].listens(Bt,!0)&&Tn.push(me[ji]);Pr=Tn.concat(Pr)}if(Pr.length){Bt==="contextmenu"&&mc(ct);var Na=Pr[0],Ya={originalEvent:ct};if(ct.type!=="keypress"&&ct.type!=="keydown"&&ct.type!=="keyup"){var xo=Na.getLatLng&&(!Na._radius||Na._radius<=10);Ya.containerPoint=xo?this.latLngToContainerPoint(Na.getLatLng()):this.mouseEventToContainerPoint(ct),Ya.layerPoint=this.containerPointToLayerPoint(Ya.containerPoint),Ya.latlng=xo?Na.getLatLng():this.layerPointToLatLng(Ya.layerPoint)}for(ji=0;ji<Pr.length;ji++)if(Pr[ji].fire(Bt,Ya,!0),Ya.originalEvent._stopped||Pr[ji].options.bubblingMouseEvents===!1&&ei(this._mouseEvents,Bt)!==-1)return}},_draggableMoved:function(ct){return ct=ct.dragging&&ct.dragging.enabled()?ct:this,ct.dragging&&ct.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var ct=0,Bt=this._handlers.length;ct<Bt;ct++)this._handlers[ct].disable()},whenReady:function(ct,Bt){return this._loaded?ct.call(Bt||this,{target:this}):this.on("load",ct,Bt),this},_getMapPanePos:function(){return Rc(this._mapPane)||new Va(0,0)},_moved:function(){var ct=this._getMapPanePos();return ct&&!ct.equals([0,0])},_getTopLeftPoint:function(ct,Bt){var me=ct&&Bt!==void 0?this._getNewPixelOrigin(ct,Bt):this.getPixelOrigin();return me.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(ct,Bt){var me=this.getSize()._divideBy(2);return this.project(ct,Bt)._subtract(me)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(ct,Bt,me){var Qe=this._getNewPixelOrigin(me,Bt);return this.project(ct,Bt)._subtract(Qe)},_latLngBoundsToNewLayerBounds:function(ct,Bt,me){var Qe=this._getNewPixelOrigin(me,Bt);return pl([this.project(ct.getSouthWest(),Bt)._subtract(Qe),this.project(ct.getNorthWest(),Bt)._subtract(Qe),this.project(ct.getSouthEast(),Bt)._subtract(Qe),this.project(ct.getNorthEast(),Bt)._subtract(Qe)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(ct){return this.latLngToLayerPoint(ct).subtract(this._getCenterLayerPoint())},_limitCenter:function(ct,Bt,me){if(!me)return ct;var Qe=this.project(ct,Bt),Pr=this.getSize().divideBy(2),Tn=new ko(Qe.subtract(Pr),Qe.add(Pr)),ji=this._getBoundsOffset(Tn,me,Bt);return Math.abs(ji.x)<=1&&Math.abs(ji.y)<=1?ct:this.unproject(Qe.add(ji),Bt)},_limitOffset:function(ct,Bt){if(!Bt)return ct;var me=this.getPixelBounds(),Qe=new ko(me.min.add(ct),me.max.add(ct));return ct.add(this._getBoundsOffset(Qe,Bt))},_getBoundsOffset:function(ct,Bt,me){var Qe=pl(this.project(Bt.getNorthEast(),me),this.project(Bt.getSouthWest(),me)),Pr=Qe.min.subtract(ct.min),Tn=Qe.max.subtract(ct.max),ji=this._rebound(Pr.x,-Tn.x),Na=this._rebound(Pr.y,-Tn.y);return new Va(ji,Na)},_rebound:function(ct,Bt){return ct+Bt>0?Math.round(ct-Bt)/2:Math.max(0,Math.ceil(ct))-Math.max(0,Math.floor(Bt))},_limitZoom:function(ct){var Bt=this.getMinZoom(),me=this.getMaxZoom(),Qe=El.any3d?this.options.zoomSnap:1;return Qe&&(ct=Math.round(ct/Qe)*Qe),Math.max(Bt,Math.min(me,ct))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Rf(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(ct,Bt){var me=this._getCenterOffset(ct)._trunc();return(Bt&&Bt.animate)!==!0&&!this.getSize().contains(me)?!1:(this.panBy(me,Bt),!0)},_createAnimProxy:function(){var ct=this._proxy=Cc("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(ct),this.on("zoomanim",function(Bt){var me=M_,Qe=this._proxy.style[me];pu(this._proxy,this.project(Bt.center,Bt.zoom),this.getZoomScale(Bt.zoom,1)),Qe===this._proxy.style[me]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Tf(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var ct=this.getCenter(),Bt=this.getZoom();pu(this._proxy,this.project(ct,Bt),this.getZoomScale(Bt,1))},_catchTransitionEnd:function(ct){this._animatingZoom&&ct.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(ct,Bt,me){if(this._animatingZoom)return!0;if(me=me||{},!this._zoomAnimated||me.animate===!1||this._nothingToAnimate()||Math.abs(Bt-this._zoom)>this.options.zoomAnimationThreshold)return!1;var Qe=this.getZoomScale(Bt),Pr=this._getCenterOffset(ct)._divideBy(1-1/Qe);return me.animate!==!0&&!this.getSize().contains(Pr)?!1:(fa(function(){this._moveStart(!0,me.noMoveStart||!1)._animateZoom(ct,Bt,!0)},this),!0)},_animateZoom:function(ct,Bt,me,Qe){this._mapPane&&(me&&(this._animatingZoom=!0,this._animateToCenter=ct,this._animateToZoom=Bt,Wu(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:ct,zoom:Bt,noUpdate:Qe}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(kt(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Rf(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function js(ct,Bt){return new Mc(ct,Bt)}var lp=ra.extend({options:{position:"topright"},initialize:function(ct){zr(this,ct)},getPosition:function(){return this.options.position},setPosition:function(ct){var Bt=this._map;return Bt&&Bt.removeControl(this),this.options.position=ct,Bt&&Bt.addControl(this),this},getContainer:function(){return this._container},addTo:function(ct){this.remove(),this._map=ct;var Bt=this._container=this.onAdd(ct),me=this.getPosition(),Qe=ct._controlCorners[me];return Wu(Bt,"leaflet-control"),me.indexOf("bottom")!==-1?Qe.insertBefore(Bt,Qe.firstChild):Qe.appendChild(Bt),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Tf(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(ct){this._map&&ct&&ct.screenX>0&&ct.screenY>0&&this._map.getContainer().focus()}}),i0=function(ct){return new lp(ct)};Mc.include({addControl:function(ct){return ct.addTo(this),this},removeControl:function(ct){return ct.remove(),this},_initControlPos:function(){var ct=this._controlCorners={},Bt="leaflet-",me=this._controlContainer=Cc("div",Bt+"control-container",this._container);function Qe(Pr,Tn){var ji=Bt+Pr+" "+Bt+Tn;ct[Pr+Tn]=Cc("div",ji,me)}Qe("top","left"),Qe("top","right"),Qe("bottom","left"),Qe("bottom","right")},_clearControlPos:function(){for(var ct in this._controlCorners)Tf(this._controlCorners[ct]);Tf(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var dv=lp.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(ct,Bt,me,Qe){return me<Qe?-1:Qe<me?1:0}},initialize:function(ct,Bt,me){zr(this,me),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var Qe in ct)this._addLayer(ct[Qe],Qe);for(Qe in Bt)this._addLayer(Bt[Qe],Qe,!0)},onAdd:function(ct){this._initLayout(),this._update(),this._map=ct,ct.on("zoomend",this._checkDisabledLayers,this);for(var Bt=0;Bt<this._layers.length;Bt++)this._layers[Bt].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(ct){return lp.prototype.addTo.call(this,ct),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var ct=0;ct<this._layers.length;ct++)this._layers[ct].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(ct,Bt){return this._addLayer(ct,Bt),this._map?this._update():this},addOverlay:function(ct,Bt){return this._addLayer(ct,Bt,!0),this._map?this._update():this},removeLayer:function(ct){ct.off("add remove",this._onLayerChange,this);var Bt=this._getLayer(Gt(ct));return Bt&&this._layers.splice(this._layers.indexOf(Bt),1),this._map?this._update():this},expand:function(){Wu(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var ct=this._map.getSize().y-(this._container.offsetTop+50);return ct<this._section.clientHeight?(Wu(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=ct+"px"):Rf(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Rf(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var ct="leaflet-control-layers",Bt=this._container=Cc("div",ct),me=this.options.collapsed;Bt.setAttribute("aria-haspopup",!0),fv(Bt),dm(Bt);var Qe=this._section=Cc("section",ct+"-list");me&&(this._map.on("click",this.collapse,this),Pu(Bt,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var Pr=this._layersLink=Cc("a",ct+"-toggle",Bt);Pr.href="#",Pr.title="Layers",Pr.setAttribute("role","button"),Pu(Pr,{keydown:function(Tn){Tn.keyCode===13&&this._expandSafely()},click:function(Tn){mc(Tn),this._expandSafely()}},this),me||this.expand(),this._baseLayersList=Cc("div",ct+"-base",Qe),this._separator=Cc("div",ct+"-separator",Qe),this._overlaysList=Cc("div",ct+"-overlays",Qe),Bt.appendChild(Qe)},_getLayer:function(ct){for(var Bt=0;Bt<this._layers.length;Bt++)if(this._layers[Bt]&&Gt(this._layers[Bt].layer)===ct)return this._layers[Bt]},_addLayer:function(ct,Bt,me){this._map&&ct.on("add remove",this._onLayerChange,this),this._layers.push({layer:ct,name:Bt,overlay:me}),this.options.sortLayers&&this._layers.sort(kt(function(Qe,Pr){return this.options.sortFunction(Qe.layer,Pr.layer,Qe.name,Pr.name)},this)),this.options.autoZIndex&&ct.setZIndex&&(this._lastZIndex++,ct.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Oy(this._baseLayersList),Oy(this._overlaysList),this._layerControlInputs=[];var ct,Bt,me,Qe,Pr=0;for(me=0;me<this._layers.length;me++)Qe=this._layers[me],this._addItem(Qe),Bt=Bt||Qe.overlay,ct=ct||!Qe.overlay,Pr+=Qe.overlay?0:1;return this.options.hideSingleBase&&(ct=ct&&Pr>1,this._baseLayersList.style.display=ct?"":"none"),this._separator.style.display=Bt&&ct?"":"none",this},_onLayerChange:function(ct){this._handlingClick||this._update();var Bt=this._getLayer(Gt(ct.target)),me=Bt.overlay?ct.type==="add"?"overlayadd":"overlayremove":ct.type==="add"?"baselayerchange":null;me&&this._map.fire(me,Bt)},_createRadioElement:function(ct,Bt){var me='<input type="radio" class="leaflet-control-layers-selector" name="'+ct+'"'+(Bt?' checked="checked"':"")+"/>",Qe=document.createElement("div");return Qe.innerHTML=me,Qe.firstChild},_addItem:function(ct){var Bt=document.createElement("label"),me=this._map.hasLayer(ct.layer),Qe;ct.overlay?(Qe=document.createElement("input"),Qe.type="checkbox",Qe.className="leaflet-control-layers-selector",Qe.defaultChecked=me):Qe=this._createRadioElement("leaflet-base-layers_"+Gt(this),me),this._layerControlInputs.push(Qe),Qe.layerId=Gt(ct.layer),Pu(Qe,"click",this._onInputClick,this);var Pr=document.createElement("span");Pr.innerHTML=" "+ct.name;var Tn=document.createElement("span");Bt.appendChild(Tn),Tn.appendChild(Qe),Tn.appendChild(Pr);var ji=ct.overlay?this._overlaysList:this._baseLayersList;return ji.appendChild(Bt),this._checkDisabledLayers(),Bt},_onInputClick:function(){if(!this._preventClick){var ct=this._layerControlInputs,Bt,me,Qe=[],Pr=[];this._handlingClick=!0;for(var Tn=ct.length-1;Tn>=0;Tn--)Bt=ct[Tn],me=this._getLayer(Bt.layerId).layer,Bt.checked?Qe.push(me):Bt.checked||Pr.push(me);for(Tn=0;Tn<Pr.length;Tn++)this._map.hasLayer(Pr[Tn])&&this._map.removeLayer(Pr[Tn]);for(Tn=0;Tn<Qe.length;Tn++)this._map.hasLayer(Qe[Tn])||this._map.addLayer(Qe[Tn]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var ct=this._layerControlInputs,Bt,me,Qe=this._map.getZoom(),Pr=ct.length-1;Pr>=0;Pr--)Bt=ct[Pr],me=this._getLayer(Bt.layerId).layer,Bt.disabled=me.options.minZoom!==void 0&&Qe<me.options.minZoom||me.options.maxZoom!==void 0&&Qe>me.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var ct=this._section;this._preventClick=!0,Pu(ct,"click",mc),this.expand();var Bt=this;setTimeout(function(){Bh(ct,"click",mc),Bt._preventClick=!1})}}),Y0=function(ct,Bt,me){return new dv(ct,Bt,me)},Es=lp.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(ct){var Bt="leaflet-control-zoom",me=Cc("div",Bt+" leaflet-bar"),Qe=this.options;return this._zoomInButton=this._createButton(Qe.zoomInText,Qe.zoomInTitle,Bt+"-in",me,this._zoomIn),this._zoomOutButton=this._createButton(Qe.zoomOutText,Qe.zoomOutTitle,Bt+"-out",me,this._zoomOut),this._updateDisabled(),ct.on("zoomend zoomlevelschange",this._updateDisabled,this),me},onRemove:function(ct){ct.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(ct){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(ct.shiftKey?3:1))},_zoomOut:function(ct){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(ct.shiftKey?3:1))},_createButton:function(ct,Bt,me,Qe,Pr){var Tn=Cc("a",me,Qe);return Tn.innerHTML=ct,Tn.href="#",Tn.title=Bt,Tn.setAttribute("role","button"),Tn.setAttribute("aria-label",Bt),fv(Tn),Pu(Tn,"click",vg),Pu(Tn,"click",Pr,this),Pu(Tn,"click",this._refocusOnMap,this),Tn},_updateDisabled:function(){var ct=this._map,Bt="leaflet-disabled";Rf(this._zoomInButton,Bt),Rf(this._zoomOutButton,Bt),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||ct._zoom===ct.getMinZoom())&&(Wu(this._zoomOutButton,Bt),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||ct._zoom===ct.getMaxZoom())&&(Wu(this._zoomInButton,Bt),this._zoomInButton.setAttribute("aria-disabled","true"))}});Mc.mergeOptions({zoomControl:!0}),Mc.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Es,this.addControl(this.zoomControl))});var gw=function(ct){return new Es(ct)},E_=lp.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(ct){var Bt="leaflet-control-scale",me=Cc("div",Bt),Qe=this.options;return this._addScales(Qe,Bt+"-line",me),ct.on(Qe.updateWhenIdle?"moveend":"move",this._update,this),ct.whenReady(this._update,this),me},onRemove:function(ct){ct.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(ct,Bt,me){ct.metric&&(this._mScale=Cc("div",Bt,me)),ct.imperial&&(this._iScale=Cc("div",Bt,me))},_update:function(){var ct=this._map,Bt=ct.getSize().y/2,me=ct.distance(ct.containerPointToLatLng([0,Bt]),ct.containerPointToLatLng([this.options.maxWidth,Bt]));this._updateScales(me)},_updateScales:function(ct){this.options.metric&&ct&&this._updateMetric(ct),this.options.imperial&&ct&&this._updateImperial(ct)},_updateMetric:function(ct){var Bt=this._getRoundNum(ct),me=Bt<1e3?Bt+" m":Bt/1e3+" km";this._updateScale(this._mScale,me,Bt/ct)},_updateImperial:function(ct){var Bt=ct*3.2808399,me,Qe,Pr;Bt>5280?(me=Bt/5280,Qe=this._getRoundNum(me),this._updateScale(this._iScale,Qe+" mi",Qe/me)):(Pr=this._getRoundNum(Bt),this._updateScale(this._iScale,Pr+" ft",Pr/Bt))},_updateScale:function(ct,Bt,me){ct.style.width=Math.round(this.options.maxWidth*me)+"px",ct.innerHTML=Bt},_getRoundNum:function(ct){var Bt=Math.pow(10,(Math.floor(ct)+"").length-1),me=ct/Bt;return me=me>=10?10:me>=5?5:me>=3?3:me>=2?2:1,Bt*me}}),h6=function(ct){return new E_(ct)},C_='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',L_=lp.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(El.inlineSvg?C_+" ":"")+"Leaflet</a>"},initialize:function(ct){zr(this,ct),this._attributions={}},onAdd:function(ct){ct.attributionControl=this,this._container=Cc("div","leaflet-control-attribution"),fv(this._container);for(var Bt in ct._layers)ct._layers[Bt].getAttribution&&this.addAttribution(ct._layers[Bt].getAttribution());return this._update(),ct.on("layeradd",this._addAttribution,this),this._container},onRemove:function(ct){ct.off("layeradd",this._addAttribution,this)},_addAttribution:function(ct){ct.layer.getAttribution&&(this.addAttribution(ct.layer.getAttribution()),ct.layer.once("remove",function(){this.removeAttribution(ct.layer.getAttribution())},this))},setPrefix:function(ct){return this.options.prefix=ct,this._update(),this},addAttribution:function(ct){return ct?(this._attributions[ct]||(this._attributions[ct]=0),this._attributions[ct]++,this._update(),this):this},removeAttribution:function(ct){return ct?(this._attributions[ct]&&(this._attributions[ct]--,this._update()),this):this},_update:function(){if(this._map){var ct=[];for(var Bt in this._attributions)this._attributions[Bt]&&ct.push(Bt);var me=[];this.options.prefix&&me.push(this.options.prefix),ct.length&&me.push(ct.join(", ")),this._container.innerHTML=me.join(' <span aria-hidden="true">|</span> ')}}});Mc.mergeOptions({attributionControl:!0}),Mc.addInitHook(function(){this.options.attributionControl&&new L_().addTo(this)});var f6=function(ct){return new L_(ct)};lp.Layers=dv,lp.Zoom=Es,lp.Scale=E_,lp.Attribution=L_,i0.layers=Y0,i0.zoom=gw,i0.scale=h6,i0.attribution=f6;var K0=ra.extend({initialize:function(ct){this._map=ct},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});K0.addTo=function(ct,Bt){return ct.addHandler(Bt,this),this};var up={Events:Ni},P0=El.touch?"touchstart mousedown":"mousedown",Fm=Ei.extend({options:{clickTolerance:3},initialize:function(ct,Bt,me,Qe){zr(this,Qe),this._element=ct,this._dragStartTarget=Bt||ct,this._preventOutline=me},enable:function(){this._enabled||(Pu(this._dragStartTarget,P0,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Fm._dragging===this&&this.finishDrag(!0),Bh(this._dragStartTarget,P0,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(ct){if(this._enabled&&(this._moved=!1,!S_(this._element,"leaflet-zoom-anim"))){if(ct.touches&&ct.touches.length!==1){Fm._dragging===this&&this.finishDrag();return}if(!(Fm._dragging||ct.shiftKey||ct.which!==1&&ct.button!==1&&!ct.touches)&&(Fm._dragging=this,this._preventOutline&&Hd(this._element),Kc(),C0(),!this._moving)){this.fire("down");var Bt=ct.touches?ct.touches[0]:ct,me=Ad(this._element);this._startPoint=new Va(Bt.clientX,Bt.clientY),this._startPos=Rc(this._element),this._parentScale=T1(me);var Qe=ct.type==="mousedown";Pu(document,Qe?"mousemove":"touchmove",this._onMove,this),Pu(document,Qe?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(ct){if(this._enabled){if(ct.touches&&ct.touches.length>1){this._moved=!0;return}var Bt=ct.touches&&ct.touches.length===1?ct.touches[0]:ct,me=new Va(Bt.clientX,Bt.clientY)._subtract(this._startPoint);!me.x&&!me.y||Math.abs(me.x)+Math.abs(me.y)<this.options.clickTolerance||(me.x/=this._parentScale.x,me.y/=this._parentScale.y,mc(ct),this._moved||(this.fire("dragstart"),this._moved=!0,Wu(document.body,"leaflet-dragging"),this._lastTarget=ct.target||ct.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Wu(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(me),this._moving=!0,this._lastEvent=ct,this._updatePosition())}},_updatePosition:function(){var ct={originalEvent:this._lastEvent};this.fire("predrag",ct),ic(this._element,this._newPos),this.fire("drag",ct)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(ct){Rf(document.body,"leaflet-dragging"),this._lastTarget&&(Rf(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Bh(document,"mousemove touchmove",this._onMove,this),Bh(document,"mouseup touchend touchcancel",this._onUp,this),Op(),pg();var Bt=this._moved&&this._moving;this._moving=!1,Fm._dragging=!1,Bt&&this.fire("dragend",{noInertia:ct,distance:this._newPos.distanceTo(this._startPos)})}});function P_(ct,Bt,me){var Qe,Pr=[1,4,2,8],Tn,ji,Na,Ya,xo,Vs,xl,Du;for(Tn=0,Vs=ct.length;Tn<Vs;Tn++)ct[Tn]._code=wg(ct[Tn],Bt);for(Na=0;Na<4;Na++){for(xl=Pr[Na],Qe=[],Tn=0,Vs=ct.length,ji=Vs-1;Tn<Vs;ji=Tn++)Ya=ct[Tn],xo=ct[ji],Ya._code&xl?xo._code&xl||(Du=bg(xo,Ya,xl,Bt,me),Du._code=wg(Du,Bt),Qe.push(Du)):(xo._code&xl&&(Du=bg(xo,Ya,xl,Bt,me),Du._code=wg(Du,Bt),Qe.push(Du)),Qe.push(Ya));ct=Qe}return ct}function Fy(ct,Bt){var me,Qe,Pr,Tn,ji,Na,Ya,xo,Vs;if(!ct||ct.length===0)throw new Error("latlngs not passed");g0(ct)||(console.warn("latlngs are not flat! Only the first ring will be used"),ct=ct[0]);var xl=Ta([0,0]),Du=qo(ct),Sd=Du.getNorthWest().distanceTo(Du.getSouthWest())*Du.getNorthEast().distanceTo(Du.getNorthWest());Sd<1700&&(xl=Ry(ct));var Bf=ct.length,_0=[];for(me=0;me<Bf;me++){var wp=Ta(ct[me]);_0.push(Bt.project(Ta([wp.lat-xl.lat,wp.lng-xl.lng])))}for(Na=Ya=xo=0,me=0,Qe=Bf-1;me<Bf;Qe=me++)Pr=_0[me],Tn=_0[Qe],ji=Pr.y*Tn.x-Tn.y*Pr.x,Ya+=(Pr.x+Tn.x)*ji,xo+=(Pr.y+Tn.y)*ji,Na+=ji*3;Na===0?Vs=_0[0]:Vs=[Ya/Na,xo/Na];var jm=Bt.unproject(mo(Vs));return Ta([jm.lat+xl.lat,jm.lng+xl.lng])}function Ry(ct){for(var Bt=0,me=0,Qe=0,Pr=0;Pr<ct.length;Pr++){var Tn=Ta(ct[Pr]);Bt+=Tn.lat,me+=Tn.lng,Qe++}return Ta([Bt/Qe,me/Qe])}var d6={__proto__:null,clipPolygon:P_,polygonCenter:Fy,centroid:Ry};function z_(ct,Bt){if(!Bt||!ct.length)return ct.slice();var me=Bt*Bt;return ct=yw(ct,me),ct=p6(ct,me),ct}function vw(ct,Bt,me){return Math.sqrt(pv(ct,Bt,me,!0))}function xg(ct,Bt,me){return pv(ct,Bt,me)}function p6(ct,Bt){var me=ct.length,Qe=typeof Uint8Array<"u"?Uint8Array:Array,Pr=new Qe(me);Pr[0]=Pr[me-1]=1,_g(ct,Pr,Bt,0,me-1);var Tn,ji=[];for(Tn=0;Tn<me;Tn++)Pr[Tn]&&ji.push(ct[Tn]);return ji}function _g(ct,Bt,me,Qe,Pr){var Tn=0,ji,Na,Ya;for(Na=Qe+1;Na<=Pr-1;Na++)Ya=pv(ct[Na],ct[Qe],ct[Pr],!0),Ya>Tn&&(ji=Na,Tn=Ya);Tn>me&&(Bt[ji]=1,_g(ct,Bt,me,Qe,ji),_g(ct,Bt,me,ji,Pr))}function yw(ct,Bt){for(var me=[ct[0]],Qe=1,Pr=0,Tn=ct.length;Qe<Tn;Qe++)m6(ct[Qe],ct[Pr])>Bt&&(me.push(ct[Qe]),Pr=Qe);return Pr<Tn-1&&me.push(ct[Tn-1]),me}var I_;function O_(ct,Bt,me,Qe,Pr){var Tn=Qe?I_:wg(ct,me),ji=wg(Bt,me),Na,Ya,xo;for(I_=ji;;){if(!(Tn|ji))return[ct,Bt];if(Tn&ji)return!1;Na=Tn||ji,Ya=bg(ct,Bt,Na,me,Pr),xo=wg(Ya,me),Na===Tn?(ct=Ya,Tn=xo):(Bt=Ya,ji=xo)}}function bg(ct,Bt,me,Qe,Pr){var Tn=Bt.x-ct.x,ji=Bt.y-ct.y,Na=Qe.min,Ya=Qe.max,xo,Vs;return me&8?(xo=ct.x+Tn*(Ya.y-ct.y)/ji,Vs=Ya.y):me&4?(xo=ct.x+Tn*(Na.y-ct.y)/ji,Vs=Na.y):me&2?(xo=Ya.x,Vs=ct.y+ji*(Ya.x-ct.x)/Tn):me&1&&(xo=Na.x,Vs=ct.y+ji*(Na.x-ct.x)/Tn),new Va(xo,Vs,Pr)}function wg(ct,Bt){var me=0;return ct.x<Bt.min.x?me|=1:ct.x>Bt.max.x&&(me|=2),ct.y<Bt.min.y?me|=4:ct.y>Bt.max.y&&(me|=8),me}function m6(ct,Bt){var me=Bt.x-ct.x,Qe=Bt.y-ct.y;return me*me+Qe*Qe}function pv(ct,Bt,me,Qe){var Pr=Bt.x,Tn=Bt.y,ji=me.x-Pr,Na=me.y-Tn,Ya=ji*ji+Na*Na,xo;return Ya>0&&(xo=((ct.x-Pr)*ji+(ct.y-Tn)*Na)/Ya,xo>1?(Pr=me.x,Tn=me.y):xo>0&&(Pr+=ji*xo,Tn+=Na*xo)),ji=ct.x-Pr,Na=ct.y-Tn,Qe?ji*ji+Na*Na:new Va(Pr,Tn)}function g0(ct){return!kn(ct[0])||typeof ct[0][0]!="object"&&typeof ct[0][0]<"u"}function xw(ct){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),g0(ct)}function _w(ct,Bt){var me,Qe,Pr,Tn,ji,Na,Ya,xo;if(!ct||ct.length===0)throw new Error("latlngs not passed");g0(ct)||(console.warn("latlngs are not flat! Only the first ring will be used"),ct=ct[0]);var Vs=Ta([0,0]),xl=qo(ct),Du=xl.getNorthWest().distanceTo(xl.getSouthWest())*xl.getNorthEast().distanceTo(xl.getNorthWest());Du<1700&&(Vs=Ry(ct));var Sd=ct.length,Bf=[];for(me=0;me<Sd;me++){var _0=Ta(ct[me]);Bf.push(Bt.project(Ta([_0.lat-Vs.lat,_0.lng-Vs.lng])))}for(me=0,Qe=0;me<Sd-1;me++)Qe+=Bf[me].distanceTo(Bf[me+1])/2;if(Qe===0)xo=Bf[0];else for(me=0,Tn=0;me<Sd-1;me++)if(ji=Bf[me],Na=Bf[me+1],Pr=ji.distanceTo(Na),Tn+=Pr,Tn>Qe){Ya=(Tn-Qe)/Pr,xo=[Na.x-Ya*(Na.x-ji.x),Na.y-Ya*(Na.y-ji.y)];break}var wp=Bt.unproject(mo(xo));return Ta([wp.lat+Vs.lat,wp.lng+Vs.lng])}var Qh={__proto__:null,simplify:z_,pointToSegmentDistance:vw,closestPointOnSegment:xg,clipSegment:O_,_getEdgeIntersection:bg,_getBitCode:wg,_sqClosestPointOnSegment:pv,isFlat:g0,_flat:xw,polylineCenter:_w},v0={project:function(ct){return new Va(ct.lng,ct.lat)},unproject:function(ct){return new fo(ct.y,ct.x)},bounds:new ko([-180,-90],[180,90])},mv={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ko([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(ct){var Bt=Math.PI/180,me=this.R,Qe=ct.lat*Bt,Pr=this.R_MINOR/me,Tn=Math.sqrt(1-Pr*Pr),ji=Tn*Math.sin(Qe),Na=Math.tan(Math.PI/4-Qe/2)/Math.pow((1-ji)/(1+ji),Tn/2);return Qe=-me*Math.log(Math.max(Na,1e-10)),new Va(ct.lng*Bt*me,Qe)},unproject:function(ct){for(var Bt=180/Math.PI,me=this.R,Qe=this.R_MINOR/me,Pr=Math.sqrt(1-Qe*Qe),Tn=Math.exp(-ct.y/me),ji=Math.PI/2-2*Math.atan(Tn),Na=0,Ya=.1,xo;Na<15&&Math.abs(Ya)>1e-7;Na++)xo=Pr*Math.sin(ji),xo=Math.pow((1-xo)/(1+xo),Pr/2),Ya=Math.PI/2-2*Math.atan(Tn*xo)-ji,ji+=Ya;return new fo(ji*Bt,ct.x*Bt/me)}},D_={__proto__:null,LonLat:v0,Mercator:mv,SphericalMercator:Ps},F_=J({},go,{code:"EPSG:3395",projection:mv,transformation:function(){var ct=.5/(Math.PI*mv.R);return gi(ct,.5,-ct,.5)}()}),By=J({},go,{code:"EPSG:4326",projection:v0,transformation:gi(1/180,1,-1/180,.5)}),kg=J({},Ea,{projection:v0,transformation:gi(1,0,-1,0),scale:function(ct){return Math.pow(2,ct)},zoom:function(ct){return Math.log(ct)/Math.LN2},distance:function(ct,Bt){var me=Bt.lng-ct.lng,Qe=Bt.lat-ct.lat;return Math.sqrt(me*me+Qe*Qe)},infinite:!0});Ea.Earth=go,Ea.EPSG3395=F_,Ea.EPSG3857=bi,Ea.EPSG900913=li,Ea.EPSG4326=By,Ea.Simple=kg;var a0=Ei.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(ct){return ct.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(ct){return ct&&ct.removeLayer(this),this},getPane:function(ct){return this._map.getPane(ct?this.options[ct]||ct:this.options.pane)},addInteractiveTarget:function(ct){return this._map._targets[Gt(ct)]=this,this},removeInteractiveTarget:function(ct){return delete this._map._targets[Gt(ct)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(ct){var Bt=ct.target;if(Bt.hasLayer(this)){if(this._map=Bt,this._zoomAnimated=Bt._zoomAnimated,this.getEvents){var me=this.getEvents();Bt.on(me,this),this.once("remove",function(){Bt.off(me,this)},this)}this.onAdd(Bt),this.fire("add"),Bt.fire("layeradd",{layer:this})}}});Mc.include({addLayer:function(ct){if(!ct._layerAdd)throw new Error("The provided object is not a Layer.");var Bt=Gt(ct);return this._layers[Bt]?this:(this._layers[Bt]=ct,ct._mapToAdd=this,ct.beforeAdd&&ct.beforeAdd(this),this.whenReady(ct._layerAdd,ct),this)},removeLayer:function(ct){var Bt=Gt(ct);return this._layers[Bt]?(this._loaded&&ct.onRemove(this),delete this._layers[Bt],this._loaded&&(this.fire("layerremove",{layer:ct}),ct.fire("remove")),ct._map=ct._mapToAdd=null,this):this},hasLayer:function(ct){return Gt(ct)in this._layers},eachLayer:function(ct,Bt){for(var me in this._layers)ct.call(Bt,this._layers[me]);return this},_addLayers:function(ct){ct=ct?kn(ct)?ct:[ct]:[];for(var Bt=0,me=ct.length;Bt<me;Bt++)this.addLayer(ct[Bt])},_addZoomLimit:function(ct){(!isNaN(ct.options.maxZoom)||!isNaN(ct.options.minZoom))&&(this._zoomBoundLayers[Gt(ct)]=ct,this._updateZoomLevels())},_removeZoomLimit:function(ct){var Bt=Gt(ct);this._zoomBoundLayers[Bt]&&(delete this._zoomBoundLayers[Bt],this._updateZoomLevels())},_updateZoomLevels:function(){var ct=1/0,Bt=-1/0,me=this._getZoomSpan();for(var Qe in this._zoomBoundLayers){var Pr=this._zoomBoundLayers[Qe].options;ct=Pr.minZoom===void 0?ct:Math.min(ct,Pr.minZoom),Bt=Pr.maxZoom===void 0?Bt:Math.max(Bt,Pr.maxZoom)}this._layersMaxZoom=Bt===-1/0?void 0:Bt,this._layersMinZoom=ct===1/0?void 0:ct,me!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Tg=a0.extend({initialize:function(ct,Bt){zr(this,Bt),this._layers={};var me,Qe;if(ct)for(me=0,Qe=ct.length;me<Qe;me++)this.addLayer(ct[me])},addLayer:function(ct){var Bt=this.getLayerId(ct);return this._layers[Bt]=ct,this._map&&this._map.addLayer(ct),this},removeLayer:function(ct){var Bt=ct in this._layers?ct:this.getLayerId(ct);return this._map&&this._layers[Bt]&&this._map.removeLayer(this._layers[Bt]),delete this._layers[Bt],this},hasLayer:function(ct){var Bt=typeof ct=="number"?ct:this.getLayerId(ct);return Bt in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(ct){var Bt=Array.prototype.slice.call(arguments,1),me,Qe;for(me in this._layers)Qe=this._layers[me],Qe[ct]&&Qe[ct].apply(Qe,Bt);return this},onAdd:function(ct){this.eachLayer(ct.addLayer,ct)},onRemove:function(ct){this.eachLayer(ct.removeLayer,ct)},eachLayer:function(ct,Bt){for(var me in this._layers)ct.call(Bt,this._layers[me]);return this},getLayer:function(ct){return this._layers[ct]},getLayers:function(){var ct=[];return this.eachLayer(ct.push,ct),ct},setZIndex:function(ct){return this.invoke("setZIndex",ct)},getLayerId:function(ct){return Gt(ct)}}),Ny=function(ct,Bt){return new Tg(ct,Bt)},bp=Tg.extend({addLayer:function(ct){return this.hasLayer(ct)?this:(ct.addEventParent(this),Tg.prototype.addLayer.call(this,ct),this.fire("layeradd",{layer:ct}))},removeLayer:function(ct){return this.hasLayer(ct)?(ct in this._layers&&(ct=this._layers[ct]),ct.removeEventParent(this),Tg.prototype.removeLayer.call(this,ct),this.fire("layerremove",{layer:ct})):this},setStyle:function(ct){return this.invoke("setStyle",ct)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var ct=new fu;for(var Bt in this._layers){var me=this._layers[Bt];ct.extend(me.getBounds?me.getBounds():me.getLatLng())}return ct}}),bw=function(ct,Bt){return new bp(ct,Bt)},Rm=ra.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(ct){zr(this,ct)},createIcon:function(ct){return this._createIcon("icon",ct)},createShadow:function(ct){return this._createIcon("shadow",ct)},_createIcon:function(ct,Bt){var me=this._getIconUrl(ct);if(!me){if(ct==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var Qe=this._createImg(me,Bt&&Bt.tagName==="IMG"?Bt:null);return this._setIconStyles(Qe,ct),(this.options.crossOrigin||this.options.crossOrigin==="")&&(Qe.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),Qe},_setIconStyles:function(ct,Bt){var me=this.options,Qe=me[Bt+"Size"];typeof Qe=="number"&&(Qe=[Qe,Qe]);var Pr=mo(Qe),Tn=mo(Bt==="shadow"&&me.shadowAnchor||me.iconAnchor||Pr&&Pr.divideBy(2,!0));ct.className="leaflet-marker-"+Bt+" "+(me.className||""),Tn&&(ct.style.marginLeft=-Tn.x+"px",ct.style.marginTop=-Tn.y+"px"),Pr&&(ct.style.width=Pr.x+"px",ct.style.height=Pr.y+"px")},_createImg:function(ct,Bt){return Bt=Bt||document.createElement("img"),Bt.src=ct,Bt},_getIconUrl:function(ct){return El.retina&&this.options[ct+"RetinaUrl"]||this.options[ct+"Url"]}});function R_(ct){return new Rm(ct)}var gv=Rm.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(ct){return typeof gv.imagePath!="string"&&(gv.imagePath=this._detectIconPath()),(this.options.imagePath||gv.imagePath)+Rm.prototype._getIconUrl.call(this,ct)},_stripUrl:function(ct){var Bt=function(me,Qe,Pr){var Tn=Qe.exec(me);return Tn&&Tn[Pr]};return ct=Bt(ct,/^url\((['"])?(.+)\1\)$/,2),ct&&Bt(ct,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var ct=Cc("div","leaflet-default-icon-path",document.body),Bt=w1(ct,"background-image")||w1(ct,"backgroundImage");if(document.body.removeChild(ct),Bt=this._stripUrl(Bt),Bt)return Bt;var me=document.querySelector('link[href$="leaflet.css"]');return me?me.href.substring(0,me.href.length-11-1):""}}),B_=K0.extend({initialize:function(ct){this._marker=ct},addHooks:function(){var ct=this._marker._icon;this._draggable||(this._draggable=new Fm(ct,ct,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Wu(ct,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Rf(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(ct){var Bt=this._marker,me=Bt._map,Qe=this._marker.options.autoPanSpeed,Pr=this._marker.options.autoPanPadding,Tn=Rc(Bt._icon),ji=me.getPixelBounds(),Na=me.getPixelOrigin(),Ya=pl(ji.min._subtract(Na).add(Pr),ji.max._subtract(Na).subtract(Pr));if(!Ya.contains(Tn)){var xo=mo((Math.max(Ya.max.x,Tn.x)-Ya.max.x)/(ji.max.x-Ya.max.x)-(Math.min(Ya.min.x,Tn.x)-Ya.min.x)/(ji.min.x-Ya.min.x),(Math.max(Ya.max.y,Tn.y)-Ya.max.y)/(ji.max.y-Ya.max.y)-(Math.min(Ya.min.y,Tn.y)-Ya.min.y)/(ji.min.y-Ya.min.y)).multiplyBy(Qe);me.panBy(xo,{animate:!1}),this._draggable._newPos._add(xo),this._draggable._startPos._add(xo),ic(Bt._icon,this._draggable._newPos),this._onDrag(ct),this._panRequest=fa(this._adjustPan.bind(this,ct))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(ct){this._marker.options.autoPan&&(Li(this._panRequest),this._panRequest=fa(this._adjustPan.bind(this,ct)))},_onDrag:function(ct){var Bt=this._marker,me=Bt._shadow,Qe=Rc(Bt._icon),Pr=Bt._map.layerPointToLatLng(Qe);me&&ic(me,Qe),Bt._latlng=Pr,ct.latlng=Pr,ct.oldLatLng=this._oldLatLng,Bt.fire("move",ct).fire("drag",ct)},_onDragEnd:function(ct){Li(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",ct)}}),M1=a0.extend({options:{icon:new gv,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(ct,Bt){zr(this,Bt),this._latlng=Ta(ct)},onAdd:function(ct){this._zoomAnimated=this._zoomAnimated&&ct.options.markerZoomAnimation,this._zoomAnimated&&ct.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(ct){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&ct.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(ct){var Bt=this._latlng;return this._latlng=Ta(ct),this.update(),this.fire("move",{oldLatLng:Bt,latlng:this._latlng})},setZIndexOffset:function(ct){return this.options.zIndexOffset=ct,this.update()},getIcon:function(){return this.options.icon},setIcon:function(ct){return this.options.icon=ct,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var ct=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(ct)}return this},_initIcon:function(){var ct=this.options,Bt="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),me=ct.icon.createIcon(this._icon),Qe=!1;me!==this._icon&&(this._icon&&this._removeIcon(),Qe=!0,ct.title&&(me.title=ct.title),me.tagName==="IMG"&&(me.alt=ct.alt||"")),Wu(me,Bt),ct.keyboard&&(me.tabIndex="0",me.setAttribute("role","button")),this._icon=me,ct.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Pu(me,"focus",this._panOnFocus,this);var Pr=ct.icon.createShadow(this._shadow),Tn=!1;Pr!==this._shadow&&(this._removeShadow(),Tn=!0),Pr&&(Wu(Pr,Bt),Pr.alt=""),this._shadow=Pr,ct.opacity<1&&this._updateOpacity(),Qe&&this.getPane().appendChild(this._icon),this._initInteraction(),Pr&&Tn&&this.getPane(ct.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Bh(this._icon,"focus",this._panOnFocus,this),Tf(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Tf(this._shadow),this._shadow=null},_setPos:function(ct){this._icon&&ic(this._icon,ct),this._shadow&&ic(this._shadow,ct),this._zIndex=ct.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(ct){this._icon&&(this._icon.style.zIndex=this._zIndex+ct)},_animateZoom:function(ct){var Bt=this._map._latLngToNewLayerPoint(this._latlng,ct.zoom,ct.center).round();this._setPos(Bt)},_initInteraction:function(){if(this.options.interactive&&(Wu(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),B_)){var ct=this.options.draggable;this.dragging&&(ct=this.dragging.enabled(),this.dragging.disable()),this.dragging=new B_(this),ct&&this.dragging.enable()}},setOpacity:function(ct){return this.options.opacity=ct,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var ct=this.options.opacity;this._icon&&m0(this._icon,ct),this._shadow&&m0(this._shadow,ct)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var ct=this._map;if(ct){var Bt=this.options.icon.options,me=Bt.iconSize?mo(Bt.iconSize):mo(0,0),Qe=Bt.iconAnchor?mo(Bt.iconAnchor):mo(0,0);ct.panInside(this._latlng,{paddingTopLeft:Qe,paddingBottomRight:me.subtract(Qe)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function g6(ct,Bt){return new M1(ct,Bt)}var Bm=a0.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(ct){this._renderer=ct.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(ct){return zr(this,ct),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&ct&&Object.prototype.hasOwnProperty.call(ct,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),jy=Bm.extend({options:{fill:!0,radius:10},initialize:function(ct,Bt){zr(this,Bt),this._latlng=Ta(ct),this._radius=this.options.radius},setLatLng:function(ct){var Bt=this._latlng;return this._latlng=Ta(ct),this.redraw(),this.fire("move",{oldLatLng:Bt,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(ct){return this.options.radius=this._radius=ct,this.redraw()},getRadius:function(){return this._radius},setStyle:function(ct){var Bt=ct&&ct.radius||this._radius;return Bm.prototype.setStyle.call(this,ct),this.setRadius(Bt),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var ct=this._radius,Bt=this._radiusY||ct,me=this._clickTolerance(),Qe=[ct+me,Bt+me];this._pxBounds=new ko(this._point.subtract(Qe),this._point.add(Qe))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(ct){return ct.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ww(ct,Bt){return new jy(ct,Bt)}var Uy=jy.extend({initialize:function(ct,Bt,me){if(typeof Bt=="number"&&(Bt=J({},me,{radius:Bt})),zr(this,Bt),this._latlng=Ta(ct),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(ct){return this._mRadius=ct,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var ct=[this._radius,this._radiusY||this._radius];return new fu(this._map.layerPointToLatLng(this._point.subtract(ct)),this._map.layerPointToLatLng(this._point.add(ct)))},setStyle:Bm.prototype.setStyle,_project:function(){var ct=this._latlng.lng,Bt=this._latlng.lat,me=this._map,Qe=me.options.crs;if(Qe.distance===go.distance){var Pr=Math.PI/180,Tn=this._mRadius/go.R/Pr,ji=me.project([Bt+Tn,ct]),Na=me.project([Bt-Tn,ct]),Ya=ji.add(Na).divideBy(2),xo=me.unproject(Ya).lat,Vs=Math.acos((Math.cos(Tn*Pr)-Math.sin(Bt*Pr)*Math.sin(xo*Pr))/(Math.cos(Bt*Pr)*Math.cos(xo*Pr)))/Pr;(isNaN(Vs)||Vs===0)&&(Vs=Tn/Math.cos(Math.PI/180*Bt)),this._point=Ya.subtract(me.getPixelOrigin()),this._radius=isNaN(Vs)?0:Ya.x-me.project([xo,ct-Vs]).x,this._radiusY=Ya.y-ji.y}else{var xl=Qe.unproject(Qe.project(this._latlng).subtract([this._mRadius,0]));this._point=me.latLngToLayerPoint(this._latlng),this._radius=this._point.x-me.latLngToLayerPoint(xl).x}this._updateBounds()}});function vv(ct,Bt,me){return new Uy(ct,Bt,me)}var y0=Bm.extend({options:{smoothFactor:1,noClip:!1},initialize:function(ct,Bt){zr(this,Bt),this._setLatLngs(ct)},getLatLngs:function(){return this._latlngs},setLatLngs:function(ct){return this._setLatLngs(ct),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(ct){for(var Bt=1/0,me=null,Qe=pv,Pr,Tn,ji=0,Na=this._parts.length;ji<Na;ji++)for(var Ya=this._parts[ji],xo=1,Vs=Ya.length;xo<Vs;xo++){Pr=Ya[xo-1],Tn=Ya[xo];var xl=Qe(ct,Pr,Tn,!0);xl<Bt&&(Bt=xl,me=Qe(ct,Pr,Tn))}return me&&(me.distance=Math.sqrt(Bt)),me},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return _w(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(ct,Bt){return Bt=Bt||this._defaultShape(),ct=Ta(ct),Bt.push(ct),this._bounds.extend(ct),this.redraw()},_setLatLngs:function(ct){this._bounds=new fu,this._latlngs=this._convertLatLngs(ct)},_defaultShape:function(){return g0(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(ct){for(var Bt=[],me=g0(ct),Qe=0,Pr=ct.length;Qe<Pr;Qe++)me?(Bt[Qe]=Ta(ct[Qe]),this._bounds.extend(Bt[Qe])):Bt[Qe]=this._convertLatLngs(ct[Qe]);return Bt},_project:function(){var ct=new ko;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,ct),this._bounds.isValid()&&ct.isValid()&&(this._rawPxBounds=ct,this._updateBounds())},_updateBounds:function(){var ct=this._clickTolerance(),Bt=new Va(ct,ct);this._rawPxBounds&&(this._pxBounds=new ko([this._rawPxBounds.min.subtract(Bt),this._rawPxBounds.max.add(Bt)]))},_projectLatlngs:function(ct,Bt,me){var Qe=ct[0]instanceof fo,Pr=ct.length,Tn,ji;if(Qe){for(ji=[],Tn=0;Tn<Pr;Tn++)ji[Tn]=this._map.latLngToLayerPoint(ct[Tn]),me.extend(ji[Tn]);Bt.push(ji)}else for(Tn=0;Tn<Pr;Tn++)this._projectLatlngs(ct[Tn],Bt,me)},_clipPoints:function(){var ct=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(ct))){if(this.options.noClip){this._parts=this._rings;return}var Bt=this._parts,me,Qe,Pr,Tn,ji,Na,Ya;for(me=0,Pr=0,Tn=this._rings.length;me<Tn;me++)for(Ya=this._rings[me],Qe=0,ji=Ya.length;Qe<ji-1;Qe++)Na=O_(Ya[Qe],Ya[Qe+1],ct,Qe,!0),Na&&(Bt[Pr]=Bt[Pr]||[],Bt[Pr].push(Na[0]),(Na[1]!==Ya[Qe+1]||Qe===ji-2)&&(Bt[Pr].push(Na[1]),Pr++))}},_simplifyPoints:function(){for(var ct=this._parts,Bt=this.options.smoothFactor,me=0,Qe=ct.length;me<Qe;me++)ct[me]=z_(ct[me],Bt)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(ct,Bt){var me,Qe,Pr,Tn,ji,Na,Ya=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(ct))return!1;for(me=0,Tn=this._parts.length;me<Tn;me++)for(Na=this._parts[me],Qe=0,ji=Na.length,Pr=ji-1;Qe<ji;Pr=Qe++)if(!(!Bt&&Qe===0)&&vw(ct,Na[Pr],Na[Qe])<=Ya)return!0;return!1}});function kw(ct,Bt){return new y0(ct,Bt)}y0._flat=xw;var yv=y0.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Fy(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(ct){var Bt=y0.prototype._convertLatLngs.call(this,ct),me=Bt.length;return me>=2&&Bt[0]instanceof fo&&Bt[0].equals(Bt[me-1])&&Bt.pop(),Bt},_setLatLngs:function(ct){y0.prototype._setLatLngs.call(this,ct),g0(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return g0(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var ct=this._renderer._bounds,Bt=this.options.weight,me=new Va(Bt,Bt);if(ct=new ko(ct.min.subtract(me),ct.max.add(me)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(ct))){if(this.options.noClip){this._parts=this._rings;return}for(var Qe=0,Pr=this._rings.length,Tn;Qe<Pr;Qe++)Tn=P_(this._rings[Qe],ct,!0),Tn.length&&this._parts.push(Tn)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(ct){var Bt=!1,me,Qe,Pr,Tn,ji,Na,Ya,xo;if(!this._pxBounds||!this._pxBounds.contains(ct))return!1;for(Tn=0,Ya=this._parts.length;Tn<Ya;Tn++)for(me=this._parts[Tn],ji=0,xo=me.length,Na=xo-1;ji<xo;Na=ji++)Qe=me[ji],Pr=me[Na],Qe.y>ct.y!=Pr.y>ct.y&&ct.x<(Pr.x-Qe.x)*(ct.y-Qe.y)/(Pr.y-Qe.y)+Qe.x&&(Bt=!Bt);return Bt||y0.prototype._containsPoint.call(this,ct,!0)}});function v6(ct,Bt){return new yv(ct,Bt)}var pm=bp.extend({initialize:function(ct,Bt){zr(this,Bt),this._layers={},ct&&this.addData(ct)},addData:function(ct){var Bt=kn(ct)?ct:ct.features,me,Qe,Pr;if(Bt){for(me=0,Qe=Bt.length;me<Qe;me++)Pr=Bt[me],(Pr.geometries||Pr.geometry||Pr.features||Pr.coordinates)&&this.addData(Pr);return this}var Tn=this.options;if(Tn.filter&&!Tn.filter(ct))return this;var ji=Vy(ct,Tn);return ji?(ji.feature=qy(ct),ji.defaultOptions=ji.options,this.resetStyle(ji),Tn.onEachFeature&&Tn.onEachFeature(ct,ji),this.addLayer(ji)):this},resetStyle:function(ct){return ct===void 0?this.eachLayer(this.resetStyle,this):(ct.options=J({},ct.defaultOptions),this._setLayerStyle(ct,this.options.style),this)},setStyle:function(ct){return this.eachLayer(function(Bt){this._setLayerStyle(Bt,ct)},this)},_setLayerStyle:function(ct,Bt){ct.setStyle&&(typeof Bt=="function"&&(Bt=Bt(ct.feature)),ct.setStyle(Bt))}});function Vy(ct,Bt){var me=ct.type==="Feature"?ct.geometry:ct,Qe=me?me.coordinates:null,Pr=[],Tn=Bt&&Bt.pointToLayer,ji=Bt&&Bt.coordsToLatLng||N_,Na,Ya,xo,Vs;if(!Qe&&!me)return null;switch(me.type){case"Point":return Na=ji(Qe),Tw(Tn,ct,Na,Bt);case"MultiPoint":for(xo=0,Vs=Qe.length;xo<Vs;xo++)Na=ji(Qe[xo]),Pr.push(Tw(Tn,ct,Na,Bt));return new bp(Pr);case"LineString":case"MultiLineString":return Ya=Hy(Qe,me.type==="LineString"?0:1,ji),new y0(Ya,Bt);case"Polygon":case"MultiPolygon":return Ya=Hy(Qe,me.type==="Polygon"?1:2,ji),new yv(Ya,Bt);case"GeometryCollection":for(xo=0,Vs=me.geometries.length;xo<Vs;xo++){var xl=Vy({geometry:me.geometries[xo],type:"Feature",properties:ct.properties},Bt);xl&&Pr.push(xl)}return new bp(Pr);case"FeatureCollection":for(xo=0,Vs=me.features.length;xo<Vs;xo++){var Du=Vy(me.features[xo],Bt);Du&&Pr.push(Du)}return new bp(Pr);default:throw new Error("Invalid GeoJSON object.")}}function Tw(ct,Bt,me,Qe){return ct?ct(Bt,me):new M1(me,Qe&&Qe.markersInheritOptions&&Qe)}function N_(ct){return new fo(ct[1],ct[0],ct[2])}function Hy(ct,Bt,me){for(var Qe=[],Pr=0,Tn=ct.length,ji;Pr<Tn;Pr++)ji=Bt?Hy(ct[Pr],Bt-1,me):(me||N_)(ct[Pr]),Qe.push(ji);return Qe}function j_(ct,Bt){return ct=Ta(ct),ct.alt!==void 0?[or(ct.lng,Bt),or(ct.lat,Bt),or(ct.alt,Bt)]:[or(ct.lng,Bt),or(ct.lat,Bt)]}function Wy(ct,Bt,me,Qe){for(var Pr=[],Tn=0,ji=ct.length;Tn<ji;Tn++)Pr.push(Bt?Wy(ct[Tn],g0(ct[Tn])?0:Bt-1,me,Qe):j_(ct[Tn],Qe));return!Bt&&me&&Pr.length>0&&Pr.push(Pr[0].slice()),Pr}function mm(ct,Bt){return ct.feature?J({},ct.feature,{geometry:Bt}):qy(Bt)}function qy(ct){return ct.type==="Feature"||ct.type==="FeatureCollection"?ct:{type:"Feature",properties:{},geometry:ct}}var U_={toGeoJSON:function(ct){return mm(this,{type:"Point",coordinates:j_(this.getLatLng(),ct)})}};M1.include(U_),Uy.include(U_),jy.include(U_),y0.include({toGeoJSON:function(ct){var Bt=!g0(this._latlngs),me=Wy(this._latlngs,Bt?1:0,!1,ct);return mm(this,{type:(Bt?"Multi":"")+"LineString",coordinates:me})}}),yv.include({toGeoJSON:function(ct){var Bt=!g0(this._latlngs),me=Bt&&!g0(this._latlngs[0]),Qe=Wy(this._latlngs,me?2:Bt?1:0,!0,ct);return Bt||(Qe=[Qe]),mm(this,{type:(me?"Multi":"")+"Polygon",coordinates:Qe})}}),Tg.include({toMultiPoint:function(ct){var Bt=[];return this.eachLayer(function(me){Bt.push(me.toGeoJSON(ct).geometry.coordinates)}),mm(this,{type:"MultiPoint",coordinates:Bt})},toGeoJSON:function(ct){var Bt=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(Bt==="MultiPoint")return this.toMultiPoint(ct);var me=Bt==="GeometryCollection",Qe=[];return this.eachLayer(function(Pr){if(Pr.toGeoJSON){var Tn=Pr.toGeoJSON(ct);if(me)Qe.push(Tn.geometry);else{var ji=qy(Tn);ji.type==="FeatureCollection"?Qe.push.apply(Qe,ji.features):Qe.push(ji)}}}),me?mm(this,{geometries:Qe,type:"GeometryCollection"}):{type:"FeatureCollection",features:Qe}}});function V_(ct,Bt){return new pm(ct,Bt)}var Zy=V_,gm=a0.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(ct,Bt,me){this._url=ct,this._bounds=qo(Bt),zr(this,me)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Wu(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Tf(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(ct){return this.options.opacity=ct,this._image&&this._updateOpacity(),this},setStyle:function(ct){return ct.opacity&&this.setOpacity(ct.opacity),this},bringToFront:function(){return this._map&&hv(this._image),this},bringToBack:function(){return this._map&&bn(this._image),this},setUrl:function(ct){return this._url=ct,this._image&&(this._image.src=ct),this},setBounds:function(ct){return this._bounds=qo(ct),this._map&&this._reset(),this},getEvents:function(){var ct={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(ct.zoomanim=this._animateZoom),ct},setZIndex:function(ct){return this.options.zIndex=ct,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var ct=this._url.tagName==="IMG",Bt=this._image=ct?this._url:Cc("img");if(Wu(Bt,"leaflet-image-layer"),this._zoomAnimated&&Wu(Bt,"leaflet-zoom-animated"),this.options.className&&Wu(Bt,this.options.className),Bt.onselectstart=Ne,Bt.onmousemove=Ne,Bt.onload=kt(this.fire,this,"load"),Bt.onerror=kt(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(Bt.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),ct){this._url=Bt.src;return}Bt.src=this._url,Bt.alt=this.options.alt},_animateZoom:function(ct){var Bt=this._map.getZoomScale(ct.zoom),me=this._map._latLngBoundsToNewLayerBounds(this._bounds,ct.zoom,ct.center).min;pu(this._image,me,Bt)},_reset:function(){var ct=this._image,Bt=new ko(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),me=Bt.getSize();ic(ct,Bt.min),ct.style.width=me.x+"px",ct.style.height=me.y+"px"},_updateOpacity:function(){m0(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var ct=this.options.errorOverlayUrl;ct&&this._url!==ct&&(this._url=ct,this._image.src=ct)},getCenter:function(){return this._bounds.getCenter()}}),vm=function(ct,Bt,me){return new gm(ct,Bt,me)},z0=gm.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var ct=this._url.tagName==="VIDEO",Bt=this._image=ct?this._url:Cc("video");if(Wu(Bt,"leaflet-image-layer"),this._zoomAnimated&&Wu(Bt,"leaflet-zoom-animated"),this.options.className&&Wu(Bt,this.options.className),Bt.onselectstart=Ne,Bt.onmousemove=Ne,Bt.onloadeddata=kt(this.fire,this,"load"),ct){for(var me=Bt.getElementsByTagName("source"),Qe=[],Pr=0;Pr<me.length;Pr++)Qe.push(me[Pr].src);this._url=me.length>0?Qe:[Bt.src];return}kn(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(Bt.style,"objectFit")&&(Bt.style.objectFit="fill"),Bt.autoplay=!!this.options.autoplay,Bt.loop=!!this.options.loop,Bt.muted=!!this.options.muted,Bt.playsInline=!!this.options.playsInline;for(var Tn=0;Tn<this._url.length;Tn++){var ji=Cc("source");ji.src=this._url[Tn],Bt.appendChild(ji)}}});function tf(ct,Bt,me){return new z0(ct,Bt,me)}var H_=gm.extend({_initImage:function(){var ct=this._image=this._url;Wu(ct,"leaflet-image-layer"),this._zoomAnimated&&Wu(ct,"leaflet-zoom-animated"),this.options.className&&Wu(ct,this.options.className),ct.onselectstart=Ne,ct.onmousemove=Ne}});function y6(ct,Bt,me){return new H_(ct,Bt,me)}var X0=a0.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(ct,Bt){ct&&(ct instanceof fo||kn(ct))?(this._latlng=Ta(ct),zr(this,Bt)):(zr(this,ct),this._source=Bt),this.options.content&&(this._content=this.options.content)},openOn:function(ct){return ct=arguments.length?ct:this._source._map,ct.hasLayer(this)||ct.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(ct){return this._map?this.close():(arguments.length?this._source=ct:ct=this._source,this._prepareOpen(),this.openOn(ct._map)),this},onAdd:function(ct){this._zoomAnimated=ct._zoomAnimated,this._container||this._initLayout(),ct._fadeAnimated&&m0(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),ct._fadeAnimated&&m0(this._container,1),this.bringToFront(),this.options.interactive&&(Wu(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(ct){ct._fadeAnimated?(m0(this._container,0),this._removeTimeout=setTimeout(kt(Tf,void 0,this._container),200)):Tf(this._container),this.options.interactive&&(Rf(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(ct){return this._latlng=Ta(ct),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(ct){return this._content=ct,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var ct={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(ct.zoomanim=this._animateZoom),ct},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&hv(this._container),this},bringToBack:function(){return this._map&&bn(this._container),this},_prepareOpen:function(ct){var Bt=this._source;if(!Bt._map)return!1;if(Bt instanceof bp){Bt=null;var me=this._source._layers;for(var Qe in me)if(me[Qe]._map){Bt=me[Qe];break}if(!Bt)return!1;this._source=Bt}if(!ct)if(Bt.getCenter)ct=Bt.getCenter();else if(Bt.getLatLng)ct=Bt.getLatLng();else if(Bt.getBounds)ct=Bt.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(ct),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var ct=this._contentNode,Bt=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof Bt=="string")ct.innerHTML=Bt;else{for(;ct.hasChildNodes();)ct.removeChild(ct.firstChild);ct.appendChild(Bt)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var ct=this._map.latLngToLayerPoint(this._latlng),Bt=mo(this.options.offset),me=this._getAnchor();this._zoomAnimated?ic(this._container,ct.add(me)):Bt=Bt.add(ct).add(me);var Qe=this._containerBottom=-Bt.y,Pr=this._containerLeft=-Math.round(this._containerWidth/2)+Bt.x;this._container.style.bottom=Qe+"px",this._container.style.left=Pr+"px"}},_getAnchor:function(){return[0,0]}});Mc.include({_initOverlay:function(ct,Bt,me,Qe){var Pr=Bt;return Pr instanceof ct||(Pr=new ct(Qe).setContent(Bt)),me&&Pr.setLatLng(me),Pr}}),a0.include({_initOverlay:function(ct,Bt,me,Qe){var Pr=me;return Pr instanceof ct?(zr(Pr,Qe),Pr._source=this):(Pr=Bt&&!Qe?Bt:new ct(Qe,this),Pr.setContent(me)),Pr}});var Ag=X0.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(ct){return ct=arguments.length?ct:this._source._map,!ct.hasLayer(this)&&ct._popup&&ct._popup.options.autoClose&&ct.removeLayer(ct._popup),ct._popup=this,X0.prototype.openOn.call(this,ct)},onAdd:function(ct){X0.prototype.onAdd.call(this,ct),ct.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Bm||this._source.on("preclick",n0))},onRemove:function(ct){X0.prototype.onRemove.call(this,ct),ct.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Bm||this._source.off("preclick",n0))},getEvents:function(){var ct=X0.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(ct.preclick=this.close),this.options.keepInView&&(ct.moveend=this._adjustPan),ct},_initLayout:function(){var ct="leaflet-popup",Bt=this._container=Cc("div",ct+" "+(this.options.className||"")+" leaflet-zoom-animated"),me=this._wrapper=Cc("div",ct+"-content-wrapper",Bt);if(this._contentNode=Cc("div",ct+"-content",me),fv(Bt),dm(this._contentNode),Pu(Bt,"contextmenu",n0),this._tipContainer=Cc("div",ct+"-tip-container",Bt),this._tip=Cc("div",ct+"-tip",this._tipContainer),this.options.closeButton){var Qe=this._closeButton=Cc("a",ct+"-close-button",Bt);Qe.setAttribute("role","button"),Qe.setAttribute("aria-label","Close popup"),Qe.href="#close",Qe.innerHTML='<span aria-hidden="true">&#215;</span>',Pu(Qe,"click",function(Pr){mc(Pr),this.close()},this)}},_updateLayout:function(){var ct=this._contentNode,Bt=ct.style;Bt.width="",Bt.whiteSpace="nowrap";var me=ct.offsetWidth;me=Math.min(me,this.options.maxWidth),me=Math.max(me,this.options.minWidth),Bt.width=me+1+"px",Bt.whiteSpace="",Bt.height="";var Qe=ct.offsetHeight,Pr=this.options.maxHeight,Tn="leaflet-popup-scrolled";Pr&&Qe>Pr?(Bt.height=Pr+"px",Wu(ct,Tn)):Rf(ct,Tn),this._containerWidth=this._container.offsetWidth},_animateZoom:function(ct){var Bt=this._map._latLngToNewLayerPoint(this._latlng,ct.zoom,ct.center),me=this._getAnchor();ic(this._container,Bt.add(me))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var ct=this._map,Bt=parseInt(w1(this._container,"marginBottom"),10)||0,me=this._container.offsetHeight+Bt,Qe=this._containerWidth,Pr=new Va(this._containerLeft,-me-this._containerBottom);Pr._add(Rc(this._container));var Tn=ct.layerPointToContainerPoint(Pr),ji=mo(this.options.autoPanPadding),Na=mo(this.options.autoPanPaddingTopLeft||ji),Ya=mo(this.options.autoPanPaddingBottomRight||ji),xo=ct.getSize(),Vs=0,xl=0;Tn.x+Qe+Ya.x>xo.x&&(Vs=Tn.x+Qe-xo.x+Ya.x),Tn.x-Vs-Na.x<0&&(Vs=Tn.x-Na.x),Tn.y+me+Ya.y>xo.y&&(xl=Tn.y+me-xo.y+Ya.y),Tn.y-xl-Na.y<0&&(xl=Tn.y-Na.y),(Vs||xl)&&(this.options.keepInView&&(this._autopanning=!0),ct.fire("autopanstart").panBy([Vs,xl]))}},_getAnchor:function(){return mo(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),vf=function(ct,Bt){return new Ag(ct,Bt)};Mc.mergeOptions({closePopupOnClick:!0}),Mc.include({openPopup:function(ct,Bt,me){return this._initOverlay(Ag,ct,Bt,me).openOn(this),this},closePopup:function(ct){return ct=arguments.length?ct:this._popup,ct&&ct.close(),this}}),a0.include({bindPopup:function(ct,Bt){return this._popup=this._initOverlay(Ag,this._popup,ct,Bt),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(ct){return this._popup&&(this instanceof bp||(this._popup._source=this),this._popup._prepareOpen(ct||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(ct){return this._popup&&this._popup.setContent(ct),this},getPopup:function(){return this._popup},_openPopup:function(ct){if(!(!this._popup||!this._map)){vg(ct);var Bt=ct.layer||ct.target;if(this._popup._source===Bt&&!(Bt instanceof Bm)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(ct.latlng);return}this._popup._source=Bt,this.openPopup(ct.latlng)}},_movePopup:function(ct){this._popup.setLatLng(ct.latlng)},_onKeyPress:function(ct){ct.originalEvent.keyCode===13&&this._openPopup(ct)}});var S1=X0.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(ct){X0.prototype.onAdd.call(this,ct),this.setOpacity(this.options.opacity),ct.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(ct){X0.prototype.onRemove.call(this,ct),ct.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var ct=X0.prototype.getEvents.call(this);return this.options.permanent||(ct.preclick=this.close),ct},_initLayout:function(){var ct="leaflet-tooltip",Bt=ct+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Cc("div",Bt),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+Gt(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(ct){var Bt,me,Qe=this._map,Pr=this._container,Tn=Qe.latLngToContainerPoint(Qe.getCenter()),ji=Qe.layerPointToContainerPoint(ct),Na=this.options.direction,Ya=Pr.offsetWidth,xo=Pr.offsetHeight,Vs=mo(this.options.offset),xl=this._getAnchor();Na==="top"?(Bt=Ya/2,me=xo):Na==="bottom"?(Bt=Ya/2,me=0):Na==="center"?(Bt=Ya/2,me=xo/2):Na==="right"?(Bt=0,me=xo/2):Na==="left"?(Bt=Ya,me=xo/2):ji.x<Tn.x?(Na="right",Bt=0,me=xo/2):(Na="left",Bt=Ya+(Vs.x+xl.x)*2,me=xo/2),ct=ct.subtract(mo(Bt,me,!0)).add(Vs).add(xl),Rf(Pr,"leaflet-tooltip-right"),Rf(Pr,"leaflet-tooltip-left"),Rf(Pr,"leaflet-tooltip-top"),Rf(Pr,"leaflet-tooltip-bottom"),Wu(Pr,"leaflet-tooltip-"+Na),ic(Pr,ct)},_updatePosition:function(){var ct=this._map.latLngToLayerPoint(this._latlng);this._setPosition(ct)},setOpacity:function(ct){this.options.opacity=ct,this._container&&m0(this._container,ct)},_animateZoom:function(ct){var Bt=this._map._latLngToNewLayerPoint(this._latlng,ct.zoom,ct.center);this._setPosition(Bt)},_getAnchor:function(){return mo(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Aw=function(ct,Bt){return new S1(ct,Bt)};Mc.include({openTooltip:function(ct,Bt,me){return this._initOverlay(S1,ct,Bt,me).openOn(this),this},closeTooltip:function(ct){return ct.close(),this}}),a0.include({bindTooltip:function(ct,Bt){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(S1,this._tooltip,ct,Bt),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(ct){if(!(!ct&&this._tooltipHandlersAdded)){var Bt=ct?"off":"on",me={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?me.add=this._openTooltip:(me.mouseover=this._openTooltip,me.mouseout=this.closeTooltip,me.click=this._openTooltip,this._map?this._addFocusListeners():me.add=this._addFocusListeners),this._tooltip.options.sticky&&(me.mousemove=this._moveTooltip),this[Bt](me),this._tooltipHandlersAdded=!ct}},openTooltip:function(ct){return this._tooltip&&(this instanceof bp||(this._tooltip._source=this),this._tooltip._prepareOpen(ct)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(ct){return this._tooltip&&this._tooltip.setContent(ct),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(ct){var Bt=typeof ct.getElement=="function"&&ct.getElement();Bt&&(Pu(Bt,"focus",function(){this._tooltip._source=ct,this.openTooltip()},this),Pu(Bt,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(ct){var Bt=typeof ct.getElement=="function"&&ct.getElement();Bt&&Bt.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(ct){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var Bt=this;this._map.once("moveend",function(){Bt._openOnceFlag=!1,Bt._openTooltip(ct)});return}this._tooltip._source=ct.layer||ct.target,this.openTooltip(this._tooltip.options.sticky?ct.latlng:void 0)}},_moveTooltip:function(ct){var Bt=ct.latlng,me,Qe;this._tooltip.options.sticky&&ct.originalEvent&&(me=this._map.mouseEventToContainerPoint(ct.originalEvent),Qe=this._map.containerPointToLayerPoint(me),Bt=this._map.layerPointToLatLng(Qe)),this._tooltip.setLatLng(Bt)}});var Mw=Rm.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(ct){var Bt=ct&&ct.tagName==="DIV"?ct:document.createElement("div"),me=this.options;if(me.html instanceof Element?(Oy(Bt),Bt.appendChild(me.html)):Bt.innerHTML=me.html!==!1?me.html:"",me.bgPos){var Qe=mo(me.bgPos);Bt.style.backgroundPosition=-Qe.x+"px "+-Qe.y+"px"}return this._setIconStyles(Bt,"icon"),Bt},createShadow:function(){return null}});function x6(ct){return new Mw(ct)}Rm.Default=gv;var E1=a0.extend({options:{tileSize:256,opacity:1,updateWhenIdle:El.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(ct){zr(this,ct)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(ct){ct._addZoomLimit(this)},onRemove:function(ct){this._removeAllTiles(),Tf(this._container),ct._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(hv(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(bn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(ct){return this.options.opacity=ct,this._updateOpacity(),this},setZIndex:function(ct){return this.options.zIndex=ct,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var ct=this._clampZoom(this._map.getZoom());ct!==this._tileZoom&&(this._tileZoom=ct,this._updateLevels()),this._update()}return this},getEvents:function(){var ct={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=re(this._onMoveEnd,this.options.updateInterval,this)),ct.move=this._onMove),this._zoomAnimated&&(ct.zoomanim=this._animateZoom),ct},createTile:function(){return document.createElement("div")},getTileSize:function(){var ct=this.options.tileSize;return ct instanceof Va?ct:new Va(ct,ct)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(ct){for(var Bt=this.getPane().children,me=-ct(-1/0,1/0),Qe=0,Pr=Bt.length,Tn;Qe<Pr;Qe++)Tn=Bt[Qe].style.zIndex,Bt[Qe]!==this._container&&Tn&&(me=ct(me,+Tn));isFinite(me)&&(this.options.zIndex=me+ct(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!El.ielt9){m0(this._container,this.options.opacity);var ct=+new Date,Bt=!1,me=!1;for(var Qe in this._tiles){var Pr=this._tiles[Qe];if(!(!Pr.current||!Pr.loaded)){var Tn=Math.min(1,(ct-Pr.loaded)/200);m0(Pr.el,Tn),Tn<1?Bt=!0:(Pr.active?me=!0:this._onOpaqueTile(Pr),Pr.active=!0)}}me&&!this._noPrune&&this._pruneTiles(),Bt&&(Li(this._fadeFrame),this._fadeFrame=fa(this._updateOpacity,this))}},_onOpaqueTile:Ne,_initContainer:function(){this._container||(this._container=Cc("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var ct=this._tileZoom,Bt=this.options.maxZoom;if(ct!==void 0){for(var me in this._levels)me=Number(me),this._levels[me].el.children.length||me===ct?(this._levels[me].el.style.zIndex=Bt-Math.abs(ct-me),this._onUpdateLevel(me)):(Tf(this._levels[me].el),this._removeTilesAtZoom(me),this._onRemoveLevel(me),delete this._levels[me]);var Qe=this._levels[ct],Pr=this._map;return Qe||(Qe=this._levels[ct]={},Qe.el=Cc("div","leaflet-tile-container leaflet-zoom-animated",this._container),Qe.el.style.zIndex=Bt,Qe.origin=Pr.project(Pr.unproject(Pr.getPixelOrigin()),ct).round(),Qe.zoom=ct,this._setZoomTransform(Qe,Pr.getCenter(),Pr.getZoom()),Ne(Qe.el.offsetWidth),this._onCreateLevel(Qe)),this._level=Qe,Qe}},_onUpdateLevel:Ne,_onRemoveLevel:Ne,_onCreateLevel:Ne,_pruneTiles:function(){if(this._map){var ct,Bt,me=this._map.getZoom();if(me>this.options.maxZoom||me<this.options.minZoom){this._removeAllTiles();return}for(ct in this._tiles)Bt=this._tiles[ct],Bt.retain=Bt.current;for(ct in this._tiles)if(Bt=this._tiles[ct],Bt.current&&!Bt.active){var Qe=Bt.coords;this._retainParent(Qe.x,Qe.y,Qe.z,Qe.z-5)||this._retainChildren(Qe.x,Qe.y,Qe.z,Qe.z+2)}for(ct in this._tiles)this._tiles[ct].retain||this._removeTile(ct)}},_removeTilesAtZoom:function(ct){for(var Bt in this._tiles)this._tiles[Bt].coords.z===ct&&this._removeTile(Bt)},_removeAllTiles:function(){for(var ct in this._tiles)this._removeTile(ct)},_invalidateAll:function(){for(var ct in this._levels)Tf(this._levels[ct].el),this._onRemoveLevel(Number(ct)),delete this._levels[ct];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(ct,Bt,me,Qe){var Pr=Math.floor(ct/2),Tn=Math.floor(Bt/2),ji=me-1,Na=new Va(+Pr,+Tn);Na.z=+ji;var Ya=this._tileCoordsToKey(Na),xo=this._tiles[Ya];return xo&&xo.active?(xo.retain=!0,!0):(xo&&xo.loaded&&(xo.retain=!0),ji>Qe?this._retainParent(Pr,Tn,ji,Qe):!1)},_retainChildren:function(ct,Bt,me,Qe){for(var Pr=2*ct;Pr<2*ct+2;Pr++)for(var Tn=2*Bt;Tn<2*Bt+2;Tn++){var ji=new Va(Pr,Tn);ji.z=me+1;var Na=this._tileCoordsToKey(ji),Ya=this._tiles[Na];if(Ya&&Ya.active){Ya.retain=!0;continue}else Ya&&Ya.loaded&&(Ya.retain=!0);me+1<Qe&&this._retainChildren(Pr,Tn,me+1,Qe)}},_resetView:function(ct){var Bt=ct&&(ct.pinch||ct.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),Bt,Bt)},_animateZoom:function(ct){this._setView(ct.center,ct.zoom,!0,ct.noUpdate)},_clampZoom:function(ct){var Bt=this.options;return Bt.minNativeZoom!==void 0&&ct<Bt.minNativeZoom?Bt.minNativeZoom:Bt.maxNativeZoom!==void 0&&Bt.maxNativeZoom<ct?Bt.maxNativeZoom:ct},_setView:function(ct,Bt,me,Qe){var Pr=Math.round(Bt);this.options.maxZoom!==void 0&&Pr>this.options.maxZoom||this.options.minZoom!==void 0&&Pr<this.options.minZoom?Pr=void 0:Pr=this._clampZoom(Pr);var Tn=this.options.updateWhenZooming&&Pr!==this._tileZoom;(!Qe||Tn)&&(this._tileZoom=Pr,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),Pr!==void 0&&this._update(ct),me||this._pruneTiles(),this._noPrune=!!me),this._setZoomTransforms(ct,Bt)},_setZoomTransforms:function(ct,Bt){for(var me in this._levels)this._setZoomTransform(this._levels[me],ct,Bt)},_setZoomTransform:function(ct,Bt,me){var Qe=this._map.getZoomScale(me,ct.zoom),Pr=ct.origin.multiplyBy(Qe).subtract(this._map._getNewPixelOrigin(Bt,me)).round();El.any3d?pu(ct.el,Pr,Qe):ic(ct.el,Pr)},_resetGrid:function(){var ct=this._map,Bt=ct.options.crs,me=this._tileSize=this.getTileSize(),Qe=this._tileZoom,Pr=this._map.getPixelWorldBounds(this._tileZoom);Pr&&(this._globalTileRange=this._pxBoundsToTileRange(Pr)),this._wrapX=Bt.wrapLng&&!this.options.noWrap&&[Math.floor(ct.project([0,Bt.wrapLng[0]],Qe).x/me.x),Math.ceil(ct.project([0,Bt.wrapLng[1]],Qe).x/me.y)],this._wrapY=Bt.wrapLat&&!this.options.noWrap&&[Math.floor(ct.project([Bt.wrapLat[0],0],Qe).y/me.x),Math.ceil(ct.project([Bt.wrapLat[1],0],Qe).y/me.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(ct){var Bt=this._map,me=Bt._animatingZoom?Math.max(Bt._animateToZoom,Bt.getZoom()):Bt.getZoom(),Qe=Bt.getZoomScale(me,this._tileZoom),Pr=Bt.project(ct,this._tileZoom).floor(),Tn=Bt.getSize().divideBy(Qe*2);return new ko(Pr.subtract(Tn),Pr.add(Tn))},_update:function(ct){var Bt=this._map;if(Bt){var me=this._clampZoom(Bt.getZoom());if(ct===void 0&&(ct=Bt.getCenter()),this._tileZoom!==void 0){var Qe=this._getTiledPixelBounds(ct),Pr=this._pxBoundsToTileRange(Qe),Tn=Pr.getCenter(),ji=[],Na=this.options.keepBuffer,Ya=new ko(Pr.getBottomLeft().subtract([Na,-Na]),Pr.getTopRight().add([Na,-Na]));if(!(isFinite(Pr.min.x)&&isFinite(Pr.min.y)&&isFinite(Pr.max.x)&&isFinite(Pr.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var xo in this._tiles){var Vs=this._tiles[xo].coords;(Vs.z!==this._tileZoom||!Ya.contains(new Va(Vs.x,Vs.y)))&&(this._tiles[xo].current=!1)}if(Math.abs(me-this._tileZoom)>1){this._setView(ct,me);return}for(var xl=Pr.min.y;xl<=Pr.max.y;xl++)for(var Du=Pr.min.x;Du<=Pr.max.x;Du++){var Sd=new Va(Du,xl);if(Sd.z=this._tileZoom,!!this._isValidTile(Sd)){var Bf=this._tiles[this._tileCoordsToKey(Sd)];Bf?Bf.current=!0:ji.push(Sd)}}if(ji.sort(function(wp,jm){return wp.distanceTo(Tn)-jm.distanceTo(Tn)}),ji.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var _0=document.createDocumentFragment();for(Du=0;Du<ji.length;Du++)this._addTile(ji[Du],_0);this._level.el.appendChild(_0)}}}},_isValidTile:function(ct){var Bt=this._map.options.crs;if(!Bt.infinite){var me=this._globalTileRange;if(!Bt.wrapLng&&(ct.x<me.min.x||ct.x>me.max.x)||!Bt.wrapLat&&(ct.y<me.min.y||ct.y>me.max.y))return!1}if(!this.options.bounds)return!0;var Qe=this._tileCoordsToBounds(ct);return qo(this.options.bounds).overlaps(Qe)},_keyToBounds:function(ct){return this._tileCoordsToBounds(this._keyToTileCoords(ct))},_tileCoordsToNwSe:function(ct){var Bt=this._map,me=this.getTileSize(),Qe=ct.scaleBy(me),Pr=Qe.add(me),Tn=Bt.unproject(Qe,ct.z),ji=Bt.unproject(Pr,ct.z);return[Tn,ji]},_tileCoordsToBounds:function(ct){var Bt=this._tileCoordsToNwSe(ct),me=new fu(Bt[0],Bt[1]);return this.options.noWrap||(me=this._map.wrapLatLngBounds(me)),me},_tileCoordsToKey:function(ct){return ct.x+":"+ct.y+":"+ct.z},_keyToTileCoords:function(ct){var Bt=ct.split(":"),me=new Va(+Bt[0],+Bt[1]);return me.z=+Bt[2],me},_removeTile:function(ct){var Bt=this._tiles[ct];Bt&&(Tf(Bt.el),delete this._tiles[ct],this.fire("tileunload",{tile:Bt.el,coords:this._keyToTileCoords(ct)}))},_initTile:function(ct){Wu(ct,"leaflet-tile");var Bt=this.getTileSize();ct.style.width=Bt.x+"px",ct.style.height=Bt.y+"px",ct.onselectstart=Ne,ct.onmousemove=Ne,El.ielt9&&this.options.opacity<1&&m0(ct,this.options.opacity)},_addTile:function(ct,Bt){var me=this._getTilePos(ct),Qe=this._tileCoordsToKey(ct),Pr=this.createTile(this._wrapCoords(ct),kt(this._tileReady,this,ct));this._initTile(Pr),this.createTile.length<2&&fa(kt(this._tileReady,this,ct,null,Pr)),ic(Pr,me),this._tiles[Qe]={el:Pr,coords:ct,current:!0},Bt.appendChild(Pr),this.fire("tileloadstart",{tile:Pr,coords:ct})},_tileReady:function(ct,Bt,me){Bt&&this.fire("tileerror",{error:Bt,tile:me,coords:ct});var Qe=this._tileCoordsToKey(ct);me=this._tiles[Qe],me&&(me.loaded=+new Date,this._map._fadeAnimated?(m0(me.el,0),Li(this._fadeFrame),this._fadeFrame=fa(this._updateOpacity,this)):(me.active=!0,this._pruneTiles()),Bt||(Wu(me.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:me.el,coords:ct})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),El.ielt9||!this._map._fadeAnimated?fa(this._pruneTiles,this):setTimeout(kt(this._pruneTiles,this),250)))},_getTilePos:function(ct){return ct.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(ct){var Bt=new Va(this._wrapX?pe(ct.x,this._wrapX):ct.x,this._wrapY?pe(ct.y,this._wrapY):ct.y);return Bt.z=ct.z,Bt},_pxBoundsToTileRange:function(ct){var Bt=this.getTileSize();return new ko(ct.min.unscaleBy(Bt).floor(),ct.max.unscaleBy(Bt).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var ct in this._tiles)if(!this._tiles[ct].loaded)return!1;return!0}});function W_(ct){return new E1(ct)}var o0=E1.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(ct,Bt){this._url=ct,Bt=zr(this,Bt),Bt.detectRetina&&El.retina&&Bt.maxZoom>0?(Bt.tileSize=Math.floor(Bt.tileSize/2),Bt.zoomReverse?(Bt.zoomOffset--,Bt.minZoom=Math.min(Bt.maxZoom,Bt.minZoom+1)):(Bt.zoomOffset++,Bt.maxZoom=Math.max(Bt.minZoom,Bt.maxZoom-1)),Bt.minZoom=Math.max(0,Bt.minZoom)):Bt.zoomReverse?Bt.minZoom=Math.min(Bt.maxZoom,Bt.minZoom):Bt.maxZoom=Math.max(Bt.minZoom,Bt.maxZoom),typeof Bt.subdomains=="string"&&(Bt.subdomains=Bt.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(ct,Bt){return this._url===ct&&Bt===void 0&&(Bt=!0),this._url=ct,Bt||this.redraw(),this},createTile:function(ct,Bt){var me=document.createElement("img");return Pu(me,"load",kt(this._tileOnLoad,this,Bt,me)),Pu(me,"error",kt(this._tileOnError,this,Bt,me)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(me.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(me.referrerPolicy=this.options.referrerPolicy),me.alt="",me.src=this.getTileUrl(ct),me},getTileUrl:function(ct){var Bt={r:El.retina?"@2x":"",s:this._getSubdomain(ct),x:ct.x,y:ct.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var me=this._globalTileRange.max.y-ct.y;this.options.tms&&(Bt.y=me),Bt["-y"]=me}return Ft(this._url,J(Bt,this.options))},_tileOnLoad:function(ct,Bt){El.ielt9?setTimeout(kt(ct,this,null,Bt),0):ct(null,Bt)},_tileOnError:function(ct,Bt,me){var Qe=this.options.errorTileUrl;Qe&&Bt.getAttribute("src")!==Qe&&(Bt.src=Qe),ct(me,Bt)},_onTileRemove:function(ct){ct.tile.onload=null},_getZoomForUrl:function(){var ct=this._tileZoom,Bt=this.options.maxZoom,me=this.options.zoomReverse,Qe=this.options.zoomOffset;return me&&(ct=Bt-ct),ct+Qe},_getSubdomain:function(ct){var Bt=Math.abs(ct.x+ct.y)%this.options.subdomains.length;return this.options.subdomains[Bt]},_abortLoading:function(){var ct,Bt;for(ct in this._tiles)if(this._tiles[ct].coords.z!==this._tileZoom&&(Bt=this._tiles[ct].el,Bt.onload=Ne,Bt.onerror=Ne,!Bt.complete)){Bt.src=jn;var me=this._tiles[ct].coords;Tf(Bt),delete this._tiles[ct],this.fire("tileabort",{tile:Bt,coords:me})}},_removeTile:function(ct){var Bt=this._tiles[ct];if(Bt)return Bt.el.setAttribute("src",jn),E1.prototype._removeTile.call(this,ct)},_tileReady:function(ct,Bt,me){if(!(!this._map||me&&me.getAttribute("src")===jn))return E1.prototype._tileReady.call(this,ct,Bt,me)}});function $y(ct,Bt){return new o0(ct,Bt)}var Gy=o0.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(ct,Bt){this._url=ct;var me=J({},this.defaultWmsParams);for(var Qe in Bt)Qe in this.options||(me[Qe]=Bt[Qe]);Bt=zr(this,Bt);var Pr=Bt.detectRetina&&El.retina?2:1,Tn=this.getTileSize();me.width=Tn.x*Pr,me.height=Tn.y*Pr,this.wmsParams=me},onAdd:function(ct){this._crs=this.options.crs||ct.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var Bt=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[Bt]=this._crs.code,o0.prototype.onAdd.call(this,ct)},getTileUrl:function(ct){var Bt=this._tileCoordsToNwSe(ct),me=this._crs,Qe=pl(me.project(Bt[0]),me.project(Bt[1])),Pr=Qe.min,Tn=Qe.max,ji=(this._wmsVersion>=1.3&&this._crs===By?[Pr.y,Pr.x,Tn.y,Tn.x]:[Pr.x,Pr.y,Tn.x,Tn.y]).join(","),Na=o0.prototype.getTileUrl.call(this,ct);return Na+Wr(this.wmsParams,Na,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ji},setParams:function(ct,Bt){return J(this.wmsParams,ct),Bt||this.redraw(),this}});function Sw(ct,Bt){return new Gy(ct,Bt)}o0.WMS=Gy,$y.wms=Sw;var ym=a0.extend({options:{padding:.1},initialize:function(ct){zr(this,ct),Gt(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Wu(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var ct={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(ct.zoomanim=this._onAnimZoom),ct},_onAnimZoom:function(ct){this._updateTransform(ct.center,ct.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(ct,Bt){var me=this._map.getZoomScale(Bt,this._zoom),Qe=this._map.getSize().multiplyBy(.5+this.options.padding),Pr=this._map.project(this._center,Bt),Tn=Qe.multiplyBy(-me).add(Pr).subtract(this._map._getNewPixelOrigin(ct,Bt));El.any3d?pu(this._container,Tn,me):ic(this._container,Tn)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var ct in this._layers)this._layers[ct]._reset()},_onZoomEnd:function(){for(var ct in this._layers)this._layers[ct]._project()},_updatePaths:function(){for(var ct in this._layers)this._layers[ct]._update()},_update:function(){var ct=this.options.padding,Bt=this._map.getSize(),me=this._map.containerPointToLayerPoint(Bt.multiplyBy(-ct)).round();this._bounds=new ko(me,me.add(Bt.multiplyBy(1+ct*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Ew=ym.extend({options:{tolerance:0},getEvents:function(){var ct=ym.prototype.getEvents.call(this);return ct.viewprereset=this._onViewPreReset,ct},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ym.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var ct=this._container=document.createElement("canvas");Pu(ct,"mousemove",this._onMouseMove,this),Pu(ct,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Pu(ct,"mouseout",this._handleMouseOut,this),ct._leaflet_disable_events=!0,this._ctx=ct.getContext("2d")},_destroyContainer:function(){Li(this._redrawRequest),delete this._ctx,Tf(this._container),Bh(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var ct;this._redrawBounds=null;for(var Bt in this._layers)ct=this._layers[Bt],ct._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ym.prototype._update.call(this);var ct=this._bounds,Bt=this._container,me=ct.getSize(),Qe=El.retina?2:1;ic(Bt,ct.min),Bt.width=Qe*me.x,Bt.height=Qe*me.y,Bt.style.width=me.x+"px",Bt.style.height=me.y+"px",El.retina&&this._ctx.scale(2,2),this._ctx.translate(-ct.min.x,-ct.min.y),this.fire("update")}},_reset:function(){ym.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(ct){this._updateDashArray(ct),this._layers[Gt(ct)]=ct;var Bt=ct._order={layer:ct,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=Bt),this._drawLast=Bt,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(ct){this._requestRedraw(ct)},_removePath:function(ct){var Bt=ct._order,me=Bt.next,Qe=Bt.prev;me?me.prev=Qe:this._drawLast=Qe,Qe?Qe.next=me:this._drawFirst=me,delete ct._order,delete this._layers[Gt(ct)],this._requestRedraw(ct)},_updatePath:function(ct){this._extendRedrawBounds(ct),ct._project(),ct._update(),this._requestRedraw(ct)},_updateStyle:function(ct){this._updateDashArray(ct),this._requestRedraw(ct)},_updateDashArray:function(ct){if(typeof ct.options.dashArray=="string"){var Bt=ct.options.dashArray.split(/[, ]+/),me=[],Qe,Pr;for(Pr=0;Pr<Bt.length;Pr++){if(Qe=Number(Bt[Pr]),isNaN(Qe))return;me.push(Qe)}ct.options._dashArray=me}else ct.options._dashArray=ct.options.dashArray},_requestRedraw:function(ct){this._map&&(this._extendRedrawBounds(ct),this._redrawRequest=this._redrawRequest||fa(this._redraw,this))},_extendRedrawBounds:function(ct){if(ct._pxBounds){var Bt=(ct.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new ko,this._redrawBounds.extend(ct._pxBounds.min.subtract([Bt,Bt])),this._redrawBounds.extend(ct._pxBounds.max.add([Bt,Bt]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var ct=this._redrawBounds;if(ct){var Bt=ct.getSize();this._ctx.clearRect(ct.min.x,ct.min.y,Bt.x,Bt.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var ct,Bt=this._redrawBounds;if(this._ctx.save(),Bt){var me=Bt.getSize();this._ctx.beginPath(),this._ctx.rect(Bt.min.x,Bt.min.y,me.x,me.y),this._ctx.clip()}this._drawing=!0;for(var Qe=this._drawFirst;Qe;Qe=Qe.next)ct=Qe.layer,(!Bt||ct._pxBounds&&ct._pxBounds.intersects(Bt))&&ct._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(ct,Bt){if(this._drawing){var me,Qe,Pr,Tn,ji=ct._parts,Na=ji.length,Ya=this._ctx;if(Na){for(Ya.beginPath(),me=0;me<Na;me++){for(Qe=0,Pr=ji[me].length;Qe<Pr;Qe++)Tn=ji[me][Qe],Ya[Qe?"lineTo":"moveTo"](Tn.x,Tn.y);Bt&&Ya.closePath()}this._fillStroke(Ya,ct)}}},_updateCircle:function(ct){if(!(!this._drawing||ct._empty())){var Bt=ct._point,me=this._ctx,Qe=Math.max(Math.round(ct._radius),1),Pr=(Math.max(Math.round(ct._radiusY),1)||Qe)/Qe;Pr!==1&&(me.save(),me.scale(1,Pr)),me.beginPath(),me.arc(Bt.x,Bt.y/Pr,Qe,0,Math.PI*2,!1),Pr!==1&&me.restore(),this._fillStroke(me,ct)}},_fillStroke:function(ct,Bt){var me=Bt.options;me.fill&&(ct.globalAlpha=me.fillOpacity,ct.fillStyle=me.fillColor||me.color,ct.fill(me.fillRule||"evenodd")),me.stroke&&me.weight!==0&&(ct.setLineDash&&ct.setLineDash(Bt.options&&Bt.options._dashArray||[]),ct.globalAlpha=me.opacity,ct.lineWidth=me.weight,ct.strokeStyle=me.color,ct.lineCap=me.lineCap,ct.lineJoin=me.lineJoin,ct.stroke())},_onClick:function(ct){for(var Bt=this._map.mouseEventToLayerPoint(ct),me,Qe,Pr=this._drawFirst;Pr;Pr=Pr.next)me=Pr.layer,me.options.interactive&&me._containsPoint(Bt)&&(!(ct.type==="click"||ct.type==="preclick")||!this._map._draggableMoved(me))&&(Qe=me);this._fireEvent(Qe?[Qe]:!1,ct)},_onMouseMove:function(ct){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var Bt=this._map.mouseEventToLayerPoint(ct);this._handleMouseHover(ct,Bt)}},_handleMouseOut:function(ct){var Bt=this._hoveredLayer;Bt&&(Rf(this._container,"leaflet-interactive"),this._fireEvent([Bt],ct,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(ct,Bt){if(!this._mouseHoverThrottled){for(var me,Qe,Pr=this._drawFirst;Pr;Pr=Pr.next)me=Pr.layer,me.options.interactive&&me._containsPoint(Bt)&&(Qe=me);Qe!==this._hoveredLayer&&(this._handleMouseOut(ct),Qe&&(Wu(this._container,"leaflet-interactive"),this._fireEvent([Qe],ct,"mouseover"),this._hoveredLayer=Qe)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,ct),this._mouseHoverThrottled=!0,setTimeout(kt(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(ct,Bt,me){this._map._fireDOMEvent(Bt,me||Bt.type,ct)},_bringToFront:function(ct){var Bt=ct._order;if(Bt){var me=Bt.next,Qe=Bt.prev;if(me)me.prev=Qe;else return;Qe?Qe.next=me:me&&(this._drawFirst=me),Bt.prev=this._drawLast,this._drawLast.next=Bt,Bt.next=null,this._drawLast=Bt,this._requestRedraw(ct)}},_bringToBack:function(ct){var Bt=ct._order;if(Bt){var me=Bt.next,Qe=Bt.prev;if(Qe)Qe.next=me;else return;me?me.prev=Qe:Qe&&(this._drawLast=Qe),Bt.prev=null,Bt.next=this._drawFirst,this._drawFirst.prev=Bt,this._drawFirst=Bt,this._requestRedraw(ct)}}});function q_(ct){return El.canvas?new Ew(ct):null}var C1=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(ct){return document.createElement("<lvml:"+ct+' class="lvml">')}}catch{}return function(ct){return document.createElement("<"+ct+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),_6={_initContainer:function(){this._container=Cc("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ym.prototype._update.call(this),this.fire("update"))},_initPath:function(ct){var Bt=ct._container=C1("shape");Wu(Bt,"leaflet-vml-shape "+(this.options.className||"")),Bt.coordsize="1 1",ct._path=C1("path"),Bt.appendChild(ct._path),this._updateStyle(ct),this._layers[Gt(ct)]=ct},_addPath:function(ct){var Bt=ct._container;this._container.appendChild(Bt),ct.options.interactive&&ct.addInteractiveTarget(Bt)},_removePath:function(ct){var Bt=ct._container;Tf(Bt),ct.removeInteractiveTarget(Bt),delete this._layers[Gt(ct)]},_updateStyle:function(ct){var Bt=ct._stroke,me=ct._fill,Qe=ct.options,Pr=ct._container;Pr.stroked=!!Qe.stroke,Pr.filled=!!Qe.fill,Qe.stroke?(Bt||(Bt=ct._stroke=C1("stroke")),Pr.appendChild(Bt),Bt.weight=Qe.weight+"px",Bt.color=Qe.color,Bt.opacity=Qe.opacity,Qe.dashArray?Bt.dashStyle=kn(Qe.dashArray)?Qe.dashArray.join(" "):Qe.dashArray.replace(/( *, *)/g," "):Bt.dashStyle="",Bt.endcap=Qe.lineCap.replace("butt","flat"),Bt.joinstyle=Qe.lineJoin):Bt&&(Pr.removeChild(Bt),ct._stroke=null),Qe.fill?(me||(me=ct._fill=C1("fill")),Pr.appendChild(me),me.color=Qe.fillColor||Qe.color,me.opacity=Qe.fillOpacity):me&&(Pr.removeChild(me),ct._fill=null)},_updateCircle:function(ct){var Bt=ct._point.round(),me=Math.round(ct._radius),Qe=Math.round(ct._radiusY||me);this._setPath(ct,ct._empty()?"M0 0":"AL "+Bt.x+","+Bt.y+" "+me+","+Qe+" 0,"+65535*360)},_setPath:function(ct,Bt){ct._path.v=Bt},_bringToFront:function(ct){hv(ct._container)},_bringToBack:function(ct){bn(ct._container)}},Nm=El.vml?C1:co,Fp=ym.extend({_initContainer:function(){this._container=Nm("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Nm("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Tf(this._container),Bh(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ym.prototype._update.call(this);var ct=this._bounds,Bt=ct.getSize(),me=this._container;(!this._svgSize||!this._svgSize.equals(Bt))&&(this._svgSize=Bt,me.setAttribute("width",Bt.x),me.setAttribute("height",Bt.y)),ic(me,ct.min),me.setAttribute("viewBox",[ct.min.x,ct.min.y,Bt.x,Bt.y].join(" ")),this.fire("update")}},_initPath:function(ct){var Bt=ct._path=Nm("path");ct.options.className&&Wu(Bt,ct.options.className),ct.options.interactive&&Wu(Bt,"leaflet-interactive"),this._updateStyle(ct),this._layers[Gt(ct)]=ct},_addPath:function(ct){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(ct._path),ct.addInteractiveTarget(ct._path)},_removePath:function(ct){Tf(ct._path),ct.removeInteractiveTarget(ct._path),delete this._layers[Gt(ct)]},_updatePath:function(ct){ct._project(),ct._update()},_updateStyle:function(ct){var Bt=ct._path,me=ct.options;Bt&&(me.stroke?(Bt.setAttribute("stroke",me.color),Bt.setAttribute("stroke-opacity",me.opacity),Bt.setAttribute("stroke-width",me.weight),Bt.setAttribute("stroke-linecap",me.lineCap),Bt.setAttribute("stroke-linejoin",me.lineJoin),me.dashArray?Bt.setAttribute("stroke-dasharray",me.dashArray):Bt.removeAttribute("stroke-dasharray"),me.dashOffset?Bt.setAttribute("stroke-dashoffset",me.dashOffset):Bt.removeAttribute("stroke-dashoffset")):Bt.setAttribute("stroke","none"),me.fill?(Bt.setAttribute("fill",me.fillColor||me.color),Bt.setAttribute("fill-opacity",me.fillOpacity),Bt.setAttribute("fill-rule",me.fillRule||"evenodd")):Bt.setAttribute("fill","none"))},_updatePoly:function(ct,Bt){this._setPath(ct,vo(ct._parts,Bt))},_updateCircle:function(ct){var Bt=ct._point,me=Math.max(Math.round(ct._radius),1),Qe=Math.max(Math.round(ct._radiusY),1)||me,Pr="a"+me+","+Qe+" 0 1,0 ",Tn=ct._empty()?"M0 0":"M"+(Bt.x-me)+","+Bt.y+Pr+me*2+",0 "+Pr+-me*2+",0 ";this._setPath(ct,Tn)},_setPath:function(ct,Bt){ct._path.setAttribute("d",Bt)},_bringToFront:function(ct){hv(ct._path)},_bringToBack:function(ct){bn(ct._path)}});El.vml&&Fp.include(_6);function Cw(ct){return El.svg||El.vml?new Fp(ct):null}Mc.include({getRenderer:function(ct){var Bt=ct.options.renderer||this._getPaneRenderer(ct.options.pane)||this.options.renderer||this._renderer;return Bt||(Bt=this._renderer=this._createRenderer()),this.hasLayer(Bt)||this.addLayer(Bt),Bt},_getPaneRenderer:function(ct){if(ct==="overlayPane"||ct===void 0)return!1;var Bt=this._paneRenderers[ct];return Bt===void 0&&(Bt=this._createRenderer({pane:ct}),this._paneRenderers[ct]=Bt),Bt},_createRenderer:function(ct){return this.options.preferCanvas&&q_(ct)||Cw(ct)}});var s0=yv.extend({initialize:function(ct,Bt){yv.prototype.initialize.call(this,this._boundsToLatLngs(ct),Bt)},setBounds:function(ct){return this.setLatLngs(this._boundsToLatLngs(ct))},_boundsToLatLngs:function(ct){return ct=qo(ct),[ct.getSouthWest(),ct.getNorthWest(),ct.getNorthEast(),ct.getSouthEast()]}});function I0(ct,Bt){return new s0(ct,Bt)}Fp.create=Nm,Fp.pointsToPath=vo,pm.geometryToLayer=Vy,pm.coordsToLatLng=N_,pm.coordsToLatLngs=Hy,pm.latLngToCoords=j_,pm.latLngsToCoords=Wy,pm.getFeature=mm,pm.asFeature=qy,Mc.mergeOptions({boxZoom:!0});var xv=K0.extend({initialize:function(ct){this._map=ct,this._container=ct._container,this._pane=ct._panes.overlayPane,this._resetStateTimeout=0,ct.on("unload",this._destroy,this)},addHooks:function(){Pu(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Bh(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Tf(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(ct){if(!ct.shiftKey||ct.which!==1&&ct.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),C0(),Kc(),this._startPoint=this._map.mouseEventToContainerPoint(ct),Pu(document,{contextmenu:vg,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(ct){this._moved||(this._moved=!0,this._box=Cc("div","leaflet-zoom-box",this._container),Wu(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(ct);var Bt=new ko(this._point,this._startPoint),me=Bt.getSize();ic(this._box,Bt.min),this._box.style.width=me.x+"px",this._box.style.height=me.y+"px"},_finish:function(){this._moved&&(Tf(this._box),Rf(this._container,"leaflet-crosshair")),pg(),Op(),Bh(document,{contextmenu:vg,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(ct){if(!(ct.which!==1&&ct.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(kt(this._resetState,this),0);var Bt=new fu(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(Bt).fire("boxzoomend",{boxZoomBounds:Bt})}},_onKeyDown:function(ct){ct.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Mc.addInitHook("addHandler","boxZoom",xv),Mc.mergeOptions({doubleClickZoom:!0});var x0=K0.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(ct){var Bt=this._map,me=Bt.getZoom(),Qe=Bt.options.zoomDelta,Pr=ct.originalEvent.shiftKey?me-Qe:me+Qe;Bt.options.doubleClickZoom==="center"?Bt.setZoom(Pr):Bt.setZoomAround(ct.containerPoint,Pr)}});Mc.addInitHook("addHandler","doubleClickZoom",x0),Mc.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var O0=K0.extend({addHooks:function(){if(!this._draggable){var ct=this._map;this._draggable=new Fm(ct._mapPane,ct._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),ct.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),ct.on("zoomend",this._onZoomEnd,this),ct.whenReady(this._onZoomEnd,this))}Wu(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Rf(this._map._container,"leaflet-grab"),Rf(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var ct=this._map;if(ct._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var Bt=qo(this._map.options.maxBounds);this._offsetLimit=pl(this._map.latLngToContainerPoint(Bt.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(Bt.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;ct.fire("movestart").fire("dragstart"),ct.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(ct){if(this._map.options.inertia){var Bt=this._lastTime=+new Date,me=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(me),this._times.push(Bt),this._prunePositions(Bt)}this._map.fire("move",ct).fire("drag",ct)},_prunePositions:function(ct){for(;this._positions.length>1&&ct-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var ct=this._map.getSize().divideBy(2),Bt=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=Bt.subtract(ct).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(ct,Bt){return ct-(ct-Bt)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var ct=this._draggable._newPos.subtract(this._draggable._startPos),Bt=this._offsetLimit;ct.x<Bt.min.x&&(ct.x=this._viscousLimit(ct.x,Bt.min.x)),ct.y<Bt.min.y&&(ct.y=this._viscousLimit(ct.y,Bt.min.y)),ct.x>Bt.max.x&&(ct.x=this._viscousLimit(ct.x,Bt.max.x)),ct.y>Bt.max.y&&(ct.y=this._viscousLimit(ct.y,Bt.max.y)),this._draggable._newPos=this._draggable._startPos.add(ct)}},_onPreDragWrap:function(){var ct=this._worldWidth,Bt=Math.round(ct/2),me=this._initialWorldOffset,Qe=this._draggable._newPos.x,Pr=(Qe-Bt+me)%ct+Bt-me,Tn=(Qe+Bt+me)%ct-Bt-me,ji=Math.abs(Pr+me)<Math.abs(Tn+me)?Pr:Tn;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=ji},_onDragEnd:function(ct){var Bt=this._map,me=Bt.options,Qe=!me.inertia||ct.noInertia||this._times.length<2;if(Bt.fire("dragend",ct),Qe)Bt.fire("moveend");else{this._prunePositions(+new Date);var Pr=this._lastPos.subtract(this._positions[0]),Tn=(this._lastTime-this._times[0])/1e3,ji=me.easeLinearity,Na=Pr.multiplyBy(ji/Tn),Ya=Na.distanceTo([0,0]),xo=Math.min(me.inertiaMaxSpeed,Ya),Vs=Na.multiplyBy(xo/Ya),xl=xo/(me.inertiaDeceleration*ji),Du=Vs.multiplyBy(-xl/2).round();!Du.x&&!Du.y?Bt.fire("moveend"):(Du=Bt._limitOffset(Du,Bt.options.maxBounds),fa(function(){Bt.panBy(Du,{duration:xl,easeLinearity:ji,noMoveStart:!0,animate:!0})}))}}});Mc.addInitHook("addHandler","dragging",O0),Mc.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Lw=K0.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(ct){this._map=ct,this._setPanDelta(ct.options.keyboardPanDelta),this._setZoomDelta(ct.options.zoomDelta)},addHooks:function(){var ct=this._map._container;ct.tabIndex<=0&&(ct.tabIndex="0"),Pu(ct,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Bh(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var ct=document.body,Bt=document.documentElement,me=ct.scrollTop||Bt.scrollTop,Qe=ct.scrollLeft||Bt.scrollLeft;this._map._container.focus(),window.scrollTo(Qe,me)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(ct){var Bt=this._panKeys={},me=this.keyCodes,Qe,Pr;for(Qe=0,Pr=me.left.length;Qe<Pr;Qe++)Bt[me.left[Qe]]=[-1*ct,0];for(Qe=0,Pr=me.right.length;Qe<Pr;Qe++)Bt[me.right[Qe]]=[ct,0];for(Qe=0,Pr=me.down.length;Qe<Pr;Qe++)Bt[me.down[Qe]]=[0,ct];for(Qe=0,Pr=me.up.length;Qe<Pr;Qe++)Bt[me.up[Qe]]=[0,-1*ct]},_setZoomDelta:function(ct){var Bt=this._zoomKeys={},me=this.keyCodes,Qe,Pr;for(Qe=0,Pr=me.zoomIn.length;Qe<Pr;Qe++)Bt[me.zoomIn[Qe]]=ct;for(Qe=0,Pr=me.zoomOut.length;Qe<Pr;Qe++)Bt[me.zoomOut[Qe]]=-ct},_addHooks:function(){Pu(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Bh(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(ct){if(!(ct.altKey||ct.ctrlKey||ct.metaKey)){var Bt=ct.keyCode,me=this._map,Qe;if(Bt in this._panKeys){if(!me._panAnim||!me._panAnim._inProgress)if(Qe=this._panKeys[Bt],ct.shiftKey&&(Qe=mo(Qe).multiplyBy(3)),me.options.maxBounds&&(Qe=me._limitOffset(mo(Qe),me.options.maxBounds)),me.options.worldCopyJump){var Pr=me.wrapLatLng(me.unproject(me.project(me.getCenter()).add(Qe)));me.panTo(Pr)}else me.panBy(Qe)}else if(Bt in this._zoomKeys)me.setZoom(me.getZoom()+(ct.shiftKey?3:1)*this._zoomKeys[Bt]);else if(Bt===27&&me._popup&&me._popup.options.closeOnEscapeKey)me.closePopup();else return;vg(ct)}}});Mc.addInitHook("addHandler","keyboard",Lw),Mc.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Mg=K0.extend({addHooks:function(){Pu(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Bh(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(ct){var Bt=Ac(ct),me=this._map.options.wheelDebounceTime;this._delta+=Bt,this._lastMousePos=this._map.mouseEventToContainerPoint(ct),this._startTime||(this._startTime=+new Date);var Qe=Math.max(me-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(kt(this._performZoom,this),Qe),vg(ct)},_performZoom:function(){var ct=this._map,Bt=ct.getZoom(),me=this._map.options.zoomSnap||0;ct._stop();var Qe=this._delta/(this._map.options.wheelPxPerZoomLevel*4),Pr=4*Math.log(2/(1+Math.exp(-Math.abs(Qe))))/Math.LN2,Tn=me?Math.ceil(Pr/me)*me:Pr,ji=ct._limitZoom(Bt+(this._delta>0?Tn:-Tn))-Bt;this._delta=0,this._startTime=null,ji&&(ct.options.scrollWheelZoom==="center"?ct.setZoom(Bt+ji):ct.setZoomAround(this._lastMousePos,Bt+ji))}});Mc.addInitHook("addHandler","scrollWheelZoom",Mg);var Pw=600;Mc.mergeOptions({tapHold:El.touchNative&&El.safari&&El.mobile,tapTolerance:15});var zw=K0.extend({addHooks:function(){Pu(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Bh(this._map._container,"touchstart",this._onDown,this)},_onDown:function(ct){if(clearTimeout(this._holdTimeout),ct.touches.length===1){var Bt=ct.touches[0];this._startPos=this._newPos=new Va(Bt.clientX,Bt.clientY),this._holdTimeout=setTimeout(kt(function(){this._cancel(),this._isTapValid()&&(Pu(document,"touchend",mc),Pu(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",Bt))},this),Pw),Pu(document,"touchend touchcancel contextmenu",this._cancel,this),Pu(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function ct(){Bh(document,"touchend",mc),Bh(document,"touchend touchcancel",ct)},_cancel:function(){clearTimeout(this._holdTimeout),Bh(document,"touchend touchcancel contextmenu",this._cancel,this),Bh(document,"touchmove",this._onMove,this)},_onMove:function(ct){var Bt=ct.touches[0];this._newPos=new Va(Bt.clientX,Bt.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(ct,Bt){var me=new MouseEvent(ct,{bubbles:!0,cancelable:!0,view:window,screenX:Bt.screenX,screenY:Bt.screenY,clientX:Bt.clientX,clientY:Bt.clientY});me._simulated=!0,Bt.target.dispatchEvent(me)}});Mc.addInitHook("addHandler","tapHold",zw),Mc.mergeOptions({touchZoom:El.touch,bounceAtZoomLimits:!0});var D0=K0.extend({addHooks:function(){Wu(this._map._container,"leaflet-touch-zoom"),Pu(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Rf(this._map._container,"leaflet-touch-zoom"),Bh(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(ct){var Bt=this._map;if(!(!ct.touches||ct.touches.length!==2||Bt._animatingZoom||this._zooming)){var me=Bt.mouseEventToContainerPoint(ct.touches[0]),Qe=Bt.mouseEventToContainerPoint(ct.touches[1]);this._centerPoint=Bt.getSize()._divideBy(2),this._startLatLng=Bt.containerPointToLatLng(this._centerPoint),Bt.options.touchZoom!=="center"&&(this._pinchStartLatLng=Bt.containerPointToLatLng(me.add(Qe)._divideBy(2))),this._startDist=me.distanceTo(Qe),this._startZoom=Bt.getZoom(),this._moved=!1,this._zooming=!0,Bt._stop(),Pu(document,"touchmove",this._onTouchMove,this),Pu(document,"touchend touchcancel",this._onTouchEnd,this),mc(ct)}},_onTouchMove:function(ct){if(!(!ct.touches||ct.touches.length!==2||!this._zooming)){var Bt=this._map,me=Bt.mouseEventToContainerPoint(ct.touches[0]),Qe=Bt.mouseEventToContainerPoint(ct.touches[1]),Pr=me.distanceTo(Qe)/this._startDist;if(this._zoom=Bt.getScaleZoom(Pr,this._startZoom),!Bt.options.bounceAtZoomLimits&&(this._zoom<Bt.getMinZoom()&&Pr<1||this._zoom>Bt.getMaxZoom()&&Pr>1)&&(this._zoom=Bt._limitZoom(this._zoom)),Bt.options.touchZoom==="center"){if(this._center=this._startLatLng,Pr===1)return}else{var Tn=me._add(Qe)._divideBy(2)._subtract(this._centerPoint);if(Pr===1&&Tn.x===0&&Tn.y===0)return;this._center=Bt.unproject(Bt.project(this._pinchStartLatLng,this._zoom).subtract(Tn),this._zoom)}this._moved||(Bt._moveStart(!0,!1),this._moved=!0),Li(this._animRequest);var ji=kt(Bt._move,Bt,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=fa(ji,this,!0),mc(ct)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Li(this._animRequest),Bh(document,"touchmove",this._onTouchMove,this),Bh(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Mc.addInitHook("addHandler","touchZoom",D0),Mc.BoxZoom=xv,Mc.DoubleClickZoom=x0,Mc.Drag=O0,Mc.Keyboard=Lw,Mc.ScrollWheelZoom=Mg,Mc.TapHold=zw,Mc.TouchZoom=D0,z.Bounds=ko,z.Browser=El,z.CRS=Ea,z.Canvas=Ew,z.Circle=Uy,z.CircleMarker=jy,z.Class=ra,z.Control=lp,z.DivIcon=Mw,z.DivOverlay=X0,z.DomEvent=Dp,z.DomUtil=Tc,z.Draggable=Fm,z.Evented=Ei,z.FeatureGroup=bp,z.GeoJSON=pm,z.GridLayer=E1,z.Handler=K0,z.Icon=Rm,z.ImageOverlay=gm,z.LatLng=fo,z.LatLngBounds=fu,z.Layer=a0,z.LayerGroup=Tg,z.LineUtil=Qh,z.Map=Mc,z.Marker=M1,z.Mixin=up,z.Path=Bm,z.Point=Va,z.PolyUtil=d6,z.Polygon=yv,z.Polyline=y0,z.Popup=Ag,z.PosAnimation=A1,z.Projection=D_,z.Rectangle=s0,z.Renderer=ym,z.SVG=Fp,z.SVGOverlay=H_,z.TileLayer=o0,z.Tooltip=S1,z.Transformation=$o,z.Util=yi,z.VideoOverlay=z0,z.bind=kt,z.bounds=pl,z.canvas=q_,z.circle=vv,z.circleMarker=ww,z.control=i0,z.divIcon=x6,z.extend=J,z.featureGroup=bw,z.geoJSON=V_,z.geoJson=Zy,z.gridLayer=W_,z.icon=R_,z.imageOverlay=vm,z.latLng=Ta,z.latLngBounds=qo,z.layerGroup=Ny,z.map=js,z.marker=g6,z.point=mo,z.polygon=v6,z.polyline=kw,z.popup=vf,z.rectangle=I0,z.setOptions=zr,z.stamp=Gt,z.svg=Cw,z.svgOverlay=y6,z.tileLayer=$y,z.tooltip=Aw,z.transformation=gi,z.version=j,z.videoOverlay=tf;var F0=window.L;z.noConflict=function(){return window.L=F0,this},window.L=z})}(c2,c2.exports)),c2.exports}var Iat=zat();const Zg=LO(Iat),Oat={class:"space-y-6"},Dat={key:0,class:"flex items-center justify-center py-12"},Fat={key:1,class:"bg-accent-red/10 border border-accent-red/20 rounded-[15px] p-6"},Rat={class:"flex items-center gap-3"},Bat={class:"text-accent-red/80 text-sm"},Nat={key:0,class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},jat={class:"flex items-center justify-between p-6 pb-4"},Uat={class:"text-white text-lg font-semibold"},Vat={class:"text-sm text-dark-text ml-2"},Hat={class:"overflow-x-auto"},Wat={class:"w-full"},qat={class:"bg-dark-bg/30"},Zat=["onMouseenter","onMouseleave"],$at={class:"py-4 px-6 text-white text-sm"},Gat={class:"py-4 px-6 text-white text-sm font-mono"},Yat={class:"py-4 px-6 text-white text-sm"},Kat={key:0},Xat={key:1,class:"text-dark-text"},Jat={class:"py-4 px-6 text-white text-sm"},Qat={class:"py-4 px-6 text-white text-sm"},tot={class:"py-4 px-6 text-white text-sm"},eot={class:"py-4 px-6 text-white text-sm"},rot={class:"py-4 px-6 text-white text-sm"},not={class:"py-4 px-6 text-white text-sm"},iot={class:"py-4 px-6 text-white text-sm text-center"},aot={key:1,class:"text-center py-12"},oot=Th({name:"NeighborsView",__name:"Neighbors",setup(d){const l={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},z={0:"text-gray-400",1:"text-blue-400",2:"text-accent-green",3:"text-accent-purple",4:"text-secondary"},j=lo({}),J=lo(!0),mt=lo(null),kt=lo();let Dt=null;const Gt=lo(new Map),re=Yo(()=>Object.entries(l).filter(([un])=>j.value[un]?.length>0).sort(([un],[ia])=>parseInt(un)-parseInt(ia))),pe=Yo(()=>Object.values(j.value).flat().filter(un=>un.latitude!==null&&un.longitude!==null)),Ne=un=>new Date(un*1e3).toLocaleString(),or=un=>un.length<=16?un:`${un.slice(0,8)}...${un.slice(-8)}`,_r=un=>un!==null?`${un} dBm`:"N/A",Fr=un=>un!==null?`${un.toFixed(1)} dB`:"N/A",zr=un=>un===null?"Unknown":{0:"Unknown",1:"Flood",2:"Direct"}[un]||`Type ${un}`,Wr=(un,ia,fa,Li)=>{const ra=(fa-un)*Math.PI/180,Da=(Li-ia)*Math.PI/180,Ni=Math.sin(ra/2)*Math.sin(ra/2)+Math.cos(un*Math.PI/180)*Math.cos(fa*Math.PI/180)*Math.sin(Da/2)*Math.sin(Da/2);return 6371*(2*Math.atan2(Math.sqrt(Ni),Math.sqrt(1-Ni)))},An=un=>un.latitude!==null&&un.longitude!==null?`${Wr(50.6185,-1.7339,un.latitude,un.longitude).toFixed(2)} km`:"Unknown",Ft=un=>{const ia={0:"#9CA3AF",1:"#60A5FA",2:"#A5E5B6",3:"#EBA0FC",4:"#FFC246"};return ia[un]||ia[0]},kn=async un=>{try{const ia=await Xh.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(un)}&hours=168`);return ia.success&&Array.isArray(ia.data)?ia.data:[]}catch(ia){return console.error(`Error fetching adverts for contact type ${un}:`,ia),[]}},ei=async()=>{J.value=!0,mt.value=null;try{j.value={};for(const[un,ia]of Object.entries(l)){const fa=await kn(ia);fa.length>0&&(j.value[un]=fa)}}catch(un){console.error("Error loading adverts:",un),mt.value=un instanceof Error?un.message:"Unknown error occurred"}finally{J.value=!1}},jn=async()=>{if(ai(),await Z0(),!kt.value){setTimeout(()=>{kt.value&&jn()},500);return}setTimeout(()=>{if(!kt.value)return;if(kt.value.offsetWidth===0||kt.value.offsetHeight===0){setTimeout(()=>jn(),500);return}const un=50.6185,ia=-1.7339;let fa=null;if(pe.value.length>0){const Li=[un,...pe.value.map(Va=>Va.latitude)],yi=[ia,...pe.value.map(Va=>Va.longitude)],ra=Math.min(...Li),Da=Math.max(...Li),Ni=Math.min(...yi),Ei=Math.max(...yi);fa=[[ra,Ni],[Da,Ei]]}try{fa?Dt=Zg.map(kt.value,{zoomControl:!0,attributionControl:!0,preferCanvas:!1}).fitBounds(fa,{padding:[50,50]}):Dt=Zg.map(kt.value,{center:[un,ia],zoom:12,zoomControl:!0,attributionControl:!0,preferCanvas:!1});const Li=Zg.tileLayer("https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>',maxZoom:18,minZoom:1,crossOrigin:!0}),yi=Zg.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png",{maxZoom:18,minZoom:1,crossOrigin:!0});Li.addTo(Dt),yi.addTo(Dt);let ra=!1,Da=!1;const Ni=()=>{ra&&Da&&setTimeout(()=>{ss()},1e3)};Li.on("load",()=>{ra=!0,Dt&&Dt.invalidateSize(),Ni()}),yi.on("load",()=>{Da=!0,Ni()});const Ei=(mo,ko=!1)=>{const pl=ko?12:8;return Zg.divIcon({className:"custom-div-icon",html:`<div style="background-color: ${mo}; width: ${pl}px; height: ${pl}px; border-radius: 50%; border: 2px solid white; box-shadow: 0 2px 4px rgba(0,0,0,0.3);"></div>`,iconSize:[pl+4,pl+4],iconAnchor:[pl/2+2,pl/2+2]})},Va=Ei("#AAE8E8",!0);Zg.marker([un,ia],{icon:Va}).addTo(Dt).bindPopup(`
<div class="p-2">
<strong style="color: #AAE8E8;">This Node</strong><br>
<span class="text-sm" style="color: #9CA3AF;">Base Station</span><br>
<span class="text-xs" style="color: #6B7280;">${un.toFixed(6)}, ${ia.toFixed(6)}</span>
</div>
`);const ss=()=>{const mo={0:"#9CA3AF",1:"#60A5FA",2:"#A5E5B6",3:"#EBA0FC",4:"#FFC246"},ko=[];let pl=0,fu=0;const qo=pe.value.length,fo=()=>{};pe.value.forEach(Ta=>{if(Ta.latitude!==null&&Ta.longitude!==null&&Dt){const Ea=parseInt(Ta.contact_type),go=mo[Ea]||mo[0],Ao=Ei(go),Ps=Wr(un,ia,Ta.latitude,Ta.longitude),$o=Zg.marker([Ta.latitude,Ta.longitude],{icon:Ao}).addTo(Dt).bindPopup(`
<div class="p-2">
<strong style="color: ${go}">${Ta.node_name||"Unknown Node"}</strong><br>
<span class="text-sm" style="color: #E5E7EB;">${l[Ea]||"Unknown"}</span><br>
<span class="text-xs" style="color: #9CA3AF;">Distance: ${Ps.toFixed(2)} km</span><br>
<span class="text-xs" style="color: #9CA3AF;">Route: ${zr(Ta.route_type)}</span><br>
<span class="text-xs" style="color: #9CA3AF;">RSSI: ${_r(Ta.rssi)}</span><br>
<span class="text-xs" style="color: #9CA3AF;">SNR: ${Fr(Ta.snr)}</span><br>
<span class="text-xs" style="color: #6B7280;">${Ta.latitude.toFixed(6)}, ${Ta.longitude.toFixed(6)}</span>
</div>
`);Gt.value.set(Ta.pubkey,$o);const gi=$o.getElement();gi&&(gi.style.opacity="0",gi.style.transition="opacity 0.5s ease-out");const bi=Ta.route_type||0;let li=go,co=3,vo=.7,yo;bi===2?(li="#A5E5B6",co=4,vo=.9):bi===1?(li="#FFC246",yo="10, 5",vo=.8):(li="#9CA3AF",yo="2, 5",vo=.6),(()=>{const ns=[un,ia],Ko=[Ta.latitude,Ta.longitude],Oo=Zg.polyline([ns,Ko],{color:li,weight:co,opacity:0,dashArray:yo,className:"connection-line"}).addTo(Dt),wl=Zg.polyline([ns,ns],{color:li,weight:co,opacity:0,dashArray:yo,className:"connection-line animated-line"}).addTo(Dt);setTimeout(()=>{wl.setStyle({opacity:vo});let ws=0;const Hu=1500/1e3*60,Fc=()=>{ws+=1/Hu,ws>1&&(ws=1);const kc=ns[0]+(Ko[0]-ns[0])*ws,Vd=ns[1]+(Ko[1]-ns[1])*ws,kd=[kc,Vd];wl.setLatLngs([ns,kd]),ws<1?requestAnimationFrame(Fc):(Dt.removeLayer(wl),Oo.setStyle({opacity:vo}),gi&&(gi.style.opacity="1"),Oo.on("mouseover",()=>{Oo.setStyle({weight:co+2,opacity:Math.min(vo+.3,1)})}),Oo.on("mouseout",()=>{Oo.setStyle({weight:co,opacity:vo})}),Oo.bindPopup(`
<div class="p-2">
<strong style="color: ${go}">Connection to ${Ta.node_name||"Unknown Node"}</strong><br>
<span class="text-sm" style="color: #E5E7EB;">Distance: ${Ps.toFixed(2)} km</span><br>
<span class="text-sm" style="color: #E5E7EB;">Route: ${zr(Ta.route_type)}</span><br>
<span class="text-sm" style="color: #E5E7EB;">Signal: ${_r(Ta.rssi)} / ${Fr(Ta.snr)}</span>
</div>
`),ko.push(Oo),fu++,fu===qo&&fo())};Fc()},pl)})(),pl+=300}})};setTimeout(()=>{Dt&&Dt.invalidateSize()},2e3)}catch(Li){console.error("Error initializing map:",Li)}},200)},ai=()=>{Dt&&(Dt.remove(),Dt=null),Gt.value.clear()},Qi=un=>{const ia=Gt.value.get(un);if(ia){const fa=ia.getElement();fa&&fa.classList.add("marker-highlight")}},Gi=un=>{const ia=Gt.value.get(un);if(ia){const fa=ia.getElement();fa&&fa.classList.remove("marker-highlight")}};return t0(async()=>{await ei()}),K2(()=>{ai()}),um(pe,async un=>{un.length>0&&!J.value&&(await Z0(),setTimeout(async()=>{await jn()},300))},{immediate:!1}),um(J,async un=>{!un&&pe.value.length>0&&(await Z0(),setTimeout(async()=>{await jn()},300))}),(un,ia)=>(zi(),Vi("div",Oat,[J.value?(zi(),Vi("div",Dat,ia[0]||(ia[0]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),Re("p",{class:"text-dark-text"},"Loading neighbor data...")],-1)]))):mt.value?(zi(),Vi("div",Fat,[Re("div",Rat,[ia[2]||(ia[2]=Re("svg",{class:"w-5 h-5 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Re("div",null,[ia[1]||(ia[1]=Re("h3",{class:"text-accent-red font-medium"},"Error Loading Neighbors",-1)),Re("p",Bat,aa(mt.value),1)])])])):(zi(),Vi(Ou,{key:2},[pe.value.length>0?(zi(),Vi("div",Nat,[Re("div",{class:"flex items-center justify-between mb-4"},[ia[3]||(ia[3]=Re("h2",{class:"text-white text-lg font-semibold"},"Network Map",-1)),Re("button",{onClick:jn,class:"px-3 py-1 text-xs bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Reload Map ")]),Re("div",{ref_key:"mapContainer",ref:kt,class:"w-full h-96 bg-gray-900 rounded-lg border border-gray-700/50 overflow-hidden leaflet-container shadow-xl",style:{"min-height":"384px",position:"relative",outline:"none","box-shadow":"inset 0 0 20px rgba(0,0,0,0.5)"}},null,512),ia[4]||(ia[4]=Ff('<div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4 text-sm" data-v-eb494437><div data-v-eb494437><h4 class="text-white font-medium mb-2" data-v-eb494437>Node Types</h4><div class="space-y-1" data-v-eb494437><div class="flex items-center gap-2" data-v-eb494437><div class="w-3 h-3 bg-primary rounded-full" data-v-eb494437></div><span class="text-dark-text" data-v-eb494437>This Node</span></div><div class="flex items-center gap-2" data-v-eb494437><div class="w-3 h-3 bg-accent-green rounded-full" data-v-eb494437></div><span class="text-dark-text" data-v-eb494437>Repeater</span></div><div class="flex items-center gap-2" data-v-eb494437><div class="w-3 h-3 bg-blue-400 rounded-full" data-v-eb494437></div><span class="text-dark-text" data-v-eb494437>Chat Node</span></div><div class="flex items-center gap-2" data-v-eb494437><div class="w-3 h-3 bg-accent-purple rounded-full" data-v-eb494437></div><span class="text-dark-text" data-v-eb494437>Room Server</span></div><div class="flex items-center gap-2" data-v-eb494437><div class="w-3 h-3 bg-secondary rounded-full" data-v-eb494437></div><span class="text-dark-text" data-v-eb494437>Hybrid Node</span></div></div></div><div data-v-eb494437><h4 class="text-white font-medium mb-2" data-v-eb494437>Connection Types</h4><div class="space-y-1" data-v-eb494437><div class="flex items-center gap-2" data-v-eb494437><div class="w-8 h-0.5 bg-accent-green" data-v-eb494437></div><span class="text-dark-text" data-v-eb494437>Direct Routing</span></div><div class="flex items-center gap-2" data-v-eb494437><div class="w-8 h-0.5 bg-secondary" style="background-image:repeating-linear-gradient(to right, #FFC246 0, #FFC246 6px, transparent 6px, transparent 10px);" data-v-eb494437></div><span class="text-dark-text" data-v-eb494437>Flood Routing</span></div></div></div></div>',1))])):bs("",!0),(zi(!0),Vi(Ou,null,sf(re.value,([fa,Li])=>(zi(),Vi("div",{key:fa,class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden"},[Re("div",jat,[Re("h2",Uat,[nc(aa(Li)+" ",1),Re("span",Vat,"("+aa(j.value[fa]?.length||0)+")",1)]),Re("div",{class:Xs(["flex items-center gap-2 text-sm",z[parseInt(fa)]])},[Re("div",{class:"w-2 h-2 rounded-full",style:av(`background-color: ${Ft(parseInt(fa))}`)},null,4),nc(" "+aa(Li),1)],2)]),Re("div",Hat,[Re("table",Wat,[ia[5]||(ia[5]=Re("thead",null,[Re("tr",{class:"bg-dark-bg/50"},[Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Node Name"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Public Key"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Location"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Distance"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Route Type"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"RSSI"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"SNR"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Last Seen"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"First Seen"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Advert Count")])],-1)),Re("tbody",qat,[(zi(!0),Vi(Ou,null,sf(j.value[fa],yi=>(zi(),Vi("tr",{key:yi.id,class:"hover:bg-white/5 transition-colors",onMouseenter:ra=>Qi(yi.pubkey),onMouseleave:ra=>Gi(yi.pubkey)},[Re("td",$at,aa(yi.node_name||"Unknown"),1),Re("td",Gat,aa(or(yi.pubkey)),1),Re("td",Yat,[yi.latitude!==null&&yi.longitude!==null?(zi(),Vi("span",Kat,aa(yi.latitude.toFixed(6))+", "+aa(yi.longitude.toFixed(6)),1)):(zi(),Vi("span",Xat,"Unknown"))]),Re("td",Jat,aa(An(yi)),1),Re("td",Qat,[Re("span",{class:Xs(yi.route_type===2?"text-accent-green":yi.route_type===1?"text-secondary":"text-gray-400")},aa(zr(yi.route_type)),3)]),Re("td",tot,aa(_r(yi.rssi)),1),Re("td",eot,aa(Fr(yi.snr)),1),Re("td",rot,aa(Ne(yi.last_seen)),1),Re("td",not,aa(Ne(yi.first_seen)),1),Re("td",iot,aa(yi.advert_count),1)],40,Zat))),128))])])])]))),128)),re.value.length===0?(zi(),Vi("div",aot,[ia[6]||(ia[6]=Ff('<div class="text-dark-text mb-4" data-v-eb494437><svg class="w-16 h-16 mx-auto mb-4 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-eb494437><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" data-v-eb494437></path></svg></div><h3 class="text-white text-lg font-medium mb-2" data-v-eb494437>No Neighbors Found</h3><p class="text-dark-text" data-v-eb494437>No mesh neighbors have been discovered in your area yet.</p>',3)),Re("button",{onClick:ei,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):bs("",!0)],64))]))}}),sot=ld(oot,[["__scopeId","data-v-eb494437"]]);/*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
*/function nw(d){return d+.5|0}const u1=(d,l,z)=>Math.max(Math.min(d,z),l);function h2(d){return u1(nw(d*2.55),0,255)}function p1(d){return u1(nw(d*255),0,255)}function Xg(d){return u1(nw(d/2.55)/100,0,1)}function UL(d){return u1(nw(d*100),0,100)}const am={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},mA=[..."0123456789ABCDEF"],lot=d=>mA[d&15],uot=d=>mA[(d&240)>>4]+mA[d&15],S5=d=>(d&240)>>4===(d&15),cot=d=>S5(d.r)&&S5(d.g)&&S5(d.b)&&S5(d.a);function hot(d){var l=d.length,z;return d[0]==="#"&&(l===4||l===5?z={r:255&am[d[1]]*17,g:255&am[d[2]]*17,b:255&am[d[3]]*17,a:l===5?am[d[4]]*17:255}:(l===7||l===9)&&(z={r:am[d[1]]<<4|am[d[2]],g:am[d[3]]<<4|am[d[4]],b:am[d[5]]<<4|am[d[6]],a:l===9?am[d[7]]<<4|am[d[8]]:255})),z}const fot=(d,l)=>d<255?l(d):"";function dot(d){var l=cot(d)?lot:uot;return d?"#"+l(d.r)+l(d.g)+l(d.b)+fot(d.a,l):void 0}const pot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function PO(d,l,z){const j=l*Math.min(z,1-z),J=(mt,kt=(mt+d/30)%12)=>z-j*Math.max(Math.min(kt-3,9-kt,1),-1);return[J(0),J(8),J(4)]}function mot(d,l,z){const j=(J,mt=(J+d/60)%6)=>z-z*l*Math.max(Math.min(mt,4-mt,1),0);return[j(5),j(3),j(1)]}function got(d,l,z){const j=PO(d,1,.5);let J;for(l+z>1&&(J=1/(l+z),l*=J,z*=J),J=0;J<3;J++)j[J]*=1-l-z,j[J]+=l;return j}function vot(d,l,z,j,J){return d===J?(l-z)/j+(l<z?6:0):l===J?(z-d)/j+2:(d-l)/j+4}function eM(d){const z=d.r/255,j=d.g/255,J=d.b/255,mt=Math.max(z,j,J),kt=Math.min(z,j,J),Dt=(mt+kt)/2;let Gt,re,pe;return mt!==kt&&(pe=mt-kt,re=Dt>.5?pe/(2-mt-kt):pe/(mt+kt),Gt=vot(z,j,J,pe,mt),Gt=Gt*60+.5),[Gt|0,re||0,Dt]}function rM(d,l,z,j){return(Array.isArray(l)?d(l[0],l[1],l[2]):d(l,z,j)).map(p1)}function nM(d,l,z){return rM(PO,d,l,z)}function yot(d,l,z){return rM(got,d,l,z)}function xot(d,l,z){return rM(mot,d,l,z)}function zO(d){return(d%360+360)%360}function _ot(d){const l=pot.exec(d);let z=255,j;if(!l)return;l[5]!==j&&(z=l[6]?h2(+l[5]):p1(+l[5]));const J=zO(+l[2]),mt=+l[3]/100,kt=+l[4]/100;return l[1]==="hwb"?j=yot(J,mt,kt):l[1]==="hsv"?j=xot(J,mt,kt):j=nM(J,mt,kt),{r:j[0],g:j[1],b:j[2],a:z}}function bot(d,l){var z=eM(d);z[0]=zO(z[0]+l),z=nM(z),d.r=z[0],d.g=z[1],d.b=z[2]}function wot(d){if(!d)return;const l=eM(d),z=l[0],j=UL(l[1]),J=UL(l[2]);return d.a<255?`hsla(${z}, ${j}%, ${J}%, ${Xg(d.a)})`:`hsl(${z}, ${j}%, ${J}%)`}const VL={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},HL={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function kot(){const d={},l=Object.keys(HL),z=Object.keys(VL);let j,J,mt,kt,Dt;for(j=0;j<l.length;j++){for(kt=Dt=l[j],J=0;J<z.length;J++)mt=z[J],Dt=Dt.replace(mt,VL[mt]);mt=parseInt(HL[kt],16),d[Dt]=[mt>>16&255,mt>>8&255,mt&255]}return d}let E5;function Tot(d){E5||(E5=kot(),E5.transparent=[0,0,0,0]);const l=E5[d.toLowerCase()];return l&&{r:l[0],g:l[1],b:l[2],a:l.length===4?l[3]:255}}const Aot=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Mot(d){const l=Aot.exec(d);let z=255,j,J,mt;if(l){if(l[7]!==j){const kt=+l[7];z=l[8]?h2(kt):u1(kt*255,0,255)}return j=+l[1],J=+l[3],mt=+l[5],j=255&(l[2]?h2(j):u1(j,0,255)),J=255&(l[4]?h2(J):u1(J,0,255)),mt=255&(l[6]?h2(mt):u1(mt,0,255)),{r:j,g:J,b:mt,a:z}}}function Sot(d){return d&&(d.a<255?`rgba(${d.r}, ${d.g}, ${d.b}, ${Xg(d.a)})`:`rgb(${d.r}, ${d.g}, ${d.b})`)}const L8=d=>d<=.0031308?d*12.92:Math.pow(d,1/2.4)*1.055-.055,Xx=d=>d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4);function Eot(d,l,z){const j=Xx(Xg(d.r)),J=Xx(Xg(d.g)),mt=Xx(Xg(d.b));return{r:p1(L8(j+z*(Xx(Xg(l.r))-j))),g:p1(L8(J+z*(Xx(Xg(l.g))-J))),b:p1(L8(mt+z*(Xx(Xg(l.b))-mt))),a:d.a+z*(l.a-d.a)}}function C5(d,l,z){if(d){let j=eM(d);j[l]=Math.max(0,Math.min(j[l]+j[l]*z,l===0?360:1)),j=nM(j),d.r=j[0],d.g=j[1],d.b=j[2]}}function IO(d,l){return d&&Object.assign(l||{},d)}function WL(d){var l={r:0,g:0,b:0,a:255};return Array.isArray(d)?d.length>=3&&(l={r:d[0],g:d[1],b:d[2],a:255},d.length>3&&(l.a=p1(d[3]))):(l=IO(d,{r:0,g:0,b:0,a:1}),l.a=p1(l.a)),l}function Cot(d){return d.charAt(0)==="r"?Mot(d):_ot(d)}class N2{constructor(l){if(l instanceof N2)return l;const z=typeof l;let j;z==="object"?j=WL(l):z==="string"&&(j=hot(l)||Tot(l)||Cot(l)),this._rgb=j,this._valid=!!j}get valid(){return this._valid}get rgb(){var l=IO(this._rgb);return l&&(l.a=Xg(l.a)),l}set rgb(l){this._rgb=WL(l)}rgbString(){return this._valid?Sot(this._rgb):void 0}hexString(){return this._valid?dot(this._rgb):void 0}hslString(){return this._valid?wot(this._rgb):void 0}mix(l,z){if(l){const j=this.rgb,J=l.rgb;let mt;const kt=z===mt?.5:z,Dt=2*kt-1,Gt=j.a-J.a,re=((Dt*Gt===-1?Dt:(Dt+Gt)/(1+Dt*Gt))+1)/2;mt=1-re,j.r=255&re*j.r+mt*J.r+.5,j.g=255&re*j.g+mt*J.g+.5,j.b=255&re*j.b+mt*J.b+.5,j.a=kt*j.a+(1-kt)*J.a,this.rgb=j}return this}interpolate(l,z){return l&&(this._rgb=Eot(this._rgb,l._rgb,z)),this}clone(){return new N2(this.rgb)}alpha(l){return this._rgb.a=p1(l),this}clearer(l){const z=this._rgb;return z.a*=1-l,this}greyscale(){const l=this._rgb,z=nw(l.r*.3+l.g*.59+l.b*.11);return l.r=l.g=l.b=z,this}opaquer(l){const z=this._rgb;return z.a*=1+l,this}negate(){const l=this._rgb;return l.r=255-l.r,l.g=255-l.g,l.b=255-l.b,this}lighten(l){return C5(this._rgb,2,l),this}darken(l){return C5(this._rgb,2,-l),this}saturate(l){return C5(this._rgb,1,l),this}desaturate(l){return C5(this._rgb,1,-l),this}rotate(l){return bot(this._rgb,l),this}}/*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/function $g(){}const Lot=(()=>{let d=0;return()=>d++})();function Rh(d){return d==null}function Xd(d){if(Array.isArray&&Array.isArray(d))return!0;const l=Object.prototype.toString.call(d);return l.slice(0,7)==="[object"&&l.slice(-6)==="Array]"}function Ec(d){return d!==null&&Object.prototype.toString.call(d)==="[object Object]"}function Qp(d){return(typeof d=="number"||d instanceof Number)&&isFinite(+d)}function eg(d,l){return Qp(d)?d:l}function cc(d,l){return typeof d>"u"?l:d}const Pot=(d,l)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100:+d/l,OO=(d,l)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100*l:+d;function Df(d,l,z){if(d&&typeof d.call=="function")return d.apply(z,l)}function Kh(d,l,z,j){let J,mt,kt;if(Xd(d))for(mt=d.length,J=0;J<mt;J++)l.call(z,d[J],J);else if(Ec(d))for(kt=Object.keys(d),mt=kt.length,J=0;J<mt;J++)l.call(z,d[kt[J]],kt[J])}function h4(d,l){let z,j,J,mt;if(!d||!l||d.length!==l.length)return!1;for(z=0,j=d.length;z<j;++z)if(J=d[z],mt=l[z],J.datasetIndex!==mt.datasetIndex||J.index!==mt.index)return!1;return!0}function f4(d){if(Xd(d))return d.map(f4);if(Ec(d)){const l=Object.create(null),z=Object.keys(d),j=z.length;let J=0;for(;J<j;++J)l[z[J]]=f4(d[z[J]]);return l}return d}function DO(d){return["__proto__","prototype","constructor"].indexOf(d)===-1}function zot(d,l,z,j){if(!DO(d))return;const J=l[d],mt=z[d];Ec(J)&&Ec(mt)?j2(J,mt,j):l[d]=f4(mt)}function j2(d,l,z){const j=Xd(l)?l:[l],J=j.length;if(!Ec(d))return d;z=z||{};const mt=z.merger||zot;let kt;for(let Dt=0;Dt<J;++Dt){if(kt=j[Dt],!Ec(kt))continue;const Gt=Object.keys(kt);for(let re=0,pe=Gt.length;re<pe;++re)mt(Gt[re],d,kt,z)}return d}function T2(d,l){return j2(d,l,{merger:Iot})}function Iot(d,l,z){if(!DO(d))return;const j=l[d],J=z[d];Ec(j)&&Ec(J)?T2(j,J):Object.prototype.hasOwnProperty.call(l,d)||(l[d]=f4(J))}const qL={"":d=>d,x:d=>d.x,y:d=>d.y};function Oot(d){const l=d.split("."),z=[];let j="";for(const J of l)j+=J,j.endsWith("\\")?j=j.slice(0,-1)+".":(z.push(j),j="");return z}function Dot(d){const l=Oot(d);return z=>{for(const j of l){if(j==="")break;z=z&&z[j]}return z}}function My(d,l){return(qL[l]||(qL[l]=Dot(l)))(d)}function iM(d){return d.charAt(0).toUpperCase()+d.slice(1)}const U2=d=>typeof d<"u",v1=d=>typeof d=="function",ZL=(d,l)=>{if(d.size!==l.size)return!1;for(const z of d)if(!l.has(z))return!1;return!0};function Fot(d){return d.type==="mouseup"||d.type==="click"||d.type==="contextmenu"}const Jh=Math.PI,od=2*Jh,Rot=od+Jh,d4=Number.POSITIVE_INFINITY,Bot=Jh/180,ap=Jh/2,sy=Jh/4,$L=Jh*2/3,FO=Math.log10,cg=Math.sign;function A2(d,l,z){return Math.abs(d-l)<z}function GL(d){const l=Math.round(d);d=A2(d,l,d/1e3)?l:d;const z=Math.pow(10,Math.floor(FO(d))),j=d/z;return(j<=1?1:j<=2?2:j<=5?5:10)*z}function Not(d){const l=[],z=Math.sqrt(d);let j;for(j=1;j<z;j++)d%j===0&&(l.push(j),l.push(d/j));return z===(z|0)&&l.push(z),l.sort((J,mt)=>J-mt).pop(),l}function jot(d){return typeof d=="symbol"||typeof d=="object"&&d!==null&&!(Symbol.toPrimitive in d||"toString"in d||"valueOf"in d)}function V2(d){return!jot(d)&&!isNaN(parseFloat(d))&&isFinite(d)}function Uot(d,l){const z=Math.round(d);return z-l<=d&&z+l>=d}function Vot(d,l,z){let j,J,mt;for(j=0,J=d.length;j<J;j++)mt=d[j][z],isNaN(mt)||(l.min=Math.min(l.min,mt),l.max=Math.max(l.max,mt))}function tv(d){return d*(Jh/180)}function Hot(d){return d*(180/Jh)}function YL(d){if(!Qp(d))return;let l=1,z=0;for(;Math.round(d*l)/l!==d;)l*=10,z++;return z}function RO(d,l){const z=l.x-d.x,j=l.y-d.y,J=Math.sqrt(z*z+j*j);let mt=Math.atan2(j,z);return mt<-.5*Jh&&(mt+=od),{angle:mt,distance:J}}function gA(d,l){return Math.sqrt(Math.pow(l.x-d.x,2)+Math.pow(l.y-d.y,2))}function Wot(d,l){return(d-l+Rot)%od-Jh}function q0(d){return(d%od+od)%od}function H2(d,l,z,j){const J=q0(d),mt=q0(l),kt=q0(z),Dt=q0(mt-J),Gt=q0(kt-J),re=q0(J-mt),pe=q0(J-kt);return J===mt||J===kt||j&&mt===kt||Dt>Gt&&re<pe}function Xp(d,l,z){return Math.max(l,Math.min(z,d))}function qot(d){return Xp(d,-32768,32767)}function ev(d,l,z,j=1e-6){return d>=Math.min(l,z)-j&&d<=Math.max(l,z)+j}function aM(d,l,z){z=z||(kt=>d[kt]<l);let j=d.length-1,J=0,mt;for(;j-J>1;)mt=J+j>>1,z(mt)?J=mt:j=mt;return{lo:J,hi:j}}const yy=(d,l,z,j)=>aM(d,z,j?J=>{const mt=d[J][l];return mt<z||mt===z&&d[J+1][l]===z}:J=>d[J][l]<z),Zot=(d,l,z)=>aM(d,z,j=>d[j][l]>=z);function $ot(d,l,z){let j=0,J=d.length;for(;j<J&&d[j]<l;)j++;for(;J>j&&d[J-1]>z;)J--;return j>0||J<d.length?d.slice(j,J):d}const BO=["push","pop","shift","splice","unshift"];function Got(d,l){if(d._chartjs){d._chartjs.listeners.push(l);return}Object.defineProperty(d,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[l]}}),BO.forEach(z=>{const j="_onData"+iM(z),J=d[z];Object.defineProperty(d,z,{configurable:!0,enumerable:!1,value(...mt){const kt=J.apply(this,mt);return d._chartjs.listeners.forEach(Dt=>{typeof Dt[j]=="function"&&Dt[j](...mt)}),kt}})})}function KL(d,l){const z=d._chartjs;if(!z)return;const j=z.listeners,J=j.indexOf(l);J!==-1&&j.splice(J,1),!(j.length>0)&&(BO.forEach(mt=>{delete d[mt]}),delete d._chartjs)}function NO(d){const l=new Set(d);return l.size===d.length?d:Array.from(l)}const jO=function(){return typeof window>"u"?function(d){return d()}:window.requestAnimationFrame}();function UO(d,l){let z=[],j=!1;return function(...J){z=J,j||(j=!0,jO.call(window,()=>{j=!1,d.apply(l,z)}))}}function Yot(d,l){let z;return function(...j){return l?(clearTimeout(z),z=setTimeout(d,l,j)):d.apply(this,j),l}}const oM=d=>d==="start"?"left":d==="end"?"right":"center",Wp=(d,l,z)=>d==="start"?l:d==="end"?z:(l+z)/2,Kot=(d,l,z,j)=>d===(j?"left":"right")?z:d==="center"?(l+z)/2:l;function Xot(d,l,z){const j=l.length;let J=0,mt=j;if(d._sorted){const{iScale:kt,vScale:Dt,_parsed:Gt}=d,re=d.dataset&&d.dataset.options?d.dataset.options.spanGaps:null,pe=kt.axis,{min:Ne,max:or,minDefined:_r,maxDefined:Fr}=kt.getUserBounds();if(_r){if(J=Math.min(yy(Gt,pe,Ne).lo,z?j:yy(l,pe,kt.getPixelForValue(Ne)).lo),re){const zr=Gt.slice(0,J+1).reverse().findIndex(Wr=>!Rh(Wr[Dt.axis]));J-=Math.max(0,zr)}J=Xp(J,0,j-1)}if(Fr){let zr=Math.max(yy(Gt,kt.axis,or,!0).hi+1,z?0:yy(l,pe,kt.getPixelForValue(or),!0).hi+1);if(re){const Wr=Gt.slice(zr-1).findIndex(An=>!Rh(An[Dt.axis]));zr+=Math.max(0,Wr)}mt=Xp(zr,J,j)-J}else mt=j-J}return{start:J,count:mt}}function Jot(d){const{xScale:l,yScale:z,_scaleRanges:j}=d,J={xmin:l.min,xmax:l.max,ymin:z.min,ymax:z.max};if(!j)return d._scaleRanges=J,!0;const mt=j.xmin!==l.min||j.xmax!==l.max||j.ymin!==z.min||j.ymax!==z.max;return Object.assign(j,J),mt}const L5=d=>d===0||d===1,XL=(d,l,z)=>-(Math.pow(2,10*(d-=1))*Math.sin((d-l)*od/z)),JL=(d,l,z)=>Math.pow(2,-10*d)*Math.sin((d-l)*od/z)+1,M2={linear:d=>d,easeInQuad:d=>d*d,easeOutQuad:d=>-d*(d-2),easeInOutQuad:d=>(d/=.5)<1?.5*d*d:-.5*(--d*(d-2)-1),easeInCubic:d=>d*d*d,easeOutCubic:d=>(d-=1)*d*d+1,easeInOutCubic:d=>(d/=.5)<1?.5*d*d*d:.5*((d-=2)*d*d+2),easeInQuart:d=>d*d*d*d,easeOutQuart:d=>-((d-=1)*d*d*d-1),easeInOutQuart:d=>(d/=.5)<1?.5*d*d*d*d:-.5*((d-=2)*d*d*d-2),easeInQuint:d=>d*d*d*d*d,easeOutQuint:d=>(d-=1)*d*d*d*d+1,easeInOutQuint:d=>(d/=.5)<1?.5*d*d*d*d*d:.5*((d-=2)*d*d*d*d+2),easeInSine:d=>-Math.cos(d*ap)+1,easeOutSine:d=>Math.sin(d*ap),easeInOutSine:d=>-.5*(Math.cos(Jh*d)-1),easeInExpo:d=>d===0?0:Math.pow(2,10*(d-1)),easeOutExpo:d=>d===1?1:-Math.pow(2,-10*d)+1,easeInOutExpo:d=>L5(d)?d:d<.5?.5*Math.pow(2,10*(d*2-1)):.5*(-Math.pow(2,-10*(d*2-1))+2),easeInCirc:d=>d>=1?d:-(Math.sqrt(1-d*d)-1),easeOutCirc:d=>Math.sqrt(1-(d-=1)*d),easeInOutCirc:d=>(d/=.5)<1?-.5*(Math.sqrt(1-d*d)-1):.5*(Math.sqrt(1-(d-=2)*d)+1),easeInElastic:d=>L5(d)?d:XL(d,.075,.3),easeOutElastic:d=>L5(d)?d:JL(d,.075,.3),easeInOutElastic(d){return L5(d)?d:d<.5?.5*XL(d*2,.1125,.45):.5+.5*JL(d*2-1,.1125,.45)},easeInBack(d){return d*d*((1.70158+1)*d-1.70158)},easeOutBack(d){return(d-=1)*d*((1.70158+1)*d+1.70158)+1},easeInOutBack(d){let l=1.70158;return(d/=.5)<1?.5*(d*d*(((l*=1.525)+1)*d-l)):.5*((d-=2)*d*(((l*=1.525)+1)*d+l)+2)},easeInBounce:d=>1-M2.easeOutBounce(1-d),easeOutBounce(d){return d<1/2.75?7.5625*d*d:d<2/2.75?7.5625*(d-=1.5/2.75)*d+.75:d<2.5/2.75?7.5625*(d-=2.25/2.75)*d+.9375:7.5625*(d-=2.625/2.75)*d+.984375},easeInOutBounce:d=>d<.5?M2.easeInBounce(d*2)*.5:M2.easeOutBounce(d*2-1)*.5+.5};function sM(d){if(d&&typeof d=="object"){const l=d.toString();return l==="[object CanvasPattern]"||l==="[object CanvasGradient]"}return!1}function QL(d){return sM(d)?d:new N2(d)}function P8(d){return sM(d)?d:new N2(d).saturate(.5).darken(.1).hexString()}const Qot=["x","y","borderWidth","radius","tension"],tst=["color","borderColor","backgroundColor"];function est(d){d.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),d.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:l=>l!=="onProgress"&&l!=="onComplete"&&l!=="fn"}),d.set("animations",{colors:{type:"color",properties:tst},numbers:{type:"number",properties:Qot}}),d.describe("animations",{_fallback:"animation"}),d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:l=>l|0}}}})}function rst(d){d.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const tP=new Map;function nst(d,l){l=l||{};const z=d+JSON.stringify(l);let j=tP.get(z);return j||(j=new Intl.NumberFormat(d,l),tP.set(z,j)),j}function lM(d,l,z){return nst(l,z).format(d)}const ist={values(d){return Xd(d)?d:""+d},numeric(d,l,z){if(d===0)return"0";const j=this.chart.options.locale;let J,mt=d;if(z.length>1){const re=Math.max(Math.abs(z[0].value),Math.abs(z[z.length-1].value));(re<1e-4||re>1e15)&&(J="scientific"),mt=ast(d,z)}const kt=FO(Math.abs(mt)),Dt=isNaN(kt)?1:Math.max(Math.min(-1*Math.floor(kt),20),0),Gt={notation:J,minimumFractionDigits:Dt,maximumFractionDigits:Dt};return Object.assign(Gt,this.options.ticks.format),lM(d,j,Gt)}};function ast(d,l){let z=l.length>3?l[2].value-l[1].value:l[1].value-l[0].value;return Math.abs(z)>=1&&d!==Math.floor(d)&&(z=d-Math.floor(d)),z}var VO={formatters:ist};function ost(d){d.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(l,z)=>z.lineWidth,tickColor:(l,z)=>z.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:VO.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),d.route("scale.ticks","color","","color"),d.route("scale.grid","color","","borderColor"),d.route("scale.border","color","","borderColor"),d.route("scale.title","color","","color"),d.describe("scale",{_fallback:!1,_scriptable:l=>!l.startsWith("before")&&!l.startsWith("after")&&l!=="callback"&&l!=="parser",_indexable:l=>l!=="borderDash"&&l!=="tickBorderDash"&&l!=="dash"}),d.describe("scales",{_fallback:"scale"}),d.describe("scale.ticks",{_scriptable:l=>l!=="backdropPadding"&&l!=="callback",_indexable:l=>l!=="backdropPadding"})}const Sy=Object.create(null),vA=Object.create(null);function S2(d,l){if(!l)return d;const z=l.split(".");for(let j=0,J=z.length;j<J;++j){const mt=z[j];d=d[mt]||(d[mt]=Object.create(null))}return d}function z8(d,l,z){return typeof l=="string"?j2(S2(d,l),z):j2(S2(d,""),l)}class sst{constructor(l,z){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=j=>j.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(j,J)=>P8(J.backgroundColor),this.hoverBorderColor=(j,J)=>P8(J.borderColor),this.hoverColor=(j,J)=>P8(J.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(l),this.apply(z)}set(l,z){return z8(this,l,z)}get(l){return S2(this,l)}describe(l,z){return z8(vA,l,z)}override(l,z){return z8(Sy,l,z)}route(l,z,j,J){const mt=S2(this,l),kt=S2(this,j),Dt="_"+z;Object.defineProperties(mt,{[Dt]:{value:mt[z],writable:!0},[z]:{enumerable:!0,get(){const Gt=this[Dt],re=kt[J];return Ec(Gt)?Object.assign({},re,Gt):cc(Gt,re)},set(Gt){this[Dt]=Gt}}})}apply(l){l.forEach(z=>z(this))}}var Bd=new sst({_scriptable:d=>!d.startsWith("on"),_indexable:d=>d!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[est,rst,ost]);function lst(d){return!d||Rh(d.size)||Rh(d.family)?null:(d.style?d.style+" ":"")+(d.weight?d.weight+" ":"")+d.size+"px "+d.family}function eP(d,l,z,j,J){let mt=l[J];return mt||(mt=l[J]=d.measureText(J).width,z.push(J)),mt>j&&(j=mt),j}function ly(d,l,z){const j=d.currentDevicePixelRatio,J=z!==0?Math.max(z/2,.5):0;return Math.round((l-J)*j)/j+J}function rP(d,l){!l&&!d||(l=l||d.getContext("2d"),l.save(),l.resetTransform(),l.clearRect(0,0,d.width,d.height),l.restore())}function yA(d,l,z,j){HO(d,l,z,j,null)}function HO(d,l,z,j,J){let mt,kt,Dt,Gt,re,pe,Ne,or;const _r=l.pointStyle,Fr=l.rotation,zr=l.radius;let Wr=(Fr||0)*Bot;if(_r&&typeof _r=="object"&&(mt=_r.toString(),mt==="[object HTMLImageElement]"||mt==="[object HTMLCanvasElement]")){d.save(),d.translate(z,j),d.rotate(Wr),d.drawImage(_r,-_r.width/2,-_r.height/2,_r.width,_r.height),d.restore();return}if(!(isNaN(zr)||zr<=0)){switch(d.beginPath(),_r){default:J?d.ellipse(z,j,J/2,zr,0,0,od):d.arc(z,j,zr,0,od),d.closePath();break;case"triangle":pe=J?J/2:zr,d.moveTo(z+Math.sin(Wr)*pe,j-Math.cos(Wr)*zr),Wr+=$L,d.lineTo(z+Math.sin(Wr)*pe,j-Math.cos(Wr)*zr),Wr+=$L,d.lineTo(z+Math.sin(Wr)*pe,j-Math.cos(Wr)*zr),d.closePath();break;case"rectRounded":re=zr*.516,Gt=zr-re,kt=Math.cos(Wr+sy)*Gt,Ne=Math.cos(Wr+sy)*(J?J/2-re:Gt),Dt=Math.sin(Wr+sy)*Gt,or=Math.sin(Wr+sy)*(J?J/2-re:Gt),d.arc(z-Ne,j-Dt,re,Wr-Jh,Wr-ap),d.arc(z+or,j-kt,re,Wr-ap,Wr),d.arc(z+Ne,j+Dt,re,Wr,Wr+ap),d.arc(z-or,j+kt,re,Wr+ap,Wr+Jh),d.closePath();break;case"rect":if(!Fr){Gt=Math.SQRT1_2*zr,pe=J?J/2:Gt,d.rect(z-pe,j-Gt,2*pe,2*Gt);break}Wr+=sy;case"rectRot":Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+or,j-kt),d.lineTo(z+Ne,j+Dt),d.lineTo(z-or,j+kt),d.closePath();break;case"crossRot":Wr+=sy;case"cross":Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+Ne,j+Dt),d.moveTo(z+or,j-kt),d.lineTo(z-or,j+kt);break;case"star":Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+Ne,j+Dt),d.moveTo(z+or,j-kt),d.lineTo(z-or,j+kt),Wr+=sy,Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+Ne,j+Dt),d.moveTo(z+or,j-kt),d.lineTo(z-or,j+kt);break;case"line":kt=J?J/2:Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,d.moveTo(z-kt,j-Dt),d.lineTo(z+kt,j+Dt);break;case"dash":d.moveTo(z,j),d.lineTo(z+Math.cos(Wr)*(J?J/2:zr),j+Math.sin(Wr)*zr);break;case!1:d.closePath();break}d.fill(),l.borderWidth>0&&d.stroke()}}function W2(d,l,z){return z=z||.5,!l||d&&d.x>l.left-z&&d.x<l.right+z&&d.y>l.top-z&&d.y<l.bottom+z}function U4(d,l){d.save(),d.beginPath(),d.rect(l.left,l.top,l.right-l.left,l.bottom-l.top),d.clip()}function V4(d){d.restore()}function ust(d,l,z,j,J){if(!l)return d.lineTo(z.x,z.y);if(J==="middle"){const mt=(l.x+z.x)/2;d.lineTo(mt,l.y),d.lineTo(mt,z.y)}else J==="after"!=!!j?d.lineTo(l.x,z.y):d.lineTo(z.x,l.y);d.lineTo(z.x,z.y)}function cst(d,l,z,j){if(!l)return d.lineTo(z.x,z.y);d.bezierCurveTo(j?l.cp1x:l.cp2x,j?l.cp1y:l.cp2y,j?z.cp2x:z.cp1x,j?z.cp2y:z.cp1y,z.x,z.y)}function hst(d,l){l.translation&&d.translate(l.translation[0],l.translation[1]),Rh(l.rotation)||d.rotate(l.rotation),l.color&&(d.fillStyle=l.color),l.textAlign&&(d.textAlign=l.textAlign),l.textBaseline&&(d.textBaseline=l.textBaseline)}function fst(d,l,z,j,J){if(J.strikethrough||J.underline){const mt=d.measureText(j),kt=l-mt.actualBoundingBoxLeft,Dt=l+mt.actualBoundingBoxRight,Gt=z-mt.actualBoundingBoxAscent,re=z+mt.actualBoundingBoxDescent,pe=J.strikethrough?(Gt+re)/2:re;d.strokeStyle=d.fillStyle,d.beginPath(),d.lineWidth=J.decorationWidth||2,d.moveTo(kt,pe),d.lineTo(Dt,pe),d.stroke()}}function dst(d,l){const z=d.fillStyle;d.fillStyle=l.color,d.fillRect(l.left,l.top,l.width,l.height),d.fillStyle=z}function q2(d,l,z,j,J,mt={}){const kt=Xd(l)?l:[l],Dt=mt.strokeWidth>0&&mt.strokeColor!=="";let Gt,re;for(d.save(),d.font=J.string,hst(d,mt),Gt=0;Gt<kt.length;++Gt)re=kt[Gt],mt.backdrop&&dst(d,mt.backdrop),Dt&&(mt.strokeColor&&(d.strokeStyle=mt.strokeColor),Rh(mt.strokeWidth)||(d.lineWidth=mt.strokeWidth),d.strokeText(re,z,j,mt.maxWidth)),d.fillText(re,z,j,mt.maxWidth),fst(d,z,j,re,mt),j+=Number(J.lineHeight);d.restore()}function p4(d,l){const{x:z,y:j,w:J,h:mt,radius:kt}=l;d.arc(z+kt.topLeft,j+kt.topLeft,kt.topLeft,1.5*Jh,Jh,!0),d.lineTo(z,j+mt-kt.bottomLeft),d.arc(z+kt.bottomLeft,j+mt-kt.bottomLeft,kt.bottomLeft,Jh,ap,!0),d.lineTo(z+J-kt.bottomRight,j+mt),d.arc(z+J-kt.bottomRight,j+mt-kt.bottomRight,kt.bottomRight,ap,0,!0),d.lineTo(z+J,j+kt.topRight),d.arc(z+J-kt.topRight,j+kt.topRight,kt.topRight,0,-ap,!0),d.lineTo(z+kt.topLeft,j)}const pst=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,mst=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function gst(d,l){const z=(""+d).match(pst);if(!z||z[1]==="normal")return l*1.2;switch(d=+z[2],z[3]){case"px":return d;case"%":d/=100;break}return l*d}const vst=d=>+d||0;function uM(d,l){const z={},j=Ec(l),J=j?Object.keys(l):l,mt=Ec(d)?j?kt=>cc(d[kt],d[l[kt]]):kt=>d[kt]:()=>d;for(const kt of J)z[kt]=vst(mt(kt));return z}function WO(d){return uM(d,{top:"y",right:"x",bottom:"y",left:"x"})}function s_(d){return uM(d,["topLeft","topRight","bottomLeft","bottomRight"])}function fm(d){const l=WO(d);return l.width=l.left+l.right,l.height=l.top+l.bottom,l}function Jp(d,l){d=d||{},l=l||Bd.font;let z=cc(d.size,l.size);typeof z=="string"&&(z=parseInt(z,10));let j=cc(d.style,l.style);j&&!(""+j).match(mst)&&(console.warn('Invalid font style specified: "'+j+'"'),j=void 0);const J={family:cc(d.family,l.family),lineHeight:gst(cc(d.lineHeight,l.lineHeight),z),size:z,style:j,weight:cc(d.weight,l.weight),string:""};return J.string=lst(J),J}function P5(d,l,z,j){let J,mt,kt;for(J=0,mt=d.length;J<mt;++J)if(kt=d[J],kt!==void 0&&kt!==void 0)return kt}function yst(d,l,z){const{min:j,max:J}=d,mt=OO(l,(J-j)/2),kt=(Dt,Gt)=>z&&Dt===0?0:Dt+Gt;return{min:kt(j,-Math.abs(mt)),max:kt(J,mt)}}function Cy(d,l){return Object.assign(Object.create(d),l)}function cM(d,l=[""],z,j,J=()=>d[0]){const mt=z||d;typeof j>"u"&&(j=GO("_fallback",d));const kt={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:d,_rootScopes:mt,_fallback:j,_getTarget:J,override:Dt=>cM([Dt,...d],l,mt,j)};return new Proxy(kt,{deleteProperty(Dt,Gt){return delete Dt[Gt],delete Dt._keys,delete d[0][Gt],!0},get(Dt,Gt){return ZO(Dt,Gt,()=>Mst(Gt,l,d,Dt))},getOwnPropertyDescriptor(Dt,Gt){return Reflect.getOwnPropertyDescriptor(Dt._scopes[0],Gt)},getPrototypeOf(){return Reflect.getPrototypeOf(d[0])},has(Dt,Gt){return iP(Dt).includes(Gt)},ownKeys(Dt){return iP(Dt)},set(Dt,Gt,re){const pe=Dt._storage||(Dt._storage=J());return Dt[Gt]=pe[Gt]=re,delete Dt._keys,!0}})}function m_(d,l,z,j){const J={_cacheable:!1,_proxy:d,_context:l,_subProxy:z,_stack:new Set,_descriptors:qO(d,j),setContext:mt=>m_(d,mt,z,j),override:mt=>m_(d.override(mt),l,z,j)};return new Proxy(J,{deleteProperty(mt,kt){return delete mt[kt],delete d[kt],!0},get(mt,kt,Dt){return ZO(mt,kt,()=>_st(mt,kt,Dt))},getOwnPropertyDescriptor(mt,kt){return mt._descriptors.allKeys?Reflect.has(d,kt)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(d,kt)},getPrototypeOf(){return Reflect.getPrototypeOf(d)},has(mt,kt){return Reflect.has(d,kt)},ownKeys(){return Reflect.ownKeys(d)},set(mt,kt,Dt){return d[kt]=Dt,delete mt[kt],!0}})}function qO(d,l={scriptable:!0,indexable:!0}){const{_scriptable:z=l.scriptable,_indexable:j=l.indexable,_allKeys:J=l.allKeys}=d;return{allKeys:J,scriptable:z,indexable:j,isScriptable:v1(z)?z:()=>z,isIndexable:v1(j)?j:()=>j}}const xst=(d,l)=>d?d+iM(l):l,hM=(d,l)=>Ec(l)&&d!=="adapters"&&(Object.getPrototypeOf(l)===null||l.constructor===Object);function ZO(d,l,z){if(Object.prototype.hasOwnProperty.call(d,l)||l==="constructor")return d[l];const j=z();return d[l]=j,j}function _st(d,l,z){const{_proxy:j,_context:J,_subProxy:mt,_descriptors:kt}=d;let Dt=j[l];return v1(Dt)&&kt.isScriptable(l)&&(Dt=bst(l,Dt,d,z)),Xd(Dt)&&Dt.length&&(Dt=wst(l,Dt,d,kt.isIndexable)),hM(l,Dt)&&(Dt=m_(Dt,J,mt&&mt[l],kt)),Dt}function bst(d,l,z,j){const{_proxy:J,_context:mt,_subProxy:kt,_stack:Dt}=z;if(Dt.has(d))throw new Error("Recursion detected: "+Array.from(Dt).join("->")+"->"+d);Dt.add(d);let Gt=l(mt,kt||j);return Dt.delete(d),hM(d,Gt)&&(Gt=fM(J._scopes,J,d,Gt)),Gt}function wst(d,l,z,j){const{_proxy:J,_context:mt,_subProxy:kt,_descriptors:Dt}=z;if(typeof mt.index<"u"&&j(d))return l[mt.index%l.length];if(Ec(l[0])){const Gt=l,re=J._scopes.filter(pe=>pe!==Gt);l=[];for(const pe of Gt){const Ne=fM(re,J,d,pe);l.push(m_(Ne,mt,kt&&kt[d],Dt))}}return l}function $O(d,l,z){return v1(d)?d(l,z):d}const kst=(d,l)=>d===!0?l:typeof d=="string"?My(l,d):void 0;function Tst(d,l,z,j,J){for(const mt of l){const kt=kst(z,mt);if(kt){d.add(kt);const Dt=$O(kt._fallback,z,J);if(typeof Dt<"u"&&Dt!==z&&Dt!==j)return Dt}else if(kt===!1&&typeof j<"u"&&z!==j)return null}return!1}function fM(d,l,z,j){const J=l._rootScopes,mt=$O(l._fallback,z,j),kt=[...d,...J],Dt=new Set;Dt.add(j);let Gt=nP(Dt,kt,z,mt||z,j);return Gt===null||typeof mt<"u"&&mt!==z&&(Gt=nP(Dt,kt,mt,Gt,j),Gt===null)?!1:cM(Array.from(Dt),[""],J,mt,()=>Ast(l,z,j))}function nP(d,l,z,j,J){for(;z;)z=Tst(d,l,z,j,J);return z}function Ast(d,l,z){const j=d._getTarget();l in j||(j[l]={});const J=j[l];return Xd(J)&&Ec(z)?z:J||{}}function Mst(d,l,z,j){let J;for(const mt of l)if(J=GO(xst(mt,d),z),typeof J<"u")return hM(d,J)?fM(z,j,d,J):J}function GO(d,l){for(const z of l){if(!z)continue;const j=z[d];if(typeof j<"u")return j}}function iP(d){let l=d._keys;return l||(l=d._keys=Sst(d._scopes)),l}function Sst(d){const l=new Set;for(const z of d)for(const j of Object.keys(z).filter(J=>!J.startsWith("_")))l.add(j);return Array.from(l)}const Est=Number.EPSILON||1e-14,g_=(d,l)=>l<d.length&&!d[l].skip&&d[l],YO=d=>d==="x"?"y":"x";function Cst(d,l,z,j){const J=d.skip?l:d,mt=l,kt=z.skip?l:z,Dt=gA(mt,J),Gt=gA(kt,mt);let re=Dt/(Dt+Gt),pe=Gt/(Dt+Gt);re=isNaN(re)?0:re,pe=isNaN(pe)?0:pe;const Ne=j*re,or=j*pe;return{previous:{x:mt.x-Ne*(kt.x-J.x),y:mt.y-Ne*(kt.y-J.y)},next:{x:mt.x+or*(kt.x-J.x),y:mt.y+or*(kt.y-J.y)}}}function Lst(d,l,z){const j=d.length;let J,mt,kt,Dt,Gt,re=g_(d,0);for(let pe=0;pe<j-1;++pe)if(Gt=re,re=g_(d,pe+1),!(!Gt||!re)){if(A2(l[pe],0,Est)){z[pe]=z[pe+1]=0;continue}J=z[pe]/l[pe],mt=z[pe+1]/l[pe],Dt=Math.pow(J,2)+Math.pow(mt,2),!(Dt<=9)&&(kt=3/Math.sqrt(Dt),z[pe]=J*kt*l[pe],z[pe+1]=mt*kt*l[pe])}}function Pst(d,l,z="x"){const j=YO(z),J=d.length;let mt,kt,Dt,Gt=g_(d,0);for(let re=0;re<J;++re){if(kt=Dt,Dt=Gt,Gt=g_(d,re+1),!Dt)continue;const pe=Dt[z],Ne=Dt[j];kt&&(mt=(pe-kt[z])/3,Dt[`cp1${z}`]=pe-mt,Dt[`cp1${j}`]=Ne-mt*l[re]),Gt&&(mt=(Gt[z]-pe)/3,Dt[`cp2${z}`]=pe+mt,Dt[`cp2${j}`]=Ne+mt*l[re])}}function zst(d,l="x"){const z=YO(l),j=d.length,J=Array(j).fill(0),mt=Array(j);let kt,Dt,Gt,re=g_(d,0);for(kt=0;kt<j;++kt)if(Dt=Gt,Gt=re,re=g_(d,kt+1),!!Gt){if(re){const pe=re[l]-Gt[l];J[kt]=pe!==0?(re[z]-Gt[z])/pe:0}mt[kt]=Dt?re?cg(J[kt-1])!==cg(J[kt])?0:(J[kt-1]+J[kt])/2:J[kt-1]:J[kt]}Lst(d,J,mt),Pst(d,mt,l)}function z5(d,l,z){return Math.max(Math.min(d,z),l)}function Ist(d,l){let z,j,J,mt,kt,Dt=W2(d[0],l);for(z=0,j=d.length;z<j;++z)kt=mt,mt=Dt,Dt=z<j-1&&W2(d[z+1],l),mt&&(J=d[z],kt&&(J.cp1x=z5(J.cp1x,l.left,l.right),J.cp1y=z5(J.cp1y,l.top,l.bottom)),Dt&&(J.cp2x=z5(J.cp2x,l.left,l.right),J.cp2y=z5(J.cp2y,l.top,l.bottom)))}function Ost(d,l,z,j,J){let mt,kt,Dt,Gt;if(l.spanGaps&&(d=d.filter(re=>!re.skip)),l.cubicInterpolationMode==="monotone")zst(d,J);else{let re=j?d[d.length-1]:d[0];for(mt=0,kt=d.length;mt<kt;++mt)Dt=d[mt],Gt=Cst(re,Dt,d[Math.min(mt+1,kt-(j?0:1))%kt],l.tension),Dt.cp1x=Gt.previous.x,Dt.cp1y=Gt.previous.y,Dt.cp2x=Gt.next.x,Dt.cp2y=Gt.next.y,re=Dt}l.capBezierPoints&&Ist(d,z)}function dM(){return typeof window<"u"&&typeof document<"u"}function pM(d){let l=d.parentNode;return l&&l.toString()==="[object ShadowRoot]"&&(l=l.host),l}function m4(d,l,z){let j;return typeof d=="string"?(j=parseInt(d,10),d.indexOf("%")!==-1&&(j=j/100*l.parentNode[z])):j=d,j}const H4=d=>d.ownerDocument.defaultView.getComputedStyle(d,null);function Dst(d,l){return H4(d).getPropertyValue(l)}const Fst=["top","right","bottom","left"];function wy(d,l,z){const j={};z=z?"-"+z:"";for(let J=0;J<4;J++){const mt=Fst[J];j[mt]=parseFloat(d[l+"-"+mt+z])||0}return j.width=j.left+j.right,j.height=j.top+j.bottom,j}const Rst=(d,l,z)=>(d>0||l>0)&&(!z||!z.shadowRoot);function Bst(d,l){const z=d.touches,j=z&&z.length?z[0]:d,{offsetX:J,offsetY:mt}=j;let kt=!1,Dt,Gt;if(Rst(J,mt,d.target))Dt=J,Gt=mt;else{const re=l.getBoundingClientRect();Dt=j.clientX-re.left,Gt=j.clientY-re.top,kt=!0}return{x:Dt,y:Gt,box:kt}}function hy(d,l){if("native"in d)return d;const{canvas:z,currentDevicePixelRatio:j}=l,J=H4(z),mt=J.boxSizing==="border-box",kt=wy(J,"padding"),Dt=wy(J,"border","width"),{x:Gt,y:re,box:pe}=Bst(d,z),Ne=kt.left+(pe&&Dt.left),or=kt.top+(pe&&Dt.top);let{width:_r,height:Fr}=l;return mt&&(_r-=kt.width+Dt.width,Fr-=kt.height+Dt.height),{x:Math.round((Gt-Ne)/_r*z.width/j),y:Math.round((re-or)/Fr*z.height/j)}}function Nst(d,l,z){let j,J;if(l===void 0||z===void 0){const mt=d&&pM(d);if(!mt)l=d.clientWidth,z=d.clientHeight;else{const kt=mt.getBoundingClientRect(),Dt=H4(mt),Gt=wy(Dt,"border","width"),re=wy(Dt,"padding");l=kt.width-re.width-Gt.width,z=kt.height-re.height-Gt.height,j=m4(Dt.maxWidth,mt,"clientWidth"),J=m4(Dt.maxHeight,mt,"clientHeight")}}return{width:l,height:z,maxWidth:j||d4,maxHeight:J||d4}}const c1=d=>Math.round(d*10)/10;function jst(d,l,z,j){const J=H4(d),mt=wy(J,"margin"),kt=m4(J.maxWidth,d,"clientWidth")||d4,Dt=m4(J.maxHeight,d,"clientHeight")||d4,Gt=Nst(d,l,z);let{width:re,height:pe}=Gt;if(J.boxSizing==="content-box"){const or=wy(J,"border","width"),_r=wy(J,"padding");re-=_r.width+or.width,pe-=_r.height+or.height}return re=Math.max(0,re-mt.width),pe=Math.max(0,j?re/j:pe-mt.height),re=c1(Math.min(re,kt,Gt.maxWidth)),pe=c1(Math.min(pe,Dt,Gt.maxHeight)),re&&!pe&&(pe=c1(re/2)),(l!==void 0||z!==void 0)&&j&&Gt.height&&pe>Gt.height&&(pe=Gt.height,re=c1(Math.floor(pe*j))),{width:re,height:pe}}function aP(d,l,z){const j=l||1,J=c1(d.height*j),mt=c1(d.width*j);d.height=c1(d.height),d.width=c1(d.width);const kt=d.canvas;return kt.style&&(z||!kt.style.height&&!kt.style.width)&&(kt.style.height=`${d.height}px`,kt.style.width=`${d.width}px`),d.currentDevicePixelRatio!==j||kt.height!==J||kt.width!==mt?(d.currentDevicePixelRatio=j,kt.height=J,kt.width=mt,d.ctx.setTransform(j,0,0,j,0,0),!0):!1}const Ust=function(){let d=!1;try{const l={get passive(){return d=!0,!1}};dM()&&(window.addEventListener("test",null,l),window.removeEventListener("test",null,l))}catch{}return d}();function oP(d,l){const z=Dst(d,l),j=z&&z.match(/^(\d+)(\.\d+)?px$/);return j?+j[1]:void 0}function fy(d,l,z,j){return{x:d.x+z*(l.x-d.x),y:d.y+z*(l.y-d.y)}}function Vst(d,l,z,j){return{x:d.x+z*(l.x-d.x),y:j==="middle"?z<.5?d.y:l.y:j==="after"?z<1?d.y:l.y:z>0?l.y:d.y}}function Hst(d,l,z,j){const J={x:d.cp2x,y:d.cp2y},mt={x:l.cp1x,y:l.cp1y},kt=fy(d,J,z),Dt=fy(J,mt,z),Gt=fy(mt,l,z),re=fy(kt,Dt,z),pe=fy(Dt,Gt,z);return fy(re,pe,z)}const Wst=function(d,l){return{x(z){return d+d+l-z},setWidth(z){l=z},textAlign(z){return z==="center"?z:z==="right"?"left":"right"},xPlus(z,j){return z-j},leftForLtr(z,j){return z-j}}},qst=function(){return{x(d){return d},setWidth(d){},textAlign(d){return d},xPlus(d,l){return d+l},leftForLtr(d,l){return d}}};function l_(d,l,z){return d?Wst(l,z):qst()}function KO(d,l){let z,j;(l==="ltr"||l==="rtl")&&(z=d.canvas.style,j=[z.getPropertyValue("direction"),z.getPropertyPriority("direction")],z.setProperty("direction",l,"important"),d.prevTextDirection=j)}function XO(d,l){l!==void 0&&(delete d.prevTextDirection,d.canvas.style.setProperty("direction",l[0],l[1]))}function JO(d){return d==="angle"?{between:H2,compare:Wot,normalize:q0}:{between:ev,compare:(l,z)=>l-z,normalize:l=>l}}function sP({start:d,end:l,count:z,loop:j,style:J}){return{start:d%z,end:l%z,loop:j&&(l-d+1)%z===0,style:J}}function Zst(d,l,z){const{property:j,start:J,end:mt}=z,{between:kt,normalize:Dt}=JO(j),Gt=l.length;let{start:re,end:pe,loop:Ne}=d,or,_r;if(Ne){for(re+=Gt,pe+=Gt,or=0,_r=Gt;or<_r&&kt(Dt(l[re%Gt][j]),J,mt);++or)re--,pe--;re%=Gt,pe%=Gt}return pe<re&&(pe+=Gt),{start:re,end:pe,loop:Ne,style:d.style}}function QO(d,l,z){if(!z)return[d];const{property:j,start:J,end:mt}=z,kt=l.length,{compare:Dt,between:Gt,normalize:re}=JO(j),{start:pe,end:Ne,loop:or,style:_r}=Zst(d,l,z),Fr=[];let zr=!1,Wr=null,An,Ft,kn;const ei=()=>Gt(J,kn,An)&&Dt(J,kn)!==0,jn=()=>Dt(mt,An)===0||Gt(mt,kn,An),ai=()=>zr||ei(),Qi=()=>!zr||jn();for(let Gi=pe,un=pe;Gi<=Ne;++Gi)Ft=l[Gi%kt],!Ft.skip&&(An=re(Ft[j]),An!==kn&&(zr=Gt(An,J,mt),Wr===null&&ai()&&(Wr=Dt(An,J)===0?Gi:un),Wr!==null&&Qi()&&(Fr.push(sP({start:Wr,end:Gi,loop:or,count:kt,style:_r})),Wr=null),un=Gi,kn=An));return Wr!==null&&Fr.push(sP({start:Wr,end:Ne,loop:or,count:kt,style:_r})),Fr}function tD(d,l){const z=[],j=d.segments;for(let J=0;J<j.length;J++){const mt=QO(j[J],d.points,l);mt.length&&z.push(...mt)}return z}function $st(d,l,z,j){let J=0,mt=l-1;if(z&&!j)for(;J<l&&!d[J].skip;)J++;for(;J<l&&d[J].skip;)J++;for(J%=l,z&&(mt+=J);mt>J&&d[mt%l].skip;)mt--;return mt%=l,{start:J,end:mt}}function Gst(d,l,z,j){const J=d.length,mt=[];let kt=l,Dt=d[l],Gt;for(Gt=l+1;Gt<=z;++Gt){const re=d[Gt%J];re.skip||re.stop?Dt.skip||(j=!1,mt.push({start:l%J,end:(Gt-1)%J,loop:j}),l=kt=re.stop?Gt:null):(kt=Gt,Dt.skip&&(l=Gt)),Dt=re}return kt!==null&&mt.push({start:l%J,end:kt%J,loop:j}),mt}function Yst(d,l){const z=d.points,j=d.options.spanGaps,J=z.length;if(!J)return[];const mt=!!d._loop,{start:kt,end:Dt}=$st(z,J,mt,j);if(j===!0)return lP(d,[{start:kt,end:Dt,loop:mt}],z,l);const Gt=Dt<kt?Dt+J:Dt,re=!!d._fullLoop&&kt===0&&Dt===J-1;return lP(d,Gst(z,kt,Gt,re),z,l)}function lP(d,l,z,j){return!j||!j.setContext||!z?l:Kst(d,l,z,j)}function Kst(d,l,z,j){const J=d._chart.getContext(),mt=uP(d.options),{_datasetIndex:kt,options:{spanGaps:Dt}}=d,Gt=z.length,re=[];let pe=mt,Ne=l[0].start,or=Ne;function _r(Fr,zr,Wr,An){const Ft=Dt?-1:1;if(Fr!==zr){for(Fr+=Gt;z[Fr%Gt].skip;)Fr-=Ft;for(;z[zr%Gt].skip;)zr+=Ft;Fr%Gt!==zr%Gt&&(re.push({start:Fr%Gt,end:zr%Gt,loop:Wr,style:An}),pe=An,Ne=zr%Gt)}}for(const Fr of l){Ne=Dt?Ne:Fr.start;let zr=z[Ne%Gt],Wr;for(or=Ne+1;or<=Fr.end;or++){const An=z[or%Gt];Wr=uP(j.setContext(Cy(J,{type:"segment",p0:zr,p1:An,p0DataIndex:(or-1)%Gt,p1DataIndex:or%Gt,datasetIndex:kt}))),Xst(Wr,pe)&&_r(Ne,or-1,Fr.loop,pe),zr=An,pe=Wr}Ne<or-1&&_r(Ne,or-1,Fr.loop,pe)}return re}function uP(d){return{backgroundColor:d.backgroundColor,borderCapStyle:d.borderCapStyle,borderDash:d.borderDash,borderDashOffset:d.borderDashOffset,borderJoinStyle:d.borderJoinStyle,borderWidth:d.borderWidth,borderColor:d.borderColor}}function Xst(d,l){if(!l)return!1;const z=[],j=function(J,mt){return sM(mt)?(z.includes(mt)||z.push(mt),z.indexOf(mt)):mt};return JSON.stringify(d,j)!==JSON.stringify(l,j)}function I5(d,l,z){return d.options.clip?d[z]:l[z]}function Jst(d,l){const{xScale:z,yScale:j}=d;return z&&j?{left:I5(z,l,"left"),right:I5(z,l,"right"),top:I5(j,l,"top"),bottom:I5(j,l,"bottom")}:l}function eD(d,l){const z=l._clip;if(z.disabled)return!1;const j=Jst(l,d.chartArea);return{left:z.left===!1?0:j.left-(z.left===!0?0:z.left),right:z.right===!1?d.width:j.right+(z.right===!0?0:z.right),top:z.top===!1?0:j.top-(z.top===!0?0:z.top),bottom:z.bottom===!1?d.height:j.bottom+(z.bottom===!0?0:z.bottom)}}/*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/class Qst{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(l,z,j,J){const mt=z.listeners[J],kt=z.duration;mt.forEach(Dt=>Dt({chart:l,initial:z.initial,numSteps:kt,currentStep:Math.min(j-z.start,kt)}))}_refresh(){this._request||(this._running=!0,this._request=jO.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(l=Date.now()){let z=0;this._charts.forEach((j,J)=>{if(!j.running||!j.items.length)return;const mt=j.items;let kt=mt.length-1,Dt=!1,Gt;for(;kt>=0;--kt)Gt=mt[kt],Gt._active?(Gt._total>j.duration&&(j.duration=Gt._total),Gt.tick(l),Dt=!0):(mt[kt]=mt[mt.length-1],mt.pop());Dt&&(J.draw(),this._notify(J,j,l,"progress")),mt.length||(j.running=!1,this._notify(J,j,l,"complete"),j.initial=!1),z+=mt.length}),this._lastDate=l,z===0&&(this._running=!1)}_getAnims(l){const z=this._charts;let j=z.get(l);return j||(j={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},z.set(l,j)),j}listen(l,z,j){this._getAnims(l).listeners[z].push(j)}add(l,z){!z||!z.length||this._getAnims(l).items.push(...z)}has(l){return this._getAnims(l).items.length>0}start(l){const z=this._charts.get(l);z&&(z.running=!0,z.start=Date.now(),z.duration=z.items.reduce((j,J)=>Math.max(j,J._duration),0),this._refresh())}running(l){if(!this._running)return!1;const z=this._charts.get(l);return!(!z||!z.running||!z.items.length)}stop(l){const z=this._charts.get(l);if(!z||!z.items.length)return;const j=z.items;let J=j.length-1;for(;J>=0;--J)j[J].cancel();z.items=[],this._notify(l,z,Date.now(),"complete")}remove(l){return this._charts.delete(l)}}var Gg=new Qst;const cP="transparent",tlt={boolean(d,l,z){return z>.5?l:d},color(d,l,z){const j=QL(d||cP),J=j.valid&&QL(l||cP);return J&&J.valid?J.mix(j,z).hexString():l},number(d,l,z){return d+(l-d)*z}};class elt{constructor(l,z,j,J){const mt=z[j];J=P5([l.to,J,mt,l.from]);const kt=P5([l.from,mt,J]);this._active=!0,this._fn=l.fn||tlt[l.type||typeof kt],this._easing=M2[l.easing]||M2.linear,this._start=Math.floor(Date.now()+(l.delay||0)),this._duration=this._total=Math.floor(l.duration),this._loop=!!l.loop,this._target=z,this._prop=j,this._from=kt,this._to=J,this._promises=void 0}active(){return this._active}update(l,z,j){if(this._active){this._notify(!1);const J=this._target[this._prop],mt=j-this._start,kt=this._duration-mt;this._start=j,this._duration=Math.floor(Math.max(kt,l.duration)),this._total+=mt,this._loop=!!l.loop,this._to=P5([l.to,z,J,l.from]),this._from=P5([l.from,J,z])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(l){const z=l-this._start,j=this._duration,J=this._prop,mt=this._from,kt=this._loop,Dt=this._to;let Gt;if(this._active=mt!==Dt&&(kt||z<j),!this._active){this._target[J]=Dt,this._notify(!0);return}if(z<0){this._target[J]=mt;return}Gt=z/j%2,Gt=kt&&Gt>1?2-Gt:Gt,Gt=this._easing(Math.min(1,Math.max(0,Gt))),this._target[J]=this._fn(mt,Dt,Gt)}wait(){const l=this._promises||(this._promises=[]);return new Promise((z,j)=>{l.push({res:z,rej:j})})}_notify(l){const z=l?"res":"rej",j=this._promises||[];for(let J=0;J<j.length;J++)j[J][z]()}}class rD{constructor(l,z){this._chart=l,this._properties=new Map,this.configure(z)}configure(l){if(!Ec(l))return;const z=Object.keys(Bd.animation),j=this._properties;Object.getOwnPropertyNames(l).forEach(J=>{const mt=l[J];if(!Ec(mt))return;const kt={};for(const Dt of z)kt[Dt]=mt[Dt];(Xd(mt.properties)&&mt.properties||[J]).forEach(Dt=>{(Dt===J||!j.has(Dt))&&j.set(Dt,kt)})})}_animateOptions(l,z){const j=z.options,J=nlt(l,j);if(!J)return[];const mt=this._createAnimations(J,j);return j.$shared&&rlt(l.options.$animations,j).then(()=>{l.options=j},()=>{}),mt}_createAnimations(l,z){const j=this._properties,J=[],mt=l.$animations||(l.$animations={}),kt=Object.keys(z),Dt=Date.now();let Gt;for(Gt=kt.length-1;Gt>=0;--Gt){const re=kt[Gt];if(re.charAt(0)==="$")continue;if(re==="options"){J.push(...this._animateOptions(l,z));continue}const pe=z[re];let Ne=mt[re];const or=j.get(re);if(Ne)if(or&&Ne.active()){Ne.update(or,pe,Dt);continue}else Ne.cancel();if(!or||!or.duration){l[re]=pe;continue}mt[re]=Ne=new elt(or,l,re,pe),J.push(Ne)}return J}update(l,z){if(this._properties.size===0){Object.assign(l,z);return}const j=this._createAnimations(l,z);if(j.length)return Gg.add(this._chart,j),!0}}function rlt(d,l){const z=[],j=Object.keys(l);for(let J=0;J<j.length;J++){const mt=d[j[J]];mt&&mt.active()&&z.push(mt.wait())}return Promise.all(z)}function nlt(d,l){if(!l)return;let z=d.options;if(!z){d.options=l;return}return z.$shared&&(d.options=z=Object.assign({},z,{$shared:!1,$animations:{}})),z}function hP(d,l){const z=d&&d.options||{},j=z.reverse,J=z.min===void 0?l:0,mt=z.max===void 0?l:0;return{start:j?mt:J,end:j?J:mt}}function ilt(d,l,z){if(z===!1)return!1;const j=hP(d,z),J=hP(l,z);return{top:J.end,right:j.end,bottom:J.start,left:j.start}}function alt(d){let l,z,j,J;return Ec(d)?(l=d.top,z=d.right,j=d.bottom,J=d.left):l=z=j=J=d,{top:l,right:z,bottom:j,left:J,disabled:d===!1}}function nD(d,l){const z=[],j=d._getSortedDatasetMetas(l);let J,mt;for(J=0,mt=j.length;J<mt;++J)z.push(j[J].index);return z}function fP(d,l,z,j={}){const J=d.keys,mt=j.mode==="single";let kt,Dt,Gt,re;if(l===null)return;let pe=!1;for(kt=0,Dt=J.length;kt<Dt;++kt){if(Gt=+J[kt],Gt===z){if(pe=!0,j.all)continue;break}re=d.values[Gt],Qp(re)&&(mt||l===0||cg(l)===cg(re))&&(l+=re)}return!pe&&!j.all?0:l}function olt(d,l){const{iScale:z,vScale:j}=l,J=z.axis==="x"?"x":"y",mt=j.axis==="x"?"x":"y",kt=Object.keys(d),Dt=new Array(kt.length);let Gt,re,pe;for(Gt=0,re=kt.length;Gt<re;++Gt)pe=kt[Gt],Dt[Gt]={[J]:pe,[mt]:d[pe]};return Dt}function I8(d,l){const z=d&&d.options.stacked;return z||z===void 0&&l.stack!==void 0}function slt(d,l,z){return`${d.id}.${l.id}.${z.stack||z.type}`}function llt(d){const{min:l,max:z,minDefined:j,maxDefined:J}=d.getUserBounds();return{min:j?l:Number.NEGATIVE_INFINITY,max:J?z:Number.POSITIVE_INFINITY}}function ult(d,l,z){const j=d[l]||(d[l]={});return j[z]||(j[z]={})}function dP(d,l,z,j){for(const J of l.getMatchingVisibleMetas(j).reverse()){const mt=d[J.index];if(z&&mt>0||!z&&mt<0)return J.index}return null}function pP(d,l){const{chart:z,_cachedMeta:j}=d,J=z._stacks||(z._stacks={}),{iScale:mt,vScale:kt,index:Dt}=j,Gt=mt.axis,re=kt.axis,pe=slt(mt,kt,j),Ne=l.length;let or;for(let _r=0;_r<Ne;++_r){const Fr=l[_r],{[Gt]:zr,[re]:Wr}=Fr,An=Fr._stacks||(Fr._stacks={});or=An[re]=ult(J,pe,zr),or[Dt]=Wr,or._top=dP(or,kt,!0,j.type),or._bottom=dP(or,kt,!1,j.type);const Ft=or._visualValues||(or._visualValues={});Ft[Dt]=Wr}}function O8(d,l){const z=d.scales;return Object.keys(z).filter(j=>z[j].axis===l).shift()}function clt(d,l){return Cy(d,{active:!1,dataset:void 0,datasetIndex:l,index:l,mode:"default",type:"dataset"})}function hlt(d,l,z){return Cy(d,{active:!1,dataIndex:l,parsed:void 0,raw:void 0,element:z,index:l,mode:"default",type:"data"})}function e2(d,l){const z=d.controller.index,j=d.vScale&&d.vScale.axis;if(j){l=l||d._parsed;for(const J of l){const mt=J._stacks;if(!mt||mt[j]===void 0||mt[j][z]===void 0)return;delete mt[j][z],mt[j]._visualValues!==void 0&&mt[j]._visualValues[z]!==void 0&&delete mt[j]._visualValues[z]}}}const D8=d=>d==="reset"||d==="none",mP=(d,l)=>l?d:Object.assign({},d),flt=(d,l,z)=>d&&!l.hidden&&l._stacked&&{keys:nD(z,!0),values:null};class W4{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(l,z){this.chart=l,this._ctx=l.ctx,this.index=z,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const l=this._cachedMeta;this.configure(),this.linkScales(),l._stacked=I8(l.vScale,l),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(l){this.index!==l&&e2(this._cachedMeta),this.index=l}linkScales(){const l=this.chart,z=this._cachedMeta,j=this.getDataset(),J=(Ne,or,_r,Fr)=>Ne==="x"?or:Ne==="r"?Fr:_r,mt=z.xAxisID=cc(j.xAxisID,O8(l,"x")),kt=z.yAxisID=cc(j.yAxisID,O8(l,"y")),Dt=z.rAxisID=cc(j.rAxisID,O8(l,"r")),Gt=z.indexAxis,re=z.iAxisID=J(Gt,mt,kt,Dt),pe=z.vAxisID=J(Gt,kt,mt,Dt);z.xScale=this.getScaleForId(mt),z.yScale=this.getScaleForId(kt),z.rScale=this.getScaleForId(Dt),z.iScale=this.getScaleForId(re),z.vScale=this.getScaleForId(pe)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(l){return this.chart.scales[l]}_getOtherScale(l){const z=this._cachedMeta;return l===z.iScale?z.vScale:z.iScale}reset(){this._update("reset")}_destroy(){const l=this._cachedMeta;this._data&&KL(this._data,this),l._stacked&&e2(l)}_dataCheck(){const l=this.getDataset(),z=l.data||(l.data=[]),j=this._data;if(Ec(z)){const J=this._cachedMeta;this._data=olt(z,J)}else if(j!==z){if(j){KL(j,this);const J=this._cachedMeta;e2(J),J._parsed=[]}z&&Object.isExtensible(z)&&Got(z,this),this._syncList=[],this._data=z}}addElements(){const l=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(l.dataset=new this.datasetElementType)}buildOrUpdateElements(l){const z=this._cachedMeta,j=this.getDataset();let J=!1;this._dataCheck();const mt=z._stacked;z._stacked=I8(z.vScale,z),z.stack!==j.stack&&(J=!0,e2(z),z.stack=j.stack),this._resyncElements(l),(J||mt!==z._stacked)&&(pP(this,z._parsed),z._stacked=I8(z.vScale,z))}configure(){const l=this.chart.config,z=l.datasetScopeKeys(this._type),j=l.getOptionScopes(this.getDataset(),z,!0);this.options=l.createResolver(j,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(l,z){const{_cachedMeta:j,_data:J}=this,{iScale:mt,_stacked:kt}=j,Dt=mt.axis;let Gt=l===0&&z===J.length?!0:j._sorted,re=l>0&&j._parsed[l-1],pe,Ne,or;if(this._parsing===!1)j._parsed=J,j._sorted=!0,or=J;else{Xd(J[l])?or=this.parseArrayData(j,J,l,z):Ec(J[l])?or=this.parseObjectData(j,J,l,z):or=this.parsePrimitiveData(j,J,l,z);const _r=()=>Ne[Dt]===null||re&&Ne[Dt]<re[Dt];for(pe=0;pe<z;++pe)j._parsed[pe+l]=Ne=or[pe],Gt&&(_r()&&(Gt=!1),re=Ne);j._sorted=Gt}kt&&pP(this,or)}parsePrimitiveData(l,z,j,J){const{iScale:mt,vScale:kt}=l,Dt=mt.axis,Gt=kt.axis,re=mt.getLabels(),pe=mt===kt,Ne=new Array(J);let or,_r,Fr;for(or=0,_r=J;or<_r;++or)Fr=or+j,Ne[or]={[Dt]:pe||mt.parse(re[Fr],Fr),[Gt]:kt.parse(z[Fr],Fr)};return Ne}parseArrayData(l,z,j,J){const{xScale:mt,yScale:kt}=l,Dt=new Array(J);let Gt,re,pe,Ne;for(Gt=0,re=J;Gt<re;++Gt)pe=Gt+j,Ne=z[pe],Dt[Gt]={x:mt.parse(Ne[0],pe),y:kt.parse(Ne[1],pe)};return Dt}parseObjectData(l,z,j,J){const{xScale:mt,yScale:kt}=l,{xAxisKey:Dt="x",yAxisKey:Gt="y"}=this._parsing,re=new Array(J);let pe,Ne,or,_r;for(pe=0,Ne=J;pe<Ne;++pe)or=pe+j,_r=z[or],re[pe]={x:mt.parse(My(_r,Dt),or),y:kt.parse(My(_r,Gt),or)};return re}getParsed(l){return this._cachedMeta._parsed[l]}getDataElement(l){return this._cachedMeta.data[l]}applyStack(l,z,j){const J=this.chart,mt=this._cachedMeta,kt=z[l.axis],Dt={keys:nD(J,!0),values:z._stacks[l.axis]._visualValues};return fP(Dt,kt,mt.index,{mode:j})}updateRangeFromParsed(l,z,j,J){const mt=j[z.axis];let kt=mt===null?NaN:mt;const Dt=J&&j._stacks[z.axis];J&&Dt&&(J.values=Dt,kt=fP(J,mt,this._cachedMeta.index)),l.min=Math.min(l.min,kt),l.max=Math.max(l.max,kt)}getMinMax(l,z){const j=this._cachedMeta,J=j._parsed,mt=j._sorted&&l===j.iScale,kt=J.length,Dt=this._getOtherScale(l),Gt=flt(z,j,this.chart),re={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:pe,max:Ne}=llt(Dt);let or,_r;function Fr(){_r=J[or];const zr=_r[Dt.axis];return!Qp(_r[l.axis])||pe>zr||Ne<zr}for(or=0;or<kt&&!(!Fr()&&(this.updateRangeFromParsed(re,l,_r,Gt),mt));++or);if(mt){for(or=kt-1;or>=0;--or)if(!Fr()){this.updateRangeFromParsed(re,l,_r,Gt);break}}return re}getAllParsedValues(l){const z=this._cachedMeta._parsed,j=[];let J,mt,kt;for(J=0,mt=z.length;J<mt;++J)kt=z[J][l.axis],Qp(kt)&&j.push(kt);return j}getMaxOverflow(){return!1}getLabelAndValue(l){const z=this._cachedMeta,j=z.iScale,J=z.vScale,mt=this.getParsed(l);return{label:j?""+j.getLabelForValue(mt[j.axis]):"",value:J?""+J.getLabelForValue(mt[J.axis]):""}}_update(l){const z=this._cachedMeta;this.update(l||"default"),z._clip=alt(cc(this.options.clip,ilt(z.xScale,z.yScale,this.getMaxOverflow())))}update(l){}draw(){const l=this._ctx,z=this.chart,j=this._cachedMeta,J=j.data||[],mt=z.chartArea,kt=[],Dt=this._drawStart||0,Gt=this._drawCount||J.length-Dt,re=this.options.drawActiveElementsOnTop;let pe;for(j.dataset&&j.dataset.draw(l,mt,Dt,Gt),pe=Dt;pe<Dt+Gt;++pe){const Ne=J[pe];Ne.hidden||(Ne.active&&re?kt.push(Ne):Ne.draw(l,mt))}for(pe=0;pe<kt.length;++pe)kt[pe].draw(l,mt)}getStyle(l,z){const j=z?"active":"default";return l===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(j):this.resolveDataElementOptions(l||0,j)}getContext(l,z,j){const J=this.getDataset();let mt;if(l>=0&&l<this._cachedMeta.data.length){const kt=this._cachedMeta.data[l];mt=kt.$context||(kt.$context=hlt(this.getContext(),l,kt)),mt.parsed=this.getParsed(l),mt.raw=J.data[l],mt.index=mt.dataIndex=l}else mt=this.$context||(this.$context=clt(this.chart.getContext(),this.index)),mt.dataset=J,mt.index=mt.datasetIndex=this.index;return mt.active=!!z,mt.mode=j,mt}resolveDatasetElementOptions(l){return this._resolveElementOptions(this.datasetElementType.id,l)}resolveDataElementOptions(l,z){return this._resolveElementOptions(this.dataElementType.id,z,l)}_resolveElementOptions(l,z="default",j){const J=z==="active",mt=this._cachedDataOpts,kt=l+"-"+z,Dt=mt[kt],Gt=this.enableOptionSharing&&U2(j);if(Dt)return mP(Dt,Gt);const re=this.chart.config,pe=re.datasetElementScopeKeys(this._type,l),Ne=J?[`${l}Hover`,"hover",l,""]:[l,""],or=re.getOptionScopes(this.getDataset(),pe),_r=Object.keys(Bd.elements[l]),Fr=()=>this.getContext(j,J,z),zr=re.resolveNamedOptions(or,_r,Fr,Ne);return zr.$shared&&(zr.$shared=Gt,mt[kt]=Object.freeze(mP(zr,Gt))),zr}_resolveAnimations(l,z,j){const J=this.chart,mt=this._cachedDataOpts,kt=`animation-${z}`,Dt=mt[kt];if(Dt)return Dt;let Gt;if(J.options.animation!==!1){const pe=this.chart.config,Ne=pe.datasetAnimationScopeKeys(this._type,z),or=pe.getOptionScopes(this.getDataset(),Ne);Gt=pe.createResolver(or,this.getContext(l,j,z))}const re=new rD(J,Gt&&Gt.animations);return Gt&&Gt._cacheable&&(mt[kt]=Object.freeze(re)),re}getSharedOptions(l){if(l.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},l))}includeOptions(l,z){return!z||D8(l)||this.chart._animationsDisabled}_getSharedOptions(l,z){const j=this.resolveDataElementOptions(l,z),J=this._sharedOptions,mt=this.getSharedOptions(j),kt=this.includeOptions(z,mt)||mt!==J;return this.updateSharedOptions(mt,z,j),{sharedOptions:mt,includeOptions:kt}}updateElement(l,z,j,J){D8(J)?Object.assign(l,j):this._resolveAnimations(z,J).update(l,j)}updateSharedOptions(l,z,j){l&&!D8(z)&&this._resolveAnimations(void 0,z).update(l,j)}_setStyle(l,z,j,J){l.active=J;const mt=this.getStyle(z,J);this._resolveAnimations(z,j,J).update(l,{options:!J&&this.getSharedOptions(mt)||mt})}removeHoverStyle(l,z,j){this._setStyle(l,j,"active",!1)}setHoverStyle(l,z,j){this._setStyle(l,j,"active",!0)}_removeDatasetHoverStyle(){const l=this._cachedMeta.dataset;l&&this._setStyle(l,void 0,"active",!1)}_setDatasetHoverStyle(){const l=this._cachedMeta.dataset;l&&this._setStyle(l,void 0,"active",!0)}_resyncElements(l){const z=this._data,j=this._cachedMeta.data;for(const[Dt,Gt,re]of this._syncList)this[Dt](Gt,re);this._syncList=[];const J=j.length,mt=z.length,kt=Math.min(mt,J);kt&&this.parse(0,kt),mt>J?this._insertElements(J,mt-J,l):mt<J&&this._removeElements(mt,J-mt)}_insertElements(l,z,j=!0){const J=this._cachedMeta,mt=J.data,kt=l+z;let Dt;const Gt=re=>{for(re.length+=z,Dt=re.length-1;Dt>=kt;Dt--)re[Dt]=re[Dt-z]};for(Gt(mt),Dt=l;Dt<kt;++Dt)mt[Dt]=new this.dataElementType;this._parsing&&Gt(J._parsed),this.parse(l,z),j&&this.updateElements(mt,l,z,"reset")}updateElements(l,z,j,J){}_removeElements(l,z){const j=this._cachedMeta;if(this._parsing){const J=j._parsed.splice(l,z);j._stacked&&e2(j,J)}j.data.splice(l,z)}_sync(l){if(this._parsing)this._syncList.push(l);else{const[z,j,J]=l;this[z](j,J)}this.chart._dataChanges.push([this.index,...l])}_onDataPush(){const l=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-l,l])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(l,z){z&&this._sync(["_removeElements",l,z]);const j=arguments.length-2;j&&this._sync(["_insertElements",l,j])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function dlt(d,l){if(!d._cache.$bar){const z=d.getMatchingVisibleMetas(l);let j=[];for(let J=0,mt=z.length;J<mt;J++)j=j.concat(z[J].controller.getAllParsedValues(d));d._cache.$bar=NO(j.sort((J,mt)=>J-mt))}return d._cache.$bar}function plt(d){const l=d.iScale,z=dlt(l,d.type);let j=l._length,J,mt,kt,Dt;const Gt=()=>{kt===32767||kt===-32768||(U2(Dt)&&(j=Math.min(j,Math.abs(kt-Dt)||j)),Dt=kt)};for(J=0,mt=z.length;J<mt;++J)kt=l.getPixelForValue(z[J]),Gt();for(Dt=void 0,J=0,mt=l.ticks.length;J<mt;++J)kt=l.getPixelForTick(J),Gt();return j}function mlt(d,l,z,j){const J=z.barThickness;let mt,kt;return Rh(J)?(mt=l.min*z.categoryPercentage,kt=z.barPercentage):(mt=J*j,kt=1),{chunk:mt/j,ratio:kt,start:l.pixels[d]-mt/2}}function glt(d,l,z,j){const J=l.pixels,mt=J[d];let kt=d>0?J[d-1]:null,Dt=d<J.length-1?J[d+1]:null;const Gt=z.categoryPercentage;kt===null&&(kt=mt-(Dt===null?l.end-l.start:Dt-mt)),Dt===null&&(Dt=mt+mt-kt);const re=mt-(mt-Math.min(kt,Dt))/2*Gt;return{chunk:Math.abs(Dt-kt)/2*Gt/j,ratio:z.barPercentage,start:re}}function vlt(d,l,z,j){const J=z.parse(d[0],j),mt=z.parse(d[1],j),kt=Math.min(J,mt),Dt=Math.max(J,mt);let Gt=kt,re=Dt;Math.abs(kt)>Math.abs(Dt)&&(Gt=Dt,re=kt),l[z.axis]=re,l._custom={barStart:Gt,barEnd:re,start:J,end:mt,min:kt,max:Dt}}function iD(d,l,z,j){return Xd(d)?vlt(d,l,z,j):l[z.axis]=z.parse(d,j),l}function gP(d,l,z,j){const J=d.iScale,mt=d.vScale,kt=J.getLabels(),Dt=J===mt,Gt=[];let re,pe,Ne,or;for(re=z,pe=z+j;re<pe;++re)or=l[re],Ne={},Ne[J.axis]=Dt||J.parse(kt[re],re),Gt.push(iD(or,Ne,mt,re));return Gt}function F8(d){return d&&d.barStart!==void 0&&d.barEnd!==void 0}function ylt(d,l,z){return d!==0?cg(d):(l.isHorizontal()?1:-1)*(l.min>=z?1:-1)}function xlt(d){let l,z,j,J,mt;return d.horizontal?(l=d.base>d.x,z="left",j="right"):(l=d.base<d.y,z="bottom",j="top"),l?(J="end",mt="start"):(J="start",mt="end"),{start:z,end:j,reverse:l,top:J,bottom:mt}}function _lt(d,l,z,j){let J=l.borderSkipped;const mt={};if(!J){d.borderSkipped=mt;return}if(J===!0){d.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:kt,end:Dt,reverse:Gt,top:re,bottom:pe}=xlt(d);J==="middle"&&z&&(d.enableBorderRadius=!0,(z._top||0)===j?J=re:(z._bottom||0)===j?J=pe:(mt[vP(pe,kt,Dt,Gt)]=!0,J=re)),mt[vP(J,kt,Dt,Gt)]=!0,d.borderSkipped=mt}function vP(d,l,z,j){return j?(d=blt(d,l,z),d=yP(d,z,l)):d=yP(d,l,z),d}function blt(d,l,z){return d===l?z:d===z?l:d}function yP(d,l,z){return d==="start"?l:d==="end"?z:d}function wlt(d,{inflateAmount:l},z){d.inflateAmount=l==="auto"?z===1?.33:0:l}class klt extends W4{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(l,z,j,J){return gP(l,z,j,J)}parseArrayData(l,z,j,J){return gP(l,z,j,J)}parseObjectData(l,z,j,J){const{iScale:mt,vScale:kt}=l,{xAxisKey:Dt="x",yAxisKey:Gt="y"}=this._parsing,re=mt.axis==="x"?Dt:Gt,pe=kt.axis==="x"?Dt:Gt,Ne=[];let or,_r,Fr,zr;for(or=j,_r=j+J;or<_r;++or)zr=z[or],Fr={},Fr[mt.axis]=mt.parse(My(zr,re),or),Ne.push(iD(My(zr,pe),Fr,kt,or));return Ne}updateRangeFromParsed(l,z,j,J){super.updateRangeFromParsed(l,z,j,J);const mt=j._custom;mt&&z===this._cachedMeta.vScale&&(l.min=Math.min(l.min,mt.min),l.max=Math.max(l.max,mt.max))}getMaxOverflow(){return 0}getLabelAndValue(l){const z=this._cachedMeta,{iScale:j,vScale:J}=z,mt=this.getParsed(l),kt=mt._custom,Dt=F8(kt)?"["+kt.start+", "+kt.end+"]":""+J.getLabelForValue(mt[J.axis]);return{label:""+j.getLabelForValue(mt[j.axis]),value:Dt}}initialize(){this.enableOptionSharing=!0,super.initialize();const l=this._cachedMeta;l.stack=this.getDataset().stack}update(l){const z=this._cachedMeta;this.updateElements(z.data,0,z.data.length,l)}updateElements(l,z,j,J){const mt=J==="reset",{index:kt,_cachedMeta:{vScale:Dt}}=this,Gt=Dt.getBasePixel(),re=Dt.isHorizontal(),pe=this._getRuler(),{sharedOptions:Ne,includeOptions:or}=this._getSharedOptions(z,J);for(let _r=z;_r<z+j;_r++){const Fr=this.getParsed(_r),zr=mt||Rh(Fr[Dt.axis])?{base:Gt,head:Gt}:this._calculateBarValuePixels(_r),Wr=this._calculateBarIndexPixels(_r,pe),An=(Fr._stacks||{})[Dt.axis],Ft={horizontal:re,base:zr.base,enableBorderRadius:!An||F8(Fr._custom)||kt===An._top||kt===An._bottom,x:re?zr.head:Wr.center,y:re?Wr.center:zr.head,height:re?Wr.size:Math.abs(zr.size),width:re?Math.abs(zr.size):Wr.size};or&&(Ft.options=Ne||this.resolveDataElementOptions(_r,l[_r].active?"active":J));const kn=Ft.options||l[_r].options;_lt(Ft,kn,An,kt),wlt(Ft,kn,pe.ratio),this.updateElement(l[_r],_r,Ft,J)}}_getStacks(l,z){const{iScale:j}=this._cachedMeta,J=j.getMatchingVisibleMetas(this._type).filter(pe=>pe.controller.options.grouped),mt=j.options.stacked,kt=[],Dt=this._cachedMeta.controller.getParsed(z),Gt=Dt&&Dt[j.axis],re=pe=>{const Ne=pe._parsed.find(_r=>_r[j.axis]===Gt),or=Ne&&Ne[pe.vScale.axis];if(Rh(or)||isNaN(or))return!0};for(const pe of J)if(!(z!==void 0&&re(pe))&&((mt===!1||kt.indexOf(pe.stack)===-1||mt===void 0&&pe.stack===void 0)&&kt.push(pe.stack),pe.index===l))break;return kt.length||kt.push(void 0),kt}_getStackCount(l){return this._getStacks(void 0,l).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const l=this.chart.scales,z=this.chart.options.indexAxis;return Object.keys(l).filter(j=>l[j].axis===z).shift()}_getAxis(){const l={},z=this.getFirstScaleIdForIndexAxis();for(const j of this.chart.data.datasets)l[cc(this.chart.options.indexAxis==="x"?j.xAxisID:j.yAxisID,z)]=!0;return Object.keys(l)}_getStackIndex(l,z,j){const J=this._getStacks(l,j),mt=z!==void 0?J.indexOf(z):-1;return mt===-1?J.length-1:mt}_getRuler(){const l=this.options,z=this._cachedMeta,j=z.iScale,J=[];let mt,kt;for(mt=0,kt=z.data.length;mt<kt;++mt)J.push(j.getPixelForValue(this.getParsed(mt)[j.axis],mt));const Dt=l.barThickness;return{min:Dt||plt(z),pixels:J,start:j._startPixel,end:j._endPixel,stackCount:this._getStackCount(),scale:j,grouped:l.grouped,ratio:Dt?1:l.categoryPercentage*l.barPercentage}}_calculateBarValuePixels(l){const{_cachedMeta:{vScale:z,_stacked:j,index:J},options:{base:mt,minBarLength:kt}}=this,Dt=mt||0,Gt=this.getParsed(l),re=Gt._custom,pe=F8(re);let Ne=Gt[z.axis],or=0,_r=j?this.applyStack(z,Gt,j):Ne,Fr,zr;_r!==Ne&&(or=_r-Ne,_r=Ne),pe&&(Ne=re.barStart,_r=re.barEnd-re.barStart,Ne!==0&&cg(Ne)!==cg(re.barEnd)&&(or=0),or+=Ne);const Wr=!Rh(mt)&&!pe?mt:or;let An=z.getPixelForValue(Wr);if(this.chart.getDataVisibility(l)?Fr=z.getPixelForValue(or+_r):Fr=An,zr=Fr-An,Math.abs(zr)<kt){zr=ylt(zr,z,Dt)*kt,Ne===Dt&&(An-=zr/2);const Ft=z.getPixelForDecimal(0),kn=z.getPixelForDecimal(1),ei=Math.min(Ft,kn),jn=Math.max(Ft,kn);An=Math.max(Math.min(An,jn),ei),Fr=An+zr,j&&!pe&&(Gt._stacks[z.axis]._visualValues[J]=z.getValueForPixel(Fr)-z.getValueForPixel(An))}if(An===z.getPixelForValue(Dt)){const Ft=cg(zr)*z.getLineWidthForValue(Dt)/2;An+=Ft,zr-=Ft}return{size:zr,base:An,head:Fr,center:Fr+zr/2}}_calculateBarIndexPixels(l,z){const j=z.scale,J=this.options,mt=J.skipNull,kt=cc(J.maxBarThickness,1/0);let Dt,Gt;const re=this._getAxisCount();if(z.grouped){const pe=mt?this._getStackCount(l):z.stackCount,Ne=J.barThickness==="flex"?glt(l,z,J,pe*re):mlt(l,z,J,pe*re),or=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_r=this._getAxis().indexOf(cc(or,this.getFirstScaleIdForIndexAxis())),Fr=this._getStackIndex(this.index,this._cachedMeta.stack,mt?l:void 0)+_r;Dt=Ne.start+Ne.chunk*Fr+Ne.chunk/2,Gt=Math.min(kt,Ne.chunk*Ne.ratio)}else Dt=j.getPixelForValue(this.getParsed(l)[j.axis],l),Gt=Math.min(kt,z.min*z.ratio);return{base:Dt-Gt/2,head:Dt+Gt/2,center:Dt,size:Gt}}draw(){const l=this._cachedMeta,z=l.vScale,j=l.data,J=j.length;let mt=0;for(;mt<J;++mt)this.getParsed(mt)[z.axis]!==null&&!j[mt].hidden&&j[mt].draw(this._ctx)}}function Tlt(d,l,z){let j=1,J=1,mt=0,kt=0;if(l<od){const Dt=d,Gt=Dt+l,re=Math.cos(Dt),pe=Math.sin(Dt),Ne=Math.cos(Gt),or=Math.sin(Gt),_r=(kn,ei,jn)=>H2(kn,Dt,Gt,!0)?1:Math.max(ei,ei*z,jn,jn*z),Fr=(kn,ei,jn)=>H2(kn,Dt,Gt,!0)?-1:Math.min(ei,ei*z,jn,jn*z),zr=_r(0,re,Ne),Wr=_r(ap,pe,or),An=Fr(Jh,re,Ne),Ft=Fr(Jh+ap,pe,or);j=(zr-An)/2,J=(Wr-Ft)/2,mt=-(zr+An)/2,kt=-(Wr+Ft)/2}return{ratioX:j,ratioY:J,offsetX:mt,offsetY:kt}}class Alt extends W4{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:l=>l!=="spacing",_indexable:l=>l!=="spacing"&&!l.startsWith("borderDash")&&!l.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(l){const z=l.data,{labels:{pointStyle:j,textAlign:J,color:mt,useBorderRadius:kt,borderRadius:Dt}}=l.legend.options;return z.labels.length&&z.datasets.length?z.labels.map((Gt,re)=>{const Ne=l.getDatasetMeta(0).controller.getStyle(re);return{text:Gt,fillStyle:Ne.backgroundColor,fontColor:mt,hidden:!l.getDataVisibility(re),lineDash:Ne.borderDash,lineDashOffset:Ne.borderDashOffset,lineJoin:Ne.borderJoinStyle,lineWidth:Ne.borderWidth,strokeStyle:Ne.borderColor,textAlign:J,pointStyle:j,borderRadius:kt&&(Dt||Ne.borderRadius),index:re}}):[]}},onClick(l,z,j){j.chart.toggleDataVisibility(z.index),j.chart.update()}}}};constructor(l,z){super(l,z),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(l,z){const j=this.getDataset().data,J=this._cachedMeta;if(this._parsing===!1)J._parsed=j;else{let mt=Gt=>+j[Gt];if(Ec(j[l])){const{key:Gt="value"}=this._parsing;mt=re=>+My(j[re],Gt)}let kt,Dt;for(kt=l,Dt=l+z;kt<Dt;++kt)J._parsed[kt]=mt(kt)}}_getRotation(){return tv(this.options.rotation-90)}_getCircumference(){return tv(this.options.circumference)}_getRotationExtents(){let l=od,z=-od;for(let j=0;j<this.chart.data.datasets.length;++j)if(this.chart.isDatasetVisible(j)&&this.chart.getDatasetMeta(j).type===this._type){const J=this.chart.getDatasetMeta(j).controller,mt=J._getRotation(),kt=J._getCircumference();l=Math.min(l,mt),z=Math.max(z,mt+kt)}return{rotation:l,circumference:z-l}}update(l){const z=this.chart,{chartArea:j}=z,J=this._cachedMeta,mt=J.data,kt=this.getMaxBorderWidth()+this.getMaxOffset(mt)+this.options.spacing,Dt=Math.max((Math.min(j.width,j.height)-kt)/2,0),Gt=Math.min(Pot(this.options.cutout,Dt),1),re=this._getRingWeight(this.index),{circumference:pe,rotation:Ne}=this._getRotationExtents(),{ratioX:or,ratioY:_r,offsetX:Fr,offsetY:zr}=Tlt(Ne,pe,Gt),Wr=(j.width-kt)/or,An=(j.height-kt)/_r,Ft=Math.max(Math.min(Wr,An)/2,0),kn=OO(this.options.radius,Ft),ei=Math.max(kn*Gt,0),jn=(kn-ei)/this._getVisibleDatasetWeightTotal();this.offsetX=Fr*kn,this.offsetY=zr*kn,J.total=this.calculateTotal(),this.outerRadius=kn-jn*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-jn*re,0),this.updateElements(mt,0,mt.length,l)}_circumference(l,z){const j=this.options,J=this._cachedMeta,mt=this._getCircumference();return z&&j.animation.animateRotate||!this.chart.getDataVisibility(l)||J._parsed[l]===null||J.data[l].hidden?0:this.calculateCircumference(J._parsed[l]*mt/od)}updateElements(l,z,j,J){const mt=J==="reset",kt=this.chart,Dt=kt.chartArea,re=kt.options.animation,pe=(Dt.left+Dt.right)/2,Ne=(Dt.top+Dt.bottom)/2,or=mt&&re.animateScale,_r=or?0:this.innerRadius,Fr=or?0:this.outerRadius,{sharedOptions:zr,includeOptions:Wr}=this._getSharedOptions(z,J);let An=this._getRotation(),Ft;for(Ft=0;Ft<z;++Ft)An+=this._circumference(Ft,mt);for(Ft=z;Ft<z+j;++Ft){const kn=this._circumference(Ft,mt),ei=l[Ft],jn={x:pe+this.offsetX,y:Ne+this.offsetY,startAngle:An,endAngle:An+kn,circumference:kn,outerRadius:Fr,innerRadius:_r};Wr&&(jn.options=zr||this.resolveDataElementOptions(Ft,ei.active?"active":J)),An+=kn,this.updateElement(ei,Ft,jn,J)}}calculateTotal(){const l=this._cachedMeta,z=l.data;let j=0,J;for(J=0;J<z.length;J++){const mt=l._parsed[J];mt!==null&&!isNaN(mt)&&this.chart.getDataVisibility(J)&&!z[J].hidden&&(j+=Math.abs(mt))}return j}calculateCircumference(l){const z=this._cachedMeta.total;return z>0&&!isNaN(l)?od*(Math.abs(l)/z):0}getLabelAndValue(l){const z=this._cachedMeta,j=this.chart,J=j.data.labels||[],mt=lM(z._parsed[l],j.options.locale);return{label:J[l]||"",value:mt}}getMaxBorderWidth(l){let z=0;const j=this.chart;let J,mt,kt,Dt,Gt;if(!l){for(J=0,mt=j.data.datasets.length;J<mt;++J)if(j.isDatasetVisible(J)){kt=j.getDatasetMeta(J),l=kt.data,Dt=kt.controller;break}}if(!l)return 0;for(J=0,mt=l.length;J<mt;++J)Gt=Dt.resolveDataElementOptions(J),Gt.borderAlign!=="inner"&&(z=Math.max(z,Gt.borderWidth||0,Gt.hoverBorderWidth||0));return z}getMaxOffset(l){let z=0;for(let j=0,J=l.length;j<J;++j){const mt=this.resolveDataElementOptions(j);z=Math.max(z,mt.offset||0,mt.hoverOffset||0)}return z}_getRingWeightOffset(l){let z=0;for(let j=0;j<l;++j)this.chart.isDatasetVisible(j)&&(z+=this._getRingWeight(j));return z}_getRingWeight(l){return Math.max(cc(this.chart.data.datasets[l].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Mlt extends W4{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(l){const z=this._cachedMeta,{dataset:j,data:J=[],_dataset:mt}=z,kt=this.chart._animationsDisabled;let{start:Dt,count:Gt}=Xot(z,J,kt);this._drawStart=Dt,this._drawCount=Gt,Jot(z)&&(Dt=0,Gt=J.length),j._chart=this.chart,j._datasetIndex=this.index,j._decimated=!!mt._decimated,j.points=J;const re=this.resolveDatasetElementOptions(l);this.options.showLine||(re.borderWidth=0),re.segment=this.options.segment,this.updateElement(j,void 0,{animated:!kt,options:re},l),this.updateElements(J,Dt,Gt,l)}updateElements(l,z,j,J){const mt=J==="reset",{iScale:kt,vScale:Dt,_stacked:Gt,_dataset:re}=this._cachedMeta,{sharedOptions:pe,includeOptions:Ne}=this._getSharedOptions(z,J),or=kt.axis,_r=Dt.axis,{spanGaps:Fr,segment:zr}=this.options,Wr=V2(Fr)?Fr:Number.POSITIVE_INFINITY,An=this.chart._animationsDisabled||mt||J==="none",Ft=z+j,kn=l.length;let ei=z>0&&this.getParsed(z-1);for(let jn=0;jn<kn;++jn){const ai=l[jn],Qi=An?ai:{};if(jn<z||jn>=Ft){Qi.skip=!0;continue}const Gi=this.getParsed(jn),un=Rh(Gi[_r]),ia=Qi[or]=kt.getPixelForValue(Gi[or],jn),fa=Qi[_r]=mt||un?Dt.getBasePixel():Dt.getPixelForValue(Gt?this.applyStack(Dt,Gi,Gt):Gi[_r],jn);Qi.skip=isNaN(ia)||isNaN(fa)||un,Qi.stop=jn>0&&Math.abs(Gi[or]-ei[or])>Wr,zr&&(Qi.parsed=Gi,Qi.raw=re.data[jn]),Ne&&(Qi.options=pe||this.resolveDataElementOptions(jn,ai.active?"active":J)),An||this.updateElement(ai,jn,Qi,J),ei=Gi}}getMaxOverflow(){const l=this._cachedMeta,z=l.dataset,j=z.options&&z.options.borderWidth||0,J=l.data||[];if(!J.length)return j;const mt=J[0].size(this.resolveDataElementOptions(0)),kt=J[J.length-1].size(this.resolveDataElementOptions(J.length-1));return Math.max(j,mt,kt)/2}draw(){const l=this._cachedMeta;l.dataset.updateControlPoints(this.chart.chartArea,l.iScale.axis),super.draw()}}function uy(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class mM{static override(l){Object.assign(mM.prototype,l)}options;constructor(l){this.options=l||{}}init(){}formats(){return uy()}parse(){return uy()}format(){return uy()}add(){return uy()}diff(){return uy()}startOf(){return uy()}endOf(){return uy()}}var aD={_date:mM};function Slt(d,l,z,j){const{controller:J,data:mt,_sorted:kt}=d,Dt=J._cachedMeta.iScale,Gt=d.dataset&&d.dataset.options?d.dataset.options.spanGaps:null;if(Dt&&l===Dt.axis&&l!=="r"&&kt&&mt.length){const re=Dt._reversePixels?Zot:yy;if(j){if(J._sharedOptions){const pe=mt[0],Ne=typeof pe.getRange=="function"&&pe.getRange(l);if(Ne){const or=re(mt,l,z-Ne),_r=re(mt,l,z+Ne);return{lo:or.lo,hi:_r.hi}}}}else{const pe=re(mt,l,z);if(Gt){const{vScale:Ne}=J._cachedMeta,{_parsed:or}=d,_r=or.slice(0,pe.lo+1).reverse().findIndex(zr=>!Rh(zr[Ne.axis]));pe.lo-=Math.max(0,_r);const Fr=or.slice(pe.hi).findIndex(zr=>!Rh(zr[Ne.axis]));pe.hi+=Math.max(0,Fr)}return pe}}return{lo:0,hi:mt.length-1}}function q4(d,l,z,j,J){const mt=d.getSortedVisibleDatasetMetas(),kt=z[l];for(let Dt=0,Gt=mt.length;Dt<Gt;++Dt){const{index:re,data:pe}=mt[Dt],{lo:Ne,hi:or}=Slt(mt[Dt],l,kt,J);for(let _r=Ne;_r<=or;++_r){const Fr=pe[_r];Fr.skip||j(Fr,re,_r)}}}function Elt(d){const l=d.indexOf("x")!==-1,z=d.indexOf("y")!==-1;return function(j,J){const mt=l?Math.abs(j.x-J.x):0,kt=z?Math.abs(j.y-J.y):0;return Math.sqrt(Math.pow(mt,2)+Math.pow(kt,2))}}function R8(d,l,z,j,J){const mt=[];return!J&&!d.isPointInArea(l)||q4(d,z,l,function(Dt,Gt,re){!J&&!W2(Dt,d.chartArea,0)||Dt.inRange(l.x,l.y,j)&&mt.push({element:Dt,datasetIndex:Gt,index:re})},!0),mt}function Clt(d,l,z,j){let J=[];function mt(kt,Dt,Gt){const{startAngle:re,endAngle:pe}=kt.getProps(["startAngle","endAngle"],j),{angle:Ne}=RO(kt,{x:l.x,y:l.y});H2(Ne,re,pe)&&J.push({element:kt,datasetIndex:Dt,index:Gt})}return q4(d,z,l,mt),J}function Llt(d,l,z,j,J,mt){let kt=[];const Dt=Elt(z);let Gt=Number.POSITIVE_INFINITY;function re(pe,Ne,or){const _r=pe.inRange(l.x,l.y,J);if(j&&!_r)return;const Fr=pe.getCenterPoint(J);if(!(!!mt||d.isPointInArea(Fr))&&!_r)return;const Wr=Dt(l,Fr);Wr<Gt?(kt=[{element:pe,datasetIndex:Ne,index:or}],Gt=Wr):Wr===Gt&&kt.push({element:pe,datasetIndex:Ne,index:or})}return q4(d,z,l,re),kt}function B8(d,l,z,j,J,mt){return!mt&&!d.isPointInArea(l)?[]:z==="r"&&!j?Clt(d,l,z,J):Llt(d,l,z,j,J,mt)}function xP(d,l,z,j,J){const mt=[],kt=z==="x"?"inXRange":"inYRange";let Dt=!1;return q4(d,z,l,(Gt,re,pe)=>{Gt[kt]&&Gt[kt](l[z],J)&&(mt.push({element:Gt,datasetIndex:re,index:pe}),Dt=Dt||Gt.inRange(l.x,l.y,J))}),j&&!Dt?[]:mt}var Plt={modes:{index(d,l,z,j){const J=hy(l,d),mt=z.axis||"x",kt=z.includeInvisible||!1,Dt=z.intersect?R8(d,J,mt,j,kt):B8(d,J,mt,!1,j,kt),Gt=[];return Dt.length?(d.getSortedVisibleDatasetMetas().forEach(re=>{const pe=Dt[0].index,Ne=re.data[pe];Ne&&!Ne.skip&&Gt.push({element:Ne,datasetIndex:re.index,index:pe})}),Gt):[]},dataset(d,l,z,j){const J=hy(l,d),mt=z.axis||"xy",kt=z.includeInvisible||!1;let Dt=z.intersect?R8(d,J,mt,j,kt):B8(d,J,mt,!1,j,kt);if(Dt.length>0){const Gt=Dt[0].datasetIndex,re=d.getDatasetMeta(Gt).data;Dt=[];for(let pe=0;pe<re.length;++pe)Dt.push({element:re[pe],datasetIndex:Gt,index:pe})}return Dt},point(d,l,z,j){const J=hy(l,d),mt=z.axis||"xy",kt=z.includeInvisible||!1;return R8(d,J,mt,j,kt)},nearest(d,l,z,j){const J=hy(l,d),mt=z.axis||"xy",kt=z.includeInvisible||!1;return B8(d,J,mt,z.intersect,j,kt)},x(d,l,z,j){const J=hy(l,d);return xP(d,J,"x",z.intersect,j)},y(d,l,z,j){const J=hy(l,d);return xP(d,J,"y",z.intersect,j)}}};const oD=["left","top","right","bottom"];function r2(d,l){return d.filter(z=>z.pos===l)}function _P(d,l){return d.filter(z=>oD.indexOf(z.pos)===-1&&z.box.axis===l)}function n2(d,l){return d.sort((z,j)=>{const J=l?j:z,mt=l?z:j;return J.weight===mt.weight?J.index-mt.index:J.weight-mt.weight})}function zlt(d){const l=[];let z,j,J,mt,kt,Dt;for(z=0,j=(d||[]).length;z<j;++z)J=d[z],{position:mt,options:{stack:kt,stackWeight:Dt=1}}=J,l.push({index:z,box:J,pos:mt,horizontal:J.isHorizontal(),weight:J.weight,stack:kt&&mt+kt,stackWeight:Dt});return l}function Ilt(d){const l={};for(const z of d){const{stack:j,pos:J,stackWeight:mt}=z;if(!j||!oD.includes(J))continue;const kt=l[j]||(l[j]={count:0,placed:0,weight:0,size:0});kt.count++,kt.weight+=mt}return l}function Olt(d,l){const z=Ilt(d),{vBoxMaxWidth:j,hBoxMaxHeight:J}=l;let mt,kt,Dt;for(mt=0,kt=d.length;mt<kt;++mt){Dt=d[mt];const{fullSize:Gt}=Dt.box,re=z[Dt.stack],pe=re&&Dt.stackWeight/re.weight;Dt.horizontal?(Dt.width=pe?pe*j:Gt&&l.availableWidth,Dt.height=J):(Dt.width=j,Dt.height=pe?pe*J:Gt&&l.availableHeight)}return z}function Dlt(d){const l=zlt(d),z=n2(l.filter(re=>re.box.fullSize),!0),j=n2(r2(l,"left"),!0),J=n2(r2(l,"right")),mt=n2(r2(l,"top"),!0),kt=n2(r2(l,"bottom")),Dt=_P(l,"x"),Gt=_P(l,"y");return{fullSize:z,leftAndTop:j.concat(mt),rightAndBottom:J.concat(Gt).concat(kt).concat(Dt),chartArea:r2(l,"chartArea"),vertical:j.concat(J).concat(Gt),horizontal:mt.concat(kt).concat(Dt)}}function bP(d,l,z,j){return Math.max(d[z],l[z])+Math.max(d[j],l[j])}function sD(d,l){d.top=Math.max(d.top,l.top),d.left=Math.max(d.left,l.left),d.bottom=Math.max(d.bottom,l.bottom),d.right=Math.max(d.right,l.right)}function Flt(d,l,z,j){const{pos:J,box:mt}=z,kt=d.maxPadding;if(!Ec(J)){z.size&&(d[J]-=z.size);const Ne=j[z.stack]||{size:0,count:1};Ne.size=Math.max(Ne.size,z.horizontal?mt.height:mt.width),z.size=Ne.size/Ne.count,d[J]+=z.size}mt.getPadding&&sD(kt,mt.getPadding());const Dt=Math.max(0,l.outerWidth-bP(kt,d,"left","right")),Gt=Math.max(0,l.outerHeight-bP(kt,d,"top","bottom")),re=Dt!==d.w,pe=Gt!==d.h;return d.w=Dt,d.h=Gt,z.horizontal?{same:re,other:pe}:{same:pe,other:re}}function Rlt(d){const l=d.maxPadding;function z(j){const J=Math.max(l[j]-d[j],0);return d[j]+=J,J}d.y+=z("top"),d.x+=z("left"),z("right"),z("bottom")}function Blt(d,l){const z=l.maxPadding;function j(J){const mt={left:0,top:0,right:0,bottom:0};return J.forEach(kt=>{mt[kt]=Math.max(l[kt],z[kt])}),mt}return j(d?["left","right"]:["top","bottom"])}function f2(d,l,z,j){const J=[];let mt,kt,Dt,Gt,re,pe;for(mt=0,kt=d.length,re=0;mt<kt;++mt){Dt=d[mt],Gt=Dt.box,Gt.update(Dt.width||l.w,Dt.height||l.h,Blt(Dt.horizontal,l));const{same:Ne,other:or}=Flt(l,z,Dt,j);re|=Ne&&J.length,pe=pe||or,Gt.fullSize||J.push(Dt)}return re&&f2(J,l,z,j)||pe}function O5(d,l,z,j,J){d.top=z,d.left=l,d.right=l+j,d.bottom=z+J,d.width=j,d.height=J}function wP(d,l,z,j){const J=z.padding;let{x:mt,y:kt}=l;for(const Dt of d){const Gt=Dt.box,re=j[Dt.stack]||{placed:0,weight:1},pe=Dt.stackWeight/re.weight||1;if(Dt.horizontal){const Ne=l.w*pe,or=re.size||Gt.height;U2(re.start)&&(kt=re.start),Gt.fullSize?O5(Gt,J.left,kt,z.outerWidth-J.right-J.left,or):O5(Gt,l.left+re.placed,kt,Ne,or),re.start=kt,re.placed+=Ne,kt=Gt.bottom}else{const Ne=l.h*pe,or=re.size||Gt.width;U2(re.start)&&(mt=re.start),Gt.fullSize?O5(Gt,mt,J.top,or,z.outerHeight-J.bottom-J.top):O5(Gt,mt,l.top+re.placed,or,Ne),re.start=mt,re.placed+=Ne,mt=Gt.right}}l.x=mt,l.y=kt}var om={addBox(d,l){d.boxes||(d.boxes=[]),l.fullSize=l.fullSize||!1,l.position=l.position||"top",l.weight=l.weight||0,l._layers=l._layers||function(){return[{z:0,draw(z){l.draw(z)}}]},d.boxes.push(l)},removeBox(d,l){const z=d.boxes?d.boxes.indexOf(l):-1;z!==-1&&d.boxes.splice(z,1)},configure(d,l,z){l.fullSize=z.fullSize,l.position=z.position,l.weight=z.weight},update(d,l,z,j){if(!d)return;const J=fm(d.options.layout.padding),mt=Math.max(l-J.width,0),kt=Math.max(z-J.height,0),Dt=Dlt(d.boxes),Gt=Dt.vertical,re=Dt.horizontal;Kh(d.boxes,zr=>{typeof zr.beforeLayout=="function"&&zr.beforeLayout()});const pe=Gt.reduce((zr,Wr)=>Wr.box.options&&Wr.box.options.display===!1?zr:zr+1,0)||1,Ne=Object.freeze({outerWidth:l,outerHeight:z,padding:J,availableWidth:mt,availableHeight:kt,vBoxMaxWidth:mt/2/pe,hBoxMaxHeight:kt/2}),or=Object.assign({},J);sD(or,fm(j));const _r=Object.assign({maxPadding:or,w:mt,h:kt,x:J.left,y:J.top},J),Fr=Olt(Gt.concat(re),Ne);f2(Dt.fullSize,_r,Ne,Fr),f2(Gt,_r,Ne,Fr),f2(re,_r,Ne,Fr)&&f2(Gt,_r,Ne,Fr),Rlt(_r),wP(Dt.leftAndTop,_r,Ne,Fr),_r.x+=_r.w,_r.y+=_r.h,wP(Dt.rightAndBottom,_r,Ne,Fr),d.chartArea={left:_r.left,top:_r.top,right:_r.left+_r.w,bottom:_r.top+_r.h,height:_r.h,width:_r.w},Kh(Dt.chartArea,zr=>{const Wr=zr.box;Object.assign(Wr,d.chartArea),Wr.update(_r.w,_r.h,{left:0,top:0,right:0,bottom:0})})}};class lD{acquireContext(l,z){}releaseContext(l){return!1}addEventListener(l,z,j){}removeEventListener(l,z,j){}getDevicePixelRatio(){return 1}getMaximumSize(l,z,j,J){return z=Math.max(0,z||l.width),j=j||l.height,{width:z,height:Math.max(0,J?Math.floor(z/J):j)}}isAttached(l){return!0}updateConfig(l){}}class Nlt extends lD{acquireContext(l){return l&&l.getContext&&l.getContext("2d")||null}updateConfig(l){l.options.animation=!1}}const K5="$chartjs",jlt={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},kP=d=>d===null||d==="";function Ult(d,l){const z=d.style,j=d.getAttribute("height"),J=d.getAttribute("width");if(d[K5]={initial:{height:j,width:J,style:{display:z.display,height:z.height,width:z.width}}},z.display=z.display||"block",z.boxSizing=z.boxSizing||"border-box",kP(J)){const mt=oP(d,"width");mt!==void 0&&(d.width=mt)}if(kP(j))if(d.style.height==="")d.height=d.width/(l||2);else{const mt=oP(d,"height");mt!==void 0&&(d.height=mt)}return d}const uD=Ust?{passive:!0}:!1;function Vlt(d,l,z){d&&d.addEventListener(l,z,uD)}function Hlt(d,l,z){d&&d.canvas&&d.canvas.removeEventListener(l,z,uD)}function Wlt(d,l){const z=jlt[d.type]||d.type,{x:j,y:J}=hy(d,l);return{type:z,chart:l,native:d,x:j!==void 0?j:null,y:J!==void 0?J:null}}function g4(d,l){for(const z of d)if(z===l||z.contains(l))return!0}function qlt(d,l,z){const j=d.canvas,J=new MutationObserver(mt=>{let kt=!1;for(const Dt of mt)kt=kt||g4(Dt.addedNodes,j),kt=kt&&!g4(Dt.removedNodes,j);kt&&z()});return J.observe(document,{childList:!0,subtree:!0}),J}function Zlt(d,l,z){const j=d.canvas,J=new MutationObserver(mt=>{let kt=!1;for(const Dt of mt)kt=kt||g4(Dt.removedNodes,j),kt=kt&&!g4(Dt.addedNodes,j);kt&&z()});return J.observe(document,{childList:!0,subtree:!0}),J}const Z2=new Map;let TP=0;function cD(){const d=window.devicePixelRatio;d!==TP&&(TP=d,Z2.forEach((l,z)=>{z.currentDevicePixelRatio!==d&&l()}))}function $lt(d,l){Z2.size||window.addEventListener("resize",cD),Z2.set(d,l)}function Glt(d){Z2.delete(d),Z2.size||window.removeEventListener("resize",cD)}function Ylt(d,l,z){const j=d.canvas,J=j&&pM(j);if(!J)return;const mt=UO((Dt,Gt)=>{const re=J.clientWidth;z(Dt,Gt),re<J.clientWidth&&z()},window),kt=new ResizeObserver(Dt=>{const Gt=Dt[0],re=Gt.contentRect.width,pe=Gt.contentRect.height;re===0&&pe===0||mt(re,pe)});return kt.observe(J),$lt(d,mt),kt}function N8(d,l,z){z&&z.disconnect(),l==="resize"&&Glt(d)}function Klt(d,l,z){const j=d.canvas,J=UO(mt=>{d.ctx!==null&&z(Wlt(mt,d))},d);return Vlt(j,l,J),J}class Xlt extends lD{acquireContext(l,z){const j=l&&l.getContext&&l.getContext("2d");return j&&j.canvas===l?(Ult(l,z),j):null}releaseContext(l){const z=l.canvas;if(!z[K5])return!1;const j=z[K5].initial;["height","width"].forEach(mt=>{const kt=j[mt];Rh(kt)?z.removeAttribute(mt):z.setAttribute(mt,kt)});const J=j.style||{};return Object.keys(J).forEach(mt=>{z.style[mt]=J[mt]}),z.width=z.width,delete z[K5],!0}addEventListener(l,z,j){this.removeEventListener(l,z);const J=l.$proxies||(l.$proxies={}),kt={attach:qlt,detach:Zlt,resize:Ylt}[z]||Klt;J[z]=kt(l,z,j)}removeEventListener(l,z){const j=l.$proxies||(l.$proxies={}),J=j[z];if(!J)return;({attach:N8,detach:N8,resize:N8}[z]||Hlt)(l,z,J),j[z]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(l,z,j,J){return jst(l,z,j,J)}isAttached(l){const z=l&&pM(l);return!!(z&&z.isConnected)}}function Jlt(d){return!dM()||typeof OffscreenCanvas<"u"&&d instanceof OffscreenCanvas?Nlt:Xlt}let lv=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(l){const{x:z,y:j}=this.getProps(["x","y"],l);return{x:z,y:j}}hasValue(){return V2(this.x)&&V2(this.y)}getProps(l,z){const j=this.$animations;if(!z||!j)return this;const J={};return l.forEach(mt=>{J[mt]=j[mt]&&j[mt].active()?j[mt]._to:this[mt]}),J}};function Qlt(d,l){const z=d.options.ticks,j=tut(d),J=Math.min(z.maxTicksLimit||j,j),mt=z.major.enabled?rut(l):[],kt=mt.length,Dt=mt[0],Gt=mt[kt-1],re=[];if(kt>J)return nut(l,re,mt,kt/J),re;const pe=eut(mt,l,J);if(kt>0){let Ne,or;const _r=kt>1?Math.round((Gt-Dt)/(kt-1)):null;for(D5(l,re,pe,Rh(_r)?0:Dt-_r,Dt),Ne=0,or=kt-1;Ne<or;Ne++)D5(l,re,pe,mt[Ne],mt[Ne+1]);return D5(l,re,pe,Gt,Rh(_r)?l.length:Gt+_r),re}return D5(l,re,pe),re}function tut(d){const l=d.options.offset,z=d._tickSize(),j=d._length/z+(l?0:1),J=d._maxLength/z;return Math.floor(Math.min(j,J))}function eut(d,l,z){const j=iut(d),J=l.length/z;if(!j)return Math.max(J,1);const mt=Not(j);for(let kt=0,Dt=mt.length-1;kt<Dt;kt++){const Gt=mt[kt];if(Gt>J)return Gt}return Math.max(J,1)}function rut(d){const l=[];let z,j;for(z=0,j=d.length;z<j;z++)d[z].major&&l.push(z);return l}function nut(d,l,z,j){let J=0,mt=z[0],kt;for(j=Math.ceil(j),kt=0;kt<d.length;kt++)kt===mt&&(l.push(d[kt]),J++,mt=z[J*j])}function D5(d,l,z,j,J){const mt=cc(j,0),kt=Math.min(cc(J,d.length),d.length);let Dt=0,Gt,re,pe;for(z=Math.ceil(z),J&&(Gt=J-j,z=Gt/Math.floor(Gt/z)),pe=mt;pe<0;)Dt++,pe=Math.round(mt+Dt*z);for(re=Math.max(mt,0);re<kt;re++)re===pe&&(l.push(d[re]),Dt++,pe=Math.round(mt+Dt*z))}function iut(d){const l=d.length;let z,j;if(l<2)return!1;for(j=d[0],z=1;z<l;++z)if(d[z]-d[z-1]!==j)return!1;return j}const aut=d=>d==="left"?"right":d==="right"?"left":d,AP=(d,l,z)=>l==="top"||l==="left"?d[l]+z:d[l]-z,MP=(d,l)=>Math.min(l||d,d);function SP(d,l){const z=[],j=d.length/l,J=d.length;let mt=0;for(;mt<J;mt+=j)z.push(d[Math.floor(mt)]);return z}function out(d,l,z){const j=d.ticks.length,J=Math.min(l,j-1),mt=d._startPixel,kt=d._endPixel,Dt=1e-6;let Gt=d.getPixelForTick(J),re;if(!(z&&(j===1?re=Math.max(Gt-mt,kt-Gt):l===0?re=(d.getPixelForTick(1)-Gt)/2:re=(Gt-d.getPixelForTick(J-1))/2,Gt+=J<l?re:-re,Gt<mt-Dt||Gt>kt+Dt)))return Gt}function sut(d,l){Kh(d,z=>{const j=z.gc,J=j.length/2;let mt;if(J>l){for(mt=0;mt<J;++mt)delete z.data[j[mt]];j.splice(0,J)}})}function i2(d){return d.drawTicks?d.tickLength:0}function EP(d,l){if(!d.display)return 0;const z=Jp(d.font,l),j=fm(d.padding);return(Xd(d.text)?d.text.length:1)*z.lineHeight+j.height}function lut(d,l){return Cy(d,{scale:l,type:"scale"})}function uut(d,l,z){return Cy(d,{tick:z,index:l,type:"tick"})}function cut(d,l,z){let j=oM(d);return(z&&l!=="right"||!z&&l==="right")&&(j=aut(j)),j}function hut(d,l,z,j){const{top:J,left:mt,bottom:kt,right:Dt,chart:Gt}=d,{chartArea:re,scales:pe}=Gt;let Ne=0,or,_r,Fr;const zr=kt-J,Wr=Dt-mt;if(d.isHorizontal()){if(_r=Wp(j,mt,Dt),Ec(z)){const An=Object.keys(z)[0],Ft=z[An];Fr=pe[An].getPixelForValue(Ft)+zr-l}else z==="center"?Fr=(re.bottom+re.top)/2+zr-l:Fr=AP(d,z,l);or=Dt-mt}else{if(Ec(z)){const An=Object.keys(z)[0],Ft=z[An];_r=pe[An].getPixelForValue(Ft)-Wr+l}else z==="center"?_r=(re.left+re.right)/2-Wr+l:_r=AP(d,z,l);Fr=Wp(j,kt,J),Ne=z==="left"?-ap:ap}return{titleX:_r,titleY:Fr,maxWidth:or,rotation:Ne}}class __ extends lv{constructor(l){super(),this.id=l.id,this.type=l.type,this.options=void 0,this.ctx=l.ctx,this.chart=l.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(l){this.options=l.setContext(this.getContext()),this.axis=l.axis,this._userMin=this.parse(l.min),this._userMax=this.parse(l.max),this._suggestedMin=this.parse(l.suggestedMin),this._suggestedMax=this.parse(l.suggestedMax)}parse(l,z){return l}getUserBounds(){let{_userMin:l,_userMax:z,_suggestedMin:j,_suggestedMax:J}=this;return l=eg(l,Number.POSITIVE_INFINITY),z=eg(z,Number.NEGATIVE_INFINITY),j=eg(j,Number.POSITIVE_INFINITY),J=eg(J,Number.NEGATIVE_INFINITY),{min:eg(l,j),max:eg(z,J),minDefined:Qp(l),maxDefined:Qp(z)}}getMinMax(l){let{min:z,max:j,minDefined:J,maxDefined:mt}=this.getUserBounds(),kt;if(J&&mt)return{min:z,max:j};const Dt=this.getMatchingVisibleMetas();for(let Gt=0,re=Dt.length;Gt<re;++Gt)kt=Dt[Gt].controller.getMinMax(this,l),J||(z=Math.min(z,kt.min)),mt||(j=Math.max(j,kt.max));return z=mt&&z>j?j:z,j=J&&z>j?z:j,{min:eg(z,eg(j,z)),max:eg(j,eg(z,j))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const l=this.chart.data;return this.options.labels||(this.isHorizontal()?l.xLabels:l.yLabels)||l.labels||[]}getLabelItems(l=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(l))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Df(this.options.beforeUpdate,[this])}update(l,z,j){const{beginAtZero:J,grace:mt,ticks:kt}=this.options,Dt=kt.sampleSize;this.beforeUpdate(),this.maxWidth=l,this.maxHeight=z,this._margins=j=Object.assign({left:0,right:0,top:0,bottom:0},j),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+j.left+j.right:this.height+j.top+j.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=yst(this,mt,J),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const Gt=Dt<this.ticks.length;this._convertTicksToLabels(Gt?SP(this.ticks,Dt):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),kt.display&&(kt.autoSkip||kt.source==="auto")&&(this.ticks=Qlt(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),Gt&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let l=this.options.reverse,z,j;this.isHorizontal()?(z=this.left,j=this.right):(z=this.top,j=this.bottom,l=!l),this._startPixel=z,this._endPixel=j,this._reversePixels=l,this._length=j-z,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Df(this.options.afterUpdate,[this])}beforeSetDimensions(){Df(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Df(this.options.afterSetDimensions,[this])}_callHooks(l){this.chart.notifyPlugins(l,this.getContext()),Df(this.options[l],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Df(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(l){const z=this.options.ticks;let j,J,mt;for(j=0,J=l.length;j<J;j++)mt=l[j],mt.label=Df(z.callback,[mt.value,j,l],this)}afterTickToLabelConversion(){Df(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Df(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const l=this.options,z=l.ticks,j=MP(this.ticks.length,l.ticks.maxTicksLimit),J=z.minRotation||0,mt=z.maxRotation;let kt=J,Dt,Gt,re;if(!this._isVisible()||!z.display||J>=mt||j<=1||!this.isHorizontal()){this.labelRotation=J;return}const pe=this._getLabelSizes(),Ne=pe.widest.width,or=pe.highest.height,_r=Xp(this.chart.width-Ne,0,this.maxWidth);Dt=l.offset?this.maxWidth/j:_r/(j-1),Ne+6>Dt&&(Dt=_r/(j-(l.offset?.5:1)),Gt=this.maxHeight-i2(l.grid)-z.padding-EP(l.title,this.chart.options.font),re=Math.sqrt(Ne*Ne+or*or),kt=Hot(Math.min(Math.asin(Xp((pe.highest.height+6)/Dt,-1,1)),Math.asin(Xp(Gt/re,-1,1))-Math.asin(Xp(or/re,-1,1)))),kt=Math.max(J,Math.min(mt,kt))),this.labelRotation=kt}afterCalculateLabelRotation(){Df(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Df(this.options.beforeFit,[this])}fit(){const l={width:0,height:0},{chart:z,options:{ticks:j,title:J,grid:mt}}=this,kt=this._isVisible(),Dt=this.isHorizontal();if(kt){const Gt=EP(J,z.options.font);if(Dt?(l.width=this.maxWidth,l.height=i2(mt)+Gt):(l.height=this.maxHeight,l.width=i2(mt)+Gt),j.display&&this.ticks.length){const{first:re,last:pe,widest:Ne,highest:or}=this._getLabelSizes(),_r=j.padding*2,Fr=tv(this.labelRotation),zr=Math.cos(Fr),Wr=Math.sin(Fr);if(Dt){const An=j.mirror?0:Wr*Ne.width+zr*or.height;l.height=Math.min(this.maxHeight,l.height+An+_r)}else{const An=j.mirror?0:zr*Ne.width+Wr*or.height;l.width=Math.min(this.maxWidth,l.width+An+_r)}this._calculatePadding(re,pe,Wr,zr)}}this._handleMargins(),Dt?(this.width=this._length=z.width-this._margins.left-this._margins.right,this.height=l.height):(this.width=l.width,this.height=this._length=z.height-this._margins.top-this._margins.bottom)}_calculatePadding(l,z,j,J){const{ticks:{align:mt,padding:kt},position:Dt}=this.options,Gt=this.labelRotation!==0,re=Dt!=="top"&&this.axis==="x";if(this.isHorizontal()){const pe=this.getPixelForTick(0)-this.left,Ne=this.right-this.getPixelForTick(this.ticks.length-1);let or=0,_r=0;Gt?re?(or=J*l.width,_r=j*z.height):(or=j*l.height,_r=J*z.width):mt==="start"?_r=z.width:mt==="end"?or=l.width:mt!=="inner"&&(or=l.width/2,_r=z.width/2),this.paddingLeft=Math.max((or-pe+kt)*this.width/(this.width-pe),0),this.paddingRight=Math.max((_r-Ne+kt)*this.width/(this.width-Ne),0)}else{let pe=z.height/2,Ne=l.height/2;mt==="start"?(pe=0,Ne=l.height):mt==="end"&&(pe=z.height,Ne=0),this.paddingTop=pe+kt,this.paddingBottom=Ne+kt}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Df(this.options.afterFit,[this])}isHorizontal(){const{axis:l,position:z}=this.options;return z==="top"||z==="bottom"||l==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(l){this.beforeTickToLabelConversion(),this.generateTickLabels(l);let z,j;for(z=0,j=l.length;z<j;z++)Rh(l[z].label)&&(l.splice(z,1),j--,z--);this.afterTickToLabelConversion()}_getLabelSizes(){let l=this._labelSizes;if(!l){const z=this.options.ticks.sampleSize;let j=this.ticks;z<j.length&&(j=SP(j,z)),this._labelSizes=l=this._computeLabelSizes(j,j.length,this.options.ticks.maxTicksLimit)}return l}_computeLabelSizes(l,z,j){const{ctx:J,_longestTextCache:mt}=this,kt=[],Dt=[],Gt=Math.floor(z/MP(z,j));let re=0,pe=0,Ne,or,_r,Fr,zr,Wr,An,Ft,kn,ei,jn;for(Ne=0;Ne<z;Ne+=Gt){if(Fr=l[Ne].label,zr=this._resolveTickFontOptions(Ne),J.font=Wr=zr.string,An=mt[Wr]=mt[Wr]||{data:{},gc:[]},Ft=zr.lineHeight,kn=ei=0,!Rh(Fr)&&!Xd(Fr))kn=eP(J,An.data,An.gc,kn,Fr),ei=Ft;else if(Xd(Fr))for(or=0,_r=Fr.length;or<_r;++or)jn=Fr[or],!Rh(jn)&&!Xd(jn)&&(kn=eP(J,An.data,An.gc,kn,jn),ei+=Ft);kt.push(kn),Dt.push(ei),re=Math.max(kn,re),pe=Math.max(ei,pe)}sut(mt,z);const ai=kt.indexOf(re),Qi=Dt.indexOf(pe),Gi=un=>({width:kt[un]||0,height:Dt[un]||0});return{first:Gi(0),last:Gi(z-1),widest:Gi(ai),highest:Gi(Qi),widths:kt,heights:Dt}}getLabelForValue(l){return l}getPixelForValue(l,z){return NaN}getValueForPixel(l){}getPixelForTick(l){const z=this.ticks;return l<0||l>z.length-1?null:this.getPixelForValue(z[l].value)}getPixelForDecimal(l){this._reversePixels&&(l=1-l);const z=this._startPixel+l*this._length;return qot(this._alignToPixels?ly(this.chart,z,0):z)}getDecimalForPixel(l){const z=(l-this._startPixel)/this._length;return this._reversePixels?1-z:z}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:l,max:z}=this;return l<0&&z<0?z:l>0&&z>0?l:0}getContext(l){const z=this.ticks||[];if(l>=0&&l<z.length){const j=z[l];return j.$context||(j.$context=uut(this.getContext(),l,j))}return this.$context||(this.$context=lut(this.chart.getContext(),this))}_tickSize(){const l=this.options.ticks,z=tv(this.labelRotation),j=Math.abs(Math.cos(z)),J=Math.abs(Math.sin(z)),mt=this._getLabelSizes(),kt=l.autoSkipPadding||0,Dt=mt?mt.widest.width+kt:0,Gt=mt?mt.highest.height+kt:0;return this.isHorizontal()?Gt*j>Dt*J?Dt/j:Gt/J:Gt*J<Dt*j?Gt/j:Dt/J}_isVisible(){const l=this.options.display;return l!=="auto"?!!l:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(l){const z=this.axis,j=this.chart,J=this.options,{grid:mt,position:kt,border:Dt}=J,Gt=mt.offset,re=this.isHorizontal(),Ne=this.ticks.length+(Gt?1:0),or=i2(mt),_r=[],Fr=Dt.setContext(this.getContext()),zr=Fr.display?Fr.width:0,Wr=zr/2,An=function(Ni){return ly(j,Ni,zr)};let Ft,kn,ei,jn,ai,Qi,Gi,un,ia,fa,Li,yi;if(kt==="top")Ft=An(this.bottom),Qi=this.bottom-or,un=Ft-Wr,fa=An(l.top)+Wr,yi=l.bottom;else if(kt==="bottom")Ft=An(this.top),fa=l.top,yi=An(l.bottom)-Wr,Qi=Ft+Wr,un=this.top+or;else if(kt==="left")Ft=An(this.right),ai=this.right-or,Gi=Ft-Wr,ia=An(l.left)+Wr,Li=l.right;else if(kt==="right")Ft=An(this.left),ia=l.left,Li=An(l.right)-Wr,ai=Ft+Wr,Gi=this.left+or;else if(z==="x"){if(kt==="center")Ft=An((l.top+l.bottom)/2+.5);else if(Ec(kt)){const Ni=Object.keys(kt)[0],Ei=kt[Ni];Ft=An(this.chart.scales[Ni].getPixelForValue(Ei))}fa=l.top,yi=l.bottom,Qi=Ft+Wr,un=Qi+or}else if(z==="y"){if(kt==="center")Ft=An((l.left+l.right)/2);else if(Ec(kt)){const Ni=Object.keys(kt)[0],Ei=kt[Ni];Ft=An(this.chart.scales[Ni].getPixelForValue(Ei))}ai=Ft-Wr,Gi=ai-or,ia=l.left,Li=l.right}const ra=cc(J.ticks.maxTicksLimit,Ne),Da=Math.max(1,Math.ceil(Ne/ra));for(kn=0;kn<Ne;kn+=Da){const Ni=this.getContext(kn),Ei=mt.setContext(Ni),Va=Dt.setContext(Ni),ss=Ei.lineWidth,mo=Ei.color,ko=Va.dash||[],pl=Va.dashOffset,fu=Ei.tickWidth,qo=Ei.tickColor,fo=Ei.tickBorderDash||[],Ta=Ei.tickBorderDashOffset;ei=out(this,kn,Gt),ei!==void 0&&(jn=ly(j,ei,ss),re?ai=Gi=ia=Li=jn:Qi=un=fa=yi=jn,_r.push({tx1:ai,ty1:Qi,tx2:Gi,ty2:un,x1:ia,y1:fa,x2:Li,y2:yi,width:ss,color:mo,borderDash:ko,borderDashOffset:pl,tickWidth:fu,tickColor:qo,tickBorderDash:fo,tickBorderDashOffset:Ta}))}return this._ticksLength=Ne,this._borderValue=Ft,_r}_computeLabelItems(l){const z=this.axis,j=this.options,{position:J,ticks:mt}=j,kt=this.isHorizontal(),Dt=this.ticks,{align:Gt,crossAlign:re,padding:pe,mirror:Ne}=mt,or=i2(j.grid),_r=or+pe,Fr=Ne?-pe:_r,zr=-tv(this.labelRotation),Wr=[];let An,Ft,kn,ei,jn,ai,Qi,Gi,un,ia,fa,Li,yi="middle";if(J==="top")ai=this.bottom-Fr,Qi=this._getXAxisLabelAlignment();else if(J==="bottom")ai=this.top+Fr,Qi=this._getXAxisLabelAlignment();else if(J==="left"){const Da=this._getYAxisLabelAlignment(or);Qi=Da.textAlign,jn=Da.x}else if(J==="right"){const Da=this._getYAxisLabelAlignment(or);Qi=Da.textAlign,jn=Da.x}else if(z==="x"){if(J==="center")ai=(l.top+l.bottom)/2+_r;else if(Ec(J)){const Da=Object.keys(J)[0],Ni=J[Da];ai=this.chart.scales[Da].getPixelForValue(Ni)+_r}Qi=this._getXAxisLabelAlignment()}else if(z==="y"){if(J==="center")jn=(l.left+l.right)/2-_r;else if(Ec(J)){const Da=Object.keys(J)[0],Ni=J[Da];jn=this.chart.scales[Da].getPixelForValue(Ni)}Qi=this._getYAxisLabelAlignment(or).textAlign}z==="y"&&(Gt==="start"?yi="top":Gt==="end"&&(yi="bottom"));const ra=this._getLabelSizes();for(An=0,Ft=Dt.length;An<Ft;++An){kn=Dt[An],ei=kn.label;const Da=mt.setContext(this.getContext(An));Gi=this.getPixelForTick(An)+mt.labelOffset,un=this._resolveTickFontOptions(An),ia=un.lineHeight,fa=Xd(ei)?ei.length:1;const Ni=fa/2,Ei=Da.color,Va=Da.textStrokeColor,ss=Da.textStrokeWidth;let mo=Qi;kt?(jn=Gi,Qi==="inner"&&(An===Ft-1?mo=this.options.reverse?"left":"right":An===0?mo=this.options.reverse?"right":"left":mo="center"),J==="top"?re==="near"||zr!==0?Li=-fa*ia+ia/2:re==="center"?Li=-ra.highest.height/2-Ni*ia+ia:Li=-ra.highest.height+ia/2:re==="near"||zr!==0?Li=ia/2:re==="center"?Li=ra.highest.height/2-Ni*ia:Li=ra.highest.height-fa*ia,Ne&&(Li*=-1),zr!==0&&!Da.showLabelBackdrop&&(jn+=ia/2*Math.sin(zr))):(ai=Gi,Li=(1-fa)*ia/2);let ko;if(Da.showLabelBackdrop){const pl=fm(Da.backdropPadding),fu=ra.heights[An],qo=ra.widths[An];let fo=Li-pl.top,Ta=0-pl.left;switch(yi){case"middle":fo-=fu/2;break;case"bottom":fo-=fu;break}switch(Qi){case"center":Ta-=qo/2;break;case"right":Ta-=qo;break;case"inner":An===Ft-1?Ta-=qo:An>0&&(Ta-=qo/2);break}ko={left:Ta,top:fo,width:qo+pl.width,height:fu+pl.height,color:Da.backdropColor}}Wr.push({label:ei,font:un,textOffset:Li,options:{rotation:zr,color:Ei,strokeColor:Va,strokeWidth:ss,textAlign:mo,textBaseline:yi,translation:[jn,ai],backdrop:ko}})}return Wr}_getXAxisLabelAlignment(){const{position:l,ticks:z}=this.options;if(-tv(this.labelRotation))return l==="top"?"left":"right";let J="center";return z.align==="start"?J="left":z.align==="end"?J="right":z.align==="inner"&&(J="inner"),J}_getYAxisLabelAlignment(l){const{position:z,ticks:{crossAlign:j,mirror:J,padding:mt}}=this.options,kt=this._getLabelSizes(),Dt=l+mt,Gt=kt.widest.width;let re,pe;return z==="left"?J?(pe=this.right+mt,j==="near"?re="left":j==="center"?(re="center",pe+=Gt/2):(re="right",pe+=Gt)):(pe=this.right-Dt,j==="near"?re="right":j==="center"?(re="center",pe-=Gt/2):(re="left",pe=this.left)):z==="right"?J?(pe=this.left+mt,j==="near"?re="right":j==="center"?(re="center",pe-=Gt/2):(re="left",pe-=Gt)):(pe=this.left+Dt,j==="near"?re="left":j==="center"?(re="center",pe+=Gt/2):(re="right",pe=this.right)):re="right",{textAlign:re,x:pe}}_computeLabelArea(){if(this.options.ticks.mirror)return;const l=this.chart,z=this.options.position;if(z==="left"||z==="right")return{top:0,left:this.left,bottom:l.height,right:this.right};if(z==="top"||z==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:l.width}}drawBackground(){const{ctx:l,options:{backgroundColor:z},left:j,top:J,width:mt,height:kt}=this;z&&(l.save(),l.fillStyle=z,l.fillRect(j,J,mt,kt),l.restore())}getLineWidthForValue(l){const z=this.options.grid;if(!this._isVisible()||!z.display)return 0;const J=this.ticks.findIndex(mt=>mt.value===l);return J>=0?z.setContext(this.getContext(J)).lineWidth:0}drawGrid(l){const z=this.options.grid,j=this.ctx,J=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(l));let mt,kt;const Dt=(Gt,re,pe)=>{!pe.width||!pe.color||(j.save(),j.lineWidth=pe.width,j.strokeStyle=pe.color,j.setLineDash(pe.borderDash||[]),j.lineDashOffset=pe.borderDashOffset,j.beginPath(),j.moveTo(Gt.x,Gt.y),j.lineTo(re.x,re.y),j.stroke(),j.restore())};if(z.display)for(mt=0,kt=J.length;mt<kt;++mt){const Gt=J[mt];z.drawOnChartArea&&Dt({x:Gt.x1,y:Gt.y1},{x:Gt.x2,y:Gt.y2},Gt),z.drawTicks&&Dt({x:Gt.tx1,y:Gt.ty1},{x:Gt.tx2,y:Gt.ty2},{color:Gt.tickColor,width:Gt.tickWidth,borderDash:Gt.tickBorderDash,borderDashOffset:Gt.tickBorderDashOffset})}}drawBorder(){const{chart:l,ctx:z,options:{border:j,grid:J}}=this,mt=j.setContext(this.getContext()),kt=j.display?mt.width:0;if(!kt)return;const Dt=J.setContext(this.getContext(0)).lineWidth,Gt=this._borderValue;let re,pe,Ne,or;this.isHorizontal()?(re=ly(l,this.left,kt)-kt/2,pe=ly(l,this.right,Dt)+Dt/2,Ne=or=Gt):(Ne=ly(l,this.top,kt)-kt/2,or=ly(l,this.bottom,Dt)+Dt/2,re=pe=Gt),z.save(),z.lineWidth=mt.width,z.strokeStyle=mt.color,z.beginPath(),z.moveTo(re,Ne),z.lineTo(pe,or),z.stroke(),z.restore()}drawLabels(l){if(!this.options.ticks.display)return;const j=this.ctx,J=this._computeLabelArea();J&&U4(j,J);const mt=this.getLabelItems(l);for(const kt of mt){const Dt=kt.options,Gt=kt.font,re=kt.label,pe=kt.textOffset;q2(j,re,0,pe,Gt,Dt)}J&&V4(j)}drawTitle(){const{ctx:l,options:{position:z,title:j,reverse:J}}=this;if(!j.display)return;const mt=Jp(j.font),kt=fm(j.padding),Dt=j.align;let Gt=mt.lineHeight/2;z==="bottom"||z==="center"||Ec(z)?(Gt+=kt.bottom,Xd(j.text)&&(Gt+=mt.lineHeight*(j.text.length-1))):Gt+=kt.top;const{titleX:re,titleY:pe,maxWidth:Ne,rotation:or}=hut(this,Gt,z,Dt);q2(l,j.text,0,0,mt,{color:j.color,maxWidth:Ne,rotation:or,textAlign:cut(Dt,z,J),textBaseline:"middle",translation:[re,pe]})}draw(l){this._isVisible()&&(this.drawBackground(),this.drawGrid(l),this.drawBorder(),this.drawTitle(),this.drawLabels(l))}_layers(){const l=this.options,z=l.ticks&&l.ticks.z||0,j=cc(l.grid&&l.grid.z,-1),J=cc(l.border&&l.border.z,0);return!this._isVisible()||this.draw!==__.prototype.draw?[{z,draw:mt=>{this.draw(mt)}}]:[{z:j,draw:mt=>{this.drawBackground(),this.drawGrid(mt),this.drawTitle()}},{z:J,draw:()=>{this.drawBorder()}},{z,draw:mt=>{this.drawLabels(mt)}}]}getMatchingVisibleMetas(l){const z=this.chart.getSortedVisibleDatasetMetas(),j=this.axis+"AxisID",J=[];let mt,kt;for(mt=0,kt=z.length;mt<kt;++mt){const Dt=z[mt];Dt[j]===this.id&&(!l||Dt.type===l)&&J.push(Dt)}return J}_resolveTickFontOptions(l){const z=this.options.ticks.setContext(this.getContext(l));return Jp(z.font)}_maxDigits(){const l=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/l}}class F5{constructor(l,z,j){this.type=l,this.scope=z,this.override=j,this.items=Object.create(null)}isForType(l){return Object.prototype.isPrototypeOf.call(this.type.prototype,l.prototype)}register(l){const z=Object.getPrototypeOf(l);let j;put(z)&&(j=this.register(z));const J=this.items,mt=l.id,kt=this.scope+"."+mt;if(!mt)throw new Error("class does not have id: "+l);return mt in J||(J[mt]=l,fut(l,kt,j),this.override&&Bd.override(l.id,l.overrides)),kt}get(l){return this.items[l]}unregister(l){const z=this.items,j=l.id,J=this.scope;j in z&&delete z[j],J&&j in Bd[J]&&(delete Bd[J][j],this.override&&delete Sy[j])}}function fut(d,l,z){const j=j2(Object.create(null),[z?Bd.get(z):{},Bd.get(l),d.defaults]);Bd.set(l,j),d.defaultRoutes&&dut(l,d.defaultRoutes),d.descriptors&&Bd.describe(l,d.descriptors)}function dut(d,l){Object.keys(l).forEach(z=>{const j=z.split("."),J=j.pop(),mt=[d].concat(j).join("."),kt=l[z].split("."),Dt=kt.pop(),Gt=kt.join(".");Bd.route(mt,J,Gt,Dt)})}function put(d){return"id"in d&&"defaults"in d}class mut{constructor(){this.controllers=new F5(W4,"datasets",!0),this.elements=new F5(lv,"elements"),this.plugins=new F5(Object,"plugins"),this.scales=new F5(__,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...l){this._each("register",l)}remove(...l){this._each("unregister",l)}addControllers(...l){this._each("register",l,this.controllers)}addElements(...l){this._each("register",l,this.elements)}addPlugins(...l){this._each("register",l,this.plugins)}addScales(...l){this._each("register",l,this.scales)}getController(l){return this._get(l,this.controllers,"controller")}getElement(l){return this._get(l,this.elements,"element")}getPlugin(l){return this._get(l,this.plugins,"plugin")}getScale(l){return this._get(l,this.scales,"scale")}removeControllers(...l){this._each("unregister",l,this.controllers)}removeElements(...l){this._each("unregister",l,this.elements)}removePlugins(...l){this._each("unregister",l,this.plugins)}removeScales(...l){this._each("unregister",l,this.scales)}_each(l,z,j){[...z].forEach(J=>{const mt=j||this._getRegistryForType(J);j||mt.isForType(J)||mt===this.plugins&&J.id?this._exec(l,mt,J):Kh(J,kt=>{const Dt=j||this._getRegistryForType(kt);this._exec(l,Dt,kt)})})}_exec(l,z,j){const J=iM(l);Df(j["before"+J],[],j),z[l](j),Df(j["after"+J],[],j)}_getRegistryForType(l){for(let z=0;z<this._typedRegistries.length;z++){const j=this._typedRegistries[z];if(j.isForType(l))return j}return this.plugins}_get(l,z,j){const J=z.get(l);if(J===void 0)throw new Error('"'+l+'" is not a registered '+j+".");return J}}var ag=new mut;class gut{constructor(){this._init=void 0}notify(l,z,j,J){if(z==="beforeInit"&&(this._init=this._createDescriptors(l,!0),this._notify(this._init,l,"install")),this._init===void 0)return;const mt=J?this._descriptors(l).filter(J):this._descriptors(l),kt=this._notify(mt,l,z,j);return z==="afterDestroy"&&(this._notify(mt,l,"stop"),this._notify(this._init,l,"uninstall"),this._init=void 0),kt}_notify(l,z,j,J){J=J||{};for(const mt of l){const kt=mt.plugin,Dt=kt[j],Gt=[z,J,mt.options];if(Df(Dt,Gt,kt)===!1&&J.cancelable)return!1}return!0}invalidate(){Rh(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(l){if(this._cache)return this._cache;const z=this._cache=this._createDescriptors(l);return this._notifyStateChanges(l),z}_createDescriptors(l,z){const j=l&&l.config,J=cc(j.options&&j.options.plugins,{}),mt=vut(j);return J===!1&&!z?[]:xut(l,mt,J,z)}_notifyStateChanges(l){const z=this._oldCache||[],j=this._cache,J=(mt,kt)=>mt.filter(Dt=>!kt.some(Gt=>Dt.plugin.id===Gt.plugin.id));this._notify(J(z,j),l,"stop"),this._notify(J(j,z),l,"start")}}function vut(d){const l={},z=[],j=Object.keys(ag.plugins.items);for(let mt=0;mt<j.length;mt++)z.push(ag.getPlugin(j[mt]));const J=d.plugins||[];for(let mt=0;mt<J.length;mt++){const kt=J[mt];z.indexOf(kt)===-1&&(z.push(kt),l[kt.id]=!0)}return{plugins:z,localIds:l}}function yut(d,l){return!l&&d===!1?null:d===!0?{}:d}function xut(d,{plugins:l,localIds:z},j,J){const mt=[],kt=d.getContext();for(const Dt of l){const Gt=Dt.id,re=yut(j[Gt],J);re!==null&&mt.push({plugin:Dt,options:_ut(d.config,{plugin:Dt,local:z[Gt]},re,kt)})}return mt}function _ut(d,{plugin:l,local:z},j,J){const mt=d.pluginScopeKeys(l),kt=d.getOptionScopes(j,mt);return z&&l.defaults&&kt.push(l.defaults),d.createResolver(kt,J,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function xA(d,l){const z=Bd.datasets[d]||{};return((l.datasets||{})[d]||{}).indexAxis||l.indexAxis||z.indexAxis||"x"}function but(d,l){let z=d;return d==="_index_"?z=l:d==="_value_"&&(z=l==="x"?"y":"x"),z}function wut(d,l){return d===l?"_index_":"_value_"}function CP(d){if(d==="x"||d==="y"||d==="r")return d}function kut(d){if(d==="top"||d==="bottom")return"x";if(d==="left"||d==="right")return"y"}function _A(d,...l){if(CP(d))return d;for(const z of l){const j=z.axis||kut(z.position)||d.length>1&&CP(d[0].toLowerCase());if(j)return j}throw new Error(`Cannot determine type of '${d}' axis. Please provide 'axis' or 'position' option.`)}function LP(d,l,z){if(z[l+"AxisID"]===d)return{axis:l}}function Tut(d,l){if(l.data&&l.data.datasets){const z=l.data.datasets.filter(j=>j.xAxisID===d||j.yAxisID===d);if(z.length)return LP(d,"x",z[0])||LP(d,"y",z[0])}return{}}function Aut(d,l){const z=Sy[d.type]||{scales:{}},j=l.scales||{},J=xA(d.type,l),mt=Object.create(null);return Object.keys(j).forEach(kt=>{const Dt=j[kt];if(!Ec(Dt))return console.error(`Invalid scale configuration for scale: ${kt}`);if(Dt._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${kt}`);const Gt=_A(kt,Dt,Tut(kt,d),Bd.scales[Dt.type]),re=wut(Gt,J),pe=z.scales||{};mt[kt]=T2(Object.create(null),[{axis:Gt},Dt,pe[Gt],pe[re]])}),d.data.datasets.forEach(kt=>{const Dt=kt.type||d.type,Gt=kt.indexAxis||xA(Dt,l),pe=(Sy[Dt]||{}).scales||{};Object.keys(pe).forEach(Ne=>{const or=but(Ne,Gt),_r=kt[or+"AxisID"]||or;mt[_r]=mt[_r]||Object.create(null),T2(mt[_r],[{axis:or},j[_r],pe[Ne]])})}),Object.keys(mt).forEach(kt=>{const Dt=mt[kt];T2(Dt,[Bd.scales[Dt.type],Bd.scale])}),mt}function hD(d){const l=d.options||(d.options={});l.plugins=cc(l.plugins,{}),l.scales=Aut(d,l)}function fD(d){return d=d||{},d.datasets=d.datasets||[],d.labels=d.labels||[],d}function Mut(d){return d=d||{},d.data=fD(d.data),hD(d),d}const PP=new Map,dD=new Set;function R5(d,l){let z=PP.get(d);return z||(z=l(),PP.set(d,z),dD.add(z)),z}const a2=(d,l,z)=>{const j=My(l,z);j!==void 0&&d.add(j)};class Sut{constructor(l){this._config=Mut(l),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(l){this._config.type=l}get data(){return this._config.data}set data(l){this._config.data=fD(l)}get options(){return this._config.options}set options(l){this._config.options=l}get plugins(){return this._config.plugins}update(){const l=this._config;this.clearCache(),hD(l)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(l){return R5(l,()=>[[`datasets.${l}`,""]])}datasetAnimationScopeKeys(l,z){return R5(`${l}.transition.${z}`,()=>[[`datasets.${l}.transitions.${z}`,`transitions.${z}`],[`datasets.${l}`,""]])}datasetElementScopeKeys(l,z){return R5(`${l}-${z}`,()=>[[`datasets.${l}.elements.${z}`,`datasets.${l}`,`elements.${z}`,""]])}pluginScopeKeys(l){const z=l.id,j=this.type;return R5(`${j}-plugin-${z}`,()=>[[`plugins.${z}`,...l.additionalOptionScopes||[]]])}_cachedScopes(l,z){const j=this._scopeCache;let J=j.get(l);return(!J||z)&&(J=new Map,j.set(l,J)),J}getOptionScopes(l,z,j){const{options:J,type:mt}=this,kt=this._cachedScopes(l,j),Dt=kt.get(z);if(Dt)return Dt;const Gt=new Set;z.forEach(pe=>{l&&(Gt.add(l),pe.forEach(Ne=>a2(Gt,l,Ne))),pe.forEach(Ne=>a2(Gt,J,Ne)),pe.forEach(Ne=>a2(Gt,Sy[mt]||{},Ne)),pe.forEach(Ne=>a2(Gt,Bd,Ne)),pe.forEach(Ne=>a2(Gt,vA,Ne))});const re=Array.from(Gt);return re.length===0&&re.push(Object.create(null)),dD.has(z)&&kt.set(z,re),re}chartOptionScopes(){const{options:l,type:z}=this;return[l,Sy[z]||{},Bd.datasets[z]||{},{type:z},Bd,vA]}resolveNamedOptions(l,z,j,J=[""]){const mt={$shared:!0},{resolver:kt,subPrefixes:Dt}=zP(this._resolverCache,l,J);let Gt=kt;if(Cut(kt,z)){mt.$shared=!1,j=v1(j)?j():j;const re=this.createResolver(l,j,Dt);Gt=m_(kt,j,re)}for(const re of z)mt[re]=Gt[re];return mt}createResolver(l,z,j=[""],J){const{resolver:mt}=zP(this._resolverCache,l,j);return Ec(z)?m_(mt,z,void 0,J):mt}}function zP(d,l,z){let j=d.get(l);j||(j=new Map,d.set(l,j));const J=z.join();let mt=j.get(J);return mt||(mt={resolver:cM(l,z),subPrefixes:z.filter(Dt=>!Dt.toLowerCase().includes("hover"))},j.set(J,mt)),mt}const Eut=d=>Ec(d)&&Object.getOwnPropertyNames(d).some(l=>v1(d[l]));function Cut(d,l){const{isScriptable:z,isIndexable:j}=qO(d);for(const J of l){const mt=z(J),kt=j(J),Dt=(kt||mt)&&d[J];if(mt&&(v1(Dt)||Eut(Dt))||kt&&Xd(Dt))return!0}return!1}var Lut="4.5.1";const Put=["top","bottom","left","right","chartArea"];function IP(d,l){return d==="top"||d==="bottom"||Put.indexOf(d)===-1&&l==="x"}function OP(d,l){return function(z,j){return z[d]===j[d]?z[l]-j[l]:z[d]-j[d]}}function DP(d){const l=d.chart,z=l.options.animation;l.notifyPlugins("afterRender"),Df(z&&z.onComplete,[d],l)}function zut(d){const l=d.chart,z=l.options.animation;Df(z&&z.onProgress,[d],l)}function pD(d){return dM()&&typeof d=="string"?d=document.getElementById(d):d&&d.length&&(d=d[0]),d&&d.canvas&&(d=d.canvas),d}const X5={},FP=d=>{const l=pD(d);return Object.values(X5).filter(z=>z.canvas===l).pop()};function Iut(d,l,z){const j=Object.keys(d);for(const J of j){const mt=+J;if(mt>=l){const kt=d[J];delete d[J],(z>0||mt>l)&&(d[mt+z]=kt)}}}function Out(d,l,z,j){return!z||d.type==="mouseout"?null:j?l:d}class d2{static defaults=Bd;static instances=X5;static overrides=Sy;static registry=ag;static version=Lut;static getChart=FP;static register(...l){ag.add(...l),RP()}static unregister(...l){ag.remove(...l),RP()}constructor(l,z){const j=this.config=new Sut(z),J=pD(l),mt=FP(J);if(mt)throw new Error("Canvas is already in use. Chart with ID '"+mt.id+"' must be destroyed before the canvas with ID '"+mt.canvas.id+"' can be reused.");const kt=j.createResolver(j.chartOptionScopes(),this.getContext());this.platform=new(j.platform||Jlt(J)),this.platform.updateConfig(j);const Dt=this.platform.acquireContext(J,kt.aspectRatio),Gt=Dt&&Dt.canvas,re=Gt&&Gt.height,pe=Gt&&Gt.width;if(this.id=Lot(),this.ctx=Dt,this.canvas=Gt,this.width=pe,this.height=re,this._options=kt,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new gut,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Yot(Ne=>this.update(Ne),kt.resizeDelay||0),this._dataChanges=[],X5[this.id]=this,!Dt||!Gt){console.error("Failed to create chart: can't acquire context from the given item");return}Gg.listen(this,"complete",DP),Gg.listen(this,"progress",zut),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:l,maintainAspectRatio:z},width:j,height:J,_aspectRatio:mt}=this;return Rh(l)?z&&mt?mt:J?j/J:null:l}get data(){return this.config.data}set data(l){this.config.data=l}get options(){return this._options}set options(l){this.config.options=l}get registry(){return ag}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():aP(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return rP(this.canvas,this.ctx),this}stop(){return Gg.stop(this),this}resize(l,z){Gg.running(this)?this._resizeBeforeDraw={width:l,height:z}:this._resize(l,z)}_resize(l,z){const j=this.options,J=this.canvas,mt=j.maintainAspectRatio&&this.aspectRatio,kt=this.platform.getMaximumSize(J,l,z,mt),Dt=j.devicePixelRatio||this.platform.getDevicePixelRatio(),Gt=this.width?"resize":"attach";this.width=kt.width,this.height=kt.height,this._aspectRatio=this.aspectRatio,aP(this,Dt,!0)&&(this.notifyPlugins("resize",{size:kt}),Df(j.onResize,[this,kt],this),this.attached&&this._doResize(Gt)&&this.render())}ensureScalesHaveIDs(){const z=this.options.scales||{};Kh(z,(j,J)=>{j.id=J})}buildOrUpdateScales(){const l=this.options,z=l.scales,j=this.scales,J=Object.keys(j).reduce((kt,Dt)=>(kt[Dt]=!1,kt),{});let mt=[];z&&(mt=mt.concat(Object.keys(z).map(kt=>{const Dt=z[kt],Gt=_A(kt,Dt),re=Gt==="r",pe=Gt==="x";return{options:Dt,dposition:re?"chartArea":pe?"bottom":"left",dtype:re?"radialLinear":pe?"category":"linear"}}))),Kh(mt,kt=>{const Dt=kt.options,Gt=Dt.id,re=_A(Gt,Dt),pe=cc(Dt.type,kt.dtype);(Dt.position===void 0||IP(Dt.position,re)!==IP(kt.dposition))&&(Dt.position=kt.dposition),J[Gt]=!0;let Ne=null;if(Gt in j&&j[Gt].type===pe)Ne=j[Gt];else{const or=ag.getScale(pe);Ne=new or({id:Gt,type:pe,ctx:this.ctx,chart:this}),j[Ne.id]=Ne}Ne.init(Dt,l)}),Kh(J,(kt,Dt)=>{kt||delete j[Dt]}),Kh(j,kt=>{om.configure(this,kt,kt.options),om.addBox(this,kt)})}_updateMetasets(){const l=this._metasets,z=this.data.datasets.length,j=l.length;if(l.sort((J,mt)=>J.index-mt.index),j>z){for(let J=z;J<j;++J)this._destroyDatasetMeta(J);l.splice(z,j-z)}this._sortedMetasets=l.slice(0).sort(OP("order","index"))}_removeUnreferencedMetasets(){const{_metasets:l,data:{datasets:z}}=this;l.length>z.length&&delete this._stacks,l.forEach((j,J)=>{z.filter(mt=>mt===j._dataset).length===0&&this._destroyDatasetMeta(J)})}buildOrUpdateControllers(){const l=[],z=this.data.datasets;let j,J;for(this._removeUnreferencedMetasets(),j=0,J=z.length;j<J;j++){const mt=z[j];let kt=this.getDatasetMeta(j);const Dt=mt.type||this.config.type;if(kt.type&&kt.type!==Dt&&(this._destroyDatasetMeta(j),kt=this.getDatasetMeta(j)),kt.type=Dt,kt.indexAxis=mt.indexAxis||xA(Dt,this.options),kt.order=mt.order||0,kt.index=j,kt.label=""+mt.label,kt.visible=this.isDatasetVisible(j),kt.controller)kt.controller.updateIndex(j),kt.controller.linkScales();else{const Gt=ag.getController(Dt),{datasetElementType:re,dataElementType:pe}=Bd.datasets[Dt];Object.assign(Gt,{dataElementType:ag.getElement(pe),datasetElementType:re&&ag.getElement(re)}),kt.controller=new Gt(this,j),l.push(kt.controller)}}return this._updateMetasets(),l}_resetElements(){Kh(this.data.datasets,(l,z)=>{this.getDatasetMeta(z).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(l){const z=this.config;z.update();const j=this._options=z.createResolver(z.chartOptionScopes(),this.getContext()),J=this._animationsDisabled=!j.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:l,cancelable:!0})===!1)return;const mt=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let kt=0;for(let re=0,pe=this.data.datasets.length;re<pe;re++){const{controller:Ne}=this.getDatasetMeta(re),or=!J&&mt.indexOf(Ne)===-1;Ne.buildOrUpdateElements(or),kt=Math.max(+Ne.getMaxOverflow(),kt)}kt=this._minPadding=j.layout.autoPadding?kt:0,this._updateLayout(kt),J||Kh(mt,re=>{re.reset()}),this._updateDatasets(l),this.notifyPlugins("afterUpdate",{mode:l}),this._layers.sort(OP("z","_idx"));const{_active:Dt,_lastEvent:Gt}=this;Gt?this._eventHandler(Gt,!0):Dt.length&&this._updateHoverStyles(Dt,Dt,!0),this.render()}_updateScales(){Kh(this.scales,l=>{om.removeBox(this,l)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const l=this.options,z=new Set(Object.keys(this._listeners)),j=new Set(l.events);(!ZL(z,j)||!!this._responsiveListeners!==l.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:l}=this,z=this._getUniformDataChanges()||[];for(const{method:j,start:J,count:mt}of z){const kt=j==="_removeElements"?-mt:mt;Iut(l,J,kt)}}_getUniformDataChanges(){const l=this._dataChanges;if(!l||!l.length)return;this._dataChanges=[];const z=this.data.datasets.length,j=mt=>new Set(l.filter(kt=>kt[0]===mt).map((kt,Dt)=>Dt+","+kt.splice(1).join(","))),J=j(0);for(let mt=1;mt<z;mt++)if(!ZL(J,j(mt)))return;return Array.from(J).map(mt=>mt.split(",")).map(mt=>({method:mt[1],start:+mt[2],count:+mt[3]}))}_updateLayout(l){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;om.update(this,this.width,this.height,l);const z=this.chartArea,j=z.width<=0||z.height<=0;this._layers=[],Kh(this.boxes,J=>{j&&J.position==="chartArea"||(J.configure&&J.configure(),this._layers.push(...J._layers()))},this),this._layers.forEach((J,mt)=>{J._idx=mt}),this.notifyPlugins("afterLayout")}_updateDatasets(l){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:l,cancelable:!0})!==!1){for(let z=0,j=this.data.datasets.length;z<j;++z)this.getDatasetMeta(z).controller.configure();for(let z=0,j=this.data.datasets.length;z<j;++z)this._updateDataset(z,v1(l)?l({datasetIndex:z}):l);this.notifyPlugins("afterDatasetsUpdate",{mode:l})}}_updateDataset(l,z){const j=this.getDatasetMeta(l),J={meta:j,index:l,mode:z,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",J)!==!1&&(j.controller._update(z),J.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",J))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Gg.has(this)?this.attached&&!Gg.running(this)&&Gg.start(this):(this.draw(),DP({chart:this})))}draw(){let l;if(this._resizeBeforeDraw){const{width:j,height:J}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(j,J)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const z=this._layers;for(l=0;l<z.length&&z[l].z<=0;++l)z[l].draw(this.chartArea);for(this._drawDatasets();l<z.length;++l)z[l].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(l){const z=this._sortedMetasets,j=[];let J,mt;for(J=0,mt=z.length;J<mt;++J){const kt=z[J];(!l||kt.visible)&&j.push(kt)}return j}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const l=this.getSortedVisibleDatasetMetas();for(let z=l.length-1;z>=0;--z)this._drawDataset(l[z]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(l){const z=this.ctx,j={meta:l,index:l.index,cancelable:!0},J=eD(this,l);this.notifyPlugins("beforeDatasetDraw",j)!==!1&&(J&&U4(z,J),l.controller.draw(),J&&V4(z),j.cancelable=!1,this.notifyPlugins("afterDatasetDraw",j))}isPointInArea(l){return W2(l,this.chartArea,this._minPadding)}getElementsAtEventForMode(l,z,j,J){const mt=Plt.modes[z];return typeof mt=="function"?mt(this,l,j,J):[]}getDatasetMeta(l){const z=this.data.datasets[l],j=this._metasets;let J=j.filter(mt=>mt&&mt._dataset===z).pop();return J||(J={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:z&&z.order||0,index:l,_dataset:z,_parsed:[],_sorted:!1},j.push(J)),J}getContext(){return this.$context||(this.$context=Cy(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(l){const z=this.data.datasets[l];if(!z)return!1;const j=this.getDatasetMeta(l);return typeof j.hidden=="boolean"?!j.hidden:!z.hidden}setDatasetVisibility(l,z){const j=this.getDatasetMeta(l);j.hidden=!z}toggleDataVisibility(l){this._hiddenIndices[l]=!this._hiddenIndices[l]}getDataVisibility(l){return!this._hiddenIndices[l]}_updateVisibility(l,z,j){const J=j?"show":"hide",mt=this.getDatasetMeta(l),kt=mt.controller._resolveAnimations(void 0,J);U2(z)?(mt.data[z].hidden=!j,this.update()):(this.setDatasetVisibility(l,j),kt.update(mt,{visible:j}),this.update(Dt=>Dt.datasetIndex===l?J:void 0))}hide(l,z){this._updateVisibility(l,z,!1)}show(l,z){this._updateVisibility(l,z,!0)}_destroyDatasetMeta(l){const z=this._metasets[l];z&&z.controller&&z.controller._destroy(),delete this._metasets[l]}_stop(){let l,z;for(this.stop(),Gg.remove(this),l=0,z=this.data.datasets.length;l<z;++l)this._destroyDatasetMeta(l)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:l,ctx:z}=this;this._stop(),this.config.clearCache(),l&&(this.unbindEvents(),rP(l,z),this.platform.releaseContext(z),this.canvas=null,this.ctx=null),delete X5[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...l){return this.canvas.toDataURL(...l)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const l=this._listeners,z=this.platform,j=(mt,kt)=>{z.addEventListener(this,mt,kt),l[mt]=kt},J=(mt,kt,Dt)=>{mt.offsetX=kt,mt.offsetY=Dt,this._eventHandler(mt)};Kh(this.options.events,mt=>j(mt,J))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const l=this._responsiveListeners,z=this.platform,j=(Gt,re)=>{z.addEventListener(this,Gt,re),l[Gt]=re},J=(Gt,re)=>{l[Gt]&&(z.removeEventListener(this,Gt,re),delete l[Gt])},mt=(Gt,re)=>{this.canvas&&this.resize(Gt,re)};let kt;const Dt=()=>{J("attach",Dt),this.attached=!0,this.resize(),j("resize",mt),j("detach",kt)};kt=()=>{this.attached=!1,J("resize",mt),this._stop(),this._resize(0,0),j("attach",Dt)},z.isAttached(this.canvas)?Dt():kt()}unbindEvents(){Kh(this._listeners,(l,z)=>{this.platform.removeEventListener(this,z,l)}),this._listeners={},Kh(this._responsiveListeners,(l,z)=>{this.platform.removeEventListener(this,z,l)}),this._responsiveListeners=void 0}updateHoverStyle(l,z,j){const J=j?"set":"remove";let mt,kt,Dt,Gt;for(z==="dataset"&&(mt=this.getDatasetMeta(l[0].datasetIndex),mt.controller["_"+J+"DatasetHoverStyle"]()),Dt=0,Gt=l.length;Dt<Gt;++Dt){kt=l[Dt];const re=kt&&this.getDatasetMeta(kt.datasetIndex).controller;re&&re[J+"HoverStyle"](kt.element,kt.datasetIndex,kt.index)}}getActiveElements(){return this._active||[]}setActiveElements(l){const z=this._active||[],j=l.map(({datasetIndex:mt,index:kt})=>{const Dt=this.getDatasetMeta(mt);if(!Dt)throw new Error("No dataset found at index "+mt);return{datasetIndex:mt,element:Dt.data[kt],index:kt}});!h4(j,z)&&(this._active=j,this._lastEvent=null,this._updateHoverStyles(j,z))}notifyPlugins(l,z,j){return this._plugins.notify(this,l,z,j)}isPluginEnabled(l){return this._plugins._cache.filter(z=>z.plugin.id===l).length===1}_updateHoverStyles(l,z,j){const J=this.options.hover,mt=(Gt,re)=>Gt.filter(pe=>!re.some(Ne=>pe.datasetIndex===Ne.datasetIndex&&pe.index===Ne.index)),kt=mt(z,l),Dt=j?l:mt(l,z);kt.length&&this.updateHoverStyle(kt,J.mode,!1),Dt.length&&J.mode&&this.updateHoverStyle(Dt,J.mode,!0)}_eventHandler(l,z){const j={event:l,replay:z,cancelable:!0,inChartArea:this.isPointInArea(l)},J=kt=>(kt.options.events||this.options.events).includes(l.native.type);if(this.notifyPlugins("beforeEvent",j,J)===!1)return;const mt=this._handleEvent(l,z,j.inChartArea);return j.cancelable=!1,this.notifyPlugins("afterEvent",j,J),(mt||j.changed)&&this.render(),this}_handleEvent(l,z,j){const{_active:J=[],options:mt}=this,kt=z,Dt=this._getActiveElements(l,J,j,kt),Gt=Fot(l),re=Out(l,this._lastEvent,j,Gt);j&&(this._lastEvent=null,Df(mt.onHover,[l,Dt,this],this),Gt&&Df(mt.onClick,[l,Dt,this],this));const pe=!h4(Dt,J);return(pe||z)&&(this._active=Dt,this._updateHoverStyles(Dt,J,z)),this._lastEvent=re,pe}_getActiveElements(l,z,j,J){if(l.type==="mouseout")return[];if(!j)return z;const mt=this.options.hover;return this.getElementsAtEventForMode(l,mt.mode,mt,J)}}function RP(){return Kh(d2.instances,d=>d._plugins.invalidate())}function Dut(d,l,z){const{startAngle:j,x:J,y:mt,outerRadius:kt,innerRadius:Dt,options:Gt}=l,{borderWidth:re,borderJoinStyle:pe}=Gt,Ne=Math.min(re/kt,q0(j-z));if(d.beginPath(),d.arc(J,mt,kt-re/2,j+Ne/2,z-Ne/2),Dt>0){const or=Math.min(re/Dt,q0(j-z));d.arc(J,mt,Dt+re/2,z-or/2,j+or/2,!0)}else{const or=Math.min(re/2,kt*q0(j-z));if(pe==="round")d.arc(J,mt,or,z-Jh/2,j+Jh/2,!0);else if(pe==="bevel"){const _r=2*or*or,Fr=-_r*Math.cos(z+Jh/2)+J,zr=-_r*Math.sin(z+Jh/2)+mt,Wr=_r*Math.cos(j+Jh/2)+J,An=_r*Math.sin(j+Jh/2)+mt;d.lineTo(Fr,zr),d.lineTo(Wr,An)}}d.closePath(),d.moveTo(0,0),d.rect(0,0,d.canvas.width,d.canvas.height),d.clip("evenodd")}function Fut(d,l,z){const{startAngle:j,pixelMargin:J,x:mt,y:kt,outerRadius:Dt,innerRadius:Gt}=l;let re=J/Dt;d.beginPath(),d.arc(mt,kt,Dt,j-re,z+re),Gt>J?(re=J/Gt,d.arc(mt,kt,Gt,z+re,j-re,!0)):d.arc(mt,kt,J,z+ap,j-ap),d.closePath(),d.clip()}function Rut(d){return uM(d,["outerStart","outerEnd","innerStart","innerEnd"])}function But(d,l,z,j){const J=Rut(d.options.borderRadius),mt=(z-l)/2,kt=Math.min(mt,j*l/2),Dt=Gt=>{const re=(z-Math.min(mt,Gt))*j/2;return Xp(Gt,0,Math.min(mt,re))};return{outerStart:Dt(J.outerStart),outerEnd:Dt(J.outerEnd),innerStart:Xp(J.innerStart,0,kt),innerEnd:Xp(J.innerEnd,0,kt)}}function Jx(d,l,z,j){return{x:z+d*Math.cos(l),y:j+d*Math.sin(l)}}function v4(d,l,z,j,J,mt){const{x:kt,y:Dt,startAngle:Gt,pixelMargin:re,innerRadius:pe}=l,Ne=Math.max(l.outerRadius+j+z-re,0),or=pe>0?pe+j+z+re:0;let _r=0;const Fr=J-Gt;if(j){const Da=pe>0?pe-j:0,Ni=Ne>0?Ne-j:0,Ei=(Da+Ni)/2,Va=Ei!==0?Fr*Ei/(Ei+j):Fr;_r=(Fr-Va)/2}const zr=Math.max(.001,Fr*Ne-z/Jh)/Ne,Wr=(Fr-zr)/2,An=Gt+Wr+_r,Ft=J-Wr-_r,{outerStart:kn,outerEnd:ei,innerStart:jn,innerEnd:ai}=But(l,or,Ne,Ft-An),Qi=Ne-kn,Gi=Ne-ei,un=An+kn/Qi,ia=Ft-ei/Gi,fa=or+jn,Li=or+ai,yi=An+jn/fa,ra=Ft-ai/Li;if(d.beginPath(),mt){const Da=(un+ia)/2;if(d.arc(kt,Dt,Ne,un,Da),d.arc(kt,Dt,Ne,Da,ia),ei>0){const ss=Jx(Gi,ia,kt,Dt);d.arc(ss.x,ss.y,ei,ia,Ft+ap)}const Ni=Jx(Li,Ft,kt,Dt);if(d.lineTo(Ni.x,Ni.y),ai>0){const ss=Jx(Li,ra,kt,Dt);d.arc(ss.x,ss.y,ai,Ft+ap,ra+Math.PI)}const Ei=(Ft-ai/or+(An+jn/or))/2;if(d.arc(kt,Dt,or,Ft-ai/or,Ei,!0),d.arc(kt,Dt,or,Ei,An+jn/or,!0),jn>0){const ss=Jx(fa,yi,kt,Dt);d.arc(ss.x,ss.y,jn,yi+Math.PI,An-ap)}const Va=Jx(Qi,An,kt,Dt);if(d.lineTo(Va.x,Va.y),kn>0){const ss=Jx(Qi,un,kt,Dt);d.arc(ss.x,ss.y,kn,An-ap,un)}}else{d.moveTo(kt,Dt);const Da=Math.cos(un)*Ne+kt,Ni=Math.sin(un)*Ne+Dt;d.lineTo(Da,Ni);const Ei=Math.cos(ia)*Ne+kt,Va=Math.sin(ia)*Ne+Dt;d.lineTo(Ei,Va)}d.closePath()}function Nut(d,l,z,j,J){const{fullCircles:mt,startAngle:kt,circumference:Dt}=l;let Gt=l.endAngle;if(mt){v4(d,l,z,j,Gt,J);for(let re=0;re<mt;++re)d.fill();isNaN(Dt)||(Gt=kt+(Dt%od||od))}return v4(d,l,z,j,Gt,J),d.fill(),Gt}function jut(d,l,z,j,J){const{fullCircles:mt,startAngle:kt,circumference:Dt,options:Gt}=l,{borderWidth:re,borderJoinStyle:pe,borderDash:Ne,borderDashOffset:or,borderRadius:_r}=Gt,Fr=Gt.borderAlign==="inner";if(!re)return;d.setLineDash(Ne||[]),d.lineDashOffset=or,Fr?(d.lineWidth=re*2,d.lineJoin=pe||"round"):(d.lineWidth=re,d.lineJoin=pe||"bevel");let zr=l.endAngle;if(mt){v4(d,l,z,j,zr,J);for(let Wr=0;Wr<mt;++Wr)d.stroke();isNaN(Dt)||(zr=kt+(Dt%od||od))}Fr&&Fut(d,l,zr),Gt.selfJoin&&zr-kt>=Jh&&_r===0&&pe!=="miter"&&Dut(d,l,zr),mt||(v4(d,l,z,j,zr,J),d.stroke())}class Uut extends lv{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:l=>l!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(l){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,l&&Object.assign(this,l)}inRange(l,z,j){const J=this.getProps(["x","y"],j),{angle:mt,distance:kt}=RO(J,{x:l,y:z}),{startAngle:Dt,endAngle:Gt,innerRadius:re,outerRadius:pe,circumference:Ne}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],j),or=(this.options.spacing+this.options.borderWidth)/2,_r=cc(Ne,Gt-Dt),Fr=H2(mt,Dt,Gt)&&Dt!==Gt,zr=_r>=od||Fr,Wr=ev(kt,re+or,pe+or);return zr&&Wr}getCenterPoint(l){const{x:z,y:j,startAngle:J,endAngle:mt,innerRadius:kt,outerRadius:Dt}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],l),{offset:Gt,spacing:re}=this.options,pe=(J+mt)/2,Ne=(kt+Dt+re+Gt)/2;return{x:z+Math.cos(pe)*Ne,y:j+Math.sin(pe)*Ne}}tooltipPosition(l){return this.getCenterPoint(l)}draw(l){const{options:z,circumference:j}=this,J=(z.offset||0)/4,mt=(z.spacing||0)/2,kt=z.circular;if(this.pixelMargin=z.borderAlign==="inner"?.33:0,this.fullCircles=j>od?Math.floor(j/od):0,j===0||this.innerRadius<0||this.outerRadius<0)return;l.save();const Dt=(this.startAngle+this.endAngle)/2;l.translate(Math.cos(Dt)*J,Math.sin(Dt)*J);const Gt=1-Math.sin(Math.min(Jh,j||0)),re=J*Gt;l.fillStyle=z.backgroundColor,l.strokeStyle=z.borderColor,Nut(l,this,re,mt,kt),jut(l,this,re,mt,kt),l.restore()}}function mD(d,l,z=l){d.lineCap=cc(z.borderCapStyle,l.borderCapStyle),d.setLineDash(cc(z.borderDash,l.borderDash)),d.lineDashOffset=cc(z.borderDashOffset,l.borderDashOffset),d.lineJoin=cc(z.borderJoinStyle,l.borderJoinStyle),d.lineWidth=cc(z.borderWidth,l.borderWidth),d.strokeStyle=cc(z.borderColor,l.borderColor)}function Vut(d,l,z){d.lineTo(z.x,z.y)}function Hut(d){return d.stepped?ust:d.tension||d.cubicInterpolationMode==="monotone"?cst:Vut}function gD(d,l,z={}){const j=d.length,{start:J=0,end:mt=j-1}=z,{start:kt,end:Dt}=l,Gt=Math.max(J,kt),re=Math.min(mt,Dt),pe=J<kt&&mt<kt||J>Dt&&mt>Dt;return{count:j,start:Gt,loop:l.loop,ilen:re<Gt&&!pe?j+re-Gt:re-Gt}}function Wut(d,l,z,j){const{points:J,options:mt}=l,{count:kt,start:Dt,loop:Gt,ilen:re}=gD(J,z,j),pe=Hut(mt);let{move:Ne=!0,reverse:or}=j||{},_r,Fr,zr;for(_r=0;_r<=re;++_r)Fr=J[(Dt+(or?re-_r:_r))%kt],!Fr.skip&&(Ne?(d.moveTo(Fr.x,Fr.y),Ne=!1):pe(d,zr,Fr,or,mt.stepped),zr=Fr);return Gt&&(Fr=J[(Dt+(or?re:0))%kt],pe(d,zr,Fr,or,mt.stepped)),!!Gt}function qut(d,l,z,j){const J=l.points,{count:mt,start:kt,ilen:Dt}=gD(J,z,j),{move:Gt=!0,reverse:re}=j||{};let pe=0,Ne=0,or,_r,Fr,zr,Wr,An;const Ft=ei=>(kt+(re?Dt-ei:ei))%mt,kn=()=>{zr!==Wr&&(d.lineTo(pe,Wr),d.lineTo(pe,zr),d.lineTo(pe,An))};for(Gt&&(_r=J[Ft(0)],d.moveTo(_r.x,_r.y)),or=0;or<=Dt;++or){if(_r=J[Ft(or)],_r.skip)continue;const ei=_r.x,jn=_r.y,ai=ei|0;ai===Fr?(jn<zr?zr=jn:jn>Wr&&(Wr=jn),pe=(Ne*pe+ei)/++Ne):(kn(),d.lineTo(ei,jn),Fr=ai,Ne=0,zr=Wr=jn),An=jn}kn()}function bA(d){const l=d.options,z=l.borderDash&&l.borderDash.length;return!d._decimated&&!d._loop&&!l.tension&&l.cubicInterpolationMode!=="monotone"&&!l.stepped&&!z?qut:Wut}function Zut(d){return d.stepped?Vst:d.tension||d.cubicInterpolationMode==="monotone"?Hst:fy}function $ut(d,l,z,j){let J=l._path;J||(J=l._path=new Path2D,l.path(J,z,j)&&J.closePath()),mD(d,l.options),d.stroke(J)}function Gut(d,l,z,j){const{segments:J,options:mt}=l,kt=bA(l);for(const Dt of J)mD(d,mt,Dt.style),d.beginPath(),kt(d,l,Dt,{start:z,end:z+j-1})&&d.closePath(),d.stroke()}const Yut=typeof Path2D=="function";function Kut(d,l,z,j){Yut&&!l.options.segment?$ut(d,l,z,j):Gut(d,l,z,j)}class Z4 extends lv{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:l=>l!=="borderDash"&&l!=="fill"};constructor(l){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,l&&Object.assign(this,l)}updateControlPoints(l,z){const j=this.options;if((j.tension||j.cubicInterpolationMode==="monotone")&&!j.stepped&&!this._pointsUpdated){const J=j.spanGaps?this._loop:this._fullLoop;Ost(this._points,j,l,J,z),this._pointsUpdated=!0}}set points(l){this._points=l,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Yst(this,this.options.segment))}first(){const l=this.segments,z=this.points;return l.length&&z[l[0].start]}last(){const l=this.segments,z=this.points,j=l.length;return j&&z[l[j-1].end]}interpolate(l,z){const j=this.options,J=l[z],mt=this.points,kt=tD(this,{property:z,start:J,end:J});if(!kt.length)return;const Dt=[],Gt=Zut(j);let re,pe;for(re=0,pe=kt.length;re<pe;++re){const{start:Ne,end:or}=kt[re],_r=mt[Ne],Fr=mt[or];if(_r===Fr){Dt.push(_r);continue}const zr=Math.abs((J-_r[z])/(Fr[z]-_r[z])),Wr=Gt(_r,Fr,zr,j.stepped);Wr[z]=l[z],Dt.push(Wr)}return Dt.length===1?Dt[0]:Dt}pathSegment(l,z,j){return bA(this)(l,this,z,j)}path(l,z,j){const J=this.segments,mt=bA(this);let kt=this._loop;z=z||0,j=j||this.points.length-z;for(const Dt of J)kt&=mt(l,this,Dt,{start:z,end:z+j-1});return!!kt}draw(l,z,j,J){const mt=this.options||{};(this.points||[]).length&&mt.borderWidth&&(l.save(),Kut(l,this,j,J),l.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function BP(d,l,z,j){const J=d.options,{[z]:mt}=d.getProps([z],j);return Math.abs(l-mt)<J.radius+J.hitRadius}class Xut extends lv{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(l){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,l&&Object.assign(this,l)}inRange(l,z,j){const J=this.options,{x:mt,y:kt}=this.getProps(["x","y"],j);return Math.pow(l-mt,2)+Math.pow(z-kt,2)<Math.pow(J.hitRadius+J.radius,2)}inXRange(l,z){return BP(this,l,"x",z)}inYRange(l,z){return BP(this,l,"y",z)}getCenterPoint(l){const{x:z,y:j}=this.getProps(["x","y"],l);return{x:z,y:j}}size(l){l=l||this.options||{};let z=l.radius||0;z=Math.max(z,z&&l.hoverRadius||0);const j=z&&l.borderWidth||0;return(z+j)*2}draw(l,z){const j=this.options;this.skip||j.radius<.1||!W2(this,z,this.size(j)/2)||(l.strokeStyle=j.borderColor,l.lineWidth=j.borderWidth,l.fillStyle=j.backgroundColor,yA(l,j,this.x,this.y))}getRange(){const l=this.options||{};return l.radius+l.hitRadius}}function vD(d,l){const{x:z,y:j,base:J,width:mt,height:kt}=d.getProps(["x","y","base","width","height"],l);let Dt,Gt,re,pe,Ne;return d.horizontal?(Ne=kt/2,Dt=Math.min(z,J),Gt=Math.max(z,J),re=j-Ne,pe=j+Ne):(Ne=mt/2,Dt=z-Ne,Gt=z+Ne,re=Math.min(j,J),pe=Math.max(j,J)),{left:Dt,top:re,right:Gt,bottom:pe}}function h1(d,l,z,j){return d?0:Xp(l,z,j)}function Jut(d,l,z){const j=d.options.borderWidth,J=d.borderSkipped,mt=WO(j);return{t:h1(J.top,mt.top,0,z),r:h1(J.right,mt.right,0,l),b:h1(J.bottom,mt.bottom,0,z),l:h1(J.left,mt.left,0,l)}}function Qut(d,l,z){const{enableBorderRadius:j}=d.getProps(["enableBorderRadius"]),J=d.options.borderRadius,mt=s_(J),kt=Math.min(l,z),Dt=d.borderSkipped,Gt=j||Ec(J);return{topLeft:h1(!Gt||Dt.top||Dt.left,mt.topLeft,0,kt),topRight:h1(!Gt||Dt.top||Dt.right,mt.topRight,0,kt),bottomLeft:h1(!Gt||Dt.bottom||Dt.left,mt.bottomLeft,0,kt),bottomRight:h1(!Gt||Dt.bottom||Dt.right,mt.bottomRight,0,kt)}}function tct(d){const l=vD(d),z=l.right-l.left,j=l.bottom-l.top,J=Jut(d,z/2,j/2),mt=Qut(d,z/2,j/2);return{outer:{x:l.left,y:l.top,w:z,h:j,radius:mt},inner:{x:l.left+J.l,y:l.top+J.t,w:z-J.l-J.r,h:j-J.t-J.b,radius:{topLeft:Math.max(0,mt.topLeft-Math.max(J.t,J.l)),topRight:Math.max(0,mt.topRight-Math.max(J.t,J.r)),bottomLeft:Math.max(0,mt.bottomLeft-Math.max(J.b,J.l)),bottomRight:Math.max(0,mt.bottomRight-Math.max(J.b,J.r))}}}}function j8(d,l,z,j){const J=l===null,mt=z===null,Dt=d&&!(J&&mt)&&vD(d,j);return Dt&&(J||ev(l,Dt.left,Dt.right))&&(mt||ev(z,Dt.top,Dt.bottom))}function ect(d){return d.topLeft||d.topRight||d.bottomLeft||d.bottomRight}function rct(d,l){d.rect(l.x,l.y,l.w,l.h)}function U8(d,l,z={}){const j=d.x!==z.x?-l:0,J=d.y!==z.y?-l:0,mt=(d.x+d.w!==z.x+z.w?l:0)-j,kt=(d.y+d.h!==z.y+z.h?l:0)-J;return{x:d.x+j,y:d.y+J,w:d.w+mt,h:d.h+kt,radius:d.radius}}class nct extends lv{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(l){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,l&&Object.assign(this,l)}draw(l){const{inflateAmount:z,options:{borderColor:j,backgroundColor:J}}=this,{inner:mt,outer:kt}=tct(this),Dt=ect(kt.radius)?p4:rct;l.save(),(kt.w!==mt.w||kt.h!==mt.h)&&(l.beginPath(),Dt(l,U8(kt,z,mt)),l.clip(),Dt(l,U8(mt,-z,kt)),l.fillStyle=j,l.fill("evenodd")),l.beginPath(),Dt(l,U8(mt,z)),l.fillStyle=J,l.fill(),l.restore()}inRange(l,z,j){return j8(this,l,z,j)}inXRange(l,z){return j8(this,l,null,z)}inYRange(l,z){return j8(this,null,l,z)}getCenterPoint(l){const{x:z,y:j,base:J,horizontal:mt}=this.getProps(["x","y","base","horizontal"],l);return{x:mt?(z+J)/2:z,y:mt?j:(j+J)/2}}getRange(l){return l==="x"?this.width/2:this.height/2}}function ict(d,l,z){const j=d.segments,J=d.points,mt=l.points,kt=[];for(const Dt of j){let{start:Gt,end:re}=Dt;re=$4(Gt,re,J);const pe=wA(z,J[Gt],J[re],Dt.loop);if(!l.segments){kt.push({source:Dt,target:pe,start:J[Gt],end:J[re]});continue}const Ne=tD(l,pe);for(const or of Ne){const _r=wA(z,mt[or.start],mt[or.end],or.loop),Fr=QO(Dt,J,_r);for(const zr of Fr)kt.push({source:zr,target:or,start:{[z]:NP(pe,_r,"start",Math.max)},end:{[z]:NP(pe,_r,"end",Math.min)}})}}return kt}function wA(d,l,z,j){if(j)return;let J=l[d],mt=z[d];return d==="angle"&&(J=q0(J),mt=q0(mt)),{property:d,start:J,end:mt}}function act(d,l){const{x:z=null,y:j=null}=d||{},J=l.points,mt=[];return l.segments.forEach(({start:kt,end:Dt})=>{Dt=$4(kt,Dt,J);const Gt=J[kt],re=J[Dt];j!==null?(mt.push({x:Gt.x,y:j}),mt.push({x:re.x,y:j})):z!==null&&(mt.push({x:z,y:Gt.y}),mt.push({x:z,y:re.y}))}),mt}function $4(d,l,z){for(;l>d;l--){const j=z[l];if(!isNaN(j.x)&&!isNaN(j.y))break}return l}function NP(d,l,z,j){return d&&l?j(d[z],l[z]):d?d[z]:l?l[z]:0}function yD(d,l){let z=[],j=!1;return Xd(d)?(j=!0,z=d):z=act(d,l),z.length?new Z4({points:z,options:{tension:0},_loop:j,_fullLoop:j}):null}function jP(d){return d&&d.fill!==!1}function oct(d,l,z){let J=d[l].fill;const mt=[l];let kt;if(!z)return J;for(;J!==!1&&mt.indexOf(J)===-1;){if(!Qp(J))return J;if(kt=d[J],!kt)return!1;if(kt.visible)return J;mt.push(J),J=kt.fill}return!1}function sct(d,l,z){const j=hct(d);if(Ec(j))return isNaN(j.value)?!1:j;let J=parseFloat(j);return Qp(J)&&Math.floor(J)===J?lct(j[0],l,J,z):["origin","start","end","stack","shape"].indexOf(j)>=0&&j}function lct(d,l,z,j){return(d==="-"||d==="+")&&(z=l+z),z===l||z<0||z>=j?!1:z}function uct(d,l){let z=null;return d==="start"?z=l.bottom:d==="end"?z=l.top:Ec(d)?z=l.getPixelForValue(d.value):l.getBasePixel&&(z=l.getBasePixel()),z}function cct(d,l,z){let j;return d==="start"?j=z:d==="end"?j=l.options.reverse?l.min:l.max:Ec(d)?j=d.value:j=l.getBaseValue(),j}function hct(d){const l=d.options,z=l.fill;let j=cc(z&&z.target,z);return j===void 0&&(j=!!l.backgroundColor),j===!1||j===null?!1:j===!0?"origin":j}function fct(d){const{scale:l,index:z,line:j}=d,J=[],mt=j.segments,kt=j.points,Dt=dct(l,z);Dt.push(yD({x:null,y:l.bottom},j));for(let Gt=0;Gt<mt.length;Gt++){const re=mt[Gt];for(let pe=re.start;pe<=re.end;pe++)pct(J,kt[pe],Dt)}return new Z4({points:J,options:{}})}function dct(d,l){const z=[],j=d.getMatchingVisibleMetas("line");for(let J=0;J<j.length;J++){const mt=j[J];if(mt.index===l)break;mt.hidden||z.unshift(mt.dataset)}return z}function pct(d,l,z){const j=[];for(let J=0;J<z.length;J++){const mt=z[J],{first:kt,last:Dt,point:Gt}=mct(mt,l,"x");if(!(!Gt||kt&&Dt)){if(kt)j.unshift(Gt);else if(d.push(Gt),!Dt)break}}d.push(...j)}function mct(d,l,z){const j=d.interpolate(l,z);if(!j)return{};const J=j[z],mt=d.segments,kt=d.points;let Dt=!1,Gt=!1;for(let re=0;re<mt.length;re++){const pe=mt[re],Ne=kt[pe.start][z],or=kt[pe.end][z];if(ev(J,Ne,or)){Dt=J===Ne,Gt=J===or;break}}return{first:Dt,last:Gt,point:j}}class xD{constructor(l){this.x=l.x,this.y=l.y,this.radius=l.radius}pathSegment(l,z,j){const{x:J,y:mt,radius:kt}=this;return z=z||{start:0,end:od},l.arc(J,mt,kt,z.end,z.start,!0),!j.bounds}interpolate(l){const{x:z,y:j,radius:J}=this,mt=l.angle;return{x:z+Math.cos(mt)*J,y:j+Math.sin(mt)*J,angle:mt}}}function gct(d){const{chart:l,fill:z,line:j}=d;if(Qp(z))return vct(l,z);if(z==="stack")return fct(d);if(z==="shape")return!0;const J=yct(d);return J instanceof xD?J:yD(J,j)}function vct(d,l){const z=d.getDatasetMeta(l);return z&&d.isDatasetVisible(l)?z.dataset:null}function yct(d){return(d.scale||{}).getPointPositionForValue?_ct(d):xct(d)}function xct(d){const{scale:l={},fill:z}=d,j=uct(z,l);if(Qp(j)){const J=l.isHorizontal();return{x:J?j:null,y:J?null:j}}return null}function _ct(d){const{scale:l,fill:z}=d,j=l.options,J=l.getLabels().length,mt=j.reverse?l.max:l.min,kt=cct(z,l,mt),Dt=[];if(j.grid.circular){const Gt=l.getPointPositionForValue(0,mt);return new xD({x:Gt.x,y:Gt.y,radius:l.getDistanceFromCenterForValue(kt)})}for(let Gt=0;Gt<J;++Gt)Dt.push(l.getPointPositionForValue(Gt,kt));return Dt}function V8(d,l,z){const j=gct(l),{chart:J,index:mt,line:kt,scale:Dt,axis:Gt}=l,re=kt.options,pe=re.fill,Ne=re.backgroundColor,{above:or=Ne,below:_r=Ne}=pe||{},Fr=J.getDatasetMeta(mt),zr=eD(J,Fr);j&&kt.points.length&&(U4(d,z),bct(d,{line:kt,target:j,above:or,below:_r,area:z,scale:Dt,axis:Gt,clip:zr}),V4(d))}function bct(d,l){const{line:z,target:j,above:J,below:mt,area:kt,scale:Dt,clip:Gt}=l,re=z._loop?"angle":l.axis;d.save();let pe=mt;mt!==J&&(re==="x"?(UP(d,j,kt.top),H8(d,{line:z,target:j,color:J,scale:Dt,property:re,clip:Gt}),d.restore(),d.save(),UP(d,j,kt.bottom)):re==="y"&&(VP(d,j,kt.left),H8(d,{line:z,target:j,color:mt,scale:Dt,property:re,clip:Gt}),d.restore(),d.save(),VP(d,j,kt.right),pe=J)),H8(d,{line:z,target:j,color:pe,scale:Dt,property:re,clip:Gt}),d.restore()}function UP(d,l,z){const{segments:j,points:J}=l;let mt=!0,kt=!1;d.beginPath();for(const Dt of j){const{start:Gt,end:re}=Dt,pe=J[Gt],Ne=J[$4(Gt,re,J)];mt?(d.moveTo(pe.x,pe.y),mt=!1):(d.lineTo(pe.x,z),d.lineTo(pe.x,pe.y)),kt=!!l.pathSegment(d,Dt,{move:kt}),kt?d.closePath():d.lineTo(Ne.x,z)}d.lineTo(l.first().x,z),d.closePath(),d.clip()}function VP(d,l,z){const{segments:j,points:J}=l;let mt=!0,kt=!1;d.beginPath();for(const Dt of j){const{start:Gt,end:re}=Dt,pe=J[Gt],Ne=J[$4(Gt,re,J)];mt?(d.moveTo(pe.x,pe.y),mt=!1):(d.lineTo(z,pe.y),d.lineTo(pe.x,pe.y)),kt=!!l.pathSegment(d,Dt,{move:kt}),kt?d.closePath():d.lineTo(z,Ne.y)}d.lineTo(z,l.first().y),d.closePath(),d.clip()}function H8(d,l){const{line:z,target:j,property:J,color:mt,scale:kt,clip:Dt}=l,Gt=ict(z,j,J);for(const{source:re,target:pe,start:Ne,end:or}of Gt){const{style:{backgroundColor:_r=mt}={}}=re,Fr=j!==!0;d.save(),d.fillStyle=_r,wct(d,kt,Dt,Fr&&wA(J,Ne,or)),d.beginPath();const zr=!!z.pathSegment(d,re);let Wr;if(Fr){zr?d.closePath():HP(d,j,or,J);const An=!!j.pathSegment(d,pe,{move:zr,reverse:!0});Wr=zr&&An,Wr||HP(d,j,Ne,J)}d.closePath(),d.fill(Wr?"evenodd":"nonzero"),d.restore()}}function wct(d,l,z,j){const J=l.chart.chartArea,{property:mt,start:kt,end:Dt}=j||{};if(mt==="x"||mt==="y"){let Gt,re,pe,Ne;mt==="x"?(Gt=kt,re=J.top,pe=Dt,Ne=J.bottom):(Gt=J.left,re=kt,pe=J.right,Ne=Dt),d.beginPath(),z&&(Gt=Math.max(Gt,z.left),pe=Math.min(pe,z.right),re=Math.max(re,z.top),Ne=Math.min(Ne,z.bottom)),d.rect(Gt,re,pe-Gt,Ne-re),d.clip()}}function HP(d,l,z,j){const J=l.interpolate(z,j);J&&d.lineTo(J.x,J.y)}var kct={id:"filler",afterDatasetsUpdate(d,l,z){const j=(d.data.datasets||[]).length,J=[];let mt,kt,Dt,Gt;for(kt=0;kt<j;++kt)mt=d.getDatasetMeta(kt),Dt=mt.dataset,Gt=null,Dt&&Dt.options&&Dt instanceof Z4&&(Gt={visible:d.isDatasetVisible(kt),index:kt,fill:sct(Dt,kt,j),chart:d,axis:mt.controller.options.indexAxis,scale:mt.vScale,line:Dt}),mt.$filler=Gt,J.push(Gt);for(kt=0;kt<j;++kt)Gt=J[kt],!(!Gt||Gt.fill===!1)&&(Gt.fill=oct(J,kt,z.propagate))},beforeDraw(d,l,z){const j=z.drawTime==="beforeDraw",J=d.getSortedVisibleDatasetMetas(),mt=d.chartArea;for(let kt=J.length-1;kt>=0;--kt){const Dt=J[kt].$filler;Dt&&(Dt.line.updateControlPoints(mt,Dt.axis),j&&Dt.fill&&V8(d.ctx,Dt,mt))}},beforeDatasetsDraw(d,l,z){if(z.drawTime!=="beforeDatasetsDraw")return;const j=d.getSortedVisibleDatasetMetas();for(let J=j.length-1;J>=0;--J){const mt=j[J].$filler;jP(mt)&&V8(d.ctx,mt,d.chartArea)}},beforeDatasetDraw(d,l,z){const j=l.meta.$filler;!jP(j)||z.drawTime!=="beforeDatasetDraw"||V8(d.ctx,j,d.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const WP=(d,l)=>{let{boxHeight:z=l,boxWidth:j=l}=d;return d.usePointStyle&&(z=Math.min(z,l),j=d.pointStyleWidth||Math.min(j,l)),{boxWidth:j,boxHeight:z,itemHeight:Math.max(l,z)}},Tct=(d,l)=>d!==null&&l!==null&&d.datasetIndex===l.datasetIndex&&d.index===l.index;class qP extends lv{constructor(l){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=l.chart,this.options=l.options,this.ctx=l.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(l,z,j){this.maxWidth=l,this.maxHeight=z,this._margins=j,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const l=this.options.labels||{};let z=Df(l.generateLabels,[this.chart],this)||[];l.filter&&(z=z.filter(j=>l.filter(j,this.chart.data))),l.sort&&(z=z.sort((j,J)=>l.sort(j,J,this.chart.data))),this.options.reverse&&z.reverse(),this.legendItems=z}fit(){const{options:l,ctx:z}=this;if(!l.display){this.width=this.height=0;return}const j=l.labels,J=Jp(j.font),mt=J.size,kt=this._computeTitleHeight(),{boxWidth:Dt,itemHeight:Gt}=WP(j,mt);let re,pe;z.font=J.string,this.isHorizontal()?(re=this.maxWidth,pe=this._fitRows(kt,mt,Dt,Gt)+10):(pe=this.maxHeight,re=this._fitCols(kt,J,Dt,Gt)+10),this.width=Math.min(re,l.maxWidth||this.maxWidth),this.height=Math.min(pe,l.maxHeight||this.maxHeight)}_fitRows(l,z,j,J){const{ctx:mt,maxWidth:kt,options:{labels:{padding:Dt}}}=this,Gt=this.legendHitBoxes=[],re=this.lineWidths=[0],pe=J+Dt;let Ne=l;mt.textAlign="left",mt.textBaseline="middle";let or=-1,_r=-pe;return this.legendItems.forEach((Fr,zr)=>{const Wr=j+z/2+mt.measureText(Fr.text).width;(zr===0||re[re.length-1]+Wr+2*Dt>kt)&&(Ne+=pe,re[re.length-(zr>0?0:1)]=0,_r+=pe,or++),Gt[zr]={left:0,top:_r,row:or,width:Wr,height:J},re[re.length-1]+=Wr+Dt}),Ne}_fitCols(l,z,j,J){const{ctx:mt,maxHeight:kt,options:{labels:{padding:Dt}}}=this,Gt=this.legendHitBoxes=[],re=this.columnSizes=[],pe=kt-l;let Ne=Dt,or=0,_r=0,Fr=0,zr=0;return this.legendItems.forEach((Wr,An)=>{const{itemWidth:Ft,itemHeight:kn}=Act(j,z,mt,Wr,J);An>0&&_r+kn+2*Dt>pe&&(Ne+=or+Dt,re.push({width:or,height:_r}),Fr+=or+Dt,zr++,or=_r=0),Gt[An]={left:Fr,top:_r,col:zr,width:Ft,height:kn},or=Math.max(or,Ft),_r+=kn+Dt}),Ne+=or,re.push({width:or,height:_r}),Ne}adjustHitBoxes(){if(!this.options.display)return;const l=this._computeTitleHeight(),{legendHitBoxes:z,options:{align:j,labels:{padding:J},rtl:mt}}=this,kt=l_(mt,this.left,this.width);if(this.isHorizontal()){let Dt=0,Gt=Wp(j,this.left+J,this.right-this.lineWidths[Dt]);for(const re of z)Dt!==re.row&&(Dt=re.row,Gt=Wp(j,this.left+J,this.right-this.lineWidths[Dt])),re.top+=this.top+l+J,re.left=kt.leftForLtr(kt.x(Gt),re.width),Gt+=re.width+J}else{let Dt=0,Gt=Wp(j,this.top+l+J,this.bottom-this.columnSizes[Dt].height);for(const re of z)re.col!==Dt&&(Dt=re.col,Gt=Wp(j,this.top+l+J,this.bottom-this.columnSizes[Dt].height)),re.top=Gt,re.left+=this.left+J,re.left=kt.leftForLtr(kt.x(re.left),re.width),Gt+=re.height+J}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const l=this.ctx;U4(l,this),this._draw(),V4(l)}}_draw(){const{options:l,columnSizes:z,lineWidths:j,ctx:J}=this,{align:mt,labels:kt}=l,Dt=Bd.color,Gt=l_(l.rtl,this.left,this.width),re=Jp(kt.font),{padding:pe}=kt,Ne=re.size,or=Ne/2;let _r;this.drawTitle(),J.textAlign=Gt.textAlign("left"),J.textBaseline="middle",J.lineWidth=.5,J.font=re.string;const{boxWidth:Fr,boxHeight:zr,itemHeight:Wr}=WP(kt,Ne),An=function(ai,Qi,Gi){if(isNaN(Fr)||Fr<=0||isNaN(zr)||zr<0)return;J.save();const un=cc(Gi.lineWidth,1);if(J.fillStyle=cc(Gi.fillStyle,Dt),J.lineCap=cc(Gi.lineCap,"butt"),J.lineDashOffset=cc(Gi.lineDashOffset,0),J.lineJoin=cc(Gi.lineJoin,"miter"),J.lineWidth=un,J.strokeStyle=cc(Gi.strokeStyle,Dt),J.setLineDash(cc(Gi.lineDash,[])),kt.usePointStyle){const ia={radius:zr*Math.SQRT2/2,pointStyle:Gi.pointStyle,rotation:Gi.rotation,borderWidth:un},fa=Gt.xPlus(ai,Fr/2),Li=Qi+or;HO(J,ia,fa,Li,kt.pointStyleWidth&&Fr)}else{const ia=Qi+Math.max((Ne-zr)/2,0),fa=Gt.leftForLtr(ai,Fr),Li=s_(Gi.borderRadius);J.beginPath(),Object.values(Li).some(yi=>yi!==0)?p4(J,{x:fa,y:ia,w:Fr,h:zr,radius:Li}):J.rect(fa,ia,Fr,zr),J.fill(),un!==0&&J.stroke()}J.restore()},Ft=function(ai,Qi,Gi){q2(J,Gi.text,ai,Qi+Wr/2,re,{strikethrough:Gi.hidden,textAlign:Gt.textAlign(Gi.textAlign)})},kn=this.isHorizontal(),ei=this._computeTitleHeight();kn?_r={x:Wp(mt,this.left+pe,this.right-j[0]),y:this.top+pe+ei,line:0}:_r={x:this.left+pe,y:Wp(mt,this.top+ei+pe,this.bottom-z[0].height),line:0},KO(this.ctx,l.textDirection);const jn=Wr+pe;this.legendItems.forEach((ai,Qi)=>{J.strokeStyle=ai.fontColor,J.fillStyle=ai.fontColor;const Gi=J.measureText(ai.text).width,un=Gt.textAlign(ai.textAlign||(ai.textAlign=kt.textAlign)),ia=Fr+or+Gi;let fa=_r.x,Li=_r.y;Gt.setWidth(this.width),kn?Qi>0&&fa+ia+pe>this.right&&(Li=_r.y+=jn,_r.line++,fa=_r.x=Wp(mt,this.left+pe,this.right-j[_r.line])):Qi>0&&Li+jn>this.bottom&&(fa=_r.x=fa+z[_r.line].width+pe,_r.line++,Li=_r.y=Wp(mt,this.top+ei+pe,this.bottom-z[_r.line].height));const yi=Gt.x(fa);if(An(yi,Li,ai),fa=Kot(un,fa+Fr+or,kn?fa+ia:this.right,l.rtl),Ft(Gt.x(fa),Li,ai),kn)_r.x+=ia+pe;else if(typeof ai.text!="string"){const ra=re.lineHeight;_r.y+=_D(ai,ra)+pe}else _r.y+=jn}),XO(this.ctx,l.textDirection)}drawTitle(){const l=this.options,z=l.title,j=Jp(z.font),J=fm(z.padding);if(!z.display)return;const mt=l_(l.rtl,this.left,this.width),kt=this.ctx,Dt=z.position,Gt=j.size/2,re=J.top+Gt;let pe,Ne=this.left,or=this.width;if(this.isHorizontal())or=Math.max(...this.lineWidths),pe=this.top+re,Ne=Wp(l.align,Ne,this.right-or);else{const Fr=this.columnSizes.reduce((zr,Wr)=>Math.max(zr,Wr.height),0);pe=re+Wp(l.align,this.top,this.bottom-Fr-l.labels.padding-this._computeTitleHeight())}const _r=Wp(Dt,Ne,Ne+or);kt.textAlign=mt.textAlign(oM(Dt)),kt.textBaseline="middle",kt.strokeStyle=z.color,kt.fillStyle=z.color,kt.font=j.string,q2(kt,z.text,_r,pe,j)}_computeTitleHeight(){const l=this.options.title,z=Jp(l.font),j=fm(l.padding);return l.display?z.lineHeight+j.height:0}_getLegendItemAt(l,z){let j,J,mt;if(ev(l,this.left,this.right)&&ev(z,this.top,this.bottom)){for(mt=this.legendHitBoxes,j=0;j<mt.length;++j)if(J=mt[j],ev(l,J.left,J.left+J.width)&&ev(z,J.top,J.top+J.height))return this.legendItems[j]}return null}handleEvent(l){const z=this.options;if(!Ect(l.type,z))return;const j=this._getLegendItemAt(l.x,l.y);if(l.type==="mousemove"||l.type==="mouseout"){const J=this._hoveredItem,mt=Tct(J,j);J&&!mt&&Df(z.onLeave,[l,J,this],this),this._hoveredItem=j,j&&!mt&&Df(z.onHover,[l,j,this],this)}else j&&Df(z.onClick,[l,j,this],this)}}function Act(d,l,z,j,J){const mt=Mct(j,d,l,z),kt=Sct(J,j,l.lineHeight);return{itemWidth:mt,itemHeight:kt}}function Mct(d,l,z,j){let J=d.text;return J&&typeof J!="string"&&(J=J.reduce((mt,kt)=>mt.length>kt.length?mt:kt)),l+z.size/2+j.measureText(J).width}function Sct(d,l,z){let j=d;return typeof l.text!="string"&&(j=_D(l,z)),j}function _D(d,l){const z=d.text?d.text.length:0;return l*z}function Ect(d,l){return!!((d==="mousemove"||d==="mouseout")&&(l.onHover||l.onLeave)||l.onClick&&(d==="click"||d==="mouseup"))}var Cct={id:"legend",_element:qP,start(d,l,z){const j=d.legend=new qP({ctx:d.ctx,options:z,chart:d});om.configure(d,j,z),om.addBox(d,j)},stop(d){om.removeBox(d,d.legend),delete d.legend},beforeUpdate(d,l,z){const j=d.legend;om.configure(d,j,z),j.options=z},afterUpdate(d){const l=d.legend;l.buildLabels(),l.adjustHitBoxes()},afterEvent(d,l){l.replay||d.legend.handleEvent(l.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(d,l,z){const j=l.datasetIndex,J=z.chart;J.isDatasetVisible(j)?(J.hide(j),l.hidden=!0):(J.show(j),l.hidden=!1)},onHover:null,onLeave:null,labels:{color:d=>d.chart.options.color,boxWidth:40,padding:10,generateLabels(d){const l=d.data.datasets,{labels:{usePointStyle:z,pointStyle:j,textAlign:J,color:mt,useBorderRadius:kt,borderRadius:Dt}}=d.legend.options;return d._getSortedDatasetMetas().map(Gt=>{const re=Gt.controller.getStyle(z?0:void 0),pe=fm(re.borderWidth);return{text:l[Gt.index].label,fillStyle:re.backgroundColor,fontColor:mt,hidden:!Gt.visible,lineCap:re.borderCapStyle,lineDash:re.borderDash,lineDashOffset:re.borderDashOffset,lineJoin:re.borderJoinStyle,lineWidth:(pe.width+pe.height)/4,strokeStyle:re.borderColor,pointStyle:j||re.pointStyle,rotation:re.rotation,textAlign:J||re.textAlign,borderRadius:kt&&(Dt||re.borderRadius),datasetIndex:Gt.index}},this)}},title:{color:d=>d.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:d=>!d.startsWith("on"),labels:{_scriptable:d=>!["generateLabels","filter","sort"].includes(d)}}};class bD extends lv{constructor(l){super(),this.chart=l.chart,this.options=l.options,this.ctx=l.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(l,z){const j=this.options;if(this.left=0,this.top=0,!j.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=l,this.height=this.bottom=z;const J=Xd(j.text)?j.text.length:1;this._padding=fm(j.padding);const mt=J*Jp(j.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=mt:this.width=mt}isHorizontal(){const l=this.options.position;return l==="top"||l==="bottom"}_drawArgs(l){const{top:z,left:j,bottom:J,right:mt,options:kt}=this,Dt=kt.align;let Gt=0,re,pe,Ne;return this.isHorizontal()?(pe=Wp(Dt,j,mt),Ne=z+l,re=mt-j):(kt.position==="left"?(pe=j+l,Ne=Wp(Dt,J,z),Gt=Jh*-.5):(pe=mt-l,Ne=Wp(Dt,z,J),Gt=Jh*.5),re=J-z),{titleX:pe,titleY:Ne,maxWidth:re,rotation:Gt}}draw(){const l=this.ctx,z=this.options;if(!z.display)return;const j=Jp(z.font),mt=j.lineHeight/2+this._padding.top,{titleX:kt,titleY:Dt,maxWidth:Gt,rotation:re}=this._drawArgs(mt);q2(l,z.text,0,0,j,{color:z.color,maxWidth:Gt,rotation:re,textAlign:oM(z.align),textBaseline:"middle",translation:[kt,Dt]})}}function Lct(d,l){const z=new bD({ctx:d.ctx,options:l,chart:d});om.configure(d,z,l),om.addBox(d,z),d.titleBlock=z}var Pct={id:"title",_element:bD,start(d,l,z){Lct(d,z)},stop(d){const l=d.titleBlock;om.removeBox(d,l),delete d.titleBlock},beforeUpdate(d,l,z){const j=d.titleBlock;om.configure(d,j,z),j.options=z},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const p2={average(d){if(!d.length)return!1;let l,z,j=new Set,J=0,mt=0;for(l=0,z=d.length;l<z;++l){const Dt=d[l].element;if(Dt&&Dt.hasValue()){const Gt=Dt.tooltipPosition();j.add(Gt.x),J+=Gt.y,++mt}}return mt===0||j.size===0?!1:{x:[...j].reduce((Dt,Gt)=>Dt+Gt)/j.size,y:J/mt}},nearest(d,l){if(!d.length)return!1;let z=l.x,j=l.y,J=Number.POSITIVE_INFINITY,mt,kt,Dt;for(mt=0,kt=d.length;mt<kt;++mt){const Gt=d[mt].element;if(Gt&&Gt.hasValue()){const re=Gt.getCenterPoint(),pe=gA(l,re);pe<J&&(J=pe,Dt=Gt)}}if(Dt){const Gt=Dt.tooltipPosition();z=Gt.x,j=Gt.y}return{x:z,y:j}}};function ng(d,l){return l&&(Xd(l)?Array.prototype.push.apply(d,l):d.push(l)),d}function Yg(d){return(typeof d=="string"||d instanceof String)&&d.indexOf(`
`)>-1?d.split(`
`):d}function zct(d,l){const{element:z,datasetIndex:j,index:J}=l,mt=d.getDatasetMeta(j).controller,{label:kt,value:Dt}=mt.getLabelAndValue(J);return{chart:d,label:kt,parsed:mt.getParsed(J),raw:d.data.datasets[j].data[J],formattedValue:Dt,dataset:mt.getDataset(),dataIndex:J,datasetIndex:j,element:z}}function ZP(d,l){const z=d.chart.ctx,{body:j,footer:J,title:mt}=d,{boxWidth:kt,boxHeight:Dt}=l,Gt=Jp(l.bodyFont),re=Jp(l.titleFont),pe=Jp(l.footerFont),Ne=mt.length,or=J.length,_r=j.length,Fr=fm(l.padding);let zr=Fr.height,Wr=0,An=j.reduce((ei,jn)=>ei+jn.before.length+jn.lines.length+jn.after.length,0);if(An+=d.beforeBody.length+d.afterBody.length,Ne&&(zr+=Ne*re.lineHeight+(Ne-1)*l.titleSpacing+l.titleMarginBottom),An){const ei=l.displayColors?Math.max(Dt,Gt.lineHeight):Gt.lineHeight;zr+=_r*ei+(An-_r)*Gt.lineHeight+(An-1)*l.bodySpacing}or&&(zr+=l.footerMarginTop+or*pe.lineHeight+(or-1)*l.footerSpacing);let Ft=0;const kn=function(ei){Wr=Math.max(Wr,z.measureText(ei).width+Ft)};return z.save(),z.font=re.string,Kh(d.title,kn),z.font=Gt.string,Kh(d.beforeBody.concat(d.afterBody),kn),Ft=l.displayColors?kt+2+l.boxPadding:0,Kh(j,ei=>{Kh(ei.before,kn),Kh(ei.lines,kn),Kh(ei.after,kn)}),Ft=0,z.font=pe.string,Kh(d.footer,kn),z.restore(),Wr+=Fr.width,{width:Wr,height:zr}}function Ict(d,l){const{y:z,height:j}=l;return z<j/2?"top":z>d.height-j/2?"bottom":"center"}function Oct(d,l,z,j){const{x:J,width:mt}=j,kt=z.caretSize+z.caretPadding;if(d==="left"&&J+mt+kt>l.width||d==="right"&&J-mt-kt<0)return!0}function Dct(d,l,z,j){const{x:J,width:mt}=z,{width:kt,chartArea:{left:Dt,right:Gt}}=d;let re="center";return j==="center"?re=J<=(Dt+Gt)/2?"left":"right":J<=mt/2?re="left":J>=kt-mt/2&&(re="right"),Oct(re,d,l,z)&&(re="center"),re}function $P(d,l,z){const j=z.yAlign||l.yAlign||Ict(d,z);return{xAlign:z.xAlign||l.xAlign||Dct(d,l,z,j),yAlign:j}}function Fct(d,l){let{x:z,width:j}=d;return l==="right"?z-=j:l==="center"&&(z-=j/2),z}function Rct(d,l,z){let{y:j,height:J}=d;return l==="top"?j+=z:l==="bottom"?j-=J+z:j-=J/2,j}function GP(d,l,z,j){const{caretSize:J,caretPadding:mt,cornerRadius:kt}=d,{xAlign:Dt,yAlign:Gt}=z,re=J+mt,{topLeft:pe,topRight:Ne,bottomLeft:or,bottomRight:_r}=s_(kt);let Fr=Fct(l,Dt);const zr=Rct(l,Gt,re);return Gt==="center"?Dt==="left"?Fr+=re:Dt==="right"&&(Fr-=re):Dt==="left"?Fr-=Math.max(pe,or)+J:Dt==="right"&&(Fr+=Math.max(Ne,_r)+J),{x:Xp(Fr,0,j.width-l.width),y:Xp(zr,0,j.height-l.height)}}function B5(d,l,z){const j=fm(z.padding);return l==="center"?d.x+d.width/2:l==="right"?d.x+d.width-j.right:d.x+j.left}function YP(d){return ng([],Yg(d))}function Bct(d,l,z){return Cy(d,{tooltip:l,tooltipItems:z,type:"tooltip"})}function KP(d,l){const z=l&&l.dataset&&l.dataset.tooltip&&l.dataset.tooltip.callbacks;return z?d.override(z):d}const wD={beforeTitle:$g,title(d){if(d.length>0){const l=d[0],z=l.chart.data.labels,j=z?z.length:0;if(this&&this.options&&this.options.mode==="dataset")return l.dataset.label||"";if(l.label)return l.label;if(j>0&&l.dataIndex<j)return z[l.dataIndex]}return""},afterTitle:$g,beforeBody:$g,beforeLabel:$g,label(d){if(this&&this.options&&this.options.mode==="dataset")return d.label+": "+d.formattedValue||d.formattedValue;let l=d.dataset.label||"";l&&(l+=": ");const z=d.formattedValue;return Rh(z)||(l+=z),l},labelColor(d){const z=d.chart.getDatasetMeta(d.datasetIndex).controller.getStyle(d.dataIndex);return{borderColor:z.borderColor,backgroundColor:z.backgroundColor,borderWidth:z.borderWidth,borderDash:z.borderDash,borderDashOffset:z.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(d){const z=d.chart.getDatasetMeta(d.datasetIndex).controller.getStyle(d.dataIndex);return{pointStyle:z.pointStyle,rotation:z.rotation}},afterLabel:$g,afterBody:$g,beforeFooter:$g,footer:$g,afterFooter:$g};function A0(d,l,z,j){const J=d[l].call(z,j);return typeof J>"u"?wD[l].call(z,j):J}class XP extends lv{static positioners=p2;constructor(l){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=l.chart,this.options=l.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(l){this.options=l,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const l=this._cachedAnimations;if(l)return l;const z=this.chart,j=this.options.setContext(this.getContext()),J=j.enabled&&z.options.animation&&j.animations,mt=new rD(this.chart,J);return J._cacheable&&(this._cachedAnimations=Object.freeze(mt)),mt}getContext(){return this.$context||(this.$context=Bct(this.chart.getContext(),this,this._tooltipItems))}getTitle(l,z){const{callbacks:j}=z,J=A0(j,"beforeTitle",this,l),mt=A0(j,"title",this,l),kt=A0(j,"afterTitle",this,l);let Dt=[];return Dt=ng(Dt,Yg(J)),Dt=ng(Dt,Yg(mt)),Dt=ng(Dt,Yg(kt)),Dt}getBeforeBody(l,z){return YP(A0(z.callbacks,"beforeBody",this,l))}getBody(l,z){const{callbacks:j}=z,J=[];return Kh(l,mt=>{const kt={before:[],lines:[],after:[]},Dt=KP(j,mt);ng(kt.before,Yg(A0(Dt,"beforeLabel",this,mt))),ng(kt.lines,A0(Dt,"label",this,mt)),ng(kt.after,Yg(A0(Dt,"afterLabel",this,mt))),J.push(kt)}),J}getAfterBody(l,z){return YP(A0(z.callbacks,"afterBody",this,l))}getFooter(l,z){const{callbacks:j}=z,J=A0(j,"beforeFooter",this,l),mt=A0(j,"footer",this,l),kt=A0(j,"afterFooter",this,l);let Dt=[];return Dt=ng(Dt,Yg(J)),Dt=ng(Dt,Yg(mt)),Dt=ng(Dt,Yg(kt)),Dt}_createItems(l){const z=this._active,j=this.chart.data,J=[],mt=[],kt=[];let Dt=[],Gt,re;for(Gt=0,re=z.length;Gt<re;++Gt)Dt.push(zct(this.chart,z[Gt]));return l.filter&&(Dt=Dt.filter((pe,Ne,or)=>l.filter(pe,Ne,or,j))),l.itemSort&&(Dt=Dt.sort((pe,Ne)=>l.itemSort(pe,Ne,j))),Kh(Dt,pe=>{const Ne=KP(l.callbacks,pe);J.push(A0(Ne,"labelColor",this,pe)),mt.push(A0(Ne,"labelPointStyle",this,pe)),kt.push(A0(Ne,"labelTextColor",this,pe))}),this.labelColors=J,this.labelPointStyles=mt,this.labelTextColors=kt,this.dataPoints=Dt,Dt}update(l,z){const j=this.options.setContext(this.getContext()),J=this._active;let mt,kt=[];if(!J.length)this.opacity!==0&&(mt={opacity:0});else{const Dt=p2[j.position].call(this,J,this._eventPosition);kt=this._createItems(j),this.title=this.getTitle(kt,j),this.beforeBody=this.getBeforeBody(kt,j),this.body=this.getBody(kt,j),this.afterBody=this.getAfterBody(kt,j),this.footer=this.getFooter(kt,j);const Gt=this._size=ZP(this,j),re=Object.assign({},Dt,Gt),pe=$P(this.chart,j,re),Ne=GP(j,re,pe,this.chart);this.xAlign=pe.xAlign,this.yAlign=pe.yAlign,mt={opacity:1,x:Ne.x,y:Ne.y,width:Gt.width,height:Gt.height,caretX:Dt.x,caretY:Dt.y}}this._tooltipItems=kt,this.$context=void 0,mt&&this._resolveAnimations().update(this,mt),l&&j.external&&j.external.call(this,{chart:this.chart,tooltip:this,replay:z})}drawCaret(l,z,j,J){const mt=this.getCaretPosition(l,j,J);z.lineTo(mt.x1,mt.y1),z.lineTo(mt.x2,mt.y2),z.lineTo(mt.x3,mt.y3)}getCaretPosition(l,z,j){const{xAlign:J,yAlign:mt}=this,{caretSize:kt,cornerRadius:Dt}=j,{topLeft:Gt,topRight:re,bottomLeft:pe,bottomRight:Ne}=s_(Dt),{x:or,y:_r}=l,{width:Fr,height:zr}=z;let Wr,An,Ft,kn,ei,jn;return mt==="center"?(ei=_r+zr/2,J==="left"?(Wr=or,An=Wr-kt,kn=ei+kt,jn=ei-kt):(Wr=or+Fr,An=Wr+kt,kn=ei-kt,jn=ei+kt),Ft=Wr):(J==="left"?An=or+Math.max(Gt,pe)+kt:J==="right"?An=or+Fr-Math.max(re,Ne)-kt:An=this.caretX,mt==="top"?(kn=_r,ei=kn-kt,Wr=An-kt,Ft=An+kt):(kn=_r+zr,ei=kn+kt,Wr=An+kt,Ft=An-kt),jn=kn),{x1:Wr,x2:An,x3:Ft,y1:kn,y2:ei,y3:jn}}drawTitle(l,z,j){const J=this.title,mt=J.length;let kt,Dt,Gt;if(mt){const re=l_(j.rtl,this.x,this.width);for(l.x=B5(this,j.titleAlign,j),z.textAlign=re.textAlign(j.titleAlign),z.textBaseline="middle",kt=Jp(j.titleFont),Dt=j.titleSpacing,z.fillStyle=j.titleColor,z.font=kt.string,Gt=0;Gt<mt;++Gt)z.fillText(J[Gt],re.x(l.x),l.y+kt.lineHeight/2),l.y+=kt.lineHeight+Dt,Gt+1===mt&&(l.y+=j.titleMarginBottom-Dt)}}_drawColorBox(l,z,j,J,mt){const kt=this.labelColors[j],Dt=this.labelPointStyles[j],{boxHeight:Gt,boxWidth:re}=mt,pe=Jp(mt.bodyFont),Ne=B5(this,"left",mt),or=J.x(Ne),_r=Gt<pe.lineHeight?(pe.lineHeight-Gt)/2:0,Fr=z.y+_r;if(mt.usePointStyle){const zr={radius:Math.min(re,Gt)/2,pointStyle:Dt.pointStyle,rotation:Dt.rotation,borderWidth:1},Wr=J.leftForLtr(or,re)+re/2,An=Fr+Gt/2;l.strokeStyle=mt.multiKeyBackground,l.fillStyle=mt.multiKeyBackground,yA(l,zr,Wr,An),l.strokeStyle=kt.borderColor,l.fillStyle=kt.backgroundColor,yA(l,zr,Wr,An)}else{l.lineWidth=Ec(kt.borderWidth)?Math.max(...Object.values(kt.borderWidth)):kt.borderWidth||1,l.strokeStyle=kt.borderColor,l.setLineDash(kt.borderDash||[]),l.lineDashOffset=kt.borderDashOffset||0;const zr=J.leftForLtr(or,re),Wr=J.leftForLtr(J.xPlus(or,1),re-2),An=s_(kt.borderRadius);Object.values(An).some(Ft=>Ft!==0)?(l.beginPath(),l.fillStyle=mt.multiKeyBackground,p4(l,{x:zr,y:Fr,w:re,h:Gt,radius:An}),l.fill(),l.stroke(),l.fillStyle=kt.backgroundColor,l.beginPath(),p4(l,{x:Wr,y:Fr+1,w:re-2,h:Gt-2,radius:An}),l.fill()):(l.fillStyle=mt.multiKeyBackground,l.fillRect(zr,Fr,re,Gt),l.strokeRect(zr,Fr,re,Gt),l.fillStyle=kt.backgroundColor,l.fillRect(Wr,Fr+1,re-2,Gt-2))}l.fillStyle=this.labelTextColors[j]}drawBody(l,z,j){const{body:J}=this,{bodySpacing:mt,bodyAlign:kt,displayColors:Dt,boxHeight:Gt,boxWidth:re,boxPadding:pe}=j,Ne=Jp(j.bodyFont);let or=Ne.lineHeight,_r=0;const Fr=l_(j.rtl,this.x,this.width),zr=function(Gi){z.fillText(Gi,Fr.x(l.x+_r),l.y+or/2),l.y+=or+mt},Wr=Fr.textAlign(kt);let An,Ft,kn,ei,jn,ai,Qi;for(z.textAlign=kt,z.textBaseline="middle",z.font=Ne.string,l.x=B5(this,Wr,j),z.fillStyle=j.bodyColor,Kh(this.beforeBody,zr),_r=Dt&&Wr!=="right"?kt==="center"?re/2+pe:re+2+pe:0,ei=0,ai=J.length;ei<ai;++ei){for(An=J[ei],Ft=this.labelTextColors[ei],z.fillStyle=Ft,Kh(An.before,zr),kn=An.lines,Dt&&kn.length&&(this._drawColorBox(z,l,ei,Fr,j),or=Math.max(Ne.lineHeight,Gt)),jn=0,Qi=kn.length;jn<Qi;++jn)zr(kn[jn]),or=Ne.lineHeight;Kh(An.after,zr)}_r=0,or=Ne.lineHeight,Kh(this.afterBody,zr),l.y-=mt}drawFooter(l,z,j){const J=this.footer,mt=J.length;let kt,Dt;if(mt){const Gt=l_(j.rtl,this.x,this.width);for(l.x=B5(this,j.footerAlign,j),l.y+=j.footerMarginTop,z.textAlign=Gt.textAlign(j.footerAlign),z.textBaseline="middle",kt=Jp(j.footerFont),z.fillStyle=j.footerColor,z.font=kt.string,Dt=0;Dt<mt;++Dt)z.fillText(J[Dt],Gt.x(l.x),l.y+kt.lineHeight/2),l.y+=kt.lineHeight+j.footerSpacing}}drawBackground(l,z,j,J){const{xAlign:mt,yAlign:kt}=this,{x:Dt,y:Gt}=l,{width:re,height:pe}=j,{topLeft:Ne,topRight:or,bottomLeft:_r,bottomRight:Fr}=s_(J.cornerRadius);z.fillStyle=J.backgroundColor,z.strokeStyle=J.borderColor,z.lineWidth=J.borderWidth,z.beginPath(),z.moveTo(Dt+Ne,Gt),kt==="top"&&this.drawCaret(l,z,j,J),z.lineTo(Dt+re-or,Gt),z.quadraticCurveTo(Dt+re,Gt,Dt+re,Gt+or),kt==="center"&&mt==="right"&&this.drawCaret(l,z,j,J),z.lineTo(Dt+re,Gt+pe-Fr),z.quadraticCurveTo(Dt+re,Gt+pe,Dt+re-Fr,Gt+pe),kt==="bottom"&&this.drawCaret(l,z,j,J),z.lineTo(Dt+_r,Gt+pe),z.quadraticCurveTo(Dt,Gt+pe,Dt,Gt+pe-_r),kt==="center"&&mt==="left"&&this.drawCaret(l,z,j,J),z.lineTo(Dt,Gt+Ne),z.quadraticCurveTo(Dt,Gt,Dt+Ne,Gt),z.closePath(),z.fill(),J.borderWidth>0&&z.stroke()}_updateAnimationTarget(l){const z=this.chart,j=this.$animations,J=j&&j.x,mt=j&&j.y;if(J||mt){const kt=p2[l.position].call(this,this._active,this._eventPosition);if(!kt)return;const Dt=this._size=ZP(this,l),Gt=Object.assign({},kt,this._size),re=$P(z,l,Gt),pe=GP(l,Gt,re,z);(J._to!==pe.x||mt._to!==pe.y)&&(this.xAlign=re.xAlign,this.yAlign=re.yAlign,this.width=Dt.width,this.height=Dt.height,this.caretX=kt.x,this.caretY=kt.y,this._resolveAnimations().update(this,pe))}}_willRender(){return!!this.opacity}draw(l){const z=this.options.setContext(this.getContext());let j=this.opacity;if(!j)return;this._updateAnimationTarget(z);const J={width:this.width,height:this.height},mt={x:this.x,y:this.y};j=Math.abs(j)<.001?0:j;const kt=fm(z.padding),Dt=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;z.enabled&&Dt&&(l.save(),l.globalAlpha=j,this.drawBackground(mt,l,J,z),KO(l,z.textDirection),mt.y+=kt.top,this.drawTitle(mt,l,z),this.drawBody(mt,l,z),this.drawFooter(mt,l,z),XO(l,z.textDirection),l.restore())}getActiveElements(){return this._active||[]}setActiveElements(l,z){const j=this._active,J=l.map(({datasetIndex:Dt,index:Gt})=>{const re=this.chart.getDatasetMeta(Dt);if(!re)throw new Error("Cannot find a dataset at index "+Dt);return{datasetIndex:Dt,element:re.data[Gt],index:Gt}}),mt=!h4(j,J),kt=this._positionChanged(J,z);(mt||kt)&&(this._active=J,this._eventPosition=z,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(l,z,j=!0){if(z&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const J=this.options,mt=this._active||[],kt=this._getActiveElements(l,mt,z,j),Dt=this._positionChanged(kt,l),Gt=z||!h4(kt,mt)||Dt;return Gt&&(this._active=kt,(J.enabled||J.external)&&(this._eventPosition={x:l.x,y:l.y},this.update(!0,z))),Gt}_getActiveElements(l,z,j,J){const mt=this.options;if(l.type==="mouseout")return[];if(!J)return z.filter(Dt=>this.chart.data.datasets[Dt.datasetIndex]&&this.chart.getDatasetMeta(Dt.datasetIndex).controller.getParsed(Dt.index)!==void 0);const kt=this.chart.getElementsAtEventForMode(l,mt.mode,mt,j);return mt.reverse&&kt.reverse(),kt}_positionChanged(l,z){const{caretX:j,caretY:J,options:mt}=this,kt=p2[mt.position].call(this,l,z);return kt!==!1&&(j!==kt.x||J!==kt.y)}}var Nct={id:"tooltip",_element:XP,positioners:p2,afterInit(d,l,z){z&&(d.tooltip=new XP({chart:d,options:z}))},beforeUpdate(d,l,z){d.tooltip&&d.tooltip.initialize(z)},reset(d,l,z){d.tooltip&&d.tooltip.initialize(z)},afterDraw(d){const l=d.tooltip;if(l&&l._willRender()){const z={tooltip:l};if(d.notifyPlugins("beforeTooltipDraw",{...z,cancelable:!0})===!1)return;l.draw(d.ctx),d.notifyPlugins("afterTooltipDraw",z)}},afterEvent(d,l){if(d.tooltip){const z=l.replay;d.tooltip.handleEvent(l.event,z,l.inChartArea)&&(l.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(d,l)=>l.bodyFont.size,boxWidth:(d,l)=>l.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:wD},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:d=>d!=="filter"&&d!=="itemSort"&&d!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const jct=(d,l,z,j)=>(typeof l=="string"?(z=d.push(l)-1,j.unshift({index:z,label:l})):isNaN(l)&&(z=null),z);function Uct(d,l,z,j){const J=d.indexOf(l);if(J===-1)return jct(d,l,z,j);const mt=d.lastIndexOf(l);return J!==mt?z:J}const Vct=(d,l)=>d===null?null:Xp(Math.round(d),0,l);function JP(d){const l=this.getLabels();return d>=0&&d<l.length?l[d]:d}class Hct extends __{static id="category";static defaults={ticks:{callback:JP}};constructor(l){super(l),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(l){const z=this._addedLabels;if(z.length){const j=this.getLabels();for(const{index:J,label:mt}of z)j[J]===mt&&j.splice(J,1);this._addedLabels=[]}super.init(l)}parse(l,z){if(Rh(l))return null;const j=this.getLabels();return z=isFinite(z)&&j[z]===l?z:Uct(j,l,cc(z,l),this._addedLabels),Vct(z,j.length-1)}determineDataLimits(){const{minDefined:l,maxDefined:z}=this.getUserBounds();let{min:j,max:J}=this.getMinMax(!0);this.options.bounds==="ticks"&&(l||(j=0),z||(J=this.getLabels().length-1)),this.min=j,this.max=J}buildTicks(){const l=this.min,z=this.max,j=this.options.offset,J=[];let mt=this.getLabels();mt=l===0&&z===mt.length-1?mt:mt.slice(l,z+1),this._valueRange=Math.max(mt.length-(j?0:1),1),this._startValue=this.min-(j?.5:0);for(let kt=l;kt<=z;kt++)J.push({value:kt});return J}getLabelForValue(l){return JP.call(this,l)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(l){return typeof l!="number"&&(l=this.parse(l)),l===null?NaN:this.getPixelForDecimal((l-this._startValue)/this._valueRange)}getPixelForTick(l){const z=this.ticks;return l<0||l>z.length-1?null:this.getPixelForValue(z[l].value)}getValueForPixel(l){return Math.round(this._startValue+this.getDecimalForPixel(l)*this._valueRange)}getBasePixel(){return this.bottom}}function Wct(d,l){const z=[],{bounds:J,step:mt,min:kt,max:Dt,precision:Gt,count:re,maxTicks:pe,maxDigits:Ne,includeBounds:or}=d,_r=mt||1,Fr=pe-1,{min:zr,max:Wr}=l,An=!Rh(kt),Ft=!Rh(Dt),kn=!Rh(re),ei=(Wr-zr)/(Ne+1);let jn=GL((Wr-zr)/Fr/_r)*_r,ai,Qi,Gi,un;if(jn<1e-14&&!An&&!Ft)return[{value:zr},{value:Wr}];un=Math.ceil(Wr/jn)-Math.floor(zr/jn),un>Fr&&(jn=GL(un*jn/Fr/_r)*_r),Rh(Gt)||(ai=Math.pow(10,Gt),jn=Math.ceil(jn*ai)/ai),J==="ticks"?(Qi=Math.floor(zr/jn)*jn,Gi=Math.ceil(Wr/jn)*jn):(Qi=zr,Gi=Wr),An&&Ft&&mt&&Uot((Dt-kt)/mt,jn/1e3)?(un=Math.round(Math.min((Dt-kt)/jn,pe)),jn=(Dt-kt)/un,Qi=kt,Gi=Dt):kn?(Qi=An?kt:Qi,Gi=Ft?Dt:Gi,un=re-1,jn=(Gi-Qi)/un):(un=(Gi-Qi)/jn,A2(un,Math.round(un),jn/1e3)?un=Math.round(un):un=Math.ceil(un));const ia=Math.max(YL(jn),YL(Qi));ai=Math.pow(10,Rh(Gt)?ia:Gt),Qi=Math.round(Qi*ai)/ai,Gi=Math.round(Gi*ai)/ai;let fa=0;for(An&&(or&&Qi!==kt?(z.push({value:kt}),Qi<kt&&fa++,A2(Math.round((Qi+fa*jn)*ai)/ai,kt,QP(kt,ei,d))&&fa++):Qi<kt&&fa++);fa<un;++fa){const Li=Math.round((Qi+fa*jn)*ai)/ai;if(Ft&&Li>Dt)break;z.push({value:Li})}return Ft&&or&&Gi!==Dt?z.length&&A2(z[z.length-1].value,Dt,QP(Dt,ei,d))?z[z.length-1].value=Dt:z.push({value:Dt}):(!Ft||Gi===Dt)&&z.push({value:Gi}),z}function QP(d,l,{horizontal:z,minRotation:j}){const J=tv(j),mt=(z?Math.sin(J):Math.cos(J))||.001,kt=.75*l*(""+d).length;return Math.min(l/mt,kt)}class qct extends __{constructor(l){super(l),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(l,z){return Rh(l)||(typeof l=="number"||l instanceof Number)&&!isFinite(+l)?null:+l}handleTickRangeOptions(){const{beginAtZero:l}=this.options,{minDefined:z,maxDefined:j}=this.getUserBounds();let{min:J,max:mt}=this;const kt=Gt=>J=z?J:Gt,Dt=Gt=>mt=j?mt:Gt;if(l){const Gt=cg(J),re=cg(mt);Gt<0&&re<0?Dt(0):Gt>0&&re>0&&kt(0)}if(J===mt){let Gt=mt===0?1:Math.abs(mt*.05);Dt(mt+Gt),l||kt(J-Gt)}this.min=J,this.max=mt}getTickLimit(){const l=this.options.ticks;let{maxTicksLimit:z,stepSize:j}=l,J;return j?(J=Math.ceil(this.max/j)-Math.floor(this.min/j)+1,J>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${j} would result generating up to ${J} ticks. Limiting to 1000.`),J=1e3)):(J=this.computeTickLimit(),z=z||11),z&&(J=Math.min(z,J)),J}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const l=this.options,z=l.ticks;let j=this.getTickLimit();j=Math.max(2,j);const J={maxTicks:j,bounds:l.bounds,min:l.min,max:l.max,precision:z.precision,step:z.stepSize,count:z.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:z.minRotation||0,includeBounds:z.includeBounds!==!1},mt=this._range||this,kt=Wct(J,mt);return l.bounds==="ticks"&&Vot(kt,this,"value"),l.reverse?(kt.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),kt}configure(){const l=this.ticks;let z=this.min,j=this.max;if(super.configure(),this.options.offset&&l.length){const J=(j-z)/Math.max(l.length-1,1)/2;z-=J,j+=J}this._startValue=z,this._endValue=j,this._valueRange=j-z}getLabelForValue(l){return lM(l,this.chart.options.locale,this.options.ticks.format)}}class Zct extends qct{static id="linear";static defaults={ticks:{callback:VO.formatters.numeric}};determineDataLimits(){const{min:l,max:z}=this.getMinMax(!0);this.min=Qp(l)?l:0,this.max=Qp(z)?z:1,this.handleTickRangeOptions()}computeTickLimit(){const l=this.isHorizontal(),z=l?this.width:this.height,j=tv(this.options.ticks.minRotation),J=(l?Math.sin(j):Math.cos(j))||.001,mt=this._resolveTickFontOptions(0);return Math.ceil(z/Math.min(40,mt.lineHeight/J))}getPixelForValue(l){return l===null?NaN:this.getPixelForDecimal((l-this._startValue)/this._valueRange)}getValueForPixel(l){return this._startValue+this.getDecimalForPixel(l)*this._valueRange}}const G4={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},M0=Object.keys(G4);function tz(d,l){return d-l}function ez(d,l){if(Rh(l))return null;const z=d._adapter,{parser:j,round:J,isoWeekday:mt}=d._parseOpts;let kt=l;return typeof j=="function"&&(kt=j(kt)),Qp(kt)||(kt=typeof j=="string"?z.parse(kt,j):z.parse(kt)),kt===null?null:(J&&(kt=J==="week"&&(V2(mt)||mt===!0)?z.startOf(kt,"isoWeek",mt):z.startOf(kt,J)),+kt)}function rz(d,l,z,j){const J=M0.length;for(let mt=M0.indexOf(d);mt<J-1;++mt){const kt=G4[M0[mt]],Dt=kt.steps?kt.steps:Number.MAX_SAFE_INTEGER;if(kt.common&&Math.ceil((z-l)/(Dt*kt.size))<=j)return M0[mt]}return M0[J-1]}function $ct(d,l,z,j,J){for(let mt=M0.length-1;mt>=M0.indexOf(z);mt--){const kt=M0[mt];if(G4[kt].common&&d._adapter.diff(J,j,kt)>=l-1)return kt}return M0[z?M0.indexOf(z):0]}function Gct(d){for(let l=M0.indexOf(d)+1,z=M0.length;l<z;++l)if(G4[M0[l]].common)return M0[l]}function nz(d,l,z){if(!z)d[l]=!0;else if(z.length){const{lo:j,hi:J}=aM(z,l),mt=z[j]>=l?z[j]:z[J];d[mt]=!0}}function Yct(d,l,z,j){const J=d._adapter,mt=+J.startOf(l[0].value,j),kt=l[l.length-1].value;let Dt,Gt;for(Dt=mt;Dt<=kt;Dt=+J.add(Dt,1,j))Gt=z[Dt],Gt>=0&&(l[Gt].major=!0);return l}function iz(d,l,z){const j=[],J={},mt=l.length;let kt,Dt;for(kt=0;kt<mt;++kt)Dt=l[kt],J[Dt]=kt,j.push({value:Dt,major:!1});return mt===0||!z?j:Yct(d,j,J,z)}class kA extends __{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(l){super(l),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(l,z={}){const j=l.time||(l.time={}),J=this._adapter=new aD._date(l.adapters.date);J.init(z),T2(j.displayFormats,J.formats()),this._parseOpts={parser:j.parser,round:j.round,isoWeekday:j.isoWeekday},super.init(l),this._normalized=z.normalized}parse(l,z){return l===void 0?null:ez(this,l)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const l=this.options,z=this._adapter,j=l.time.unit||"day";let{min:J,max:mt,minDefined:kt,maxDefined:Dt}=this.getUserBounds();function Gt(re){!kt&&!isNaN(re.min)&&(J=Math.min(J,re.min)),!Dt&&!isNaN(re.max)&&(mt=Math.max(mt,re.max))}(!kt||!Dt)&&(Gt(this._getLabelBounds()),(l.bounds!=="ticks"||l.ticks.source!=="labels")&&Gt(this.getMinMax(!1))),J=Qp(J)&&!isNaN(J)?J:+z.startOf(Date.now(),j),mt=Qp(mt)&&!isNaN(mt)?mt:+z.endOf(Date.now(),j)+1,this.min=Math.min(J,mt-1),this.max=Math.max(J+1,mt)}_getLabelBounds(){const l=this.getLabelTimestamps();let z=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY;return l.length&&(z=l[0],j=l[l.length-1]),{min:z,max:j}}buildTicks(){const l=this.options,z=l.time,j=l.ticks,J=j.source==="labels"?this.getLabelTimestamps():this._generate();l.bounds==="ticks"&&J.length&&(this.min=this._userMin||J[0],this.max=this._userMax||J[J.length-1]);const mt=this.min,kt=this.max,Dt=$ot(J,mt,kt);return this._unit=z.unit||(j.autoSkip?rz(z.minUnit,this.min,this.max,this._getLabelCapacity(mt)):$ct(this,Dt.length,z.minUnit,this.min,this.max)),this._majorUnit=!j.major.enabled||this._unit==="year"?void 0:Gct(this._unit),this.initOffsets(J),l.reverse&&Dt.reverse(),iz(this,Dt,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(l=>+l.value))}initOffsets(l=[]){let z=0,j=0,J,mt;this.options.offset&&l.length&&(J=this.getDecimalForValue(l[0]),l.length===1?z=1-J:z=(this.getDecimalForValue(l[1])-J)/2,mt=this.getDecimalForValue(l[l.length-1]),l.length===1?j=mt:j=(mt-this.getDecimalForValue(l[l.length-2]))/2);const kt=l.length<3?.5:.25;z=Xp(z,0,kt),j=Xp(j,0,kt),this._offsets={start:z,end:j,factor:1/(z+1+j)}}_generate(){const l=this._adapter,z=this.min,j=this.max,J=this.options,mt=J.time,kt=mt.unit||rz(mt.minUnit,z,j,this._getLabelCapacity(z)),Dt=cc(J.ticks.stepSize,1),Gt=kt==="week"?mt.isoWeekday:!1,re=V2(Gt)||Gt===!0,pe={};let Ne=z,or,_r;if(re&&(Ne=+l.startOf(Ne,"isoWeek",Gt)),Ne=+l.startOf(Ne,re?"day":kt),l.diff(j,z,kt)>1e5*Dt)throw new Error(z+" and "+j+" are too far apart with stepSize of "+Dt+" "+kt);const Fr=J.ticks.source==="data"&&this.getDataTimestamps();for(or=Ne,_r=0;or<j;or=+l.add(or,Dt,kt),_r++)nz(pe,or,Fr);return(or===j||J.bounds==="ticks"||_r===1)&&nz(pe,or,Fr),Object.keys(pe).sort(tz).map(zr=>+zr)}getLabelForValue(l){const z=this._adapter,j=this.options.time;return j.tooltipFormat?z.format(l,j.tooltipFormat):z.format(l,j.displayFormats.datetime)}format(l,z){const J=this.options.time.displayFormats,mt=this._unit,kt=z||J[mt];return this._adapter.format(l,kt)}_tickFormatFunction(l,z,j,J){const mt=this.options,kt=mt.ticks.callback;if(kt)return Df(kt,[l,z,j],this);const Dt=mt.time.displayFormats,Gt=this._unit,re=this._majorUnit,pe=Gt&&Dt[Gt],Ne=re&&Dt[re],or=j[z],_r=re&&Ne&&or&&or.major;return this._adapter.format(l,J||(_r?Ne:pe))}generateTickLabels(l){let z,j,J;for(z=0,j=l.length;z<j;++z)J=l[z],J.label=this._tickFormatFunction(J.value,z,l)}getDecimalForValue(l){return l===null?NaN:(l-this.min)/(this.max-this.min)}getPixelForValue(l){const z=this._offsets,j=this.getDecimalForValue(l);return this.getPixelForDecimal((z.start+j)*z.factor)}getValueForPixel(l){const z=this._offsets,j=this.getDecimalForPixel(l)/z.factor-z.end;return this.min+j*(this.max-this.min)}_getLabelSize(l){const z=this.options.ticks,j=this.ctx.measureText(l).width,J=tv(this.isHorizontal()?z.maxRotation:z.minRotation),mt=Math.cos(J),kt=Math.sin(J),Dt=this._resolveTickFontOptions(0).size;return{w:j*mt+Dt*kt,h:j*kt+Dt*mt}}_getLabelCapacity(l){const z=this.options.time,j=z.displayFormats,J=j[z.unit]||j.millisecond,mt=this._tickFormatFunction(l,0,iz(this,[l],this._majorUnit),J),kt=this._getLabelSize(mt),Dt=Math.floor(this.isHorizontal()?this.width/kt.w:this.height/kt.h)-1;return Dt>0?Dt:1}getDataTimestamps(){let l=this._cache.data||[],z,j;if(l.length)return l;const J=this.getMatchingVisibleMetas();if(this._normalized&&J.length)return this._cache.data=J[0].controller.getAllParsedValues(this);for(z=0,j=J.length;z<j;++z)l=l.concat(J[z].controller.getAllParsedValues(this));return this._cache.data=this.normalize(l)}getLabelTimestamps(){const l=this._cache.labels||[];let z,j;if(l.length)return l;const J=this.getLabels();for(z=0,j=J.length;z<j;++z)l.push(ez(this,J[z]));return this._cache.labels=this._normalized?l:this.normalize(l)}normalize(l){return NO(l.sort(tz))}}function N5(d,l,z){let j=0,J=d.length-1,mt,kt,Dt,Gt;z?(l>=d[j].pos&&l<=d[J].pos&&({lo:j,hi:J}=yy(d,"pos",l)),{pos:mt,time:Dt}=d[j],{pos:kt,time:Gt}=d[J]):(l>=d[j].time&&l<=d[J].time&&({lo:j,hi:J}=yy(d,"time",l)),{time:mt,pos:Dt}=d[j],{time:kt,pos:Gt}=d[J]);const re=kt-mt;return re?Dt+(Gt-Dt)*(l-mt)/re:Dt}class Rvt extends kA{static id="timeseries";static defaults=kA.defaults;constructor(l){super(l),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const l=this._getTimestampsForTable(),z=this._table=this.buildLookupTable(l);this._minPos=N5(z,this.min),this._tableRange=N5(z,this.max)-this._minPos,super.initOffsets(l)}buildLookupTable(l){const{min:z,max:j}=this,J=[],mt=[];let kt,Dt,Gt,re,pe;for(kt=0,Dt=l.length;kt<Dt;++kt)re=l[kt],re>=z&&re<=j&&J.push(re);if(J.length<2)return[{time:z,pos:0},{time:j,pos:1}];for(kt=0,Dt=J.length;kt<Dt;++kt)pe=J[kt+1],Gt=J[kt-1],re=J[kt],Math.round((pe+Gt)/2)!==re&&mt.push({time:re,pos:kt/(Dt-1)});return mt}_generate(){const l=this.min,z=this.max;let j=super.getDataTimestamps();return(!j.includes(l)||!j.length)&&j.splice(0,0,l),(!j.includes(z)||j.length===1)&&j.push(z),j.sort((J,mt)=>J-mt)}_getTimestampsForTable(){let l=this._cache.all||[];if(l.length)return l;const z=this.getDataTimestamps(),j=this.getLabelTimestamps();return z.length&&j.length?l=this.normalize(z.concat(j)):l=z.length?z:j,l=this._cache.all=l,l}getDecimalForValue(l){return(N5(this._table,l)-this._minPos)/this._tableRange}getValueForPixel(l){const z=this._offsets,j=this.getDecimalForPixel(l)/z.factor-z.end;return N5(this._table,j*this._tableRange+this._minPos,!0)}}const kD=6048e5,Kct=864e5,iw=6e4,aw=36e5,Xct=1e3,az=Symbol.for("constructDateFrom");function bd(d,l){return typeof d=="function"?d(l):d&&typeof d=="object"&&az in d?d[az](l):d instanceof Date?new d.constructor(l):new Date(l)}function Vu(d,l){return bd(l||d,d)}function Y4(d,l,z){const j=Vu(d,z?.in);return isNaN(l)?bd(z?.in||d,NaN):(l&&j.setDate(j.getDate()+l),j)}function gM(d,l,z){const j=Vu(d,z?.in);if(isNaN(l))return bd(d,NaN);if(!l)return j;const J=j.getDate(),mt=bd(d,j.getTime());mt.setMonth(j.getMonth()+l+1,0);const kt=mt.getDate();return J>=kt?mt:(j.setFullYear(mt.getFullYear(),mt.getMonth(),J),j)}function vM(d,l,z){return bd(d,+Vu(d)+l)}function Jct(d,l,z){return vM(d,l*aw)}let Qct={};function Ly(){return Qct}function fg(d,l){const z=Ly(),j=l?.weekStartsOn??l?.locale?.options?.weekStartsOn??z.weekStartsOn??z.locale?.options?.weekStartsOn??0,J=Vu(d,l?.in),mt=J.getDay(),kt=(mt<j?7:0)+mt-j;return J.setDate(J.getDate()-kt),J.setHours(0,0,0,0),J}function v_(d,l){return fg(d,{...l,weekStartsOn:1})}function TD(d,l){const z=Vu(d,l?.in),j=z.getFullYear(),J=bd(z,0);J.setFullYear(j+1,0,4),J.setHours(0,0,0,0);const mt=v_(J),kt=bd(z,0);kt.setFullYear(j,0,4),kt.setHours(0,0,0,0);const Dt=v_(kt);return z.getTime()>=mt.getTime()?j+1:z.getTime()>=Dt.getTime()?j:j-1}function y4(d){const l=Vu(d),z=new Date(Date.UTC(l.getFullYear(),l.getMonth(),l.getDate(),l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()));return z.setUTCFullYear(l.getFullYear()),+d-+z}function Py(d,...l){const z=bd.bind(null,l.find(j=>typeof j=="object"));return l.map(z)}function TA(d,l){const z=Vu(d,l?.in);return z.setHours(0,0,0,0),z}function AD(d,l,z){const[j,J]=Py(z?.in,d,l),mt=TA(j),kt=TA(J),Dt=+mt-y4(mt),Gt=+kt-y4(kt);return Math.round((Dt-Gt)/Kct)}function tht(d,l){const z=TD(d,l),j=bd(d,0);return j.setFullYear(z,0,4),j.setHours(0,0,0,0),v_(j)}function eht(d,l,z){const j=Vu(d,z?.in);return j.setTime(j.getTime()+l*iw),j}function rht(d,l,z){return gM(d,l*3,z)}function nht(d,l,z){return vM(d,l*1e3)}function iht(d,l,z){return Y4(d,l*7,z)}function aht(d,l,z){return gM(d,l*12,z)}function E2(d,l){const z=+Vu(d)-+Vu(l);return z<0?-1:z>0?1:z}function oht(d){return d instanceof Date||typeof d=="object"&&Object.prototype.toString.call(d)==="[object Date]"}function MD(d){return!(!oht(d)&&typeof d!="number"||isNaN(+Vu(d)))}function sht(d,l,z){const[j,J]=Py(z?.in,d,l),mt=j.getFullYear()-J.getFullYear(),kt=j.getMonth()-J.getMonth();return mt*12+kt}function lht(d,l,z){const[j,J]=Py(z?.in,d,l);return j.getFullYear()-J.getFullYear()}function SD(d,l,z){const[j,J]=Py(z?.in,d,l),mt=oz(j,J),kt=Math.abs(AD(j,J));j.setDate(j.getDate()-mt*kt);const Dt=+(oz(j,J)===-mt),Gt=mt*(kt-Dt);return Gt===0?0:Gt}function oz(d,l){const z=d.getFullYear()-l.getFullYear()||d.getMonth()-l.getMonth()||d.getDate()-l.getDate()||d.getHours()-l.getHours()||d.getMinutes()-l.getMinutes()||d.getSeconds()-l.getSeconds()||d.getMilliseconds()-l.getMilliseconds();return z<0?-1:z>0?1:z}function ow(d){return l=>{const j=(d?Math[d]:Math.trunc)(l);return j===0?0:j}}function uht(d,l,z){const[j,J]=Py(z?.in,d,l),mt=(+j-+J)/aw;return ow(z?.roundingMethod)(mt)}function yM(d,l){return+Vu(d)-+Vu(l)}function cht(d,l,z){const j=yM(d,l)/iw;return ow(z?.roundingMethod)(j)}function ED(d,l){const z=Vu(d,l?.in);return z.setHours(23,59,59,999),z}function CD(d,l){const z=Vu(d,l?.in),j=z.getMonth();return z.setFullYear(z.getFullYear(),j+1,0),z.setHours(23,59,59,999),z}function hht(d,l){const z=Vu(d,l?.in);return+ED(z,l)==+CD(z,l)}function LD(d,l,z){const[j,J,mt]=Py(z?.in,d,d,l),kt=E2(J,mt),Dt=Math.abs(sht(J,mt));if(Dt<1)return 0;J.getMonth()===1&&J.getDate()>27&&J.setDate(30),J.setMonth(J.getMonth()-kt*Dt);let Gt=E2(J,mt)===-kt;hht(j)&&Dt===1&&E2(j,mt)===1&&(Gt=!1);const re=kt*(Dt-+Gt);return re===0?0:re}function fht(d,l,z){const j=LD(d,l,z)/3;return ow(z?.roundingMethod)(j)}function dht(d,l,z){const j=yM(d,l)/1e3;return ow(z?.roundingMethod)(j)}function pht(d,l,z){const j=SD(d,l,z)/7;return ow(z?.roundingMethod)(j)}function mht(d,l,z){const[j,J]=Py(z?.in,d,l),mt=E2(j,J),kt=Math.abs(lht(j,J));j.setFullYear(1584),J.setFullYear(1584);const Dt=E2(j,J)===-mt,Gt=mt*(kt-+Dt);return Gt===0?0:Gt}function ght(d,l){const z=Vu(d,l?.in),j=z.getMonth(),J=j-j%3;return z.setMonth(J,1),z.setHours(0,0,0,0),z}function vht(d,l){const z=Vu(d,l?.in);return z.setDate(1),z.setHours(0,0,0,0),z}function yht(d,l){const z=Vu(d,l?.in),j=z.getFullYear();return z.setFullYear(j+1,0,0),z.setHours(23,59,59,999),z}function PD(d,l){const z=Vu(d,l?.in);return z.setFullYear(z.getFullYear(),0,1),z.setHours(0,0,0,0),z}function xht(d,l){const z=Vu(d,l?.in);return z.setMinutes(59,59,999),z}function _ht(d,l){const z=Ly(),j=z.weekStartsOn??z.locale?.options?.weekStartsOn??0,J=Vu(d,l?.in),mt=J.getDay(),kt=(mt<j?-7:0)+6-(mt-j);return J.setDate(J.getDate()+kt),J.setHours(23,59,59,999),J}function bht(d,l){const z=Vu(d,l?.in);return z.setSeconds(59,999),z}function wht(d,l){const z=Vu(d,l?.in),j=z.getMonth(),J=j-j%3+3;return z.setMonth(J,0),z.setHours(23,59,59,999),z}function kht(d,l){const z=Vu(d,l?.in);return z.setMilliseconds(999),z}const Tht={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Aht=(d,l,z)=>{let j;const J=Tht[d];return typeof J=="string"?j=J:l===1?j=J.one:j=J.other.replace("{{count}}",l.toString()),z?.addSuffix?z.comparison&&z.comparison>0?"in "+j:j+" ago":j};function W8(d){return(l={})=>{const z=l.width?String(l.width):d.defaultWidth;return d.formats[z]||d.formats[d.defaultWidth]}}const Mht={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Eht={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cht={date:W8({formats:Mht,defaultWidth:"full"}),time:W8({formats:Sht,defaultWidth:"full"}),dateTime:W8({formats:Eht,defaultWidth:"full"})},Lht={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Pht=(d,l,z,j)=>Lht[d];function o2(d){return(l,z)=>{const j=z?.context?String(z.context):"standalone";let J;if(j==="formatting"&&d.formattingValues){const kt=d.defaultFormattingWidth||d.defaultWidth,Dt=z?.width?String(z.width):kt;J=d.formattingValues[Dt]||d.formattingValues[kt]}else{const kt=d.defaultWidth,Dt=z?.width?String(z.width):d.defaultWidth;J=d.values[Dt]||d.values[kt]}const mt=d.argumentCallback?d.argumentCallback(l):l;return J[mt]}}const zht={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Iht={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Oht={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Dht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Fht={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Rht={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Bht=(d,l)=>{const z=Number(d),j=z%100;if(j>20||j<10)switch(j%10){case 1:return z+"st";case 2:return z+"nd";case 3:return z+"rd"}return z+"th"},Nht={ordinalNumber:Bht,era:o2({values:zht,defaultWidth:"wide"}),quarter:o2({values:Iht,defaultWidth:"wide",argumentCallback:d=>d-1}),month:o2({values:Oht,defaultWidth:"wide"}),day:o2({values:Dht,defaultWidth:"wide"}),dayPeriod:o2({values:Fht,defaultWidth:"wide",formattingValues:Rht,defaultFormattingWidth:"wide"})};function s2(d){return(l,z={})=>{const j=z.width,J=j&&d.matchPatterns[j]||d.matchPatterns[d.defaultMatchWidth],mt=l.match(J);if(!mt)return null;const kt=mt[0],Dt=j&&d.parsePatterns[j]||d.parsePatterns[d.defaultParseWidth],Gt=Array.isArray(Dt)?Uht(Dt,Ne=>Ne.test(kt)):jht(Dt,Ne=>Ne.test(kt));let re;re=d.valueCallback?d.valueCallback(Gt):Gt,re=z.valueCallback?z.valueCallback(re):re;const pe=l.slice(kt.length);return{value:re,rest:pe}}}function jht(d,l){for(const z in d)if(Object.prototype.hasOwnProperty.call(d,z)&&l(d[z]))return z}function Uht(d,l){for(let z=0;z<d.length;z++)if(l(d[z]))return z}function Vht(d){return(l,z={})=>{const j=l.match(d.matchPattern);if(!j)return null;const J=j[0],mt=l.match(d.parsePattern);if(!mt)return null;let kt=d.valueCallback?d.valueCallback(mt[0]):mt[0];kt=z.valueCallback?z.valueCallback(kt):kt;const Dt=l.slice(J.length);return{value:kt,rest:Dt}}}const Hht=/^(\d+)(th|st|nd|rd)?/i,Wht=/\d+/i,qht={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Zht={any:[/^b/i,/^(a|c)/i]},$ht={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ght={any:[/1/i,/2/i,/3/i,/4/i]},Yht={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Kht={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Xht={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Jht={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Qht={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},tft={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},eft={ordinalNumber:Vht({matchPattern:Hht,parsePattern:Wht,valueCallback:d=>parseInt(d,10)}),era:s2({matchPatterns:qht,defaultMatchWidth:"wide",parsePatterns:Zht,defaultParseWidth:"any"}),quarter:s2({matchPatterns:$ht,defaultMatchWidth:"wide",parsePatterns:Ght,defaultParseWidth:"any",valueCallback:d=>d+1}),month:s2({matchPatterns:Yht,defaultMatchWidth:"wide",parsePatterns:Kht,defaultParseWidth:"any"}),day:s2({matchPatterns:Xht,defaultMatchWidth:"wide",parsePatterns:Jht,defaultParseWidth:"any"}),dayPeriod:s2({matchPatterns:Qht,defaultMatchWidth:"any",parsePatterns:tft,defaultParseWidth:"any"})},zD={code:"en-US",formatDistance:Aht,formatLong:Cht,formatRelative:Pht,localize:Nht,match:eft,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rft(d,l){const z=Vu(d,l?.in);return AD(z,PD(z))+1}function ID(d,l){const z=Vu(d,l?.in),j=+v_(z)-+tht(z);return Math.round(j/kD)+1}function xM(d,l){const z=Vu(d,l?.in),j=z.getFullYear(),J=Ly(),mt=l?.firstWeekContainsDate??l?.locale?.options?.firstWeekContainsDate??J.firstWeekContainsDate??J.locale?.options?.firstWeekContainsDate??1,kt=bd(l?.in||d,0);kt.setFullYear(j+1,0,mt),kt.setHours(0,0,0,0);const Dt=fg(kt,l),Gt=bd(l?.in||d,0);Gt.setFullYear(j,0,mt),Gt.setHours(0,0,0,0);const re=fg(Gt,l);return+z>=+Dt?j+1:+z>=+re?j:j-1}function nft(d,l){const z=Ly(),j=l?.firstWeekContainsDate??l?.locale?.options?.firstWeekContainsDate??z.firstWeekContainsDate??z.locale?.options?.firstWeekContainsDate??1,J=xM(d,l),mt=bd(l?.in||d,0);return mt.setFullYear(J,0,j),mt.setHours(0,0,0,0),fg(mt,l)}function OD(d,l){const z=Vu(d,l?.in),j=+fg(z,l)-+nft(z,l);return Math.round(j/kD)+1}function Yh(d,l){const z=d<0?"-":"",j=Math.abs(d).toString().padStart(l,"0");return z+j}const t1={y(d,l){const z=d.getFullYear(),j=z>0?z:1-z;return Yh(l==="yy"?j%100:j,l.length)},M(d,l){const z=d.getMonth();return l==="M"?String(z+1):Yh(z+1,2)},d(d,l){return Yh(d.getDate(),l.length)},a(d,l){const z=d.getHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return z.toUpperCase();case"aaa":return z;case"aaaaa":return z[0];case"aaaa":default:return z==="am"?"a.m.":"p.m."}},h(d,l){return Yh(d.getHours()%12||12,l.length)},H(d,l){return Yh(d.getHours(),l.length)},m(d,l){return Yh(d.getMinutes(),l.length)},s(d,l){return Yh(d.getSeconds(),l.length)},S(d,l){const z=l.length,j=d.getMilliseconds(),J=Math.trunc(j*Math.pow(10,z-3));return Yh(J,l.length)}},Qx={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sz={G:function(d,l,z){const j=d.getFullYear()>0?1:0;switch(l){case"G":case"GG":case"GGG":return z.era(j,{width:"abbreviated"});case"GGGGG":return z.era(j,{width:"narrow"});case"GGGG":default:return z.era(j,{width:"wide"})}},y:function(d,l,z){if(l==="yo"){const j=d.getFullYear(),J=j>0?j:1-j;return z.ordinalNumber(J,{unit:"year"})}return t1.y(d,l)},Y:function(d,l,z,j){const J=xM(d,j),mt=J>0?J:1-J;if(l==="YY"){const kt=mt%100;return Yh(kt,2)}return l==="Yo"?z.ordinalNumber(mt,{unit:"year"}):Yh(mt,l.length)},R:function(d,l){const z=TD(d);return Yh(z,l.length)},u:function(d,l){const z=d.getFullYear();return Yh(z,l.length)},Q:function(d,l,z){const j=Math.ceil((d.getMonth()+1)/3);switch(l){case"Q":return String(j);case"QQ":return Yh(j,2);case"Qo":return z.ordinalNumber(j,{unit:"quarter"});case"QQQ":return z.quarter(j,{width:"abbreviated",context:"formatting"});case"QQQQQ":return z.quarter(j,{width:"narrow",context:"formatting"});case"QQQQ":default:return z.quarter(j,{width:"wide",context:"formatting"})}},q:function(d,l,z){const j=Math.ceil((d.getMonth()+1)/3);switch(l){case"q":return String(j);case"qq":return Yh(j,2);case"qo":return z.ordinalNumber(j,{unit:"quarter"});case"qqq":return z.quarter(j,{width:"abbreviated",context:"standalone"});case"qqqqq":return z.quarter(j,{width:"narrow",context:"standalone"});case"qqqq":default:return z.quarter(j,{width:"wide",context:"standalone"})}},M:function(d,l,z){const j=d.getMonth();switch(l){case"M":case"MM":return t1.M(d,l);case"Mo":return z.ordinalNumber(j+1,{unit:"month"});case"MMM":return z.month(j,{width:"abbreviated",context:"formatting"});case"MMMMM":return z.month(j,{width:"narrow",context:"formatting"});case"MMMM":default:return z.month(j,{width:"wide",context:"formatting"})}},L:function(d,l,z){const j=d.getMonth();switch(l){case"L":return String(j+1);case"LL":return Yh(j+1,2);case"Lo":return z.ordinalNumber(j+1,{unit:"month"});case"LLL":return z.month(j,{width:"abbreviated",context:"standalone"});case"LLLLL":return z.month(j,{width:"narrow",context:"standalone"});case"LLLL":default:return z.month(j,{width:"wide",context:"standalone"})}},w:function(d,l,z,j){const J=OD(d,j);return l==="wo"?z.ordinalNumber(J,{unit:"week"}):Yh(J,l.length)},I:function(d,l,z){const j=ID(d);return l==="Io"?z.ordinalNumber(j,{unit:"week"}):Yh(j,l.length)},d:function(d,l,z){return l==="do"?z.ordinalNumber(d.getDate(),{unit:"date"}):t1.d(d,l)},D:function(d,l,z){const j=rft(d);return l==="Do"?z.ordinalNumber(j,{unit:"dayOfYear"}):Yh(j,l.length)},E:function(d,l,z){const j=d.getDay();switch(l){case"E":case"EE":case"EEE":return z.day(j,{width:"abbreviated",context:"formatting"});case"EEEEE":return z.day(j,{width:"narrow",context:"formatting"});case"EEEEEE":return z.day(j,{width:"short",context:"formatting"});case"EEEE":default:return z.day(j,{width:"wide",context:"formatting"})}},e:function(d,l,z,j){const J=d.getDay(),mt=(J-j.weekStartsOn+8)%7||7;switch(l){case"e":return String(mt);case"ee":return Yh(mt,2);case"eo":return z.ordinalNumber(mt,{unit:"day"});case"eee":return z.day(J,{width:"abbreviated",context:"formatting"});case"eeeee":return z.day(J,{width:"narrow",context:"formatting"});case"eeeeee":return z.day(J,{width:"short",context:"formatting"});case"eeee":default:return z.day(J,{width:"wide",context:"formatting"})}},c:function(d,l,z,j){const J=d.getDay(),mt=(J-j.weekStartsOn+8)%7||7;switch(l){case"c":return String(mt);case"cc":return Yh(mt,l.length);case"co":return z.ordinalNumber(mt,{unit:"day"});case"ccc":return z.day(J,{width:"abbreviated",context:"standalone"});case"ccccc":return z.day(J,{width:"narrow",context:"standalone"});case"cccccc":return z.day(J,{width:"short",context:"standalone"});case"cccc":default:return z.day(J,{width:"wide",context:"standalone"})}},i:function(d,l,z){const j=d.getDay(),J=j===0?7:j;switch(l){case"i":return String(J);case"ii":return Yh(J,l.length);case"io":return z.ordinalNumber(J,{unit:"day"});case"iii":return z.day(j,{width:"abbreviated",context:"formatting"});case"iiiii":return z.day(j,{width:"narrow",context:"formatting"});case"iiiiii":return z.day(j,{width:"short",context:"formatting"});case"iiii":default:return z.day(j,{width:"wide",context:"formatting"})}},a:function(d,l,z){const J=d.getHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"});case"aaa":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return z.dayPeriod(J,{width:"narrow",context:"formatting"});case"aaaa":default:return z.dayPeriod(J,{width:"wide",context:"formatting"})}},b:function(d,l,z){const j=d.getHours();let J;switch(j===12?J=Qx.noon:j===0?J=Qx.midnight:J=j/12>=1?"pm":"am",l){case"b":case"bb":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"});case"bbb":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return z.dayPeriod(J,{width:"narrow",context:"formatting"});case"bbbb":default:return z.dayPeriod(J,{width:"wide",context:"formatting"})}},B:function(d,l,z){const j=d.getHours();let J;switch(j>=17?J=Qx.evening:j>=12?J=Qx.afternoon:j>=4?J=Qx.morning:J=Qx.night,l){case"B":case"BB":case"BBB":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"});case"BBBBB":return z.dayPeriod(J,{width:"narrow",context:"formatting"});case"BBBB":default:return z.dayPeriod(J,{width:"wide",context:"formatting"})}},h:function(d,l,z){if(l==="ho"){let j=d.getHours()%12;return j===0&&(j=12),z.ordinalNumber(j,{unit:"hour"})}return t1.h(d,l)},H:function(d,l,z){return l==="Ho"?z.ordinalNumber(d.getHours(),{unit:"hour"}):t1.H(d,l)},K:function(d,l,z){const j=d.getHours()%12;return l==="Ko"?z.ordinalNumber(j,{unit:"hour"}):Yh(j,l.length)},k:function(d,l,z){let j=d.getHours();return j===0&&(j=24),l==="ko"?z.ordinalNumber(j,{unit:"hour"}):Yh(j,l.length)},m:function(d,l,z){return l==="mo"?z.ordinalNumber(d.getMinutes(),{unit:"minute"}):t1.m(d,l)},s:function(d,l,z){return l==="so"?z.ordinalNumber(d.getSeconds(),{unit:"second"}):t1.s(d,l)},S:function(d,l){return t1.S(d,l)},X:function(d,l,z){const j=d.getTimezoneOffset();if(j===0)return"Z";switch(l){case"X":return uz(j);case"XXXX":case"XX":return dy(j);case"XXXXX":case"XXX":default:return dy(j,":")}},x:function(d,l,z){const j=d.getTimezoneOffset();switch(l){case"x":return uz(j);case"xxxx":case"xx":return dy(j);case"xxxxx":case"xxx":default:return dy(j,":")}},O:function(d,l,z){const j=d.getTimezoneOffset();switch(l){case"O":case"OO":case"OOO":return"GMT"+lz(j,":");case"OOOO":default:return"GMT"+dy(j,":")}},z:function(d,l,z){const j=d.getTimezoneOffset();switch(l){case"z":case"zz":case"zzz":return"GMT"+lz(j,":");case"zzzz":default:return"GMT"+dy(j,":")}},t:function(d,l,z){const j=Math.trunc(+d/1e3);return Yh(j,l.length)},T:function(d,l,z){return Yh(+d,l.length)}};function lz(d,l=""){const z=d>0?"-":"+",j=Math.abs(d),J=Math.trunc(j/60),mt=j%60;return mt===0?z+String(J):z+String(J)+l+Yh(mt,2)}function uz(d,l){return d%60===0?(d>0?"-":"+")+Yh(Math.abs(d)/60,2):dy(d,l)}function dy(d,l=""){const z=d>0?"-":"+",j=Math.abs(d),J=Yh(Math.trunc(j/60),2),mt=Yh(j%60,2);return z+J+l+mt}const cz=(d,l)=>{switch(d){case"P":return l.date({width:"short"});case"PP":return l.date({width:"medium"});case"PPP":return l.date({width:"long"});case"PPPP":default:return l.date({width:"full"})}},DD=(d,l)=>{switch(d){case"p":return l.time({width:"short"});case"pp":return l.time({width:"medium"});case"ppp":return l.time({width:"long"});case"pppp":default:return l.time({width:"full"})}},ift=(d,l)=>{const z=d.match(/(P+)(p+)?/)||[],j=z[1],J=z[2];if(!J)return cz(d,l);let mt;switch(j){case"P":mt=l.dateTime({width:"short"});break;case"PP":mt=l.dateTime({width:"medium"});break;case"PPP":mt=l.dateTime({width:"long"});break;case"PPPP":default:mt=l.dateTime({width:"full"});break}return mt.replace("{{date}}",cz(j,l)).replace("{{time}}",DD(J,l))},AA={p:DD,P:ift},aft=/^D+$/,oft=/^Y+$/,sft=["D","DD","YY","YYYY"];function FD(d){return aft.test(d)}function RD(d){return oft.test(d)}function MA(d,l,z){const j=lft(d,l,z);if(console.warn(j),sft.includes(d))throw new RangeError(j)}function lft(d,l,z){const j=d[0]==="Y"?"years":"days of the month";return`Use \`${d.toLowerCase()}\` instead of \`${d}\` (in \`${l}\`) for formatting ${j} to the input \`${z}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const uft=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cft=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hft=/^'([^]*?)'?$/,fft=/''/g,dft=/[a-zA-Z]/;function pft(d,l,z){const j=Ly(),J=z?.locale??j.locale??zD,mt=z?.firstWeekContainsDate??z?.locale?.options?.firstWeekContainsDate??j.firstWeekContainsDate??j.locale?.options?.firstWeekContainsDate??1,kt=z?.weekStartsOn??z?.locale?.options?.weekStartsOn??j.weekStartsOn??j.locale?.options?.weekStartsOn??0,Dt=Vu(d,z?.in);if(!MD(Dt))throw new RangeError("Invalid time value");let Gt=l.match(cft).map(pe=>{const Ne=pe[0];if(Ne==="p"||Ne==="P"){const or=AA[Ne];return or(pe,J.formatLong)}return pe}).join("").match(uft).map(pe=>{if(pe==="''")return{isToken:!1,value:"'"};const Ne=pe[0];if(Ne==="'")return{isToken:!1,value:mft(pe)};if(sz[Ne])return{isToken:!0,value:pe};if(Ne.match(dft))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Ne+"`");return{isToken:!1,value:pe}});J.localize.preprocessor&&(Gt=J.localize.preprocessor(Dt,Gt));const re={firstWeekContainsDate:mt,weekStartsOn:kt,locale:J};return Gt.map(pe=>{if(!pe.isToken)return pe.value;const Ne=pe.value;(!z?.useAdditionalWeekYearTokens&&RD(Ne)||!z?.useAdditionalDayOfYearTokens&&FD(Ne))&&MA(Ne,l,String(d));const or=sz[Ne[0]];return or(Dt,Ne,J.localize,re)}).join("")}function mft(d){const l=d.match(hft);return l?l[1].replace(fft,"'"):d}function gft(){return Object.assign({},Ly())}function vft(d,l){const z=Vu(d,l?.in).getDay();return z===0?7:z}function yft(d,l){const z=xft(l)?new l(0):bd(l,0);return z.setFullYear(d.getFullYear(),d.getMonth(),d.getDate()),z.setHours(d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds()),z}function xft(d){return typeof d=="function"&&d.prototype?.constructor===d}const _ft=10;class BD{subPriority=0;validate(l,z){return!0}}class bft extends BD{constructor(l,z,j,J,mt){super(),this.value=l,this.validateValue=z,this.setValue=j,this.priority=J,mt&&(this.subPriority=mt)}validate(l,z){return this.validateValue(l,this.value,z)}set(l,z,j){return this.setValue(l,z,this.value,j)}}class wft extends BD{priority=_ft;subPriority=-1;constructor(l,z){super(),this.context=l||(j=>bd(z,j))}set(l,z){return z.timestampIsSet?l:bd(l,yft(l,this.context))}}class Ah{run(l,z,j,J){const mt=this.parse(l,z,j,J);return mt?{setter:new bft(mt.value,this.validate,this.set,this.priority,this.subPriority),rest:mt.rest}:null}validate(l,z,j){return!0}}class kft extends Ah{priority=140;parse(l,z,j){switch(z){case"G":case"GG":case"GGG":return j.era(l,{width:"abbreviated"})||j.era(l,{width:"narrow"});case"GGGGG":return j.era(l,{width:"narrow"});case"GGGG":default:return j.era(l,{width:"wide"})||j.era(l,{width:"abbreviated"})||j.era(l,{width:"narrow"})}}set(l,z,j){return z.era=j,l.setFullYear(j,0,1),l.setHours(0,0,0,0),l}incompatibleTokens=["R","u","t","T"]}const Nd={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},sg={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function jd(d,l){return d&&{value:l(d.value),rest:d.rest}}function ad(d,l){const z=l.match(d);return z?{value:parseInt(z[0],10),rest:l.slice(z[0].length)}:null}function lg(d,l){const z=l.match(d);if(!z)return null;if(z[0]==="Z")return{value:0,rest:l.slice(1)};const j=z[1]==="+"?1:-1,J=z[2]?parseInt(z[2],10):0,mt=z[3]?parseInt(z[3],10):0,kt=z[5]?parseInt(z[5],10):0;return{value:j*(J*aw+mt*iw+kt*Xct),rest:l.slice(z[0].length)}}function ND(d){return ad(Nd.anyDigitsSigned,d)}function wd(d,l){switch(d){case 1:return ad(Nd.singleDigit,l);case 2:return ad(Nd.twoDigits,l);case 3:return ad(Nd.threeDigits,l);case 4:return ad(Nd.fourDigits,l);default:return ad(new RegExp("^\\d{1,"+d+"}"),l)}}function x4(d,l){switch(d){case 1:return ad(Nd.singleDigitSigned,l);case 2:return ad(Nd.twoDigitsSigned,l);case 3:return ad(Nd.threeDigitsSigned,l);case 4:return ad(Nd.fourDigitsSigned,l);default:return ad(new RegExp("^-?\\d{1,"+d+"}"),l)}}function _M(d){switch(d){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function jD(d,l){const z=l>0,j=z?l:1-l;let J;if(j<=50)J=d||100;else{const mt=j+50,kt=Math.trunc(mt/100)*100,Dt=d>=mt%100;J=d+kt-(Dt?100:0)}return z?J:1-J}function UD(d){return d%400===0||d%4===0&&d%100!==0}class Tft extends Ah{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(l,z,j){const J=mt=>({year:mt,isTwoDigitYear:z==="yy"});switch(z){case"y":return jd(wd(4,l),J);case"yo":return jd(j.ordinalNumber(l,{unit:"year"}),J);default:return jd(wd(z.length,l),J)}}validate(l,z){return z.isTwoDigitYear||z.year>0}set(l,z,j){const J=l.getFullYear();if(j.isTwoDigitYear){const kt=jD(j.year,J);return l.setFullYear(kt,0,1),l.setHours(0,0,0,0),l}const mt=!("era"in z)||z.era===1?j.year:1-j.year;return l.setFullYear(mt,0,1),l.setHours(0,0,0,0),l}}class Aft extends Ah{priority=130;parse(l,z,j){const J=mt=>({year:mt,isTwoDigitYear:z==="YY"});switch(z){case"Y":return jd(wd(4,l),J);case"Yo":return jd(j.ordinalNumber(l,{unit:"year"}),J);default:return jd(wd(z.length,l),J)}}validate(l,z){return z.isTwoDigitYear||z.year>0}set(l,z,j,J){const mt=xM(l,J);if(j.isTwoDigitYear){const Dt=jD(j.year,mt);return l.setFullYear(Dt,0,J.firstWeekContainsDate),l.setHours(0,0,0,0),fg(l,J)}const kt=!("era"in z)||z.era===1?j.year:1-j.year;return l.setFullYear(kt,0,J.firstWeekContainsDate),l.setHours(0,0,0,0),fg(l,J)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class Mft extends Ah{priority=130;parse(l,z){return x4(z==="R"?4:z.length,l)}set(l,z,j){const J=bd(l,0);return J.setFullYear(j,0,4),J.setHours(0,0,0,0),v_(J)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class Sft extends Ah{priority=130;parse(l,z){return x4(z==="u"?4:z.length,l)}set(l,z,j){return l.setFullYear(j,0,1),l.setHours(0,0,0,0),l}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class Eft extends Ah{priority=120;parse(l,z,j){switch(z){case"Q":case"QQ":return wd(z.length,l);case"Qo":return j.ordinalNumber(l,{unit:"quarter"});case"QQQ":return j.quarter(l,{width:"abbreviated",context:"formatting"})||j.quarter(l,{width:"narrow",context:"formatting"});case"QQQQQ":return j.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return j.quarter(l,{width:"wide",context:"formatting"})||j.quarter(l,{width:"abbreviated",context:"formatting"})||j.quarter(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=1&&z<=4}set(l,z,j){return l.setMonth((j-1)*3,1),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Cft extends Ah{priority=120;parse(l,z,j){switch(z){case"q":case"qq":return wd(z.length,l);case"qo":return j.ordinalNumber(l,{unit:"quarter"});case"qqq":return j.quarter(l,{width:"abbreviated",context:"standalone"})||j.quarter(l,{width:"narrow",context:"standalone"});case"qqqqq":return j.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return j.quarter(l,{width:"wide",context:"standalone"})||j.quarter(l,{width:"abbreviated",context:"standalone"})||j.quarter(l,{width:"narrow",context:"standalone"})}}validate(l,z){return z>=1&&z<=4}set(l,z,j){return l.setMonth((j-1)*3,1),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class Lft extends Ah{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(l,z,j){const J=mt=>mt-1;switch(z){case"M":return jd(ad(Nd.month,l),J);case"MM":return jd(wd(2,l),J);case"Mo":return jd(j.ordinalNumber(l,{unit:"month"}),J);case"MMM":return j.month(l,{width:"abbreviated",context:"formatting"})||j.month(l,{width:"narrow",context:"formatting"});case"MMMMM":return j.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return j.month(l,{width:"wide",context:"formatting"})||j.month(l,{width:"abbreviated",context:"formatting"})||j.month(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=0&&z<=11}set(l,z,j){return l.setMonth(j,1),l.setHours(0,0,0,0),l}}class Pft extends Ah{priority=110;parse(l,z,j){const J=mt=>mt-1;switch(z){case"L":return jd(ad(Nd.month,l),J);case"LL":return jd(wd(2,l),J);case"Lo":return jd(j.ordinalNumber(l,{unit:"month"}),J);case"LLL":return j.month(l,{width:"abbreviated",context:"standalone"})||j.month(l,{width:"narrow",context:"standalone"});case"LLLLL":return j.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return j.month(l,{width:"wide",context:"standalone"})||j.month(l,{width:"abbreviated",context:"standalone"})||j.month(l,{width:"narrow",context:"standalone"})}}validate(l,z){return z>=0&&z<=11}set(l,z,j){return l.setMonth(j,1),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function zft(d,l,z){const j=Vu(d,z?.in),J=OD(j,z)-l;return j.setDate(j.getDate()-J*7),Vu(j,z?.in)}class Ift extends Ah{priority=100;parse(l,z,j){switch(z){case"w":return ad(Nd.week,l);case"wo":return j.ordinalNumber(l,{unit:"week"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=53}set(l,z,j,J){return fg(zft(l,j,J),J)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function Oft(d,l,z){const j=Vu(d,z?.in),J=ID(j,z)-l;return j.setDate(j.getDate()-J*7),j}class Dft extends Ah{priority=100;parse(l,z,j){switch(z){case"I":return ad(Nd.week,l);case"Io":return j.ordinalNumber(l,{unit:"week"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=53}set(l,z,j){return v_(Oft(l,j))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Fft=[31,28,31,30,31,30,31,31,30,31,30,31],Rft=[31,29,31,30,31,30,31,31,30,31,30,31];class Bft extends Ah{priority=90;subPriority=1;parse(l,z,j){switch(z){case"d":return ad(Nd.date,l);case"do":return j.ordinalNumber(l,{unit:"date"});default:return wd(z.length,l)}}validate(l,z){const j=l.getFullYear(),J=UD(j),mt=l.getMonth();return J?z>=1&&z<=Rft[mt]:z>=1&&z<=Fft[mt]}set(l,z,j){return l.setDate(j),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Nft extends Ah{priority=90;subpriority=1;parse(l,z,j){switch(z){case"D":case"DD":return ad(Nd.dayOfYear,l);case"Do":return j.ordinalNumber(l,{unit:"date"});default:return wd(z.length,l)}}validate(l,z){const j=l.getFullYear();return UD(j)?z>=1&&z<=366:z>=1&&z<=365}set(l,z,j){return l.setMonth(0,j),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function bM(d,l,z){const j=Ly(),J=z?.weekStartsOn??z?.locale?.options?.weekStartsOn??j.weekStartsOn??j.locale?.options?.weekStartsOn??0,mt=Vu(d,z?.in),kt=mt.getDay(),Gt=(l%7+7)%7,re=7-J,pe=l<0||l>6?l-(kt+re)%7:(Gt+re)%7-(kt+re)%7;return Y4(mt,pe,z)}class jft extends Ah{priority=90;parse(l,z,j){switch(z){case"E":case"EE":case"EEE":return j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"EEEEE":return j.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"EEEE":default:return j.day(l,{width:"wide",context:"formatting"})||j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=0&&z<=6}set(l,z,j,J){return l=bM(l,j,J),l.setHours(0,0,0,0),l}incompatibleTokens=["D","i","e","c","t","T"]}class Uft extends Ah{priority=90;parse(l,z,j,J){const mt=kt=>{const Dt=Math.floor((kt-1)/7)*7;return(kt+J.weekStartsOn+6)%7+Dt};switch(z){case"e":case"ee":return jd(wd(z.length,l),mt);case"eo":return jd(j.ordinalNumber(l,{unit:"day"}),mt);case"eee":return j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"eeeee":return j.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"eeee":default:return j.day(l,{width:"wide",context:"formatting"})||j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=0&&z<=6}set(l,z,j,J){return l=bM(l,j,J),l.setHours(0,0,0,0),l}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Vft extends Ah{priority=90;parse(l,z,j,J){const mt=kt=>{const Dt=Math.floor((kt-1)/7)*7;return(kt+J.weekStartsOn+6)%7+Dt};switch(z){case"c":case"cc":return jd(wd(z.length,l),mt);case"co":return jd(j.ordinalNumber(l,{unit:"day"}),mt);case"ccc":return j.day(l,{width:"abbreviated",context:"standalone"})||j.day(l,{width:"short",context:"standalone"})||j.day(l,{width:"narrow",context:"standalone"});case"ccccc":return j.day(l,{width:"narrow",context:"standalone"});case"cccccc":return j.day(l,{width:"short",context:"standalone"})||j.day(l,{width:"narrow",context:"standalone"});case"cccc":default:return j.day(l,{width:"wide",context:"standalone"})||j.day(l,{width:"abbreviated",context:"standalone"})||j.day(l,{width:"short",context:"standalone"})||j.day(l,{width:"narrow",context:"standalone"})}}validate(l,z){return z>=0&&z<=6}set(l,z,j,J){return l=bM(l,j,J),l.setHours(0,0,0,0),l}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Hft(d,l,z){const j=Vu(d,z?.in),J=vft(j,z),mt=l-J;return Y4(j,mt,z)}class Wft extends Ah{priority=90;parse(l,z,j){const J=mt=>mt===0?7:mt;switch(z){case"i":case"ii":return wd(z.length,l);case"io":return j.ordinalNumber(l,{unit:"day"});case"iii":return jd(j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"}),J);case"iiiii":return jd(j.day(l,{width:"narrow",context:"formatting"}),J);case"iiiiii":return jd(j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"}),J);case"iiii":default:return jd(j.day(l,{width:"wide",context:"formatting"})||j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"}),J)}}validate(l,z){return z>=1&&z<=7}set(l,z,j){return l=Hft(l,j),l.setHours(0,0,0,0),l}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class qft extends Ah{priority=80;parse(l,z,j){switch(z){case"a":case"aa":case"aaa":return j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaaa":return j.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return j.dayPeriod(l,{width:"wide",context:"formatting"})||j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"})}}set(l,z,j){return l.setHours(_M(j),0,0,0),l}incompatibleTokens=["b","B","H","k","t","T"]}class Zft extends Ah{priority=80;parse(l,z,j){switch(z){case"b":case"bb":case"bbb":return j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbbb":return j.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return j.dayPeriod(l,{width:"wide",context:"formatting"})||j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"})}}set(l,z,j){return l.setHours(_M(j),0,0,0),l}incompatibleTokens=["a","B","H","k","t","T"]}class $ft extends Ah{priority=80;parse(l,z,j){switch(z){case"B":case"BB":case"BBB":return j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBBB":return j.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return j.dayPeriod(l,{width:"wide",context:"formatting"})||j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"})}}set(l,z,j){return l.setHours(_M(j),0,0,0),l}incompatibleTokens=["a","b","t","T"]}class Gft extends Ah{priority=70;parse(l,z,j){switch(z){case"h":return ad(Nd.hour12h,l);case"ho":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=12}set(l,z,j){const J=l.getHours()>=12;return J&&j<12?l.setHours(j+12,0,0,0):!J&&j===12?l.setHours(0,0,0,0):l.setHours(j,0,0,0),l}incompatibleTokens=["H","K","k","t","T"]}class Yft extends Ah{priority=70;parse(l,z,j){switch(z){case"H":return ad(Nd.hour23h,l);case"Ho":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=23}set(l,z,j){return l.setHours(j,0,0,0),l}incompatibleTokens=["a","b","h","K","k","t","T"]}class Kft extends Ah{priority=70;parse(l,z,j){switch(z){case"K":return ad(Nd.hour11h,l);case"Ko":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=11}set(l,z,j){return l.getHours()>=12&&j<12?l.setHours(j+12,0,0,0):l.setHours(j,0,0,0),l}incompatibleTokens=["h","H","k","t","T"]}class Xft extends Ah{priority=70;parse(l,z,j){switch(z){case"k":return ad(Nd.hour24h,l);case"ko":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=24}set(l,z,j){const J=j<=24?j%24:j;return l.setHours(J,0,0,0),l}incompatibleTokens=["a","b","h","H","K","t","T"]}class Jft extends Ah{priority=60;parse(l,z,j){switch(z){case"m":return ad(Nd.minute,l);case"mo":return j.ordinalNumber(l,{unit:"minute"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=59}set(l,z,j){return l.setMinutes(j,0,0),l}incompatibleTokens=["t","T"]}class Qft extends Ah{priority=50;parse(l,z,j){switch(z){case"s":return ad(Nd.second,l);case"so":return j.ordinalNumber(l,{unit:"second"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=59}set(l,z,j){return l.setSeconds(j,0),l}incompatibleTokens=["t","T"]}class tdt extends Ah{priority=30;parse(l,z){const j=J=>Math.trunc(J*Math.pow(10,-z.length+3));return jd(wd(z.length,l),j)}set(l,z,j){return l.setMilliseconds(j),l}incompatibleTokens=["t","T"]}class edt extends Ah{priority=10;parse(l,z){switch(z){case"X":return lg(sg.basicOptionalMinutes,l);case"XX":return lg(sg.basic,l);case"XXXX":return lg(sg.basicOptionalSeconds,l);case"XXXXX":return lg(sg.extendedOptionalSeconds,l);case"XXX":default:return lg(sg.extended,l)}}set(l,z,j){return z.timestampIsSet?l:bd(l,l.getTime()-y4(l)-j)}incompatibleTokens=["t","T","x"]}class rdt extends Ah{priority=10;parse(l,z){switch(z){case"x":return lg(sg.basicOptionalMinutes,l);case"xx":return lg(sg.basic,l);case"xxxx":return lg(sg.basicOptionalSeconds,l);case"xxxxx":return lg(sg.extendedOptionalSeconds,l);case"xxx":default:return lg(sg.extended,l)}}set(l,z,j){return z.timestampIsSet?l:bd(l,l.getTime()-y4(l)-j)}incompatibleTokens=["t","T","X"]}class ndt extends Ah{priority=40;parse(l){return ND(l)}set(l,z,j){return[bd(l,j*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class idt extends Ah{priority=20;parse(l){return ND(l)}set(l,z,j){return[bd(l,j),{timestampIsSet:!0}]}incompatibleTokens="*"}const adt={G:new kft,y:new Tft,Y:new Aft,R:new Mft,u:new Sft,Q:new Eft,q:new Cft,M:new Lft,L:new Pft,w:new Ift,I:new Dft,d:new Bft,D:new Nft,E:new jft,e:new Uft,c:new Vft,i:new Wft,a:new qft,b:new Zft,B:new $ft,h:new Gft,H:new Yft,K:new Kft,k:new Xft,m:new Jft,s:new Qft,S:new tdt,X:new edt,x:new rdt,t:new ndt,T:new idt},odt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sdt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ldt=/^'([^]*?)'?$/,udt=/''/g,cdt=/\S/,hdt=/[a-zA-Z]/;function fdt(d,l,z,j){const J=()=>bd(j?.in||z,NaN),mt=gft(),kt=j?.locale??mt.locale??zD,Dt=j?.firstWeekContainsDate??j?.locale?.options?.firstWeekContainsDate??mt.firstWeekContainsDate??mt.locale?.options?.firstWeekContainsDate??1,Gt=j?.weekStartsOn??j?.locale?.options?.weekStartsOn??mt.weekStartsOn??mt.locale?.options?.weekStartsOn??0;if(!l)return d?J():Vu(z,j?.in);const re={firstWeekContainsDate:Dt,weekStartsOn:Gt,locale:kt},pe=[new wft(j?.in,z)],Ne=l.match(sdt).map(Wr=>{const An=Wr[0];if(An in AA){const Ft=AA[An];return Ft(Wr,kt.formatLong)}return Wr}).join("").match(odt),or=[];for(let Wr of Ne){!j?.useAdditionalWeekYearTokens&&RD(Wr)&&MA(Wr,l,d),!j?.useAdditionalDayOfYearTokens&&FD(Wr)&&MA(Wr,l,d);const An=Wr[0],Ft=adt[An];if(Ft){const{incompatibleTokens:kn}=Ft;if(Array.isArray(kn)){const jn=or.find(ai=>kn.includes(ai.token)||ai.token===An);if(jn)throw new RangeError(`The format string mustn't contain \`${jn.fullToken}\` and \`${Wr}\` at the same time`)}else if(Ft.incompatibleTokens==="*"&&or.length>0)throw new RangeError(`The format string mustn't contain \`${Wr}\` and any other token at the same time`);or.push({token:An,fullToken:Wr});const ei=Ft.run(d,Wr,kt.match,re);if(!ei)return J();pe.push(ei.setter),d=ei.rest}else{if(An.match(hdt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+An+"`");if(Wr==="''"?Wr="'":An==="'"&&(Wr=ddt(Wr)),d.indexOf(Wr)===0)d=d.slice(Wr.length);else return J()}}if(d.length>0&&cdt.test(d))return J();const _r=pe.map(Wr=>Wr.priority).sort((Wr,An)=>An-Wr).filter((Wr,An,Ft)=>Ft.indexOf(Wr)===An).map(Wr=>pe.filter(An=>An.priority===Wr).sort((An,Ft)=>Ft.subPriority-An.subPriority)).map(Wr=>Wr[0]);let Fr=Vu(z,j?.in);if(isNaN(+Fr))return J();const zr={};for(const Wr of _r){if(!Wr.validate(Fr,re))return J();const An=Wr.set(Fr,zr,re);Array.isArray(An)?(Fr=An[0],Object.assign(zr,An[1])):Fr=An}return Fr}function ddt(d){return d.match(ldt)[1].replace(udt,"'")}function pdt(d,l){const z=Vu(d,l?.in);return z.setMinutes(0,0,0),z}function mdt(d,l){const z=Vu(d,l?.in);return z.setSeconds(0,0),z}function gdt(d,l){const z=Vu(d,l?.in);return z.setMilliseconds(0),z}function vdt(d,l){const z=()=>bd(l?.in,NaN),j=l?.additionalDigits??2,J=bdt(d);let mt;if(J.date){const re=wdt(J.date,j);mt=kdt(re.restDateString,re.year)}if(!mt||isNaN(+mt))return z();const kt=+mt;let Dt=0,Gt;if(J.time&&(Dt=Tdt(J.time),isNaN(Dt)))return z();if(J.timezone){if(Gt=Adt(J.timezone),isNaN(Gt))return z()}else{const re=new Date(kt+Dt),pe=Vu(0,l?.in);return pe.setFullYear(re.getUTCFullYear(),re.getUTCMonth(),re.getUTCDate()),pe.setHours(re.getUTCHours(),re.getUTCMinutes(),re.getUTCSeconds(),re.getUTCMilliseconds()),pe}return Vu(kt+Dt+Gt,l?.in)}const j5={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ydt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,xdt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,_dt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function bdt(d){const l={},z=d.split(j5.dateTimeDelimiter);let j;if(z.length>2)return l;if(/:/.test(z[0])?j=z[0]:(l.date=z[0],j=z[1],j5.timeZoneDelimiter.test(l.date)&&(l.date=d.split(j5.timeZoneDelimiter)[0],j=d.substr(l.date.length,d.length))),j){const J=j5.timezone.exec(j);J?(l.time=j.replace(J[1],""),l.timezone=J[1]):l.time=j}return l}function wdt(d,l){const z=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+l)+"})|(\\d{2}|[+-]\\d{"+(2+l)+"})$)"),j=d.match(z);if(!j)return{year:NaN,restDateString:""};const J=j[1]?parseInt(j[1]):null,mt=j[2]?parseInt(j[2]):null;return{year:mt===null?J:mt*100,restDateString:d.slice((j[1]||j[2]).length)}}function kdt(d,l){if(l===null)return new Date(NaN);const z=d.match(ydt);if(!z)return new Date(NaN);const j=!!z[4],J=l2(z[1]),mt=l2(z[2])-1,kt=l2(z[3]),Dt=l2(z[4]),Gt=l2(z[5])-1;if(j)return Ldt(l,Dt,Gt)?Mdt(l,Dt,Gt):new Date(NaN);{const re=new Date(0);return!Edt(l,mt,kt)||!Cdt(l,J)?new Date(NaN):(re.setUTCFullYear(l,mt,Math.max(J,kt)),re)}}function l2(d){return d?parseInt(d):1}function Tdt(d){const l=d.match(xdt);if(!l)return NaN;const z=q8(l[1]),j=q8(l[2]),J=q8(l[3]);return Pdt(z,j,J)?z*aw+j*iw+J*1e3:NaN}function q8(d){return d&&parseFloat(d.replace(",","."))||0}function Adt(d){if(d==="Z")return 0;const l=d.match(_dt);if(!l)return 0;const z=l[1]==="+"?-1:1,j=parseInt(l[2]),J=l[3]&&parseInt(l[3])||0;return zdt(j,J)?z*(j*aw+J*iw):NaN}function Mdt(d,l,z){const j=new Date(0);j.setUTCFullYear(d,0,4);const J=j.getUTCDay()||7,mt=(l-1)*7+z+1-J;return j.setUTCDate(j.getUTCDate()+mt),j}const Sdt=[31,null,31,30,31,30,31,31,30,31,30,31];function VD(d){return d%400===0||d%4===0&&d%100!==0}function Edt(d,l,z){return l>=0&&l<=11&&z>=1&&z<=(Sdt[l]||(VD(d)?29:28))}function Cdt(d,l){return l>=1&&l<=(VD(d)?366:365)}function Ldt(d,l,z){return l>=1&&l<=53&&z>=0&&z<=6}function Pdt(d,l,z){return d===24?l===0&&z===0:z>=0&&z<60&&l>=0&&l<60&&d>=0&&d<25}function zdt(d,l){return l>=0&&l<=59}/*!
* chartjs-adapter-date-fns v3.0.0
* https://www.chartjs.org
* (c) 2022 chartjs-adapter-date-fns Contributors
* Released under the MIT license
*/const Idt={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};aD._date.override({_id:"date-fns",formats:function(){return Idt},parse:function(d,l){if(d===null||typeof d>"u")return null;const z=typeof d;return z==="number"||d instanceof Date?d=Vu(d):z==="string"&&(typeof l=="string"?d=fdt(d,l,new Date,this.options):d=vdt(d,this.options)),MD(d)?d.getTime():null},format:function(d,l){return pft(d,l,this.options)},add:function(d,l,z){switch(z){case"millisecond":return vM(d,l);case"second":return nht(d,l);case"minute":return eht(d,l);case"hour":return Jct(d,l);case"day":return Y4(d,l);case"week":return iht(d,l);case"month":return gM(d,l);case"quarter":return rht(d,l);case"year":return aht(d,l);default:return d}},diff:function(d,l,z){switch(z){case"millisecond":return yM(d,l);case"second":return dht(d,l);case"minute":return cht(d,l);case"hour":return uht(d,l);case"day":return SD(d,l);case"week":return pht(d,l);case"month":return LD(d,l);case"quarter":return fht(d,l);case"year":return mht(d,l);default:return 0}},startOf:function(d,l,z){switch(l){case"second":return gdt(d);case"minute":return mdt(d);case"hour":return pdt(d);case"day":return TA(d);case"week":return fg(d);case"isoWeek":return fg(d,{weekStartsOn:+z});case"month":return vht(d);case"quarter":return ght(d);case"year":return PD(d);default:return d}},endOf:function(d,l){switch(l){case"second":return kht(d);case"minute":return bht(d);case"hour":return xht(d);case"day":return ED(d);case"week":return _ht(d);case"month":return CD(d);case"quarter":return wht(d);case"year":return yht(d);default:return d}}});var J5={exports:{}},Odt=J5.exports,hz;function Ddt(){return hz||(hz=1,function(d){var l={};(function(z,j){d.exports?d.exports=j():z.moduleName=j()})(typeof self<"u"?self:Odt,()=>{var z=(()=>{var j=Object.create,J=Object.defineProperty,mt=Object.defineProperties,kt=Object.getOwnPropertyDescriptor,Dt=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertyNames,re=Object.getOwnPropertySymbols,pe=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty,or=Object.prototype.propertyIsEnumerable,_r=(Q,$,c)=>$ in Q?J(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:c}):Q[$]=c,Fr=(Q,$)=>{for(var c in $||($={}))Ne.call($,c)&&_r(Q,c,$[c]);if(re)for(var c of re($))or.call($,c)&&_r(Q,c,$[c]);return Q},zr=(Q,$)=>mt(Q,Dt($)),Wr=(Q,$)=>{var c={};for(var g in Q)Ne.call(Q,g)&&$.indexOf(g)<0&&(c[g]=Q[g]);if(Q!=null&&re)for(var g of re(Q))$.indexOf(g)<0&&or.call(Q,g)&&(c[g]=Q[g]);return c},An=(Q,$)=>()=>(Q&&($=Q(Q=0)),$),Ft=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports),kn=(Q,$)=>{for(var c in $)J(Q,c,{get:$[c],enumerable:!0})},ei=(Q,$,c,g)=>{if($&&typeof $=="object"||typeof $=="function")for(let P of Gt($))!Ne.call(Q,P)&&P!==c&&J(Q,P,{get:()=>$[P],enumerable:!(g=kt($,P))||g.enumerable});return Q},jn=(Q,$,c)=>(c=Q!=null?j(pe(Q)):{},ei(J(c,"default",{value:Q,enumerable:!0}),Q)),ai=Q=>ei(J({},"__esModule",{value:!0}),Q),Qi=Ft(Q=>{Q.version="3.2.0"}),Gi=Ft((Q,$)=>{(function(c,g,P){g[c]=g[c]||P(),typeof $<"u"&&$.exports&&($.exports=g[c])})("Promise",typeof window<"u"?window:Q,function(){var c,g,P,S=Object.prototype.toString,t=typeof setImmediate<"u"?function(T){return setImmediate(T)}:setTimeout;try{Object.defineProperty({},"x",{}),c=function(T,u,b,_){return Object.defineProperty(T,u,{value:b,writable:!0,configurable:_!==!1})}}catch{c=function(u,b,_){return u[b]=_,u}}P=function(){var T,u,b;function _(C,M){this.fn=C,this.self=M,this.next=void 0}return{add:function(C,M){b=new _(C,M),u?u.next=b:T=b,u=b,b=void 0},drain:function(){var C=T;for(T=u=g=void 0;C;)C.fn.call(C.self),C=C.next}}}();function e(T,u){P.add(T,u),g||(g=t(P.drain))}function r(T){var u,b=typeof T;return T!=null&&(b=="object"||b=="function")&&(u=T.then),typeof u=="function"?u:!1}function a(){for(var T=0;T<this.chain.length;T++)n(this,this.state===1?this.chain[T].success:this.chain[T].failure,this.chain[T]);this.chain.length=0}function n(T,u,b){var _,C;try{u===!1?b.reject(T.msg):(u===!0?_=T.msg:_=u.call(void 0,T.msg),_===b.promise?b.reject(TypeError("Promise-chain cycle")):(C=r(_))?C.call(_,b.resolve,b.reject):b.resolve(_))}catch(M){b.reject(M)}}function o(T){var u,b=this;if(!b.triggered){b.triggered=!0,b.def&&(b=b.def);try{(u=r(T))?e(function(){var _=new f(b);try{u.call(T,function(){o.apply(_,arguments)},function(){i.apply(_,arguments)})}catch(C){i.call(_,C)}}):(b.msg=T,b.state=1,b.chain.length>0&&e(a,b))}catch(_){i.call(new f(b),_)}}}function i(T){var u=this;u.triggered||(u.triggered=!0,u.def&&(u=u.def),u.msg=T,u.state=2,u.chain.length>0&&e(a,u))}function s(T,u,b,_){for(var C=0;C<u.length;C++)(function(M){T.resolve(u[M]).then(function(E){b(M,E)},_)})(C)}function f(T){this.def=T,this.triggered=!1}function x(T){this.promise=T,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function y(T){if(typeof T!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var u=new x(this);this.then=function(b,_){var C={success:typeof b=="function"?b:!0,failure:typeof _=="function"?_:!1};return C.promise=new this.constructor(function(M,E){if(typeof M!="function"||typeof E!="function")throw TypeError("Not a function");C.resolve=M,C.reject=E}),u.chain.push(C),u.state!==0&&e(a,u),C.promise},this.catch=function(b){return this.then(void 0,b)};try{T.call(void 0,function(b){o.call(u,b)},function(b){i.call(u,b)})}catch(b){i.call(u,b)}}var v=c({},"constructor",y,!1);return y.prototype=v,c(v,"__NPO__",0,!1),c(y,"resolve",function(T){var u=this;return T&&typeof T=="object"&&T.__NPO__===1?T:new u(function(b,_){if(typeof b!="function"||typeof _!="function")throw TypeError("Not a function");b(T)})}),c(y,"reject",function(T){return new this(function(u,b){if(typeof u!="function"||typeof b!="function")throw TypeError("Not a function");b(T)})}),c(y,"all",function(T){var u=this;return S.call(T)!="[object Array]"?u.reject(TypeError("Not an array")):T.length===0?u.resolve([]):new u(function(b,_){if(typeof b!="function"||typeof _!="function")throw TypeError("Not a function");var C=T.length,M=Array(C),E=0;s(u,T,function(A,h){M[A]=h,++E===C&&b(M)},_)})}),c(y,"race",function(T){var u=this;return S.call(T)!="[object Array]"?u.reject(TypeError("Not an array")):new u(function(b,_){if(typeof b!="function"||typeof _!="function")throw TypeError("Not a function");s(u,T,function(C,M){b(M)},_)})}),y})}),un=Ft((Q,$)=>{(function(){var c={version:"3.8.2"},g=[].slice,P=function(At){return g.call(At)},S=self.document;function t(At){return At&&(At.ownerDocument||At.document||At).documentElement}function e(At){return At&&(At.ownerDocument&&At.ownerDocument.defaultView||At.document&&At||At.defaultView)}if(S)try{P(S.documentElement.childNodes)[0].nodeType}catch{P=function(jt){for(var ue=jt.length,Me=new Array(ue);ue--;)Me[ue]=jt[ue];return Me}}if(Date.now||(Date.now=function(){return+new Date}),S)try{S.createElement("DIV").style.setProperty("opacity",0,"")}catch{var r=this.Element.prototype,a=r.setAttribute,n=r.setAttributeNS,o=this.CSSStyleDeclaration.prototype,i=o.setProperty;r.setAttribute=function(jt,ue){a.call(this,jt,ue+"")},r.setAttributeNS=function(jt,ue,Me){n.call(this,jt,ue,Me+"")},o.setProperty=function(jt,ue,Me){i.call(this,jt,ue+"",Me)}}c.ascending=s;function s(At,jt){return At<jt?-1:At>jt?1:At>=jt?0:NaN}c.descending=function(At,jt){return jt<At?-1:jt>At?1:jt>=At?0:NaN},c.min=function(At,jt){var ue=-1,Me=At.length,Le,Be;if(arguments.length===1){for(;++ue<Me;)if((Be=At[ue])!=null&&Be>=Be){Le=Be;break}for(;++ue<Me;)(Be=At[ue])!=null&&Le>Be&&(Le=Be)}else{for(;++ue<Me;)if((Be=jt.call(At,At[ue],ue))!=null&&Be>=Be){Le=Be;break}for(;++ue<Me;)(Be=jt.call(At,At[ue],ue))!=null&&Le>Be&&(Le=Be)}return Le},c.max=function(At,jt){var ue=-1,Me=At.length,Le,Be;if(arguments.length===1){for(;++ue<Me;)if((Be=At[ue])!=null&&Be>=Be){Le=Be;break}for(;++ue<Me;)(Be=At[ue])!=null&&Be>Le&&(Le=Be)}else{for(;++ue<Me;)if((Be=jt.call(At,At[ue],ue))!=null&&Be>=Be){Le=Be;break}for(;++ue<Me;)(Be=jt.call(At,At[ue],ue))!=null&&Be>Le&&(Le=Be)}return Le},c.extent=function(At,jt){var ue=-1,Me=At.length,Le,Be,sr;if(arguments.length===1){for(;++ue<Me;)if((Be=At[ue])!=null&&Be>=Be){Le=sr=Be;break}for(;++ue<Me;)(Be=At[ue])!=null&&(Le>Be&&(Le=Be),sr<Be&&(sr=Be))}else{for(;++ue<Me;)if((Be=jt.call(At,At[ue],ue))!=null&&Be>=Be){Le=sr=Be;break}for(;++ue<Me;)(Be=jt.call(At,At[ue],ue))!=null&&(Le>Be&&(Le=Be),sr<Be&&(sr=Be))}return[Le,sr]};function f(At){return At===null?NaN:+At}function x(At){return!isNaN(At)}c.sum=function(At,jt){var ue=0,Me=At.length,Le,Be=-1;if(arguments.length===1)for(;++Be<Me;)x(Le=+At[Be])&&(ue+=Le);else for(;++Be<Me;)x(Le=+jt.call(At,At[Be],Be))&&(ue+=Le);return ue},c.mean=function(At,jt){var ue=0,Me=At.length,Le,Be=-1,sr=Me;if(arguments.length===1)for(;++Be<Me;)x(Le=f(At[Be]))?ue+=Le:--sr;else for(;++Be<Me;)x(Le=f(jt.call(At,At[Be],Be)))?ue+=Le:--sr;if(sr)return ue/sr},c.quantile=function(At,jt){var ue=(At.length-1)*jt+1,Me=Math.floor(ue),Le=+At[Me-1],Be=ue-Me;return Be?Le+Be*(At[Me]-Le):Le},c.median=function(At,jt){var ue=[],Me=At.length,Le,Be=-1;if(arguments.length===1)for(;++Be<Me;)x(Le=f(At[Be]))&&ue.push(Le);else for(;++Be<Me;)x(Le=f(jt.call(At,At[Be],Be)))&&ue.push(Le);if(ue.length)return c.quantile(ue.sort(s),.5)},c.variance=function(At,jt){var ue=At.length,Me=0,Le,Be,sr=0,ir=-1,Mr=0;if(arguments.length===1)for(;++ir<ue;)x(Le=f(At[ir]))&&(Be=Le-Me,Me+=Be/++Mr,sr+=Be*(Le-Me));else for(;++ir<ue;)x(Le=f(jt.call(At,At[ir],ir)))&&(Be=Le-Me,Me+=Be/++Mr,sr+=Be*(Le-Me));if(Mr>1)return sr/(Mr-1)},c.deviation=function(){var At=c.variance.apply(this,arguments);return At&&Math.sqrt(At)};function y(At){return{left:function(jt,ue,Me,Le){for(arguments.length<3&&(Me=0),arguments.length<4&&(Le=jt.length);Me<Le;){var Be=Me+Le>>>1;At(jt[Be],ue)<0?Me=Be+1:Le=Be}return Me},right:function(jt,ue,Me,Le){for(arguments.length<3&&(Me=0),arguments.length<4&&(Le=jt.length);Me<Le;){var Be=Me+Le>>>1;At(jt[Be],ue)>0?Le=Be:Me=Be+1}return Me}}}var v=y(s);c.bisectLeft=v.left,c.bisect=c.bisectRight=v.right,c.bisector=function(At){return y(At.length===1?function(jt,ue){return s(At(jt),ue)}:At)},c.shuffle=function(At,jt,ue){(Me=arguments.length)<3&&(ue=At.length,Me<2&&(jt=0));for(var Me=ue-jt,Le,Be;Me;)Be=Math.random()*Me--|0,Le=At[Me+jt],At[Me+jt]=At[Be+jt],At[Be+jt]=Le;return At},c.permute=function(At,jt){for(var ue=jt.length,Me=new Array(ue);ue--;)Me[ue]=At[jt[ue]];return Me},c.pairs=function(At){for(var jt=0,ue=At.length-1,Me,Le=At[0],Be=new Array(ue<0?0:ue);jt<ue;)Be[jt]=[Me=Le,Le=At[++jt]];return Be},c.transpose=function(At){if(!(Be=At.length))return[];for(var jt=-1,ue=c.min(At,T),Me=new Array(ue);++jt<ue;)for(var Le=-1,Be,sr=Me[jt]=new Array(Be);++Le<Be;)sr[Le]=At[Le][jt];return Me};function T(At){return At.length}c.zip=function(){return c.transpose(arguments)},c.keys=function(At){var jt=[];for(var ue in At)jt.push(ue);return jt},c.values=function(At){var jt=[];for(var ue in At)jt.push(At[ue]);return jt},c.entries=function(At){var jt=[];for(var ue in At)jt.push({key:ue,value:At[ue]});return jt},c.merge=function(At){for(var jt=At.length,ue,Me=-1,Le=0,Be,sr;++Me<jt;)Le+=At[Me].length;for(Be=new Array(Le);--jt>=0;)for(sr=At[jt],ue=sr.length;--ue>=0;)Be[--Le]=sr[ue];return Be};var u=Math.abs;c.range=function(At,jt,ue){if(arguments.length<3&&(ue=1,arguments.length<2&&(jt=At,At=0)),(jt-At)/ue===1/0)throw new Error("infinite range");var Me=[],Le=b(u(ue)),Be=-1,sr;if(At*=Le,jt*=Le,ue*=Le,ue<0)for(;(sr=At+ue*++Be)>jt;)Me.push(sr/Le);else for(;(sr=At+ue*++Be)<jt;)Me.push(sr/Le);return Me};function b(At){for(var jt=1;At*jt%1;)jt*=10;return jt}function _(At,jt){for(var ue in jt)Object.defineProperty(At.prototype,ue,{value:jt[ue],enumerable:!1})}c.map=function(At,jt){var ue=new C;if(At instanceof C)At.forEach(function(ir,Mr){ue.set(ir,Mr)});else if(Array.isArray(At)){var Me=-1,Le=At.length,Be;if(arguments.length===1)for(;++Me<Le;)ue.set(Me,At[Me]);else for(;++Me<Le;)ue.set(jt.call(At,Be=At[Me],Me),Be)}else for(var sr in At)ue.set(sr,At[sr]);return ue};function C(){this._=Object.create(null)}var M="__proto__",E="\0";_(C,{has:p,get:function(At){return this._[A(At)]},set:function(At,jt){return this._[A(At)]=jt},remove:k,keys:w,values:function(){var At=[];for(var jt in this._)At.push(this._[jt]);return At},entries:function(){var At=[];for(var jt in this._)At.push({key:h(jt),value:this._[jt]});return At},size:R,empty:O,forEach:function(At){for(var jt in this._)At.call(this,h(jt),this._[jt])}});function A(At){return(At+="")===M||At[0]===E?E+At:At}function h(At){return(At+="")[0]===E?At.slice(1):At}function p(At){return A(At)in this._}function k(At){return(At=A(At))in this._&&delete this._[At]}function w(){var At=[];for(var jt in this._)At.push(h(jt));return At}function R(){var At=0;for(var jt in this._)++At;return At}function O(){for(var At in this._)return!1;return!0}c.nest=function(){var At={},jt=[],ue=[],Me,Le;function Be(ir,Mr,en){if(en>=jt.length)return Le?Le.call(At,Mr):Me?Mr.sort(Me):Mr;for(var Xr=-1,vn=Mr.length,In=jt[en++],On,Bi,Un,mi=new C,Ti;++Xr<vn;)(Ti=mi.get(On=In(Bi=Mr[Xr])))?Ti.push(Bi):mi.set(On,[Bi]);return ir?(Bi=ir(),Un=function(Ii,Wi){Bi.set(Ii,Be(ir,Wi,en))}):(Bi={},Un=function(Ii,Wi){Bi[Ii]=Be(ir,Wi,en)}),mi.forEach(Un),Bi}function sr(ir,Mr){if(Mr>=jt.length)return ir;var en=[],Xr=ue[Mr++];return ir.forEach(function(vn,In){en.push({key:vn,values:sr(In,Mr)})}),Xr?en.sort(function(vn,In){return Xr(vn.key,In.key)}):en}return At.map=function(ir,Mr){return Be(Mr,ir,0)},At.entries=function(ir){return sr(Be(c.map,ir,0),0)},At.key=function(ir){return jt.push(ir),At},At.sortKeys=function(ir){return ue[jt.length-1]=ir,At},At.sortValues=function(ir){return Me=ir,At},At.rollup=function(ir){return Le=ir,At},At},c.set=function(At){var jt=new N;if(At)for(var ue=0,Me=At.length;ue<Me;++ue)jt.add(At[ue]);return jt};function N(){this._=Object.create(null)}_(N,{has:p,add:function(At){return this._[A(At+="")]=!0,At},remove:k,values:w,size:R,empty:O,forEach:function(At){for(var jt in this._)At.call(this,h(jt))}}),c.behavior={};function V(At){return At}c.rebind=function(At,jt){for(var ue=1,Me=arguments.length,Le;++ue<Me;)At[Le=arguments[ue]]=H(At,jt,jt[Le]);return At};function H(At,jt,ue){return function(){var Me=ue.apply(jt,arguments);return Me===jt?At:Me}}function F(At,jt){if(jt in At)return jt;jt=jt.charAt(0).toUpperCase()+jt.slice(1);for(var ue=0,Me=U.length;ue<Me;++ue){var Le=U[ue]+jt;if(Le in At)return Le}}var U=["webkit","ms","moz","Moz","o","O"];function W(){}c.dispatch=function(){for(var At=new q,jt=-1,ue=arguments.length;++jt<ue;)At[arguments[jt]]=X(At);return At};function q(){}q.prototype.on=function(At,jt){var ue=At.indexOf("."),Me="";if(ue>=0&&(Me=At.slice(ue+1),At=At.slice(0,ue)),At)return arguments.length<2?this[At].on(Me):this[At].on(Me,jt);if(arguments.length===2){if(jt==null)for(At in this)this.hasOwnProperty(At)&&this[At].on(Me,null);return this}};function X(At){var jt=[],ue=new C;function Me(){for(var Le=jt,Be=-1,sr=Le.length,ir;++Be<sr;)(ir=Le[Be].on)&&ir.apply(this,arguments);return At}return Me.on=function(Le,Be){var sr=ue.get(Le),ir;return arguments.length<2?sr&&sr.on:(sr&&(sr.on=null,jt=jt.slice(0,ir=jt.indexOf(sr)).concat(jt.slice(ir+1)),ue.remove(Le)),Be&&jt.push(ue.set(Le,{on:Be})),At)},Me}c.event=null;function lt(){c.event.preventDefault()}function yt(){for(var At=c.event,jt;jt=At.sourceEvent;)At=jt;return At}function pt(At){for(var jt=new q,ue=0,Me=arguments.length;++ue<Me;)jt[arguments[ue]]=X(jt);return jt.of=function(Le,Be){return function(sr){try{var ir=sr.sourceEvent=c.event;sr.target=At,c.event=sr,jt[sr.type].apply(Le,Be)}finally{c.event=ir}}},jt}c.requote=function(At){return At.replace(st,"\\$&")};var st=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,tt={}.__proto__?function(At,jt){At.__proto__=jt}:function(At,jt){for(var ue in jt)At[ue]=jt[ue]};function dt(At){return tt(At,it),At}var rt=function(At,jt){return jt.querySelector(At)},at=function(At,jt){return jt.querySelectorAll(At)},vt=function(At,jt){var ue=At.matches||At[F(At,"matchesSelector")];return vt=function(Me,Le){return ue.call(Me,Le)},vt(At,jt)};typeof Sizzle=="function"&&(rt=function(At,jt){return Sizzle(At,jt)[0]||null},at=Sizzle,vt=Sizzle.matchesSelector),c.selection=function(){return c.select(S.documentElement)};var it=c.selection.prototype=[];it.select=function(At){var jt=[],ue,Me,Le,Be;At=Y(At);for(var sr=-1,ir=this.length;++sr<ir;){jt.push(ue=[]),ue.parentNode=(Le=this[sr]).parentNode;for(var Mr=-1,en=Le.length;++Mr<en;)(Be=Le[Mr])?(ue.push(Me=At.call(Be,Be.__data__,Mr,sr)),Me&&"__data__"in Be&&(Me.__data__=Be.__data__)):ue.push(null)}return dt(jt)};function Y(At){return typeof At=="function"?At:function(){return rt(At,this)}}it.selectAll=function(At){var jt=[],ue,Me;At=ft(At);for(var Le=-1,Be=this.length;++Le<Be;)for(var sr=this[Le],ir=-1,Mr=sr.length;++ir<Mr;)(Me=sr[ir])&&(jt.push(ue=P(At.call(Me,Me.__data__,ir,Le))),ue.parentNode=Me);return dt(jt)};function ft(At){return typeof At=="function"?At:function(){return at(At,this)}}var ut="http://www.w3.org/1999/xhtml",wt={svg:"http://www.w3.org/2000/svg",xhtml:ut,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};c.ns={prefix:wt,qualify:function(At){var jt=At.indexOf(":"),ue=At;return jt>=0&&(ue=At.slice(0,jt))!=="xmlns"&&(At=At.slice(jt+1)),wt.hasOwnProperty(ue)?{space:wt[ue],local:At}:At}},it.attr=function(At,jt){if(arguments.length<2){if(typeof At=="string"){var ue=this.node();return At=c.ns.qualify(At),At.local?ue.getAttributeNS(At.space,At.local):ue.getAttribute(At)}for(jt in At)this.each(zt(jt,At[jt]));return this}return this.each(zt(At,jt))};function zt(At,jt){At=c.ns.qualify(At);function ue(){this.removeAttribute(At)}function Me(){this.removeAttributeNS(At.space,At.local)}function Le(){this.setAttribute(At,jt)}function Be(){this.setAttributeNS(At.space,At.local,jt)}function sr(){var Mr=jt.apply(this,arguments);Mr==null?this.removeAttribute(At):this.setAttribute(At,Mr)}function ir(){var Mr=jt.apply(this,arguments);Mr==null?this.removeAttributeNS(At.space,At.local):this.setAttributeNS(At.space,At.local,Mr)}return jt==null?At.local?Me:ue:typeof jt=="function"?At.local?ir:sr:At.local?Be:Le}function Pt(At){return At.trim().replace(/\s+/g," ")}it.classed=function(At,jt){if(arguments.length<2){if(typeof At=="string"){var ue=this.node(),Me=(At=Ht(At)).length,Le=-1;if(jt=ue.classList){for(;++Le<Me;)if(!jt.contains(At[Le]))return!1}else for(jt=ue.getAttribute("class");++Le<Me;)if(!Wt(At[Le]).test(jt))return!1;return!0}for(jt in At)this.each(Jt(jt,At[jt]));return this}return this.each(Jt(At,jt))};function Wt(At){return new RegExp("(?:^|\\s+)"+c.requote(At)+"(?:\\s+|$)","g")}function Ht(At){return(At+"").trim().split(/^|\s+/)}function Jt(At,jt){At=Ht(At).map(ge);var ue=At.length;function Me(){for(var Be=-1;++Be<ue;)At[Be](this,jt)}function Le(){for(var Be=-1,sr=jt.apply(this,arguments);++Be<ue;)At[Be](this,sr)}return typeof jt=="function"?Le:Me}function ge(At){var jt=Wt(At);return function(ue,Me){if(Le=ue.classList)return Me?Le.add(At):Le.remove(At);var Le=ue.getAttribute("class")||"";Me?(jt.lastIndex=0,jt.test(Le)||ue.setAttribute("class",Pt(Le+" "+At))):ue.setAttribute("class",Pt(Le.replace(jt," ")))}}it.style=function(At,jt,ue){var Me=arguments.length;if(Me<3){if(typeof At!="string"){Me<2&&(jt="");for(ue in At)this.each(he(ue,At[ue],jt));return this}if(Me<2){var Le=this.node();return e(Le).getComputedStyle(Le,null).getPropertyValue(At)}ue=""}return this.each(he(At,jt,ue))};function he(At,jt,ue){function Me(){this.style.removeProperty(At)}function Le(){this.style.setProperty(At,jt,ue)}function Be(){var sr=jt.apply(this,arguments);sr==null?this.style.removeProperty(At):this.style.setProperty(At,sr,ue)}return jt==null?Me:typeof jt=="function"?Be:Le}it.property=function(At,jt){if(arguments.length<2){if(typeof At=="string")return this.node()[At];for(jt in At)this.each(de(jt,At[jt]));return this}return this.each(de(At,jt))};function de(At,jt){function ue(){delete this[At]}function Me(){this[At]=jt}function Le(){var Be=jt.apply(this,arguments);Be==null?delete this[At]:this[At]=Be}return jt==null?ue:typeof jt=="function"?Le:Me}it.text=function(At){return arguments.length?this.each(typeof At=="function"?function(){var jt=At.apply(this,arguments);this.textContent=jt??""}:At==null?function(){this.textContent=""}:function(){this.textContent=At}):this.node().textContent},it.html=function(At){return arguments.length?this.each(typeof At=="function"?function(){var jt=At.apply(this,arguments);this.innerHTML=jt??""}:At==null?function(){this.innerHTML=""}:function(){this.innerHTML=At}):this.node().innerHTML},it.append=function(At){return At=se(At),this.select(function(){return this.appendChild(At.apply(this,arguments))})};function se(At){function jt(){var Me=this.ownerDocument,Le=this.namespaceURI;return Le===ut&&Me.documentElement.namespaceURI===ut?Me.createElement(At):Me.createElementNS(Le,At)}function ue(){return this.ownerDocument.createElementNS(At.space,At.local)}return typeof At=="function"?At:(At=c.ns.qualify(At)).local?ue:jt}it.insert=function(At,jt){return At=se(At),jt=Y(jt),this.select(function(){return this.insertBefore(At.apply(this,arguments),jt.apply(this,arguments)||null)})},it.remove=function(){return this.each(Tt)};function Tt(){var At=this.parentNode;At&&At.removeChild(this)}it.data=function(At,jt){var ue=-1,Me=this.length,Le,Be;if(!arguments.length){for(At=new Array(Me=(Le=this[0]).length);++ue<Me;)(Be=Le[ue])&&(At[ue]=Be.__data__);return At}function sr(Xr,vn){var In,On=Xr.length,Bi=vn.length,Un=Math.min(On,Bi),mi=new Array(Bi),Ti=new Array(Bi),Ii=new Array(On),Wi,Yn;if(jt){var ja=new C,Ha=new Array(On),ro;for(In=-1;++In<On;)(Wi=Xr[In])&&(ja.has(ro=jt.call(Wi,Wi.__data__,In))?Ii[In]=Wi:ja.set(ro,Wi),Ha[In]=ro);for(In=-1;++In<Bi;)(Wi=ja.get(ro=jt.call(vn,Yn=vn[In],In)))?Wi!==!0&&(mi[In]=Wi,Wi.__data__=Yn):Ti[In]=Lt(Yn),ja.set(ro,!0);for(In=-1;++In<On;)In in Ha&&ja.get(Ha[In])!==!0&&(Ii[In]=Xr[In])}else{for(In=-1;++In<Un;)Wi=Xr[In],Yn=vn[In],Wi?(Wi.__data__=Yn,mi[In]=Wi):Ti[In]=Lt(Yn);for(;In<Bi;++In)Ti[In]=Lt(vn[In]);for(;In<On;++In)Ii[In]=Xr[In]}Ti.update=mi,Ti.parentNode=mi.parentNode=Ii.parentNode=Xr.parentNode,ir.push(Ti),Mr.push(mi),en.push(Ii)}var ir=oe([]),Mr=dt([]),en=dt([]);if(typeof At=="function")for(;++ue<Me;)sr(Le=this[ue],At.call(Le,Le.parentNode.__data__,ue));else for(;++ue<Me;)sr(Le=this[ue],At);return Mr.enter=function(){return ir},Mr.exit=function(){return en},Mr};function Lt(At){return{__data__:At}}it.datum=function(At){return arguments.length?this.property("__data__",At):this.property("__data__")},it.filter=function(At){var jt=[],ue,Me,Le;typeof At!="function"&&(At=Mt(At));for(var Be=0,sr=this.length;Be<sr;Be++){jt.push(ue=[]),ue.parentNode=(Me=this[Be]).parentNode;for(var ir=0,Mr=Me.length;ir<Mr;ir++)(Le=Me[ir])&&At.call(Le,Le.__data__,ir,Be)&&ue.push(Le)}return dt(jt)};function Mt(At){return function(){return vt(this,At)}}it.order=function(){for(var At=-1,jt=this.length;++At<jt;)for(var ue=this[At],Me=ue.length-1,Le=ue[Me],Be;--Me>=0;)(Be=ue[Me])&&(Le&&Le!==Be.nextSibling&&Le.parentNode.insertBefore(Be,Le),Le=Be);return this},it.sort=function(At){At=te.apply(this,arguments);for(var jt=-1,ue=this.length;++jt<ue;)this[jt].sort(At);return this.order()};function te(At){return arguments.length||(At=s),function(jt,ue){return jt&&ue?At(jt.__data__,ue.__data__):!jt-!ue}}it.each=function(At){return ve(this,function(jt,ue,Me){At.call(jt,jt.__data__,ue,Me)})};function ve(At,jt){for(var ue=0,Me=At.length;ue<Me;ue++)for(var Le=At[ue],Be=0,sr=Le.length,ir;Be<sr;Be++)(ir=Le[Be])&&jt(ir,Be,ue);return At}it.call=function(At){var jt=P(arguments);return At.apply(jt[0]=this,jt),this},it.empty=function(){return!this.node()},it.node=function(){for(var At=0,jt=this.length;At<jt;At++)for(var ue=this[At],Me=0,Le=ue.length;Me<Le;Me++){var Be=ue[Me];if(Be)return Be}return null},it.size=function(){var At=0;return ve(this,function(){++At}),At};function oe(At){return tt(At,Te),At}var Te=[];c.selection.enter=oe,c.selection.enter.prototype=Te,Te.append=it.append,Te.empty=it.empty,Te.node=it.node,Te.call=it.call,Te.size=it.size,Te.select=function(At){for(var jt=[],ue,Me,Le,Be,sr,ir=-1,Mr=this.length;++ir<Mr;){Le=(Be=this[ir]).update,jt.push(ue=[]),ue.parentNode=Be.parentNode;for(var en=-1,Xr=Be.length;++en<Xr;)(sr=Be[en])?(ue.push(Le[en]=Me=At.call(Be.parentNode,sr.__data__,en,ir)),Me.__data__=sr.__data__):ue.push(null)}return dt(jt)},Te.insert=function(At,jt){return arguments.length<2&&(jt=He(this)),it.insert.call(this,At,jt)};function He(At){var jt,ue;return function(Me,Le,Be){var sr=At[Be].update,ir=sr.length,Mr;for(Be!=ue&&(ue=Be,jt=0),Le>=jt&&(jt=Le+1);!(Mr=sr[jt])&&++jt<ir;);return Mr}}c.select=function(At){var jt;return typeof At=="string"?(jt=[rt(At,S)],jt.parentNode=S.documentElement):(jt=[At],jt.parentNode=t(At)),dt([jt])},c.selectAll=function(At){var jt;return typeof At=="string"?(jt=P(at(At,S)),jt.parentNode=S.documentElement):(jt=P(At),jt.parentNode=null),dt([jt])},it.on=function(At,jt,ue){var Me=arguments.length;if(Me<3){if(typeof At!="string"){Me<2&&(jt=!1);for(ue in At)this.each(Ge(ue,At[ue],jt));return this}if(Me<2)return(Me=this.node()["__on"+At])&&Me._;ue=!1}return this.each(Ge(At,jt,ue))};function Ge(At,jt,ue){var Me="__on"+At,Le=At.indexOf("."),Be=ur;Le>0&&(At=At.slice(0,Le));var sr=cr.get(At);sr&&(At=sr,Be=jr);function ir(){var Xr=this[Me];Xr&&(this.removeEventListener(At,Xr,Xr.$),delete this[Me])}function Mr(){var Xr=Be(jt,P(arguments));ir.call(this),this.addEventListener(At,this[Me]=Xr,Xr.$=ue),Xr._=jt}function en(){var Xr=new RegExp("^__on([^.]+)"+c.requote(At)+"$"),vn;for(var In in this)if(vn=In.match(Xr)){var On=this[In];this.removeEventListener(vn[1],On,On.$),delete this[In]}}return Le?jt?Mr:ir:jt?W:en}var cr=c.map({mouseenter:"mouseover",mouseleave:"mouseout"});S&&cr.forEach(function(At){"on"+At in S&&cr.remove(At)});function ur(At,jt){return function(ue){var Me=c.event;c.event=ue,jt[0]=this.__data__;try{At.apply(this,jt)}finally{c.event=Me}}}function jr(At,jt){var ue=ur(At,jt);return function(Me){var Le=this,Be=Me.relatedTarget;(!Be||Be!==Le&&!(Be.compareDocumentPosition(Le)&8))&&ue.call(Le,Me)}}var Hr,br=0;function Kr(At){var jt=".dragsuppress-"+ ++br,ue="click"+jt,Me=c.select(e(At)).on("touchmove"+jt,lt).on("dragstart"+jt,lt).on("selectstart"+jt,lt);if(Hr==null&&(Hr="onselectstart"in At?!1:F(At.style,"userSelect")),Hr){var Le=t(At).style,Be=Le[Hr];Le[Hr]="none"}return function(sr){if(Me.on(jt,null),Hr&&(Le[Hr]=Be),sr){var ir=function(){Me.on(ue,null)};Me.on(ue,function(){lt(),ir()},!0),setTimeout(ir,0)}}}c.mouse=function(At){return Ce(At,yt())};var rn=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ce(At,jt){jt.changedTouches&&(jt=jt.changedTouches[0]);var ue=At.ownerSVGElement||At;if(ue.createSVGPoint){var Me=ue.createSVGPoint();if(rn<0){var Le=e(At);if(Le.scrollX||Le.scrollY){ue=c.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var Be=ue[0][0].getScreenCTM();rn=!(Be.f||Be.e),ue.remove()}}return rn?(Me.x=jt.pageX,Me.y=jt.pageY):(Me.x=jt.clientX,Me.y=jt.clientY),Me=Me.matrixTransform(At.getScreenCTM().inverse()),[Me.x,Me.y]}var sr=At.getBoundingClientRect();return[jt.clientX-sr.left-At.clientLeft,jt.clientY-sr.top-At.clientTop]}c.touch=function(At,jt,ue){if(arguments.length<3&&(ue=jt,jt=yt().changedTouches),jt){for(var Me=0,Le=jt.length,Be;Me<Le;++Me)if((Be=jt[Me]).identifier===ue)return Ce(At,Be)}},c.behavior.drag=function(){var At=pt(Le,"drag","dragstart","dragend"),jt=null,ue=Be(W,c.mouse,e,"mousemove","mouseup"),Me=Be($t,c.touch,V,"touchmove","touchend");function Le(){this.on("mousedown.drag",ue).on("touchstart.drag",Me)}function Be(sr,ir,Mr,en,Xr){return function(){var vn=this,In=c.event.target.correspondingElement||c.event.target,On=vn.parentNode,Bi=At.of(vn,arguments),Un=0,mi=sr(),Ti=".drag"+(mi==null?"":"-"+mi),Ii,Wi=c.select(Mr(In)).on(en+Ti,Ha).on(Xr+Ti,ro),Yn=Kr(In),ja=ir(On,mi);jt?(Ii=jt.apply(vn,arguments),Ii=[Ii.x-ja[0],Ii.y-ja[1]]):Ii=[0,0],Bi({type:"dragstart"});function Ha(){var Lo=ir(On,mi),Fo,Uo;Lo&&(Fo=Lo[0]-ja[0],Uo=Lo[1]-ja[1],Un|=Fo|Uo,ja=Lo,Bi({type:"drag",x:Lo[0]+Ii[0],y:Lo[1]+Ii[1],dx:Fo,dy:Uo}))}function ro(){ir(On,mi)&&(Wi.on(en+Ti,null).on(Xr+Ti,null),Yn(Un),Bi({type:"dragend"}))}}}return Le.origin=function(sr){return arguments.length?(jt=sr,Le):jt},c.rebind(Le,At,"on")};function $t(){return c.event.changedTouches[0].identifier}c.touches=function(At,jt){return arguments.length<2&&(jt=yt().touches),jt?P(jt).map(function(ue){var Me=Ce(At,ue);return Me.identifier=ue.identifier,Me}):[]};var ne=1e-6,Ct=ne*ne,gt=Math.PI,St=2*gt,Nt=St-ne,ee=gt/2,le=gt/180,we=180/gt;function Ue(At,jt,ue){return(jt[0]-At[0])*(ue[1]-At[1])-(jt[1]-At[1])*(ue[0]-At[0])}function qe(At){return At>1?ee:At<-1?-ee:Math.asin(At)}function ar(At){return((At=Math.exp(At))-1/At)/2}function Ar(At){return((At=Math.exp(At))+1/At)/2}function Tr(At){return((At=Math.exp(2*At))-1)/(At+1)}var pr=Math.SQRT2,Jr=2,Vn=4;c.interpolateZoom=function(At,jt){var ue=At[0],Me=At[1],Le=At[2],Be=jt[0],sr=jt[1],ir=jt[2],Mr=Be-ue,en=sr-Me,Xr=Mr*Mr+en*en,vn,In;if(Xr<Ct)In=Math.log(ir/Le)/pr,vn=function(Ii){return[ue+Ii*Mr,Me+Ii*en,Le*Math.exp(pr*Ii*In)]};else{var On=Math.sqrt(Xr),Bi=(ir*ir-Le*Le+Vn*Xr)/(2*Le*Jr*On),Un=(ir*ir-Le*Le-Vn*Xr)/(2*ir*Jr*On),mi=Math.log(Math.sqrt(Bi*Bi+1)-Bi),Ti=Math.log(Math.sqrt(Un*Un+1)-Un);In=(Ti-mi)/pr,vn=function(Ii){var Wi=Ii*In,Yn=Ar(mi),ja=Le/(Jr*On)*(Yn*Tr(pr*Wi+mi)-ar(mi));return[ue+ja*Mr,Me+ja*en,Le*Yn/Ar(pr*Wi+mi)]}}return vn.duration=In*1e3,vn},c.behavior.zoom=function(){var At={x:0,y:0,k:1},jt,ue,Me,Le=[960,500],Be=Hn,sr=250,ir=0,Mr="mousedown.zoom",en="mousemove.zoom",Xr="mouseup.zoom",vn,In="touchstart.zoom",On,Bi=pt(Wi,"zoomstart","zoom","zoomend"),Un,mi,Ti,Ii;Ci||(Ci="onwheel"in S?(Kn=function(){return-c.event.deltaY*(c.event.deltaMode?120:1)},"wheel"):"onmousewheel"in S?(Kn=function(){return c.event.wheelDelta},"mousewheel"):(Kn=function(){return-c.event.detail},"MozMousePixelScroll"));function Wi(_o){_o.on(Mr,ps).on(Ci+".zoom",Ku).on("dblclick.zoom",cu).on(In,Tl)}Wi.event=function(_o){_o.each(function(){var Zs=Bi.of(this,arguments),rl=At;Ro?c.select(this).transition().each("start.zoom",function(){At=this.__chart__||{x:0,y:0,k:1},Uo(Zs)}).tween("zoom:zoom",function(){var ou=Le[0],Gl=Le[1],rh=ue?ue[0]:ou/2,Bl=ue?ue[1]:Gl/2,Ql=c.interpolateZoom([(rh-At.x)/At.k,(Bl-At.y)/At.k,ou/At.k],[(rh-rl.x)/rl.k,(Bl-rl.y)/rl.k,ou/rl.k]);return function(bh){var _e=Ql(bh),kr=ou/_e[2];this.__chart__=At={x:rh-_e[0]*kr,y:Bl-_e[1]*kr,k:kr},al(Zs)}}).each("interrupt.zoom",function(){Wo(Zs)}).each("end.zoom",function(){Wo(Zs)}):(this.__chart__=At,Uo(Zs),al(Zs),Wo(Zs))})},Wi.translate=function(_o){return arguments.length?(At={x:+_o[0],y:+_o[1],k:At.k},Fo(),Wi):[At.x,At.y]},Wi.scale=function(_o){return arguments.length?(At={x:At.x,y:At.y,k:null},Ha(+_o),Fo(),Wi):At.k},Wi.scaleExtent=function(_o){return arguments.length?(Be=_o==null?Hn:[+_o[0],+_o[1]],Wi):Be},Wi.center=function(_o){return arguments.length?(Me=_o&&[+_o[0],+_o[1]],Wi):Me},Wi.size=function(_o){return arguments.length?(Le=_o&&[+_o[0],+_o[1]],Wi):Le},Wi.duration=function(_o){return arguments.length?(sr=+_o,Wi):sr},Wi.x=function(_o){return arguments.length?(mi=_o,Un=_o.copy(),At={x:0,y:0,k:1},Wi):mi},Wi.y=function(_o){return arguments.length?(Ii=_o,Ti=_o.copy(),At={x:0,y:0,k:1},Wi):Ii};function Yn(_o){return[(_o[0]-At.x)/At.k,(_o[1]-At.y)/At.k]}function ja(_o){return[_o[0]*At.k+At.x,_o[1]*At.k+At.y]}function Ha(_o){At.k=Math.max(Be[0],Math.min(Be[1],_o))}function ro(_o,Zs){Zs=ja(Zs),At.x+=_o[0]-Zs[0],At.y+=_o[1]-Zs[1]}function Lo(_o,Zs,rl,ou){_o.__chart__={x:At.x,y:At.y,k:At.k},Ha(Math.pow(2,ou)),ro(ue=Zs,rl),_o=c.select(_o),sr>0&&(_o=_o.transition().duration(sr)),_o.call(Wi.event)}function Fo(){mi&&mi.domain(Un.range().map(function(_o){return(_o-At.x)/At.k}).map(Un.invert)),Ii&&Ii.domain(Ti.range().map(function(_o){return(_o-At.y)/At.k}).map(Ti.invert))}function Uo(_o){ir++||_o({type:"zoomstart"})}function al(_o){Fo(),_o({type:"zoom",scale:At.k,translate:[At.x,At.y]})}function Wo(_o){--ir||(_o({type:"zoomend"}),ue=null)}function ps(){var _o=this,Zs=Bi.of(_o,arguments),rl=0,ou=c.select(e(_o)).on(en,Bl).on(Xr,Ql),Gl=Yn(c.mouse(_o)),rh=Kr(_o);Fi.call(_o),Uo(Zs);function Bl(){rl=1,ro(c.mouse(_o),Gl),al(Zs)}function Ql(){ou.on(en,null).on(Xr,null),rh(rl),Wo(Zs)}}function Tl(){var _o=this,Zs=Bi.of(_o,arguments),rl={},ou=0,Gl,rh=".zoom-"+c.event.changedTouches[0].identifier,Bl="touchmove"+rh,Ql="touchend"+rh,bh=[],_e=c.select(_o),kr=Kr(_o);Dn(),Uo(Zs),_e.on(Mr,null).on(In,Dn);function Lr(){var gn=c.touches(_o);return Gl=At.k,gn.forEach(function(ni){ni.identifier in rl&&(rl[ni.identifier]=Yn(ni))}),gn}function Dn(){var gn=c.event.target;c.select(gn).on(Bl,oi).on(Ql,Jn),bh.push(gn);for(var ni=c.event.changedTouches,Yi=0,Ui=ni.length;Yi<Ui;++Yi)rl[ni[Yi].identifier]=null;var va=Lr(),Za=Date.now();if(va.length===1){if(Za-On<500){var Ba=va[0];Lo(_o,Ba,rl[Ba.identifier],Math.floor(Math.log(At.k)/Math.LN2)+1),lt()}On=Za}else if(va.length>1){var Ba=va[0],ta=va[1],wi=Ba[0]-ta[0],hn=Ba[1]-ta[1];ou=wi*wi+hn*hn}}function oi(){var gn=c.touches(_o),ni,Yi,Ui,va;Fi.call(_o);for(var Za=0,Ba=gn.length;Za<Ba;++Za,va=null)if(Ui=gn[Za],va=rl[Ui.identifier]){if(Yi)break;ni=Ui,Yi=va}if(va){var ta=(ta=Ui[0]-ni[0])*ta+(ta=Ui[1]-ni[1])*ta,wi=ou&&Math.sqrt(ta/ou);ni=[(ni[0]+Ui[0])/2,(ni[1]+Ui[1])/2],Yi=[(Yi[0]+va[0])/2,(Yi[1]+va[1])/2],Ha(wi*Gl)}On=null,ro(ni,Yi),al(Zs)}function Jn(){if(c.event.touches.length){for(var gn=c.event.changedTouches,ni=0,Yi=gn.length;ni<Yi;++ni)delete rl[gn[ni].identifier];for(var Ui in rl)return void Lr()}c.selectAll(bh).on(rh,null),_e.on(Mr,ps).on(In,Tl),kr(),Wo(Zs)}}function Ku(){var _o=Bi.of(this,arguments);vn?clearTimeout(vn):(Fi.call(this),jt=Yn(ue=Me||c.mouse(this)),Uo(_o)),vn=setTimeout(function(){vn=null,Wo(_o)},50),lt(),Ha(Math.pow(2,Kn()*.002)*At.k),ro(ue,jt),al(_o)}function cu(){var _o=c.mouse(this),Zs=Math.log(At.k)/Math.LN2;Lo(this,_o,Yn(_o),c.event.shiftKey?Math.ceil(Zs)-1:Math.floor(Zs)+1)}return c.rebind(Wi,Bi,"on")};var Hn=[0,1/0],Kn,Ci;c.color=ii;function ii(){}ii.prototype.toString=function(){return this.rgb()+""},c.hsl=qn;function qn(At,jt,ue){return this instanceof qn?(this.h=+At,this.s=+jt,void(this.l=+ue)):arguments.length<2?At instanceof qn?new qn(At.h,At.s,At.l):qr(""+At,$r,qn):new qn(At,jt,ue)}var oa=qn.prototype=new ii;oa.brighter=function(At){return At=Math.pow(.7,arguments.length?At:1),new qn(this.h,this.s,this.l/At)},oa.darker=function(At){return At=Math.pow(.7,arguments.length?At:1),new qn(this.h,this.s,At*this.l)},oa.rgb=function(){return Hi(this.h,this.s,this.l)};function Hi(At,jt,ue){var Me,Le;At=isNaN(At)?0:(At%=360)<0?At+360:At,jt=isNaN(jt)||jt<0?0:jt>1?1:jt,ue=ue<0?0:ue>1?1:ue,Le=ue<=.5?ue*(1+jt):ue+jt-ue*jt,Me=2*ue-Le;function Be(ir){return ir>360?ir-=360:ir<0&&(ir+=360),ir<60?Me+(Le-Me)*ir/60:ir<180?Le:ir<240?Me+(Le-Me)*(240-ir)/60:Me}function sr(ir){return Math.round(Be(ir)*255)}return new Pa(sr(At+120),sr(At),sr(At-120))}c.hcl=We;function We(At,jt,ue){return this instanceof We?(this.h=+At,this.c=+jt,void(this.l=+ue)):arguments.length<2?At instanceof We?new We(At.h,At.c,At.l):At instanceof xr?Pi(At.l,At.a,At.b):Pi((At=Br((At=c.rgb(At)).r,At.g,At.b)).l,At.a,At.b):new We(At,jt,ue)}var rr=We.prototype=new ii;rr.brighter=function(At){return new We(this.h,this.c,Math.min(100,this.l+Qr*(arguments.length?At:1)))},rr.darker=function(At){return new We(this.h,this.c,Math.max(0,this.l-Qr*(arguments.length?At:1)))},rr.rgb=function(){return fr(this.h,this.c,this.l).rgb()};function fr(At,jt,ue){return isNaN(At)&&(At=0),isNaN(jt)&&(jt=0),new xr(ue,Math.cos(At*=le)*jt,Math.sin(At)*jt)}c.lab=xr;function xr(At,jt,ue){return this instanceof xr?(this.l=+At,this.a=+jt,void(this.b=+ue)):arguments.length<2?At instanceof xr?new xr(At.l,At.a,At.b):At instanceof We?fr(At.h,At.c,At.l):Br((At=Pa(At)).r,At.g,At.b):new xr(At,jt,ue)}var Qr=18,Cn=.95047,wn=1,Mn=1.08883,ci=xr.prototype=new ii;ci.brighter=function(At){return new xr(Math.min(100,this.l+Qr*(arguments.length?At:1)),this.a,this.b)},ci.darker=function(At){return new xr(Math.max(0,this.l-Qr*(arguments.length?At:1)),this.a,this.b)},ci.rgb=function(){return xi(this.l,this.a,this.b)};function xi(At,jt,ue){var Me=(At+16)/116,Le=Me+jt/500,Be=Me-ue/200;return Le=Di(Le)*Cn,Me=Di(Me)*wn,Be=Di(Be)*Mn,new Pa(ui(3.2404542*Le-1.5371385*Me-.4985314*Be),ui(-.969266*Le+1.8760108*Me+.041556*Be),ui(.0556434*Le-.2040259*Me+1.0572252*Be))}function Pi(At,jt,ue){return At>0?new We(Math.atan2(ue,jt)*we,Math.sqrt(jt*jt+ue*ue),At):new We(NaN,NaN,At)}function Di(At){return At>.206893034?At*At*At:(At-4/29)/7.787037}function Zi(At){return At>.008856?Math.pow(At,1/3):7.787037*At+4/29}function ui(At){return Math.round(255*(At<=.00304?12.92*At:1.055*Math.pow(At,1/2.4)-.055))}c.rgb=Pa;function Pa(At,jt,ue){return this instanceof Pa?(this.r=~~At,this.g=~~jt,void(this.b=~~ue)):arguments.length<2?At instanceof Pa?new Pa(At.r,At.g,At.b):qr(""+At,Pa,Hi):new Pa(At,jt,ue)}function Wa(At){return new Pa(At>>16,At>>8&255,At&255)}function ze(At){return Wa(At)+""}var Pe=Pa.prototype=new ii;Pe.brighter=function(At){At=Math.pow(.7,arguments.length?At:1);var jt=this.r,ue=this.g,Me=this.b,Le=30;return!jt&&!ue&&!Me?new Pa(Le,Le,Le):(jt&&jt<Le&&(jt=Le),ue&&ue<Le&&(ue=Le),Me&&Me<Le&&(Me=Le),new Pa(Math.min(255,jt/At),Math.min(255,ue/At),Math.min(255,Me/At)))},Pe.darker=function(At){return At=Math.pow(.7,arguments.length?At:1),new Pa(At*this.r,At*this.g,At*this.b)},Pe.hsl=function(){return $r(this.r,this.g,this.b)},Pe.toString=function(){return"#"+Rr(this.r)+Rr(this.g)+Rr(this.b)};function Rr(At){return At<16?"0"+Math.max(0,At).toString(16):Math.min(255,At).toString(16)}function qr(At,jt,ue){var Me=0,Le=0,Be=0,sr,ir,Mr;if(sr=/([a-z]+)\((.*)\)/.exec(At=At.toLowerCase()),sr)switch(ir=sr[2].split(","),sr[1]){case"hsl":return ue(parseFloat(ir[0]),parseFloat(ir[1])/100,parseFloat(ir[2])/100);case"rgb":return jt(dn(ir[0]),dn(ir[1]),dn(ir[2]))}return(Mr=an.get(At))?jt(Mr.r,Mr.g,Mr.b):(At!=null&&At.charAt(0)==="#"&&!isNaN(Mr=parseInt(At.slice(1),16))&&(At.length===4?(Me=(Mr&3840)>>4,Me=Me>>4|Me,Le=Mr&240,Le=Le>>4|Le,Be=Mr&15,Be=Be<<4|Be):At.length===7&&(Me=(Mr&16711680)>>16,Le=(Mr&65280)>>8,Be=Mr&255)),jt(Me,Le,Be))}function $r(At,jt,ue){var Me=Math.min(At/=255,jt/=255,ue/=255),Le=Math.max(At,jt,ue),Be=Le-Me,sr,ir,Mr=(Le+Me)/2;return Be?(ir=Mr<.5?Be/(Le+Me):Be/(2-Le-Me),At==Le?sr=(jt-ue)/Be+(jt<ue?6:0):jt==Le?sr=(ue-At)/Be+2:sr=(At-jt)/Be+4,sr*=60):(sr=NaN,ir=Mr>0&&Mr<1?0:sr),new qn(sr,ir,Mr)}function Br(At,jt,ue){At=Gr(At),jt=Gr(jt),ue=Gr(ue);var Me=Zi((.4124564*At+.3575761*jt+.1804375*ue)/Cn),Le=Zi((.2126729*At+.7151522*jt+.072175*ue)/wn),Be=Zi((.0193339*At+.119192*jt+.9503041*ue)/Mn);return xr(116*Le-16,500*(Me-Le),200*(Le-Be))}function Gr(At){return(At/=255)<=.04045?At/12.92:Math.pow((At+.055)/1.055,2.4)}function dn(At){var jt=parseFloat(At);return At.charAt(At.length-1)==="%"?Math.round(jt*2.55):jt}var an=c.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});an.forEach(function(At,jt){an.set(At,Wa(jt))});function Ee(At){return typeof At=="function"?At:function(){return At}}c.functor=Ee,c.xhr=dr(V);function dr(At){return function(jt,ue,Me){return arguments.length===2&&typeof ue=="function"&&(Me=ue,ue=null),Vr(jt,ue,At,Me)}}function Vr(At,jt,ue,Me){var Le={},Be=c.dispatch("beforesend","progress","load","error"),sr={},ir=new XMLHttpRequest,Mr=null;self.XDomainRequest&&!("withCredentials"in ir)&&/^(http(s)?:)?\/\//.test(At)&&(ir=new XDomainRequest),"onload"in ir?ir.onload=ir.onerror=en:ir.onreadystatechange=function(){ir.readyState>3&&en()};function en(){var Xr=ir.status,vn;if(!Xr&&Fn(ir)||Xr>=200&&Xr<300||Xr===304){try{vn=ue.call(Le,ir)}catch(In){Be.error.call(Le,In);return}Be.load.call(Le,vn)}else Be.error.call(Le,ir)}return ir.onprogress=function(Xr){var vn=c.event;c.event=Xr;try{Be.progress.call(Le,ir)}finally{c.event=vn}},Le.header=function(Xr,vn){return Xr=(Xr+"").toLowerCase(),arguments.length<2?sr[Xr]:(vn==null?delete sr[Xr]:sr[Xr]=vn+"",Le)},Le.mimeType=function(Xr){return arguments.length?(jt=Xr==null?null:Xr+"",Le):jt},Le.responseType=function(Xr){return arguments.length?(Mr=Xr,Le):Mr},Le.response=function(Xr){return ue=Xr,Le},["get","post"].forEach(function(Xr){Le[Xr]=function(){return Le.send.apply(Le,[Xr].concat(P(arguments)))}}),Le.send=function(Xr,vn,In){if(arguments.length===2&&typeof vn=="function"&&(In=vn,vn=null),ir.open(Xr,At,!0),jt!=null&&!("accept"in sr)&&(sr.accept=jt+",*/*"),ir.setRequestHeader)for(var On in sr)ir.setRequestHeader(On,sr[On]);return jt!=null&&ir.overrideMimeType&&ir.overrideMimeType(jt),Mr!=null&&(ir.responseType=Mr),In!=null&&Le.on("error",In).on("load",function(Bi){In(null,Bi)}),Be.beforesend.call(Le,ir),ir.send(vn??null),Le},Le.abort=function(){return ir.abort(),Le},c.rebind(Le,Be,"on"),Me==null?Le:Le.get(yn(Me))}function yn(At){return At.length===1?function(jt,ue){At(jt==null?ue:null)}:At}function Fn(At){var jt=At.responseType;return jt&&jt!=="text"?At.response:At.responseText}c.dsv=function(At,jt){var ue=new RegExp('["'+At+`
]`),Me=At.charCodeAt(0);function Le(en,Xr,vn){arguments.length<3&&(vn=Xr,Xr=null);var In=Vr(en,jt,Xr==null?Be:sr(Xr),vn);return In.row=function(On){return arguments.length?In.response((Xr=On)==null?Be:sr(On)):Xr},In}function Be(en){return Le.parse(en.responseText)}function sr(en){return function(Xr){return Le.parse(Xr.responseText,en)}}Le.parse=function(en,Xr){var vn;return Le.parseRows(en,function(In,On){if(vn)return vn(In,On-1);var Bi=function(Un){for(var mi={},Ti=In.length,Ii=0;Ii<Ti;++Ii)mi[In[Ii]]=Un[Ii];return mi};vn=Xr?function(Un,mi){return Xr(Bi(Un),mi)}:Bi})},Le.parseRows=function(en,Xr){var vn={},In={},On=[],Bi=en.length,Un=0,mi=0,Ti,Ii;function Wi(){if(Un>=Bi)return In;if(Ii)return Ii=!1,vn;var ja=Un;if(en.charCodeAt(ja)===34){for(var Ha=ja;Ha++<Bi;)if(en.charCodeAt(Ha)===34){if(en.charCodeAt(Ha+1)!==34)break;++Ha}Un=Ha+2;var ro=en.charCodeAt(Ha+1);return ro===13?(Ii=!0,en.charCodeAt(Ha+2)===10&&++Un):ro===10&&(Ii=!0),en.slice(ja+1,Ha).replace(/""/g,'"')}for(;Un<Bi;){var ro=en.charCodeAt(Un++),Lo=1;if(ro===10)Ii=!0;else if(ro===13)Ii=!0,en.charCodeAt(Un)===10&&(++Un,++Lo);else if(ro!==Me)continue;return en.slice(ja,Un-Lo)}return en.slice(ja)}for(;(Ti=Wi())!==In;){for(var Yn=[];Ti!==vn&&Ti!==In;)Yn.push(Ti),Ti=Wi();Xr&&(Yn=Xr(Yn,mi++))==null||On.push(Yn)}return On},Le.format=function(en){if(Array.isArray(en[0]))return Le.formatRows(en);var Xr=new N,vn=[];return en.forEach(function(In){for(var On in In)Xr.has(On)||vn.push(Xr.add(On))}),[vn.map(Mr).join(At)].concat(en.map(function(In){return vn.map(function(On){return Mr(In[On])}).join(At)})).join(`
`)},Le.formatRows=function(en){return en.map(ir).join(`
`)};function ir(en){return en.map(Mr).join(At)}function Mr(en){return ue.test(en)?'"'+en.replace(/\"/g,'""')+'"':en}return Le},c.csv=c.dsv(",","text/csv"),c.tsv=c.dsv(" ","text/tab-separated-values");var Xn,Pn,En,Zn,Ca=this[F(this,"requestAnimationFrame")]||function(At){setTimeout(At,17)};c.timer=function(){Ri.apply(this,arguments)};function Ri(At,jt,ue){var Me=arguments.length;Me<2&&(jt=0),Me<3&&(ue=Date.now());var Le=ue+jt,Be={c:At,t:Le,n:null};return Pn?Pn.n=Be:Xn=Be,Pn=Be,En||(Zn=clearTimeout(Zn),En=1,Ca(Ja)),Be}function Ja(){var At=Xa(),jt=Io()-At;jt>24?(isFinite(jt)&&(clearTimeout(Zn),Zn=setTimeout(Ja,jt)),En=0):(En=1,Ca(Ja))}c.timer.flush=function(){Xa(),Io()};function Xa(){for(var At=Date.now(),jt=Xn;jt;)At>=jt.t&&jt.c(At-jt.t)&&(jt.c=null),jt=jt.n;return At}function Io(){for(var At,jt=Xn,ue=1/0;jt;)jt.c?(jt.t<ue&&(ue=jt.t),jt=(At=jt).n):jt=At?At.n=jt.n:Xn=jt.n;return Pn=At,ue}c.round=function(At,jt){return jt?Math.round(At*(jt=Math.pow(10,jt)))/jt:Math.round(At)},c.geom={};function po(At){return At[0]}function Do(At){return At[1]}c.geom.hull=function(At){var jt=po,ue=Do;if(arguments.length)return Me(At);function Me(Le){if(Le.length<3)return[];var Be=Ee(jt),sr=Ee(ue),ir,Mr=Le.length,en=[],Xr=[];for(ir=0;ir<Mr;ir++)en.push([+Be.call(this,Le[ir],ir),+sr.call(this,Le[ir],ir),ir]);for(en.sort(gs),ir=0;ir<Mr;ir++)Xr.push([en[ir][0],-en[ir][1]]);var vn=Ia(en),In=Ia(Xr),On=In[0]===vn[0],Bi=In[In.length-1]===vn[vn.length-1],Un=[];for(ir=vn.length-1;ir>=0;--ir)Un.push(Le[en[vn[ir]][2]]);for(ir=+On;ir<In.length-Bi;++ir)Un.push(Le[en[In[ir]][2]]);return Un}return Me.x=function(Le){return arguments.length?(jt=Le,Me):jt},Me.y=function(Le){return arguments.length?(ue=Le,Me):ue},Me};function Ia(At){for(var jt=At.length,ue=[0,1],Me=2,Le=2;Le<jt;Le++){for(;Me>1&&Ue(At[ue[Me-2]],At[ue[Me-1]],At[Le])<=0;)--Me;ue[Me++]=Le}return ue.slice(0,Me)}function gs(At,jt){return At[0]-jt[0]||At[1]-jt[1]}c.geom.polygon=function(At){return tt(At,is),At};var is=c.geom.polygon.prototype=[];is.area=function(){for(var At=-1,jt=this.length,ue,Me=this[jt-1],Le=0;++At<jt;)ue=Me,Me=this[At],Le+=ue[1]*Me[0]-ue[0]*Me[1];return Le*.5},is.centroid=function(At){var jt=-1,ue=this.length,Me=0,Le=0,Be,sr=this[ue-1],ir;for(arguments.length||(At=-1/(6*this.area()));++jt<ue;)Be=sr,sr=this[jt],ir=Be[0]*sr[1]-sr[0]*Be[1],Me+=(Be[0]+sr[0])*ir,Le+=(Be[1]+sr[1])*ir;return[Me*At,Le*At]},is.clip=function(At){for(var jt,ue=Gs(At),Me=-1,Le=this.length-Gs(this),Be,sr,ir=this[Le-1],Mr,en,Xr;++Me<Le;){for(jt=At.slice(),At.length=0,Mr=this[Me],en=jt[(sr=jt.length-ue)-1],Be=-1;++Be<sr;)Xr=jt[Be],ll(Xr,ir,Mr)?(ll(en,ir,Mr)||At.push(Ho(en,Xr,ir,Mr)),At.push(Xr)):ll(en,ir,Mr)&&At.push(Ho(en,Xr,ir,Mr)),en=Xr;ue&&At.push(At[0]),ir=Mr}return At};function ll(At,jt,ue){return(ue[0]-jt[0])*(At[1]-jt[1])<(ue[1]-jt[1])*(At[0]-jt[0])}function Ho(At,jt,ue,Me){var Le=At[0],Be=ue[0],sr=jt[0]-Le,ir=Me[0]-Be,Mr=At[1],en=ue[1],Xr=jt[1]-Mr,vn=Me[1]-en,In=(ir*(Mr-en)-vn*(Le-Be))/(vn*sr-ir*Xr);return[Le+In*sr,Mr+In*Xr]}function Gs(At){var jt=At[0],ue=At[At.length-1];return!(jt[0]-ue[0]||jt[1]-ue[1])}var as,ul,Js,Rl=[],ls,Cs,Co=[];function ks(){_l(this),this.edge=this.site=this.circle=null}function kl(At){var jt=Rl.pop()||new ks;return jt.site=At,jt}function Vl(At){Cl(At),Js.remove(At),Rl.push(At),_l(At)}function Yl(At){var jt=At.circle,ue=jt.x,Me=jt.cy,Le={x:ue,y:Me},Be=At.P,sr=At.N,ir=[At];Vl(At);for(var Mr=Be;Mr.circle&&u(ue-Mr.circle.x)<ne&&u(Me-Mr.circle.cy)<ne;)Be=Mr.P,ir.unshift(Mr),Vl(Mr),Mr=Be;ir.unshift(Mr),Cl(Mr);for(var en=sr;en.circle&&u(ue-en.circle.x)<ne&&u(Me-en.circle.cy)<ne;)sr=en.N,ir.push(en),Vl(en),en=sr;ir.push(en),Cl(en);var Xr=ir.length,vn;for(vn=1;vn<Xr;++vn)en=ir[vn],Mr=ir[vn-1],Qo(en.edge,Mr.site,en.site,Le);Mr=ir[0],en=ir[Xr-1],en.edge=nu(Mr.site,en.site,null,Le),il(Mr),il(en)}function Ns(At){for(var jt=At.x,ue=At.y,Me,Le,Be,sr,ir=Js._;ir;)if(Be=La(ir,ue)-jt,Be>ne)ir=ir.L;else if(sr=jt-uo(ir,ue),sr>ne){if(!ir.R){Me=ir;break}ir=ir.R}else{Be>-ne?(Me=ir.P,Le=ir):sr>-ne?(Me=ir,Le=ir.N):Me=Le=ir;break}var Mr=kl(At);if(Js.insert(Me,Mr),!(!Me&&!Le)){if(Me===Le){Cl(Me),Le=kl(Me.site),Js.insert(Mr,Le),Mr.edge=Le.edge=nu(Me.site,Mr.site),il(Me),il(Le);return}if(!Le){Mr.edge=nu(Me.site,Mr.site);return}Cl(Me),Cl(Le);var en=Me.site,Xr=en.x,vn=en.y,In=At.x-Xr,On=At.y-vn,Bi=Le.site,Un=Bi.x-Xr,mi=Bi.y-vn,Ti=2*(In*mi-On*Un),Ii=In*In+On*On,Wi=Un*Un+mi*mi,Yn={x:(mi*Ii-On*Wi)/Ti+Xr,y:(In*Wi-Un*Ii)/Ti+vn};Qo(Le.edge,en,Bi,Yn),Mr.edge=nu(en,At,null,Yn),Le.edge=nu(At,Bi,null,Yn),il(Me),il(Le)}}function La(At,jt){var ue=At.site,Me=ue.x,Le=ue.y,Be=Le-jt;if(!Be)return Me;var sr=At.P;if(!sr)return-1/0;ue=sr.site;var ir=ue.x,Mr=ue.y,en=Mr-jt;if(!en)return ir;var Xr=ir-Me,vn=1/Be-1/en,In=Xr/en;return vn?(-In+Math.sqrt(In*In-2*vn*(Xr*Xr/(-2*en)-Mr+en/2+Le-Be/2)))/vn+Me:(Me+ir)/2}function uo(At,jt){var ue=At.N;if(ue)return La(ue,jt);var Me=At.site;return Me.y===jt?Me.x:1/0}function Hs(At){this.site=At,this.edges=[]}Hs.prototype.prepare=function(){for(var At=this.edges,jt=At.length,ue;jt--;)ue=At[jt].edge,(!ue.b||!ue.a)&&At.splice(jt,1);return At.sort(Go),At.length};function Kl(At){for(var jt=At[0][0],ue=At[1][0],Me=At[0][1],Le=At[1][1],Be,sr,ir,Mr,en=ul,Xr=en.length,vn,In,On,Bi,Un,mi;Xr--;)if(vn=en[Xr],!(!vn||!vn.prepare()))for(On=vn.edges,Bi=On.length,In=0;In<Bi;)mi=On[In].end(),ir=mi.x,Mr=mi.y,Un=On[++In%Bi].start(),Be=Un.x,sr=Un.y,(u(ir-Be)>ne||u(Mr-sr)>ne)&&(On.splice(In,0,new Mu(cl(vn.site,mi,u(ir-jt)<ne&&Le-Mr>ne?{x:jt,y:u(Be-jt)<ne?sr:Le}:u(Mr-Le)<ne&&ue-ir>ne?{x:u(sr-Le)<ne?Be:ue,y:Le}:u(ir-ue)<ne&&Mr-Me>ne?{x:ue,y:u(Be-ue)<ne?sr:Me}:u(Mr-Me)<ne&&ir-jt>ne?{x:u(sr-Me)<ne?Be:jt,y:Me}:null),vn.site,null)),++Bi)}function Go(At,jt){return jt.angle-At.angle}function ql(){_l(this),this.x=this.y=this.arc=this.site=this.cy=null}function il(At){var jt=At.P,ue=At.N;if(!(!jt||!ue)){var Me=jt.site,Le=At.site,Be=ue.site;if(Me!==Be){var sr=Le.x,ir=Le.y,Mr=Me.x-sr,en=Me.y-ir,Xr=Be.x-sr,vn=Be.y-ir,In=2*(Mr*vn-en*Xr);if(!(In>=-Ct)){var On=Mr*Mr+en*en,Bi=Xr*Xr+vn*vn,Un=(vn*On-en*Bi)/In,mi=(Mr*Bi-Xr*On)/In,vn=mi+ir,Ti=Co.pop()||new ql;Ti.arc=At,Ti.site=Le,Ti.x=Un+sr,Ti.y=vn+Math.sqrt(Un*Un+mi*mi),Ti.cy=vn,At.circle=Ti;for(var Ii=null,Wi=Cs._;Wi;)if(Ti.y<Wi.y||Ti.y===Wi.y&&Ti.x<=Wi.x)if(Wi.L)Wi=Wi.L;else{Ii=Wi.P;break}else if(Wi.R)Wi=Wi.R;else{Ii=Wi;break}Cs.insert(Ii,Ti),Ii||(ls=Ti)}}}}function Cl(At){var jt=At.circle;jt&&(jt.P||(ls=jt.N),Cs.remove(jt),Co.push(jt),_l(jt),At.circle=null)}function Fu(At,jt,ue,Me){return function(Le){var Be=Le.a,sr=Le.b,ir=Be.x,Mr=Be.y,en=sr.x,Xr=sr.y,vn=0,In=1,On=en-ir,Bi=Xr-Mr,Un;if(Un=At-ir,!(!On&&Un>0)){if(Un/=On,On<0){if(Un<vn)return;Un<In&&(In=Un)}else if(On>0){if(Un>In)return;Un>vn&&(vn=Un)}if(Un=ue-ir,!(!On&&Un<0)){if(Un/=On,On<0){if(Un>In)return;Un>vn&&(vn=Un)}else if(On>0){if(Un<vn)return;Un<In&&(In=Un)}if(Un=jt-Mr,!(!Bi&&Un>0)){if(Un/=Bi,Bi<0){if(Un<vn)return;Un<In&&(In=Un)}else if(Bi>0){if(Un>In)return;Un>vn&&(vn=Un)}if(Un=Me-Mr,!(!Bi&&Un<0)){if(Un/=Bi,Bi<0){if(Un>In)return;Un>vn&&(vn=Un)}else if(Bi>0){if(Un<vn)return;Un<In&&(In=Un)}return vn>0&&(Le.a={x:ir+vn*On,y:Mr+vn*Bi}),In<1&&(Le.b={x:ir+In*On,y:Mr+In*Bi}),Le}}}}}}function ao(At){for(var jt=as,ue=Fu(At[0][0],At[0][1],At[1][0],At[1][1]),Me=jt.length,Le;Me--;)Le=jt[Me],(!Ts(Le,At)||!ue(Le)||u(Le.a.x-Le.b.x)<ne&&u(Le.a.y-Le.b.y)<ne)&&(Le.a=Le.b=null,jt.splice(Me,1))}function Ts(At,jt){var ue=At.b;if(ue)return!0;var Me=At.a,Le=jt[0][0],Be=jt[1][0],sr=jt[0][1],ir=jt[1][1],Mr=At.l,en=At.r,Xr=Mr.x,vn=Mr.y,In=en.x,On=en.y,Bi=(Xr+In)/2,Un=(vn+On)/2,mi,Ti;if(On===vn){if(Bi<Le||Bi>=Be)return;if(Xr>In){if(!Me)Me={x:Bi,y:sr};else if(Me.y>=ir)return;ue={x:Bi,y:ir}}else{if(!Me)Me={x:Bi,y:ir};else if(Me.y<sr)return;ue={x:Bi,y:sr}}}else if(mi=(Xr-In)/(On-vn),Ti=Un-mi*Bi,mi<-1||mi>1)if(Xr>In){if(!Me)Me={x:(sr-Ti)/mi,y:sr};else if(Me.y>=ir)return;ue={x:(ir-Ti)/mi,y:ir}}else{if(!Me)Me={x:(ir-Ti)/mi,y:ir};else if(Me.y<sr)return;ue={x:(sr-Ti)/mi,y:sr}}else if(vn<On){if(!Me)Me={x:Le,y:mi*Le+Ti};else if(Me.x>=Be)return;ue={x:Be,y:mi*Be+Ti}}else{if(!Me)Me={x:Be,y:mi*Be+Ti};else if(Me.x<Le)return;ue={x:Le,y:mi*Le+Ti}}return At.a=Me,At.b=ue,!0}function Ls(At,jt){this.l=At,this.r=jt,this.a=this.b=null}function nu(At,jt,ue,Me){var Le=new Ls(At,jt);return as.push(Le),ue&&Qo(Le,At,jt,ue),Me&&Qo(Le,jt,At,Me),ul[At.i].edges.push(new Mu(Le,At,jt)),ul[jt.i].edges.push(new Mu(Le,jt,At)),Le}function cl(At,jt,ue){var Me=new Ls(At,null);return Me.a=jt,Me.b=ue,as.push(Me),Me}function Qo(At,jt,ue,Me){!At.a&&!At.b?(At.a=Me,At.l=jt,At.r=ue):At.l===ue?At.b=Me:At.a=Me}function Mu(At,jt,ue){var Me=At.a,Le=At.b;this.edge=At,this.site=jt,this.angle=ue?Math.atan2(ue.y-jt.y,ue.x-jt.x):At.l===jt?Math.atan2(Le.x-Me.x,Me.y-Le.y):Math.atan2(Me.x-Le.x,Le.y-Me.y)}Mu.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 Gu(){this._=null}function _l(At){At.U=At.C=At.L=At.R=At.P=At.N=null}Gu.prototype={insert:function(At,jt){var ue,Me,Le;if(At){if(jt.P=At,jt.N=At.N,At.N&&(At.N.P=jt),At.N=jt,At.R){for(At=At.R;At.L;)At=At.L;At.L=jt}else At.R=jt;ue=At}else this._?(At=tu(this._),jt.P=null,jt.N=At,At.P=At.L=jt,ue=At):(jt.P=jt.N=null,this._=jt,ue=null);for(jt.L=jt.R=null,jt.U=ue,jt.C=!0,At=jt;ue&&ue.C;)Me=ue.U,ue===Me.L?(Le=Me.R,Le&&Le.C?(ue.C=Le.C=!1,Me.C=!0,At=Me):(At===ue.R&&(Ol(this,ue),At=ue,ue=At.U),ue.C=!1,Me.C=!0,Xl(this,Me))):(Le=Me.L,Le&&Le.C?(ue.C=Le.C=!1,Me.C=!0,At=Me):(At===ue.L&&(Xl(this,ue),At=ue,ue=At.U),ue.C=!1,Me.C=!0,Ol(this,Me))),ue=At.U;this._.C=!1},remove:function(At){At.N&&(At.N.P=At.P),At.P&&(At.P.N=At.N),At.N=At.P=null;var jt=At.U,ue,Me=At.L,Le=At.R,Be,sr;if(Me?Le?Be=tu(Le):Be=Me:Be=Le,jt?jt.L===At?jt.L=Be:jt.R=Be:this._=Be,Me&&Le?(sr=Be.C,Be.C=At.C,Be.L=Me,Me.U=Be,Be!==Le?(jt=Be.U,Be.U=At.U,At=Be.R,jt.L=At,Be.R=Le,Le.U=Be):(Be.U=jt,jt=Be,At=Be.R)):(sr=At.C,At=Be),At&&(At.U=jt),!sr){if(At&&At.C){At.C=!1;return}do{if(At===this._)break;if(At===jt.L){if(ue=jt.R,ue.C&&(ue.C=!1,jt.C=!0,Ol(this,jt),ue=jt.R),ue.L&&ue.L.C||ue.R&&ue.R.C){(!ue.R||!ue.R.C)&&(ue.L.C=!1,ue.C=!0,Xl(this,ue),ue=jt.R),ue.C=jt.C,jt.C=ue.R.C=!1,Ol(this,jt),At=this._;break}}else if(ue=jt.L,ue.C&&(ue.C=!1,jt.C=!0,Xl(this,jt),ue=jt.L),ue.L&&ue.L.C||ue.R&&ue.R.C){(!ue.L||!ue.L.C)&&(ue.R.C=!1,ue.C=!0,Ol(this,ue),ue=jt.L),ue.C=jt.C,jt.C=ue.L.C=!1,Xl(this,jt),At=this._;break}ue.C=!0,At=jt,jt=jt.U}while(!At.C);At&&(At.C=!1)}}};function Ol(At,jt){var ue=jt,Me=jt.R,Le=ue.U;Le?Le.L===ue?Le.L=Me:Le.R=Me:At._=Me,Me.U=Le,ue.U=Me,ue.R=Me.L,ue.R&&(ue.R.U=ue),Me.L=ue}function Xl(At,jt){var ue=jt,Me=jt.L,Le=ue.U;Le?Le.L===ue?Le.L=Me:Le.R=Me:At._=Me,Me.U=Le,ue.U=Me,ue.L=Me.R,ue.L&&(ue.L.U=ue),Me.R=ue}function tu(At){for(;At.L;)At=At.L;return At}function ac(At,jt){var ue=At.sort(ph).pop(),Me,Le,Be;for(as=[],ul=new Array(At.length),Js=new Gu,Cs=new Gu;;)if(Be=ls,ue&&(!Be||ue.y<Be.y||ue.y===Be.y&&ue.x<Be.x))(ue.x!==Me||ue.y!==Le)&&(ul[ue.i]=new Hs(ue),Ns(ue),Me=ue.x,Le=ue.y),ue=At.pop();else if(Be)Yl(Be.arc);else break;jt&&(ao(jt),Kl(jt));var sr={cells:ul,edges:as};return Js=Cs=as=ul=null,sr}function ph(At,jt){return jt.y-At.y||jt.x-At.x}c.geom.voronoi=function(At){var jt=po,ue=Do,Me=jt,Le=ue,Be=Jc;if(At)return sr(At);function sr(Mr){var en=new Array(Mr.length),Xr=Be[0][0],vn=Be[0][1],In=Be[1][0],On=Be[1][1];return ac(ir(Mr),Be).cells.forEach(function(Bi,Un){var mi=Bi.edges,Ti=Bi.site,Ii=en[Un]=mi.length?mi.map(function(Wi){var Yn=Wi.start();return[Yn.x,Yn.y]}):Ti.x>=Xr&&Ti.x<=In&&Ti.y>=vn&&Ti.y<=On?[[Xr,On],[In,On],[In,vn],[Xr,vn]]:[];Ii.point=Mr[Un]}),en}function ir(Mr){return Mr.map(function(en,Xr){return{x:Math.round(Me(en,Xr)/ne)*ne,y:Math.round(Le(en,Xr)/ne)*ne,i:Xr}})}return sr.links=function(Mr){return ac(ir(Mr)).edges.filter(function(en){return en.l&&en.r}).map(function(en){return{source:Mr[en.l.i],target:Mr[en.r.i]}})},sr.triangles=function(Mr){var en=[];return ac(ir(Mr)).cells.forEach(function(Xr,vn){for(var In=Xr.site,On=Xr.edges.sort(Go),Bi=-1,Un=On.length,mi,Ti,Ii=On[Un-1].edge,Wi=Ii.l===In?Ii.r:Ii.l;++Bi<Un;)mi=Ii,Ti=Wi,Ii=On[Bi].edge,Wi=Ii.l===In?Ii.r:Ii.l,vn<Ti.i&&vn<Wi.i&&ah(In,Ti,Wi)<0&&en.push([Mr[vn],Mr[Ti.i],Mr[Wi.i]])}),en},sr.x=function(Mr){return arguments.length?(Me=Ee(jt=Mr),sr):jt},sr.y=function(Mr){return arguments.length?(Le=Ee(ue=Mr),sr):ue},sr.clipExtent=function(Mr){return arguments.length?(Be=Mr??Jc,sr):Be===Jc?null:Be},sr.size=function(Mr){return arguments.length?sr.clipExtent(Mr&&[[0,0],Mr]):Be===Jc?null:Be&&Be[1]},sr};var Jc=[[-1e6,-1e6],[1e6,1e6]];function ah(At,jt,ue){return(At.x-ue.x)*(jt.y-At.y)-(At.x-jt.x)*(ue.y-At.y)}c.geom.delaunay=function(At){return c.geom.voronoi().triangles(At)},c.geom.quadtree=function(At,jt,ue,Me,Le){var Be=po,sr=Do,ir;if(ir=arguments.length)return Be=Nf,sr=Sf,ir===3&&(Le=ue,Me=jt,ue=jt=0),Mr(At);function Mr(en){var Xr,vn=Ee(Be),In=Ee(sr),On,Bi,Un,mi,Ti,Ii,Wi,Yn;if(jt!=null)Ti=jt,Ii=ue,Wi=Me,Yn=Le;else if(Wi=Yn=-(Ti=Ii=1/0),On=[],Bi=[],mi=en.length,ir)for(Un=0;Un<mi;++Un)Xr=en[Un],Xr.x<Ti&&(Ti=Xr.x),Xr.y<Ii&&(Ii=Xr.y),Xr.x>Wi&&(Wi=Xr.x),Xr.y>Yn&&(Yn=Xr.y),On.push(Xr.x),Bi.push(Xr.y);else for(Un=0;Un<mi;++Un){var ja=+vn(Xr=en[Un],Un),Ha=+In(Xr,Un);ja<Ti&&(Ti=ja),Ha<Ii&&(Ii=Ha),ja>Wi&&(Wi=ja),Ha>Yn&&(Yn=Ha),On.push(ja),Bi.push(Ha)}var ro=Wi-Ti,Lo=Yn-Ii;ro>Lo?Yn=Ii+ro:Wi=Ti+Lo;function Fo(Wo,ps,Tl,Ku,cu,_o,Zs,rl){if(!(isNaN(Tl)||isNaN(Ku)))if(Wo.leaf){var ou=Wo.x,Gl=Wo.y;if(ou!=null)if(u(ou-Tl)+u(Gl-Ku)<.01)Uo(Wo,ps,Tl,Ku,cu,_o,Zs,rl);else{var rh=Wo.point;Wo.x=Wo.y=Wo.point=null,Uo(Wo,rh,ou,Gl,cu,_o,Zs,rl),Uo(Wo,ps,Tl,Ku,cu,_o,Zs,rl)}else Wo.x=Tl,Wo.y=Ku,Wo.point=ps}else Uo(Wo,ps,Tl,Ku,cu,_o,Zs,rl)}function Uo(Wo,ps,Tl,Ku,cu,_o,Zs,rl){var ou=(cu+Zs)*.5,Gl=(_o+rl)*.5,rh=Tl>=ou,Bl=Ku>=Gl,Ql=Bl<<1|rh;Wo.leaf=!1,Wo=Wo.nodes[Ql]||(Wo.nodes[Ql]=Dl()),rh?cu=ou:Zs=ou,Bl?_o=Gl:rl=Gl,Fo(Wo,ps,Tl,Ku,cu,_o,Zs,rl)}var al=Dl();if(al.add=function(Wo){Fo(al,Wo,+vn(Wo,++Un),+In(Wo,Un),Ti,Ii,Wi,Yn)},al.visit=function(Wo){Bc(Wo,al,Ti,Ii,Wi,Yn)},al.find=function(Wo){return jf(al,Wo[0],Wo[1],Ti,Ii,Wi,Yn)},Un=-1,jt==null){for(;++Un<mi;)Fo(al,en[Un],On[Un],Bi[Un],Ti,Ii,Wi,Yn);--Un}else en.forEach(al.add);return On=Bi=en=Xr=null,al}return Mr.x=function(en){return arguments.length?(Be=en,Mr):Be},Mr.y=function(en){return arguments.length?(sr=en,Mr):sr},Mr.extent=function(en){return arguments.length?(en==null?jt=ue=Me=Le=null:(jt=+en[0][0],ue=+en[0][1],Me=+en[1][0],Le=+en[1][1]),Mr):jt==null?null:[[jt,ue],[Me,Le]]},Mr.size=function(en){return arguments.length?(en==null?jt=ue=Me=Le=null:(jt=ue=0,Me=+en[0],Le=+en[1]),Mr):jt==null?null:[Me-jt,Le-ue]},Mr};function Nf(At){return At.x}function Sf(At){return At.y}function Dl(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function Bc(At,jt,ue,Me,Le,Be){if(!At(jt,ue,Me,Le,Be)){var sr=(ue+Le)*.5,ir=(Me+Be)*.5,Mr=jt.nodes;Mr[0]&&Bc(At,Mr[0],ue,Me,sr,ir),Mr[1]&&Bc(At,Mr[1],sr,Me,Le,ir),Mr[2]&&Bc(At,Mr[2],ue,ir,sr,Be),Mr[3]&&Bc(At,Mr[3],sr,ir,Le,Be)}}function jf(At,jt,ue,Me,Le,Be,sr){var ir=1/0,Mr;return function en(Xr,vn,In,On,Bi){if(!(vn>Be||In>sr||On<Me||Bi<Le)){if(Un=Xr.point){var Un,mi=jt-Xr.x,Ti=ue-Xr.y,Ii=mi*mi+Ti*Ti;if(Ii<ir){var Wi=Math.sqrt(ir=Ii);Me=jt-Wi,Le=ue-Wi,Be=jt+Wi,sr=ue+Wi,Mr=Un}}for(var Yn=Xr.nodes,ja=(vn+On)*.5,Ha=(In+Bi)*.5,ro=jt>=ja,Lo=ue>=Ha,Fo=Lo<<1|ro,Uo=Fo+4;Fo<Uo;++Fo)if(Xr=Yn[Fo&3])switch(Fo&3){case 0:en(Xr,vn,In,ja,Ha);break;case 1:en(Xr,ja,In,On,Ha);break;case 2:en(Xr,vn,Ha,ja,Bi);break;case 3:en(Xr,ja,Ha,On,Bi);break}}}(At,Me,Le,Be,sr),Mr}c.interpolateRgb=hc;function hc(At,jt){At=c.rgb(At),jt=c.rgb(jt);var ue=At.r,Me=At.g,Le=At.b,Be=jt.r-ue,sr=jt.g-Me,ir=jt.b-Le;return function(Mr){return"#"+Rr(Math.round(ue+Be*Mr))+Rr(Math.round(Me+sr*Mr))+Rr(Math.round(Le+ir*Mr))}}c.interpolateObject=oc;function oc(At,jt){var ue={},Me={},Le;for(Le in At)Le in jt?ue[Le]=el(At[Le],jt[Le]):Me[Le]=At[Le];for(Le in jt)Le in At||(Me[Le]=jt[Le]);return function(Be){for(Le in ue)Me[Le]=ue[Le](Be);return Me}}c.interpolateNumber=fc;function fc(At,jt){return At=+At,jt=+jt,function(ue){return At*(1-ue)+jt*ue}}c.interpolateString=oh;function oh(At,jt){var ue=su.lastIndex=sc.lastIndex=0,Me,Le,Be,sr=-1,ir=[],Mr=[];for(At=At+"",jt=jt+"";(Me=su.exec(At))&&(Le=sc.exec(jt));)(Be=Le.index)>ue&&(Be=jt.slice(ue,Be),ir[sr]?ir[sr]+=Be:ir[++sr]=Be),(Me=Me[0])===(Le=Le[0])?ir[sr]?ir[sr]+=Le:ir[++sr]=Le:(ir[++sr]=null,Mr.push({i:sr,x:fc(Me,Le)})),ue=sc.lastIndex;return ue<jt.length&&(Be=jt.slice(ue),ir[sr]?ir[sr]+=Be:ir[++sr]=Be),ir.length<2?Mr[0]?(jt=Mr[0].x,function(en){return jt(en)+""}):function(){return jt}:(jt=Mr.length,function(en){for(var Xr=0,vn;Xr<jt;++Xr)ir[(vn=Mr[Xr]).i]=vn.x(en);return ir.join("")})}var su=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sc=new RegExp(su.source,"g");c.interpolate=el;function el(At,jt){for(var ue=c.interpolators.length,Me;--ue>=0&&!(Me=c.interpolators[ue](At,jt)););return Me}c.interpolators=[function(At,jt){var ue=typeof jt;return(ue==="string"?an.has(jt.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(jt)?hc:oh:jt instanceof ii?hc:Array.isArray(jt)?Zl:ue==="object"&&isNaN(jt)?oc:fc)(At,jt)}],c.interpolateArray=Zl;function Zl(At,jt){var ue=[],Me=[],Le=At.length,Be=jt.length,sr=Math.min(At.length,jt.length),ir;for(ir=0;ir<sr;++ir)ue.push(el(At[ir],jt[ir]));for(;ir<Le;++ir)Me[ir]=At[ir];for(;ir<Be;++ir)Me[ir]=jt[ir];return function(Mr){for(ir=0;ir<sr;++ir)Me[ir]=ue[ir](Mr);return Me}}var Mh=function(){return V},Lc=c.map({linear:Mh,poly:lf,quad:function(){return Wd},cubic:function(){return Ll},sin:function(){return sh},exp:function(){return ec},circle:function(){return Uf},elastic:Uh,back:yf,bounce:function(){return lc}}),jh=c.map({in:V,out:Cd,"in-out":Qs,"out-in":function(At){return Qs(Cd(At))}});c.ease=function(At){var jt=At.indexOf("-"),ue=jt>=0?At.slice(0,jt):At,Me=jt>=0?At.slice(jt+1):"in";return ue=Lc.get(ue)||Mh,Me=jh.get(Me)||V,xu(Me(ue.apply(null,g.call(arguments,1))))};function xu(At){return function(jt){return jt<=0?0:jt>=1?1:At(jt)}}function Cd(At){return function(jt){return 1-At(1-jt)}}function Qs(At){return function(jt){return .5*(jt<.5?At(2*jt):2-At(2-2*jt))}}function Wd(At){return At*At}function Ll(At){return At*At*At}function Jo(At){if(At<=0)return 0;if(At>=1)return 1;var jt=At*At,ue=jt*At;return 4*(At<.5?ue:3*(At-jt)+ue-.75)}function lf(At){return function(jt){return Math.pow(jt,At)}}function sh(At){return 1-Math.cos(At*ee)}function ec(At){return Math.pow(2,10*(At-1))}function Uf(At){return 1-Math.sqrt(1-At*At)}function Uh(At,jt){var ue;return arguments.length<2&&(jt=.45),arguments.length?ue=jt/St*Math.asin(1/At):(At=1,ue=jt/4),function(Me){return 1+At*Math.pow(2,-10*Me)*Math.sin((Me-ue)*St/jt)}}function yf(At){return At||(At=1.70158),function(jt){return jt*jt*((At+1)*jt-At)}}function lc(At){return At<1/2.75?7.5625*At*At:At<2/2.75?7.5625*(At-=1.5/2.75)*At+.75:At<2.5/2.75?7.5625*(At-=2.25/2.75)*At+.9375:7.5625*(At-=2.625/2.75)*At+.984375}c.interpolateHcl=hd;function hd(At,jt){At=c.hcl(At),jt=c.hcl(jt);var ue=At.h,Me=At.c,Le=At.l,Be=jt.h-ue,sr=jt.c-Me,ir=jt.l-Le;return isNaN(sr)&&(sr=0,Me=isNaN(Me)?jt.c:Me),isNaN(Be)?(Be=0,ue=isNaN(ue)?jt.h:ue):Be>180?Be-=360:Be<-180&&(Be+=360),function(Mr){return fr(ue+Be*Mr,Me+sr*Mr,Le+ir*Mr)+""}}c.interpolateHsl=$f;function $f(At,jt){At=c.hsl(At),jt=c.hsl(jt);var ue=At.h,Me=At.s,Le=At.l,Be=jt.h-ue,sr=jt.s-Me,ir=jt.l-Le;return isNaN(sr)&&(sr=0,Me=isNaN(Me)?jt.s:Me),isNaN(Be)?(Be=0,ue=isNaN(ue)?jt.h:ue):Be>180?Be-=360:Be<-180&&(Be+=360),function(Mr){return Hi(ue+Be*Mr,Me+sr*Mr,Le+ir*Mr)+""}}c.interpolateLab=xf;function xf(At,jt){At=c.lab(At),jt=c.lab(jt);var ue=At.l,Me=At.a,Le=At.b,Be=jt.l-ue,sr=jt.a-Me,ir=jt.b-Le;return function(Mr){return xi(ue+Be*Mr,Me+sr*Mr,Le+ir*Mr)+""}}c.interpolateRound=Vh;function Vh(At,jt){return jt-=At,function(ue){return Math.round(At+jt*ue)}}c.transform=function(At){var jt=S.createElementNS(c.ns.prefix.svg,"g");return(c.transform=function(ue){if(ue!=null){jt.setAttribute("transform",ue);var Me=jt.transform.baseVal.consolidate()}return new Vf(Me?Me.matrix:Sh)})(At)};function Vf(At){var jt=[At.a,At.b],ue=[At.c,At.d],Me=lh(jt),Le=Hf(jt,ue),Be=lh(Gf(ue,jt,-Le))||0;jt[0]*ue[1]<ue[0]*jt[1]&&(jt[0]*=-1,jt[1]*=-1,Me*=-1,Le*=-1),this.rotate=(Me?Math.atan2(jt[1],jt[0]):Math.atan2(-ue[0],ue[1]))*we,this.translate=[At.e,At.f],this.scale=[Me,Be],this.skew=Be?Math.atan2(Le,Be)*we:0}Vf.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};function Hf(At,jt){return At[0]*jt[0]+At[1]*jt[1]}function lh(At){var jt=Math.sqrt(Hf(At,At));return jt&&(At[0]/=jt,At[1]/=jt),jt}function Gf(At,jt,ue){return At[0]+=ue*jt[0],At[1]+=ue*jt[1],At}var Sh={a:1,b:0,c:0,d:1,e:0,f:0};c.interpolateTransform=Ef;function mh(At){return At.length?At.pop()+",":""}function uc(At,jt,ue,Me){if(At[0]!==jt[0]||At[1]!==jt[1]){var Le=ue.push("translate(",null,",",null,")");Me.push({i:Le-4,x:fc(At[0],jt[0])},{i:Le-2,x:fc(At[1],jt[1])})}else(jt[0]||jt[1])&&ue.push("translate("+jt+")")}function ef(At,jt,ue,Me){At!==jt?(At-jt>180?jt+=360:jt-At>180&&(At+=360),Me.push({i:ue.push(mh(ue)+"rotate(",null,")")-2,x:fc(At,jt)})):jt&&ue.push(mh(ue)+"rotate("+jt+")")}function Wf(At,jt,ue,Me){At!==jt?Me.push({i:ue.push(mh(ue)+"skewX(",null,")")-2,x:fc(At,jt)}):jt&&ue.push(mh(ue)+"skewX("+jt+")")}function Jl(At,jt,ue,Me){if(At[0]!==jt[0]||At[1]!==jt[1]){var Le=ue.push(mh(ue)+"scale(",null,",",null,")");Me.push({i:Le-4,x:fc(At[0],jt[0])},{i:Le-2,x:fc(At[1],jt[1])})}else(jt[0]!==1||jt[1]!==1)&&ue.push(mh(ue)+"scale("+jt+")")}function Ef(At,jt){var ue=[],Me=[];return At=c.transform(At),jt=c.transform(jt),uc(At.translate,jt.translate,ue,Me),ef(At.rotate,jt.rotate,ue,Me),Wf(At.skew,jt.skew,ue,Me),Jl(At.scale,jt.scale,ue,Me),At=jt=null,function(Le){for(var Be=-1,sr=Me.length,ir;++Be<sr;)ue[(ir=Me[Be]).i]=ir.x(Le);return ue.join("")}}function Ld(At,jt){return jt=(jt-=At=+At)||1/jt,function(ue){return(ue-At)/jt}}function Yf(At,jt){return jt=(jt-=At=+At)||1/jt,function(ue){return Math.max(0,Math.min(1,(ue-At)/jt))}}c.layout={},c.layout.bundle=function(){return function(At){for(var jt=[],ue=-1,Me=At.length;++ue<Me;)jt.push(_f(At[ue]));return jt}};function _f(At){for(var jt=At.source,ue=At.target,Me=Nc(jt,ue),Le=[jt];jt!==Me;)jt=jt.parent,Le.push(jt);for(var Be=Le.length;ue!==Me;)Le.splice(Be,0,ue),ue=ue.parent;return Le}function Kf(At){for(var jt=[],ue=At.parent;ue!=null;)jt.push(At),At=ue,ue=ue.parent;return jt.push(At),jt}function Nc(At,jt){if(At===jt)return At;for(var ue=Kf(At),Me=Kf(jt),Le=ue.pop(),Be=Me.pop(),sr=null;Le===Be;)sr=Le,Le=ue.pop(),Be=Me.pop();return sr}c.layout.chord=function(){var At={},jt,ue,Me,Le,Be=0,sr,ir,Mr;function en(){var vn={},In=[],On=c.range(Le),Bi=[],Un,mi,Ti,Ii,Wi;for(jt=[],ue=[],Un=0,Ii=-1;++Ii<Le;){for(mi=0,Wi=-1;++Wi<Le;)mi+=Me[Ii][Wi];In.push(mi),Bi.push(c.range(Le)),Un+=mi}for(sr&&On.sort(function(al,Wo){return sr(In[al],In[Wo])}),ir&&Bi.forEach(function(al,Wo){al.sort(function(ps,Tl){return ir(Me[Wo][ps],Me[Wo][Tl])})}),Un=(St-Be*Le)/Un,mi=0,Ii=-1;++Ii<Le;){for(Ti=mi,Wi=-1;++Wi<Le;){var Yn=On[Ii],ja=Bi[Yn][Wi],Ha=Me[Yn][ja],ro=mi,Lo=mi+=Ha*Un;vn[Yn+"-"+ja]={index:Yn,subindex:ja,startAngle:ro,endAngle:Lo,value:Ha}}ue[Yn]={index:Yn,startAngle:Ti,endAngle:mi,value:In[Yn]},mi+=Be}for(Ii=-1;++Ii<Le;)for(Wi=Ii-1;++Wi<Le;){var Fo=vn[Ii+"-"+Wi],Uo=vn[Wi+"-"+Ii];(Fo.value||Uo.value)&&jt.push(Fo.value<Uo.value?{source:Uo,target:Fo}:{source:Fo,target:Uo})}Mr&&Xr()}function Xr(){jt.sort(function(vn,In){return Mr((vn.source.value+vn.target.value)/2,(In.source.value+In.target.value)/2)})}return At.matrix=function(vn){return arguments.length?(Le=(Me=vn)&&Me.length,jt=ue=null,At):Me},At.padding=function(vn){return arguments.length?(Be=vn,jt=ue=null,At):Be},At.sortGroups=function(vn){return arguments.length?(sr=vn,jt=ue=null,At):sr},At.sortSubgroups=function(vn){return arguments.length?(ir=vn,jt=null,At):ir},At.sortChords=function(vn){return arguments.length?(Mr=vn,jt&&Xr(),At):Mr},At.chords=function(){return jt||en(),jt},At.groups=function(){return ue||en(),ue},At},c.layout.force=function(){var At={},jt=c.dispatch("start","tick","end"),ue,Me=[1,1],Le,Be,sr=.9,ir=Eh,Mr=Sc,en=-30,Xr=Uc,vn=.1,In=.64,On=[],Bi=[],Un,mi,Ti;function Ii(Yn){return function(ja,Ha,ro,Lo){if(ja.point!==Yn){var Fo=ja.cx-Yn.x,Uo=ja.cy-Yn.y,al=Lo-Ha,Wo=Fo*Fo+Uo*Uo;if(al*al/In<Wo){if(Wo<Xr){var ps=ja.charge/Wo;Yn.px-=Fo*ps,Yn.py-=Uo*ps}return!0}if(ja.point&&Wo&&Wo<Xr){var ps=ja.pointCharge/Wo;Yn.px-=Fo*ps,Yn.py-=Uo*ps}}return!ja.charge}}At.tick=function(){if((Be*=.99)<.005)return ue=null,jt.end({type:"end",alpha:Be=0}),!0;var Yn=On.length,ja=Bi.length,Ha,ro,Lo,Fo,Uo,al,Wo,ps,Tl;for(ro=0;ro<ja;++ro)Lo=Bi[ro],Fo=Lo.source,Uo=Lo.target,ps=Uo.x-Fo.x,Tl=Uo.y-Fo.y,(al=ps*ps+Tl*Tl)&&(al=Be*mi[ro]*((al=Math.sqrt(al))-Un[ro])/al,ps*=al,Tl*=al,Uo.x-=ps*(Wo=Fo.weight+Uo.weight?Fo.weight/(Fo.weight+Uo.weight):.5),Uo.y-=Tl*Wo,Fo.x+=ps*(Wo=1-Wo),Fo.y+=Tl*Wo);if((Wo=Be*vn)&&(ps=Me[0]/2,Tl=Me[1]/2,ro=-1,Wo))for(;++ro<Yn;)Lo=On[ro],Lo.x+=(ps-Lo.x)*Wo,Lo.y+=(Tl-Lo.y)*Wo;if(en)for(lu(Ha=c.geom.quadtree(On),Be,Ti),ro=-1;++ro<Yn;)(Lo=On[ro]).fixed||Ha.visit(Ii(Lo));for(ro=-1;++ro<Yn;)Lo=On[ro],Lo.fixed?(Lo.x=Lo.px,Lo.y=Lo.py):(Lo.x-=(Lo.px-(Lo.px=Lo.x))*sr,Lo.y-=(Lo.py-(Lo.py=Lo.y))*sr);jt.tick({type:"tick",alpha:Be})},At.nodes=function(Yn){return arguments.length?(On=Yn,At):On},At.links=function(Yn){return arguments.length?(Bi=Yn,At):Bi},At.size=function(Yn){return arguments.length?(Me=Yn,At):Me},At.linkDistance=function(Yn){return arguments.length?(ir=typeof Yn=="function"?Yn:+Yn,At):ir},At.distance=At.linkDistance,At.linkStrength=function(Yn){return arguments.length?(Mr=typeof Yn=="function"?Yn:+Yn,At):Mr},At.friction=function(Yn){return arguments.length?(sr=+Yn,At):sr},At.charge=function(Yn){return arguments.length?(en=typeof Yn=="function"?Yn:+Yn,At):en},At.chargeDistance=function(Yn){return arguments.length?(Xr=Yn*Yn,At):Math.sqrt(Xr)},At.gravity=function(Yn){return arguments.length?(vn=+Yn,At):vn},At.theta=function(Yn){return arguments.length?(In=Yn*Yn,At):Math.sqrt(In)},At.alpha=function(Yn){return arguments.length?(Yn=+Yn,Be?Yn>0?Be=Yn:(ue.c=null,ue.t=NaN,ue=null,jt.end({type:"end",alpha:Be=0})):Yn>0&&(jt.start({type:"start",alpha:Be=Yn}),ue=Ri(At.tick)),At):Be},At.start=function(){var Yn,ja=On.length,Ha=Bi.length,ro=Me[0],Lo=Me[1],Fo,Uo;for(Yn=0;Yn<ja;++Yn)(Uo=On[Yn]).index=Yn,Uo.weight=0;for(Yn=0;Yn<Ha;++Yn)Uo=Bi[Yn],typeof Uo.source=="number"&&(Uo.source=On[Uo.source]),typeof Uo.target=="number"&&(Uo.target=On[Uo.target]),++Uo.source.weight,++Uo.target.weight;for(Yn=0;Yn<ja;++Yn)Uo=On[Yn],isNaN(Uo.x)&&(Uo.x=al("x",ro)),isNaN(Uo.y)&&(Uo.y=al("y",Lo)),isNaN(Uo.px)&&(Uo.px=Uo.x),isNaN(Uo.py)&&(Uo.py=Uo.y);if(Un=[],typeof ir=="function")for(Yn=0;Yn<Ha;++Yn)Un[Yn]=+ir.call(this,Bi[Yn],Yn);else for(Yn=0;Yn<Ha;++Yn)Un[Yn]=ir;if(mi=[],typeof Mr=="function")for(Yn=0;Yn<Ha;++Yn)mi[Yn]=+Mr.call(this,Bi[Yn],Yn);else for(Yn=0;Yn<Ha;++Yn)mi[Yn]=Mr;if(Ti=[],typeof en=="function")for(Yn=0;Yn<ja;++Yn)Ti[Yn]=+en.call(this,On[Yn],Yn);else for(Yn=0;Yn<ja;++Yn)Ti[Yn]=en;function al(Wo,ps){if(!Fo){for(Fo=new Array(ja),cu=0;cu<ja;++cu)Fo[cu]=[];for(cu=0;cu<Ha;++cu){var Tl=Bi[cu];Fo[Tl.source.index].push(Tl.target),Fo[Tl.target.index].push(Tl.source)}}for(var Ku=Fo[Yn],cu=-1,_o=Ku.length,Zs;++cu<_o;)if(!isNaN(Zs=Ku[cu][Wo]))return Zs;return Math.random()*ps}return At.resume()},At.resume=function(){return At.alpha(.1)},At.stop=function(){return At.alpha(0)},At.drag=function(){if(Le||(Le=c.behavior.drag().origin(V).on("dragstart.force",Xf).on("drag.force",Wi).on("dragend.force",zu)),!arguments.length)return Le;this.on("mouseover.force",jc).on("mouseout.force",Hh).call(Le)};function Wi(Yn){Yn.px=c.event.x,Yn.py=c.event.y,At.resume()}return c.rebind(At,jt,"on")};function Xf(At){At.fixed|=2}function zu(At){At.fixed&=-7}function jc(At){At.fixed|=4,At.px=At.x,At.py=At.y}function Hh(At){At.fixed&=-5}function lu(At,jt,ue){var Me=0,Le=0;if(At.charge=0,!At.leaf)for(var Be=At.nodes,sr=Be.length,ir=-1,Mr;++ir<sr;)Mr=Be[ir],Mr!=null&&(lu(Mr,jt,ue),At.charge+=Mr.charge,Me+=Mr.charge*Mr.cx,Le+=Mr.charge*Mr.cy);if(At.point){At.leaf||(At.point.x+=Math.random()-.5,At.point.y+=Math.random()-.5);var en=jt*ue[At.point.index];At.charge+=At.pointCharge=en,Me+=en*At.point.x,Le+=en*At.point.y}At.cx=Me/At.charge,At.cy=Le/At.charge}var Eh=20,Sc=1,Uc=1/0;c.layout.hierarchy=function(){var At=Pd,jt=Wh,ue=Cf;function Me(Le){var Be=[Le],sr=[],ir;for(Le.depth=0;(ir=Be.pop())!=null;)if(sr.push(ir),(en=jt.call(Me,ir,ir.depth))&&(Mr=en.length)){for(var Mr,en,Xr;--Mr>=0;)Be.push(Xr=en[Mr]),Xr.parent=ir,Xr.depth=ir.depth+1;ue&&(ir.value=0),ir.children=en}else ue&&(ir.value=+ue.call(Me,ir,ir.depth)||0),delete ir.children;return gh(Le,function(vn){var In,On;At&&(In=vn.children)&&In.sort(At),ue&&(On=vn.parent)&&(On.value+=vn.value)}),sr}return Me.sort=function(Le){return arguments.length?(At=Le,Me):At},Me.children=function(Le){return arguments.length?(jt=Le,Me):jt},Me.value=function(Le){return arguments.length?(ue=Le,Me):ue},Me.revalue=function(Le){return ue&&(uf(Le,function(Be){Be.children&&(Be.value=0)}),gh(Le,function(Be){var sr;Be.children||(Be.value=+ue.call(Me,Be,Be.depth)||0),(sr=Be.parent)&&(sr.value+=Be.value)})),Le},Me};function _u(At,jt){return c.rebind(At,jt,"sort","children","value"),At.nodes=At,At.links=Qd,At}function uf(At,jt){for(var ue=[At];(At=ue.pop())!=null;)if(jt(At),(Le=At.children)&&(Me=Le.length))for(var Me,Le;--Me>=0;)ue.push(Le[Me])}function gh(At,jt){for(var ue=[At],Me=[];(At=ue.pop())!=null;)if(Me.push(At),(sr=At.children)&&(Be=sr.length))for(var Le=-1,Be,sr;++Le<Be;)ue.push(sr[Le]);for(;(At=Me.pop())!=null;)jt(At)}function Wh(At){return At.children}function Cf(At){return At.value}function Pd(At,jt){return jt.value-At.value}function Qd(At){return c.merge(At.map(function(jt){return(jt.children||[]).map(function(ue){return{source:jt,target:ue}})}))}c.layout.partition=function(){var At=c.layout.hierarchy(),jt=[1,1];function ue(Be,sr,ir,Mr){var en=Be.children;if(Be.x=sr,Be.y=Be.depth*Mr,Be.dx=ir,Be.dy=Mr,en&&(vn=en.length)){var Xr=-1,vn,In,On;for(ir=Be.value?ir/Be.value:0;++Xr<vn;)ue(In=en[Xr],sr,On=In.value*ir,Mr),sr+=On}}function Me(Be){var sr=Be.children,ir=0;if(sr&&(en=sr.length))for(var Mr=-1,en;++Mr<en;)ir=Math.max(ir,Me(sr[Mr]));return 1+ir}function Le(Be,sr){var ir=At.call(this,Be,sr);return ue(ir[0],0,jt[0],jt[1]/Me(ir[0])),ir}return Le.size=function(Be){return arguments.length?(jt=Be,Le):jt},_u(Le,At)},c.layout.pie=function(){var At=Number,jt=cf,ue=0,Me=St,Le=0;function Be(sr){var ir=sr.length,Mr=sr.map(function(Ii,Wi){return+At.call(Be,Ii,Wi)}),en=+(typeof ue=="function"?ue.apply(this,arguments):ue),Xr=(typeof Me=="function"?Me.apply(this,arguments):Me)-en,vn=Math.min(Math.abs(Xr)/ir,+(typeof Le=="function"?Le.apply(this,arguments):Le)),In=vn*(Xr<0?-1:1),On=c.sum(Mr),Bi=On?(Xr-ir*In)/On:0,Un=c.range(ir),mi=[],Ti;return jt!=null&&Un.sort(jt===cf?function(Ii,Wi){return Mr[Wi]-Mr[Ii]}:function(Ii,Wi){return jt(sr[Ii],sr[Wi])}),Un.forEach(function(Ii){mi[Ii]={data:sr[Ii],value:Ti=Mr[Ii],startAngle:en,endAngle:en+=Ti*Bi+In,padAngle:vn}}),mi}return Be.value=function(sr){return arguments.length?(At=sr,Be):At},Be.sort=function(sr){return arguments.length?(jt=sr,Be):jt},Be.startAngle=function(sr){return arguments.length?(ue=sr,Be):ue},Be.endAngle=function(sr){return arguments.length?(Me=sr,Be):Me},Be.padAngle=function(sr){return arguments.length?(Le=sr,Be):Le},Be};var cf={};c.layout.stack=function(){var At=V,jt=Pf,ue=vh,Me=hf,Le=Lf,Be=wc;function sr(ir,Mr){if(!(Bi=ir.length))return ir;var en=ir.map(function(Ii,Wi){return At.call(sr,Ii,Wi)}),Xr=en.map(function(Ii){return Ii.map(function(Wi,Yn){return[Le.call(sr,Wi,Yn),Be.call(sr,Wi,Yn)]})}),vn=jt.call(sr,Xr,Mr);en=c.permute(en,vn),Xr=c.permute(Xr,vn);var In=ue.call(sr,Xr,Mr),On=en[0].length,Bi,Un,mi,Ti;for(mi=0;mi<On;++mi)for(Me.call(sr,en[0][mi],Ti=In[mi],Xr[0][mi][1]),Un=1;Un<Bi;++Un)Me.call(sr,en[Un][mi],Ti+=Xr[Un-1][mi][1],Xr[Un][mi][1]);return ir}return sr.values=function(ir){return arguments.length?(At=ir,sr):At},sr.order=function(ir){return arguments.length?(jt=typeof ir=="function"?ir:Qc.get(ir)||Pf,sr):jt},sr.offset=function(ir){return arguments.length?(ue=typeof ir=="function"?ir:ff.get(ir)||vh,sr):ue},sr.x=function(ir){return arguments.length?(Le=ir,sr):Le},sr.y=function(ir){return arguments.length?(Be=ir,sr):Be},sr.out=function(ir){return arguments.length?(Me=ir,sr):Me},sr};function Lf(At){return At.x}function wc(At){return At.y}function hf(At,jt,ue){At.y0=jt,At.y=ue}var Qc=c.map({"inside-out":function(At){var jt=At.length,ue,Me,Le=At.map(bu),Be=At.map(Ch),sr=c.range(jt).sort(function(vn,In){return Le[vn]-Le[In]}),ir=0,Mr=0,en=[],Xr=[];for(ue=0;ue<jt;++ue)Me=sr[ue],ir<Mr?(ir+=Be[Me],en.push(Me)):(Mr+=Be[Me],Xr.push(Me));return Xr.reverse().concat(en)},reverse:function(At){return c.range(At.length).reverse()},default:Pf}),ff=c.map({silhouette:function(At){var jt=At.length,ue=At[0].length,Me=[],Le=0,Be,sr,ir,Mr=[];for(sr=0;sr<ue;++sr){for(Be=0,ir=0;Be<jt;Be++)ir+=At[Be][sr][1];ir>Le&&(Le=ir),Me.push(ir)}for(sr=0;sr<ue;++sr)Mr[sr]=(Le-Me[sr])/2;return Mr},wiggle:function(At){var jt=At.length,ue=At[0],Me=ue.length,Le,Be,sr,ir,Mr,en,Xr,vn,In,On=[];for(On[0]=vn=In=0,Be=1;Be<Me;++Be){for(Le=0,ir=0;Le<jt;++Le)ir+=At[Le][Be][1];for(Le=0,Mr=0,Xr=ue[Be][0]-ue[Be-1][0];Le<jt;++Le){for(sr=0,en=(At[Le][Be][1]-At[Le][Be-1][1])/(2*Xr);sr<Le;++sr)en+=(At[sr][Be][1]-At[sr][Be-1][1])/Xr;Mr+=en*At[Le][Be][1]}On[Be]=vn-=ir?Mr/ir*Xr:0,vn<In&&(In=vn)}for(Be=0;Be<Me;++Be)On[Be]-=In;return On},expand:function(At){var jt=At.length,ue=At[0].length,Me=1/jt,Le,Be,sr,ir=[];for(Be=0;Be<ue;++Be){for(Le=0,sr=0;Le<jt;Le++)sr+=At[Le][Be][1];if(sr)for(Le=0;Le<jt;Le++)At[Le][Be][1]/=sr;else for(Le=0;Le<jt;Le++)At[Le][Be][1]=Me}for(Be=0;Be<ue;++Be)ir[Be]=0;return ir},zero:vh});function Pf(At){return c.range(At.length)}function vh(At){for(var jt=-1,ue=At[0].length,Me=[];++jt<ue;)Me[jt]=0;return Me}function bu(At){for(var jt=1,ue=0,Me=At[0][1],Le,Be=At.length;jt<Be;++jt)(Le=At[jt][1])>Me&&(ue=jt,Me=Le);return ue}function Ch(At){return At.reduce(Vc,0)}function Vc(At,jt){return At+jt[1]}c.layout.histogram=function(){var At=!0,jt=Number,ue=bf,Me=fd;function Le(Be,sr){for(var ir=[],Mr=Be.map(jt,this),en=ue.call(this,Mr,sr),Xr=Me.call(this,en,Mr,sr),vn,sr=-1,In=Mr.length,On=Xr.length-1,Bi=At?1:1/In,Un;++sr<On;)vn=ir[sr]=[],vn.dx=Xr[sr+1]-(vn.x=Xr[sr]),vn.y=0;if(On>0)for(sr=-1;++sr<In;)Un=Mr[sr],Un>=en[0]&&Un<=en[1]&&(vn=ir[c.bisect(Xr,Un,1,On)-1],vn.y+=Bi,vn.push(Be[sr]));return ir}return Le.value=function(Be){return arguments.length?(jt=Be,Le):jt},Le.range=function(Be){return arguments.length?(ue=Ee(Be),Le):ue},Le.bins=function(Be){return arguments.length?(Me=typeof Be=="number"?function(sr){return vu(sr,Be)}:Ee(Be),Le):Me},Le.frequency=function(Be){return arguments.length?(At=!!Be,Le):At},Le};function fd(At,jt){return vu(At,Math.ceil(Math.log(jt.length)/Math.LN2+1))}function vu(At,jt){for(var ue=-1,Me=+At[0],Le=(At[1]-Me)/jt,Be=[];++ue<=jt;)Be[ue]=Le*ue+Me;return Be}function bf(At){return[c.min(At),c.max(At)]}c.layout.pack=function(){var At=c.layout.hierarchy().sort(qh),jt=0,ue=[1,1],Me;function Le(Be,sr){var ir=At.call(this,Be,sr),Mr=ir[0],en=ue[0],Xr=ue[1],vn=Me==null?Math.sqrt:typeof Me=="function"?Me:function(){return Me};if(Mr.x=Mr.y=0,gh(Mr,function(On){On.r=+vn(On.value)}),gh(Mr,wf),jt){var In=jt*(Me?1:Math.max(2*Mr.r/en,2*Mr.r/Xr))/2;gh(Mr,function(On){On.r+=In}),gh(Mr,wf),gh(Mr,function(On){On.r-=In})}return Jf(Mr,en/2,Xr/2,Me?1:1/Math.max(2*Mr.r/en,2*Mr.r/Xr)),ir}return Le.size=function(Be){return arguments.length?(ue=Be,Le):ue},Le.radius=function(Be){return arguments.length?(Me=Be==null||typeof Be=="function"?Be:+Be,Le):Me},Le.padding=function(Be){return arguments.length?(jt=+Be,Le):jt},_u(Le,At)};function qh(At,jt){return At.value-jt.value}function th(At,jt){var ue=At._pack_next;At._pack_next=jt,jt._pack_prev=At,jt._pack_next=ue,ue._pack_prev=jt}function rf(At,jt){At._pack_next=jt,jt._pack_prev=At}function Zh(At,jt){var ue=jt.x-At.x,Me=jt.y-At.y,Le=At.r+jt.r;return .999*Le*Le>ue*ue+Me*Me}function wf(At){if(!(jt=At.children)||!(In=jt.length))return;var jt,ue=1/0,Me=-1/0,Le=1/0,Be=-1/0,sr,ir,Mr,en,Xr,vn,In;function On(Yn){ue=Math.min(Yn.x-Yn.r,ue),Me=Math.max(Yn.x+Yn.r,Me),Le=Math.min(Yn.y-Yn.r,Le),Be=Math.max(Yn.y+Yn.r,Be)}if(jt.forEach(zd),sr=jt[0],sr.x=-sr.r,sr.y=0,On(sr),In>1&&(ir=jt[1],ir.x=ir.r,ir.y=0,On(ir),In>2))for(Mr=jt[2],eh(sr,ir,Mr),On(Mr),th(sr,Mr),sr._pack_prev=Mr,th(Mr,ir),ir=sr._pack_next,en=3;en<In;en++){eh(sr,ir,Mr=jt[en]);var Bi=0,Un=1,mi=1;for(Xr=ir._pack_next;Xr!==ir;Xr=Xr._pack_next,Un++)if(Zh(Xr,Mr)){Bi=1;break}if(Bi==1)for(vn=sr._pack_prev;vn!==Xr._pack_prev&&!Zh(vn,Mr);vn=vn._pack_prev,mi++);Bi?(Un<mi||Un==mi&&ir.r<sr.r?rf(sr,ir=Xr):rf(sr=vn,ir),en--):(th(sr,Mr),ir=Mr,On(Mr))}var Ti=(ue+Me)/2,Ii=(Le+Be)/2,Wi=0;for(en=0;en<In;en++)Mr=jt[en],Mr.x-=Ti,Mr.y-=Ii,Wi=Math.max(Wi,Mr.r+Math.sqrt(Mr.x*Mr.x+Mr.y*Mr.y));At.r=Wi,jt.forEach(gc)}function zd(At){At._pack_next=At._pack_prev=At}function gc(At){delete At._pack_next,delete At._pack_prev}function Jf(At,jt,ue,Me){var Le=At.children;if(At.x=jt+=Me*At.x,At.y=ue+=Me*At.y,At.r*=Me,Le)for(var Be=-1,sr=Le.length;++Be<sr;)Jf(Le[Be],jt,ue,Me)}function eh(At,jt,ue){var Me=At.r+ue.r,Le=jt.x-At.x,Be=jt.y-At.y;if(Me&&(Le||Be)){var sr=jt.r+ue.r,ir=Le*Le+Be*Be;sr*=sr,Me*=Me;var Mr=.5+(Me-sr)/(2*ir),en=Math.sqrt(Math.max(0,2*sr*(Me+ir)-(Me-=ir)*Me-sr*sr))/(2*ir);ue.x=At.x+Mr*Le+en*Be,ue.y=At.y+Mr*Be-en*Le}else ue.x=At.x+Me,ue.y=At.y}c.layout.tree=function(){var At=c.layout.hierarchy().sort(null).value(null),jt=Lh,ue=[1,1],Me=null;function Le(Xr,vn){var In=At.call(this,Xr,vn),On=In[0],Bi=Be(On);if(gh(Bi,sr),Bi.parent.m=-Bi.z,uf(Bi,ir),Me)uf(On,en);else{var Un=On,mi=On,Ti=On;uf(On,function(ja){ja.x<Un.x&&(Un=ja),ja.x>mi.x&&(mi=ja),ja.depth>Ti.depth&&(Ti=ja)});var Ii=jt(Un,mi)/2-Un.x,Wi=ue[0]/(mi.x+jt(mi,Un)/2+Ii),Yn=ue[1]/(Ti.depth||1);uf(On,function(ja){ja.x=(ja.x+Ii)*Wi,ja.y=ja.depth*Yn})}return In}function Be(Xr){for(var vn={A:null,children:[Xr]},In=[vn],On;(On=In.pop())!=null;)for(var Bi=On.children,Un,mi=0,Ti=Bi.length;mi<Ti;++mi)In.push((Bi[mi]=Un={_:Bi[mi],parent:On,children:(Un=Bi[mi].children)&&Un.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:mi}).a=Un);return vn.children[0]}function sr(Xr){var vn=Xr.children,In=Xr.parent.children,On=Xr.i?In[Xr.i-1]:null;if(vn.length){xh(Xr);var Bi=(vn[0].z+vn[vn.length-1].z)/2;On?(Xr.z=On.z+jt(Xr._,On._),Xr.m=Xr.z-Bi):Xr.z=Bi}else On&&(Xr.z=On.z+jt(Xr._,On._));Xr.parent.A=Mr(Xr,On,Xr.parent.A||In[0])}function ir(Xr){Xr._.x=Xr.z+Xr.parent.m,Xr.m+=Xr.parent.m}function Mr(Xr,vn,In){if(vn){for(var On=Xr,Bi=Xr,Un=vn,mi=On.parent.children[0],Ti=On.m,Ii=Bi.m,Wi=Un.m,Yn=mi.m,ja;Un=Ru(Un),On=yh(On),Un&&On;)mi=yh(mi),Bi=Ru(Bi),Bi.a=Xr,ja=Un.z+Wi-On.z-Ti+jt(Un._,On._),ja>0&&(eu(df(Un,Xr,In),Xr,ja),Ti+=ja,Ii+=ja),Wi+=Un.m,Ti+=On.m,Yn+=mi.m,Ii+=Bi.m;Un&&!Ru(Bi)&&(Bi.t=Un,Bi.m+=Wi-Ii),On&&!yh(mi)&&(mi.t=On,mi.m+=Ti-Yn,In=Xr)}return In}function en(Xr){Xr.x*=ue[0],Xr.y=Xr.depth*ue[1]}return Le.separation=function(Xr){return arguments.length?(jt=Xr,Le):jt},Le.size=function(Xr){return arguments.length?(Me=(ue=Xr)==null?en:null,Le):Me?null:ue},Le.nodeSize=function(Xr){return arguments.length?(Me=(ue=Xr)==null?null:en,Le):Me?ue:null},_u(Le,At)};function Lh(At,jt){return At.parent==jt.parent?1:2}function yh(At){var jt=At.children;return jt.length?jt[0]:At.t}function Ru(At){var jt=At.children,ue;return(ue=jt.length)?jt[ue-1]:At.t}function eu(At,jt,ue){var Me=ue/(jt.i-At.i);jt.c-=Me,jt.s+=ue,At.c+=Me,jt.z+=ue,jt.m+=ue}function xh(At){for(var jt=0,ue=0,Me=At.children,Le=Me.length,Be;--Le>=0;)Be=Me[Le],Be.z+=jt,Be.m+=jt,jt+=Be.s+(ue+=Be.c)}function df(At,jt,ue){return At.a.parent===jt.parent?At.a:ue}c.layout.cluster=function(){var At=c.layout.hierarchy().sort(null).value(null),jt=Lh,ue=[1,1],Me=!1;function Le(Be,sr){var ir=At.call(this,Be,sr),Mr=ir[0],en,Xr=0;gh(Mr,function(Un){var mi=Un.children;mi&&mi.length?(Un.x=qf(mi),Un.y=_h(mi)):(Un.x=en?Xr+=jt(Un,en):0,Un.y=0,en=Un)});var vn=mr(Mr),In=Ur(Mr),On=vn.x-jt(vn,In)/2,Bi=In.x+jt(In,vn)/2;return gh(Mr,Me?function(Un){Un.x=(Un.x-Mr.x)*ue[0],Un.y=(Mr.y-Un.y)*ue[1]}:function(Un){Un.x=(Un.x-On)/(Bi-On)*ue[0],Un.y=(1-(Mr.y?Un.y/Mr.y:1))*ue[1]}),ir}return Le.separation=function(Be){return arguments.length?(jt=Be,Le):jt},Le.size=function(Be){return arguments.length?(Me=(ue=Be)==null,Le):Me?null:ue},Le.nodeSize=function(Be){return arguments.length?(Me=(ue=Be)!=null,Le):Me?ue:null},_u(Le,At)};function _h(At){return 1+c.max(At,function(jt){return jt.y})}function qf(At){return At.reduce(function(jt,ue){return jt+ue.x},0)/At.length}function mr(At){var jt=At.children;return jt&&jt.length?mr(jt[0]):At}function Ur(At){var jt=At.children,ue;return jt&&(ue=jt.length)?Ur(jt[ue-1]):At}c.layout.treemap=function(){var At=c.layout.hierarchy(),jt=Math.round,ue=[1,1],Me=null,Le=_n,Be=!1,sr,ir="squarify",Mr=.5*(1+Math.sqrt(5));function en(Un,mi){for(var Ti=-1,Ii=Un.length,Wi,Yn;++Ti<Ii;)Yn=(Wi=Un[Ti]).value*(mi<0?0:mi),Wi.area=isNaN(Yn)||Yn<=0?0:Yn}function Xr(Un){var mi=Un.children;if(mi&&mi.length){var Ti=Le(Un),Ii=[],Wi=mi.slice(),Yn,ja=1/0,Ha,ro=ir==="slice"?Ti.dx:ir==="dice"?Ti.dy:ir==="slice-dice"?Un.depth&1?Ti.dy:Ti.dx:Math.min(Ti.dx,Ti.dy),Lo;for(en(Wi,Ti.dx*Ti.dy/Un.value),Ii.area=0;(Lo=Wi.length)>0;)Ii.push(Yn=Wi[Lo-1]),Ii.area+=Yn.area,ir!=="squarify"||(Ha=In(Ii,ro))<=ja?(Wi.pop(),ja=Ha):(Ii.area-=Ii.pop().area,On(Ii,ro,Ti,!1),ro=Math.min(Ti.dx,Ti.dy),Ii.length=Ii.area=0,ja=1/0);Ii.length&&(On(Ii,ro,Ti,!0),Ii.length=Ii.area=0),mi.forEach(Xr)}}function vn(Un){var mi=Un.children;if(mi&&mi.length){var Ti=Le(Un),Ii=mi.slice(),Wi,Yn=[];for(en(Ii,Ti.dx*Ti.dy/Un.value),Yn.area=0;Wi=Ii.pop();)Yn.push(Wi),Yn.area+=Wi.area,Wi.z!=null&&(On(Yn,Wi.z?Ti.dx:Ti.dy,Ti,!Ii.length),Yn.length=Yn.area=0);mi.forEach(vn)}}function In(Un,mi){for(var Ti=Un.area,Ii,Wi=0,Yn=1/0,ja=-1,Ha=Un.length;++ja<Ha;)(Ii=Un[ja].area)&&(Ii<Yn&&(Yn=Ii),Ii>Wi&&(Wi=Ii));return Ti*=Ti,mi*=mi,Ti?Math.max(mi*Wi*Mr/Ti,Ti/(mi*Yn*Mr)):1/0}function On(Un,mi,Ti,Ii){var Wi=-1,Yn=Un.length,ja=Ti.x,Ha=Ti.y,ro=mi?jt(Un.area/mi):0,Lo;if(mi==Ti.dx){for((Ii||ro>Ti.dy)&&(ro=Ti.dy);++Wi<Yn;)Lo=Un[Wi],Lo.x=ja,Lo.y=Ha,Lo.dy=ro,ja+=Lo.dx=Math.min(Ti.x+Ti.dx-ja,ro?jt(Lo.area/ro):0);Lo.z=!0,Lo.dx+=Ti.x+Ti.dx-ja,Ti.y+=ro,Ti.dy-=ro}else{for((Ii||ro>Ti.dx)&&(ro=Ti.dx);++Wi<Yn;)Lo=Un[Wi],Lo.x=ja,Lo.y=Ha,Lo.dx=ro,Ha+=Lo.dy=Math.min(Ti.y+Ti.dy-Ha,ro?jt(Lo.area/ro):0);Lo.z=!1,Lo.dy+=Ti.y+Ti.dy-Ha,Ti.x+=ro,Ti.dx-=ro}}function Bi(Un){var mi=sr||At(Un),Ti=mi[0];return Ti.x=Ti.y=0,Ti.value?(Ti.dx=ue[0],Ti.dy=ue[1]):Ti.dx=Ti.dy=0,sr&&At.revalue(Ti),en([Ti],Ti.dx*Ti.dy/Ti.value),(sr?vn:Xr)(Ti),Be&&(sr=mi),mi}return Bi.size=function(Un){return arguments.length?(ue=Un,Bi):ue},Bi.padding=function(Un){if(!arguments.length)return Me;function mi(Wi){var Yn=Un.call(Bi,Wi,Wi.depth);return Yn==null?_n(Wi):cn(Wi,typeof Yn=="number"?[Yn,Yn,Yn,Yn]:Yn)}function Ti(Wi){return cn(Wi,Un)}var Ii;return Le=(Me=Un)==null?_n:(Ii=typeof Un)=="function"?mi:(Ii==="number"&&(Un=[Un,Un,Un,Un]),Ti),Bi},Bi.round=function(Un){return arguments.length?(jt=Un?Math.round:Number,Bi):jt!=Number},Bi.sticky=function(Un){return arguments.length?(Be=Un,sr=null,Bi):Be},Bi.ratio=function(Un){return arguments.length?(Mr=Un,Bi):Mr},Bi.mode=function(Un){return arguments.length?(ir=Un+"",Bi):ir},_u(Bi,At)};function _n(At){return{x:At.x,y:At.y,dx:At.dx,dy:At.dy}}function cn(At,jt){var ue=At.x+jt[3],Me=At.y+jt[0],Le=At.dx-jt[1]-jt[3],Be=At.dy-jt[0]-jt[2];return Le<0&&(ue+=Le/2,Le=0),Be<0&&(Me+=Be/2,Be=0),{x:ue,y:Me,dx:Le,dy:Be}}c.random={normal:function(At,jt){var ue=arguments.length;return ue<2&&(jt=1),ue<1&&(At=0),function(){var Me,Le,Be;do Me=Math.random()*2-1,Le=Math.random()*2-1,Be=Me*Me+Le*Le;while(!Be||Be>1);return At+jt*Me*Math.sqrt(-2*Math.log(Be)/Be)}},logNormal:function(){var At=c.random.normal.apply(c,arguments);return function(){return Math.exp(At())}},bates:function(At){var jt=c.random.irwinHall(At);return function(){return jt()/At}},irwinHall:function(At){return function(){for(var jt=0,ue=0;ue<At;ue++)jt+=Math.random();return jt}}},c.scale={};function Wn(At){var jt=At[0],ue=At[At.length-1];return jt<ue?[jt,ue]:[ue,jt]}function hi(At){return At.rangeExtent?At.rangeExtent():Wn(At.range())}function ea(At,jt,ue,Me){var Le=ue(At[0],At[1]),Be=Me(jt[0],jt[1]);return function(sr){return Be(Le(sr))}}function ga(At,jt){var ue=0,Me=At.length-1,Le=At[ue],Be=At[Me],sr;return Be<Le&&(sr=ue,ue=Me,Me=sr,sr=Le,Le=Be,Be=sr),At[ue]=jt.floor(Le),At[Me]=jt.ceil(Be),At}function Ra(At){return At?{floor:function(jt){return Math.floor(jt/At)*At},ceil:function(jt){return Math.ceil(jt/At)*At}}:$a}var $a={floor:V,ceil:V};function ua(At,jt,ue,Me){var Le=[],Be=[],sr=0,ir=Math.min(At.length,jt.length)-1;for(At[ir]<At[0]&&(At=At.slice().reverse(),jt=jt.slice().reverse());++sr<=ir;)Le.push(ue(At[sr-1],At[sr])),Be.push(Me(jt[sr-1],jt[sr]));return function(Mr){var en=c.bisect(At,Mr,1,ir)-1;return Be[en](Le[en](Mr))}}c.scale.linear=function(){return za([0,1],[0,1],el,!1)};function za(At,jt,ue,Me){var Le,Be;function sr(){var Mr=Math.min(At.length,jt.length)>2?ua:ea,en=Me?Yf:Ld;return Le=Mr(At,jt,en,ue),Be=Mr(jt,At,en,el),ir}function ir(Mr){return Le(Mr)}return ir.invert=function(Mr){return Be(Mr)},ir.domain=function(Mr){return arguments.length?(At=Mr.map(Number),sr()):At},ir.range=function(Mr){return arguments.length?(jt=Mr,sr()):jt},ir.rangeRound=function(Mr){return ir.range(Mr).interpolate(Vh)},ir.clamp=function(Mr){return arguments.length?(Me=Mr,sr()):Me},ir.interpolate=function(Mr){return arguments.length?(ue=Mr,sr()):ue},ir.ticks=function(Mr){return rs(At,Mr)},ir.tickFormat=function(Mr,en){return d3_scale_linearTickFormat(At,Mr,en)},ir.nice=function(Mr){return Ji(At,Mr),sr()},ir.copy=function(){return za(At,jt,ue,Me)},sr()}function wa(At,jt){return c.rebind(At,jt,"range","rangeRound","interpolate","clamp")}function Ji(At,jt){return ga(At,Ra(eo(At,jt)[2])),ga(At,Ra(eo(At,jt)[2])),At}function eo(At,jt){jt==null&&(jt=10);var ue=Wn(At),Me=ue[1]-ue[0],Le=Math.pow(10,Math.floor(Math.log(Me/jt)/Math.LN10)),Be=jt/Me*Le;return Be<=.15?Le*=10:Be<=.35?Le*=5:Be<=.75&&(Le*=2),ue[0]=Math.ceil(ue[0]/Le)*Le,ue[1]=Math.floor(ue[1]/Le)*Le+Le*.5,ue[2]=Le,ue}function rs(At,jt){return c.range.apply(c,eo(At,jt))}c.scale.log=function(){return Zo(c.scale.linear().domain([0,1]),10,!0,[1,10])};function Zo(At,jt,ue,Me){function Le(ir){return(ue?Math.log(ir<0?0:ir):-Math.log(ir>0?0:-ir))/Math.log(jt)}function Be(ir){return ue?Math.pow(jt,ir):-Math.pow(jt,-ir)}function sr(ir){return At(Le(ir))}return sr.invert=function(ir){return Be(At.invert(ir))},sr.domain=function(ir){return arguments.length?(ue=ir[0]>=0,At.domain((Me=ir.map(Number)).map(Le)),sr):Me},sr.base=function(ir){return arguments.length?(jt=+ir,At.domain(Me.map(Le)),sr):jt},sr.nice=function(){var ir=ga(Me.map(Le),ue?Math:os);return At.domain(ir),Me=ir.map(Be),sr},sr.ticks=function(){var ir=Wn(Me),Mr=[],en=ir[0],Xr=ir[1],vn=Math.floor(Le(en)),In=Math.ceil(Le(Xr)),On=jt%1?2:jt;if(isFinite(In-vn)){if(ue){for(;vn<In;vn++)for(var Bi=1;Bi<On;Bi++)Mr.push(Be(vn)*Bi);Mr.push(Be(vn))}else for(Mr.push(Be(vn));vn++<In;)for(var Bi=On-1;Bi>0;Bi--)Mr.push(Be(vn)*Bi);for(vn=0;Mr[vn]<en;vn++);for(In=Mr.length;Mr[In-1]>Xr;In--);Mr=Mr.slice(vn,In)}return Mr},sr.copy=function(){return Zo(At.copy(),jt,ue,Me)},wa(sr,At)}var os={floor:function(At){return-Math.ceil(-At)},ceil:function(At){return-Math.floor(-At)}};c.scale.pow=function(){return fs(c.scale.linear(),1,[0,1])};function fs(At,jt,ue){var Me=no(jt),Le=no(1/jt);function Be(sr){return At(Me(sr))}return Be.invert=function(sr){return Le(At.invert(sr))},Be.domain=function(sr){return arguments.length?(At.domain((ue=sr.map(Number)).map(Me)),Be):ue},Be.ticks=function(sr){return rs(ue,sr)},Be.tickFormat=function(sr,ir){return d3_scale_linearTickFormat(ue,sr,ir)},Be.nice=function(sr){return Be.domain(Ji(ue,sr))},Be.exponent=function(sr){return arguments.length?(Me=no(jt=sr),Le=no(1/jt),At.domain(ue.map(Me)),Be):jt},Be.copy=function(){return fs(At.copy(),jt,ue)},wa(Be,At)}function no(At){return function(jt){return jt<0?-Math.pow(-jt,At):Math.pow(jt,At)}}c.scale.sqrt=function(){return c.scale.pow().exponent(.5)},c.scale.ordinal=function(){return qa([],{t:"range",a:[[]]})};function qa(At,jt){var ue,Me,Le;function Be(ir){return Me[((ue.get(ir)||(jt.t==="range"?ue.set(ir,At.push(ir)):NaN))-1)%Me.length]}function sr(ir,Mr){return c.range(At.length).map(function(en){return ir+Mr*en})}return Be.domain=function(ir){if(!arguments.length)return At;At=[],ue=new C;for(var Mr=-1,en=ir.length,Xr;++Mr<en;)ue.has(Xr=ir[Mr])||ue.set(Xr,At.push(Xr));return Be[jt.t].apply(Be,jt.a)},Be.range=function(ir){return arguments.length?(Me=ir,Le=0,jt={t:"range",a:arguments},Be):Me},Be.rangePoints=function(ir,Mr){arguments.length<2&&(Mr=0);var en=ir[0],Xr=ir[1],vn=At.length<2?(en=(en+Xr)/2,0):(Xr-en)/(At.length-1+Mr);return Me=sr(en+vn*Mr/2,vn),Le=0,jt={t:"rangePoints",a:arguments},Be},Be.rangeRoundPoints=function(ir,Mr){arguments.length<2&&(Mr=0);var en=ir[0],Xr=ir[1],vn=At.length<2?(en=Xr=Math.round((en+Xr)/2),0):(Xr-en)/(At.length-1+Mr)|0;return Me=sr(en+Math.round(vn*Mr/2+(Xr-en-(At.length-1+Mr)*vn)/2),vn),Le=0,jt={t:"rangeRoundPoints",a:arguments},Be},Be.rangeBands=function(ir,Mr,en){arguments.length<2&&(Mr=0),arguments.length<3&&(en=Mr);var Xr=ir[1]<ir[0],vn=ir[Xr-0],In=ir[1-Xr],On=(In-vn)/(At.length-Mr+2*en);return Me=sr(vn+On*en,On),Xr&&Me.reverse(),Le=On*(1-Mr),jt={t:"rangeBands",a:arguments},Be},Be.rangeRoundBands=function(ir,Mr,en){arguments.length<2&&(Mr=0),arguments.length<3&&(en=Mr);var Xr=ir[1]<ir[0],vn=ir[Xr-0],In=ir[1-Xr],On=Math.floor((In-vn)/(At.length-Mr+2*en));return Me=sr(vn+Math.round((In-vn-(At.length-Mr)*On)/2),On),Xr&&Me.reverse(),Le=Math.round(On*(1-Mr)),jt={t:"rangeRoundBands",a:arguments},Be},Be.rangeBand=function(){return Le},Be.rangeExtent=function(){return Wn(jt.a[0])},Be.copy=function(){return qa(At,jt)},Be.domain(At)}c.scale.category10=function(){return c.scale.ordinal().range(ds)},c.scale.category20=function(){return c.scale.ordinal().range(tl)},c.scale.category20b=function(){return c.scale.ordinal().range(Pl)},c.scale.category20c=function(){return c.scale.ordinal().range(iu)};var ds=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ze),tl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ze),Pl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ze),iu=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ze);c.scale.quantile=function(){return Hl([],[])};function Hl(At,jt){var ue;function Me(){var Be=0,sr=jt.length;for(ue=[];++Be<sr;)ue[Be-1]=c.quantile(At,Be/sr);return Le}function Le(Be){if(!isNaN(Be=+Be))return jt[c.bisect(ue,Be)]}return Le.domain=function(Be){return arguments.length?(At=Be.map(f).filter(x).sort(s),Me()):At},Le.range=function(Be){return arguments.length?(jt=Be,Me()):jt},Le.quantiles=function(){return ue},Le.invertExtent=function(Be){return Be=jt.indexOf(Be),Be<0?[NaN,NaN]:[Be>0?ue[Be-1]:At[0],Be<ue.length?ue[Be]:At[At.length-1]]},Le.copy=function(){return Hl(At,jt)},Me()}c.scale.quantize=function(){return au(0,1,[0,1])};function au(At,jt,ue){var Me,Le;function Be(ir){return ue[Math.max(0,Math.min(Le,Math.floor(Me*(ir-At))))]}function sr(){return Me=ue.length/(jt-At),Le=ue.length-1,Be}return Be.domain=function(ir){return arguments.length?(At=+ir[0],jt=+ir[ir.length-1],sr()):[At,jt]},Be.range=function(ir){return arguments.length?(ue=ir,sr()):ue},Be.invertExtent=function(ir){return ir=ue.indexOf(ir),ir=ir<0?NaN:ir/Me+At,[ir,ir+1/Me]},Be.copy=function(){return au(At,jt,ue)},sr()}c.scale.threshold=function(){return ml([.5],[0,1])};function ml(At,jt){function ue(Me){if(Me<=Me)return jt[c.bisect(At,Me)]}return ue.domain=function(Me){return arguments.length?(At=Me,ue):At},ue.range=function(Me){return arguments.length?(jt=Me,ue):jt},ue.invertExtent=function(Me){return Me=jt.indexOf(Me),[At[Me-1],At[Me]]},ue.copy=function(){return ml(At,jt)},ue}c.scale.identity=function(){return qu([0,1])};function qu(At){function jt(ue){return+ue}return jt.invert=jt,jt.domain=jt.range=function(ue){return arguments.length?(At=ue.map(jt),jt):At},jt.ticks=function(ue){return rs(At,ue)},jt.tickFormat=function(ue,Me){return d3_scale_linearTickFormat(At,ue,Me)},jt.copy=function(){return qu(At)},jt}c.svg={};function Lu(){return 0}c.svg.arc=function(){var At=zo,jt=Ms,ue=Lu,Me=uu,Le=$l,Be=Fl,sr=vc;function ir(){var en=Math.max(0,+At.apply(this,arguments)),Xr=Math.max(0,+jt.apply(this,arguments)),vn=Le.apply(this,arguments)-ee,In=Be.apply(this,arguments)-ee,On=Math.abs(In-vn),Bi=vn>In?0:1;if(Xr<en&&(Un=Xr,Xr=en,en=Un),On>=Nt)return Mr(Xr,Bi)+(en?Mr(en,1-Bi):"")+"Z";var Un,mi,Ti,Ii,Wi=0,Yn=0,ja,Ha,ro,Lo,Fo,Uo,al,Wo,ps=[];if((Ii=(+sr.apply(this,arguments)||0)/2)&&(Ti=Me===uu?Math.sqrt(en*en+Xr*Xr):+Me.apply(this,arguments),Bi||(Yn*=-1),Xr&&(Yn=qe(Ti/Xr*Math.sin(Ii))),en&&(Wi=qe(Ti/en*Math.sin(Ii)))),Xr){ja=Xr*Math.cos(vn+Yn),Ha=Xr*Math.sin(vn+Yn),ro=Xr*Math.cos(In-Yn),Lo=Xr*Math.sin(In-Yn);var Tl=Math.abs(In-vn-2*Yn)<=gt?0:1;if(Yn&&Hc(ja,Ha,ro,Lo)===Bi^Tl){var Ku=(vn+In)/2;ja=Xr*Math.cos(Ku),Ha=Xr*Math.sin(Ku),ro=Lo=null}}else ja=Ha=0;if(en){Fo=en*Math.cos(In-Wi),Uo=en*Math.sin(In-Wi),al=en*Math.cos(vn+Wi),Wo=en*Math.sin(vn+Wi);var cu=Math.abs(vn-In+2*Wi)<=gt?0:1;if(Wi&&Hc(Fo,Uo,al,Wo)===1-Bi^cu){var _o=(vn+In)/2;Fo=en*Math.cos(_o),Uo=en*Math.sin(_o),al=Wo=null}}else Fo=Uo=0;if(On>ne&&(Un=Math.min(Math.abs(Xr-en)/2,+ue.apply(this,arguments)))>.001){mi=en<Xr^Bi?0:1;var Zs=Un,rl=Un;if(On<gt){var ou=al==null?[Fo,Uo]:ro==null?[ja,Ha]:Ho([ja,Ha],[al,Wo],[ro,Lo],[Fo,Uo]),Gl=ja-ou[0],rh=Ha-ou[1],Bl=ro-ou[0],Ql=Lo-ou[1],bh=1/Math.sin(Math.acos((Gl*Bl+rh*Ql)/(Math.sqrt(Gl*Gl+rh*rh)*Math.sqrt(Bl*Bl+Ql*Ql)))/2),_e=Math.sqrt(ou[0]*ou[0]+ou[1]*ou[1]);rl=Math.min(Un,(en-_e)/(bh-1)),Zs=Math.min(Un,(Xr-_e)/(bh+1))}if(ro!=null){var kr=Pc(al==null?[Fo,Uo]:[al,Wo],[ja,Ha],Xr,Zs,Bi),Lr=Pc([ro,Lo],[Fo,Uo],Xr,Zs,Bi);Un===Zs?ps.push("M",kr[0],"A",Zs,",",Zs," 0 0,",mi," ",kr[1],"A",Xr,",",Xr," 0 ",1-Bi^Hc(kr[1][0],kr[1][1],Lr[1][0],Lr[1][1]),",",Bi," ",Lr[1],"A",Zs,",",Zs," 0 0,",mi," ",Lr[0]):ps.push("M",kr[0],"A",Zs,",",Zs," 0 1,",mi," ",Lr[0])}else ps.push("M",ja,",",Ha);if(al!=null){var Dn=Pc([ja,Ha],[al,Wo],en,-rl,Bi),oi=Pc([Fo,Uo],ro==null?[ja,Ha]:[ro,Lo],en,-rl,Bi);Un===rl?ps.push("L",oi[0],"A",rl,",",rl," 0 0,",mi," ",oi[1],"A",en,",",en," 0 ",Bi^Hc(oi[1][0],oi[1][1],Dn[1][0],Dn[1][1]),",",1-Bi," ",Dn[1],"A",rl,",",rl," 0 0,",mi," ",Dn[0]):ps.push("L",oi[0],"A",rl,",",rl," 0 0,",mi," ",Dn[0])}else ps.push("L",Fo,",",Uo)}else ps.push("M",ja,",",Ha),ro!=null&&ps.push("A",Xr,",",Xr," 0 ",Tl,",",Bi," ",ro,",",Lo),ps.push("L",Fo,",",Uo),al!=null&&ps.push("A",en,",",en," 0 ",cu,",",1-Bi," ",al,",",Wo);return ps.push("Z"),ps.join("")}function Mr(en,Xr){return"M0,"+en+"A"+en+","+en+" 0 1,"+Xr+" 0,"+-en+"A"+en+","+en+" 0 1,"+Xr+" 0,"+en}return ir.innerRadius=function(en){return arguments.length?(At=Ee(en),ir):At},ir.outerRadius=function(en){return arguments.length?(jt=Ee(en),ir):jt},ir.cornerRadius=function(en){return arguments.length?(ue=Ee(en),ir):ue},ir.padRadius=function(en){return arguments.length?(Me=en==uu?uu:Ee(en),ir):Me},ir.startAngle=function(en){return arguments.length?(Le=Ee(en),ir):Le},ir.endAngle=function(en){return arguments.length?(Be=Ee(en),ir):Be},ir.padAngle=function(en){return arguments.length?(sr=Ee(en),ir):sr},ir.centroid=function(){var en=(+At.apply(this,arguments)+ +jt.apply(this,arguments))/2,Xr=(+Le.apply(this,arguments)+ +Be.apply(this,arguments))/2-ee;return[Math.cos(Xr)*en,Math.sin(Xr)*en]},ir};var uu="auto";function zo(At){return At.innerRadius}function Ms(At){return At.outerRadius}function $l(At){return At.startAngle}function Fl(At){return At.endAngle}function vc(At){return At&&At.padAngle}function Hc(At,jt,ue,Me){return(At-ue)*jt-(jt-Me)*At>0?0:1}function Pc(At,jt,ue,Me,Le){var Be=At[0]-jt[0],sr=At[1]-jt[1],ir=(Le?Me:-Me)/Math.sqrt(Be*Be+sr*sr),Mr=ir*sr,en=-ir*Be,Xr=At[0]+Mr,vn=At[1]+en,In=jt[0]+Mr,On=jt[1]+en,Bi=(Xr+In)/2,Un=(vn+On)/2,mi=In-Xr,Ti=On-vn,Ii=mi*mi+Ti*Ti,Wi=ue-Me,Yn=Xr*On-In*vn,ja=(Ti<0?-1:1)*Math.sqrt(Math.max(0,Wi*Wi*Ii-Yn*Yn)),Ha=(Yn*Ti-mi*ja)/Ii,ro=(-Yn*mi-Ti*ja)/Ii,Lo=(Yn*Ti+mi*ja)/Ii,Fo=(-Yn*mi+Ti*ja)/Ii,Uo=Ha-Bi,al=ro-Un,Wo=Lo-Bi,ps=Fo-Un;return Uo*Uo+al*al>Wo*Wo+ps*ps&&(Ha=Lo,ro=Fo),[[Ha-Mr,ro-en],[Ha*ue/Wi,ro*ue/Wi]]}function Ph(){return!0}function Wc(At){var jt=po,ue=Do,Me=Ph,Le=Iu,Be=Le.key,sr=.7;function ir(Mr){var en=[],Xr=[],vn=-1,In=Mr.length,On,Bi=Ee(jt),Un=Ee(ue);function mi(){en.push("M",Le(At(Xr),sr))}for(;++vn<In;)Me.call(this,On=Mr[vn],vn)?Xr.push([+Bi.call(this,On,vn),+Un.call(this,On,vn)]):Xr.length&&(mi(),Xr=[]);return Xr.length&&mi(),en.length?en.join(""):null}return ir.x=function(Mr){return arguments.length?(jt=Mr,ir):jt},ir.y=function(Mr){return arguments.length?(ue=Mr,ir):ue},ir.defined=function(Mr){return arguments.length?(Me=Mr,ir):Me},ir.interpolate=function(Mr){return arguments.length?(typeof Mr=="function"?Be=Le=Mr:Be=(Le=zh.get(Mr)||Iu).key,ir):Be},ir.tension=function(Mr){return arguments.length?(sr=Mr,ir):sr},ir}c.svg.line=function(){return Wc(V)};var zh=c.map({linear:Iu,"linear-closed":Ih,step:es,"step-before":zs,"step-after":qc,basis:Et,"basis-open":It,"basis-closed":Vt,bundle:ke,cardinal:qt,"cardinal-open":Zu,"cardinal-closed":Zf,monotone:ae});zh.forEach(function(At,jt){jt.key=At,jt.closed=/-closed$/.test(At)});function Iu(At){return At.length>1?At.join("L"):At+"Z"}function Ih(At){return At.join("L")+"Z"}function es(At){for(var jt=0,ue=At.length,Me=At[0],Le=[Me[0],",",Me[1]];++jt<ue;)Le.push("H",(Me[0]+(Me=At[jt])[0])/2,"V",Me[1]);return ue>1&&Le.push("H",Me[0]),Le.join("")}function zs(At){for(var jt=0,ue=At.length,Me=At[0],Le=[Me[0],",",Me[1]];++jt<ue;)Le.push("V",(Me=At[jt])[1],"H",Me[0]);return Le.join("")}function qc(At){for(var jt=0,ue=At.length,Me=At[0],Le=[Me[0],",",Me[1]];++jt<ue;)Le.push("H",(Me=At[jt])[0],"V",Me[1]);return Le.join("")}function Zu(At,jt){return At.length<4?Iu(At):At[1]+I(At.slice(1,-1),ht(At,jt))}function Zf(At,jt){return At.length<3?Ih(At):At[0]+I((At.push(At[0]),At),ht([At[At.length-2]].concat(At,[At[1]]),jt))}function qt(At,jt){return At.length<3?Iu(At):At[0]+I(At,ht(At,jt))}function I(At,jt){if(jt.length<1||At.length!=jt.length&&At.length!=jt.length+2)return Iu(At);var ue=At.length!=jt.length,Me="",Le=At[0],Be=At[1],sr=jt[0],ir=sr,Mr=1;if(ue&&(Me+="Q"+(Be[0]-sr[0]*2/3)+","+(Be[1]-sr[1]*2/3)+","+Be[0]+","+Be[1],Le=At[1],Mr=2),jt.length>1){ir=jt[1],Be=At[Mr],Mr++,Me+="C"+(Le[0]+sr[0])+","+(Le[1]+sr[1])+","+(Be[0]-ir[0])+","+(Be[1]-ir[1])+","+Be[0]+","+Be[1];for(var en=2;en<jt.length;en++,Mr++)Be=At[Mr],ir=jt[en],Me+="S"+(Be[0]-ir[0])+","+(Be[1]-ir[1])+","+Be[0]+","+Be[1]}if(ue){var Xr=At[Mr];Me+="Q"+(Be[0]+ir[0]*2/3)+","+(Be[1]+ir[1]*2/3)+","+Xr[0]+","+Xr[1]}return Me}function ht(At,jt){for(var ue=[],Me=(1-jt)/2,Le,Be=At[0],sr=At[1],ir=1,Mr=At.length;++ir<Mr;)Le=Be,Be=sr,sr=At[ir],ue.push([Me*(sr[0]-Le[0]),Me*(sr[1]-Le[1])]);return ue}function Et(At){if(At.length<3)return Iu(At);var jt=1,ue=At.length,Me=At[0],Le=Me[0],Be=Me[1],sr=[Le,Le,Le,(Me=At[1])[0]],ir=[Be,Be,Be,Me[1]],Mr=[Le,",",Be,"L",Oe(Or,sr),",",Oe(Or,ir)];for(At.push(At[ue-1]);++jt<=ue;)Me=At[jt],sr.shift(),sr.push(Me[0]),ir.shift(),ir.push(Me[1]),Dr(Mr,sr,ir);return At.pop(),Mr.push("L",Me),Mr.join("")}function It(At){if(At.length<4)return Iu(At);for(var jt=[],ue=-1,Me=At.length,Le,Be=[0],sr=[0];++ue<3;)Le=At[ue],Be.push(Le[0]),sr.push(Le[1]);for(jt.push(Oe(Or,Be)+","+Oe(Or,sr)),--ue;++ue<Me;)Le=At[ue],Be.shift(),Be.push(Le[0]),sr.shift(),sr.push(Le[1]),Dr(jt,Be,sr);return jt.join("")}function Vt(At){for(var jt,ue=-1,Me=At.length,Le=Me+4,Be,sr=[],ir=[];++ue<4;)Be=At[ue%Me],sr.push(Be[0]),ir.push(Be[1]);for(jt=[Oe(Or,sr),",",Oe(Or,ir)],--ue;++ue<Le;)Be=At[ue%Me],sr.shift(),sr.push(Be[0]),ir.shift(),ir.push(Be[1]),Dr(jt,sr,ir);return jt.join("")}function ke(At,jt){var ue=At.length-1;if(ue)for(var Me=At[0][0],Le=At[0][1],Be=At[ue][0]-Me,sr=At[ue][1]-Le,ir=-1,Mr,en;++ir<=ue;)Mr=At[ir],en=ir/ue,Mr[0]=jt*Mr[0]+(1-jt)*(Me+en*Be),Mr[1]=jt*Mr[1]+(1-jt)*(Le+en*sr);return Et(At)}function Oe(At,jt){return At[0]*jt[0]+At[1]*jt[1]+At[2]*jt[2]+At[3]*jt[3]}var Ke=[0,2/3,1/3,0],gr=[0,1/3,2/3,0],Or=[0,1/6,2/3,1/6];function Dr(At,jt,ue){At.push("C",Oe(Ke,jt),",",Oe(Ke,ue),",",Oe(gr,jt),",",Oe(gr,ue),",",Oe(Or,jt),",",Oe(Or,ue))}function ln(At,jt){return(jt[1]-At[1])/(jt[0]-At[0])}function Sn(At){for(var jt=0,ue=At.length-1,Me=[],Le=At[0],Be=At[1],sr=Me[0]=ln(Le,Be);++jt<ue;)Me[jt]=(sr+(sr=ln(Le=Be,Be=At[jt+1])))/2;return Me[jt]=sr,Me}function Xt(At){for(var jt=[],ue,Me,Le,Be,sr=Sn(At),ir=-1,Mr=At.length-1;++ir<Mr;)ue=ln(At[ir],At[ir+1]),u(ue)<ne?sr[ir]=sr[ir+1]=0:(Me=sr[ir]/ue,Le=sr[ir+1]/ue,Be=Me*Me+Le*Le,Be>9&&(Be=ue*3/Math.sqrt(Be),sr[ir]=Be*Me,sr[ir+1]=Be*Le));for(ir=-1;++ir<=Mr;)Be=(At[Math.min(Mr,ir+1)][0]-At[Math.max(0,ir-1)][0])/(6*(1+sr[ir]*sr[ir])),jt.push([Be||0,sr[ir]*Be||0]);return jt}function ae(At){return At.length<3?Iu(At):At[0]+I(At,Xt(At))}c.svg.line.radial=function(){var At=Wc(xe);return At.radius=At.x,delete At.x,At.angle=At.y,delete At.y,At};function xe(At){for(var jt,ue=-1,Me=At.length,Le,Be;++ue<Me;)jt=At[ue],Le=jt[0],Be=jt[1]-ee,jt[0]=Le*Math.cos(Be),jt[1]=Le*Math.sin(Be);return At}function Ae(At){var jt=po,ue=po,Me=0,Le=Do,Be=Ph,sr=Iu,ir=sr.key,Mr=sr,en="L",Xr=.7;function vn(In){var On=[],Bi=[],Un=[],mi=-1,Ti=In.length,Ii,Wi=Ee(jt),Yn=Ee(Me),ja=jt===ue?function(){return ro}:Ee(ue),Ha=Me===Le?function(){return Lo}:Ee(Le),ro,Lo;function Fo(){On.push("M",sr(At(Un),Xr),en,Mr(At(Bi.reverse()),Xr),"Z")}for(;++mi<Ti;)Be.call(this,Ii=In[mi],mi)?(Bi.push([ro=+Wi.call(this,Ii,mi),Lo=+Yn.call(this,Ii,mi)]),Un.push([+ja.call(this,Ii,mi),+Ha.call(this,Ii,mi)])):Bi.length&&(Fo(),Bi=[],Un=[]);return Bi.length&&Fo(),On.length?On.join(""):null}return vn.x=function(In){return arguments.length?(jt=ue=In,vn):ue},vn.x0=function(In){return arguments.length?(jt=In,vn):jt},vn.x1=function(In){return arguments.length?(ue=In,vn):ue},vn.y=function(In){return arguments.length?(Me=Le=In,vn):Le},vn.y0=function(In){return arguments.length?(Me=In,vn):Me},vn.y1=function(In){return arguments.length?(Le=In,vn):Le},vn.defined=function(In){return arguments.length?(Be=In,vn):Be},vn.interpolate=function(In){return arguments.length?(typeof In=="function"?ir=sr=In:ir=(sr=zh.get(In)||Iu).key,Mr=sr.reverse||sr,en=sr.closed?"M":"L",vn):ir},vn.tension=function(In){return arguments.length?(Xr=In,vn):Xr},vn}zs.reverse=qc,qc.reverse=zs,c.svg.area=function(){return Ae(V)},c.svg.area.radial=function(){var At=Ae(xe);return At.radius=At.x,delete At.x,At.innerRadius=At.x0,delete At.x0,At.outerRadius=At.x1,delete At.x1,At.angle=At.y,delete At.y,At.startAngle=At.y0,delete At.y0,At.endAngle=At.y1,delete At.y1,At};function je(At){return At.source}function Ie(At){return At.target}c.svg.chord=function(){var At=je,jt=Ie,ue=Ze,Me=$l,Le=Fl;function Be(Xr,vn){var In=sr(this,At,Xr,vn),On=sr(this,jt,Xr,vn);return"M"+In.p0+Mr(In.r,In.p1,In.a1-In.a0)+(ir(In,On)?en(In.r,In.p1,In.r,In.p0):en(In.r,In.p1,On.r,On.p0)+Mr(On.r,On.p1,On.a1-On.a0)+en(On.r,On.p1,In.r,In.p0))+"Z"}function sr(Xr,vn,In,On){var Bi=vn.call(Xr,In,On),Un=ue.call(Xr,Bi,On),mi=Me.call(Xr,Bi,On)-ee,Ti=Le.call(Xr,Bi,On)-ee;return{r:Un,a0:mi,a1:Ti,p0:[Un*Math.cos(mi),Un*Math.sin(mi)],p1:[Un*Math.cos(Ti),Un*Math.sin(Ti)]}}function ir(Xr,vn){return Xr.a0==vn.a0&&Xr.a1==vn.a1}function Mr(Xr,vn,In){return"A"+Xr+","+Xr+" 0 "+ +(In>gt)+",1 "+vn}function en(Xr,vn,In,On){return"Q 0,0 "+On}return Be.radius=function(Xr){return arguments.length?(ue=Ee(Xr),Be):ue},Be.source=function(Xr){return arguments.length?(At=Ee(Xr),Be):At},Be.target=function(Xr){return arguments.length?(jt=Ee(Xr),Be):jt},Be.startAngle=function(Xr){return arguments.length?(Me=Ee(Xr),Be):Me},Be.endAngle=function(Xr){return arguments.length?(Le=Ee(Xr),Be):Le},Be};function Ze(At){return At.radius}c.svg.diagonal=function(){var At=je,jt=Ie,ue=wr;function Me(Le,Be){var sr=At.call(this,Le,Be),ir=jt.call(this,Le,Be),Mr=(sr.y+ir.y)/2,en=[sr,{x:sr.x,y:Mr},{x:ir.x,y:Mr},ir];return en=en.map(ue),"M"+en[0]+"C"+en[1]+" "+en[2]+" "+en[3]}return Me.source=function(Le){return arguments.length?(At=Ee(Le),Me):At},Me.target=function(Le){return arguments.length?(jt=Ee(Le),Me):jt},Me.projection=function(Le){return arguments.length?(ue=Le,Me):ue},Me};function wr(At){return[At.x,At.y]}c.svg.diagonal.radial=function(){var At=c.svg.diagonal(),jt=wr,ue=At.projection;return At.projection=function(Me){return arguments.length?ue(Ir(jt=Me)):jt},At};function Ir(At){return function(){var jt=At.apply(this,arguments),ue=jt[0],Me=jt[1]-ee;return[ue*Math.cos(Me),ue*Math.sin(Me)]}}c.svg.symbol=function(){var At=tn,jt=Nr;function ue(Me,Le){return(zn.get(At.call(this,Me,Le))||mn)(jt.call(this,Me,Le))}return ue.type=function(Me){return arguments.length?(At=Ee(Me),ue):At},ue.size=function(Me){return arguments.length?(jt=Ee(Me),ue):jt},ue};function Nr(){return 64}function tn(){return"circle"}function mn(At){var jt=Math.sqrt(At/gt);return"M0,"+jt+"A"+jt+","+jt+" 0 1,1 0,"+-jt+"A"+jt+","+jt+" 0 1,1 0,"+jt+"Z"}var zn=c.map({circle:mn,cross:function(At){var jt=Math.sqrt(At/5)/2;return"M"+-3*jt+","+-jt+"H"+-jt+"V"+-3*jt+"H"+jt+"V"+-jt+"H"+3*jt+"V"+jt+"H"+jt+"V"+3*jt+"H"+-jt+"V"+jt+"H"+-3*jt+"Z"},diamond:function(At){var jt=Math.sqrt(At/(2*ri)),ue=jt*ri;return"M0,"+-jt+"L"+ue+",0 0,"+jt+" "+-ue+",0Z"},square:function(At){var jt=Math.sqrt(At)/2;return"M"+-jt+","+-jt+"L"+jt+","+-jt+" "+jt+","+jt+" "+-jt+","+jt+"Z"},"triangle-down":function(At){var jt=Math.sqrt(At/Bn),ue=jt*Bn/2;return"M0,"+ue+"L"+jt+","+-ue+" "+-jt+","+-ue+"Z"},"triangle-up":function(At){var jt=Math.sqrt(At/Bn),ue=jt*Bn/2;return"M0,"+-ue+"L"+jt+","+ue+" "+-jt+","+ue+"Z"}});c.svg.symbolTypes=zn.keys();var Bn=Math.sqrt(3),ri=Math.tan(30*le);it.transition=function(At){for(var jt=Ro||++io,ue=vl(At),Me=[],Le,Be,sr=Mo||{time:Date.now(),ease:Jo,delay:0,duration:250},ir=-1,Mr=this.length;++ir<Mr;){Me.push(Le=[]);for(var en=this[ir],Xr=-1,vn=en.length;++Xr<vn;)(Be=en[Xr])&&Os(Be,Xr,ue,jt,sr),Le.push(Be)}return ha(Me,ue,jt)},it.interrupt=function(At){return this.each(At==null?Fi:da(vl(At)))};var Fi=da(vl());function da(At){return function(){var jt,ue,Me;(jt=this[At])&&(Me=jt[ue=jt.active])&&(Me.timer.c=null,Me.timer.t=NaN,--jt.count?delete jt[ue]:delete this[At],jt.active+=.5,Me.event&&Me.event.interrupt.call(this,this.__data__,Me.index))}}function ha(At,jt,ue){return tt(At,ka),At.namespace=jt,At.id=ue,At}var ka=[],io=0,Ro,Mo;ka.call=it.call,ka.empty=it.empty,ka.node=it.node,ka.size=it.size,c.transition=function(At,jt){return At&&At.transition?Ro?At.transition(jt):At:c.selection().transition(At)},c.transition.prototype=ka,ka.select=function(At){var jt=this.id,ue=this.namespace,Me=[],Le,Be,sr;At=Y(At);for(var ir=-1,Mr=this.length;++ir<Mr;){Me.push(Le=[]);for(var en=this[ir],Xr=-1,vn=en.length;++Xr<vn;)(sr=en[Xr])&&(Be=At.call(sr,sr.__data__,Xr,ir))?("__data__"in sr&&(Be.__data__=sr.__data__),Os(Be,Xr,ue,jt,sr[ue][jt]),Le.push(Be)):Le.push(null)}return ha(Me,ue,jt)},ka.selectAll=function(At){var jt=this.id,ue=this.namespace,Me=[],Le,Be,sr,ir,Mr;At=ft(At);for(var en=-1,Xr=this.length;++en<Xr;)for(var vn=this[en],In=-1,On=vn.length;++In<On;)if(sr=vn[In]){Mr=sr[ue][jt],Be=At.call(sr,sr.__data__,In,en),Me.push(Le=[]);for(var Bi=-1,Un=Be.length;++Bi<Un;)(ir=Be[Bi])&&Os(ir,Bi,ue,jt,Mr),Le.push(ir)}return ha(Me,ue,jt)},ka.filter=function(At){var jt=[],ue,Me,Le;typeof At!="function"&&(At=Mt(At));for(var Be=0,sr=this.length;Be<sr;Be++){jt.push(ue=[]);for(var Me=this[Be],ir=0,Mr=Me.length;ir<Mr;ir++)(Le=Me[ir])&&At.call(Le,Le.__data__,ir,Be)&&ue.push(Le)}return ha(jt,this.namespace,this.id)},ka.tween=function(At,jt){var ue=this.id,Me=this.namespace;return arguments.length<2?this.node()[Me][ue].tween.get(At):ve(this,jt==null?function(Le){Le[Me][ue].tween.remove(At)}:function(Le){Le[Me][ue].tween.set(At,jt)})};function hs(At,jt,ue,Me){var Le=At.id,Be=At.namespace;return ve(At,typeof ue=="function"?function(sr,ir,Mr){sr[Be][Le].tween.set(jt,Me(ue.call(sr,sr.__data__,ir,Mr)))}:(ue=Me(ue),function(sr){sr[Be][Le].tween.set(jt,ue)}))}ka.attr=function(At,jt){if(arguments.length<2){for(jt in At)this.attr(jt,At[jt]);return this}var ue=At=="transform"?Ef:el,Me=c.ns.qualify(At);function Le(){this.removeAttribute(Me)}function Be(){this.removeAttributeNS(Me.space,Me.local)}function sr(Mr){return Mr==null?Le:(Mr+="",function(){var en=this.getAttribute(Me),Xr;return en!==Mr&&(Xr=ue(en,Mr),function(vn){this.setAttribute(Me,Xr(vn))})})}function ir(Mr){return Mr==null?Be:(Mr+="",function(){var en=this.getAttributeNS(Me.space,Me.local),Xr;return en!==Mr&&(Xr=ue(en,Mr),function(vn){this.setAttributeNS(Me.space,Me.local,Xr(vn))})})}return hs(this,"attr."+At,jt,Me.local?ir:sr)},ka.attrTween=function(At,jt){var ue=c.ns.qualify(At);function Me(Be,sr){var ir=jt.call(this,Be,sr,this.getAttribute(ue));return ir&&function(Mr){this.setAttribute(ue,ir(Mr))}}function Le(Be,sr){var ir=jt.call(this,Be,sr,this.getAttributeNS(ue.space,ue.local));return ir&&function(Mr){this.setAttributeNS(ue.space,ue.local,ir(Mr))}}return this.tween("attr."+At,ue.local?Le:Me)},ka.style=function(At,jt,ue){var Me=arguments.length;if(Me<3){if(typeof At!="string"){Me<2&&(jt="");for(ue in At)this.style(ue,At[ue],jt);return this}ue=""}function Le(){this.style.removeProperty(At)}function Be(sr){return sr==null?Le:(sr+="",function(){var ir=e(this).getComputedStyle(this,null).getPropertyValue(At),Mr;return ir!==sr&&(Mr=el(ir,sr),function(en){this.style.setProperty(At,Mr(en),ue)})})}return hs(this,"style."+At,jt,Be)},ka.styleTween=function(At,jt,ue){arguments.length<3&&(ue="");function Me(Le,Be){var sr=jt.call(this,Le,Be,e(this).getComputedStyle(this,null).getPropertyValue(At));return sr&&function(ir){this.style.setProperty(At,sr(ir),ue)}}return this.tween("style."+At,Me)},ka.text=function(At){return hs(this,"text",At,hl)};function hl(At){return At==null&&(At=""),function(){this.textContent=At}}ka.remove=function(){var At=this.namespace;return this.each("end.transition",function(){var jt;this[At].count<2&&(jt=this.parentNode)&&jt.removeChild(this)})},ka.ease=function(At){var jt=this.id,ue=this.namespace;return arguments.length<1?this.node()[ue][jt].ease:(typeof At!="function"&&(At=c.ease.apply(c,arguments)),ve(this,function(Me){Me[ue][jt].ease=At}))},ka.delay=function(At){var jt=this.id,ue=this.namespace;return arguments.length<1?this.node()[ue][jt].delay:ve(this,typeof At=="function"?function(Me,Le,Be){Me[ue][jt].delay=+At.call(Me,Me.__data__,Le,Be)}:(At=+At,function(Me){Me[ue][jt].delay=At}))},ka.duration=function(At){var jt=this.id,ue=this.namespace;return arguments.length<1?this.node()[ue][jt].duration:ve(this,typeof At=="function"?function(Me,Le,Be){Me[ue][jt].duration=Math.max(1,At.call(Me,Me.__data__,Le,Be))}:(At=Math.max(1,At),function(Me){Me[ue][jt].duration=At}))},ka.each=function(At,jt){var ue=this.id,Me=this.namespace;if(arguments.length<2){var Le=Mo,Be=Ro;try{Ro=ue,ve(this,function(sr,ir,Mr){Mo=sr[Me][ue],At.call(sr,sr.__data__,ir,Mr)})}finally{Mo=Le,Ro=Be}}else ve(this,function(sr){var ir=sr[Me][ue];(ir.event||(ir.event=c.dispatch("start","end","interrupt"))).on(At,jt)});return this},ka.transition=function(){for(var At=this.id,jt=++io,ue=this.namespace,Me=[],Le,Be,sr,ir,Mr=0,en=this.length;Mr<en;Mr++){Me.push(Le=[]);for(var Be=this[Mr],Xr=0,vn=Be.length;Xr<vn;Xr++)(sr=Be[Xr])&&(ir=sr[ue][At],Os(sr,Xr,ue,jt,{time:ir.time,ease:ir.ease,delay:ir.delay+ir.duration,duration:ir.duration})),Le.push(sr)}return ha(Me,ue,jt)};function vl(At){return At==null?"__transition__":"__transition_"+At+"__"}function Os(At,jt,ue,Me,Le){var Be=At[ue]||(At[ue]={active:0,count:0}),sr=Be[Me],ir,Mr,en,Xr,vn;function In(Un){var mi=sr.delay;if(Mr.t=mi+ir,mi<=Un)return On(Un-mi);Mr.c=On}function On(Un){var mi=Be.active,Ti=Be[mi];Ti&&(Ti.timer.c=null,Ti.timer.t=NaN,--Be.count,delete Be[mi],Ti.event&&Ti.event.interrupt.call(At,At.__data__,Ti.index));for(var Ii in Be)if(+Ii<Me){var Wi=Be[Ii];Wi.timer.c=null,Wi.timer.t=NaN,--Be.count,delete Be[Ii]}Mr.c=Bi,Ri(function(){return Mr.c&&Bi(Un||1)&&(Mr.c=null,Mr.t=NaN),1},0,ir),Be.active=Me,sr.event&&sr.event.start.call(At,At.__data__,jt),vn=[],sr.tween.forEach(function(Yn,ja){(ja=ja.call(At,At.__data__,jt))&&vn.push(ja)}),Xr=sr.ease,en=sr.duration}function Bi(Un){for(var mi=Un/en,Ti=Xr(mi),Ii=vn.length;Ii>0;)vn[--Ii].call(At,Ti);if(mi>=1)return sr.event&&sr.event.end.call(At,At.__data__,jt),--Be.count?delete Be[Me]:delete At[ue],1}sr||(ir=Le.time,Mr=Ri(In,0,ir),sr=Be[Me]={tween:new C,time:ir,timer:Mr,delay:Le.delay,duration:Le.duration,ease:Le.ease,index:jt},Le=null,++Be.count)}c.svg.axis=function(){var At=c.scale.linear(),jt=bl,ue=6,Me=6,Le=3,Be=[10],sr=null,ir;function Mr(en){en.each(function(){var Xr=c.select(this),vn=this.__chart__||At,In=this.__chart__=At.copy(),On=sr??(In.ticks?In.ticks.apply(In,Be):In.domain()),Bi=ir??(In.tickFormat?In.tickFormat.apply(In,Be):V),Un=Xr.selectAll(".tick").data(On,In),mi=Un.enter().insert("g",".domain").attr("class","tick").style("opacity",ne),Ti=c.transition(Un.exit()).style("opacity",ne).remove(),Ii=c.transition(Un.order()).style("opacity",1),Wi=Math.max(ue,0)+Le,Yn,ja=hi(In),Ha=Xr.selectAll(".domain").data([0]),ro=(Ha.enter().append("path").attr("class","domain"),c.transition(Ha));mi.append("line"),mi.append("text");var Lo=mi.select("line"),Fo=Ii.select("line"),Uo=Un.select("text").text(Bi),al=mi.select("text"),Wo=Ii.select("text"),ps=jt==="top"||jt==="left"?-1:1,Tl,Ku,cu,_o;if(jt==="bottom"||jt==="top"?(Yn=mu,Tl="x",cu="y",Ku="x2",_o="y2",Uo.attr("dy",ps<0?"0em":".71em").style("text-anchor","middle"),ro.attr("d","M"+ja[0]+","+ps*Me+"V0H"+ja[1]+"V"+ps*Me)):(Yn=Ws,Tl="y",cu="x",Ku="y2",_o="x2",Uo.attr("dy",".32em").style("text-anchor",ps<0?"end":"start"),ro.attr("d","M"+ps*Me+","+ja[0]+"H0V"+ja[1]+"H"+ps*Me)),Lo.attr(_o,ps*ue),al.attr(cu,ps*Wi),Fo.attr(Ku,0).attr(_o,ps*ue),Wo.attr(Tl,0).attr(cu,ps*Wi),In.rangeBand){var Zs=In,rl=Zs.rangeBand()/2;vn=In=function(ou){return Zs(ou)+rl}}else vn.rangeBand?vn=In:Ti.call(Yn,In,vn);mi.call(Yn,vn,In),Ii.call(Yn,In,In)})}return Mr.scale=function(en){return arguments.length?(At=en,Mr):At},Mr.orient=function(en){return arguments.length?(jt=en in Su?en+"":bl,Mr):jt},Mr.ticks=function(){return arguments.length?(Be=P(arguments),Mr):Be},Mr.tickValues=function(en){return arguments.length?(sr=en,Mr):sr},Mr.tickFormat=function(en){return arguments.length?(ir=en,Mr):ir},Mr.tickSize=function(en){var Xr=arguments.length;return Xr?(ue=+en,Me=+arguments[Xr-1],Mr):ue},Mr.innerTickSize=function(en){return arguments.length?(ue=+en,Mr):ue},Mr.outerTickSize=function(en){return arguments.length?(Me=+en,Mr):Me},Mr.tickPadding=function(en){return arguments.length?(Le=+en,Mr):Le},Mr.tickSubdivide=function(){return arguments.length&&Mr},Mr};var bl="bottom",Su={top:1,right:1,bottom:1,left:1};function mu(At,jt,ue){At.attr("transform",function(Me){var Le=jt(Me);return"translate("+(isFinite(Le)?Le:ue(Me))+",0)"})}function Ws(At,jt,ue){At.attr("transform",function(Me){var Le=jt(Me);return"translate(0,"+(isFinite(Le)?Le:ue(Me))+")"})}c.svg.brush=function(){var At=pt(Xr,"brushstart","brush","brushend"),jt=null,ue=null,Me=[0,0],Le=[0,0],Be,sr,ir=!0,Mr=!0,en=Yu[0];function Xr(Un){Un.each(function(){var mi=c.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Bi).on("touchstart.brush",Bi),Ti=mi.selectAll(".background").data([0]);Ti.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),mi.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Ii=mi.selectAll(".resize").data(en,V);Ii.exit().remove(),Ii.enter().append("g").attr("class",function(Ha){return"resize "+Ha}).style("cursor",function(Ha){return qs[Ha]}).append("rect").attr("x",function(Ha){return/[ew]$/.test(Ha)?-3:null}).attr("y",function(Ha){return/^[ns]/.test(Ha)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Ii.style("display",Xr.empty()?"none":null);var Wi=c.transition(mi),Yn=c.transition(Ti),ja;jt&&(ja=hi(jt),Yn.attr("x",ja[0]).attr("width",ja[1]-ja[0]),In(Wi)),ue&&(ja=hi(ue),Yn.attr("y",ja[0]).attr("height",ja[1]-ja[0]),On(Wi)),vn(Wi)})}Xr.event=function(Un){Un.each(function(){var mi=At.of(this,arguments),Ti={x:Me,y:Le,i:Be,j:sr},Ii=this.__chart__||Ti;this.__chart__=Ti,Ro?c.select(this).transition().each("start.brush",function(){Be=Ii.i,sr=Ii.j,Me=Ii.x,Le=Ii.y,mi({type:"brushstart"})}).tween("brush:brush",function(){var Wi=Zl(Me,Ti.x),Yn=Zl(Le,Ti.y);return Be=sr=null,function(ja){Me=Ti.x=Wi(ja),Le=Ti.y=Yn(ja),mi({type:"brush",mode:"resize"})}}).each("end.brush",function(){Be=Ti.i,sr=Ti.j,mi({type:"brush",mode:"resize"}),mi({type:"brushend"})}):(mi({type:"brushstart"}),mi({type:"brush",mode:"resize"}),mi({type:"brushend"}))})};function vn(Un){Un.selectAll(".resize").attr("transform",function(mi){return"translate("+Me[+/e$/.test(mi)]+","+Le[+/^s/.test(mi)]+")"})}function In(Un){Un.select(".extent").attr("x",Me[0]),Un.selectAll(".extent,.n>rect,.s>rect").attr("width",Me[1]-Me[0])}function On(Un){Un.select(".extent").attr("y",Le[0]),Un.selectAll(".extent,.e>rect,.w>rect").attr("height",Le[1]-Le[0])}function Bi(){var Un=this,mi=c.select(c.event.target),Ti=At.of(Un,arguments),Ii=c.select(Un),Wi=mi.datum(),Yn=!/^(n|s)$/.test(Wi)&&jt,ja=!/^(e|w)$/.test(Wi)&&ue,Ha=mi.classed("extent"),ro=Kr(Un),Lo,Fo=c.mouse(Un),Uo,al=c.select(e(Un)).on("keydown.brush",Tl).on("keyup.brush",Ku);if(c.event.changedTouches?al.on("touchmove.brush",cu).on("touchend.brush",Zs):al.on("mousemove.brush",cu).on("mouseup.brush",Zs),Ii.interrupt().selectAll("*").interrupt(),Ha)Fo[0]=Me[0]-Fo[0],Fo[1]=Le[0]-Fo[1];else if(Wi){var Wo=+/w$/.test(Wi),ps=+/^n/.test(Wi);Uo=[Me[1-Wo]-Fo[0],Le[1-ps]-Fo[1]],Fo[0]=Me[Wo],Fo[1]=Le[ps]}else c.event.altKey&&(Lo=Fo.slice());Ii.style("pointer-events","none").selectAll(".resize").style("display",null),c.select("body").style("cursor",mi.style("cursor")),Ti({type:"brushstart"}),cu();function Tl(){c.event.keyCode==32&&(Ha||(Lo=null,Fo[0]-=Me[1],Fo[1]-=Le[1],Ha=2),lt())}function Ku(){c.event.keyCode==32&&Ha==2&&(Fo[0]+=Me[1],Fo[1]+=Le[1],Ha=0,lt())}function cu(){var rl=c.mouse(Un),ou=!1;Uo&&(rl[0]+=Uo[0],rl[1]+=Uo[1]),Ha||(c.event.altKey?(Lo||(Lo=[(Me[0]+Me[1])/2,(Le[0]+Le[1])/2]),Fo[0]=Me[+(rl[0]<Lo[0])],Fo[1]=Le[+(rl[1]<Lo[1])]):Lo=null),Yn&&_o(rl,jt,0)&&(In(Ii),ou=!0),ja&&_o(rl,ue,1)&&(On(Ii),ou=!0),ou&&(vn(Ii),Ti({type:"brush",mode:Ha?"move":"resize"}))}function _o(rl,ou,Gl){var rh=hi(ou),Bl=rh[0],Ql=rh[1],bh=Fo[Gl],_e=Gl?Le:Me,kr=_e[1]-_e[0],Lr,Dn;if(Ha&&(Bl-=bh,Ql-=kr+bh),Lr=(Gl?Mr:ir)?Math.max(Bl,Math.min(Ql,rl[Gl])):rl[Gl],Ha?Dn=(Lr+=bh)+kr:(Lo&&(bh=Math.max(Bl,Math.min(Ql,2*Lo[Gl]-Lr))),bh<Lr?(Dn=Lr,Lr=bh):Dn=bh),_e[0]!=Lr||_e[1]!=Dn)return Gl?sr=null:Be=null,_e[0]=Lr,_e[1]=Dn,!0}function Zs(){cu(),Ii.style("pointer-events","all").selectAll(".resize").style("display",Xr.empty()?"none":null),c.select("body").style("cursor",null),al.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),ro(),Ti({type:"brushend"})}}return Xr.x=function(Un){return arguments.length?(jt=Un,en=Yu[!jt<<1|!ue],Xr):jt},Xr.y=function(Un){return arguments.length?(ue=Un,en=Yu[!jt<<1|!ue],Xr):ue},Xr.clamp=function(Un){return arguments.length?(jt&&ue?(ir=!!Un[0],Mr=!!Un[1]):jt?ir=!!Un:ue&&(Mr=!!Un),Xr):jt&&ue?[ir,Mr]:jt?ir:ue?Mr:null},Xr.extent=function(Un){var mi,Ti,Ii,Wi,Yn;return arguments.length?(jt&&(mi=Un[0],Ti=Un[1],ue&&(mi=mi[0],Ti=Ti[0]),Be=[mi,Ti],jt.invert&&(mi=jt(mi),Ti=jt(Ti)),Ti<mi&&(Yn=mi,mi=Ti,Ti=Yn),(mi!=Me[0]||Ti!=Me[1])&&(Me=[mi,Ti])),ue&&(Ii=Un[0],Wi=Un[1],jt&&(Ii=Ii[1],Wi=Wi[1]),sr=[Ii,Wi],ue.invert&&(Ii=ue(Ii),Wi=ue(Wi)),Wi<Ii&&(Yn=Ii,Ii=Wi,Wi=Yn),(Ii!=Le[0]||Wi!=Le[1])&&(Le=[Ii,Wi])),Xr):(jt&&(Be?(mi=Be[0],Ti=Be[1]):(mi=Me[0],Ti=Me[1],jt.invert&&(mi=jt.invert(mi),Ti=jt.invert(Ti)),Ti<mi&&(Yn=mi,mi=Ti,Ti=Yn))),ue&&(sr?(Ii=sr[0],Wi=sr[1]):(Ii=Le[0],Wi=Le[1],ue.invert&&(Ii=ue.invert(Ii),Wi=ue.invert(Wi)),Wi<Ii&&(Yn=Ii,Ii=Wi,Wi=Yn))),jt&&ue?[[mi,Ii],[Ti,Wi]]:jt?[mi,Ti]:ue&&[Ii,Wi])},Xr.clear=function(){return Xr.empty()||(Me=[0,0],Le=[0,0],Be=sr=null),Xr},Xr.empty=function(){return!!jt&&Me[0]==Me[1]||!!ue&&Le[0]==Le[1]},c.rebind(Xr,At,"on")};var qs={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Yu=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];c.text=dr(function(At){return At.responseText}),c.json=function(At,jt){return Vr(At,"application/json",dc,jt)};function dc(At){return JSON.parse(At.responseText)}c.html=function(At,jt){return Vr(At,"text/html",Zc,jt)};function Zc(At){var jt=S.createRange();return jt.selectNode(S.body),jt.createContextualFragment(At.responseText)}c.xml=dr(function(At){return At.responseXML}),typeof $=="object"&&$.exports?$.exports=c:this.d3=c}).apply(self)}),ia=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=c||self,g(c.d3=c.d3||{}))})(Q,function(c){var g=new Date,P=new Date;function S(Mt,te,ve,oe){function Te(He){return Mt(He=arguments.length===0?new Date:new Date(+He)),He}return Te.floor=function(He){return Mt(He=new Date(+He)),He},Te.ceil=function(He){return Mt(He=new Date(He-1)),te(He,1),Mt(He),He},Te.round=function(He){var Ge=Te(He),cr=Te.ceil(He);return He-Ge<cr-He?Ge:cr},Te.offset=function(He,Ge){return te(He=new Date(+He),Ge==null?1:Math.floor(Ge)),He},Te.range=function(He,Ge,cr){var ur=[],jr;if(He=Te.ceil(He),cr=cr==null?1:Math.floor(cr),!(He<Ge)||!(cr>0))return ur;do ur.push(jr=new Date(+He)),te(He,cr),Mt(He);while(jr<He&&He<Ge);return ur},Te.filter=function(He){return S(function(Ge){if(Ge>=Ge)for(;Mt(Ge),!He(Ge);)Ge.setTime(Ge-1)},function(Ge,cr){if(Ge>=Ge)if(cr<0)for(;++cr<=0;)for(;te(Ge,-1),!He(Ge););else for(;--cr>=0;)for(;te(Ge,1),!He(Ge););})},ve&&(Te.count=function(He,Ge){return g.setTime(+He),P.setTime(+Ge),Mt(g),Mt(P),Math.floor(ve(g,P))},Te.every=function(He){return He=Math.floor(He),!isFinite(He)||!(He>0)?null:He>1?Te.filter(oe?function(Ge){return oe(Ge)%He===0}:function(Ge){return Te.count(0,Ge)%He===0}):Te}),Te}var t=S(function(){},function(Mt,te){Mt.setTime(+Mt+te)},function(Mt,te){return te-Mt});t.every=function(Mt){return Mt=Math.floor(Mt),!isFinite(Mt)||!(Mt>0)?null:Mt>1?S(function(te){te.setTime(Math.floor(te/Mt)*Mt)},function(te,ve){te.setTime(+te+ve*Mt)},function(te,ve){return(ve-te)/Mt}):t};var e=t.range,r=1e3,a=6e4,n=36e5,o=864e5,i=6048e5,s=S(function(Mt){Mt.setTime(Mt-Mt.getMilliseconds())},function(Mt,te){Mt.setTime(+Mt+te*r)},function(Mt,te){return(te-Mt)/r},function(Mt){return Mt.getUTCSeconds()}),f=s.range,x=S(function(Mt){Mt.setTime(Mt-Mt.getMilliseconds()-Mt.getSeconds()*r)},function(Mt,te){Mt.setTime(+Mt+te*a)},function(Mt,te){return(te-Mt)/a},function(Mt){return Mt.getMinutes()}),y=x.range,v=S(function(Mt){Mt.setTime(Mt-Mt.getMilliseconds()-Mt.getSeconds()*r-Mt.getMinutes()*a)},function(Mt,te){Mt.setTime(+Mt+te*n)},function(Mt,te){return(te-Mt)/n},function(Mt){return Mt.getHours()}),T=v.range,u=S(function(Mt){Mt.setHours(0,0,0,0)},function(Mt,te){Mt.setDate(Mt.getDate()+te)},function(Mt,te){return(te-Mt-(te.getTimezoneOffset()-Mt.getTimezoneOffset())*a)/o},function(Mt){return Mt.getDate()-1}),b=u.range;function _(Mt){return S(function(te){te.setDate(te.getDate()-(te.getDay()+7-Mt)%7),te.setHours(0,0,0,0)},function(te,ve){te.setDate(te.getDate()+ve*7)},function(te,ve){return(ve-te-(ve.getTimezoneOffset()-te.getTimezoneOffset())*a)/i})}var C=_(0),M=_(1),E=_(2),A=_(3),h=_(4),p=_(5),k=_(6),w=C.range,R=M.range,O=E.range,N=A.range,V=h.range,H=p.range,F=k.range,U=S(function(Mt){Mt.setDate(1),Mt.setHours(0,0,0,0)},function(Mt,te){Mt.setMonth(Mt.getMonth()+te)},function(Mt,te){return te.getMonth()-Mt.getMonth()+(te.getFullYear()-Mt.getFullYear())*12},function(Mt){return Mt.getMonth()}),W=U.range,q=S(function(Mt){Mt.setMonth(0,1),Mt.setHours(0,0,0,0)},function(Mt,te){Mt.setFullYear(Mt.getFullYear()+te)},function(Mt,te){return te.getFullYear()-Mt.getFullYear()},function(Mt){return Mt.getFullYear()});q.every=function(Mt){return!isFinite(Mt=Math.floor(Mt))||!(Mt>0)?null:S(function(te){te.setFullYear(Math.floor(te.getFullYear()/Mt)*Mt),te.setMonth(0,1),te.setHours(0,0,0,0)},function(te,ve){te.setFullYear(te.getFullYear()+ve*Mt)})};var X=q.range,lt=S(function(Mt){Mt.setUTCSeconds(0,0)},function(Mt,te){Mt.setTime(+Mt+te*a)},function(Mt,te){return(te-Mt)/a},function(Mt){return Mt.getUTCMinutes()}),yt=lt.range,pt=S(function(Mt){Mt.setUTCMinutes(0,0,0)},function(Mt,te){Mt.setTime(+Mt+te*n)},function(Mt,te){return(te-Mt)/n},function(Mt){return Mt.getUTCHours()}),st=pt.range,tt=S(function(Mt){Mt.setUTCHours(0,0,0,0)},function(Mt,te){Mt.setUTCDate(Mt.getUTCDate()+te)},function(Mt,te){return(te-Mt)/o},function(Mt){return Mt.getUTCDate()-1}),dt=tt.range;function rt(Mt){return S(function(te){te.setUTCDate(te.getUTCDate()-(te.getUTCDay()+7-Mt)%7),te.setUTCHours(0,0,0,0)},function(te,ve){te.setUTCDate(te.getUTCDate()+ve*7)},function(te,ve){return(ve-te)/i})}var at=rt(0),vt=rt(1),it=rt(2),Y=rt(3),ft=rt(4),ut=rt(5),wt=rt(6),zt=at.range,Pt=vt.range,Wt=it.range,Ht=Y.range,Jt=ft.range,ge=ut.range,he=wt.range,de=S(function(Mt){Mt.setUTCDate(1),Mt.setUTCHours(0,0,0,0)},function(Mt,te){Mt.setUTCMonth(Mt.getUTCMonth()+te)},function(Mt,te){return te.getUTCMonth()-Mt.getUTCMonth()+(te.getUTCFullYear()-Mt.getUTCFullYear())*12},function(Mt){return Mt.getUTCMonth()}),se=de.range,Tt=S(function(Mt){Mt.setUTCMonth(0,1),Mt.setUTCHours(0,0,0,0)},function(Mt,te){Mt.setUTCFullYear(Mt.getUTCFullYear()+te)},function(Mt,te){return te.getUTCFullYear()-Mt.getUTCFullYear()},function(Mt){return Mt.getUTCFullYear()});Tt.every=function(Mt){return!isFinite(Mt=Math.floor(Mt))||!(Mt>0)?null:S(function(te){te.setUTCFullYear(Math.floor(te.getUTCFullYear()/Mt)*Mt),te.setUTCMonth(0,1),te.setUTCHours(0,0,0,0)},function(te,ve){te.setUTCFullYear(te.getUTCFullYear()+ve*Mt)})};var Lt=Tt.range;c.timeDay=u,c.timeDays=b,c.timeFriday=p,c.timeFridays=H,c.timeHour=v,c.timeHours=T,c.timeInterval=S,c.timeMillisecond=t,c.timeMilliseconds=e,c.timeMinute=x,c.timeMinutes=y,c.timeMonday=M,c.timeMondays=R,c.timeMonth=U,c.timeMonths=W,c.timeSaturday=k,c.timeSaturdays=F,c.timeSecond=s,c.timeSeconds=f,c.timeSunday=C,c.timeSundays=w,c.timeThursday=h,c.timeThursdays=V,c.timeTuesday=E,c.timeTuesdays=O,c.timeWednesday=A,c.timeWednesdays=N,c.timeWeek=C,c.timeWeeks=w,c.timeYear=q,c.timeYears=X,c.utcDay=tt,c.utcDays=dt,c.utcFriday=ut,c.utcFridays=ge,c.utcHour=pt,c.utcHours=st,c.utcMillisecond=t,c.utcMilliseconds=e,c.utcMinute=lt,c.utcMinutes=yt,c.utcMonday=vt,c.utcMondays=Pt,c.utcMonth=de,c.utcMonths=se,c.utcSaturday=wt,c.utcSaturdays=he,c.utcSecond=s,c.utcSeconds=f,c.utcSunday=at,c.utcSundays=zt,c.utcThursday=ft,c.utcThursdays=Jt,c.utcTuesday=it,c.utcTuesdays=Wt,c.utcWednesday=Y,c.utcWednesdays=Ht,c.utcWeek=at,c.utcWeeks=zt,c.utcYear=Tt,c.utcYears=Lt,Object.defineProperty(c,"__esModule",{value:!0})})}),fa=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q,ia()):(c=c||self,g(c.d3=c.d3||{},c.d3))})(Q,function(c,g){function P($t){if(0<=$t.y&&$t.y<100){var ne=new Date(-1,$t.m,$t.d,$t.H,$t.M,$t.S,$t.L);return ne.setFullYear($t.y),ne}return new Date($t.y,$t.m,$t.d,$t.H,$t.M,$t.S,$t.L)}function S($t){if(0<=$t.y&&$t.y<100){var ne=new Date(Date.UTC(-1,$t.m,$t.d,$t.H,$t.M,$t.S,$t.L));return ne.setUTCFullYear($t.y),ne}return new Date(Date.UTC($t.y,$t.m,$t.d,$t.H,$t.M,$t.S,$t.L))}function t($t,ne,Ct){return{y:$t,m:ne,d:Ct,H:0,M:0,S:0,L:0}}function e($t){var ne=$t.dateTime,Ct=$t.date,gt=$t.time,St=$t.periods,Nt=$t.days,ee=$t.shortDays,le=$t.months,we=$t.shortMonths,Ue=f(St),qe=x(St),ar=f(Nt),Ar=x(Nt),Tr=f(ee),pr=x(ee),Jr=f(le),Vn=x(le),Hn=f(we),Kn=x(we),Ci={a:xi,A:Pi,b:Di,B:Zi,c:null,d:U,e:U,f:yt,H:W,I:q,j:X,L:lt,m:pt,M:st,p:ui,q:Pa,Q:Ge,s:cr,S:tt,u:dt,U:rt,V:at,w:vt,W:it,x:null,X:null,y:Y,Y:ft,Z:ut,"%":He},ii={a:Wa,A:ze,b:Pe,B:Rr,c:null,d:wt,e:wt,f:Jt,H:zt,I:Pt,j:Wt,L:Ht,m:ge,M:he,p:qr,q:$r,Q:Ge,s:cr,S:de,u:se,U:Tt,V:Lt,w:Mt,W:te,x:null,X:null,y:ve,Y:oe,Z:Te,"%":He},qn={a:fr,A:xr,b:Qr,B:Cn,c:wn,d:h,e:h,f:N,H:k,I:k,j:p,L:O,m:A,M:w,p:rr,q:E,Q:H,s:F,S:R,u:v,U:T,V:u,w:y,W:b,x:Mn,X:ci,y:C,Y:_,Z:M,"%":V};Ci.x=oa(Ct,Ci),Ci.X=oa(gt,Ci),Ci.c=oa(ne,Ci),ii.x=oa(Ct,ii),ii.X=oa(gt,ii),ii.c=oa(ne,ii);function oa(Br,Gr){return function(dn){var an=[],Ee=-1,dr=0,Vr=Br.length,yn,Fn,Xn;for(dn instanceof Date||(dn=new Date(+dn));++Ee<Vr;)Br.charCodeAt(Ee)===37&&(an.push(Br.slice(dr,Ee)),(Fn=r[yn=Br.charAt(++Ee)])!=null?yn=Br.charAt(++Ee):Fn=yn==="e"?" ":"0",(Xn=Gr[yn])&&(yn=Xn(dn,Fn)),an.push(yn),dr=Ee+1);return an.push(Br.slice(dr,Ee)),an.join("")}}function Hi(Br,Gr){return function(dn){var an=t(1900,void 0,1),Ee=We(an,Br,dn+="",0),dr,Vr;if(Ee!=dn.length)return null;if("Q"in an)return new Date(an.Q);if("s"in an)return new Date(an.s*1e3+("L"in an?an.L:0));if(Gr&&!("Z"in an)&&(an.Z=0),"p"in an&&(an.H=an.H%12+an.p*12),an.m===void 0&&(an.m="q"in an?an.q:0),"V"in an){if(an.V<1||an.V>53)return null;"w"in an||(an.w=1),"Z"in an?(dr=S(t(an.y,0,1)),Vr=dr.getUTCDay(),dr=Vr>4||Vr===0?g.utcMonday.ceil(dr):g.utcMonday(dr),dr=g.utcDay.offset(dr,(an.V-1)*7),an.y=dr.getUTCFullYear(),an.m=dr.getUTCMonth(),an.d=dr.getUTCDate()+(an.w+6)%7):(dr=P(t(an.y,0,1)),Vr=dr.getDay(),dr=Vr>4||Vr===0?g.timeMonday.ceil(dr):g.timeMonday(dr),dr=g.timeDay.offset(dr,(an.V-1)*7),an.y=dr.getFullYear(),an.m=dr.getMonth(),an.d=dr.getDate()+(an.w+6)%7)}else("W"in an||"U"in an)&&("w"in an||(an.w="u"in an?an.u%7:"W"in an?1:0),Vr="Z"in an?S(t(an.y,0,1)).getUTCDay():P(t(an.y,0,1)).getDay(),an.m=0,an.d="W"in an?(an.w+6)%7+an.W*7-(Vr+5)%7:an.w+an.U*7-(Vr+6)%7);return"Z"in an?(an.H+=an.Z/100|0,an.M+=an.Z%100,S(an)):P(an)}}function We(Br,Gr,dn,an){for(var Ee=0,dr=Gr.length,Vr=dn.length,yn,Fn;Ee<dr;){if(an>=Vr)return-1;if(yn=Gr.charCodeAt(Ee++),yn===37){if(yn=Gr.charAt(Ee++),Fn=qn[yn in r?Gr.charAt(Ee++):yn],!Fn||(an=Fn(Br,dn,an))<0)return-1}else if(yn!=dn.charCodeAt(an++))return-1}return an}function rr(Br,Gr,dn){var an=Ue.exec(Gr.slice(dn));return an?(Br.p=qe[an[0].toLowerCase()],dn+an[0].length):-1}function fr(Br,Gr,dn){var an=Tr.exec(Gr.slice(dn));return an?(Br.w=pr[an[0].toLowerCase()],dn+an[0].length):-1}function xr(Br,Gr,dn){var an=ar.exec(Gr.slice(dn));return an?(Br.w=Ar[an[0].toLowerCase()],dn+an[0].length):-1}function Qr(Br,Gr,dn){var an=Hn.exec(Gr.slice(dn));return an?(Br.m=Kn[an[0].toLowerCase()],dn+an[0].length):-1}function Cn(Br,Gr,dn){var an=Jr.exec(Gr.slice(dn));return an?(Br.m=Vn[an[0].toLowerCase()],dn+an[0].length):-1}function wn(Br,Gr,dn){return We(Br,ne,Gr,dn)}function Mn(Br,Gr,dn){return We(Br,Ct,Gr,dn)}function ci(Br,Gr,dn){return We(Br,gt,Gr,dn)}function xi(Br){return ee[Br.getDay()]}function Pi(Br){return Nt[Br.getDay()]}function Di(Br){return we[Br.getMonth()]}function Zi(Br){return le[Br.getMonth()]}function ui(Br){return St[+(Br.getHours()>=12)]}function Pa(Br){return 1+~~(Br.getMonth()/3)}function Wa(Br){return ee[Br.getUTCDay()]}function ze(Br){return Nt[Br.getUTCDay()]}function Pe(Br){return we[Br.getUTCMonth()]}function Rr(Br){return le[Br.getUTCMonth()]}function qr(Br){return St[+(Br.getUTCHours()>=12)]}function $r(Br){return 1+~~(Br.getUTCMonth()/3)}return{format:function(Br){var Gr=oa(Br+="",Ci);return Gr.toString=function(){return Br},Gr},parse:function(Br){var Gr=Hi(Br+="",!1);return Gr.toString=function(){return Br},Gr},utcFormat:function(Br){var Gr=oa(Br+="",ii);return Gr.toString=function(){return Br},Gr},utcParse:function(Br){var Gr=Hi(Br+="",!0);return Gr.toString=function(){return Br},Gr}}}var r={"-":"",_:" ",0:"0"},a=/^\s*\d+/,n=/^%/,o=/[\\^$*+?|[\]().{}]/g;function i($t,ne,Ct){var gt=$t<0?"-":"",St=(gt?-$t:$t)+"",Nt=St.length;return gt+(Nt<Ct?new Array(Ct-Nt+1).join(ne)+St:St)}function s($t){return $t.replace(o,"\\$&")}function f($t){return new RegExp("^(?:"+$t.map(s).join("|")+")","i")}function x($t){for(var ne={},Ct=-1,gt=$t.length;++Ct<gt;)ne[$t[Ct].toLowerCase()]=Ct;return ne}function y($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+1));return gt?($t.w=+gt[0],Ct+gt[0].length):-1}function v($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+1));return gt?($t.u=+gt[0],Ct+gt[0].length):-1}function T($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.U=+gt[0],Ct+gt[0].length):-1}function u($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.V=+gt[0],Ct+gt[0].length):-1}function b($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.W=+gt[0],Ct+gt[0].length):-1}function _($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+4));return gt?($t.y=+gt[0],Ct+gt[0].length):-1}function C($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.y=+gt[0]+(+gt[0]>68?1900:2e3),Ct+gt[0].length):-1}function M($t,ne,Ct){var gt=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(ne.slice(Ct,Ct+6));return gt?($t.Z=gt[1]?0:-(gt[2]+(gt[3]||"00")),Ct+gt[0].length):-1}function E($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+1));return gt?($t.q=gt[0]*3-3,Ct+gt[0].length):-1}function A($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.m=gt[0]-1,Ct+gt[0].length):-1}function h($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.d=+gt[0],Ct+gt[0].length):-1}function p($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+3));return gt?($t.m=0,$t.d=+gt[0],Ct+gt[0].length):-1}function k($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.H=+gt[0],Ct+gt[0].length):-1}function w($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.M=+gt[0],Ct+gt[0].length):-1}function R($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.S=+gt[0],Ct+gt[0].length):-1}function O($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+3));return gt?($t.L=+gt[0],Ct+gt[0].length):-1}function N($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+6));return gt?($t.L=Math.floor(gt[0]/1e3),Ct+gt[0].length):-1}function V($t,ne,Ct){var gt=n.exec(ne.slice(Ct,Ct+1));return gt?Ct+gt[0].length:-1}function H($t,ne,Ct){var gt=a.exec(ne.slice(Ct));return gt?($t.Q=+gt[0],Ct+gt[0].length):-1}function F($t,ne,Ct){var gt=a.exec(ne.slice(Ct));return gt?($t.s=+gt[0],Ct+gt[0].length):-1}function U($t,ne){return i($t.getDate(),ne,2)}function W($t,ne){return i($t.getHours(),ne,2)}function q($t,ne){return i($t.getHours()%12||12,ne,2)}function X($t,ne){return i(1+g.timeDay.count(g.timeYear($t),$t),ne,3)}function lt($t,ne){return i($t.getMilliseconds(),ne,3)}function yt($t,ne){return lt($t,ne)+"000"}function pt($t,ne){return i($t.getMonth()+1,ne,2)}function st($t,ne){return i($t.getMinutes(),ne,2)}function tt($t,ne){return i($t.getSeconds(),ne,2)}function dt($t){var ne=$t.getDay();return ne===0?7:ne}function rt($t,ne){return i(g.timeSunday.count(g.timeYear($t)-1,$t),ne,2)}function at($t,ne){var Ct=$t.getDay();return $t=Ct>=4||Ct===0?g.timeThursday($t):g.timeThursday.ceil($t),i(g.timeThursday.count(g.timeYear($t),$t)+(g.timeYear($t).getDay()===4),ne,2)}function vt($t){return $t.getDay()}function it($t,ne){return i(g.timeMonday.count(g.timeYear($t)-1,$t),ne,2)}function Y($t,ne){return i($t.getFullYear()%100,ne,2)}function ft($t,ne){return i($t.getFullYear()%1e4,ne,4)}function ut($t){var ne=$t.getTimezoneOffset();return(ne>0?"-":(ne*=-1,"+"))+i(ne/60|0,"0",2)+i(ne%60,"0",2)}function wt($t,ne){return i($t.getUTCDate(),ne,2)}function zt($t,ne){return i($t.getUTCHours(),ne,2)}function Pt($t,ne){return i($t.getUTCHours()%12||12,ne,2)}function Wt($t,ne){return i(1+g.utcDay.count(g.utcYear($t),$t),ne,3)}function Ht($t,ne){return i($t.getUTCMilliseconds(),ne,3)}function Jt($t,ne){return Ht($t,ne)+"000"}function ge($t,ne){return i($t.getUTCMonth()+1,ne,2)}function he($t,ne){return i($t.getUTCMinutes(),ne,2)}function de($t,ne){return i($t.getUTCSeconds(),ne,2)}function se($t){var ne=$t.getUTCDay();return ne===0?7:ne}function Tt($t,ne){return i(g.utcSunday.count(g.utcYear($t)-1,$t),ne,2)}function Lt($t,ne){var Ct=$t.getUTCDay();return $t=Ct>=4||Ct===0?g.utcThursday($t):g.utcThursday.ceil($t),i(g.utcThursday.count(g.utcYear($t),$t)+(g.utcYear($t).getUTCDay()===4),ne,2)}function Mt($t){return $t.getUTCDay()}function te($t,ne){return i(g.utcMonday.count(g.utcYear($t)-1,$t),ne,2)}function ve($t,ne){return i($t.getUTCFullYear()%100,ne,2)}function oe($t,ne){return i($t.getUTCFullYear()%1e4,ne,4)}function Te(){return"+0000"}function He(){return"%"}function Ge($t){return+$t}function cr($t){return Math.floor(+$t/1e3)}var ur;jr({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 jr($t){return ur=e($t),c.timeFormat=ur.format,c.timeParse=ur.parse,c.utcFormat=ur.utcFormat,c.utcParse=ur.utcParse,ur}var Hr="%Y-%m-%dT%H:%M:%S.%LZ";function br($t){return $t.toISOString()}var Kr=Date.prototype.toISOString?br:c.utcFormat(Hr);function rn($t){var ne=new Date($t);return isNaN(ne)?null:ne}var Ce=+new Date("2000-01-01T00:00:00.000Z")?rn:c.utcParse(Hr);c.isoFormat=Kr,c.isoParse=Ce,c.timeFormatDefaultLocale=jr,c.timeFormatLocale=e,Object.defineProperty(c,"__esModule",{value:!0})})}),Li=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=typeof globalThis<"u"?globalThis:c||self,g(c.d3=c.d3||{}))})(Q,function(c){function g(A){return Math.abs(A=Math.round(A))>=1e21?A.toLocaleString("en").replace(/,/g,""):A.toString(10)}function P(A,h){if((p=(A=h?A.toExponential(h-1):A.toExponential()).indexOf("e"))<0)return null;var p,k=A.slice(0,p);return[k.length>1?k[0]+k.slice(2):k,+A.slice(p+1)]}function S(A){return A=P(Math.abs(A)),A?A[1]:NaN}function t(A,h){return function(p,k){for(var w=p.length,R=[],O=0,N=A[0],V=0;w>0&&N>0&&(V+N+1>k&&(N=Math.max(1,k-V)),R.push(p.substring(w-=N,w+N)),!((V+=N+1)>k));)N=A[O=(O+1)%A.length];return R.reverse().join(h)}}function e(A){return function(h){return h.replace(/[0-9]/g,function(p){return A[+p]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(A){if(!(h=r.exec(A)))throw new Error("invalid format: "+A);var h;return new n({fill:h[1],align:h[2],sign:h[3],symbol:h[4],zero:h[5],width:h[6],comma:h[7],precision:h[8]&&h[8].slice(1),trim:h[9],type:h[10]})}a.prototype=n.prototype;function n(A){this.fill=A.fill===void 0?" ":A.fill+"",this.align=A.align===void 0?">":A.align+"",this.sign=A.sign===void 0?"-":A.sign+"",this.symbol=A.symbol===void 0?"":A.symbol+"",this.zero=!!A.zero,this.width=A.width===void 0?void 0:+A.width,this.comma=!!A.comma,this.precision=A.precision===void 0?void 0:+A.precision,this.trim=!!A.trim,this.type=A.type===void 0?"":A.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(A){t:for(var h=A.length,p=1,k=-1,w;p<h;++p)switch(A[p]){case".":k=w=p;break;case"0":k===0&&(k=p),w=p;break;default:if(!+A[p])break t;k>0&&(k=0);break}return k>0?A.slice(0,k)+A.slice(w+1):A}var i;function s(A,h){var p=P(A,h);if(!p)return A+"";var k=p[0],w=p[1],R=w-(i=Math.max(-8,Math.min(8,Math.floor(w/3)))*3)+1,O=k.length;return R===O?k:R>O?k+new Array(R-O+1).join("0"):R>0?k.slice(0,R)+"."+k.slice(R):"0."+new Array(1-R).join("0")+P(A,Math.max(0,h+R-1))[0]}function f(A,h){var p=P(A,h);if(!p)return A+"";var k=p[0],w=p[1];return w<0?"0."+new Array(-w).join("0")+k:k.length>w+1?k.slice(0,w+1)+"."+k.slice(w+1):k+new Array(w-k.length+2).join("0")}var x={"%":function(A,h){return(A*100).toFixed(h)},b:function(A){return Math.round(A).toString(2)},c:function(A){return A+""},d:g,e:function(A,h){return A.toExponential(h)},f:function(A,h){return A.toFixed(h)},g:function(A,h){return A.toPrecision(h)},o:function(A){return Math.round(A).toString(8)},p:function(A,h){return f(A*100,h)},r:f,s,X:function(A){return Math.round(A).toString(16).toUpperCase()},x:function(A){return Math.round(A).toString(16)}};function y(A){return A}var v=Array.prototype.map,T=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function u(A){var h=A.grouping===void 0||A.thousands===void 0?y:t(v.call(A.grouping,Number),A.thousands+""),p=A.currency===void 0?"":A.currency[0]+"",k=A.currency===void 0?"":A.currency[1]+"",w=A.decimal===void 0?".":A.decimal+"",R=A.numerals===void 0?y:e(v.call(A.numerals,String)),O=A.percent===void 0?"%":A.percent+"",N=A.minus===void 0?"-":A.minus+"",V=A.nan===void 0?"NaN":A.nan+"";function H(U){U=a(U);var W=U.fill,q=U.align,X=U.sign,lt=U.symbol,yt=U.zero,pt=U.width,st=U.comma,tt=U.precision,dt=U.trim,rt=U.type;rt==="n"?(st=!0,rt="g"):x[rt]||(tt===void 0&&(tt=12),dt=!0,rt="g"),(yt||W==="0"&&q==="=")&&(yt=!0,W="0",q="=");var at=lt==="$"?p:lt==="#"&&/[boxX]/.test(rt)?"0"+rt.toLowerCase():"",vt=lt==="$"?k:/[%p]/.test(rt)?O:"",it=x[rt],Y=/[defgprs%]/.test(rt);tt=tt===void 0?6:/[gprs]/.test(rt)?Math.max(1,Math.min(21,tt)):Math.max(0,Math.min(20,tt));function ft(ut){var wt=at,zt=vt,Pt,Wt,Ht;if(rt==="c")zt=it(ut)+zt,ut="";else{ut=+ut;var Jt=ut<0||1/ut<0;if(ut=isNaN(ut)?V:it(Math.abs(ut),tt),dt&&(ut=o(ut)),Jt&&+ut==0&&X!=="+"&&(Jt=!1),wt=(Jt?X==="("?X:N:X==="-"||X==="("?"":X)+wt,zt=(rt==="s"?T[8+i/3]:"")+zt+(Jt&&X==="("?")":""),Y){for(Pt=-1,Wt=ut.length;++Pt<Wt;)if(Ht=ut.charCodeAt(Pt),48>Ht||Ht>57){zt=(Ht===46?w+ut.slice(Pt+1):ut.slice(Pt))+zt,ut=ut.slice(0,Pt);break}}}st&&!yt&&(ut=h(ut,1/0));var ge=wt.length+ut.length+zt.length,he=ge<pt?new Array(pt-ge+1).join(W):"";switch(st&&yt&&(ut=h(he+ut,he.length?pt-zt.length:1/0),he=""),q){case"<":ut=wt+ut+zt+he;break;case"=":ut=wt+he+ut+zt;break;case"^":ut=he.slice(0,ge=he.length>>1)+wt+ut+zt+he.slice(ge);break;default:ut=he+wt+ut+zt;break}return R(ut)}return ft.toString=function(){return U+""},ft}function F(U,W){var q=H((U=a(U),U.type="f",U)),X=Math.max(-8,Math.min(8,Math.floor(S(W)/3)))*3,lt=Math.pow(10,-X),yt=T[8+X/3];return function(pt){return q(lt*pt)+yt}}return{format:H,formatPrefix:F}}var b;_({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function _(A){return b=u(A),c.format=b.format,c.formatPrefix=b.formatPrefix,b}function C(A){return Math.max(0,-S(Math.abs(A)))}function M(A,h){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(S(h)/3)))*3-S(Math.abs(A)))}function E(A,h){return A=Math.abs(A),h=Math.abs(h)-A,Math.max(0,S(h)-S(A))+1}c.FormatSpecifier=n,c.formatDefaultLocale=_,c.formatLocale=u,c.formatSpecifier=a,c.precisionFixed=C,c.precisionPrefix=M,c.precisionRound=E,Object.defineProperty(c,"__esModule",{value:!0})})}),yi=Ft((Q,$)=>{$.exports=function(c){for(var g=c.length,P,S=0;S<g;S++)if(P=c.charCodeAt(S),(P<9||P>13)&&P!==32&&P!==133&&P!==160&&P!==5760&&P!==6158&&(P<8192||P>8205)&&P!==8232&&P!==8233&&P!==8239&&P!==8287&&P!==8288&&P!==12288&&P!==65279)return!1;return!0}}),ra=Ft((Q,$)=>{var c=yi();$.exports=function(g){var P=typeof g;if(P==="string"){var S=g;if(g=+g,g===0&&c(S))return!1}else if(P!=="number")return!1;return g-g<1}}),Da=Ft((Q,$)=>{$.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:""}}),Ni=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=typeof globalThis<"u"?globalThis:c||self,g(c["base64-arraybuffer"]={}))})(Q,function(c){for(var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",P=typeof Uint8Array>"u"?[]:new Uint8Array(256),S=0;S<g.length;S++)P[g.charCodeAt(S)]=S;var t=function(r){var a=new Uint8Array(r),n,o=a.length,i="";for(n=0;n<o;n+=3)i+=g[a[n]>>2],i+=g[(a[n]&3)<<4|a[n+1]>>4],i+=g[(a[n+1]&15)<<2|a[n+2]>>6],i+=g[a[n+2]&63];return o%3===2?i=i.substring(0,i.length-1)+"=":o%3===1&&(i=i.substring(0,i.length-2)+"=="),i},e=function(r){var a=r.length*.75,n=r.length,o,i=0,s,f,x,y;r[r.length-1]==="="&&(a--,r[r.length-2]==="="&&a--);var v=new ArrayBuffer(a),T=new Uint8Array(v);for(o=0;o<n;o+=4)s=P[r.charCodeAt(o)],f=P[r.charCodeAt(o+1)],x=P[r.charCodeAt(o+2)],y=P[r.charCodeAt(o+3)],T[i++]=s<<2|f>>4,T[i++]=(f&15)<<4|x>>2,T[i++]=(x&3)<<6|y&63;return v};c.decode=e,c.encode=t,Object.defineProperty(c,"__esModule",{value:!0})})}),Ei=Ft((Q,$)=>{$.exports=function(c){return window&&window.process&&window.process.versions?Object.prototype.toString.call(c)==="[object Object]":Object.prototype.toString.call(c)==="[object Object]"&&Object.getPrototypeOf(c).hasOwnProperty("hasOwnProperty")}}),Va=Ft(Q=>{var $=Ni().decode,c=Ei(),g=Array.isArray,P=ArrayBuffer,S=DataView;function t(s){return P.isView(s)&&!(s instanceof S)}Q.isTypedArray=t;function e(s){return g(s)||t(s)}Q.isArrayOrTypedArray=e;function r(s){return!e(s[0])}Q.isArray1D=r,Q.ensureArray=function(s,f){return g(s)||(s=[]),s.length=f,s};var a={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};a.uint8c=a.u1c,a.uint8=a.u1,a.int8=a.i1,a.uint16=a.u2,a.int16=a.i2,a.uint32=a.u4,a.int32=a.i4,a.float32=a.f4,a.float64=a.f8;function n(s){return s.constructor===ArrayBuffer}Q.isArrayBuffer=n,Q.decodeTypedArraySpec=function(s){var f=[],x=o(s),y=x.dtype,v=a[y];if(!v)throw new Error('Error in dtype: "'+y+'"');var T=v.BYTES_PER_ELEMENT,u=x.bdata;n(u)||(u=$(u));var b=x.shape===void 0?[u.byteLength/T]:(""+x.shape).split(",");b.reverse();var _=b.length,C,M,E=+b[0],A=T*E,h=0;if(_===1)f=new v(u);else if(_===2)for(C=+b[1],M=0;M<C;M++)f[M]=new v(u,h,E),h+=A;else if(_===3){C=+b[1];for(var p=+b[2],k=0;k<p;k++)for(f[k]=[],M=0;M<C;M++)f[k][M]=new v(u,h,E),h+=A}else throw new Error("ndim: "+_+'is not supported with the shape:"'+x.shape+'"');return f.bdata=x.bdata,f.dtype=x.dtype,f.shape=b.reverse().join(","),s._inputArray=f,f},Q.isTypedArraySpec=function(s){return c(s)&&s.hasOwnProperty("dtype")&&typeof s.dtype=="string"&&s.hasOwnProperty("bdata")&&(typeof s.bdata=="string"||n(s.bdata))&&(s.shape===void 0||s.hasOwnProperty("shape")&&(typeof s.shape=="string"||typeof s.shape=="number"))};function o(s){return{bdata:s.bdata,dtype:s.dtype,shape:s.shape}}Q.concat=function(){var s=[],f=!0,x=0,y,v,T,u,b,_,C,M;for(T=0;T<arguments.length;T++)u=arguments[T],_=u.length,_&&(v?s.push(u):(v=u,b=_),g(u)?y=!1:(f=!1,x?y!==u.constructor&&(y=!1):y=u.constructor),x+=_);if(!x)return[];if(!s.length)return v;if(f)return v.concat.apply(v,s);if(y){for(C=new y(x),C.set(v),T=0;T<s.length;T++)u=s[T],C.set(u,b),b+=u.length;return C}for(C=new Array(x),M=0;M<v.length;M++)C[M]=v[M];for(T=0;T<s.length;T++){for(u=s[T],M=0;M<u.length;M++)C[b+M]=u[M];b+=M}return C},Q.maxRowLength=function(s){return i(s,Math.max,0)},Q.minRowLength=function(s){return i(s,Math.min,1/0)};function i(s,f,x){if(e(s))if(e(s[0])){for(var y=x,v=0;v<s.length;v++)y=f(y,s[v].length);return y}else return s.length;return 0}}),ss=Ft((Q,$)=>{var c=ra(),g=Va().isArrayOrTypedArray;$.exports=function(i,s){if(c(s))s=String(s);else if(typeof s!="string"||s.substr(s.length-4)==="[-1]")throw"bad property string";var f=s.split("."),x,y,v,T;for(T=0;T<f.length;T++)if(String(f[T]).slice(0,2)==="__")throw"bad property string";for(T=0;T<f.length;){if(x=String(f[T]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/),x){if(x[1])f[T]=x[1];else if(T===0)f.splice(0,1);else throw"bad property string";for(y=x[2].substr(1,x[2].length-2).split("]["),v=0;v<y.length;v++)T++,f.splice(T,0,Number(y[v]))}T++}return typeof i!="object"?o(i,s,f):{set:e(i,f,s),get:P(i,f),astr:s,parts:f,obj:i}};function P(i,s){return function(f){var x=i,y,v,T,u,b;for(u=0;u<s.length-1;u++){if(y=s[u],y===-1){for(v=!0,T=[],b=0;b<x.length;b++)T[b]=P(x[b],s.slice(u+1))(f),T[b]!==T[0]&&(v=!1);return v?T[0]:T}if(typeof y=="number"&&!g(x)||(x=x[y],typeof x!="object"||x===null))return}if(!(typeof x!="object"||x===null)&&(T=x[s[u]],!(!f&&T===null)))return T}}var S=/(^|\.)args\[/;function t(i,s){return i===void 0||i===null&&!s.match(S)}function e(i,s,f){return function(x){var y=i,v="",T=t(x,f),u,b;for(b=0;b<s.length-1;b++){if(u=s[b],typeof u=="number"&&!g(y))throw"array index but container is not an array";if(u===-1){if(T=!a(y,s.slice(b+1),x,f),T)break;return}if(!n(y,u,s[b+1],T))break;if(y=y[u],typeof y!="object"||y===null)throw"container is not an object";v=r(v,u)}if(T){if(b===s.length-1&&(delete y[s[b]],Array.isArray(y)&&+s[b]===y.length-1))for(;y.length&&y[y.length-1]===void 0;)y.pop()}else y[s[b]]=x}}function r(i,s){var f=s;return c(s)?f="["+s+"]":i&&(f="."+s),i+f}function a(i,s,f,x){var y=g(f),v=!0,T=f,u=x.replace("-1",0),b=y?!1:t(f,u),_=s[0],C;for(C=0;C<i.length;C++)u=x.replace("-1",C),y&&(T=f[C%f.length],b=t(T,u)),b&&(v=!1),n(i,C,_,b)&&e(i[C],s,x.replace("-1",C))(T);return v}function n(i,s,f,x){if(i[s]===void 0){if(x)return!1;typeof f=="number"?i[s]=[]:i[s]={}}return!0}function o(i,s,f){return{set:function(){throw"bad container"},get:function(){},astr:s,parts:f,obj:i}}}),mo=Ft((Q,$)=>{var c=ss(),g=/^\w*$/,P=0,S=1,t=2,e=3,r=4;$.exports=function(a,n,o,i){o=o||"name",i=i||"value";var s,f,x,y={};n&&n.length?(x=c(a,n),f=x.get()):f=a,n=n||"";var v={};if(f)for(s=0;s<f.length;s++)v[f[s][o]]=s;var T=g.test(i),u={set:function(b,_){var C=_===null?r:P;if(!f){if(!x||C===r)return;f=[],x.set(f)}var M=v[b];if(M===void 0){if(C===r)return;C=C|e,M=f.length,v[b]=M}else _!==(T?f[M][i]:c(f[M],i).get())&&(C=C|t);var E=f[M]=f[M]||{};return E[o]=b,T?E[i]=_:c(E,i).set(_),_!==null&&(C=C&~r),y[M]=y[M]|C,u},get:function(b){if(f){var _=v[b];if(_!==void 0)return T?f[_][i]:c(f[_],i).get()}},rename:function(b,_){var C=v[b];return C===void 0||(y[C]=y[C]|S,v[_]=C,delete v[b],f[C][o]=_),u},remove:function(b){var _=v[b];if(_===void 0)return u;var C=f[_];if(Object.keys(C).length>2)return y[_]=y[_]|t,u.set(b,null);if(T){for(s=_;s<f.length;s++)y[s]=y[s]|e;for(s=_;s<f.length;s++)v[f[s][o]]--;f.splice(_,1),delete v[b]}else c(C,i).set(null),y[_]=y[_]|t|r;return u},constructUpdate:function(){for(var b,_,C={},M=Object.keys(y),E=0;E<M.length;E++)_=M[E],b=n+"["+_+"]",f[_]?(y[_]&S&&(C[b+"."+o]=f[_][o]),y[_]&t&&(T?C[b+"."+i]=y[_]&r?null:f[_][i]:C[b+"."+i]=y[_]&r?null:c(f[_],i).get())):C[b]=null;return C}};return u}}),ko=Ft((Q,$)=>{var c=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,g=/^[^\.\[\]]+$/;$.exports=function(P,S){for(;S;){var t=P.match(c);if(t)P=t[1];else if(P.match(g))P="";else throw new Error("bad relativeAttr call:"+[P,S]);if(S.charAt(0)==="^")S=S.slice(1);else break}return P&&S.charAt(0)!=="["?P+"."+S:P+S}}),pl=Ft((Q,$)=>{var c=ra();$.exports=function(g,P){if(g>0)return Math.log(g)/Math.LN10;var S=Math.log(Math.min(P[0],P[1]))/Math.LN10;return c(S)||(S=Math.log(Math.max(P[0],P[1]))/Math.LN10-6),S}}),fu=Ft((Q,$)=>{var c=Va().isArrayOrTypedArray,g=Ei();$.exports=function P(S,t){for(var e in t){var r=t[e],a=S[e];if(a!==r)if(e.charAt(0)==="_"||typeof r=="function"){if(e in S)continue;S[e]=r}else if(c(r)&&c(a)&&g(r[0])){if(e==="customdata"||e==="ids")continue;for(var n=Math.min(r.length,a.length),o=0;o<n;o++)a[o]!==r[o]&&g(r[o])&&g(a[o])&&P(a[o],r[o])}else g(r)&&g(a)&&(P(a,r),Object.keys(a).length||delete S[e])}}}),qo=Ft((Q,$)=>{function c(P,S){var t=P%S;return t<0?t+S:t}function g(P,S){return Math.abs(P)>S/2?P-Math.round(P/S)*S:P}$.exports={mod:c,modHalf:g}}),fo=Ft((Q,$)=>{(function(c){var g=/^\s+/,P=/\s+$/,S=0,t=c.round,e=c.min,r=c.max,a=c.random;function n(Y,ft){if(Y=Y||"",ft=ft||{},Y instanceof n)return Y;if(!(this instanceof n))return new n(Y,ft);var ut=o(Y);this._originalInput=Y,this._r=ut.r,this._g=ut.g,this._b=ut.b,this._a=ut.a,this._roundA=t(100*this._a)/100,this._format=ft.format||ut.format,this._gradientType=ft.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=ut.ok,this._tc_id=S++}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 Y=this.toRgb();return(Y.r*299+Y.g*587+Y.b*114)/1e3},getLuminance:function(){var Y=this.toRgb(),ft,ut,wt,zt,Pt,Wt;return ft=Y.r/255,ut=Y.g/255,wt=Y.b/255,ft<=.03928?zt=ft/12.92:zt=c.pow((ft+.055)/1.055,2.4),ut<=.03928?Pt=ut/12.92:Pt=c.pow((ut+.055)/1.055,2.4),wt<=.03928?Wt=wt/12.92:Wt=c.pow((wt+.055)/1.055,2.4),.2126*zt+.7152*Pt+.0722*Wt},setAlpha:function(Y){return this._a=U(Y),this._roundA=t(100*this._a)/100,this},toHsv:function(){var Y=x(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,v:Y.v,a:this._a}},toHsvString:function(){var Y=x(this._r,this._g,this._b),ft=t(Y.h*360),ut=t(Y.s*100),wt=t(Y.v*100);return this._a==1?"hsv("+ft+", "+ut+"%, "+wt+"%)":"hsva("+ft+", "+ut+"%, "+wt+"%, "+this._roundA+")"},toHsl:function(){var Y=s(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,l:Y.l,a:this._a}},toHslString:function(){var Y=s(this._r,this._g,this._b),ft=t(Y.h*360),ut=t(Y.s*100),wt=t(Y.l*100);return this._a==1?"hsl("+ft+", "+ut+"%, "+wt+"%)":"hsla("+ft+", "+ut+"%, "+wt+"%, "+this._roundA+")"},toHex:function(Y){return v(this._r,this._g,this._b,Y)},toHexString:function(Y){return"#"+this.toHex(Y)},toHex8:function(Y){return T(this._r,this._g,this._b,this._a,Y)},toHex8String:function(Y){return"#"+this.toHex8(Y)},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(W(this._r,255)*100)+"%",g:t(W(this._g,255)*100)+"%",b:t(W(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+t(W(this._r,255)*100)+"%, "+t(W(this._g,255)*100)+"%, "+t(W(this._b,255)*100)+"%)":"rgba("+t(W(this._r,255)*100)+"%, "+t(W(this._g,255)*100)+"%, "+t(W(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:H[v(this._r,this._g,this._b,!0)]||!1},toFilter:function(Y){var ft="#"+u(this._r,this._g,this._b,this._a),ut=ft,wt=this._gradientType?"GradientType = 1, ":"";if(Y){var zt=n(Y);ut="#"+u(zt._r,zt._g,zt._b,zt._a)}return"progid:DXImageTransform.Microsoft.gradient("+wt+"startColorstr="+ft+",endColorstr="+ut+")"},toString:function(Y){var ft=!!Y;Y=Y||this._format;var ut=!1,wt=this._a<1&&this._a>=0,zt=!ft&&wt&&(Y==="hex"||Y==="hex6"||Y==="hex3"||Y==="hex4"||Y==="hex8"||Y==="name");return zt?Y==="name"&&this._a===0?this.toName():this.toRgbString():(Y==="rgb"&&(ut=this.toRgbString()),Y==="prgb"&&(ut=this.toPercentageRgbString()),(Y==="hex"||Y==="hex6")&&(ut=this.toHexString()),Y==="hex3"&&(ut=this.toHexString(!0)),Y==="hex4"&&(ut=this.toHex8String(!0)),Y==="hex8"&&(ut=this.toHex8String()),Y==="name"&&(ut=this.toName()),Y==="hsl"&&(ut=this.toHslString()),Y==="hsv"&&(ut=this.toHsvString()),ut||this.toHexString())},clone:function(){return n(this.toString())},_applyModification:function(Y,ft){var ut=Y.apply(null,[this].concat([].slice.call(ft)));return this._r=ut._r,this._g=ut._g,this._b=ut._b,this.setAlpha(ut._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(E,arguments)},darken:function(){return this._applyModification(A,arguments)},desaturate:function(){return this._applyModification(b,arguments)},saturate:function(){return this._applyModification(_,arguments)},greyscale:function(){return this._applyModification(C,arguments)},spin:function(){return this._applyModification(h,arguments)},_applyCombination:function(Y,ft){return Y.apply(null,[this].concat([].slice.call(ft)))},analogous:function(){return this._applyCombination(O,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(N,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(k,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},n.fromRatio=function(Y,ft){if(typeof Y=="object"){var ut={};for(var wt in Y)Y.hasOwnProperty(wt)&&(wt==="a"?ut[wt]=Y[wt]:ut[wt]=st(Y[wt]));Y=ut}return n(Y,ft)};function o(Y){var ft={r:0,g:0,b:0},ut=1,wt=null,zt=null,Pt=null,Wt=!1,Ht=!1;return typeof Y=="string"&&(Y=vt(Y)),typeof Y=="object"&&(at(Y.r)&&at(Y.g)&&at(Y.b)?(ft=i(Y.r,Y.g,Y.b),Wt=!0,Ht=String(Y.r).substr(-1)==="%"?"prgb":"rgb"):at(Y.h)&&at(Y.s)&&at(Y.v)?(wt=st(Y.s),zt=st(Y.v),ft=y(Y.h,wt,zt),Wt=!0,Ht="hsv"):at(Y.h)&&at(Y.s)&&at(Y.l)&&(wt=st(Y.s),Pt=st(Y.l),ft=f(Y.h,wt,Pt),Wt=!0,Ht="hsl"),Y.hasOwnProperty("a")&&(ut=Y.a)),ut=U(ut),{ok:Wt,format:Y.format||Ht,r:e(255,r(ft.r,0)),g:e(255,r(ft.g,0)),b:e(255,r(ft.b,0)),a:ut}}function i(Y,ft,ut){return{r:W(Y,255)*255,g:W(ft,255)*255,b:W(ut,255)*255}}function s(Y,ft,ut){Y=W(Y,255),ft=W(ft,255),ut=W(ut,255);var wt=r(Y,ft,ut),zt=e(Y,ft,ut),Pt,Wt,Ht=(wt+zt)/2;if(wt==zt)Pt=Wt=0;else{var Jt=wt-zt;switch(Wt=Ht>.5?Jt/(2-wt-zt):Jt/(wt+zt),wt){case Y:Pt=(ft-ut)/Jt+(ft<ut?6:0);break;case ft:Pt=(ut-Y)/Jt+2;break;case ut:Pt=(Y-ft)/Jt+4;break}Pt/=6}return{h:Pt,s:Wt,l:Ht}}function f(Y,ft,ut){var wt,zt,Pt;Y=W(Y,360),ft=W(ft,100),ut=W(ut,100);function Wt(ge,he,de){return de<0&&(de+=1),de>1&&(de-=1),de<1/6?ge+(he-ge)*6*de:de<1/2?he:de<2/3?ge+(he-ge)*(2/3-de)*6:ge}if(ft===0)wt=zt=Pt=ut;else{var Ht=ut<.5?ut*(1+ft):ut+ft-ut*ft,Jt=2*ut-Ht;wt=Wt(Jt,Ht,Y+1/3),zt=Wt(Jt,Ht,Y),Pt=Wt(Jt,Ht,Y-1/3)}return{r:wt*255,g:zt*255,b:Pt*255}}function x(Y,ft,ut){Y=W(Y,255),ft=W(ft,255),ut=W(ut,255);var wt=r(Y,ft,ut),zt=e(Y,ft,ut),Pt,Wt,Ht=wt,Jt=wt-zt;if(Wt=wt===0?0:Jt/wt,wt==zt)Pt=0;else{switch(wt){case Y:Pt=(ft-ut)/Jt+(ft<ut?6:0);break;case ft:Pt=(ut-Y)/Jt+2;break;case ut:Pt=(Y-ft)/Jt+4;break}Pt/=6}return{h:Pt,s:Wt,v:Ht}}function y(Y,ft,ut){Y=W(Y,360)*6,ft=W(ft,100),ut=W(ut,100);var wt=c.floor(Y),zt=Y-wt,Pt=ut*(1-ft),Wt=ut*(1-zt*ft),Ht=ut*(1-(1-zt)*ft),Jt=wt%6,ge=[ut,Wt,Pt,Pt,Ht,ut][Jt],he=[Ht,ut,ut,Wt,Pt,Pt][Jt],de=[Pt,Pt,Ht,ut,ut,Wt][Jt];return{r:ge*255,g:he*255,b:de*255}}function v(Y,ft,ut,wt){var zt=[pt(t(Y).toString(16)),pt(t(ft).toString(16)),pt(t(ut).toString(16))];return wt&&zt[0].charAt(0)==zt[0].charAt(1)&&zt[1].charAt(0)==zt[1].charAt(1)&&zt[2].charAt(0)==zt[2].charAt(1)?zt[0].charAt(0)+zt[1].charAt(0)+zt[2].charAt(0):zt.join("")}function T(Y,ft,ut,wt,zt){var Pt=[pt(t(Y).toString(16)),pt(t(ft).toString(16)),pt(t(ut).toString(16)),pt(tt(wt))];return zt&&Pt[0].charAt(0)==Pt[0].charAt(1)&&Pt[1].charAt(0)==Pt[1].charAt(1)&&Pt[2].charAt(0)==Pt[2].charAt(1)&&Pt[3].charAt(0)==Pt[3].charAt(1)?Pt[0].charAt(0)+Pt[1].charAt(0)+Pt[2].charAt(0)+Pt[3].charAt(0):Pt.join("")}function u(Y,ft,ut,wt){var zt=[pt(tt(wt)),pt(t(Y).toString(16)),pt(t(ft).toString(16)),pt(t(ut).toString(16))];return zt.join("")}n.equals=function(Y,ft){return!Y||!ft?!1:n(Y).toRgbString()==n(ft).toRgbString()},n.random=function(){return n.fromRatio({r:a(),g:a(),b:a()})};function b(Y,ft){ft=ft===0?0:ft||10;var ut=n(Y).toHsl();return ut.s-=ft/100,ut.s=q(ut.s),n(ut)}function _(Y,ft){ft=ft===0?0:ft||10;var ut=n(Y).toHsl();return ut.s+=ft/100,ut.s=q(ut.s),n(ut)}function C(Y){return n(Y).desaturate(100)}function M(Y,ft){ft=ft===0?0:ft||10;var ut=n(Y).toHsl();return ut.l+=ft/100,ut.l=q(ut.l),n(ut)}function E(Y,ft){ft=ft===0?0:ft||10;var ut=n(Y).toRgb();return ut.r=r(0,e(255,ut.r-t(255*-(ft/100)))),ut.g=r(0,e(255,ut.g-t(255*-(ft/100)))),ut.b=r(0,e(255,ut.b-t(255*-(ft/100)))),n(ut)}function A(Y,ft){ft=ft===0?0:ft||10;var ut=n(Y).toHsl();return ut.l-=ft/100,ut.l=q(ut.l),n(ut)}function h(Y,ft){var ut=n(Y).toHsl(),wt=(ut.h+ft)%360;return ut.h=wt<0?360+wt:wt,n(ut)}function p(Y){var ft=n(Y).toHsl();return ft.h=(ft.h+180)%360,n(ft)}function k(Y){var ft=n(Y).toHsl(),ut=ft.h;return[n(Y),n({h:(ut+120)%360,s:ft.s,l:ft.l}),n({h:(ut+240)%360,s:ft.s,l:ft.l})]}function w(Y){var ft=n(Y).toHsl(),ut=ft.h;return[n(Y),n({h:(ut+90)%360,s:ft.s,l:ft.l}),n({h:(ut+180)%360,s:ft.s,l:ft.l}),n({h:(ut+270)%360,s:ft.s,l:ft.l})]}function R(Y){var ft=n(Y).toHsl(),ut=ft.h;return[n(Y),n({h:(ut+72)%360,s:ft.s,l:ft.l}),n({h:(ut+216)%360,s:ft.s,l:ft.l})]}function O(Y,ft,ut){ft=ft||6,ut=ut||30;var wt=n(Y).toHsl(),zt=360/ut,Pt=[n(Y)];for(wt.h=(wt.h-(zt*ft>>1)+720)%360;--ft;)wt.h=(wt.h+zt)%360,Pt.push(n(wt));return Pt}function N(Y,ft){ft=ft||6;for(var ut=n(Y).toHsv(),wt=ut.h,zt=ut.s,Pt=ut.v,Wt=[],Ht=1/ft;ft--;)Wt.push(n({h:wt,s:zt,v:Pt})),Pt=(Pt+Ht)%1;return Wt}n.mix=function(Y,ft,ut){ut=ut===0?0:ut||50;var wt=n(Y).toRgb(),zt=n(ft).toRgb(),Pt=ut/100,Wt={r:(zt.r-wt.r)*Pt+wt.r,g:(zt.g-wt.g)*Pt+wt.g,b:(zt.b-wt.b)*Pt+wt.b,a:(zt.a-wt.a)*Pt+wt.a};return n(Wt)},n.readability=function(Y,ft){var ut=n(Y),wt=n(ft);return(c.max(ut.getLuminance(),wt.getLuminance())+.05)/(c.min(ut.getLuminance(),wt.getLuminance())+.05)},n.isReadable=function(Y,ft,ut){var wt=n.readability(Y,ft),zt,Pt;switch(Pt=!1,zt=it(ut),zt.level+zt.size){case"AAsmall":case"AAAlarge":Pt=wt>=4.5;break;case"AAlarge":Pt=wt>=3;break;case"AAAsmall":Pt=wt>=7;break}return Pt},n.mostReadable=function(Y,ft,ut){var wt=null,zt=0,Pt,Wt,Ht,Jt;ut=ut||{},Wt=ut.includeFallbackColors,Ht=ut.level,Jt=ut.size;for(var ge=0;ge<ft.length;ge++)Pt=n.readability(Y,ft[ge]),Pt>zt&&(zt=Pt,wt=n(ft[ge]));return n.isReadable(Y,wt,{level:Ht,size:Jt})||!Wt?wt:(ut.includeFallbackColors=!1,n.mostReadable(Y,["#fff","#000"],ut))};var V=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"},H=n.hexNames=F(V);function F(Y){var ft={};for(var ut in Y)Y.hasOwnProperty(ut)&&(ft[Y[ut]]=ut);return ft}function U(Y){return Y=parseFloat(Y),(isNaN(Y)||Y<0||Y>1)&&(Y=1),Y}function W(Y,ft){lt(Y)&&(Y="100%");var ut=yt(Y);return Y=e(ft,r(0,parseFloat(Y))),ut&&(Y=parseInt(Y*ft,10)/100),c.abs(Y-ft)<1e-6?1:Y%ft/parseFloat(ft)}function q(Y){return e(1,r(0,Y))}function X(Y){return parseInt(Y,16)}function lt(Y){return typeof Y=="string"&&Y.indexOf(".")!=-1&&parseFloat(Y)===1}function yt(Y){return typeof Y=="string"&&Y.indexOf("%")!=-1}function pt(Y){return Y.length==1?"0"+Y:""+Y}function st(Y){return Y<=1&&(Y=Y*100+"%"),Y}function tt(Y){return c.round(parseFloat(Y)*255).toString(16)}function dt(Y){return X(Y)/255}var rt=function(){var Y="[-\\+]?\\d+%?",ft="[-\\+]?\\d*\\.\\d+%?",ut="(?:"+ft+")|(?:"+Y+")",wt="[\\s|\\(]+("+ut+")[,|\\s]+("+ut+")[,|\\s]+("+ut+")\\s*\\)?",zt="[\\s|\\(]+("+ut+")[,|\\s]+("+ut+")[,|\\s]+("+ut+")[,|\\s]+("+ut+")\\s*\\)?";return{CSS_UNIT:new RegExp(ut),rgb:new RegExp("rgb"+wt),rgba:new RegExp("rgba"+zt),hsl:new RegExp("hsl"+wt),hsla:new RegExp("hsla"+zt),hsv:new RegExp("hsv"+wt),hsva:new RegExp("hsva"+zt),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 at(Y){return!!rt.CSS_UNIT.exec(Y)}function vt(Y){Y=Y.replace(g,"").replace(P,"").toLowerCase();var ft=!1;if(V[Y])Y=V[Y],ft=!0;else if(Y=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ut;return(ut=rt.rgb.exec(Y))?{r:ut[1],g:ut[2],b:ut[3]}:(ut=rt.rgba.exec(Y))?{r:ut[1],g:ut[2],b:ut[3],a:ut[4]}:(ut=rt.hsl.exec(Y))?{h:ut[1],s:ut[2],l:ut[3]}:(ut=rt.hsla.exec(Y))?{h:ut[1],s:ut[2],l:ut[3],a:ut[4]}:(ut=rt.hsv.exec(Y))?{h:ut[1],s:ut[2],v:ut[3]}:(ut=rt.hsva.exec(Y))?{h:ut[1],s:ut[2],v:ut[3],a:ut[4]}:(ut=rt.hex8.exec(Y))?{r:X(ut[1]),g:X(ut[2]),b:X(ut[3]),a:dt(ut[4]),format:ft?"name":"hex8"}:(ut=rt.hex6.exec(Y))?{r:X(ut[1]),g:X(ut[2]),b:X(ut[3]),format:ft?"name":"hex"}:(ut=rt.hex4.exec(Y))?{r:X(ut[1]+""+ut[1]),g:X(ut[2]+""+ut[2]),b:X(ut[3]+""+ut[3]),a:dt(ut[4]+""+ut[4]),format:ft?"name":"hex8"}:(ut=rt.hex3.exec(Y))?{r:X(ut[1]+""+ut[1]),g:X(ut[2]+""+ut[2]),b:X(ut[3]+""+ut[3]),format:ft?"name":"hex"}:!1}function it(Y){var ft,ut;return Y=Y||{level:"AA",size:"small"},ft=(Y.level||"AA").toUpperCase(),ut=(Y.size||"small").toLowerCase(),ft!=="AA"&&ft!=="AAA"&&(ft="AA"),ut!=="small"&&ut!=="large"&&(ut="small"),{level:ft,size:ut}}typeof $<"u"&&$.exports?$.exports=n:window.tinycolor=n})(Math)}),Ta=Ft(Q=>{var $=Ei(),c=Array.isArray;function g(S,t){var e,r;for(e=0;e<S.length;e++){if(r=S[e],r!==null&&typeof r=="object")return!1;r!==void 0&&(t[e]=r)}return!0}Q.extendFlat=function(){return P(arguments,!1,!1,!1)},Q.extendDeep=function(){return P(arguments,!0,!1,!1)},Q.extendDeepAll=function(){return P(arguments,!0,!0,!1)},Q.extendDeepNoArrays=function(){return P(arguments,!0,!1,!0)};function P(S,t,e,r){var a=S[0],n=S.length,o,i,s,f,x,y,v;if(n===2&&c(a)&&c(S[1])&&a.length===0){if(v=g(S[1],a),v)return a;a.splice(0,a.length)}for(var T=1;T<n;T++){o=S[T];for(i in o)s=a[i],f=o[i],r&&c(f)?a[i]=f:t&&f&&($(f)||(x=c(f)))?(x?(x=!1,y=s&&c(s)?s:[]):y=s&&$(s)?s:{},a[i]=P([y,f],t,e,r)):(typeof f<"u"||e)&&(a[i]=f)}return a}}),Ea=Ft((Q,$)=>{$.exports=function(c){var g=c.variantValues,P=c.editType,S=c.colorEditType;S===void 0&&(S=P);var t={editType:P,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};c.noNumericWeightValues&&(t.valType="enumerated",t.values=t.extras,t.extras=void 0,t.min=void 0,t.max=void 0);var e={family:{valType:"string",noBlank:!0,strict:!0,editType:P},size:{valType:"number",min:1,editType:P},color:{valType:"color",editType:S},weight:t,style:{editType:P,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:c.noFontVariant?void 0:{editType:P,valType:"enumerated",values:g||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:c.noFontTextcase?void 0:{editType:P,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:c.noFontLineposition?void 0:{editType:P,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:c.noFontShadow?void 0:{editType:P,valType:"string",dflt:c.autoShadowDflt?"auto":"none"},editType:P};return c.autoSize&&(e.size.dflt="auto"),c.autoColor&&(e.color.dflt="auto"),c.arrayOk&&(e.family.arrayOk=!0,e.weight.arrayOk=!0,e.style.arrayOk=!0,c.noFontVariant||(e.variant.arrayOk=!0),c.noFontTextcase||(e.textcase.arrayOk=!0),c.noFontLineposition||(e.lineposition.arrayOk=!0),c.noFontShadow||(e.shadow.arrayOk=!0),e.size.arrayOk=!0,e.color.arrayOk=!0),e}}),go=Ft((Q,$)=>{$.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}),Ao=Ft((Q,$)=>{var c=go(),g=Ea(),P=g({editType:"none"});P.family.dflt=c.HOVERFONT,P.size.dflt=c.HOVERFONTSIZE,$.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:P,grouptitlefont:g({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"}}}),Ps=Ft((Q,$)=>{var c=Ea(),g=Ao().hoverlabel,P=Ta().extendFlat;$.exports={hoverlabel:{bgcolor:P({},g.bgcolor,{arrayOk:!0}),bordercolor:P({},g.bordercolor,{arrayOk:!0}),font:c({arrayOk:!0,editType:"none"}),align:P({},g.align,{arrayOk:!0}),namelength:P({},g.namelength,{arrayOk:!0}),showarrow:P({},g.showarrow),editType:"none"}}}),$o=Ft((Q,$)=>{var c=Ea(),g=Ps();$.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:c({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:g.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}),gi=Ft((Q,$)=>{var c=fo(),g={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},P=g.RdBu;function S(r,a){if(a||(a=P),!r)return a;function n(){try{r=g[r]||JSON.parse(r)}catch{r=a}}return typeof r=="string"&&(n(),typeof r=="string"&&n()),t(r)?r:a}function t(r){var a=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]<a||!c(o[1]).isValid())return!1;a=+o[0]}return!0}function e(r){return g[r]!==void 0?!0:t(r)}$.exports={scales:g,defaultScale:P,get:S,isValid:e}}),bi=Ft(Q=>{Q.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Q.defaultLine="#444",Q.lightLine="#eee",Q.background="#fff",Q.borderLine="#BEC8D9",Q.lightFraction=1e3/11}),li=Ft((Q,$)=>{var c=fo(),g=ra(),P=Va().isTypedArray,S=$.exports={},t=bi();S.defaults=t.defaults;var e=S.defaultLine=t.defaultLine;S.lightLine=t.lightLine;var r=S.background=t.background;S.tinyRGB=function(n){var o=n.toRgb();return"rgb("+Math.round(o.r)+", "+Math.round(o.g)+", "+Math.round(o.b)+")"},S.rgb=function(n){return S.tinyRGB(c(n))},S.opacity=function(n){return n?c(n).getAlpha():0},S.addOpacity=function(n,o){var i=c(n).toRgb();return"rgba("+Math.round(i.r)+", "+Math.round(i.g)+", "+Math.round(i.b)+", "+o+")"},S.combine=function(n,o){var i=c(n).toRgb();if(i.a===1)return c(n).toRgbString();var s=c(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},x={r:f.r*(1-i.a)+i.r*i.a,g:f.g*(1-i.a)+i.g*i.a,b:f.b*(1-i.a)+i.b*i.a};return c(x).toRgbString()},S.interpolate=function(n,o,i){var s=c(n).toRgb(),f=c(o).toRgb(),x={r:i*s.r+(1-i)*f.r,g:i*s.g+(1-i)*f.g,b:i*s.b+(1-i)*f.b};return c(x).toRgbString()},S.contrast=function(n,o,i){var s=c(n);s.getAlpha()!==1&&(s=c(S.combine(n,r)));var f=s.isDark()?o?s.lighten(o):r:i?s.darken(i):e;return f.toString()},S.stroke=function(n,o){var i=c(o);n.style({stroke:S.tinyRGB(i),"stroke-opacity":i.getAlpha()})},S.fill=function(n,o){var i=c(o);n.style({fill:S.tinyRGB(i),"fill-opacity":i.getAlpha()})},S.clean=function(n){if(!(!n||typeof n!="object")){var o=Object.keys(n),i,s,f,x;for(i=0;i<o.length;i++)if(f=o[i],x=n[f],f.substr(f.length-5)==="color")if(Array.isArray(x))for(s=0;s<x.length;s++)x[s]=a(x[s]);else n[f]=a(x);else if(f.substr(f.length-10)==="colorscale"&&Array.isArray(x))for(s=0;s<x.length;s++)Array.isArray(x[s])&&(x[s][1]=a(x[s][1]));else if(Array.isArray(x)){var y=x[0];if(!Array.isArray(y)&&y&&typeof y=="object")for(s=0;s<x.length;s++)S.clean(x[s])}else x&&typeof x=="object"&&!P(x)&&S.clean(x)}};function a(n){if(g(n)||typeof n!="string")return n;var o=n.trim();if(o.substr(0,3)!=="rgb")return n;var i=o.match(/^rgba?\s*\(([^()]*)\)$/);if(!i)return n;var s=i[1].trim().split(/\s*[\s,]\s*/),f=o.charAt(3)==="a"&&s.length===4;if(!f&&s.length!==3)return n;for(var x=0;x<s.length;x++){if(!s[x].length||(s[x]=Number(s[x]),!(s[x]>=0)))return n;if(x===3)s[x]>1&&(s[x]=1);else if(s[x]>=1)return n}var y=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return f?"rgba("+y+", "+s[3]+")":"rgb("+y+")"}}),co=Ft((Q,$)=>{$.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),vo=Ft(Q=>{Q.counter=function($,c,g,P){var S=(c||"")+(g?"":"$"),t=P===!1?"":"^";return $==="xy"?new RegExp(t+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+S):new RegExp(t+$+"([2-9]|[1-9][0-9]+)?"+S)}}),yo=Ft(Q=>{var $=ra(),c=fo(),g=Ta().extendFlat,P=$o(),S=gi(),t=li(),e=co().DESELECTDIM,r=ss(),a=vo().counter,n=qo().modHalf,o=Va().isArrayOrTypedArray,i=Va().isTypedArraySpec,s=Va().decodeTypedArraySpec;Q.valObjectMeta={data_array:{coerceFunction:function(x,y,v){y.set(o(x)?x:i(x)?s(x):v)}},enumerated:{coerceFunction:function(x,y,v,T){T.coerceNumber&&(x=+x),T.values.indexOf(x)===-1?y.set(v):y.set(x)},validateFunction:function(x,y){y.coerceNumber&&(x=+x);for(var v=y.values,T=0;T<v.length;T++){var u=String(v[T]);if(u.charAt(0)==="/"&&u.charAt(u.length-1)==="/"){var b=new RegExp(u.substr(1,u.length-2));if(b.test(x))return!0}else if(x===v[T])return!0}return!1}},boolean:{coerceFunction:function(x,y,v){x===!0||x===!1?y.set(x):y.set(v)}},number:{coerceFunction:function(x,y,v,T){i(x)&&(x=s(x)),!$(x)||T.min!==void 0&&x<T.min||T.max!==void 0&&x>T.max?y.set(v):y.set(+x)}},integer:{coerceFunction:function(x,y,v,T){if((T.extras||[]).indexOf(x)!==-1){y.set(x);return}i(x)&&(x=s(x)),x%1||!$(x)||T.min!==void 0&&x<T.min||T.max!==void 0&&x>T.max?y.set(v):y.set(+x)}},string:{coerceFunction:function(x,y,v,T){if(typeof x!="string"){var u=typeof x=="number";T.strict===!0||!u?y.set(v):y.set(String(x))}else T.noBlank&&!x?y.set(v):y.set(x)}},color:{coerceFunction:function(x,y,v){i(x)&&(x=s(x)),c(x).isValid()?y.set(x):y.set(v)}},colorlist:{coerceFunction:function(x,y,v){function T(u){return c(u).isValid()}!Array.isArray(x)||!x.length?y.set(v):x.every(T)?y.set(x):y.set(v)}},colorscale:{coerceFunction:function(x,y,v){y.set(S.get(x,v))}},angle:{coerceFunction:function(x,y,v){i(x)&&(x=s(x)),x==="auto"?y.set("auto"):$(x)?y.set(n(+x,360)):y.set(v)}},subplotid:{coerceFunction:function(x,y,v,T){var u=T.regex||a(v);if(typeof x=="string"&&u.test(x)){y.set(x);return}y.set(v)},validateFunction:function(x,y){var v=y.dflt;return x===v?!0:typeof x!="string"?!1:!!a(v).test(x)}},flaglist:{coerceFunction:function(x,y,v,T){if((T.extras||[]).indexOf(x)!==-1){y.set(x);return}if(typeof x!="string"){y.set(v);return}for(var u=x.split("+"),b=0;b<u.length;){var _=u[b];T.flags.indexOf(_)===-1||u.indexOf(_)<b?u.splice(b,1):b++}u.length?y.set(u.join("+")):y.set(v)}},any:{coerceFunction:function(x,y,v){x===void 0?y.set(v):y.set(i(x)?s(x):x)}},info_array:{coerceFunction:function(x,y,v,T){function u(V,H,F){var U,W={set:function(q){U=q}};return F===void 0&&(F=H.dflt),Q.valObjectMeta[H.valType].coerceFunction(V,W,F,H),U}if(i(x)&&(x=s(x)),!o(x)){y.set(v);return}var b=T.dimensions===2||T.dimensions==="1-2"&&Array.isArray(x)&&o(x[0]),_=T.items,C=[],M=Array.isArray(_),E=M&&b&&o(_[0]),A=b&&M&&!E,h=M&&!A?_.length:x.length,p,k,w,R,O,N;if(v=Array.isArray(v)?v:[],b)for(p=0;p<h;p++)for(C[p]=[],w=o(x[p])?x[p]:[],A?O=_.length:M?O=_[p].length:O=w.length,k=0;k<O;k++)A?R=_[k]:M?R=_[p][k]:R=_,N=u(w[k],R,(v[p]||[])[k]),N!==void 0&&(C[p][k]=N);else for(p=0;p<h;p++)N=u(x[p],M?_[p]:_,v[p]),N!==void 0&&(C[p]=N);y.set(C)},validateFunction:function(x,y){if(!o(x))return!1;var v=y.items,T=Array.isArray(v),u=y.dimensions===2;if(!y.freeLength&&x.length!==v.length)return!1;for(var b=0;b<x.length;b++)if(u){if(!o(x[b])||!y.freeLength&&x[b].length!==v[b].length)return!1;for(var _=0;_<x[b].length;_++)if(!f(x[b][_],T?v[b][_]:v))return!1}else if(!f(x[b],T?v[b]:v))return!1;return!0}}},Q.coerce=function(x,y,v,T,u){var b=r(v,T).get(),_=r(x,T),C=r(y,T),M=_.get(),E=y._template;if(M===void 0&&E&&(M=r(E,T).get(),E=0),u===void 0&&(u=b.dflt),b.arrayOk){if(o(M))return C.set(M),M;if(i(M))return M=s(M),C.set(M),M}var A=Q.valObjectMeta[b.valType].coerceFunction;A(M,C,u,b);var h=C.get();return E&&h===u&&!f(M,b)&&(M=r(E,T).get(),A(M,C,u,b),h=C.get()),h},Q.coerce2=function(x,y,v,T,u){var b=r(x,T),_=Q.coerce(x,y,v,T,u),C=b.get();return C!=null?_:!1},Q.coerceFont=function(x,y,v,T){T||(T={}),v=g({},v),v=g(v,T.overrideDflt||{});var u={family:x(y+".family",v.family),size:x(y+".size",v.size),color:x(y+".color",v.color),weight:x(y+".weight",v.weight),style:x(y+".style",v.style)};if(T.noFontVariant||(u.variant=x(y+".variant",v.variant)),T.noFontLineposition||(u.lineposition=x(y+".lineposition",v.lineposition)),T.noFontTextcase||(u.textcase=x(y+".textcase",v.textcase)),!T.noFontShadow){var b=v.shadow;b==="none"&&T.autoShadowDflt&&(b="auto"),u.shadow=x(y+".shadow",b)}return u},Q.coercePattern=function(x,y,v,T){var u=x(y+".shape"),b;if(u||(b=x(y+".path")),u||b){u&&x(y+".solidity"),x(y+".size");var _=x(y+".fillmode"),C=_==="overlay";if(!T){var M=x(y+".bgcolor",C?v:void 0);x(y+".fgcolor",C?t.contrast(M):v)}x(y+".fgopacity",C?.5:1)}},Q.coerceHoverinfo=function(x,y,v){var T=y._module.attributes,u=T.hoverinfo?T:P,b=u.hoverinfo,_;if(v._dataLength===1){var C=b.dflt==="all"?b.flags.slice():b.dflt.split("+");C.splice(C.indexOf("name"),1),_=C.join("+")}return Q.coerce(x,y,u,"hoverinfo",_)},Q.coerceSelectionMarkerOpacity=function(x,y){if(x.marker){var v=x.marker.opacity;if(v!==void 0){var T,u;!o(v)&&!x.selected&&!x.unselected&&(T=v,u=e*v),y("selected.marker.opacity",T),y("unselected.marker.opacity",u)}}};function f(x,y){var v=Q.valObjectMeta[y.valType];if(y.arrayOk&&o(x))return!0;if(v.validateFunction)return v.validateFunction(x,y);var T={},u=T,b={set:function(_){u=_}};return v.coerceFunction(x,b,T,y),u!==T}Q.validate=f}),ms=Ft((Q,$)=>{var c={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/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:{}}},g={};function P(S,t){for(var e in S){var r=S[e];r.valType?t[e]=r.dflt:(t[e]||(t[e]={}),P(r,t[e]))}}P(c,g),$.exports={configAttributes:c,dfltConfig:g}}),ns=Ft((Q,$)=>{var c=un(),g=ra(),P=[];$.exports=function(S,t){if(P.indexOf(S)!==-1)return;P.push(S);var e=1e3;g(t)?e=t:t==="long"&&(e=3e3);var r=c.select("body").selectAll(".plotly-notifier").data([0]);r.enter().append("div").classed("plotly-notifier",!0);var a=r.selectAll(".notifier-note").data(P);function n(o){o.duration(700).style("opacity",0).each("end",function(i){var s=P.indexOf(i);s!==-1&&P.splice(s,1),c.select(this).remove()})}a.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(o){var i=c.select(this);i.append("button").classed("notifier-close",!0).html("&times;").on("click",function(){i.transition().call(n)});for(var s=i.append("p"),f=o.split(/<br\s*\/?>/g),x=0;x<f.length;x++)x&&s.append("br"),s.append("span").text(f[x]);t==="stick"?i.transition().duration(350).style("opacity",1):i.transition().duration(700).style("opacity",1).transition().delay(e).call(n)})}}),Ko=Ft((Q,$)=>{var c=ms().dfltConfig,g=ns(),P=$.exports={};P.log=function(){var S;if(c.logging>1){var t=["LOG:"];for(S=0;S<arguments.length;S++)t.push(arguments[S]);console.trace.apply(console,t)}if(c.notifyOnLogging>1){var e=[];for(S=0;S<arguments.length;S++)e.push(arguments[S]);g(e.join("<br>"),"long")}},P.warn=function(){var S;if(c.logging>0){var t=["WARN:"];for(S=0;S<arguments.length;S++)t.push(arguments[S]);console.trace.apply(console,t)}if(c.notifyOnLogging>0){var e=[];for(S=0;S<arguments.length;S++)e.push(arguments[S]);g(e.join("<br>"),"stick")}},P.error=function(){var S;if(c.logging>0){var t=["ERROR:"];for(S=0;S<arguments.length;S++)t.push(arguments[S]);console.error.apply(console,t)}if(c.notifyOnLogging>0){var e=[];for(S=0;S<arguments.length;S++)e.push(arguments[S]);g(e.join("<br>"),"stick")}}}),Oo=Ft((Q,$)=>{$.exports=function(){}}),wl=Ft((Q,$)=>{$.exports=function(c,g){if(g instanceof RegExp){for(var P=g.toString(),S=0;S<c.length;S++)if(c[S]instanceof RegExp&&c[S].toString()===P)return c;c.push(g)}else(g||g===0)&&c.indexOf(g)===-1&&c.push(g);return c}}),ws=Ft((Q,$)=>{$.exports=c;function c(){var g=new Float32Array(16);return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),Il=Ft((Q,$)=>{$.exports=c;function c(g){var P=new Float32Array(16);return P[0]=g[0],P[1]=g[1],P[2]=g[2],P[3]=g[3],P[4]=g[4],P[5]=g[5],P[6]=g[6],P[7]=g[7],P[8]=g[8],P[9]=g[9],P[10]=g[10],P[11]=g[11],P[12]=g[12],P[13]=g[13],P[14]=g[14],P[15]=g[15],P}}),du=Ft((Q,$)=>{$.exports=c;function c(g,P){return g[0]=P[0],g[1]=P[1],g[2]=P[2],g[3]=P[3],g[4]=P[4],g[5]=P[5],g[6]=P[6],g[7]=P[7],g[8]=P[8],g[9]=P[9],g[10]=P[10],g[11]=P[11],g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15],g}}),Hu=Ft((Q,$)=>{$.exports=c;function c(g){return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),Fc=Ft((Q,$)=>{$.exports=c;function c(g,P){if(g===P){var S=P[1],t=P[2],e=P[3],r=P[6],a=P[7],n=P[11];g[1]=P[4],g[2]=P[8],g[3]=P[12],g[4]=S,g[6]=P[9],g[7]=P[13],g[8]=t,g[9]=r,g[11]=P[14],g[12]=e,g[13]=a,g[14]=n}else g[0]=P[0],g[1]=P[4],g[2]=P[8],g[3]=P[12],g[4]=P[1],g[5]=P[5],g[6]=P[9],g[7]=P[13],g[8]=P[2],g[9]=P[6],g[10]=P[10],g[11]=P[14],g[12]=P[3],g[13]=P[7],g[14]=P[11],g[15]=P[15];return g}}),kc=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=P[0],t=P[1],e=P[2],r=P[3],a=P[4],n=P[5],o=P[6],i=P[7],s=P[8],f=P[9],x=P[10],y=P[11],v=P[12],T=P[13],u=P[14],b=P[15],_=S*n-t*a,C=S*o-e*a,M=S*i-r*a,E=t*o-e*n,A=t*i-r*n,h=e*i-r*o,p=s*T-f*v,k=s*u-x*v,w=s*b-y*v,R=f*u-x*T,O=f*b-y*T,N=x*b-y*u,V=_*N-C*O+M*R+E*w-A*k+h*p;return V?(V=1/V,g[0]=(n*N-o*O+i*R)*V,g[1]=(e*O-t*N-r*R)*V,g[2]=(T*h-u*A+b*E)*V,g[3]=(x*A-f*h-y*E)*V,g[4]=(o*w-a*N-i*k)*V,g[5]=(S*N-e*w+r*k)*V,g[6]=(u*M-v*h-b*C)*V,g[7]=(s*h-x*M+y*C)*V,g[8]=(a*O-n*w+i*p)*V,g[9]=(t*w-S*O-r*p)*V,g[10]=(v*A-T*M+b*_)*V,g[11]=(f*M-s*A-y*_)*V,g[12]=(n*k-a*R-o*p)*V,g[13]=(S*R-t*k+e*p)*V,g[14]=(T*C-v*E-u*_)*V,g[15]=(s*E-f*C+x*_)*V,g):null}}),Vd=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=P[0],t=P[1],e=P[2],r=P[3],a=P[4],n=P[5],o=P[6],i=P[7],s=P[8],f=P[9],x=P[10],y=P[11],v=P[12],T=P[13],u=P[14],b=P[15];return g[0]=n*(x*b-y*u)-f*(o*b-i*u)+T*(o*y-i*x),g[1]=-(t*(x*b-y*u)-f*(e*b-r*u)+T*(e*y-r*x)),g[2]=t*(o*b-i*u)-n*(e*b-r*u)+T*(e*i-r*o),g[3]=-(t*(o*y-i*x)-n*(e*y-r*x)+f*(e*i-r*o)),g[4]=-(a*(x*b-y*u)-s*(o*b-i*u)+v*(o*y-i*x)),g[5]=S*(x*b-y*u)-s*(e*b-r*u)+v*(e*y-r*x),g[6]=-(S*(o*b-i*u)-a*(e*b-r*u)+v*(e*i-r*o)),g[7]=S*(o*y-i*x)-a*(e*y-r*x)+s*(e*i-r*o),g[8]=a*(f*b-y*T)-s*(n*b-i*T)+v*(n*y-i*f),g[9]=-(S*(f*b-y*T)-s*(t*b-r*T)+v*(t*y-r*f)),g[10]=S*(n*b-i*T)-a*(t*b-r*T)+v*(t*i-r*n),g[11]=-(S*(n*y-i*f)-a*(t*y-r*f)+s*(t*i-r*n)),g[12]=-(a*(f*u-x*T)-s*(n*u-o*T)+v*(n*x-o*f)),g[13]=S*(f*u-x*T)-s*(t*u-e*T)+v*(t*x-e*f),g[14]=-(S*(n*u-o*T)-a*(t*u-e*T)+v*(t*o-e*n)),g[15]=S*(n*x-o*f)-a*(t*x-e*f)+s*(t*o-e*n),g}}),kd=Ft((Q,$)=>{$.exports=c;function c(g){var P=g[0],S=g[1],t=g[2],e=g[3],r=g[4],a=g[5],n=g[6],o=g[7],i=g[8],s=g[9],f=g[10],x=g[11],y=g[12],v=g[13],T=g[14],u=g[15],b=P*a-S*r,_=P*n-t*r,C=P*o-e*r,M=S*n-t*a,E=S*o-e*a,A=t*o-e*n,h=i*v-s*y,p=i*T-f*y,k=i*u-x*y,w=s*T-f*v,R=s*u-x*v,O=f*u-x*T;return b*O-_*R+C*w+M*k-E*p+A*h}}),e0=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=P[0],e=P[1],r=P[2],a=P[3],n=P[4],o=P[5],i=P[6],s=P[7],f=P[8],x=P[9],y=P[10],v=P[11],T=P[12],u=P[13],b=P[14],_=P[15],C=S[0],M=S[1],E=S[2],A=S[3];return g[0]=C*t+M*n+E*f+A*T,g[1]=C*e+M*o+E*x+A*u,g[2]=C*r+M*i+E*y+A*b,g[3]=C*a+M*s+E*v+A*_,C=S[4],M=S[5],E=S[6],A=S[7],g[4]=C*t+M*n+E*f+A*T,g[5]=C*e+M*o+E*x+A*u,g[6]=C*r+M*i+E*y+A*b,g[7]=C*a+M*s+E*v+A*_,C=S[8],M=S[9],E=S[10],A=S[11],g[8]=C*t+M*n+E*f+A*T,g[9]=C*e+M*o+E*x+A*u,g[10]=C*r+M*i+E*y+A*b,g[11]=C*a+M*s+E*v+A*_,C=S[12],M=S[13],E=S[14],A=S[15],g[12]=C*t+M*n+E*f+A*T,g[13]=C*e+M*o+E*x+A*u,g[14]=C*r+M*i+E*y+A*b,g[15]=C*a+M*s+E*v+A*_,g}}),d0=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=S[0],e=S[1],r=S[2],a,n,o,i,s,f,x,y,v,T,u,b;return P===g?(g[12]=P[0]*t+P[4]*e+P[8]*r+P[12],g[13]=P[1]*t+P[5]*e+P[9]*r+P[13],g[14]=P[2]*t+P[6]*e+P[10]*r+P[14],g[15]=P[3]*t+P[7]*e+P[11]*r+P[15]):(a=P[0],n=P[1],o=P[2],i=P[3],s=P[4],f=P[5],x=P[6],y=P[7],v=P[8],T=P[9],u=P[10],b=P[11],g[0]=a,g[1]=n,g[2]=o,g[3]=i,g[4]=s,g[5]=f,g[6]=x,g[7]=y,g[8]=v,g[9]=T,g[10]=u,g[11]=b,g[12]=a*t+s*e+v*r+P[12],g[13]=n*t+f*e+T*r+P[13],g[14]=o*t+x*e+u*r+P[14],g[15]=i*t+y*e+b*r+P[15]),g}}),Pm=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=S[0],e=S[1],r=S[2];return g[0]=P[0]*t,g[1]=P[1]*t,g[2]=P[2]*t,g[3]=P[3]*t,g[4]=P[4]*e,g[5]=P[5]*e,g[6]=P[6]*e,g[7]=P[7]*e,g[8]=P[8]*r,g[9]=P[9]*r,g[10]=P[10]*r,g[11]=P[11]*r,g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15],g}}),uv=Ft((Q,$)=>{$.exports=c;function c(g,P,S,t){var e=t[0],r=t[1],a=t[2],n=Math.sqrt(e*e+r*r+a*a),o,i,s,f,x,y,v,T,u,b,_,C,M,E,A,h,p,k,w,R,O,N,V,H;return Math.abs(n)<1e-6?null:(n=1/n,e*=n,r*=n,a*=n,o=Math.sin(S),i=Math.cos(S),s=1-i,f=P[0],x=P[1],y=P[2],v=P[3],T=P[4],u=P[5],b=P[6],_=P[7],C=P[8],M=P[9],E=P[10],A=P[11],h=e*e*s+i,p=r*e*s+a*o,k=a*e*s-r*o,w=e*r*s-a*o,R=r*r*s+i,O=a*r*s+e*o,N=e*a*s+r*o,V=r*a*s-e*o,H=a*a*s+i,g[0]=f*h+T*p+C*k,g[1]=x*h+u*p+M*k,g[2]=y*h+b*p+E*k,g[3]=v*h+_*p+A*k,g[4]=f*w+T*R+C*O,g[5]=x*w+u*R+M*O,g[6]=y*w+b*R+E*O,g[7]=v*w+_*R+A*O,g[8]=f*N+T*V+C*H,g[9]=x*N+u*V+M*H,g[10]=y*N+b*V+E*H,g[11]=v*N+_*V+A*H,P!==g&&(g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15]),g)}}),sp=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=Math.sin(S),e=Math.cos(S),r=P[4],a=P[5],n=P[6],o=P[7],i=P[8],s=P[9],f=P[10],x=P[11];return P!==g&&(g[0]=P[0],g[1]=P[1],g[2]=P[2],g[3]=P[3],g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15]),g[4]=r*e+i*t,g[5]=a*e+s*t,g[6]=n*e+f*t,g[7]=o*e+x*t,g[8]=i*e-r*t,g[9]=s*e-a*t,g[10]=f*e-n*t,g[11]=x*e-o*t,g}}),p0=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=Math.sin(S),e=Math.cos(S),r=P[0],a=P[1],n=P[2],o=P[3],i=P[8],s=P[9],f=P[10],x=P[11];return P!==g&&(g[4]=P[4],g[5]=P[5],g[6]=P[6],g[7]=P[7],g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15]),g[0]=r*e-i*t,g[1]=a*e-s*t,g[2]=n*e-f*t,g[3]=o*e-x*t,g[8]=r*t+i*e,g[9]=a*t+s*e,g[10]=n*t+f*e,g[11]=o*t+x*e,g}}),zm=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=Math.sin(S),e=Math.cos(S),r=P[0],a=P[1],n=P[2],o=P[3],i=P[4],s=P[5],f=P[6],x=P[7];return P!==g&&(g[8]=P[8],g[9]=P[9],g[10]=P[10],g[11]=P[11],g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15]),g[0]=r*e+i*t,g[1]=a*e+s*t,g[2]=n*e+f*t,g[3]=o*e+x*t,g[4]=i*e-r*t,g[5]=s*e-a*t,g[6]=f*e-n*t,g[7]=x*e-o*t,g}}),zy=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t,e,r,a=S[0],n=S[1],o=S[2],i=Math.sqrt(a*a+n*n+o*o);return Math.abs(i)<1e-6?null:(i=1/i,a*=i,n*=i,o*=i,t=Math.sin(P),e=Math.cos(P),r=1-e,g[0]=a*a*r+e,g[1]=n*a*r+o*t,g[2]=o*a*r-n*t,g[3]=0,g[4]=a*n*r-o*t,g[5]=n*n*r+e,g[6]=o*n*r+a*t,g[7]=0,g[8]=a*o*r+n*t,g[9]=n*o*r-a*t,g[10]=o*o*r+e,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g)}}),K4=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=P[0],e=P[1],r=P[2],a=P[3],n=t+t,o=e+e,i=r+r,s=t*n,f=t*o,x=t*i,y=e*o,v=e*i,T=r*i,u=a*n,b=a*o,_=a*i;return g[0]=1-(y+T),g[1]=f+_,g[2]=x-b,g[3]=0,g[4]=f-_,g[5]=1-(s+T),g[6]=v+u,g[7]=0,g[8]=x+b,g[9]=v-u,g[10]=1-(s+y),g[11]=0,g[12]=S[0],g[13]=S[1],g[14]=S[2],g[15]=1,g}}),sw=Ft((Q,$)=>{$.exports=c;function c(g,P){return g[0]=P[0],g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=P[1],g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=P[2],g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),lw=Ft((Q,$)=>{$.exports=c;function c(g,P){return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=P[0],g[13]=P[1],g[14]=P[2],g[15]=1,g}}),uw=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=Math.sin(P),t=Math.cos(P);return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=t,g[6]=S,g[7]=0,g[8]=0,g[9]=-S,g[10]=t,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),X4=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=Math.sin(P),t=Math.cos(P);return g[0]=t,g[1]=0,g[2]=-S,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=S,g[9]=0,g[10]=t,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),J4=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=Math.sin(P),t=Math.cos(P);return g[0]=t,g[1]=S,g[2]=0,g[3]=0,g[4]=-S,g[5]=t,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),Q4=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=P[0],t=P[1],e=P[2],r=P[3],a=S+S,n=t+t,o=e+e,i=S*a,s=t*a,f=t*n,x=e*a,y=e*n,v=e*o,T=r*a,u=r*n,b=r*o;return g[0]=1-f-v,g[1]=s+b,g[2]=x-u,g[3]=0,g[4]=s-b,g[5]=1-i-v,g[6]=y+T,g[7]=0,g[8]=x+u,g[9]=y-T,g[10]=1-i-f,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),t6=Ft((Q,$)=>{$.exports=c;function c(g,P,S,t,e,r,a){var n=1/(S-P),o=1/(e-t),i=1/(r-a);return g[0]=r*2*n,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=r*2*o,g[6]=0,g[7]=0,g[8]=(S+P)*n,g[9]=(e+t)*o,g[10]=(a+r)*i,g[11]=-1,g[12]=0,g[13]=0,g[14]=a*r*2*i,g[15]=0,g}}),e6=Ft((Q,$)=>{$.exports=c;function c(g,P,S,t,e){var r=1/Math.tan(P/2),a=1/(t-e);return g[0]=r/S,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=r,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=(e+t)*a,g[11]=-1,g[12]=0,g[13]=0,g[14]=2*e*t*a,g[15]=0,g}}),r6=Ft((Q,$)=>{$.exports=c;function c(g,P,S,t){var e=Math.tan(P.upDegrees*Math.PI/180),r=Math.tan(P.downDegrees*Math.PI/180),a=Math.tan(P.leftDegrees*Math.PI/180),n=Math.tan(P.rightDegrees*Math.PI/180),o=2/(a+n),i=2/(e+r);return g[0]=o,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=i,g[6]=0,g[7]=0,g[8]=-((a-n)*o*.5),g[9]=(e-r)*i*.5,g[10]=t/(S-t),g[11]=-1,g[12]=0,g[13]=0,g[14]=t*S/(S-t),g[15]=0,g}}),b_=Ft((Q,$)=>{$.exports=c;function c(g,P,S,t,e,r,a){var n=1/(P-S),o=1/(t-e),i=1/(r-a);return g[0]=-2*n,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=-2*o,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=2*i,g[11]=0,g[12]=(P+S)*n,g[13]=(e+t)*o,g[14]=(a+r)*i,g[15]=1,g}}),n6=Ft((Q,$)=>{var c=Hu();$.exports=g;function g(P,S,t,e){var r,a,n,o,i,s,f,x,y,v,T=S[0],u=S[1],b=S[2],_=e[0],C=e[1],M=e[2],E=t[0],A=t[1],h=t[2];return Math.abs(T-E)<1e-6&&Math.abs(u-A)<1e-6&&Math.abs(b-h)<1e-6?c(P):(f=T-E,x=u-A,y=b-h,v=1/Math.sqrt(f*f+x*x+y*y),f*=v,x*=v,y*=v,r=C*y-M*x,a=M*f-_*y,n=_*x-C*f,v=Math.sqrt(r*r+a*a+n*n),v?(v=1/v,r*=v,a*=v,n*=v):(r=0,a=0,n=0),o=x*n-y*a,i=y*r-f*n,s=f*a-x*r,v=Math.sqrt(o*o+i*i+s*s),v?(v=1/v,o*=v,i*=v,s*=v):(o=0,i=0,s=0),P[0]=r,P[1]=o,P[2]=f,P[3]=0,P[4]=a,P[5]=i,P[6]=x,P[7]=0,P[8]=n,P[9]=s,P[10]=y,P[11]=0,P[12]=-(r*T+a*u+n*b),P[13]=-(o*T+i*u+s*b),P[14]=-(f*T+x*u+y*b),P[15]=1,P)}}),i6=Ft((Q,$)=>{$.exports=c;function c(g){return"mat4("+g[0]+", "+g[1]+", "+g[2]+", "+g[3]+", "+g[4]+", "+g[5]+", "+g[6]+", "+g[7]+", "+g[8]+", "+g[9]+", "+g[10]+", "+g[11]+", "+g[12]+", "+g[13]+", "+g[14]+", "+g[15]+")"}}),cw=Ft((Q,$)=>{$.exports={create:ws(),clone:Il(),copy:du(),identity:Hu(),transpose:Fc(),invert:kc(),adjoint:Vd(),determinant:kd(),multiply:e0(),translate:d0(),scale:Pm(),rotate:uv(),rotateX:sp(),rotateY:p0(),rotateZ:zm(),fromRotation:zy(),fromRotationTranslation:K4(),fromScaling:sw(),fromTranslation:lw(),fromXRotation:uw(),fromYRotation:X4(),fromZRotation:J4(),fromQuat:Q4(),frustum:t6(),perspective:e6(),perspectiveFromFieldOfView:r6(),ortho:b_(),lookAt:n6(),str:i6()}}),w_=Ft(Q=>{var $=cw();Q.init2dArray=function(c,g){for(var P=new Array(c),S=0;S<c;S++)P[S]=new Array(g);return P},Q.transposeRagged=function(c){var g=0,P=c.length,S,t;for(S=0;S<P;S++)g=Math.max(g,c[S].length);var e=new Array(g);for(S=0;S<g;S++)for(e[S]=new Array(P),t=0;t<P;t++)e[S][t]=c[t][S];return e},Q.dot=function(c,g){if(!(c.length&&g.length)||c.length!==g.length)return null;var P=c.length,S,t;if(c[0].length)for(S=new Array(P),t=0;t<P;t++)S[t]=Q.dot(c[t],g);else if(g[0].length){var e=Q.transposeRagged(g);for(S=new Array(e.length),t=0;t<e.length;t++)S[t]=Q.dot(c,e[t])}else for(S=0,t=0;t<P;t++)S+=c[t]*g[t];return S},Q.translationMatrix=function(c,g){return[[1,0,c],[0,1,g],[0,0,1]]},Q.rotationMatrix=function(c){var g=c*Math.PI/180;return[[Math.cos(g),-Math.sin(g),0],[Math.sin(g),Math.cos(g),0],[0,0,1]]},Q.rotationXYMatrix=function(c,g,P){return Q.dot(Q.dot(Q.translationMatrix(g,P),Q.rotationMatrix(c)),Q.translationMatrix(-g,-P))},Q.apply3DTransform=function(c){return function(){var g=arguments,P=arguments.length===1?g[0]:[g[0],g[1],g[2]||0];return Q.dot(c,[P[0],P[1],P[2],1]).slice(0,3)}},Q.apply2DTransform=function(c){return function(){var g=arguments;g.length===3&&(g=g[0]);var P=arguments.length===1?g[0]:[g[0],g[1]];return Q.dot(c,[P[0],P[1],1]).slice(0,2)}},Q.apply2DTransform2=function(c){var g=Q.apply2DTransform(c);return function(P){return g(P.slice(0,2)).concat(g(P.slice(2,4)))}},Q.convertCssMatrix=function(c){if(c){var g=c.length;if(g===16)return c;if(g===6)return[c[0],c[1],0,0,c[2],c[3],0,0,0,0,1,0,c[4],c[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Q.inverseTransformMatrix=function(c){var g=[];return $.invert(g,c),[[g[0],g[1],g[2],g[3]],[g[4],g[5],g[6],g[7]],[g[8],g[9],g[10],g[11]],[g[12],g[13],g[14],g[15]]]}}),r0=Ft((Q,$)=>{var c=un(),g=Ko(),P=w_(),S=cw();function t(T){var u;if(typeof T=="string"){if(u=document.getElementById(T),u===null)throw new Error("No DOM element with id '"+T+"' exists on the page.");return u}else if(T==null)throw new Error("DOM element provided is null or undefined");return T}function e(T){var u=c.select(T);return u.node()instanceof HTMLElement&&u.size()&&u.classed("js-plotly-plot")}function r(T){var u=T&&T.parentNode;u&&u.removeChild(T)}function a(T,u){n("global",T,u)}function n(T,u,b){var _="plotly.js-style-"+T,C=document.getElementById(_);if(!(C&&C.matches(".no-inline-styles"))){C||(C=document.createElement("style"),C.setAttribute("id",_),C.appendChild(document.createTextNode("")),document.head.appendChild(C));var M=C.sheet;M?M.insertRule?M.insertRule(u+"{"+b+"}",0):M.addRule?M.addRule(u,b,0):g.warn("addStyleRule failed"):g.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function o(T){var u="plotly.js-style-"+T,b=document.getElementById(u);b&&r(b)}function i(T,u,b,_,C,M){var E=_.split(":"),A=C.split(":"),h="data-btn-style-event-added";M||(M=document),M.querySelectorAll(T).forEach(function(p){p.getAttribute(h)||(p.addEventListener("mouseenter",function(){var k=this.querySelector(b);k&&(k.style[E[0]]=E[1])}),p.addEventListener("mouseleave",function(){var k=this.querySelector(b);k&&(u&&this.matches(u)?k.style[E[0]]=E[1]:k.style[A[0]]=A[1])}),p.setAttribute(h,!0))})}function s(T){var u=x(T),b=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return u.forEach(function(_){var C=f(_);if(C){var M=P.convertCssMatrix(C);b=S.multiply(b,b,M)}}),b}function f(T){var u=window.getComputedStyle(T,null),b=u.getPropertyValue("-webkit-transform")||u.getPropertyValue("-moz-transform")||u.getPropertyValue("-ms-transform")||u.getPropertyValue("-o-transform")||u.getPropertyValue("transform");return b==="none"?null:b.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(_){return+_})}function x(T){for(var u=[];y(T);)u.push(T),T=T.parentNode,typeof ShadowRoot=="function"&&T instanceof ShadowRoot&&(T=T.host);return u}function y(T){return T&&(T instanceof Element||T instanceof HTMLElement)}function v(T,u){return T&&u&&T.top===u.top&&T.left===u.left&&T.right===u.right&&T.bottom===u.bottom}$.exports={getGraphDiv:t,isPlotDiv:e,removeElement:r,addStyleRule:a,addRelatedStyleRule:n,deleteRelatedStyleRule:o,setStyleOnHover:i,getFullTransformMatrix:s,getElementTransformMatrix:f,getElementAndAncestors:x,equalDomRects:v}}),El=Ft((Q,$)=>{$.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"}}}}),Yc=Ft((Q,$)=>{var c=Ta().extendFlat,g=Ei(),P={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},S={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},t=P.flags.slice().concat(["fullReplot"]),e=S.flags.slice().concat("layoutReplot");$.exports={traces:P,layout:S,traceFlags:function(){return r(t)},layoutFlags:function(){return r(e)},update:function(o,i){var s=i.editType;if(s&&s!=="none")for(var f=s.split("+"),x=0;x<f.length;x++)o[f[x]]=!0},overrideAll:a};function r(o){for(var i={},s=0;s<o.length;s++)i[o[s]]=!1;return i}function a(o,i,s){var f=c({},o);for(var x in f){var y=f[x];g(y)&&(f[x]=n(y,i,s,x))}return s==="from-root"&&(f.editType=i),f}function n(o,i,s,f){if(o.valType){var x=c({},o);if(x.editType=i,Array.isArray(o.items)){x.items=new Array(o.items.length);for(var y=0;y<o.items.length;y++)x.items[y]=n(o.items[y],i)}return x}else return a(o,i,f.charAt(0)==="_"?"nested":"from-root")}}),Td=Ft(Q=>{Q.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},Q.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"}}),k_=Ft((Q,$)=>{$.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"}}),$u=Ft(Q=>{var{DATE_FORMAT_LINK:$,FORMAT_LINK:c}=k_(),g=["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 P({supportOther:S}={}){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(S?" 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}".`,c,"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}".`,$,"for details on the date formatting syntax.",g].join(" ")}Q.templateFormatStringDescription=P,Q.hovertemplateAttrs=({editType:S="none",arrayOk:t}={},e={})=>Fr({valType:"string",dflt:"",editType:S},t!==!1?{arrayOk:!0}:{}),Q.texttemplateAttrs=({editType:S="calc",arrayOk:t}={},e={})=>Fr({valType:"string",dflt:"",editType:S},t!==!1?{arrayOk:!0}:{}),Q.shapeTexttemplateAttrs=({editType:S="arraydraw",newshape:t}={},e={})=>({valType:"string",dflt:"",editType:S}),Q.templatefallbackAttrs=({editType:S="none"}={})=>({valType:"any",dflt:"-",editType:S})}),y1=Ft((Q,$)=>{function c(b,_){return _?_.d2l(b):b}function g(b,_){return _?_.l2d(b):b}function P(b){return b.x0}function S(b){return b.x1}function t(b){return b.y0}function e(b){return b.y1}function r(b){return b.x0shift||0}function a(b){return b.x1shift||0}function n(b){return b.y0shift||0}function o(b){return b.y1shift||0}function i(b,_){return c(b.x1,_)+a(b)-c(b.x0,_)-r(b)}function s(b,_,C){return c(b.y1,C)+o(b)-c(b.y0,C)-n(b)}function f(b,_){return Math.abs(i(b,_))}function x(b,_,C){return Math.abs(s(b,_,C))}function y(b,_,C){return b.type!=="line"?void 0:Math.sqrt(Math.pow(i(b,_),2)+Math.pow(s(b,_,C),2))}function v(b,_){return g((c(b.x1,_)+a(b)+c(b.x0,_)+r(b))/2,_)}function T(b,_,C){return g((c(b.y1,C)+o(b)+c(b.y0,C)+n(b))/2,C)}function u(b,_,C){return b.type!=="line"?void 0:s(b,_,C)/i(b,_)}$.exports={x0:P,x1:S,y0:t,y1:e,slope:u,dx:i,dy:s,width:f,height:x,length:y,xcenter:v,ycenter:T}}),hw=Ft((Q,$)=>{var c=Yc().overrideAll,g=$o(),P=Ea(),S=Td().dash,t=Ta().extendFlat,{shapeTexttemplateAttrs:e,templatefallbackAttrs:r}=$u(),a=y1();$.exports=c({newshape:{visible:t({},g.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:t({},g.legend,{}),legendgroup:t({},g.legendgroup,{}),legendgrouptitle:{text:t({},g.legendgrouptitle.text,{}),font:P({})},legendrank:t({},g.legendrank,{}),legendwidth:t({},g.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:t({},S,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:t({},g.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:e({newshape:!0},{keys:Object.keys(a)}),texttemplatefallback:r({editType:"arraydraw"}),font:P({}),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")}),cv=Ft((Q,$)=>{var c=Td().dash,g=Ta().extendFlat;$.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:g({},c,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}),Iy=Ft((Q,$)=>{$.exports=function(c){var g=c.editType;return{t:{valType:"number",dflt:0,editType:g},r:{valType:"number",dflt:0,editType:g},b:{valType:"number",dflt:0,editType:g},l:{valType:"number",dflt:0,editType:g},editType:g}}}),x1=Ft((Q,$)=>{var c=Ea(),g=El(),P=bi(),S=hw(),t=cv(),e=Iy(),r=Ta().extendFlat,a=c({editType:"calc"});a.family.dflt='"Open Sans", verdana, arial, sans-serif',a.size.dflt=12,a.color.dflt=P.defaultLine,$.exports={font:a,title:{text:{valType:"string",editType:"layoutstyle"},font:c({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:c({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:r(e({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:P.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:P.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:P.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:S.newshape,activeshape:S.activeshape,newselection:t.newselection,activeselection:t.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},g.transition,{editType:"none"})}}),a6=Ft(()=>{(function(){if(!document.getElementById("8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc")){var Q=document.createElement("style");Q.id="8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc",Q.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(Q)}})()}),Xo=Ft(Q=>{var $=Ko(),c=Oo(),g=wl(),P=Ei(),S=r0().addStyleRule,t=Ta(),e=$o(),r=x1(),a=t.extendFlat,n=t.extendDeepAll;Q.modules={},Q.allCategories={},Q.allTypes=[],Q.subplotsRegistry={},Q.componentsRegistry={},Q.layoutArrayContainers=[],Q.layoutArrayRegexes=[],Q.traceLayoutAttributes={},Q.localeRegistry={},Q.apiMethodRegistry={},Q.collectableSubplotTypes=null,Q.register=function(b){if(Q.collectableSubplotTypes=null,b)b&&!Array.isArray(b)&&(b=[b]);else throw new Error("No argument passed to Plotly.register.");for(var _=0;_<b.length;_++){var C=b[_];if(!C)throw new Error("Invalid module was attempted to be registered!");switch(C.moduleType){case"trace":o(C);break;case"transform":f(C);break;case"component":s(C);break;case"locale":x(C);break;case"apiMethod":var M=C.name;Q.apiMethodRegistry[M]=C.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},Q.getModule=function(b){var _=Q.modules[u(b)];return _?_._module:!1},Q.traceIs=function(b,_){if(b=u(b),b==="various")return!1;var C=Q.modules[b];return C||(b&&$.log("Unrecognized trace type "+b+"."),C=Q.modules[e.type.dflt]),!!C.categories[_]},Q.getComponentMethod=function(b,_){var C=Q.componentsRegistry[b];return C&&C[_]||c},Q.call=function(){var b=arguments[0],_=[].slice.call(arguments,1);return Q.apiMethodRegistry[b].apply(null,_)};function o(b){var _=b.name,C=b.categories,M=b.meta;if(Q.modules[_]){$.log("Type "+_+" already registered");return}Q.subplotsRegistry[b.basePlotModule.name]||i(b.basePlotModule);for(var E={},A=0;A<C.length;A++)E[C[A]]=!0,Q.allCategories[C[A]]=!0;Q.modules[_]={_module:b,categories:E},M&&Object.keys(M).length&&(Q.modules[_].meta=M),Q.allTypes.push(_);for(var h in Q.componentsRegistry)v(h,_);b.layoutAttributes&&a(Q.traceLayoutAttributes,b.layoutAttributes);var p=b.basePlotModule,k=p.name;if(k==="mapbox"){var w=p.constants.styleRules;for(var R in w)S(".js-plotly-plot .plotly .mapboxgl-"+R,w[R])}k==="map"&&a6(),(k==="geo"||k==="mapbox"||k==="map")&&window.PlotlyGeoAssets===void 0&&(window.PlotlyGeoAssets={topojson:{}})}function i(b){var _=b.name;if(Q.subplotsRegistry[_]){$.log("Plot type "+_+" already registered.");return}y(b),Q.subplotsRegistry[_]=b;for(var C in Q.componentsRegistry)T(C,b.name)}function s(b){if(typeof b.name!="string")throw new Error("Component module *name* must be a string.");var _=b.name;Q.componentsRegistry[_]=b,b.layoutAttributes&&(b.layoutAttributes._isLinkedToArray&&g(Q.layoutArrayContainers,_),y(b));for(var C in Q.modules)v(_,C);for(var M in Q.subplotsRegistry)T(_,M);b.schema&&b.schema.layout&&n(r,b.schema.layout)}function f(b){if(typeof b.name!="string")throw new Error("Transform module *name* must be a string.");var _="Transform module "+b.name,C=typeof b.transform=="function",M=typeof b.calcTransform=="function";if(!C&&!M)throw new Error(_+" is missing a *transform* or *calcTransform* method.");C&&M&&$.log([_+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),P(b.attributes)||$.log(_+" registered without an *attributes* object."),typeof b.supplyDefaults!="function"&&$.log(_+" registered without a *supplyDefaults* method.")}function x(b){var _=b.name,C=_.split("-")[0],M=b.dictionary,E=b.format,A=M&&Object.keys(M).length,h=E&&Object.keys(E).length,p=Q.localeRegistry,k=p[_];if(k||(p[_]=k={}),C!==_){var w=p[C];w||(p[C]=w={}),A&&w.dictionary===k.dictionary&&(w.dictionary=M),h&&w.format===k.format&&(w.format=E)}A&&(k.dictionary=M),h&&(k.format=E)}function y(b){if(b.layoutAttributes){var _=b.layoutAttributes._arrayAttrRegexps;if(_)for(var C=0;C<_.length;C++)g(Q.layoutArrayRegexes,_[C])}}function v(b,_){var C=Q.componentsRegistry[b].schema;if(!(!C||!C.traces)){var M=C.traces[_];M&&n(Q.modules[_]._module.attributes,M)}}function T(b,_){var C=Q.componentsRegistry[b].schema;if(!(!C||!C.subplots)){var M=Q.subplotsRegistry[_],E=M.layoutAttributes,A=M.attr==="subplot"?M.name:M.attr;Array.isArray(A)&&(A=A[0]);var h=C.subplots[A];E&&h&&n(E,h)}}function u(b){return typeof b=="object"&&(b=b.type),b}}),o6=Ft(Q=>{var $=fa().timeFormat,c=ra(),g=Ko(),P=qo().mod,S=Da(),t=S.BADNUM,e=S.ONEDAY,r=S.ONEHOUR,a=S.ONEMIN,n=S.ONESEC,o=S.EPOCHJD,i=Xo(),s=fa().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,x=/^\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,y=new Date().getFullYear()-70;function v(V){return V&&i.componentsRegistry.calendars&&typeof V=="string"&&V!=="gregorian"}Q.dateTick0=function(V,H){var F=T(V,!!H);if(H<2)return F;var U=Q.dateTime2ms(F,V);return U+=e*(H-1),Q.ms2DateTime(U,0,V)};function T(V,H){return v(V)?H?i.getComponentMethod("calendars","CANONICAL_SUNDAY")[V]:i.getComponentMethod("calendars","CANONICAL_TICK")[V]:H?"2000-01-02":"2000-01-01"}Q.dfltRange=function(V){return v(V)?i.getComponentMethod("calendars","DFLTRANGE")[V]:["2000-01-01","2001-01-01"]},Q.isJSDate=function(V){return typeof V=="object"&&V!==null&&typeof V.getTime=="function"};var u,b;Q.dateTime2ms=function(V,H){if(Q.isJSDate(V)){var F=V.getTimezoneOffset()*a,U=(V.getUTCMinutes()-V.getMinutes())*a+(V.getUTCSeconds()-V.getSeconds())*n+(V.getUTCMilliseconds()-V.getMilliseconds());if(U){var W=3*a;F=F-W/2+P(U-F+W/2,W)}return V=Number(V)-F,V>=u&&V<=b?V:t}if(typeof V!="string"&&typeof V!="number")return t;V=String(V);var q=v(H),X=V.charAt(0);q&&(X==="G"||X==="g")&&(V=V.substr(1),H="");var lt=q&&H.substr(0,7)==="chinese",yt=V.match(lt?x:f);if(!yt)return t;var pt=yt[1],st=yt[3]||"1",tt=Number(yt[5]||1),dt=Number(yt[7]||0),rt=Number(yt[9]||0),at=Number(yt[11]||0);if(q){if(pt.length===2)return t;pt=Number(pt);var vt;try{var it=i.getComponentMethod("calendars","getCal")(H);if(lt){var Y=st.charAt(st.length-1)==="i";st=parseInt(st,10),vt=it.newDate(pt,it.toMonthIndex(pt,st,Y),tt)}else vt=it.newDate(pt,Number(st),tt)}catch{return t}return vt?(vt.toJD()-o)*e+dt*r+rt*a+at*n:t}pt.length===2?pt=(Number(pt)+2e3-y)%100+y:pt=Number(pt),st-=1;var ft=new Date(Date.UTC(2e3,st,tt,dt,rt));return ft.setUTCFullYear(pt),ft.getUTCMonth()!==st||ft.getUTCDate()!==tt?t:ft.getTime()+at*n},u=Q.MIN_MS=Q.dateTime2ms("-9999"),b=Q.MAX_MS=Q.dateTime2ms("9999-12-31 23:59:59.9999"),Q.isDateTime=function(V,H){return Q.dateTime2ms(V,H)!==t};function _(V,H){return String(V+Math.pow(10,H)).substr(1)}var C=90*e,M=3*r,E=5*a;Q.ms2DateTime=function(V,H,F){if(typeof V!="number"||!(V>=u&&V<=b))return t;H||(H=0);var U=Math.floor(P(V+.05,1)*10),W=Math.round(V-U/10),q,X,lt,yt,pt,st;if(v(F)){var tt=Math.floor(W/e)+o,dt=Math.floor(P(V,e));try{q=i.getComponentMethod("calendars","getCal")(F).fromJD(tt).formatDate("yyyy-mm-dd")}catch{q=s("G%Y-%m-%d")(new Date(W))}if(q.charAt(0)==="-")for(;q.length<11;)q="-0"+q.substr(1);else for(;q.length<10;)q="0"+q;X=H<C?Math.floor(dt/r):0,lt=H<C?Math.floor(dt%r/a):0,yt=H<M?Math.floor(dt%a/n):0,pt=H<E?dt%n*10+U:0}else st=new Date(W),q=s("%Y-%m-%d")(st),X=H<C?st.getUTCHours():0,lt=H<C?st.getUTCMinutes():0,yt=H<M?st.getUTCSeconds():0,pt=H<E?st.getUTCMilliseconds()*10+U:0;return A(q,X,lt,yt,pt)},Q.ms2DateTimeLocal=function(V){if(!(V>=u+e&&V<=b-e))return t;var H=Math.floor(P(V+.05,1)*10),F=new Date(Math.round(V-H/10)),U=$("%Y-%m-%d")(F),W=F.getHours(),q=F.getMinutes(),X=F.getSeconds(),lt=F.getUTCMilliseconds()*10+H;return A(U,W,q,X,lt)};function A(V,H,F,U,W){if((H||F||U||W)&&(V+=" "+_(H,2)+":"+_(F,2),(U||W)&&(V+=":"+_(U,2),W))){for(var q=4;W%10===0;)q-=1,W/=10;V+="."+_(W,q)}return V}Q.cleanDate=function(V,H,F){if(V===t)return H;if(Q.isJSDate(V)||typeof V=="number"&&isFinite(V)){if(v(F))return g.error("JS Dates and milliseconds are incompatible with world calendars",V),H;if(V=Q.ms2DateTimeLocal(+V),!V&&H!==void 0)return H}else if(!Q.isDateTime(V,F))return g.error("unrecognized date",V),H;return V};var h=/%\d?f/g,p=/%h/g,k={1:"1",2:"1",3:"2",4:"2"};function w(V,H,F,U){V=V.replace(h,function(q){var X=Math.min(+q.charAt(1)||6,6),lt=(H/1e3%1+2).toFixed(X).substr(2).replace(/0+$/,"")||"0";return lt});var W=new Date(Math.floor(H+.05));if(V=V.replace(p,function(){return k[F("%q")(W)]}),v(U))try{V=i.getComponentMethod("calendars","worldCalFmt")(V,H,U)}catch{return"Invalid"}return F(V)(W)}var R=[59,59.9,59.99,59.999,59.9999];function O(V,H){var F=P(V+.05,e),U=_(Math.floor(F/r),2)+":"+_(P(Math.floor(F/a),60),2);if(H!=="M"){c(H)||(H=0);var W=Math.min(P(V/n,60),R[H]),q=(100+W).toFixed(H).substr(1);H>0&&(q=q.replace(/0+$/,"").replace(/[\.]$/,"")),U+=":"+q}return U}Q.formatDate=function(V,H,F,U,W,q){if(W=v(W)&&W,!H)if(F==="y")H=q.year;else if(F==="m")H=q.month;else if(F==="d")H=q.dayMonth+`
`+q.year;else return O(V,F)+`
`+w(q.dayMonthYear,V,U,W);return w(H,V,U,W)};var N=3*e;Q.incrementMonth=function(V,H,F){F=v(F)&&F;var U=P(V,e);if(V=Math.round(V-U),F)try{var W=Math.round(V/e)+o,q=i.getComponentMethod("calendars","getCal")(F),X=q.fromJD(W);return H%12?q.add(X,H,"m"):q.add(X,H/12,"y"),(X.toJD()-o)*e+U}catch{g.error("invalid ms "+V+" in calendar "+F)}var lt=new Date(V+N);return lt.setUTCMonth(lt.getUTCMonth()+H)+U-N},Q.findExactDates=function(V,H){for(var F=0,U=0,W=0,q=0,X,lt,yt=v(H)&&i.getComponentMethod("calendars","getCal")(H),pt=0;pt<V.length;pt++){if(lt=V[pt],!c(lt)){q++;continue}if(!(lt%e))if(yt)try{X=yt.fromJD(lt/e+o),X.day()===1?X.month()===1?F++:U++:W++}catch{}else X=new Date(lt),X.getUTCDate()===1?X.getUTCMonth()===0?F++:U++:W++}U+=F,W+=U;var st=V.length-q;return{exactYears:F/st,exactMonths:U/st,exactDays:W/st}}}),_1=Ft((Q,$)=>{$.exports=function(c){return c}}),T_=Ft(Q=>{var $=ra(),c=Ko(),g=_1(),P=Da().BADNUM,S=1e-9;Q.findBin=function(n,o,i){if($(o.start))return i?Math.ceil((n-o.start)/o.size-S)-1:Math.floor((n-o.start)/o.size+S);var s=0,f=o.length,x=0,y=f>1?(o[f-1]-o[0])/(f-1):1,v,T;for(y>=0?T=i?t:e:T=i?a:r,n+=y*S*(i?-1:1)*(y>=0?1:-1);s<f&&x++<100;)v=Math.floor((s+f)/2),T(o[v],n)?s=v+1:f=v;return x>90&&c.log("Long binary search..."),s-1};function t(n,o){return n<o}function e(n,o){return n<=o}function r(n,o){return n>o}function a(n,o){return n>=o}Q.sorterAsc=function(n,o){return n-o},Q.sorterDes=function(n,o){return o-n},Q.distinctVals=function(n){var o=n.slice();o.sort(Q.sorterAsc);var i;for(i=o.length-1;i>-1&&o[i]===P;i--);for(var s=o[i]-o[0]||1,f=s/(i||1)/1e4,x=[],y,v=0;v<=i;v++){var T=o[v],u=T-y;y===void 0?(x.push(T),y=T):u>f&&(s=Math.min(s,u),x.push(T),y=T)}return{vals:x,minDiff:s}},Q.roundUp=function(n,o,i){for(var s=0,f=o.length-1,x,y=0,v=i?0:1,T=i?1:0,u=i?Math.ceil:Math.floor;s<f&&y++<100;)x=u((s+f)/2),o[x]<=n?s=x+v:f=x-T;return o[s]},Q.sort=function(n,o){for(var i=0,s=0,f=1;f<n.length;f++){var x=o(n[f],n[f-1]);if(x<0?i=1:x>0&&(s=1),i&&s)return n.sort(o)}return s?n:n.reverse()},Q.findIndexOfMin=function(n,o){o=o||g;for(var i=1/0,s,f=0;f<n.length;f++){var x=o(n[f]);x<i&&(i=x,s=f)}return s}}),G0=Ft((Q,$)=>{$.exports=function(c){return Object.keys(c).sort()}}),s6=Ft(Q=>{var $=ra(),c=Va().isArrayOrTypedArray;Q.aggNums=function(g,P,S,t){var e,r;if((!t||t>S.length)&&(t=S.length),$(P)||(P=!1),c(S[0])){for(r=new Array(t),e=0;e<t;e++)r[e]=Q.aggNums(g,P,S[e]);S=r}for(e=0;e<t;e++)$(P)?$(S[e])&&(P=g(+P,+S[e])):P=S[e];return P},Q.len=function(g){return Q.aggNums(function(P){return P+1},0,g)},Q.mean=function(g,P){return P||(P=Q.len(g)),Q.aggNums(function(S,t){return S+t},0,g)/P},Q.geometricMean=function(g,P){return P||(P=Q.len(g)),Math.pow(Q.aggNums(function(S,t){return S*t},1,g),1/P)},Q.midRange=function(g){if(!(g===void 0||g.length===0))return(Q.aggNums(Math.max,null,g)+Q.aggNums(Math.min,null,g))/2},Q.variance=function(g,P,S){return P||(P=Q.len(g)),$(S)||(S=Q.mean(g,P)),Q.aggNums(function(t,e){return t+Math.pow(e-S,2)},0,g)/P},Q.stdev=function(g,P,S){return Math.sqrt(Q.variance(g,P,S))},Q.median=function(g){var P=g.slice().sort();return Q.interp(P,.5)},Q.interp=function(g,P){if(!$(P))throw"n should be a finite number";if(P=P*g.length-.5,P<0)return g[0];if(P>g.length-1)return g[g.length-1];var S=P%1;return S*g[Math.ceil(P)]+(1-S)*g[Math.floor(P)]}}),l6=Ft((Q,$)=>{var c=qo(),g=c.mod,P=c.modHalf,S=Math.PI,t=2*S;function e(T){return T/180*S}function r(T){return T/S*180}function a(T){return Math.abs(T[1]-T[0])>t-1e-14}function n(T,u){return P(u-T,t)}function o(T,u){return Math.abs(n(T,u))}function i(T,u){if(a(u))return!0;var b,_;u[0]<u[1]?(b=u[0],_=u[1]):(b=u[1],_=u[0]),b=g(b,t),_=g(_,t),b>_&&(_+=t);var C=g(T,t),M=C+t;return C>=b&&C<=_||M>=b&&M<=_}function s(T,u,b,_){if(!i(u,_))return!1;var C,M;return b[0]<b[1]?(C=b[0],M=b[1]):(C=b[1],M=b[0]),T>=C&&T<=M}function f(T,u,b,_,C,M,E){C=C||0,M=M||0;var A=a([b,_]),h,p,k,w,R;A?(h=0,p=S,k=t):b<_?(h=b,k=_):(h=_,k=b),T<u?(w=T,R=u):(w=u,R=T);function O(F,U){return[F*Math.cos(U)+C,M-F*Math.sin(U)]}var N=Math.abs(k-h)<=S?0:1;function V(F,U,W){return"A"+[F,F]+" "+[0,N,W]+" "+O(F,U)}var H;return A?w===null?H="M"+O(R,h)+V(R,p,0)+V(R,k,0)+"Z":H="M"+O(w,h)+V(w,p,0)+V(w,k,0)+"ZM"+O(R,h)+V(R,p,1)+V(R,k,1)+"Z":w===null?(H="M"+O(R,h)+V(R,k,0),E&&(H+="L0,0Z")):H="M"+O(w,h)+"L"+O(R,h)+V(R,k,0)+"L"+O(w,k)+V(w,h,1)+"Z",H}function x(T,u,b,_,C){return f(null,T,u,b,_,C,0)}function y(T,u,b,_,C){return f(null,T,u,b,_,C,1)}function v(T,u,b,_,C,M){return f(T,u,b,_,C,M,1)}$.exports={deg2rad:e,rad2deg:r,angleDelta:n,angleDist:o,isFullCircle:a,isAngleInsideSector:i,isPtInsideSector:s,pathArc:x,pathSector:y,pathAnnulus:v}}),u6=Ft(Q=>{Q.isLeftAnchor=function($){return $.xanchor==="left"||$.xanchor==="auto"&&$.x<=1/3},Q.isCenterAnchor=function($){return $.xanchor==="center"||$.xanchor==="auto"&&$.x>1/3&&$.x<2/3},Q.isRightAnchor=function($){return $.xanchor==="right"||$.xanchor==="auto"&&$.x>=2/3},Q.isTopAnchor=function($){return $.yanchor==="top"||$.yanchor==="auto"&&$.y>=2/3},Q.isMiddleAnchor=function($){return $.yanchor==="middle"||$.yanchor==="auto"&&$.y>1/3&&$.y<2/3},Q.isBottomAnchor=function($){return $.yanchor==="bottom"||$.yanchor==="auto"&&$.y<=1/3}}),c6=Ft(Q=>{var $=qo().mod;Q.segmentsIntersect=c;function c(e,r,a,n,o,i,s,f){var x=a-e,y=o-e,v=s-o,T=n-r,u=i-r,b=f-i,_=x*b-v*T;if(_===0)return null;var C=(y*b-v*u)/_,M=(y*T-x*u)/_;return M<0||M>1||C<0||C>1?null:{x:e+x*C,y:r+T*C}}Q.segmentDistance=function(e,r,a,n,o,i,s,f){if(c(e,r,a,n,o,i,s,f))return 0;var x=a-e,y=n-r,v=s-o,T=f-i,u=x*x+y*y,b=v*v+T*T,_=Math.min(g(x,y,u,o-e,i-r),g(x,y,u,s-e,f-r),g(v,T,b,e-o,r-i),g(v,T,b,a-o,n-i));return Math.sqrt(_)};function g(e,r,a,n,o){var i=n*e+o*r;if(i<0)return n*n+o*o;if(i>a){var s=n-e,f=o-r;return s*s+f*f}else{var x=n*r-o*e;return x*x/a}}var P,S,t;Q.getTextLocation=function(e,r,a,n){if((e!==S||n!==t)&&(P={},S=e,t=n),P[a])return P[a];var o=e.getPointAtLength($(a-n/2,r)),i=e.getPointAtLength($(a+n/2,r)),s=Math.atan((i.y-o.y)/(i.x-o.x)),f=e.getPointAtLength($(a,r)),x=(f.x*4+o.x+i.x)/6,y=(f.y*4+o.y+i.y)/6,v={x,y,theta:s};return P[a]=v,v},Q.clearLocationCache=function(){S=null},Q.getVisibleSegment=function(e,r,a){var n=r.left,o=r.right,i=r.top,s=r.bottom,f=0,x=e.getTotalLength(),y=x,v,T;function u(_){var C=e.getPointAtLength(_);_===0?v=C:_===x&&(T=C);var M=C.x<n?n-C.x:C.x>o?C.x-o:0,E=C.y<i?i-C.y:C.y>s?C.y-s:0;return Math.sqrt(M*M+E*E)}for(var b=u(f);b;){if(f+=b+a,f>y)return;b=u(f)}for(b=u(y);b;){if(y-=b+a,f>y)return;b=u(y)}return{min:f,max:y,len:y-f,total:x,isClosed:f===0&&y===x&&Math.abs(v.x-T.x)<.1&&Math.abs(v.y-T.y)<.1}},Q.findPointOnPath=function(e,r,a,n){n=n||{};for(var o=n.pathLength||e.getTotalLength(),i=n.tolerance||.001,s=n.iterationLimit||30,f=e.getPointAtLength(0)[a]>e.getPointAtLength(o)[a]?-1:1,x=0,y=0,v=o,T,u,b;x<s;){if(T=(y+v)/2,u=e.getPointAtLength(T),b=u[a]-r,Math.abs(b)<i)return u;f*b>0?v=T:y=T,x++}return u}}),A_=Ft(Q=>{var $={};Q.throttle=function(g,P,S){var t=$[g],e=Date.now();if(!t){for(var r in $)$[r].ts<e-6e4&&delete $[r];t=$[g]={ts:0,timer:null}}c(t);function a(){S(),t.ts=Date.now(),t.onDone&&(t.onDone(),t.onDone=null)}if(e>t.ts+P){a();return}t.timer=setTimeout(function(){a(),t.timer=null},P)},Q.done=function(g){var P=$[g];return!P||!P.timer?Promise.resolve():new Promise(function(S){var t=P.onDone;P.onDone=function(){t&&t(),S(),P.onDone=null}})},Q.clear=function(g){if(g)c($[g]),delete $[g];else for(var P in $)Q.clear(P)};function c(g){g&&g.timer!==null&&(clearTimeout(g.timer),g.timer=null)}}),M_=Ft((Q,$)=>{$.exports=function(c){c._responsiveChartHandler&&(window.removeEventListener("resize",c._responsiveChartHandler),delete c._responsiveChartHandler)}}),b1=Ft((Q,$)=>{$.exports=S,$.exports.isMobile=S,$.exports.default=S;var c=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,g=/CrOS/,P=/android|ipad|playbook|silk/i;function S(t){t||(t={});let e=t.ua;if(!e&&typeof navigator<"u"&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string")return!1;let r=c.test(e)&&!g.test(e)||!!t.tablet&&P.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(r=!0),r}}),fw=Ft((Q,$)=>{var c=ra(),g=b1();$.exports=function(S){var t;if(S&&S.hasOwnProperty("userAgent")?t=S.userAgent:t=P(),typeof t!="string")return!0;var e=g({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!e)for(var r=t.split(" "),a=1;a<r.length;a++){var n=r[a];if(n.indexOf("Safari")!==-1)for(var o=a-1;o>-1;o--){var i=r[o];if(i.substr(0,8)==="Version/"){var s=i.substr(8).split(".")[0];if(c(s)&&(s=+s),s>=13)return!0}}}return e};function P(){var S;return typeof navigator<"u"&&(S=navigator.userAgent),S&&S.headers&&typeof S.headers["user-agent"]=="string"&&(S=S.headers["user-agent"]),S}}),dw=Ft((Q,$)=>{var c=un();$.exports=function(g,P,S){var t=g.selectAll("g."+S.replace(/\s/g,".")).data(P,function(r){return r[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",S),t.order();var e=g.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(r){r[0][e]=c.select(this)}),t}}),w1=Ft((Q,$)=>{var c=Xo();$.exports=function(g,P){for(var S=g._context.locale,t=0;t<2;t++){for(var e=g._context.locales,r=0;r<2;r++){var a=(e[S]||{}).dictionary;if(a){var n=a[P];if(n)return n}e=c.localeRegistry}var o=S.split("-")[0];if(o===S)break;S=o}return P}}),Cc=Ft((Q,$)=>{$.exports=function(c){for(var g={},P=[],S=0,t=0;t<c.length;t++){var e=c[t];g[e]!==1&&(g[e]=1,P[S++]=e)}return P}}),Tf=Ft((Q,$)=>{$.exports=function(S){for(var t=P(S)?g:c,e=[],r=0;r<S.length;r++){var a=S[r];t(a)&&e.push(a)}return e};function c(S){return S.visible===!0}function g(S){var t=S[0].trace;return t.visible===!0&&t._length!==0}function P(S){return Array.isArray(S)&&Array.isArray(S[0])&&S[0][0]&&S[0][0].trace}}),Oy=Ft((Q,$)=>{$.exports=function(c,g){if(!g)return c;var P=1/Math.abs(g),S=P>1?(P*c+P*g)/P:c+g,t=String(S).length;if(t>16){var e=String(g).length,r=String(c).length;if(t>=r+e){var a=parseFloat(S).toPrecision(12);a.indexOf("e+")===-1&&(S=+a)}}return S}}),hv=Ft((Q,$)=>{var c=ra(),g=Da().BADNUM,P=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;$.exports=function(S){return typeof S=="string"&&(S=S.replace(P,"")),c(S)?Number(S):g}}),bn=Ft((Q,$)=>{var c=un(),g=fa().utcFormat,P=Li().format,S=ra(),t=Da(),e=t.FP_SAFE,r=-e,a=t.BADNUM,n=$.exports={};n.adjustFormat=function(it){return!it||/^\d[.]\df/.test(it)||/[.]\d%/.test(it)?it:it==="0.f"?"~f":/^\d%/.test(it)?"~%":/^\ds/.test(it)?"~s":!/^[~,.0$]/.test(it)&&/[&fps]/.test(it)?"~"+it:it};var o={};n.warnBadFormat=function(it){var Y=String(it);o[Y]||(o[Y]=1,n.warn('encountered bad format: "'+Y+'"'))},n.noFormat=function(it){return String(it)},n.numberFormat=function(it){var Y;try{Y=P(n.adjustFormat(it))}catch{return n.warnBadFormat(it),n.noFormat}return Y},n.nestedProperty=ss(),n.keyedContainer=mo(),n.relativeAttr=ko(),n.isPlainObject=Ei(),n.toLogRange=pl(),n.relinkPrivateKeys=fu();var i=Va();n.isArrayBuffer=i.isArrayBuffer,n.isTypedArray=i.isTypedArray,n.isArrayOrTypedArray=i.isArrayOrTypedArray,n.isArray1D=i.isArray1D,n.ensureArray=i.ensureArray,n.concat=i.concat,n.maxRowLength=i.maxRowLength,n.minRowLength=i.minRowLength;var s=qo();n.mod=s.mod,n.modHalf=s.modHalf;var f=yo();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 x=o6();n.dateTime2ms=x.dateTime2ms,n.isDateTime=x.isDateTime,n.ms2DateTime=x.ms2DateTime,n.ms2DateTimeLocal=x.ms2DateTimeLocal,n.cleanDate=x.cleanDate,n.isJSDate=x.isJSDate,n.formatDate=x.formatDate,n.incrementMonth=x.incrementMonth,n.dateTick0=x.dateTick0,n.dfltRange=x.dfltRange,n.findExactDates=x.findExactDates,n.MIN_MS=x.MIN_MS,n.MAX_MS=x.MAX_MS;var y=T_();n.findBin=y.findBin,n.sorterAsc=y.sorterAsc,n.sorterDes=y.sorterDes,n.distinctVals=y.distinctVals,n.roundUp=y.roundUp,n.sort=y.sort,n.findIndexOfMin=y.findIndexOfMin,n.sortObjectKeys=G0();var v=s6();n.aggNums=v.aggNums,n.len=v.len,n.mean=v.mean,n.geometricMean=v.geometricMean,n.median=v.median,n.midRange=v.midRange,n.variance=v.variance,n.stdev=v.stdev,n.interp=v.interp;var T=w_();n.init2dArray=T.init2dArray,n.transposeRagged=T.transposeRagged,n.dot=T.dot,n.translationMatrix=T.translationMatrix,n.rotationMatrix=T.rotationMatrix,n.rotationXYMatrix=T.rotationXYMatrix,n.apply3DTransform=T.apply3DTransform,n.apply2DTransform=T.apply2DTransform,n.apply2DTransform2=T.apply2DTransform2,n.convertCssMatrix=T.convertCssMatrix,n.inverseTransformMatrix=T.inverseTransformMatrix;var u=l6();n.deg2rad=u.deg2rad,n.rad2deg=u.rad2deg,n.angleDelta=u.angleDelta,n.angleDist=u.angleDist,n.isFullCircle=u.isFullCircle,n.isAngleInsideSector=u.isAngleInsideSector,n.isPtInsideSector=u.isPtInsideSector,n.pathArc=u.pathArc,n.pathSector=u.pathSector,n.pathAnnulus=u.pathAnnulus;var b=u6();n.isLeftAnchor=b.isLeftAnchor,n.isCenterAnchor=b.isCenterAnchor,n.isRightAnchor=b.isRightAnchor,n.isTopAnchor=b.isTopAnchor,n.isMiddleAnchor=b.isMiddleAnchor,n.isBottomAnchor=b.isBottomAnchor;var _=c6();n.segmentsIntersect=_.segmentsIntersect,n.segmentDistance=_.segmentDistance,n.getTextLocation=_.getTextLocation,n.clearLocationCache=_.clearLocationCache,n.getVisibleSegment=_.getVisibleSegment,n.findPointOnPath=_.findPointOnPath;var C=Ta();n.extendFlat=C.extendFlat,n.extendDeep=C.extendDeep,n.extendDeepAll=C.extendDeepAll,n.extendDeepNoArrays=C.extendDeepNoArrays;var M=Ko();n.log=M.log,n.warn=M.warn,n.error=M.error;var E=vo();n.counterRegex=E.counter;var A=A_();n.throttle=A.throttle,n.throttleDone=A.done,n.clearThrottle=A.clear;var h=r0();n.getGraphDiv=h.getGraphDiv,n.isPlotDiv=h.isPlotDiv,n.removeElement=h.removeElement,n.addStyleRule=h.addStyleRule,n.addRelatedStyleRule=h.addRelatedStyleRule,n.deleteRelatedStyleRule=h.deleteRelatedStyleRule,n.setStyleOnHover=h.setStyleOnHover,n.getFullTransformMatrix=h.getFullTransformMatrix,n.getElementTransformMatrix=h.getElementTransformMatrix,n.getElementAndAncestors=h.getElementAndAncestors,n.equalDomRects=h.equalDomRects,n.clearResponsive=M_(),n.preserveDrawingBuffer=fw(),n.makeTraceGroups=dw(),n._=w1(),n.notifier=ns(),n.filterUnique=Cc(),n.filterVisible=Tf(),n.pushUnique=wl(),n.increment=Oy(),n.cleanNumber=hv(),n.ensureNumber=function(it){return S(it)?(it=Number(it),it>e||it<r?a:it):a},n.isIndex=function(it,Y){return Y!==void 0&&it>=Y?!1:S(it)&&it>=0&&it%1===0},n.noop=Oo(),n.identity=_1(),n.repeat=function(it,Y){for(var ft=new Array(Y),ut=0;ut<Y;ut++)ft[ut]=it;return ft},n.swapAttrs=function(it,Y,ft,ut){ft||(ft="x"),ut||(ut="y");for(var wt=0;wt<Y.length;wt++){var zt=Y[wt],Pt=n.nestedProperty(it,zt.replace("?",ft)),Wt=n.nestedProperty(it,zt.replace("?",ut)),Ht=Pt.get();Pt.set(Wt.get()),Wt.set(Ht)}},n.raiseToTop=function(it){it.parentNode.appendChild(it)},n.cancelTransition=function(it){return it.transition().duration(0)},n.constrain=function(it,Y,ft){return Y>ft?Math.max(ft,Math.min(Y,it)):Math.max(Y,Math.min(ft,it))},n.bBoxIntersect=function(it,Y,ft){return ft=ft||0,it.left<=Y.right+ft&&Y.left<=it.right+ft&&it.top<=Y.bottom+ft&&Y.top<=it.bottom+ft},n.simpleMap=function(it,Y,ft,ut,wt){for(var zt=it.length,Pt=new Array(zt),Wt=0;Wt<zt;Wt++)Pt[Wt]=Y(it[Wt],ft,ut,wt);return Pt},n.randstr=function it(Y,ft,ut,wt){if(ut||(ut=16),ft===void 0&&(ft=24),ft<=0)return"0";var zt=Math.log(Math.pow(2,ft))/Math.log(ut),Pt="",Wt,Ht,Jt;for(Wt=2;zt===1/0;Wt*=2)zt=Math.log(Math.pow(2,ft/Wt))/Math.log(ut)*Wt;var ge=zt-Math.floor(zt);for(Wt=0;Wt<Math.floor(zt);Wt++)Jt=Math.floor(Math.random()*ut).toString(ut),Pt=Jt+Pt;ge&&(Ht=Math.pow(ut,ge),Jt=Math.floor(Math.random()*Ht).toString(ut),Pt=Jt+Pt);var he=parseInt(Pt,ut);return Y&&Y[Pt]||he!==1/0&&he>=Math.pow(2,ft)?wt>10?(n.warn("randstr failed uniqueness"),Pt):it(Y,ft,ut,(wt||0)+1):Pt},n.OptionControl=function(it,Y){it||(it={}),Y||(Y="opt");var ft={};return ft.optionList=[],ft._newoption=function(ut){ut[Y]=it,ft[ut.name]=ut,ft.optionList.push(ut)},ft["_"+Y]=it,ft},n.smooth=function(it,Y){if(Y=Math.round(Y)||0,Y<2)return it;var ft=it.length,ut=2*ft,wt=2*Y-1,zt=new Array(wt),Pt=new Array(ft),Wt,Ht,Jt,ge;for(Wt=0;Wt<wt;Wt++)zt[Wt]=(1-Math.cos(Math.PI*(Wt+1)/Y))/(2*Y);for(Wt=0;Wt<ft;Wt++){for(ge=0,Ht=0;Ht<wt;Ht++)Jt=Wt+Ht+1-Y,Jt<-ft?Jt-=ut*Math.round(Jt/ut):Jt>=ut&&(Jt-=ut*Math.floor(Jt/ut)),Jt<0?Jt=-1-Jt:Jt>=ft&&(Jt=ut-1-Jt),ge+=it[Jt]*zt[Ht];Pt[Wt]=ge}return Pt},n.syncOrAsync=function(it,Y,ft){var ut,wt;function zt(){return n.syncOrAsync(it,Y,ft)}for(;it.length;)if(wt=it.splice(0,1)[0],ut=wt(Y),ut&&ut.then)return ut.then(zt);return ft&&ft(Y)},n.stripTrailingSlash=function(it){return it.substr(-1)==="/"?it.substr(0,it.length-1):it},n.noneOrAll=function(it,Y,ft){if(it){var ut=!1,wt=!0,zt,Pt;for(zt=0;zt<ft.length;zt++)Pt=it[ft[zt]],Pt!=null?ut=!0:wt=!1;if(ut&&!wt)for(zt=0;zt<ft.length;zt++)it[ft[zt]]=Y[ft[zt]]}},n.mergeArray=function(it,Y,ft,ut){var wt=typeof ut=="function";if(n.isArrayOrTypedArray(it))for(var zt=Math.min(it.length,Y.length),Pt=0;Pt<zt;Pt++){var Wt=it[Pt];Y[Pt][ft]=wt?ut(Wt):Wt}},n.mergeArrayCastPositive=function(it,Y,ft){return n.mergeArray(it,Y,ft,function(ut){var wt=+ut;return isFinite(wt)&&wt>0?wt:0})},n.fillArray=function(it,Y,ft,ut){if(ut=ut||n.identity,n.isArrayOrTypedArray(it))for(var wt=0;wt<Y.length;wt++)Y[wt][ft]=ut(it[wt])},n.castOption=function(it,Y,ft,ut){ut=ut||n.identity;var wt=n.nestedProperty(it,ft).get();return n.isArrayOrTypedArray(wt)?Array.isArray(Y)&&n.isArrayOrTypedArray(wt[Y[0]])?ut(wt[Y[0]][Y[1]]):ut(wt[Y]):wt},n.extractOption=function(it,Y,ft,ut){if(ft in it)return it[ft];var wt=n.nestedProperty(Y,ut).get();if(!Array.isArray(wt))return wt};function p(it){var Y={};for(var ft in it)for(var ut=it[ft],wt=0;wt<ut.length;wt++)Y[ut[wt]]=+ft;return Y}n.tagSelected=function(it,Y,ft){var ut=Y.selectedpoints,wt=Y._indexToPoints,zt;wt&&(zt=p(wt));function Pt(he){return he!==void 0&&he<it.length}for(var Wt=0;Wt<ut.length;Wt++){var Ht=ut[Wt];if(n.isIndex(Ht)||n.isArrayOrTypedArray(Ht)&&n.isIndex(Ht[0])&&n.isIndex(Ht[1])){var Jt=zt?zt[Ht]:Ht,ge=ft?ft[Jt]:Jt;Pt(ge)&&(it[ge].selected=1)}}},n.selIndices2selPoints=function(it){var Y=it.selectedpoints,ft=it._indexToPoints;if(ft){for(var ut=p(ft),wt=[],zt=0;zt<Y.length;zt++){var Pt=Y[zt];if(n.isIndex(Pt)){var Wt=ut[Pt];n.isIndex(Wt)&&wt.push(Wt)}}return wt}else return Y},n.getTargetArray=function(it,Y){var ft=Y.target;if(typeof ft=="string"&&ft){var ut=n.nestedProperty(it,ft).get();return n.isArrayOrTypedArray(ut)?ut:!1}else if(n.isArrayOrTypedArray(ft))return ft;return!1};function k(it,Y,ft){var ut={};typeof Y!="object"&&(Y={});var wt=ft==="pieLike"?-1:3,zt=Object.keys(it),Pt,Wt,Ht;for(Pt=0;Pt<zt.length;Pt++)Wt=zt[Pt],Ht=it[Wt],!(Wt.charAt(0)==="_"||typeof Ht=="function")&&(Wt==="module"?ut[Wt]=Ht:Array.isArray(Ht)?Wt==="colorscale"||wt===-1?ut[Wt]=Ht.slice():ut[Wt]=Ht.slice(0,wt):n.isTypedArray(Ht)?wt===-1?ut[Wt]=Ht.subarray():ut[Wt]=Ht.subarray(0,wt):Ht&&typeof Ht=="object"?ut[Wt]=k(it[Wt],Y[Wt],ft):ut[Wt]=Ht);for(zt=Object.keys(Y),Pt=0;Pt<zt.length;Pt++)Wt=zt[Pt],Ht=Y[Wt],(typeof Ht!="object"||!(Wt in ut)||typeof ut[Wt]!="object")&&(ut[Wt]=Ht);return ut}n.minExtend=k,n.titleCase=function(it){return it.charAt(0).toUpperCase()+it.substr(1)},n.containsAny=function(it,Y){for(var ft=0;ft<Y.length;ft++)if(it.indexOf(Y[ft])!==-1)return!0;return!1};var w=/Version\/[\d\.]+.*Safari/;n.isSafari=function(){return w.test(window.navigator.userAgent)};var R=/iPad|iPhone|iPod/;n.isIOS=function(){return R.test(window.navigator.userAgent)};var O=/Macintosh.+AppleWebKit.+Gecko\)$/;n.isMacWKWebView=()=>O.test(window.navigator.userAgent);var N=/Firefox\/(\d+)\.\d+/;n.getFirefoxVersion=function(){var it=N.exec(window.navigator.userAgent);if(it&&it.length===2){var Y=parseInt(it[1]);if(!isNaN(Y))return Y}return null},n.isD3Selection=function(it){return it instanceof c.selection},n.ensureSingle=function(it,Y,ft,ut){var wt=it.select(Y+(ft?"."+ft:""));if(wt.size())return wt;var zt=it.append(Y);return ft&&zt.classed(ft,!0),ut&&zt.call(ut),zt},n.ensureSingleById=function(it,Y,ft,ut){var wt=it.select(Y+"#"+ft);if(wt.size())return wt;var zt=it.append(Y).attr("id",ft);return ut&&zt.call(ut),zt},n.objectFromPath=function(it,Y){for(var ft=it.split("."),ut,wt=ut={},zt=0;zt<ft.length;zt++){var Pt=ft[zt],Wt=null,Ht=ft[zt].match(/(.*)\[([0-9]+)\]/);Ht?(Pt=Ht[1],Wt=Ht[2],ut=ut[Pt]=[],zt===ft.length-1?ut[Wt]=Y:ut[Wt]={},ut=ut[Wt]):(zt===ft.length-1?ut[Pt]=Y:ut[Pt]={},ut=ut[Pt])}return wt};var V=/^([^\[\.]+)\.(.+)?/,H=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function F(it){return it.slice(0,2)==="__"}n.expandObjectPaths=function(it){var Y,ft,ut,wt,zt,Pt,Wt;if(typeof it=="object"&&!Array.isArray(it)){for(ft in it)if(it.hasOwnProperty(ft))if(Y=ft.match(V)){if(wt=it[ft],ut=Y[1],F(ut))continue;delete it[ft],it[ut]=n.extendDeepNoArrays(it[ut]||{},n.objectFromPath(ft,n.expandObjectPaths(wt))[ut])}else if(Y=ft.match(H)){if(wt=it[ft],ut=Y[1],F(ut))continue;if(zt=parseInt(Y[2]),delete it[ft],it[ut]=it[ut]||[],Y[3]===".")Wt=Y[4],Pt=it[ut][zt]=it[ut][zt]||{},n.extendDeepNoArrays(Pt,n.objectFromPath(Wt,n.expandObjectPaths(wt)));else{if(F(ut))continue;it[ut][zt]=n.expandObjectPaths(wt)}}else{if(F(ft))continue;it[ft]=n.expandObjectPaths(it[ft])}}return it},n.numSeparate=function(it,Y,ft){if(ft||(ft=!1),typeof Y!="string"||Y.length===0)throw new Error("Separator string required for formatting!");typeof it=="number"&&(it=String(it));var ut=/(\d+)(\d{3})/,wt=Y.charAt(0),zt=Y.charAt(1),Pt=it.split("."),Wt=Pt[0],Ht=Pt.length>1?wt+Pt[1]:"";if(zt&&(Pt.length>1||Wt.length>4||ft))for(;ut.test(Wt);)Wt=Wt.replace(ut,"$1"+zt+"$2");return Wt+Ht},n.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var U=/^\w*$/;n.templateString=function(it,Y){var ft={};return it.replace(n.TEMPLATE_STRING_REGEX,function(ut,wt){var zt;return U.test(wt)?zt=Y[wt]:(ft[wt]=ft[wt]||n.nestedProperty(Y,wt).get,zt=ft[wt](!0)),zt!==void 0?zt:""})};var W={max:10,count:0,name:"hovertemplate"};n.hovertemplateString=it=>st(zr(Fr({},it),{opts:W}));var q={max:10,count:0,name:"texttemplate"};n.texttemplateString=it=>st(zr(Fr({},it),{opts:q}));var X=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function lt(it){var Y=it.match(X);return Y?{key:Y[1],op:Y[2],number:Number(Y[3])}:{key:it,op:null,number:null}}var yt={max:10,count:0,name:"texttemplate",parseMultDiv:!0};n.texttemplateStringForShapes=it=>st(zr(Fr({},it),{opts:yt}));var pt=/^[:|\|]/;function st({data:it=[],locale:Y,fallback:ft,labels:ut={},opts:wt,template:zt}){return zt.replace(n.TEMPLATE_STRING_REGEX,(Pt,Wt,Ht)=>{let Jt=["xother","yother"].includes(Wt),ge=["_xother","_yother"].includes(Wt),he=["_xother_","_yother_"].includes(Wt),de=["xother_","yother_"].includes(Wt),se=Jt||ge||de||he;(ge||he)&&(Wt=Wt.substring(1)),(de||he)&&(Wt=Wt.substring(0,Wt.length-1));let Tt=null,Lt=null;if(wt.parseMultDiv){var Mt=lt(Wt);Wt=Mt.key,Tt=Mt.op,Lt=Mt.number}let te;if(se){if(ut[Wt]===void 0)return"";te=ut[Wt]}else for(let He of it)if(He){if(He.hasOwnProperty(Wt)){te=He[Wt];break}if(U.test(Wt)||(te=n.nestedProperty(He,Wt).get(!0)),te!==void 0)break}if(te===void 0){let{count:He,max:Ge,name:cr}=wt,ur=ft===!1?Pt:ft;return He<Ge&&n.warn([`Variable '${Wt}' in ${cr} could not be found!`,"Please verify that the template is correct.",`Using value: '${ur}'.`].join(" ")),He===Ge&&n.warn(`Too many '${cr}' warnings - additional warnings will be suppressed.`),wt.count++,ur}if(Tt==="*"&&(te*=Lt),Tt==="/"&&(te/=Lt),Ht){var ve;if(Ht[0]===":"&&(ve=Y?Y.numberFormat:n.numberFormat,te!==""&&(te=ve(Ht.replace(pt,""))(te))),Ht[0]==="|"){ve=Y?Y.timeFormat:g;var oe=n.dateTime2ms(te);te=n.formatDate(oe,Ht.replace(pt,""),!1,ve)}}else{var Te=Wt+"Label";ut.hasOwnProperty(Te)&&(te=ut[Te])}return se&&(te="("+te+")",(ge||he)&&(te=" "+te),(de||he)&&(te=te+" ")),te})}var tt=48,dt=57;n.subplotSort=function(it,Y){for(var ft=Math.min(it.length,Y.length)+1,ut=0,wt=0,zt=0;zt<ft;zt++){var Pt=it.charCodeAt(zt)||0,Wt=Y.charCodeAt(zt)||0,Ht=Pt>=tt&&Pt<=dt,Jt=Wt>=tt&&Wt<=dt;if(Ht&&(ut=10*ut+Pt-tt),Jt&&(wt=10*wt+Wt-tt),!Ht||!Jt){if(ut!==wt)return ut-wt;if(Pt!==Wt)return Pt-Wt}}return wt-ut};var rt=2e9;n.seedPseudoRandom=function(){rt=2e9},n.pseudoRandom=function(){var it=rt;return rt=(69069*rt+1)%4294967296,Math.abs(rt-it)<429496729?n.pseudoRandom():rt/4294967296},n.fillText=function(it,Y,ft){var ut=Array.isArray(ft)?function(Pt){ft.push(Pt)}:function(Pt){ft.text=Pt},wt=n.extractOption(it,Y,"htx","hovertext");if(n.isValidTextValue(wt))return ut(wt);var zt=n.extractOption(it,Y,"tx","text");if(n.isValidTextValue(zt))return ut(zt)},n.isValidTextValue=function(it){return it||it===0},n.formatPercent=function(it,Y){Y=Y||0;for(var ft=(Math.round(100*it*Math.pow(10,Y))*Math.pow(.1,Y)).toFixed(Y)+"%",ut=0;ut<Y;ut++)ft.indexOf(".")!==-1&&(ft=ft.replace("0%","%"),ft=ft.replace(".%","%"));return ft},n.isHidden=function(it){var Y=window.getComputedStyle(it).display;return!Y||Y==="none"},n.strTranslate=function(it,Y){return it||Y?"translate("+it+","+Y+")":""},n.strRotate=function(it){return it?"rotate("+it+")":""},n.strScale=function(it){return it!==1?"scale("+it+")":""},n.getTextTransform=function(it){var Y=it.noCenter,ft=it.textX,ut=it.textY,wt=it.targetX,zt=it.targetY,Pt=it.anchorX||0,Wt=it.anchorY||0,Ht=it.rotate,Jt=it.scale;return Jt?Jt>1&&(Jt=1):Jt=0,n.strTranslate(wt-Jt*(ft+Pt),zt-Jt*(ut+Wt))+n.strScale(Jt)+(Ht?"rotate("+Ht+(Y?"":" "+ft+" "+ut)+")":"")},n.setTransormAndDisplay=function(it,Y){it.attr("transform",n.getTextTransform(Y)),it.style("display",Y.scale?null:"none")},n.ensureUniformFontSize=function(it,Y){var ft=n.extendFlat({},Y);return ft.size=Math.max(Y.size,it._fullLayout.uniformtext.minsize||0),ft},n.join2=function(it,Y,ft){var ut=it.length;return ut>1?it.slice(0,-1).join(Y)+ft+it[ut-1]:it.join(Y)},n.bigFont=function(it){return Math.round(1.2*it)};var at=n.getFirefoxVersion(),vt=at!==null&&at<86;n.getPositionFromD3Event=function(){return vt?[c.event.layerX,c.event.layerY]:[c.event.offsetX,c.event.offsetY]}}),S_=Ft(()=>{var Q=bn(),$={"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(g in $)c=g.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),Q.addStyleRule(c,$[g]);var c,g}),Wu=Ft((Q,$)=>{$.exports=!0}),Rf=Ft((Q,$)=>{var c=Wu(),g;typeof window.matchMedia=="function"?g=!window.matchMedia("(hover: none)").matches:g=c,$.exports=g}),Im=Ft((Q,$)=>{var c=typeof Reflect=="object"?Reflect:null,g=c&&typeof c.apply=="function"?c.apply:function(C,M,E){return Function.prototype.apply.call(C,M,E)},P;c&&typeof c.ownKeys=="function"?P=c.ownKeys:Object.getOwnPropertySymbols?P=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:P=function(C){return Object.getOwnPropertyNames(C)};function S(C){console&&console.warn&&console.warn(C)}var t=Number.isNaN||function(C){return C!==C};function e(){e.init.call(this)}$.exports=e,$.exports.once=u,e.EventEmitter=e,e.prototype._events=void 0,e.prototype._eventsCount=0,e.prototype._maxListeners=void 0;var r=10;function a(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(e,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(C){if(typeof C!="number"||C<0||t(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");r=C}}),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(C){if(typeof C!="number"||C<0||t(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function n(C){return C._maxListeners===void 0?e.defaultMaxListeners:C._maxListeners}e.prototype.getMaxListeners=function(){return n(this)},e.prototype.emit=function(C){for(var M=[],E=1;E<arguments.length;E++)M.push(arguments[E]);var A=C==="error",h=this._events;if(h!==void 0)A=A&&h.error===void 0;else if(!A)return!1;if(A){var p;if(M.length>0&&(p=M[0]),p instanceof Error)throw p;var k=new Error("Unhandled error."+(p?" ("+p.message+")":""));throw k.context=p,k}var w=h[C];if(w===void 0)return!1;if(typeof w=="function")g(w,this,M);else for(var R=w.length,O=y(w,R),E=0;E<R;++E)g(O[E],this,M);return!0};function o(C,M,E,A){var h,p,k;if(a(E),p=C._events,p===void 0?(p=C._events=Object.create(null),C._eventsCount=0):(p.newListener!==void 0&&(C.emit("newListener",M,E.listener?E.listener:E),p=C._events),k=p[M]),k===void 0)k=p[M]=E,++C._eventsCount;else if(typeof k=="function"?k=p[M]=A?[E,k]:[k,E]:A?k.unshift(E):k.push(E),h=n(C),h>0&&k.length>h&&!k.warned){k.warned=!0;var w=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");w.name="MaxListenersExceededWarning",w.emitter=C,w.type=M,w.count=k.length,S(w)}return C}e.prototype.addListener=function(C,M){return o(this,C,M,!1)},e.prototype.on=e.prototype.addListener,e.prototype.prependListener=function(C,M){return o(this,C,M,!0)};function i(){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(C,M,E){var A={fired:!1,wrapFn:void 0,target:C,type:M,listener:E},h=i.bind(A);return h.listener=E,A.wrapFn=h,h}e.prototype.once=function(C,M){return a(M),this.on(C,s(this,C,M)),this},e.prototype.prependOnceListener=function(C,M){return a(M),this.prependListener(C,s(this,C,M)),this},e.prototype.removeListener=function(C,M){var E,A,h,p,k;if(a(M),A=this._events,A===void 0)return this;if(E=A[C],E===void 0)return this;if(E===M||E.listener===M)--this._eventsCount===0?this._events=Object.create(null):(delete A[C],A.removeListener&&this.emit("removeListener",C,E.listener||M));else if(typeof E!="function"){for(h=-1,p=E.length-1;p>=0;p--)if(E[p]===M||E[p].listener===M){k=E[p].listener,h=p;break}if(h<0)return this;h===0?E.shift():v(E,h),E.length===1&&(A[C]=E[0]),A.removeListener!==void 0&&this.emit("removeListener",C,k||M)}return this},e.prototype.off=e.prototype.removeListener,e.prototype.removeAllListeners=function(C){var M,E,A;if(E=this._events,E===void 0)return this;if(E.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):E[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete E[C]),this;if(arguments.length===0){var h=Object.keys(E),p;for(A=0;A<h.length;++A)p=h[A],p!=="removeListener"&&this.removeAllListeners(p);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(M=E[C],typeof M=="function")this.removeListener(C,M);else if(M!==void 0)for(A=M.length-1;A>=0;A--)this.removeListener(C,M[A]);return this};function f(C,M,E){var A=C._events;if(A===void 0)return[];var h=A[M];return h===void 0?[]:typeof h=="function"?E?[h.listener||h]:[h]:E?T(h):y(h,h.length)}e.prototype.listeners=function(C){return f(this,C,!0)},e.prototype.rawListeners=function(C){return f(this,C,!1)},e.listenerCount=function(C,M){return typeof C.listenerCount=="function"?C.listenerCount(M):x.call(C,M)},e.prototype.listenerCount=x;function x(C){var M=this._events;if(M!==void 0){var E=M[C];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}e.prototype.eventNames=function(){return this._eventsCount>0?P(this._events):[]};function y(C,M){for(var E=new Array(M),A=0;A<M;++A)E[A]=C[A];return E}function v(C,M){for(;M+1<C.length;M++)C[M]=C[M+1];C.pop()}function T(C){for(var M=new Array(C.length),E=0;E<M.length;++E)M[E]=C[E].listener||C[E];return M}function u(C,M){return new Promise(function(E,A){function h(k){C.removeListener(M,p),A(k)}function p(){typeof C.removeListener=="function"&&C.removeListener("error",h),E([].slice.call(arguments))}_(C,M,p,{once:!0}),M!=="error"&&b(C,h,{once:!0})})}function b(C,M,E){typeof C.on=="function"&&_(C,"error",M,E)}function _(C,M,E,A){if(typeof C.on=="function")A.once?C.once(M,E):C.on(M,E);else if(typeof C.addEventListener=="function")C.addEventListener(M,function h(p){A.once&&C.removeEventListener(M,h),E(p)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}}),Om=Ft((Q,$)=>{var c=Im().EventEmitter,g={init:function(P){if(P._ev instanceof c)return P;var S=new c,t=new c;return P._ev=S,P._internalEv=t,P.on=S.on.bind(S),P.once=S.once.bind(S),P.removeListener=S.removeListener.bind(S),P.removeAllListeners=S.removeAllListeners.bind(S),P._internalOn=t.on.bind(t),P._internalOnce=t.once.bind(t),P._removeInternalListener=t.removeListener.bind(t),P._removeAllInternalListeners=t.removeAllListeners.bind(t),P.emit=function(e,r){S.emit(e,r),t.emit(e,r)},typeof P.addEventListener=="function"&&P.addEventListener("wheel",()=>{},{passive:!0}),P},triggerHandler:function(P,S,t){var e,r=P._ev;if(!r)return;var a=r._events[S];if(!a)return;function n(i){if(i.listener){if(r.removeListener(S,i.listener),!i.fired)return i.fired=!0,i.listener.apply(r,[t])}else return i.apply(r,[t])}a=Array.isArray(a)?a:[a];var o;for(o=0;o<a.length-1;o++)n(a[o]);return e=n(a[o]),e},purge:function(P){return delete P._ev,delete P.on,delete P.once,delete P.removeListener,delete P.removeAllListeners,delete P.emit,delete P._ev,delete P._internalEv,delete P._internalOn,delete P._internalOnce,delete P._removeInternalListener,delete P._removeAllInternalListeners,P}};$.exports=g}),m0=Ft((Q,$)=>{var c=bn(),g=ms().dfltConfig;function P(t,e){for(var r=[],a,n=0;n<e.length;n++)a=e[n],a===t?r[n]=a:typeof a=="object"?r[n]=Array.isArray(a)?c.extendDeep([],a):c.extendDeepAll({},a):r[n]=a;return r}var S={};S.add=function(t,e,r,a,n){var o,i;if(t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},i=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(i,t.undoQueue.queue.length-i,o),t.undoQueue.index+=1):o=t.undoQueue.queue[i-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(a),o.redo.args.push(n)),t.undoQueue.queue.length>g.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},S.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},S.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},S.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++)S.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},S.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++)S.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},S.plotDo=function(t,e,r){t.autoplay=!0,r=P(t,r),e.apply(null,r)},$.exports=S}),pw=Ft((Q,$)=>{$.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}),Dm=Ft(Q=>{var $=Xo(),c=bn(),g=$o(),P=x1(),S=pw(),t=El(),e=ms().configAttributes,r=Yc(),a=c.extendDeepAll,n=c.isPlainObject,o=c.isArrayOrTypedArray,i=c.nestedProperty,s=c.valObjectMeta,f="_isSubplotObj",x="_isLinkedToArray",y="_arrayAttrRegexps",v="_deprecated",T=[f,x,y,v];Q.IS_SUBPLOT_OBJ=f,Q.IS_LINKED_TO_ARRAY=x,Q.DEPRECATED=v,Q.UNDERSCORE_ATTRS=T,Q.get=function(){var O={};return $.allTypes.forEach(function(N){O[N]=C(N)}),{defs:{valObjects:s,metaKeys:T.concat(["description","role","editType","impliedEdits"]),editType:{traces:r.traces,layout:r.layout},impliedEdits:{}},traces:O,layout:M(),frames:E(),animation:A(t),config:A(e)}},Q.crawl=function(O,N,V,H){var F=V||0;H=H||"",Object.keys(O).forEach(function(U){var W=O[U];if(T.indexOf(U)===-1){var q=(H?H+".":"")+U;N(W,U,O,F,q),!Q.isValObject(W)&&n(W)&&U!=="impliedEdits"&&Q.crawl(W,N,F+1,q)}})},Q.isValObject=function(O){return O&&O.valType!==void 0},Q.findArrayAttributes=function(O){var N=[],V=[],H=[],F,U;function W(X,lt,yt,pt){V=V.slice(0,pt).concat([lt]),H=H.slice(0,pt).concat([X&&X._isLinkedToArray]);var st=X&&(X.valType==="data_array"||X.arrayOk===!0)&&!(V[pt-1]==="colorbar"&&(lt==="ticktext"||lt==="tickvals"));st&&q(F,0,"")}function q(X,lt,yt){var pt=X[V[lt]],st=yt+V[lt];if(lt===V.length-1)o(pt)&&N.push(U+st);else if(H[lt]){if(Array.isArray(pt))for(var tt=0;tt<pt.length;tt++)n(pt[tt])&&q(pt[tt],lt+1,st+"["+tt+"].")}else n(pt)&&q(pt,lt+1,st+".")}return F=O,U="",Q.crawl(g,W),O._module&&O._module.attributes&&Q.crawl(O._module.attributes,W),N},Q.getTraceValObject=function(O,N){var V=N[0],H=1,F,U,W=O._module;if(W||(W=($.modules[O.type||g.type.dflt]||{})._module),!W)return!1;if(F=W.attributes,U=F&&F[V],!U){var q=W.basePlotModule;q&&q.attributes&&(U=q.attributes[V])}return U||(U=g[V]),b(U,N,H)},Q.getLayoutValObject=function(O,N){var V=u(O,N[0]);return b(V,N,1)};function u(O,N){var V,H,F,U,W=O._basePlotModules;if(W){var q;for(V=0;V<W.length;V++){if(F=W[V],F.attrRegex&&F.attrRegex.test(N)){if(F.layoutAttrOverrides)return F.layoutAttrOverrides;!q&&F.layoutAttributes&&(q=F.layoutAttributes)}var X=F.baseLayoutAttrOverrides;if(X&&N in X)return X[N]}if(q)return q}var lt=O._modules;if(lt){for(V=0;V<lt.length;V++)if(U=lt[V].layoutAttributes,U&&N in U)return U[N]}for(H in $.componentsRegistry){if(F=$.componentsRegistry[H],F.name==="colorscale"&&N.indexOf("coloraxis")===0)return F.layoutAttributes[N];if(!F.schema&&N===F.name)return F.layoutAttributes}return N in P?P[N]:!1}function b(O,N,V){if(!O)return!1;if(O._isLinkedToArray){if(_(N[V]))V++;else if(V<N.length)return!1}for(;V<N.length;V++){var H=O[N[V]];if(n(H))O=H;else break;if(V===N.length-1)break;if(O._isLinkedToArray){if(V++,!_(N[V]))return!1}else if(O.valType==="info_array"){V++;var F=N[V];if(!_(F))return!1;var U=O.items;if(Array.isArray(U)){if(F>=U.length)return!1;if(O.dimensions===2){if(V++,N.length===V)return O;var W=N[V];if(!_(W))return!1;O=U[F][W]}else O=U[F]}else O=U}}return O}function _(O){return O===Math.round(O)&&O>=0}function C(O){var N,V;N=$.modules[O]._module,V=N.basePlotModule;var H={};H.type=null;var F=a({},g),U=a({},N.attributes);Q.crawl(U,function(X,lt,yt,pt,st){i(F,st).set(void 0),X===void 0&&i(U,st).set(void 0)}),a(H,F),$.traceIs(O,"noOpacity")&&delete H.opacity,$.traceIs(O,"showLegend")||(delete H.showlegend,delete H.legendgroup),$.traceIs(O,"noHover")&&(delete H.hoverinfo,delete H.hoverlabel),N.selectPoints||delete H.selectedpoints,a(H,U),V.attributes&&a(H,V.attributes),H.type=O;var W={meta:N.meta||{},categories:N.categories||{},animatable:!!N.animatable,type:O,attributes:A(H)};if(N.layoutAttributes){var q={};a(q,N.layoutAttributes),W.layoutAttributes=A(q)}return N.animatable||Q.crawl(W,function(X){Q.isValObject(X)&&"anim"in X&&delete X.anim}),W}function M(){var O={},N,V;a(O,P);for(N in $.subplotsRegistry)if(V=$.subplotsRegistry[N],!!V.layoutAttributes)if(Array.isArray(V.attr))for(var H=0;H<V.attr.length;H++)w(O,V,V.attr[H]);else{var F=V.attr==="subplot"?V.name:V.attr;w(O,V,F)}for(N in $.componentsRegistry){V=$.componentsRegistry[N];var U=V.schema;if(U&&(U.subplots||U.layout)){var W=U.subplots;if(W&&W.xaxis&&!W.yaxis)for(var q in W.xaxis)delete O.yaxis[q];delete O.xaxis.shift,delete O.xaxis.autoshift}else V.name==="colorscale"?a(O,V.layoutAttributes):V.layoutAttributes&&R(O,V.layoutAttributes,V.name)}return{layoutAttributes:A(O)}}function E(){var O={frames:a({},S)};return A(O),O.frames}function A(O){return h(O),p(O),k(O),O}function h(O){function N(H){return{valType:"string",editType:"none"}}function V(H,F,U){Q.isValObject(H)?(H.arrayOk===!0||H.valType==="data_array")&&(U[F+"src"]=N()):n(H)&&(H.role="object")}Q.crawl(O,V)}function p(O){function N(V,H,F){if(V){var U=V[x];U&&(delete V[x],F[H]={items:{}},F[H].items[U]=V,F[H].role="object")}}Q.crawl(O,N)}function k(O){function N(V){for(var H in V)if(n(V[H]))N(V[H]);else if(Array.isArray(V[H]))for(var F=0;F<V[H].length;F++)N(V[H][F]);else V[H]instanceof RegExp&&(V[H]=V[H].toString())}N(O)}function w(O,N,V){var H=i(O,V),F=a({},N.layoutAttributes);F[f]=!0,H.set(F)}function R(O,N,V){var H=i(O,V);H.set(a(H.get()||{},N))}}),pu=Ft(Q=>{var $=bn(),c=$o(),g="templateitemname",P={name:{valType:"string",editType:"none"}};P[g]={valType:"string",editType:"calc"},Q.templatedArray=function(e,r){return r._isLinkedToArray=e,r.name=P.name,r[g]=P[g],r},Q.traceTemplater=function(e){var r={},a,n;for(a in e)n=e[a],Array.isArray(n)&&n.length&&(r[a]=0);function o(i){a=$.coerce(i,{},c,"type");var s={type:a,_template:null};if(a in r){n=e[a];var f=r[a]%n.length;r[a]++,s._template=n[f]}return s}return{newTrace:o}},Q.newContainer=function(e,r,a){var n=e._template,o=n&&(n[r]||a&&n[a]);$.isPlainObject(o)||(o=null);var i=e[r]={_template:o};return i},Q.arrayTemplater=function(e,r,a){var n=e._template,o=n&&n[t(r)],i=n&&n[r];(!Array.isArray(i)||!i.length)&&(i=[]);var s={};function f(y){var v={name:y.name,_input:y},T=v[g]=y[g];if(!S(T))return v._template=o,v;for(var u=0;u<i.length;u++){var b=i[u];if(b.name===T)return s[T]=1,v._template=b,v}return v[a]=y[a]||!1,v._template=!1,v}function x(){for(var y=[],v=0;v<i.length;v++){var T=i[v],u=T.name;if(S(u)&&!s[u]){var b={_template:T,name:u,_input:{_templateitemname:u}};b[g]=T[g],y.push(b),s[u]=1}}return y}return{newItem:f,defaultItems:x}};function S(e){return e&&typeof e=="string"}function t(e){var r=e.length-1;return e.charAt(r)!=="s"&&$.warn("bad argument to arrayDefaultKey: "+e),e.substr(0,e.length-1)+"defaults"}Q.arrayDefaultKey=t,Q.arrayEditor=function(e,r,a){var n=($.nestedProperty(e,r).get()||[]).length,o=a._index,i=o>=n&&(a._input||{})._templateitemname;i&&(o=n);var s=r+"["+o+"]",f;function x(){f={},i&&(f[s]={},f[s][g]=i)}x();function y(b,_){f[b]=_}function v(b,_){i?$.nestedProperty(f[s],b).set(_):f[s+"."+b]=_}function T(){var b=f;return x(),b}function u(b,_){b&&v(b,_);var C=T();for(var M in C)$.nestedProperty(e,M).set(C[M])}return{modifyBase:y,modifyItem:v,getUpdateObj:T,applyUpdate:u}}}),ic=Ft((Q,$)=>{var c=vo().counter;$.exports={idRegex:{x:c("x","( domain)?"),y:c("y","( domain)?")},attrRegex:c("[xy]axis"),xAxisMatch:c("xaxis"),yAxisMatch:c("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}),Rc=Ft(Q=>{var $=Xo(),c=ic();Q.id2name=function(P){if(!(typeof P!="string"||!P.match(c.AX_ID_PATTERN))){var S=P.split(" ")[0].substr(1);return S==="1"&&(S=""),P.charAt(0)+"axis"+S}},Q.name2id=function(P){if(P.match(c.AX_NAME_PATTERN)){var S=P.substr(5);return S==="1"&&(S=""),P.charAt(0)+S}},Q.cleanId=function(P,S,t){var e=/( domain)$/.test(P);if(!(typeof P!="string"||!P.match(c.AX_ID_PATTERN))&&!(S&&P.charAt(0)!==S)&&!(e&&!t)){var r=P.split(" ")[0].substr(1).replace(/^0+/,"");return r==="1"&&(r=""),P.charAt(0)+r+(e&&t?" domain":"")}},Q.list=function(P,S,t){var e=P._fullLayout;if(!e)return[];var r=Q.listIds(P,S),a=new Array(r.length),n;for(n=0;n<r.length;n++){var o=r[n];a[n]=e[o.charAt(0)+"axis"+o.substr(1)]}if(!t){var i=e._subplots.gl3d||[];for(n=0;n<i.length;n++){var s=e[i[n]];S?a.push(s[S+"axis"]):a.push(s.xaxis,s.yaxis,s.zaxis)}}return a},Q.listIds=function(P,S){var t=P._fullLayout;if(!t)return[];var e=t._subplots;return S?e[S+"axis"]:e.xaxis.concat(e.yaxis)},Q.getFromId=function(P,S,t){var e=P._fullLayout;return S=S===void 0||typeof S!="string"?S:S.replace(" domain",""),t==="x"?S=S.replace(/y[0-9]*/,""):t==="y"&&(S=S.replace(/x[0-9]*/,"")),e[Q.id2name(S)]},Q.getFromTrace=function(P,S,t){var e=P._fullLayout,r=null;if($.traceIs(S,"gl3d")){var a=S.scene;a.substr(0,5)==="scene"&&(r=e[a][t+"axis"])}else r=Q.getFromId(P,S[t+"axis"]||t);return r},Q.idSort=function(P,S){var t=P.charAt(0),e=S.charAt(0);return t!==e?t>e?1:-1:+(P.substr(1)||1)-+(S.substr(1)||1)},Q.ref2id=function(P){return/^[xyz]/.test(P)?P.split(" ")[0]:!1};function g(P,S){if(S&&S.length){for(var t=0;t<S.length;t++)if(S[t][P])return!0}return!1}Q.isLinked=function(P,S){return g(S,P._axisMatchGroups)||g(S,P._axisConstraintGroups)}}),C0=Ft((Q,$)=>{function c(P){var S=P._fullLayout._zoomlayer;S&&S.selectAll(".outline-controllers").remove()}function g(P){var S=P._fullLayout._zoomlayer;S&&S.selectAll(".select-outline").remove(),P._fullLayout._outlining=!1}$.exports={clearOutlineControllers:c,clearOutline:g}}),pg=Ft((Q,$)=>{$.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}),ud=Ft(Q=>{var $=Xo();ic().SUBPLOT_PATTERN,Q.getSubplotCalcData=function(c,g,P){var S=$.subplotsRegistry[g];if(!S)return[];for(var t=S.attr,e=[],r=0;r<c.length;r++){var a=c[r],n=a[0].trace;n[t]===P&&e.push(a)}return e},Q.getModuleCalcData=function(c,g,P){var S=[],t=[],e;if(typeof g=="string"?e=$.getModule(g).plot:typeof g=="function"?e=g:e=g.plot,!e)return[S,c];for(var r=P,a=0;a<c.length;a++){var n=c[a],o=n[0].trace,i=o.zorder!==void 0;o.visible!==!0||o._length===0||(o._module&&o._module.plot===e&&(!i||o.zorder===r)?S.push(n):t.push(n))}return[S,t]},Q.getSubplotData=function(c,g,P){if(!$.subplotsRegistry[g])return[];for(var S=$.subplotsRegistry[g].attr,t=[],e,r,a,n=0;n<c.length;n++)e=c[n],e[S]===P&&t.push(e);return t}}),k1=Ft(Q=>{var $=Xo(),c=bn();Q.manageCommandObserver=function(r,a,n,o){var i={},s=!0;a&&a._commandObserver&&(i=a._commandObserver),i.cache||(i.cache={}),i.lookupTable={};var f=Q.hasSimpleAPICommandBindings(r,n,i.lookupTable);if(a&&a._commandObserver){if(f)return i;if(a._commandObserver.remove)return a._commandObserver.remove(),a._commandObserver=null,i}if(f){g(r,f,i.cache),i.check=function(){if(s){var v=g(r,f,i.cache);return v.changed&&o&&i.lookupTable[v.value]!==void 0&&(i.disable(),Promise.resolve(o({value:v.value,type:f.type,prop:f.prop,traces:f.traces,index:i.lookupTable[v.value]})).then(i.enable,i.enable)),v.changed}};for(var x=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],y=0;y<x.length;y++)r._internalOn(x[y],i.check);i.remove=function(){for(var v=0;v<x.length;v++)r._removeInternalListener(x[v],i.check)}}else c.log("Unable to automatically bind plot updates to API command"),i.lookupTable={},i.remove=function(){};return i.disable=function(){s=!1},i.enable=function(){s=!0},a&&(a._commandObserver=i),i},Q.hasSimpleAPICommandBindings=function(r,a,n){var o,i=a.length,s;for(o=0;o<i;o++){var f,x=a[o],y=x.method,v=x.args;if(Array.isArray(v)||(v=[]),!y)return!1;var T=Q.computeAPICommandBindings(r,y,v);if(T.length!==1)return!1;if(!s)s=T[0],Array.isArray(s.traces)&&s.traces.sort();else{if(f=T[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 u=0;u<s.traces.length;u++)if(s.traces[u]!==f.traces[u])return!1}else return!1;else if(f.prop!==s.prop)return!1}f=T[0];var b=f.value;if(Array.isArray(b))if(b.length===1)b=b[0];else return!1;n&&(n[b]=o)}return s};function g(r,a,n){var o,i,s,f=!1;if(a.type==="data")o=r._fullData[a.traces!==null?a.traces[0]:0];else if(a.type==="layout")o=r._fullLayout;else return!1;return i=c.nestedProperty(o,a.prop).get(),s=n[a.type]=n[a.type]||{},s.hasOwnProperty(a.prop)&&s[a.prop]!==i&&(f=!0),s[a.prop]=i,{changed:f,value:i}}Q.executeAPICommand=function(r,a,n){if(a==="skip")return Promise.resolve();var o=$.apiMethodRegistry[a],i=[r];Array.isArray(n)||(n=[]);for(var s=0;s<n.length;s++)i.push(n[s]);return o.apply(null,i).catch(function(f){return c.warn("API call to Plotly."+a+" rejected.",f),Promise.reject(f)})},Q.computeAPICommandBindings=function(r,a,n){var o;switch(Array.isArray(n)||(n=[]),a){case"restyle":o=t(r,n);break;case"relayout":o=S(r,n);break;case"update":o=t(r,[n[0],n[2]]).concat(S(r,[n[1]]));break;case"animate":o=P(r,n);break;default:o=[]}return o};function P(r,a){return Array.isArray(a[0])&&a[0].length===1&&["string","number"].indexOf(typeof a[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:a[0][0].toString()}]:[]}function S(r,a){var n=[],o=a[0],i={};if(typeof o=="string")i[o]=a[1];else if(c.isPlainObject(o))i=o;else return n;return e(i,function(s,f,x){n.push({type:"layout",prop:s,value:x})},"",0),n}function t(r,a){var n,o,i,s,f=[];if(o=a[0],i=a[1],n=a[2],s={},typeof o=="string")s[o]=i;else if(c.isPlainObject(o))s=o,n===void 0&&(n=i);else return f;return n===void 0&&(n=null),e(s,function(x,y,v){var T,u;if(Array.isArray(v)){u=v.slice();var b=Math.min(u.length,r.data.length);n&&(b=Math.min(b,n.length)),T=[];for(var _=0;_<b;_++)T[_]=n?n[_]:_}else u=v,T=n?n.slice():null;if(T===null)Array.isArray(u)&&(u=u[0]);else if(Array.isArray(T)){if(!Array.isArray(u)){var C=u;u=[];for(var M=0;M<T.length;M++)u[M]=C}u.length=Math.min(T.length,u.length)}f.push({type:"data",prop:x,traces:T,value:u})},"",0),f}function e(r,a,n,o){Object.keys(r).forEach(function(i){var s=r[i];if(i[0]!=="_"){var f=n+(o>0?".":"")+i;c.isPlainObject(s)?e(s,a,f,o+1):a(f,i,s)}})}}),Kc=Ft((Q,$)=>{var c=un(),g=fa().timeFormatLocale,P=Li().formatLocale,S=ra(),t=Ni(),e=Xo(),r=Dm(),a=pu(),n=bn(),o=li(),i=Da().BADNUM,s=Rc(),f=C0().clearOutline,x=pg(),y=El(),v=pw(),T=ud().getModuleCalcData,u=n.relinkPrivateKeys,b=n._,_=$.exports={};n.extendFlat(_,e),_.attributes=$o(),_.attributes.type.values=_.allTypes,_.fontAttrs=Ea(),_.layoutAttributes=x1();var C=k1();_.executeAPICommand=C.executeAPICommand,_.computeAPICommandBindings=C.computeAPICommandBindings,_.manageCommandObserver=C.manageCommandObserver,_.hasSimpleAPICommandBindings=C.hasSimpleAPICommandBindings,_.redrawText=function(tt){return tt=n.getGraphDiv(tt),new Promise(function(dt){setTimeout(function(){tt._fullLayout&&(e.getComponentMethod("annotations","draw")(tt),e.getComponentMethod("legend","draw")(tt),e.getComponentMethod("colorbar","draw")(tt),dt(_.previousPromises(tt)))},300)})},_.resize=function(tt){tt=n.getGraphDiv(tt);var dt,rt=new Promise(function(at,vt){(!tt||n.isHidden(tt))&&vt(new Error("Resize must be passed a displayed plot div element.")),tt._redrawTimer&&clearTimeout(tt._redrawTimer),tt._resolveResize&&(dt=tt._resolveResize),tt._resolveResize=at,tt._redrawTimer=setTimeout(function(){if(!tt.layout||tt.layout.width&&tt.layout.height||n.isHidden(tt)){at(tt);return}delete tt.layout.width,delete tt.layout.height;var it=tt.changed;tt.autoplay=!0,e.call("relayout",tt,{autosize:!0}).then(function(){tt.changed=it,tt._resolveResize===at&&(delete tt._resolveResize,at(tt))})},100)});return dt&&dt(rt),rt},_.previousPromises=function(tt){if((tt._promises||[]).length)return Promise.all(tt._promises).then(function(){tt._promises=[]})},_.addLinks=function(tt){if(!(!tt._context.showLink&&!tt._context.showSources)){var dt=tt._fullLayout,rt=n.ensureSingle(dt._paper,"text","js-plot-link-container",function(ut){ut.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:o.defaultLine,"pointer-events":"all"}).each(function(){var wt=c.select(this);wt.append("tspan").classed("js-link-to-tool",!0),wt.append("tspan").classed("js-link-spacer",!0),wt.append("tspan").classed("js-sourcelinks",!0)})}),at=rt.node(),vt={y:dt._paper.attr("height")-9};document.body.contains(at)&&at.getComputedTextLength()>=dt.width-20?(vt["text-anchor"]="start",vt.x=5):(vt["text-anchor"]="end",vt.x=dt._paper.attr("width")-7),rt.attr(vt);var it=rt.select(".js-link-to-tool"),Y=rt.select(".js-link-spacer"),ft=rt.select(".js-sourcelinks");tt._context.showSources&&tt._context.showSources(tt),tt._context.showLink&&M(tt,it),Y.text(it.text()&&ft.text()?" - ":"")}};function M(tt,dt){dt.text("");var rt=dt.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(tt._context.linkText+" »");if(tt._context.sendData)rt.on("click",function(){_.sendDataToCloud(tt)});else{var at=window.location.pathname.split("/"),vt=window.location.search;rt.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+at[2].split(".")[0]+"/"+at[1]+vt})}}_.sendDataToCloud=function(tt){var dt=(window.PLOTLYENV||{}).BASE_URL||tt._context.plotlyServerURL;if(dt){tt.emit("plotly_beforeexport");var rt=c.select(tt).append("div").attr("id","hiddenform").style("display","none"),at=rt.append("form").attr({action:dt+"/external",method:"post",target:"_blank"}),vt=at.append("input").attr({type:"text",name:"data"});return vt.node().value=_.graphJson(tt,!1,"keepdata"),at.node().submit(),rt.remove(),tt.emit("plotly_afterexport"),!1}};var E=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],A=["year","month","dayMonth","dayMonthYear"];_.supplyDefaults=function(tt,dt){var rt=dt&&dt.skipUpdateCalc,at=tt._fullLayout||{};if(at._skipDefaults){delete at._skipDefaults;return}var vt=tt._fullLayout={},it=tt.layout||{},Y=tt._fullData||[],ft=tt._fullData=[],ut=tt.data||[],wt=tt.calcdata||[],zt=tt._context||{},Pt;tt._transitionData||_.createTransitionData(tt),vt._dfltTitle={plot:b(tt,"Click to enter Plot title"),subtitle:b(tt,"Click to enter Plot subtitle"),x:b(tt,"Click to enter X axis title"),y:b(tt,"Click to enter Y axis title"),colorbar:b(tt,"Click to enter Colorscale title"),annotation:b(tt,"new text")},vt._traceWord=b(tt,"trace");var Wt=k(tt,E);if(vt._mapboxAccessToken=zt.mapboxAccessToken,at._initialAutoSizeIsDone){var Ht=at.width,Jt=at.height;_.supplyLayoutGlobalDefaults(it,vt,Wt),it.width||(vt.width=Ht),it.height||(vt.height=Jt),_.sanitizeMargins(vt)}else{_.supplyLayoutGlobalDefaults(it,vt,Wt);var ge=!it.width||!it.height,he=vt.autosize,de=zt.autosizable,se=ge&&(he||de);se?_.plotAutoSize(tt,it,vt):ge&&_.sanitizeMargins(vt),!he&&ge&&(it.width=vt.width,it.height=vt.height)}vt._d3locale=w(Wt,vt.separators),vt._extraFormat=k(tt,A),vt._initialAutoSizeIsDone=!0,vt._dataLength=ut.length,vt._modules=[],vt._visibleModules=[],vt._basePlotModules=[];var Tt=vt._subplots=p(),Lt=vt._splomAxes={x:{},y:{}},Mt=vt._splomSubplots={};vt._splomGridDflt={},vt._scatterStackOpts={},vt._firstScatter={},vt._alignmentOpts={},vt._colorAxes={},vt._requestRangeslider={},vt._traceUids=h(Y,ut),_.supplyDataDefaults(ut,ft,it,vt);var te=Object.keys(Lt.x),ve=Object.keys(Lt.y);if(te.length>1&&ve.length>1){for(e.getComponentMethod("grid","sizeDefaults")(it,vt),Pt=0;Pt<te.length;Pt++)n.pushUnique(Tt.xaxis,te[Pt]);for(Pt=0;Pt<ve.length;Pt++)n.pushUnique(Tt.yaxis,ve[Pt]);for(var oe in Mt)n.pushUnique(Tt.cartesian,oe)}if(vt._has=_._hasPlotType.bind(vt),Y.length===ft.length)for(Pt=0;Pt<ft.length;Pt++)u(ft[Pt],Y[Pt]);_.supplyLayoutModuleDefaults(it,vt,ft,tt._transitionData);var Te=vt._visibleModules,He=[];for(Pt=0;Pt<Te.length;Pt++){var Ge=Te[Pt].crossTraceDefaults;Ge&&n.pushUnique(He,Ge)}for(Pt=0;Pt<He.length;Pt++)He[Pt](ft,vt);vt._hasOnlyLargeSploms=vt._basePlotModules.length===1&&vt._basePlotModules[0].name==="splom"&&te.length>15&&ve.length>15&&vt.shapes.length===0&&vt.images.length===0,_.linkSubplots(ft,vt,Y,at),_.cleanPlot(ft,vt,Y,at);var cr=!!(at._has&&at._has("cartesian")),ur=!!(vt._has&&vt._has("cartesian")),jr=cr,Hr=ur;jr&&!Hr?at._bgLayer.remove():Hr&&!jr&&(vt._shouldCreateBgLayer=!0),at._zoomlayer&&!tt._dragging&&f({_fullLayout:at}),R(ft,vt),u(vt,at),e.getComponentMethod("colorscale","crossTraceDefaults")(ft,vt),vt._preGUI||(vt._preGUI={}),vt._tracePreGUI||(vt._tracePreGUI={});var br=vt._tracePreGUI,Kr={},rn;for(rn in br)Kr[rn]="old";for(Pt=0;Pt<ft.length;Pt++)rn=ft[Pt]._fullInput.uid,Kr[rn]||(br[rn]={}),Kr[rn]="new";for(rn in Kr)Kr[rn]==="old"&&delete br[rn];V(vt),e.getComponentMethod("rangeslider","makeData")(vt),!rt&&wt.length===ft.length&&_.supplyDefaultsUpdateCalc(wt,ft)},_.supplyDefaultsUpdateCalc=function(tt,dt){for(var rt=0;rt<dt.length;rt++){var at=dt[rt],vt=(tt[rt]||[])[0];if(vt&&vt.trace){var it=vt.trace;if(it._hasCalcTransform){var Y=it._arrayAttrs,ft,ut,wt;for(ft=0;ft<Y.length;ft++)ut=Y[ft],wt=n.nestedProperty(it,ut).get().slice(),n.nestedProperty(at,ut).set(wt)}vt.trace=at}}};function h(tt,dt){var rt=dt.length,at=[],vt,it;for(vt=0;vt<tt.length;vt++){var Y=tt[vt]._fullInput;Y!==it&&at.push(Y),it=Y}var ft=at.length,ut=new Array(rt),wt={};function zt(Ht,Jt){ut[Jt]=Ht,wt[Ht]=1}function Pt(Ht,Jt){if(Ht&&typeof Ht=="string"&&!wt[Ht])return zt(Ht,Jt),!0}for(vt=0;vt<rt;vt++){var Wt=dt[vt].uid;typeof Wt=="number"&&(Wt=String(Wt)),!Pt(Wt,vt)&&(vt<ft&&Pt(at[vt].uid,vt)||zt(n.randstr(wt),vt))}return ut}function p(){var tt=e.collectableSubplotTypes,dt={},rt,at;if(!tt){tt=[];var vt=e.subplotsRegistry;for(var it in vt){var Y=vt[it],ft=Y.attr;if(ft&&(tt.push(it),Array.isArray(ft)))for(at=0;at<ft.length;at++)n.pushUnique(tt,ft[at])}}for(rt=0;rt<tt.length;rt++)dt[tt[rt]]=[];return dt}function k(tt,dt){var rt=tt._context.locale;rt||(rt="en-US");var at=!1,vt={};function it(Pt){for(var Wt=!0,Ht=0;Ht<dt.length;Ht++){var Jt=dt[Ht];vt[Jt]||(Pt[Jt]?vt[Jt]=Pt[Jt]:Wt=!1)}Wt&&(at=!0)}for(var Y=0;Y<2;Y++){for(var ft=tt._context.locales,ut=0;ut<2;ut++){var wt=(ft[rt]||{}).format;if(wt&&(it(wt),at))break;ft=e.localeRegistry}var zt=rt.split("-")[0];if(at||zt===rt)break;rt=zt}return at||it(e.localeRegistry.en.format),vt}function w(tt,dt){return tt.decimal=dt.charAt(0),tt.thousands=dt.charAt(1),{numberFormat:function(rt){try{rt=P(tt).format(n.adjustFormat(rt))}catch{return n.warnBadFormat(rt),n.noFormat}return rt},timeFormat:g(tt).utcFormat}}function R(tt,dt){var rt,at=[];dt.meta&&(rt=dt._meta={meta:dt.meta,layout:{meta:dt.meta}});for(var vt=0;vt<tt.length;vt++){var it=tt[vt];it.meta?at[it.index]=it._meta={meta:it.meta}:dt.meta&&(it._meta={meta:dt.meta}),dt.meta&&(it._meta.layout={meta:dt.meta})}at.length&&(rt||(rt=dt._meta={}),rt.data=at)}_.createTransitionData=function(tt){tt._transitionData||(tt._transitionData={}),tt._transitionData._frames||(tt._transitionData._frames=[]),tt._transitionData._frameHash||(tt._transitionData._frameHash={}),tt._transitionData._counter||(tt._transitionData._counter=0),tt._transitionData._interruptCallbacks||(tt._transitionData._interruptCallbacks=[])},_._hasPlotType=function(tt){var dt,rt=this._basePlotModules||[];for(dt=0;dt<rt.length;dt++)if(rt[dt].name===tt)return!0;var at=this._modules||[];for(dt=0;dt<at.length;dt++){var vt=at[dt].name;if(vt===tt)return!0;var it=e.modules[vt];if(it&&it.categories[tt])return!0}return!1},_.cleanPlot=function(tt,dt,rt,at){var vt,it,Y=at._basePlotModules||[];for(vt=0;vt<Y.length;vt++){var ft=Y[vt];ft.clean&&ft.clean(tt,dt,rt,at)}var ut=at._has&&at._has("gl"),wt=dt._has&&dt._has("gl");ut&&!wt&&at._glcontainer!==void 0&&(at._glcontainer.selectAll(".gl-canvas").remove(),at._glcontainer.selectAll(".no-webgl").remove(),at._glcanvas=null);var zt=!!at._infolayer;t:for(vt=0;vt<rt.length;vt++){var Pt=rt[vt],Wt=Pt.uid;for(it=0;it<tt.length;it++){var Ht=tt[it];if(Wt===Ht.uid)continue t}zt&&at._infolayer.select(".cb"+Wt).remove()}},_.linkSubplots=function(tt,dt,rt,at){var vt,it,Y=at._plots||{},ft=dt._plots={},ut=dt._subplots,wt={_fullData:tt,_fullLayout:dt},zt=ut.cartesian||[];for(vt=0;vt<zt.length;vt++){var Pt=zt[vt],Wt=Y[Pt],Ht=s.getFromId(wt,Pt,"x"),Jt=s.getFromId(wt,Pt,"y"),ge;for(Wt?ge=ft[Pt]=Wt:(ge=ft[Pt]={},ge.id=Pt),Ht._counterAxes.push(Jt._id),Jt._counterAxes.push(Ht._id),Ht._subplotsWith.push(Pt),Jt._subplotsWith.push(Pt),ge.xaxis=Ht,ge.yaxis=Jt,ge._hasClipOnAxisFalse=!1,it=0;it<tt.length;it++){var he=tt[it];if(he.xaxis===ge.xaxis._id&&he.yaxis===ge.yaxis._id&&he.cliponaxis===!1){ge._hasClipOnAxisFalse=!0;break}}}var de=s.list(wt,null,!0),se;for(vt=0;vt<de.length;vt++){se=de[vt];var Tt=null;se.overlaying&&(Tt=s.getFromId(wt,se.overlaying),Tt&&Tt.overlaying&&(se.overlaying=!1,Tt=null)),se._mainAxis=Tt||se,Tt&&(se.domain=Tt.domain.slice()),se._anchorAxis=se.anchor==="free"?null:s.getFromId(wt,se.anchor)}for(vt=0;vt<de.length;vt++)if(se=de[vt],se._counterAxes.sort(s.idSort),se._subplotsWith.sort(n.subplotSort),se._mainSubplot=O(se,dt),se._counterAxes.length&&(se.spikemode&&se.spikemode.indexOf("across")!==-1||se.automargin&&se.mirror&&se.anchor!=="free"||e.getComponentMethod("rangeslider","isVisible")(se))){var Lt=1,Mt=0;for(it=0;it<se._counterAxes.length;it++){var te=s.getFromId(wt,se._counterAxes[it]);Lt=Math.min(Lt,te.domain[0]),Mt=Math.max(Mt,te.domain[1])}Lt<Mt&&(se._counterDomainMin=Lt,se._counterDomainMax=Mt)}};function O(tt,dt){var rt={_fullLayout:dt},at=tt._id.charAt(0)==="x",vt=tt._mainAxis._anchorAxis,it="",Y="",ft="";if(vt&&(ft=vt._mainAxis._id,it=at?tt._id+ft:ft+tt._id),!it||!dt._plots[it]){it="";for(var ut=tt._counterAxes,wt=0;wt<ut.length;wt++){var zt=ut[wt],Pt=at?tt._id+zt:zt+tt._id;Y||(Y=Pt);var Wt=s.getFromId(rt,zt);if(ft&&Wt.overlaying===ft){it=Pt;break}}}return it||Y}_.clearExpandedTraceDefaultColors=function(tt){var dt,rt,at;function vt(Y,ft,ut,wt){rt[wt]=ft,rt.length=wt+1,Y.valType==="color"&&Y.dflt===void 0&&dt.push(rt.join("."))}for(rt=[],dt=tt._module._colorAttrs,dt||(tt._module._colorAttrs=dt=[],r.crawl(tt._module.attributes,vt)),at=0;at<dt.length;at++){var it=n.nestedProperty(tt,"_input."+dt[at]);it.get()||n.nestedProperty(tt,dt[at]).set(null)}},_.supplyDataDefaults=function(tt,dt,rt,at){var vt=at._modules,it=at._visibleModules,Y=at._basePlotModules,ft=0,ut,wt,zt;at._transformModules=[];function Pt(de){dt.push(de);var se=de._module;se&&(n.pushUnique(vt,se),de.visible===!0&&n.pushUnique(it,se),n.pushUnique(Y,de._module.basePlotModule),de._input.visible!==!1&&ft++)}var Wt={},Ht=[],Jt=(rt.template||{}).data||{},ge=a.traceTemplater(Jt);for(ut=0;ut<tt.length;ut++)zt=tt[ut],wt=ge.newTrace(zt),wt.uid=at._traceUids[ut],_.supplyTraceDefaults(zt,wt,ft,at,ut),wt.index=ut,wt._input=zt,wt._fullInput=wt,Pt(wt),e.traceIs(wt,"carpetAxis")&&(Wt[wt.carpet]=wt),e.traceIs(wt,"carpetDependent")&&Ht.push(ut);for(ut=0;ut<Ht.length;ut++)if(wt=dt[Ht[ut]],!!wt.visible){var he=Wt[wt.carpet];if(wt._carpet=he,!he||!he.visible){wt.visible=!1;continue}wt.xaxis=he.xaxis,wt.yaxis=he.yaxis}},_.supplyAnimationDefaults=function(tt){tt=tt||{};var dt,rt={};function at(vt,it){return n.coerce(tt||{},rt,y,vt,it)}if(at("mode"),at("direction"),at("fromcurrent"),Array.isArray(tt.frame))for(rt.frame=[],dt=0;dt<tt.frame.length;dt++)rt.frame[dt]=_.supplyAnimationFrameDefaults(tt.frame[dt]||{});else rt.frame=_.supplyAnimationFrameDefaults(tt.frame||{});if(Array.isArray(tt.transition))for(rt.transition=[],dt=0;dt<tt.transition.length;dt++)rt.transition[dt]=_.supplyAnimationTransitionDefaults(tt.transition[dt]||{});else rt.transition=_.supplyAnimationTransitionDefaults(tt.transition||{});return rt},_.supplyAnimationFrameDefaults=function(tt){var dt={};function rt(at,vt){return n.coerce(tt||{},dt,y.frame,at,vt)}return rt("duration"),rt("redraw"),dt},_.supplyAnimationTransitionDefaults=function(tt){var dt={};function rt(at,vt){return n.coerce(tt||{},dt,y.transition,at,vt)}return rt("duration"),rt("easing"),dt},_.supplyFrameDefaults=function(tt){var dt={};function rt(at,vt){return n.coerce(tt,dt,v,at,vt)}return rt("group"),rt("name"),rt("traces"),rt("baseframe"),rt("data"),rt("layout"),dt},_.supplyTraceDefaults=function(tt,dt,rt,at,vt){var it=at.colorway||o.defaults,Y=it[rt%it.length],ft;function ut(Tt,Lt){return n.coerce(tt,dt,_.attributes,Tt,Lt)}var wt=ut("visible");ut("type"),ut("name",at._traceWord+" "+vt),ut("uirevision",at.uirevision);var zt=_.getModule(dt);if(dt._module=zt,zt){var Pt=zt.basePlotModule,Wt=Pt.attr,Ht=Pt.attributes;if(Wt&&Ht){var Jt=at._subplots,ge="";if(Array.isArray(Wt))for(ft=0;ft<Wt.length;ft++){var he=Wt[ft],de=n.coerce(tt,dt,Ht,he);Jt[he]&&n.pushUnique(Jt[he],de),ge+=de}else ge=n.coerce(tt,dt,Ht,Wt);Jt[Pt.name]&&n.pushUnique(Jt[Pt.name],ge)}}if(wt&&(ut("customdata"),ut("ids"),ut("meta"),e.traceIs(dt,"showLegend")?(n.coerce(tt,dt,zt.attributes.showlegend?zt.attributes:_.attributes,"showlegend"),ut("legend"),ut("legendwidth"),ut("legendgroup"),ut("legendgrouptitle.text"),ut("legendrank"),dt._dfltShowLegend=!0):dt._dfltShowLegend=!1,zt&&zt.supplyDefaults(tt,dt,Y,at),e.traceIs(dt,"noOpacity")||ut("opacity"),e.traceIs(dt,"notLegendIsolatable")&&(dt.visible=!!dt.visible),e.traceIs(dt,"noHover")||(dt.hovertemplate||n.coerceHoverinfo(tt,dt,at),dt.type!=="parcats"&&e.getComponentMethod("fx","supplyDefaults")(tt,dt,Y,at)),zt&&zt.selectPoints)){var se=ut("selectedpoints");n.isTypedArray(se)&&(dt.selectedpoints=Array.from(se))}return dt},_.supplyLayoutGlobalDefaults=function(tt,dt,rt){function at(Pt,Wt){return n.coerce(tt,dt,_.layoutAttributes,Pt,Wt)}var vt=tt.template;n.isPlainObject(vt)&&(dt.template=vt,dt._template=vt.layout,dt._dataTemplate=vt.data),at("autotypenumbers");var it=n.coerceFont(at,"font"),Y=it.size;n.coerceFont(at,"title.font",it,{overrideDflt:{size:Math.round(Y*1.4)}}),at("title.text",dt._dfltTitle.plot),at("title.xref");var ft=at("title.yref");at("title.pad.t"),at("title.pad.r"),at("title.pad.b"),at("title.pad.l");var ut=at("title.automargin");at("title.x"),at("title.xanchor"),at("title.y"),at("title.yanchor"),at("title.subtitle.text",dt._dfltTitle.subtitle),n.coerceFont(at,"title.subtitle.font",it,{overrideDflt:{size:Math.round(dt.title.font.size*.7)}}),ut&&(ft==="paper"&&(dt.title.y!==0&&(dt.title.y=1),dt.title.yanchor==="auto"&&(dt.title.yanchor=dt.title.y===0?"top":"bottom")),ft==="container"&&(dt.title.y==="auto"&&(dt.title.y=1),dt.title.yanchor==="auto"&&(dt.title.yanchor=dt.title.y<.5?"bottom":"top")));var wt=at("uniformtext.mode");wt&&at("uniformtext.minsize"),at("autosize",!(tt.width&&tt.height)),at("width"),at("height"),at("minreducedwidth"),at("minreducedheight"),at("margin.l"),at("margin.r"),at("margin.t"),at("margin.b"),at("margin.pad"),at("margin.autoexpand"),tt.width&&tt.height&&_.sanitizeMargins(dt),e.getComponentMethod("grid","sizeDefaults")(tt,dt),at("paper_bgcolor"),at("separators",rt.decimal+rt.thousands),at("hidesources"),at("colorway"),at("datarevision");var zt=at("uirevision");at("editrevision",zt),at("selectionrevision",zt),e.getComponentMethod("modebar","supplyLayoutDefaults")(tt,dt),e.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(tt,dt,at),e.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(tt,dt,at),at("meta"),n.isPlainObject(tt.transition)&&(at("transition.duration"),at("transition.easing"),at("transition.ordering")),e.getComponentMethod("calendars","handleDefaults")(tt,dt,"calendar"),e.getComponentMethod("fx","supplyLayoutGlobalDefaults")(tt,dt,at),n.coerce(tt,dt,x,"scattermode")};function N(tt){return typeof tt=="string"&&tt.substr(tt.length-2)==="px"&&parseFloat(tt)}_.plotAutoSize=function(tt,dt,rt){var at=tt._context||{},vt=at.frameMargins,it,Y,ft=n.isPlotDiv(tt);if(ft&&tt.emit("plotly_autosize"),at.fillFrame)it=window.innerWidth,Y=window.innerHeight,document.body.style.overflow="hidden";else{var ut=ft?window.getComputedStyle(tt):{};if(it=N(ut.width)||N(ut.maxWidth)||rt.width,Y=N(ut.height)||N(ut.maxHeight)||rt.height,S(vt)&&vt>0){var wt=1-2*vt;it=Math.round(wt*it),Y=Math.round(wt*Y)}}var zt=_.layoutAttributes.width.min,Pt=_.layoutAttributes.height.min;it<zt&&(it=zt),Y<Pt&&(Y=Pt);var Wt=!dt.width&&Math.abs(rt.width-it)>1,Ht=!dt.height&&Math.abs(rt.height-Y)>1;(Ht||Wt)&&(Wt&&(rt.width=it),Ht&&(rt.height=Y)),tt._initialAutoSize||(tt._initialAutoSize={width:it,height:Y}),_.sanitizeMargins(rt)},_.supplyLayoutModuleDefaults=function(tt,dt,rt,at){var vt=e.componentsRegistry,it=dt._basePlotModules,Y,ft,ut,wt=e.subplotsRegistry.cartesian;for(Y in vt)ut=vt[Y],ut.includeBasePlot&&ut.includeBasePlot(tt,dt);it.length||it.push(wt),dt._has("cartesian")&&(e.getComponentMethod("grid","contentDefaults")(tt,dt),wt.finalizeSubplots(tt,dt));for(var zt in dt._subplots)dt._subplots[zt].sort(n.subplotSort);for(ft=0;ft<it.length;ft++)ut=it[ft],ut.supplyLayoutDefaults&&ut.supplyLayoutDefaults(tt,dt,rt);var Pt=dt._modules;for(ft=0;ft<Pt.length;ft++)ut=Pt[ft],ut.supplyLayoutDefaults&&ut.supplyLayoutDefaults(tt,dt,rt);var Wt=dt._transformModules;for(ft=0;ft<Wt.length;ft++)ut=Wt[ft],ut.supplyLayoutDefaults&&ut.supplyLayoutDefaults(tt,dt,rt,at);for(Y in vt)ut=vt[Y],ut.supplyLayoutDefaults&&ut.supplyLayoutDefaults(tt,dt,rt)},_.purge=function(tt){var dt=tt._fullLayout||{};dt._glcontainer!==void 0&&(dt._glcontainer.selectAll(".gl-canvas").remove(),dt._glcontainer.remove(),dt._glcanvas=null),dt._modeBar&&dt._modeBar.destroy(),tt._transitionData&&(tt._transitionData._interruptCallbacks&&(tt._transitionData._interruptCallbacks.length=0),tt._transitionData._animationRaf&&window.cancelAnimationFrame(tt._transitionData._animationRaf)),n.clearThrottle(),n.clearResponsive(tt),delete tt.data,delete tt.layout,delete tt._fullData,delete tt._fullLayout,delete tt.calcdata,delete tt.empty,delete tt.fid,delete tt.undoqueue,delete tt.undonum,delete tt.autoplay,delete tt.changed,delete tt._promises,delete tt._redrawTimer,delete tt._hmlumcount,delete tt._hmpixcount,delete tt._transitionData,delete tt._transitioning,delete tt._initialAutoSize,delete tt._transitioningWithDuration,delete tt._dragging,delete tt._dragged,delete tt._dragdata,delete tt._hoverdata,delete tt._snapshotInProgress,delete tt._editing,delete tt._mouseDownTime,delete tt._legendMouseDownTime,tt.removeAllListeners&&tt.removeAllListeners()},_.style=function(tt){var dt=tt._fullLayout._visibleModules,rt=[],at;for(at=0;at<dt.length;at++){var vt=dt[at];vt.style&&n.pushUnique(rt,vt.style)}for(at=0;at<rt.length;at++)rt[at](tt)},_.sanitizeMargins=function(tt){if(!(!tt||!tt.margin)){var dt=tt.width,rt=tt.height,at=tt.margin,vt=dt-(at.l+at.r),it=rt-(at.t+at.b),Y;vt<0&&(Y=(dt-1)/(at.l+at.r),at.l=Math.floor(Y*at.l),at.r=Math.floor(Y*at.r)),it<0&&(Y=(rt-1)/(at.t+at.b),at.t=Math.floor(Y*at.t),at.b=Math.floor(Y*at.b))}},_.clearAutoMarginIds=function(tt){tt._fullLayout._pushmarginIds={}},_.allowAutoMargin=function(tt,dt){tt._fullLayout._pushmarginIds[dt]=1};function V(tt){var dt=tt.margin;if(!tt._size){var rt=tt._size={l:Math.round(dt.l),r:Math.round(dt.r),t:Math.round(dt.t),b:Math.round(dt.b),p:Math.round(dt.pad)};rt.w=Math.round(tt.width)-rt.l-rt.r,rt.h=Math.round(tt.height)-rt.t-rt.b}tt._pushmargin||(tt._pushmargin={}),tt._pushmarginIds||(tt._pushmarginIds={}),tt._reservedMargin||(tt._reservedMargin={})}var H=2,F=2;_.autoMargin=function(tt,dt,rt){var at=tt._fullLayout,vt=at.width,it=at.height,Y=at.margin,ft=at.minreducedwidth,ut=at.minreducedheight,wt=n.constrain(vt-Y.l-Y.r,H,ft),zt=n.constrain(it-Y.t-Y.b,F,ut),Pt=Math.max(0,vt-wt),Wt=Math.max(0,it-zt),Ht=at._pushmargin,Jt=at._pushmarginIds;if(Y.autoexpand!==!1){if(!rt)delete Ht[dt],delete Jt[dt];else{var ge=rt.pad;if(ge===void 0&&(ge=Math.min(12,Y.l,Y.r,Y.t,Y.b)),Pt){var he=(rt.l+rt.r)/Pt;he>1&&(rt.l/=he,rt.r/=he)}if(Wt){var de=(rt.t+rt.b)/Wt;de>1&&(rt.t/=de,rt.b/=de)}var se=rt.xl!==void 0?rt.xl:rt.x,Tt=rt.xr!==void 0?rt.xr:rt.x,Lt=rt.yt!==void 0?rt.yt:rt.y,Mt=rt.yb!==void 0?rt.yb:rt.y;Ht[dt]={l:{val:se,size:rt.l+ge},r:{val:Tt,size:rt.r+ge},b:{val:Mt,size:rt.b+ge},t:{val:Lt,size:rt.t+ge}},Jt[dt]=1}if(!at._replotting)return _.doAutoMargin(tt)}};function U(tt){if("_redrawFromAutoMarginCount"in tt._fullLayout)return!1;var dt=s.list(tt,"",!0);for(var rt in dt)if(dt[rt].autoshift||dt[rt].shift)return!0;return!1}_.doAutoMargin=function(tt){var dt=tt._fullLayout,rt=dt.width,at=dt.height;dt._size||(dt._size={}),V(dt);var vt=dt._size,it=dt.margin,Y={t:0,b:0,l:0,r:0},ft=n.extendFlat({},vt),ut=it.l,wt=it.r,zt=it.t,Pt=it.b,Wt=dt._pushmargin,Ht=dt._pushmarginIds,Jt=dt.minreducedwidth,ge=dt.minreducedheight;if(it.autoexpand!==!1){for(var he in Wt)Ht[he]||delete Wt[he];var de=tt._fullLayout._reservedMargin;for(var se in de)for(var Tt in de[se]){var Lt=de[se][Tt];Y[Tt]=Math.max(Y[Tt],Lt)}Wt.base={l:{val:0,size:ut},r:{val:1,size:wt},t:{val:1,size:zt},b:{val:0,size:Pt}};for(var Mt in Y){var te=0;for(var ve in Wt)ve!=="base"&&S(Wt[ve][Mt].size)&&(te=Wt[ve][Mt].size>te?Wt[ve][Mt].size:te);var oe=Math.max(0,it[Mt]-te);Y[Mt]=Math.max(0,Y[Mt]-oe)}for(var Te in Wt){var He=Wt[Te].l||{},Ge=Wt[Te].b||{},cr=He.val,ur=He.size,jr=Ge.val,Hr=Ge.size,br=rt-Y.r-Y.l,Kr=at-Y.t-Y.b;for(var rn in Wt){if(S(ur)&&Wt[rn].r){var Ce=Wt[rn].r.val,$t=Wt[rn].r.size;if(Ce>cr){var ne=(ur*Ce+($t-br)*cr)/(Ce-cr),Ct=($t*(1-cr)+(ur-br)*(1-Ce))/(Ce-cr);ne+Ct>ut+wt&&(ut=ne,wt=Ct)}}if(S(Hr)&&Wt[rn].t){var gt=Wt[rn].t.val,St=Wt[rn].t.size;if(gt>jr){var Nt=(Hr*gt+(St-Kr)*jr)/(gt-jr),ee=(St*(1-jr)+(Hr-Kr)*(1-gt))/(gt-jr);Nt+ee>Pt+zt&&(Pt=Nt,zt=ee)}}}}}var le=n.constrain(rt-it.l-it.r,H,Jt),we=n.constrain(at-it.t-it.b,F,ge),Ue=Math.max(0,rt-le),qe=Math.max(0,at-we);if(Ue){var ar=(ut+wt)/Ue;ar>1&&(ut/=ar,wt/=ar)}if(qe){var Ar=(Pt+zt)/qe;Ar>1&&(Pt/=Ar,zt/=Ar)}if(vt.l=Math.round(ut)+Y.l,vt.r=Math.round(wt)+Y.r,vt.t=Math.round(zt)+Y.t,vt.b=Math.round(Pt)+Y.b,vt.p=Math.round(it.pad),vt.w=Math.round(rt)-vt.l-vt.r,vt.h=Math.round(at)-vt.t-vt.b,!dt._replotting&&(_.didMarginChange(ft,vt)||U(tt))){"_redrawFromAutoMarginCount"in dt?dt._redrawFromAutoMarginCount++:dt._redrawFromAutoMarginCount=1;var Tr=3*(1+Object.keys(Ht).length);if(dt._redrawFromAutoMarginCount<Tr)return e.call("_doPlot",tt);dt._size=ft,n.warn("Too many auto-margin redraws.")}W(tt)};function W(tt){var dt=s.list(tt,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach(function(rt){for(var at=0;at<dt.length;at++){var vt=dt[at][rt];vt&&vt()}})}var q=["l","r","t","b","p","w","h"];_.didMarginChange=function(tt,dt){for(var rt=0;rt<q.length;rt++){var at=q[rt],vt=tt[at],it=dt[at];if(!S(vt)||Math.abs(it-vt)>1)return!0}return!1},_.graphJson=function(tt,dt,rt,at,vt,it){(vt&&dt&&!tt._fullData||vt&&!dt&&!tt._fullLayout)&&_.supplyDefaults(tt);var Y=vt?tt._fullData:tt.data,ft=vt?tt._fullLayout:tt.layout,ut=(tt._transitionData||{})._frames;function wt(Wt,Ht){if(typeof Wt=="function")return Ht?"_function_":null;if(n.isPlainObject(Wt)){var Jt={},ge;return Object.keys(Wt).sort().forEach(function(Tt){if(["_","["].indexOf(Tt.charAt(0))===-1){if(typeof Wt[Tt]=="function"){Ht&&(Jt[Tt]="_function");return}if(rt==="keepdata"){if(Tt.substr(Tt.length-3)==="src")return}else if(rt==="keepstream"){if(ge=Wt[Tt+"src"],typeof ge=="string"&&ge.indexOf(":")>0&&!n.isPlainObject(Wt.stream))return}else if(rt!=="keepall"&&(ge=Wt[Tt+"src"],typeof ge=="string"&&ge.indexOf(":")>0))return;Jt[Tt]=wt(Wt[Tt],Ht)}}),Jt}var he=Array.isArray(Wt),de=n.isTypedArray(Wt);if((he||de)&&Wt.dtype&&Wt.shape){var se=Wt.bdata;return wt({dtype:Wt.dtype,shape:Wt.shape,bdata:n.isArrayBuffer(se)?t.encode(se):se},Ht)}return he?Wt.map(function(Tt){return wt(Tt,Ht)}):de?n.simpleMap(Wt,n.identity):n.isJSDate(Wt)?n.ms2DateTimeLocal(+Wt):Wt}var zt={data:(Y||[]).map(function(Wt){var Ht=wt(Wt);return dt&&delete Ht.fit,Ht})};if(!dt&&(zt.layout=wt(ft),vt)){var Pt=ft._size;zt.layout.computed={margin:{b:Pt.b,l:Pt.l,r:Pt.r,t:Pt.t}}}return ut&&(zt.frames=wt(ut)),it&&(zt.config=wt(tt._context,!0)),at==="object"?zt:JSON.stringify(zt)},_.modifyFrames=function(tt,dt){var rt,at,vt,it=tt._transitionData._frames,Y=tt._transitionData._frameHash;for(rt=0;rt<dt.length;rt++)switch(at=dt[rt],at.type){case"replace":vt=at.value;var ft=(it[at.index]||{}).name,ut=vt.name;it[at.index]=Y[ut]=vt,ut!==ft&&(delete Y[ft],Y[ut]=vt);break;case"insert":vt=at.value,Y[vt.name]=vt,it.splice(at.index,0,vt);break;case"delete":vt=it[at.index],delete Y[vt.name],it.splice(at.index,1);break}return Promise.resolve()},_.computeFrame=function(tt,dt){var rt=tt._transitionData._frameHash,at,vt,it,Y;if(!dt)throw new Error("computeFrame must be given a string frame name");var ft=rt[dt.toString()];if(!ft)return!1;for(var ut=[ft],wt=[ft.name];ft.baseframe&&(ft=rt[ft.baseframe.toString()])&&wt.indexOf(ft.name)===-1;)ut.push(ft),wt.push(ft.name);for(var zt={};ft=ut.pop();)if(ft.layout&&(zt.layout=_.extendLayout(zt.layout,ft.layout)),ft.data){if(zt.data||(zt.data=[]),vt=ft.traces,!vt)for(vt=[],at=0;at<ft.data.length;at++)vt[at]=at;for(zt.traces||(zt.traces=[]),at=0;at<ft.data.length;at++)it=vt[at],it!=null&&(Y=zt.traces.indexOf(it),Y===-1&&(Y=zt.data.length,zt.traces[Y]=it),zt.data[Y]=_.extendTrace(zt.data[Y],ft.data[at]))}return zt},_.recomputeFrameHash=function(tt){for(var dt=tt._transitionData._frameHash={},rt=tt._transitionData._frames,at=0;at<rt.length;at++){var vt=rt[at];vt&&vt.name&&(dt[vt.name]=vt)}},_.extendObjectWithContainers=function(tt,dt,rt){var at,vt,it,Y,ft,ut,wt,zt,Pt=n.extendDeepNoArrays({},dt||{}),Wt=n.expandObjectPaths(Pt),Ht={};if(rt&&rt.length)for(it=0;it<rt.length;it++)at=n.nestedProperty(Wt,rt[it]),vt=at.get(),vt===void 0?n.nestedProperty(Ht,rt[it]).set(null):(at.set(null),n.nestedProperty(Ht,rt[it]).set(vt));if(tt=n.extendDeepNoArrays(tt||{},Wt),rt&&rt.length){for(it=0;it<rt.length;it++)if(ft=n.nestedProperty(Ht,rt[it]),wt=ft.get(),!!wt){for(ut=n.nestedProperty(tt,rt[it]),zt=ut.get(),Array.isArray(zt)||(zt=[],ut.set(zt)),Y=0;Y<wt.length;Y++){var Jt=wt[Y];Jt===null?zt[Y]=null:zt[Y]=_.extendObjectWithContainers(zt[Y],Jt)}ut.set(zt)}}return tt},_.dataArrayContainers=["transforms","dimensions"],_.layoutArrayContainers=e.layoutArrayContainers,_.extendTrace=function(tt,dt){return _.extendObjectWithContainers(tt,dt,_.dataArrayContainers)},_.extendLayout=function(tt,dt){return _.extendObjectWithContainers(tt,dt,_.layoutArrayContainers)},_.transition=function(tt,dt,rt,at,vt,it){var Y={redraw:vt.redraw},ft={},ut=[];return Y.prepareFn=function(){for(var wt=Array.isArray(dt)?dt.length:0,zt=at.slice(0,wt),Pt=0;Pt<zt.length;Pt++){var Wt=zt[Pt],Ht=tt._fullData[Wt],Jt=Ht._module;if(Jt){if(Jt.animatable){var ge=Jt.basePlotModule.name;ft[ge]||(ft[ge]=[]),ft[ge].push(Wt)}tt.data[zt[Pt]]=_.extendTrace(tt.data[zt[Pt]],dt[Pt])}}var he=n.expandObjectPaths(n.extendDeepNoArrays({},rt)),de=/^[xy]axis[0-9]*$/;for(var se in he)de.test(se)&&delete he[se].range;_.extendLayout(tt.layout,he),delete tt.calcdata,_.supplyDefaults(tt),_.doCalcdata(tt);var Tt=n.expandObjectPaths(rt);if(Tt){var Lt=tt._fullLayout._plots;for(var Mt in Lt){var te=Lt[Mt],ve=te.xaxis,oe=te.yaxis,Te=ve.range.slice(),He=oe.range.slice(),Ge=null,cr=null,ur=null,jr=null;Array.isArray(Tt[ve._name+".range"])?Ge=Tt[ve._name+".range"].slice():Array.isArray((Tt[ve._name]||{}).range)&&(Ge=Tt[ve._name].range.slice()),Array.isArray(Tt[oe._name+".range"])?cr=Tt[oe._name+".range"].slice():Array.isArray((Tt[oe._name]||{}).range)&&(cr=Tt[oe._name].range.slice()),Te&&Ge&&(ve.r2l(Te[0])!==ve.r2l(Ge[0])||ve.r2l(Te[1])!==ve.r2l(Ge[1]))&&(ur={xr0:Te,xr1:Ge}),He&&cr&&(oe.r2l(He[0])!==oe.r2l(cr[0])||oe.r2l(He[1])!==oe.r2l(cr[1]))&&(jr={yr0:He,yr1:cr}),(ur||jr)&&ut.push(n.extendFlat({plotinfo:te},ur,jr))}}return Promise.resolve()},Y.runFn=function(wt){var zt,Pt=tt._fullLayout._basePlotModules,Wt=ut.length,Ht;if(rt)for(Ht=0;Ht<Pt.length;Ht++)Pt[Ht].transitionAxes&&Pt[Ht].transitionAxes(tt,ut,it,wt);Wt?(zt=n.extendFlat({},it),zt.duration=0,delete ft.cartesian):zt=it;for(var Jt in ft){var ge=ft[Jt],he=tt._fullData[ge[0]]._module;he.basePlotModule.plot(tt,ge,zt,wt)}},X(tt,it,Y)},_.transitionFromReact=function(tt,dt,rt,at){var vt=tt._fullLayout,it=vt.transition,Y={},ft=[];return Y.prepareFn=function(){var ut=vt._plots;Y.redraw=!1,dt.anim==="some"&&(Y.redraw=!0),rt.anim==="some"&&(Y.redraw=!0);for(var wt in ut){var zt=ut[wt],Pt=zt.xaxis,Wt=zt.yaxis,Ht=at[Pt._name].range.slice(),Jt=at[Wt._name].range.slice(),ge=Pt.range.slice(),he=Wt.range.slice();Pt.setScale(),Wt.setScale();var de=null,se=null;(Pt.r2l(Ht[0])!==Pt.r2l(ge[0])||Pt.r2l(Ht[1])!==Pt.r2l(ge[1]))&&(de={xr0:Ht,xr1:ge}),(Wt.r2l(Jt[0])!==Wt.r2l(he[0])||Wt.r2l(Jt[1])!==Wt.r2l(he[1]))&&(se={yr0:Jt,yr1:he}),(de||se)&&ft.push(n.extendFlat({plotinfo:zt},de,se))}return Promise.resolve()},Y.runFn=function(ut){for(var wt=tt._fullData,zt=tt._fullLayout,Pt=zt._basePlotModules,Wt,Ht,Jt,ge=[],he=0;he<wt.length;he++)ge.push(he);function de(){if(tt._fullLayout)for(var Tt=0;Tt<Pt.length;Tt++)Pt[Tt].transitionAxes&&Pt[Tt].transitionAxes(tt,ft,Wt,ut)}function se(){if(tt._fullLayout)for(var Tt=0;Tt<Pt.length;Tt++)Pt[Tt].plot(tt,Jt,Ht,ut)}ft.length&&dt.anim?it.ordering==="traces first"?(Wt=n.extendFlat({},it,{duration:0}),Jt=ge,Ht=it,setTimeout(de,it.duration),se()):(Wt=it,Jt=null,Ht=n.extendFlat({},it,{duration:0}),setTimeout(se,Wt.duration),de()):ft.length?(Wt=it,de()):dt.anim&&(Jt=ge,Ht=it,se())},X(tt,it,Y)};function X(tt,dt,rt){var at=!1;function vt(Pt){var Wt=Promise.resolve();if(!Pt)return Wt;for(;Pt.length;)Wt=Wt.then(Pt.shift());return Wt}function it(Pt){if(Pt)for(;Pt.length;)Pt.shift()}function Y(){return tt.emit("plotly_transitioning",[]),new Promise(function(Pt){tt._transitioning=!0,dt.duration>0&&(tt._transitioningWithDuration=!0),tt._transitionData._interruptCallbacks.push(function(){at=!0}),rt.redraw&&tt._transitionData._interruptCallbacks.push(function(){return e.call("redraw",tt)}),tt._transitionData._interruptCallbacks.push(function(){tt.emit("plotly_transitioninterrupted",[])});var Wt=0,Ht=0;function Jt(){return Wt++,function(){Ht++,!at&&Ht===Wt&&ft(Pt)}}rt.runFn(Jt),setTimeout(Jt())})}function ft(Pt){if(tt._transitionData)return it(tt._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(rt.redraw)return e.call("redraw",tt)}).then(function(){tt._transitioning=!1,tt._transitioningWithDuration=!1,tt.emit("plotly_transitioned",[])}).then(Pt)}function ut(){if(tt._transitionData)return tt._transitioning=!1,vt(tt._transitionData._interruptCallbacks)}var wt=[_.previousPromises,ut,rt.prepareFn,_.rehover,_.reselect,Y],zt=n.syncOrAsync(wt,tt);return(!zt||!zt.then)&&(zt=Promise.resolve()),zt.then(function(){return tt})}_.doCalcdata=function(tt,dt){var rt=s.list(tt),at=tt._fullData,vt=tt._fullLayout,it,Y,ft,ut,wt=new Array(at.length),zt=(tt.calcdata||[]).slice();for(tt.calcdata=wt,vt._numBoxes=0,vt._numViolins=0,vt._violinScaleGroupStats={},tt._hmpixcount=0,tt._hmlumcount=0,vt._piecolormap={},vt._sunburstcolormap={},vt._treemapcolormap={},vt._iciclecolormap={},vt._funnelareacolormap={},ft=0;ft<at.length;ft++)if(Array.isArray(dt)&&dt.indexOf(ft)===-1){wt[ft]=zt[ft];continue}for(ft=0;ft<at.length;ft++)it=at[ft],it._arrayAttrs=r.findArrayAttributes(it),it._extremes={};var Pt=vt._subplots.polar||[];for(ft=0;ft<Pt.length;ft++)rt.push(vt[Pt[ft]].radialaxis,vt[Pt[ft]].angularaxis);for(var Wt in vt._colorAxes){var Ht=vt[Wt];Ht.cauto!==!1&&(delete Ht.cmin,delete Ht.cmax)}var Jt=!1;function ge(se){if(it=at[se],Y=it._module,it.visible===!0&&it.transforms){if(Y&&Y.calc){var Tt=Y.calc(tt,it);Tt[0]&&Tt[0].t&&Tt[0].t._scene&&delete Tt[0].t._scene.dirty}for(ut=0;ut<it.transforms.length;ut++){var Lt=it.transforms[ut];Y=transformsRegistry[Lt.type],Y&&Y.calcTransform&&(it._hasCalcTransform=!0,Jt=!0,Y.calcTransform(tt,it,Lt))}}}function he(se,Tt){if(it=at[se],Y=it._module,!!Y.isContainer===Tt){var Lt=[];if(it.visible===!0&&it._length!==0){delete it._indexToPoints;var Mt=it.transforms||[];for(ut=Mt.length-1;ut>=0;ut--)if(Mt[ut].enabled){it._indexToPoints=Mt[ut]._indexToPoints;break}Y&&Y.calc&&(Lt=Y.calc(tt,it))}(!Array.isArray(Lt)||!Lt[0])&&(Lt=[{x:i,y:i}]),Lt[0].t||(Lt[0].t={}),Lt[0].trace=it,wt[se]=Lt}}for(pt(rt,at,vt),ft=0;ft<at.length;ft++)he(ft,!0);for(ft=0;ft<at.length;ft++)ge(ft);for(Jt&&pt(rt,at,vt),ft=0;ft<at.length;ft++)he(ft,!0);for(ft=0;ft<at.length;ft++)he(ft,!1);st(tt);var de=yt(rt,tt);if(de.length){for(vt._numBoxes=0,vt._numViolins=0,ft=0;ft<de.length;ft++)he(de[ft],!0);for(ft=0;ft<de.length;ft++)he(de[ft],!1);st(tt)}e.getComponentMethod("fx","calc")(tt),e.getComponentMethod("errorbars","calc")(tt)};var lt=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function yt(tt,dt){var rt=[],at,vt,it,Y,ft;function ut(rn,Ce,$t){var ne=Ce._id.charAt(0);if(rn==="histogram2dcontour"){var Ct=Ce._counterAxes[0],gt=s.getFromId(dt,Ct),St=ne==="x"||Ct==="x"&&gt.type==="category",Nt=ne==="y"||Ct==="y"&&gt.type==="category";return function(ee,le){return ee===0||le===0||St&&ee===$t[le].length-1||Nt&&le===$t.length-1?-1:(ne==="y"?le:ee)-1}}else return function(ee,le){return ne==="y"?le:ee}}var wt={min:function(rn){return n.aggNums(Math.min,null,rn)},max:function(rn){return n.aggNums(Math.max,null,rn)},sum:function(rn){return n.aggNums(function(Ce,$t){return Ce+$t},null,rn)},total:function(rn){return n.aggNums(function(Ce,$t){return Ce+$t},null,rn)},mean:function(rn){return n.mean(rn)},"geometric mean":function(rn){return n.geometricMean(rn)},median:function(rn){return n.median(rn)}};function zt(rn,Ce){return rn[1]-Ce[1]}function Pt(rn,Ce){return Ce[1]-rn[1]}for(at=0;at<tt.length;at++){var Wt=tt[at];if(Wt.type==="category"){var Ht=Wt.categoryorder.match(lt);if(Ht){var Jt=Ht[1],ge=Ht[2],he=Wt._id.charAt(0),de=he==="x",se=[];for(vt=0;vt<Wt._categories.length;vt++)se.push([Wt._categories[vt],[]]);for(vt=0;vt<Wt._traceIndices.length;vt++){var Tt=Wt._traceIndices[vt],Lt=dt._fullData[Tt];if(Lt.visible===!0){var Mt=Lt.type;e.traceIs(Lt,"histogram")&&(delete Lt._xautoBinFinished,delete Lt._yautoBinFinished);var te=Mt==="splom",ve=Mt==="scattergl",oe=dt.calcdata[Tt];for(it=0;it<oe.length;it++){var Te=oe[it],He,Ge;if(te){var cr=Lt._axesDim[Wt._id];if(!de){var ur=Lt._diag[cr][0];ur&&(Wt=dt._fullLayout[s.id2name(ur)])}var jr=Te.trace.dimensions[cr].values;for(Y=0;Y<jr.length;Y++)for(He=Wt._categoriesMap[jr[Y]],ft=0;ft<Te.trace.dimensions.length;ft++)if(ft!==cr){var Hr=Te.trace.dimensions[ft];se[He][1].push(Hr.values[Y])}}else if(ve){for(Y=0;Y<Te.t.x.length;Y++)de?(He=Te.t.x[Y],Ge=Te.t.y[Y]):(He=Te.t.y[Y],Ge=Te.t.x[Y]),se[He][1].push(Ge);Te.t&&Te.t._scene&&delete Te.t._scene.dirty}else if(Te.hasOwnProperty("z")){Ge=Te.z;var br=ut(Lt.type,Wt,Ge);for(Y=0;Y<Ge.length;Y++)for(ft=0;ft<Ge[Y].length;ft++)He=br(ft,Y),He+1&&se[He][1].push(Ge[Y][ft])}else for(He=Te.p,He===void 0&&(He=Te[he]),Ge=Te.s,Ge===void 0&&(Ge=Te.v),Ge===void 0&&(Ge=de?Te.y:Te.x),Array.isArray(Ge)||(Ge===void 0?Ge=[]:Ge=[Ge]),Y=0;Y<Ge.length;Y++)se[He][1].push(Ge[Y])}}}Wt._categoriesValue=se;var Kr=[];for(vt=0;vt<se.length;vt++)Kr.push([se[vt][0],wt[Jt](se[vt][1])]);Kr.sort(ge==="descending"?Pt:zt),Wt._categoriesAggregatedValue=Kr,Wt._initialCategories=Kr.map(function(rn){return rn[0]}),rt=rt.concat(Wt.sortByInitialCategories())}}}return rt}function pt(tt,dt,rt){var at={};function vt(ut){ut.clearCalc(),ut.type==="multicategory"&&ut.setupMultiCategory(dt),at[ut._id]=1}n.simpleMap(tt,vt);for(var it=rt._axisMatchGroups||[],Y=0;Y<it.length;Y++)for(var ft in it[Y])at[ft]||vt(rt[s.id2name(ft)])}function st(tt){var dt=tt._fullLayout,rt=dt._visibleModules,at={},vt,it,Y;for(it=0;it<rt.length;it++){var ft=rt[it],ut=ft.crossTraceCalc;if(ut){var wt=ft.basePlotModule.name;at[wt]?n.pushUnique(at[wt],ut):at[wt]=[ut]}}for(Y in at){var zt=at[Y],Pt=dt._subplots[Y];if(Array.isArray(Pt))for(vt=0;vt<Pt.length;vt++){var Wt=Pt[vt],Ht=Y==="cartesian"?dt._plots[Wt]:dt[Wt];for(it=0;it<zt.length;it++)zt[it](tt,Ht,Wt)}else for(it=0;it<zt.length;it++)zt[it](tt)}}_.rehover=function(tt){tt._fullLayout._rehover&&tt._fullLayout._rehover()},_.redrag=function(tt){tt._fullLayout._redrag&&tt._fullLayout._redrag()},_.reselect=function(tt){var dt=tt._fullLayout,rt=(tt.layout||{}).selections,at=dt._previousSelections;dt._previousSelections=rt;var vt=dt._reselect||JSON.stringify(rt)!==JSON.stringify(at);e.getComponentMethod("selections","reselect")(tt,vt)},_.generalUpdatePerTraceModule=function(tt,dt,rt,at){var vt=dt.traceHash,it={},Y;for(Y=0;Y<rt.length;Y++){var ft=rt[Y],ut=ft[0].trace;ut.visible&&(it[ut.type]=it[ut.type]||[],it[ut.type].push(ft))}for(var wt in vt)if(!it[wt]){var zt=vt[wt][0],Pt=zt[0].trace;Pt.visible=!1,it[wt]=[zt]}for(var Wt in it){var Ht=it[Wt],Jt=Ht[0][0].trace._module;Jt.plot(tt,dt,n.filterVisible(Ht),at)}dt.traceHash=it},_.plotBasePlot=function(tt,dt,rt,at,vt){var it=e.getModule(tt),Y=T(dt.calcdata,it)[0];it.plot(dt,Y,at,vt)},_.cleanBasePlot=function(tt,dt,rt,at,vt){var it=vt._has&&vt._has(tt),Y=rt._has&&rt._has(tt);it&&!Y&&vt["_"+tt+"layer"].selectAll("g.trace").remove()}}),Op=Ft(Q=>{Q.xmlns="http://www.w3.org/2000/xmlns/",Q.svg="http://www.w3.org/2000/svg",Q.xlink="http://www.w3.org/1999/xlink",Q.svgAttrs={xmlns:Q.svg,"xmlns:xlink":Q.xlink}}),Af=Ft((Q,$)=>{$.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"}}}),tc=Ft(Q=>{var $=un(),c=bn(),g=c.strTranslate,P=Op(),S=Af().LINE_SPACING,t=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;Q.convertToTspans=function(F,U,W){var q=F.text(),X=!F.attr("data-notex")&&U&&U._context.typesetMath&&typeof MathJax<"u"&&q.match(t),lt=$.select(F.node().parentNode);if(lt.empty())return;var yt=F.attr("class")?F.attr("class").split(" ")[0]:"text";yt+="-math",lt.selectAll("svg."+yt).remove(),lt.selectAll("g."+yt+"-group").remove(),F.style("display",null).attr({"data-unformatted":q,"data-math":"N"});function pt(){lt.empty()||(yt=F.attr("class")+"-math",lt.select("svg."+yt).remove()),F.text("").style("white-space","pre");var st=O(F.node(),q);st&&F.style("pointer-events","all"),Q.positionText(F),W&&W.call(F)}return X?(U&&U._promises||[]).push(new Promise(function(st){F.style("display","none");var tt=parseInt(F.node().style.fontSize,10),dt={fontSize:tt};o(X[2],dt,function(rt,at,vt){lt.selectAll("svg."+yt).remove(),lt.selectAll("g."+yt+"-group").remove();var it=rt&&rt.select("svg");if(!it||!it.node()){pt(),st();return}var Y=lt.append("g").classed(yt+"-group",!0).attr({"pointer-events":"none","data-unformatted":q,"data-math":"Y"});Y.node().appendChild(it.node()),at&&at.node()&&it.node().insertBefore(at.node().cloneNode(!0),it.node().firstChild);var ft=vt.width,ut=vt.height;it.attr({class:yt,height:ut,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var wt=F.node().style.fill||"black",zt=it.select("g");zt.attr({fill:wt,stroke:wt});var Pt=zt.node().getBoundingClientRect(),Wt=Pt.width,Ht=Pt.height;(Wt>ft||Ht>ut)&&(it.style("overflow","hidden"),Pt=it.node().getBoundingClientRect(),Wt=Pt.width,Ht=Pt.height);var Jt=+F.attr("x"),ge=+F.attr("y"),he=tt||F.node().getBoundingClientRect().height,de=-he/4;if(yt[0]==="y")Y.attr({transform:"rotate("+[-90,Jt,ge]+")"+g(-Wt/2,de-Ht/2)});else if(yt[0]==="l")ge=de-Ht/2;else if(yt[0]==="a"&&yt.indexOf("atitle")!==0)Jt=0,ge=de;else{var se=F.attr("text-anchor");Jt=Jt-Wt*(se==="middle"?.5:se==="end"?1:0),ge=ge+de-Ht/2}it.attr({x:Jt,y:ge}),W&&W.call(F,Y),st(Y)})})):pt(),F};var e=/(<|&lt;|&#60;)/g,r=/(>|&gt;|&#62;)/g;function a(F){return F.replace(e,"\\lt ").replace(r,"\\gt ")}var n=[["$","$"],["\\(","\\)"]];function o(F,U,W){var q=parseInt((MathJax.version||"").split(".")[0]);if(q!==2&&q!==3){c.warn("No MathJax version:",MathJax.version);return}var X,lt,yt,pt,st=function(){return lt=c.extendDeepAll({},MathJax.Hub.config),yt=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:n},displayAlign:"left"})},tt=function(){lt=c.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=n},dt=function(){if(X=MathJax.Hub.config.menuSettings.renderer,X!=="SVG")return MathJax.Hub.setRenderer("SVG")},rt=function(){X=MathJax.config.startup.output,X!=="svg"&&(MathJax.config.startup.output="svg")},at=function(){var wt="math-output-"+c.randstr({},64);pt=$.select("body").append("div").attr({id:wt}).style({visibility:"hidden",position:"absolute","font-size":U.fontSize+"px"}).text(a(F));var zt=pt.node();return q===2?MathJax.Hub.Typeset(zt):MathJax.typeset([zt])},vt=function(){var wt=pt.select(q===2?".MathJax_SVG":".MathJax"),zt=!wt.empty()&&pt.select("svg").node();if(!zt)c.log("There was an error in the tex syntax.",F),W();else{var Pt=zt.getBoundingClientRect(),Wt;q===2?Wt=$.select("body").select("#MathJax_SVG_glyphs"):Wt=wt.select("defs"),W(wt,Wt,Pt)}pt.remove()},it=function(){if(X!=="SVG")return MathJax.Hub.setRenderer(X)},Y=function(){X!=="svg"&&(MathJax.config.startup.output=X)},ft=function(){return yt!==void 0&&(MathJax.Hub.processSectionDelay=yt),MathJax.Hub.Config(lt)},ut=function(){MathJax.config=lt};q===2?MathJax.Hub.Queue(st,dt,at,vt,it,ft):q===3&&(tt(),rt(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){at(),vt(),Y(),ut()}))}var i={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"},x="",y=["http:","https:","mailto:","",void 0,":"],v=Q.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,u=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=/<br(\s+.*)?>/i;Q.BR_TAG_ALL=/<br(\s+.*)?>/gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,C=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,E=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function A(F,U){if(!F)return null;var W=F.match(U),q=W&&(W[3]||W[4]);return q&&w(q)}var h=/(^|;)\s*color:/;Q.plainText=function(F,U){U=U||{};for(var W=U.len!==void 0&&U.len!==-1?U.len:1/0,q=U.allowedTags!==void 0?U.allowedTags:["br"],X="...",lt=X.length,yt=F.split(T),pt=[],st="",tt=0,dt=0;dt<yt.length;dt++){var rt=yt[dt],at=rt.match(u),vt=at&&at[2].toLowerCase();if(vt)q.indexOf(vt)!==-1&&(pt.push(rt),st=vt);else{var it=rt.length;if(tt+it<W)pt.push(rt),tt+=it;else if(tt<W){var Y=W-tt;st&&(st!=="br"||Y<=lt||it<=lt)&&pt.pop(),W>lt?pt.push(rt.substr(0,Y-lt)+X):pt.push(rt.substr(0,Y));break}st=""}}return pt.join("")};var p={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},k=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function w(F){return F.replace(k,function(U,W){var q;return W.charAt(0)==="#"?q=R(W.charAt(1)==="x"?parseInt(W.substr(2),16):parseInt(W.substr(1),10)):q=p[W],q||U})}Q.convertEntities=w;function R(F){if(!(F>1114111)){var U=String.fromCodePoint;if(U)return U(F);var W=String.fromCharCode;return F<=65535?W(F):W((F>>10)+55232,F%1024+56320)}}function O(F,U){U=U.replace(v," ");var W=!1,q=[],X,lt=-1;function yt(){lt++;var Ht=document.createElementNS(P.svg,"tspan");$.select(Ht).attr({class:"line",dy:lt*S+"em"}),F.appendChild(Ht),X=Ht;var Jt=q;if(q=[{node:Ht}],Jt.length>1)for(var ge=1;ge<Jt.length;ge++)pt(Jt[ge])}function pt(Ht){var Jt=Ht.type,ge={},he;if(Jt==="a"){he="a";var de=Ht.target,se=Ht.href,Tt=Ht.popup;se&&(ge={"xlink:xlink:show":de==="_blank"||de.charAt(0)!=="_"?"new":"replace",target:de,"xlink:xlink:href":se},Tt&&(ge.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+Tt+'");return false;'))}else he="tspan";Ht.style&&(ge.style=Ht.style);var Lt=document.createElementNS(P.svg,he);if(Jt==="sup"||Jt==="sub"){st(X,x),X.appendChild(Lt);var Mt=document.createElementNS(P.svg,"tspan");st(Mt,x),$.select(Mt).attr("dy",f[Jt]),ge.dy=s[Jt],X.appendChild(Lt),X.appendChild(Mt)}else X.appendChild(Lt);$.select(Lt).attr(ge),X=Ht.node=Lt,q.push(Ht)}function st(Ht,Jt){Ht.appendChild(document.createTextNode(Jt))}function tt(Ht){if(q.length===1){c.log("Ignoring unexpected end tag </"+Ht+">.",U);return}var Jt=q.pop();Ht!==Jt.type&&c.log("Start tag <"+Jt.type+"> doesnt match end tag <"+Ht+">. Pretending it did match.",U),X=q[q.length-1].node}var dt=b.test(U);dt?yt():(X=F,q=[{node:F}]);for(var rt=U.split(T),at=0;at<rt.length;at++){var vt=rt[at],it=vt.match(u),Y=it&&it[2].toLowerCase(),ft=i[Y];if(Y==="br")yt();else if(ft===void 0)st(X,w(vt));else if(it[1])tt(Y);else{var ut=it[4],wt={type:Y},zt=A(ut,_);if(zt?(zt=zt.replace(h,"$1 fill:"),ft&&(zt+=";"+ft)):ft&&(zt=ft),zt&&(wt.style=zt),Y==="a"){W=!0;var Pt=A(ut,C);if(Pt){var Wt=N(Pt);Wt&&(wt.href=Wt,wt.target=A(ut,M)||"_blank",wt.popup=A(ut,E))}}pt(wt)}}return W}function N(F){var U=encodeURI(decodeURI(F)),W=document.createElement("a"),q=document.createElement("a");W.href=F,q.href=U;var X=W.protocol,lt=q.protocol;return y.indexOf(X)!==-1&&y.indexOf(lt)!==-1?U:""}Q.sanitizeHTML=function(F){F=F.replace(v," ");for(var U=document.createElement("p"),W=U,q=[],X=F.split(T),lt=0;lt<X.length;lt++){var yt=X[lt],pt=yt.match(u),st=pt&&pt[2].toLowerCase();if(st in i)if(pt[1])q.length&&(W=q.pop());else{var tt=pt[4],dt=A(tt,_),rt=dt?{style:dt}:{};if(st==="a"){var at=A(tt,C);if(at){var vt=N(at);if(vt){rt.href=vt;var it=A(tt,M);it&&(rt.target=it)}}}var Y=document.createElement(st);W.appendChild(Y),$.select(Y).attr(rt),W=Y,q.push(Y)}else W.appendChild(document.createTextNode(w(yt)))}var ft="innerHTML";return U[ft]},Q.lineCount=function(F){return F.selectAll("tspan.line").size()||1},Q.positionText=function(F,U,W){return F.each(function(){var q=$.select(this);function X(pt,st){return st===void 0?(st=q.attr(pt),st===null&&(q.attr(pt,0),st=0)):q.attr(pt,st),st}var lt=X("x",U),yt=X("y",W);this.nodeName==="text"&&q.selectAll("tspan.line").attr({x:lt,y:yt})})};function V(F,U,W){var q=W.horizontalAlign,X=W.verticalAlign||"top",lt=F.node().getBoundingClientRect(),yt=U.node().getBoundingClientRect(),pt,st,tt;return X==="bottom"?st=function(){return lt.bottom-pt.height}:X==="middle"?st=function(){return lt.top+(lt.height-pt.height)/2}:st=function(){return lt.top},q==="right"?tt=function(){return lt.right-pt.width}:q==="center"?tt=function(){return lt.left+(lt.width-pt.width)/2}:tt=function(){return lt.left},function(){pt=this.node().getBoundingClientRect();var dt=tt()-yt.left,rt=st()-yt.top,at=W.gd||{};if(W.gd){at._fullLayout._calcInverseTransform(at);var vt=c.apply3DTransform(at._fullLayout._invTransform)(dt,rt);dt=vt[0],rt=vt[1]}return this.style({top:rt+"px",left:dt+"px","z-index":1e3}),this}}var H="1px ";Q.makeTextShadow=function(F){var U=H,W=H,q=H;return U+W+q+F+", -"+U+"-"+W+q+F+", "+U+"-"+W+q+F+", -"+U+W+q+F},Q.makeEditable=function(F,U){var W=U.gd,q=U.delegate,X=$.dispatch("edit","input","cancel"),lt=q||F;if(F.style({"pointer-events":q?"none":"all"}),F.size()!==1)throw new Error("boo");function yt(){st(),F.style({opacity:0});var tt=lt.attr("class"),dt;tt?dt="."+tt.split(" ")[0]+"-math-group":dt="[class*=-math-group]",dt&&$.select(F.node().parentNode).select(dt).style({opacity:0})}function pt(tt){var dt=tt.node(),rt=document.createRange();rt.selectNodeContents(dt);var at=window.getSelection();at.removeAllRanges(),at.addRange(rt),dt.focus()}function st(){var tt=$.select(W),dt=tt.select(".svg-container"),rt=dt.append("div"),at=F.node().style,vt=parseFloat(at.fontSize||12),it=U.text;it===void 0&&(it=F.attr("data-unformatted")),rt.classed("plugin-editable editable",!0).style({position:"absolute","font-family":at.fontFamily||"Arial","font-size":vt,color:U.fill||at.fill||"black",opacity:1,"background-color":U.background||"transparent",outline:"#ffffff33 1px solid",margin:[-vt/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(it).call(V(F,dt,U)).on("blur",function(){W._editing=!1,F.text(this.textContent).style({opacity:1});var Y=$.select(this).attr("class"),ft;Y?ft="."+Y.split(" ")[0]+"-math-group":ft="[class*=-math-group]",ft&&$.select(F.node().parentNode).select(ft).style({opacity:0});var ut=this.textContent;$.select(this).transition().duration(0).remove(),$.select(document).on("mouseup",null),X.edit.call(F,ut)}).on("focus",function(){var Y=this;W._editing=!0,$.select(document).on("mouseup",function(){if($.event.target===Y)return!1;document.activeElement===rt.node()&&rt.node().blur()})}).on("keyup",function(){$.event.which===27?(W._editing=!1,F.style({opacity:1}),$.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),X.cancel.call(F,this.textContent)):(X.input.call(F,this.textContent),$.select(this).call(V(F,dt,U)))}).on("keydown",function(){$.event.which===13&&this.blur()}).call(pt)}return U.immediate?yt():lt.on("click",yt),$.rebind(F,X,"on")}}),Hd=Ft((Q,$)=>{var c=un(),g=fo(),P=ra(),S=bn(),t=li(),e=gi().isValid;function r(v,T,u){var b=T?S.nestedProperty(v,T).get()||{}:v,_=b[u||"color"];_&&_._inputArray&&(_=_._inputArray);var C=!1;if(S.isArrayOrTypedArray(_)){for(var M=0;M<_.length;M++)if(P(_[M])){C=!0;break}}return S.isPlainObject(b)&&(C||b.showscale===!0||P(b.cmin)&&P(b.cmax)||e(b.colorscale)||S.isPlainObject(b.colorbar))}var a=["showscale","autocolorscale","colorscale","reversescale","colorbar"],n=["min","max","mid","auto"];function o(v){var T=v._colorAx,u=T||v,b={},_,C,M;for(C=0;C<a.length;C++)M=a[C],b[M]=u[M];if(T)for(_="c",C=0;C<n.length;C++)M=n[C],b[M]=u["c"+M];else{var E;for(C=0;C<n.length;C++){if(M=n[C],E="c"+M,E in u){b[M]=u[E];continue}E="z"+M,E in u&&(b[M]=u[E])}_=E.charAt(0)}return b._sync=function(A,h){var p=n.indexOf(A)!==-1?_+A:A;u[p]=u["_"+p]=h},b}function i(v){for(var T=o(v),u=T.min,b=T.max,_=T.reversescale?s(T.colorscale):T.colorscale,C=_.length,M=new Array(C),E=new Array(C),A=0;A<C;A++){var h=_[A];M[A]=u+h[0]*(b-u),E[A]=h[1]}return{domain:M,range:E}}function s(v){for(var T=v.length,u=new Array(T),b=T-1,_=0;b>=0;b--,_++){var C=v[b];u[_]=[1-C[0],C[1]]}return u}function f(v,T){T=T||{};for(var u=v.domain,b=v.range,_=b.length,C=new Array(_),M=0;M<_;M++){var E=g(b[M]).toRgb();C[M]=[E.r,E.g,E.b,E.a]}var A=c.scale.linear().domain(u).range(C).clamp(!0),h=T.noNumericCheck,p=T.returnArray,k;return h&&p?k=A:h?k=function(w){return y(A(w))}:p?k=function(w){return P(w)?A(w):g(w).isValid()?w:t.defaultLine}:k=function(w){return P(w)?y(A(w)):g(w).isValid()?w:t.defaultLine},k.domain=A.domain,k.range=function(){return b},k}function x(v,T){return f(i(v),T)}function y(v){var T={r:v[0],g:v[1],b:v[2],a:v[3]};return g(T).toRgbString()}$.exports={hasColorscale:r,extractOpts:o,extractScale:i,flipScale:s,makeColorScaleFunc:f,makeColorScaleFuncFromTrace:x}}),fh=Ft((Q,$)=>{var c=k_(),g=c.FORMAT_LINK,P=c.DATE_FORMAT_LINK;function S(r,a){return{valType:"string",dflt:"",editType:"none",description:(a?t:e)("hover text",r)+["By default the values are formatted using "+(a?"generic number format":"`"+r+"axis.hoverformat`")+"."].join(" ")}}function t(r,a){return["Sets the "+r+" formatting rule"+(a?"for `"+a+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+g+"."].join(" ")}function e(r,a){return t(r,a)+[" And for dates see: "+P+".","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(" ")}$.exports={axisHoverFormat:S,descriptionOnlyNumbers:t,descriptionWithDates:e}}),Ad=Ft((Q,$)=>{var c=Ea(),g=bi(),P=Td().dash,S=Ta().extendFlat,t=pu().templatedArray;$u().templateFormatStringDescription;var e=fh().descriptionWithDates,r=Da().ONEDAY,a=ic(),n=a.HOUR_PATTERN,o=a.WEEKDAY_PATTERN,i={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},s=S({},i,{values:i.values.slice().concat(["sync"])});function f(h){return{valType:"integer",min:0,dflt:h?5:0,editType:"ticks"}}var x={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},y={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},v={valType:"data_array",editType:"ticks"},T={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function u(h){var p={valType:"number",min:0,editType:"ticks"};return h||(p.dflt=5),p}function b(h){var p={valType:"number",min:0,editType:"ticks"};return h||(p.dflt=1),p}var _={valType:"color",dflt:g.defaultLine,editType:"ticks"},C={valType:"color",dflt:g.lightLine,editType:"ticks"};function M(h){var p={valType:"number",min:0,editType:"ticks"};return h||(p.dflt=1),p}var E=S({},P,{editType:"ticks"}),A={valType:"boolean",editType:"ticks"};$.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:g.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:c({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},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:[a.idRegex.x.toString(),a.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:[a.idRegex.x.toString(),a.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:x,dtick:y,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:v,ticktext:{valType:"data_array",editType:"ticks"},ticks:T,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:u(),tickwidth:b(),tickcolor:_,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:S({},P,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:c({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","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:g.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:A,gridcolor:C,gridwidth:M(),griddash:E,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:g.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:g.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",a.idRegex.x.toString(),a.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",a.idRegex.x.toString(),a.idRegex.y.toString()],editType:"plot"},minor:{tickmode:i,nticks:f("minor"),tick0:x,dtick:y,tickvals:v,ticks:T,ticklen:u("minor"),tickwidth:b("minor"),tickcolor:_,gridcolor:C,gridwidth:M("minor"),griddash:E,showgrid:A,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"}}),T1=Ft((Q,$)=>{var c=Ad(),g=Ea(),P=Ta().extendFlat,S=Yc().overrideAll;$.exports=S({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:c.linecolor,outlinewidth:c.linewidth,bordercolor:c.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:c.minor.tickmode,nticks:c.nticks,tick0:c.tick0,dtick:c.dtick,tickvals:c.tickvals,ticktext:c.ticktext,ticks:P({},c.ticks,{dflt:""}),ticklabeloverflow:P({},c.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:c.ticklen,tickwidth:c.tickwidth,tickcolor:c.tickcolor,ticklabelstep:c.ticklabelstep,showticklabels:c.showticklabels,labelalias:c.labelalias,tickfont:g({}),tickangle:c.tickangle,tickformat:c.tickformat,tickformatstops:c.tickformatstops,tickprefix:c.tickprefix,showtickprefix:c.showtickprefix,ticksuffix:c.ticksuffix,showticksuffix:c.showticksuffix,separatethousands:c.separatethousands,exponentformat:c.exponentformat,minexponent:c.minexponent,showexponent:c.showexponent,title:{text:{valType:"string"},font:g({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}),Tc=Ft((Q,$)=>{var c=T1(),g=vo().counter,P=G0(),S=gi().scales;P(S);function t(e){return"`"+e+"`"}$.exports=function(e,r){e=e||"",r=r||{};var a=r.cLetter||"c";"onlyIfNumerical"in r&&r.onlyIfNumerical;var n="noScale"in r?r.noScale:e==="marker.line",o="showScaleDflt"in r?r.showScaleDflt:a==="z",i=typeof r.colorscaleDflt=="string"?S[r.colorscaleDflt]:null,s=r.editTypeOverride||"",f=e?e+".":"",x;"colorAttr"in r?(x=r.colorAttr,r.colorAttr):(x={z:"z",c:"color"}[a],""+t(f+x));var y=a+"auto",v=a+"min",T=a+"max",u=a+"mid",b={};b[v]=b[T]=void 0;var _={};_[y]=!1;var C={};return x==="color"&&(C.color={valType:"color",arrayOk:!0,editType:s||"style"},r.anim&&(C.color.anim=!0)),C[y]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:b},C[v]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:_},C[T]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:_},C[u]={valType:"number",dflt:null,editType:"calc",impliedEdits:b},C.colorscale={valType:"colorscale",editType:"calc",dflt:i,impliedEdits:{autocolorscale:!1}},C.autocolorscale={valType:"boolean",dflt:r.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},C.reversescale={valType:"boolean",dflt:!1,editType:"plot"},n||(C.showscale={valType:"boolean",dflt:o,editType:"calc"},C.colorbar=c),r.noColorAxis||(C.coloraxis={valType:"subplotid",regex:g("coloraxis"),dflt:null,editType:"calc"}),C}}),Pu=Ft((Q,$)=>{var c=Ta().extendFlat,g=Tc(),P=gi().scales;$.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:P.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:P.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:P.RdBu,editType:"calc"}},coloraxis:c({_isSubplotObj:!0,editType:"calc"},g("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}),L0=Ft((Q,$)=>{var c=bn();$.exports=function(g){return c.isPlainObject(g.colorbar)}}),Bh=Ft(Q=>{var $=ra(),c=bn(),g=Da(),P=g.ONEDAY,S=g.ONEWEEK;Q.dtick=function(t,e){var r=e==="log",a=e==="date",n=e==="category",o=a?P:1;if(!t)return o;if($(t))return t=Number(t),t<=0?o:n?Math.max(1,Math.round(t)):a?Math.max(.1,t):t;if(typeof t!="string"||!(a||r))return o;var i=t.charAt(0),s=t.substr(1);return s=$(s)?Number(s):0,s<=0||!(a&&i==="M"&&s===Math.round(s)||r&&i==="L"||r&&i==="D"&&(s===1||s===2))?o:t},Q.tick0=function(t,e,r,a){if(e==="date")return c.cleanDate(t,c.dateTick0(r,a%S===0?1:0));if(!(a==="D1"||a==="D2"))return $(t)?Number(t):0}}),mg=Ft((Q,$)=>{var c=Bh(),g=bn().isArrayOrTypedArray,P=Va().isTypedArraySpec,S=Va().decodeTypedArraySpec;$.exports=function(t,e,r,a,n){n||(n={});var o=n.isMinor,i=o?t.minor||{}:t,s=o?e.minor:e,f=o?"minor.":"";function x(M){var E=i[M];return P(E)&&(E=S(E)),E!==void 0?E:(s._template||{})[M]}var y=x("tick0"),v=x("dtick"),T=x("tickvals"),u=g(T)?"array":v?"linear":"auto",b=r(f+"tickmode",u);if(b==="auto"||b==="sync")r(f+"nticks");else if(b==="linear"){var _=s.dtick=c.dtick(v,a);s.tick0=c.tick0(y,a,e.calendar,_)}else if(a!=="multicategory"){var C=r(f+"tickvals");C===void 0?s.tickmode="auto":o||r("ticktext")}}}),gg=Ft((Q,$)=>{var c=bn(),g=Ad();$.exports=function(P,S,t,e){var r=e.isMinor,a=r?P.minor||{}:P,n=r?S.minor:S,o=r?g.minor:g,i=r?"minor.":"",s=c.coerce2(a,n,o,"ticklen",r?(S.ticklen||5)*.6:void 0),f=c.coerce2(a,n,o,"tickwidth",r?S.tickwidth||1:void 0),x=c.coerce2(a,n,o,"tickcolor",(r?S.tickcolor:void 0)||n.color),y=t(i+"ticks",!r&&e.outerTicks||s||f||x?"outside":"");y||(delete n.ticklen,delete n.tickwidth,delete n.tickcolor)}}),Dy=Ft((Q,$)=>{$.exports=function(c){var g=["showexponent","showtickprefix","showticksuffix"],P=g.filter(function(t){return c[t]!==void 0}),S=function(t){return c[t]===c[P[0]]};if(P.every(S)||P.length===1)return c[P[0]]}}),Md=Ft((Q,$)=>{var c=bn(),g=pu();$.exports=function(P,S,t){var e=t.name,r=t.inclusionAttr||"visible",a=S[e],n=c.isArrayOrTypedArray(P[e])?P[e]:[],o=S[e]=[],i=g.arrayTemplater(S,e,r),s,f;for(s=0;s<n.length;s++){var x=n[s];c.isPlainObject(x)?f=i.newItem(x):(f=i.newItem({}),f[r]=!1),f._index=s,f[r]!==!1&&t.handleItemDefaults(x,f,S,t),o.push(f)}var y=i.defaultItems();for(s=0;s<y.length;s++)f=y[s],f._index=o.length,t.handleItemDefaults({},f,S,t,{}),o.push(f);if(c.isArrayOrTypedArray(a)){var v=Math.min(a.length,o.length);for(s=0;s<v;s++)c.relinkPrivateKeys(o[s],a[s])}return o}}),n0=Ft((Q,$)=>{var c=bn(),g=li().contrast,P=Ad(),S=Dy(),t=Md();$.exports=function(r,a,n,o,i){i||(i={});var s=n("labelalias");c.isPlainObject(s)||delete a.labelalias;var f=S(r),x=n("showticklabels");if(x){i.noTicklabelshift||n("ticklabelshift"),i.noTicklabelstandoff||n("ticklabelstandoff");var y=i.font||{},v=a.color,T=a.ticklabelposition||"",u=T.indexOf("inside")!==-1?g(i.bgColor):v&&v!==P.color.dflt?v:y.color;if(c.coerceFont(n,"tickfont",y,{overrideDflt:{color:u}}),!i.noTicklabelstep&&o!=="multicategory"&&o!=="log"&&n("ticklabelstep"),!i.noAng){var b=n("tickangle");!i.noAutotickangles&&b==="auto"&&n("autotickangles")}if(o!=="category"){var _=n("tickformat");t(r,a,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:e}),a.tickformatstops.length||delete a.tickformatstops,!i.noExp&&!_&&o!=="date"&&(n("showexponent",f),n("exponentformat"),n("minexponent"),n("separatethousands"))}!i.noMinorloglabels&&o==="log"&&n("minorloglabels")}};function e(r,a){function n(i,s){return c.coerce(r,a,P.tickformatstops,i,s)}var o=n("enabled");o&&(n("dtickrange"),n("value"))}}),dm=Ft((Q,$)=>{var c=Dy();$.exports=function(g,P,S,t,e){e||(e={});var r=e.tickSuffixDflt,a=c(g),n=S("tickprefix");n&&S("showtickprefix",a);var o=S("ticksuffix",r);o&&S("showticksuffix",a)}}),fv=Ft((Q,$)=>{var c=bn(),g=pu(),P=mg(),S=gg(),t=n0(),e=dm(),r=T1();$.exports=function(a,n,o){var i=g.newContainer(n,"colorbar"),s=a.colorbar||{};function f(F,U){return c.coerce(s,i,r,F,U)}var x=o.margin||{t:0,b:0,l:0,r:0},y=o.width-x.l-x.r,v=o.height-x.t-x.b,T=f("orientation"),u=T==="v",b=f("thicknessmode");f("thickness",b==="fraction"?30/(u?y:v):30);var _=f("lenmode");f("len",_==="fraction"?1:u?v:y);var C=f("yref"),M=f("xref"),E=C==="paper",A=M==="paper",h,p,k,w="left";u?(k="middle",w=A?"left":"right",h=A?1.02:1,p=.5):(k=E?"bottom":"top",w="center",h=.5,p=E?1.02:1),c.coerce(s,i,{x:{valType:"number",min:A?-2:0,max:A?3:1,dflt:h}},"x"),c.coerce(s,i,{y:{valType:"number",min:E?-2:0,max:E?3:1,dflt:p}},"y"),f("xanchor",w),f("xpad"),f("yanchor",k),f("ypad"),c.noneOrAll(s,i,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor");var R=c.coerce(s,i,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:u?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");f("ticklabeloverflow",R.indexOf("inside")!==-1?"hide past domain":"hide past div"),P(s,i,f,"linear");var O=o.font,N={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:O};R.indexOf("inside")!==-1&&(N.bgColor="black"),e(s,i,f,"linear",N),t(s,i,f,"linear",N),S(s,i,f,"linear",N),f("title.text",o._dfltTitle.colorbar);var V=i.showticklabels?i.tickfont:O,H=c.extendFlat({},O,{family:V.family,size:c.bigFont(V.size)});c.coerceFont(f,"title.font",H),f("title.side",u?"top":"right")}}),mc=Ft((Q,$)=>{var c=ra(),g=bn(),P=L0(),S=fv(),t=gi().isValid,e=Xo().traceIs;function r(a,n){var o=n.slice(0,n.length-1);return n?g.nestedProperty(a,o).get()||{}:a}$.exports=function a(n,o,i,s,f){var x=f.prefix,y=f.cLetter,v="_module"in o,T=r(n,x),u=r(o,x),b=r(o._template||{},x)||{},_=function(){return delete n.coloraxis,delete o.coloraxis,a(n,o,i,s,f)};if(v){var C=i._colorAxes||{},M=s(x+"coloraxis");if(M){var E=e(o,"contour")&&g.nestedProperty(o,"contours.coloring").get()||"heatmap",A=C[M];A?(A[2].push(_),A[0]!==E&&(A[0]=!1,g.warn(["Ignoring coloraxis:",M,"setting","as it is linked to incompatible colorscales."].join(" ")))):C[M]=[E,o,[_]];return}}var h=T[y+"min"],p=T[y+"max"],k=c(h)&&c(p)&&h<p,w=s(x+y+"auto",!k);w?s(x+y+"mid"):(s(x+y+"min"),s(x+y+"max"));var R=T.colorscale,O=b.colorscale,N;if(R!==void 0&&(N=!t(R)),O!==void 0&&(N=!t(O)),s(x+"autocolorscale",N),s(x+"colorscale"),s(x+"reversescale"),x!=="marker.line."){var V;x&&v&&(V=P(T));var H=s(x+"showscale",V);H&&(x&&b&&(u._template=b),S(T,u,i))}}}),vg=Ft((Q,$)=>{var c=bn(),g=pu(),P=Pu(),S=mc();$.exports=function(t,e){function r(y,v){return c.coerce(t,e,P,y,v)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var a=e._colorAxes,n,o;function i(y,v){return c.coerce(n,o,P.coloraxis,y,v)}for(var s in a){var f=a[s];if(f[0])n=t[s]||{},o=g.newContainer(e,s,"coloraxis"),o._name=s,S(n,o,e,i,{prefix:"",cLetter:"c"});else{for(var x=0;x<f[2].length;x++)f[2][x]();delete e._colorAxes[s]}}}}),mw=Ft((Q,$)=>{var c=bn(),g=Hd().hasColorscale,P=Hd().extractOpts;$.exports=function(S,t){function e(f,x){var y=f["_"+x];y!==void 0&&(f[x]=y)}function r(f,x){var y=x.container?c.nestedProperty(f,x.container).get():f;if(y)if(y.coloraxis)y._colorAx=t[y.coloraxis];else{var v=P(y),T=v.auto;(T||v.min===void 0)&&e(y,x.min),(T||v.max===void 0)&&e(y,x.max),v.autocolorscale&&e(y,"colorscale")}}for(var a=0;a<S.length;a++){var n=S[a],o=n._module.colorbar;if(o)if(Array.isArray(o))for(var i=0;i<o.length;i++)r(n,o[i]);else r(n,o);g(n,"marker.line")&&r(n,{container:"marker.line",min:"cmin",max:"cmax"})}for(var s in t._colorAxes)r(t[s],{min:"cmin",max:"cmax"})}}),Jd=Ft((Q,$)=>{var c=ra(),g=bn(),P=Hd().extractOpts;$.exports=function(S,t,e){var r=S._fullLayout,a=e.vals,n=e.containerStr,o=n?g.nestedProperty(t,n).get():t,i=P(o),s=i.auto!==!1,f=i.min,x=i.max,y=i.mid,v=function(){return g.aggNums(Math.min,null,a)},T=function(){return g.aggNums(Math.max,null,a)};if(f===void 0?f=v():s&&(o._colorAx&&c(f)?f=Math.min(f,v()):f=v()),x===void 0?x=T():s&&(o._colorAx&&c(x)?x=Math.max(x,T()):x=T()),s&&y!==void 0&&(x-y>y-f?f=y-(x-y):x-y<y-f&&(x=y+(y-f))),f===x&&(f-=.5,x+=.5),i._sync("min",f),i._sync("max",x),i.autocolorscale){var u;f*x<0?u=r.colorscale.diverging:f>=0?u=r.colorscale.sequential:u=r.colorscale.sequentialminus,i._sync("colorscale",u)}}}),Xc=Ft((Q,$)=>{var c=gi(),g=Hd();$.exports={moduleType:"component",name:"colorscale",attributes:Tc(),layoutAttributes:Pu(),supplyLayoutDefaults:vg(),handleDefaults:mc(),crossTraceDefaults:mw(),calc:Jd(),scales:c.scales,defaultScale:c.defaultScale,getScale:c.get,isValidScale:c.isValid,hasColorscale:g.hasColorscale,extractOpts:g.extractOpts,extractScale:g.extractScale,flipScale:g.flipScale,makeColorScaleFunc:g.makeColorScaleFunc,makeColorScaleFuncFromTrace:g.makeColorScaleFuncFromTrace}}),Ac=Ft((Q,$)=>{var c=bn(),g=Va().isTypedArraySpec;$.exports={hasLines:function(P){return P.visible&&P.mode&&P.mode.indexOf("lines")!==-1},hasMarkers:function(P){return P.visible&&(P.mode&&P.mode.indexOf("markers")!==-1||P.type==="splom")},hasText:function(P){return P.visible&&P.mode&&P.mode.indexOf("text")!==-1},isBubble:function(P){var S=P.marker;return c.isPlainObject(S)&&(c.isArrayOrTypedArray(S.size)||g(S.size))}}}),yg=Ft((Q,$)=>{var c=ra();$.exports=function(g,P){P||(P=2);var S=g.marker,t=S.sizeref||1,e=S.sizemin||0,r=S.sizemode==="area"?function(a){return Math.sqrt(a/t)}:function(a){return a/t};return function(a){var n=r(a/P);return c(n)&&n>0?Math.max(n,e):0}}}),Dp=Ft(Q=>{var $=bn();Q.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},Q.isTraceInSubplots=function(e,r){if(e.type==="splom"){for(var a=e.xaxes||[],n=e.yaxes||[],o=0;o<a.length;o++)for(var i=0;i<n.length;i++)if(r.indexOf(a[o]+n[i])!==-1)return!0;return!1}return r.indexOf(Q.getSubplot(e))!==-1},Q.flat=function(e,r){for(var a=new Array(e.length),n=0;n<e.length;n++)a[n]=r;return a},Q.p2c=function(e,r){for(var a=new Array(e.length),n=0;n<e.length;n++)a[n]=e[n].p2c(r);return a},Q.getDistanceFunction=function(e,r,a,n){return e==="closest"?n||Q.quadrature(r,a):e.charAt(0)==="x"?r:a},Q.getClosest=function(e,r,a){if(a.index!==!1)a.index>=0&&a.index<e.length?a.distance=0:a.index=!1;else for(var n=1/0,o=e.length,i=0;i<o;i++)n=r(e[i]),n<=a.distance&&(a.index=i,a.distance=n);return a},Q.inbox=function(e,r,a){return e*r<0||e===0?a:1/0},Q.quadrature=function(e,r){return function(a){var n=e(a),o=r(a);return Math.sqrt(n*n+o*o)}},Q.makeEventData=function(e,r,a){var n="index"in e?e.index:e.pointNumber,o={data:r._input,fullData:r,curveNumber:r.index,pointNumber:n};if(r._indexToPoints){var i=r._indexToPoints[n];i.length===1?o.pointIndex=i[0]:o.pointIndices=i}else o.pointIndex=n;return r._module.eventData?o=r._module.eventData(o,e,r,a,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)),Q.appendArrayPointValue(o,r,n),o},Q.appendArrayPointValue=function(e,r,a){var n=r._arrayAttrs;if(n)for(var o=0;o<n.length;o++){var i=n[o],s=g(i);if(e[s]===void 0){var f=$.nestedProperty(r,i).get(),x=P(f,a);x!==void 0&&(e[s]=x)}}},Q.appendArrayMultiPointValues=function(e,r,a){var n=r._arrayAttrs;if(n)for(var o=0;o<n.length;o++){var i=n[o],s=g(i);if(e[s]===void 0){for(var f=$.nestedProperty(r,i).get(),x=new Array(a.length),y=0;y<a.length;y++)x[y]=P(f,a[y]);e[s]=x}}};var c={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function g(e){return c[e]||e}function P(e,r){if(Array.isArray(r)){if($.isArrayOrTypedArray(e)&&$.isArrayOrTypedArray(e[r[0]]))return e[r[0]][r[1]]}else return e[r]}var S={x:!0,y:!0},t={"x unified":!0,"y unified":!0};Q.isUnifiedHover=function(e){return typeof e!="string"?!1:!!t[e]},Q.isXYhover=function(e){return typeof e!="string"?!1:!!S[e]}}),A1=Ft((Q,$)=>{$.exports=P;var c={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},g=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function P(e){var r=[];return e.replace(g,function(a,n,o){var i=n.toLowerCase();for(o=t(o),i=="m"&&o.length>2&&(r.push([n].concat(o.splice(0,2))),i="l",n=n=="m"?"l":"L");;){if(o.length==c[i])return o.unshift(n),r.push(o);if(o.length<c[i])throw new Error("malformed path data");r.push([n].concat(o.splice(0,c[i])))}}),r}var S=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function t(e){var r=e.match(S);return r?r.map(Number):[]}}),Mc=Ft((Q,$)=>{var c=A1(),g=function(y,v){return v?Math.round(y*(v=Math.pow(10,v)))/v:Math.round(y)},P="M0,0Z",S=Math.sqrt(2),t=Math.sqrt(3),e=Math.PI,r=Math.cos,a=Math.sin;$.exports={circle:{n:0,f:function(y,v,T){if(n(v))return P;var u=g(y,2),b="M"+u+",0A"+u+","+u+" 0 1,1 0,-"+u+"A"+u+","+u+" 0 0,1 "+u+",0Z";return T?x(v,T,b):b}},square:{n:1,f:function(y,v,T){if(n(v))return P;var u=g(y,2);return x(v,T,"M"+u+","+u+"H-"+u+"V-"+u+"H"+u+"Z")}},diamond:{n:2,f:function(y,v,T){if(n(v))return P;var u=g(y*1.3,2);return x(v,T,"M"+u+",0L0,"+u+"L-"+u+",0L0,-"+u+"Z")}},cross:{n:3,f:function(y,v,T){if(n(v))return P;var u=g(y*.4,2),b=g(y*1.2,2);return x(v,T,"M"+b+","+u+"H"+u+"V"+b+"H-"+u+"V"+u+"H-"+b+"V-"+u+"H-"+u+"V-"+b+"H"+u+"V-"+u+"H"+b+"Z")}},x:{n:4,f:function(y,v,T){if(n(v))return P;var u=g(y*.8/S,2),b="l"+u+","+u,_="l"+u+",-"+u,C="l-"+u+",-"+u,M="l-"+u+","+u;return x(v,T,"M0,"+u+b+_+C+_+C+M+C+M+b+M+b+"Z")}},"triangle-up":{n:5,f:function(y,v,T){if(n(v))return P;var u=g(y*2/t,2),b=g(y/2,2),_=g(y,2);return x(v,T,"M-"+u+","+b+"H"+u+"L0,-"+_+"Z")}},"triangle-down":{n:6,f:function(y,v,T){if(n(v))return P;var u=g(y*2/t,2),b=g(y/2,2),_=g(y,2);return x(v,T,"M-"+u+",-"+b+"H"+u+"L0,"+_+"Z")}},"triangle-left":{n:7,f:function(y,v,T){if(n(v))return P;var u=g(y*2/t,2),b=g(y/2,2),_=g(y,2);return x(v,T,"M"+b+",-"+u+"V"+u+"L-"+_+",0Z")}},"triangle-right":{n:8,f:function(y,v,T){if(n(v))return P;var u=g(y*2/t,2),b=g(y/2,2),_=g(y,2);return x(v,T,"M-"+b+",-"+u+"V"+u+"L"+_+",0Z")}},"triangle-ne":{n:9,f:function(y,v,T){if(n(v))return P;var u=g(y*.6,2),b=g(y*1.2,2);return x(v,T,"M-"+b+",-"+u+"H"+u+"V"+b+"Z")}},"triangle-se":{n:10,f:function(y,v,T){if(n(v))return P;var u=g(y*.6,2),b=g(y*1.2,2);return x(v,T,"M"+u+",-"+b+"V"+u+"H-"+b+"Z")}},"triangle-sw":{n:11,f:function(y,v,T){if(n(v))return P;var u=g(y*.6,2),b=g(y*1.2,2);return x(v,T,"M"+b+","+u+"H-"+u+"V-"+b+"Z")}},"triangle-nw":{n:12,f:function(y,v,T){if(n(v))return P;var u=g(y*.6,2),b=g(y*1.2,2);return x(v,T,"M-"+u+","+b+"V-"+u+"H"+b+"Z")}},pentagon:{n:13,f:function(y,v,T){if(n(v))return P;var u=g(y*.951,2),b=g(y*.588,2),_=g(-y,2),C=g(y*-.309,2),M=g(y*.809,2);return x(v,T,"M"+u+","+C+"L"+b+","+M+"H-"+b+"L-"+u+","+C+"L0,"+_+"Z")}},hexagon:{n:14,f:function(y,v,T){if(n(v))return P;var u=g(y,2),b=g(y/2,2),_=g(y*t/2,2);return x(v,T,"M"+_+",-"+b+"V"+b+"L0,"+u+"L-"+_+","+b+"V-"+b+"L0,-"+u+"Z")}},hexagon2:{n:15,f:function(y,v,T){if(n(v))return P;var u=g(y,2),b=g(y/2,2),_=g(y*t/2,2);return x(v,T,"M-"+b+","+_+"H"+b+"L"+u+",0L"+b+",-"+_+"H-"+b+"L-"+u+",0Z")}},octagon:{n:16,f:function(y,v,T){if(n(v))return P;var u=g(y*.924,2),b=g(y*.383,2);return x(v,T,"M-"+b+",-"+u+"H"+b+"L"+u+",-"+b+"V"+b+"L"+b+","+u+"H-"+b+"L-"+u+","+b+"V-"+b+"Z")}},star:{n:17,f:function(y,v,T){if(n(v))return P;var u=y*1.4,b=g(u*.225,2),_=g(u*.951,2),C=g(u*.363,2),M=g(u*.588,2),E=g(-u,2),A=g(u*-.309,2),h=g(u*.118,2),p=g(u*.809,2),k=g(u*.382,2);return x(v,T,"M"+b+","+A+"H"+_+"L"+C+","+h+"L"+M+","+p+"L0,"+k+"L-"+M+","+p+"L-"+C+","+h+"L-"+_+","+A+"H-"+b+"L0,"+E+"Z")}},hexagram:{n:18,f:function(y,v,T){if(n(v))return P;var u=g(y*.66,2),b=g(y*.38,2),_=g(y*.76,2);return x(v,T,"M-"+_+",0l-"+b+",-"+u+"h"+_+"l"+b+",-"+u+"l"+b+","+u+"h"+_+"l-"+b+","+u+"l"+b+","+u+"h-"+_+"l-"+b+","+u+"l-"+b+",-"+u+"h-"+_+"Z")}},"star-triangle-up":{n:19,f:function(y,v,T){if(n(v))return P;var u=g(y*t*.8,2),b=g(y*.8,2),_=g(y*1.6,2),C=g(y*4,2),M="A "+C+","+C+" 0 0 1 ";return x(v,T,"M-"+u+","+b+M+u+","+b+M+"0,-"+_+M+"-"+u+","+b+"Z")}},"star-triangle-down":{n:20,f:function(y,v,T){if(n(v))return P;var u=g(y*t*.8,2),b=g(y*.8,2),_=g(y*1.6,2),C=g(y*4,2),M="A "+C+","+C+" 0 0 1 ";return x(v,T,"M"+u+",-"+b+M+"-"+u+",-"+b+M+"0,"+_+M+u+",-"+b+"Z")}},"star-square":{n:21,f:function(y,v,T){if(n(v))return P;var u=g(y*1.1,2),b=g(y*2,2),_="A "+b+","+b+" 0 0 1 ";return x(v,T,"M-"+u+",-"+u+_+"-"+u+","+u+_+u+","+u+_+u+",-"+u+_+"-"+u+",-"+u+"Z")}},"star-diamond":{n:22,f:function(y,v,T){if(n(v))return P;var u=g(y*1.4,2),b=g(y*1.9,2),_="A "+b+","+b+" 0 0 1 ";return x(v,T,"M-"+u+",0"+_+"0,"+u+_+u+",0"+_+"0,-"+u+_+"-"+u+",0Z")}},"diamond-tall":{n:23,f:function(y,v,T){if(n(v))return P;var u=g(y*.7,2),b=g(y*1.4,2);return x(v,T,"M0,"+b+"L"+u+",0L0,-"+b+"L-"+u+",0Z")}},"diamond-wide":{n:24,f:function(y,v,T){if(n(v))return P;var u=g(y*1.4,2),b=g(y*.7,2);return x(v,T,"M0,"+b+"L"+u+",0L0,-"+b+"L-"+u+",0Z")}},hourglass:{n:25,f:function(y,v,T){if(n(v))return P;var u=g(y,2);return x(v,T,"M"+u+","+u+"H-"+u+"L"+u+",-"+u+"H-"+u+"Z")},noDot:!0},bowtie:{n:26,f:function(y,v,T){if(n(v))return P;var u=g(y,2);return x(v,T,"M"+u+","+u+"V-"+u+"L-"+u+","+u+"V-"+u+"Z")},noDot:!0},"circle-cross":{n:27,f:function(y,v,T){if(n(v))return P;var u=g(y,2);return x(v,T,"M0,"+u+"V-"+u+"M"+u+",0H-"+u+"M"+u+",0A"+u+","+u+" 0 1,1 0,-"+u+"A"+u+","+u+" 0 0,1 "+u+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(y,v,T){if(n(v))return P;var u=g(y,2),b=g(y/S,2);return x(v,T,"M"+b+","+b+"L-"+b+",-"+b+"M"+b+",-"+b+"L-"+b+","+b+"M"+u+",0A"+u+","+u+" 0 1,1 0,-"+u+"A"+u+","+u+" 0 0,1 "+u+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(y,v,T){if(n(v))return P;var u=g(y,2);return x(v,T,"M0,"+u+"V-"+u+"M"+u+",0H-"+u+"M"+u+","+u+"H-"+u+"V-"+u+"H"+u+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(y,v,T){if(n(v))return P;var u=g(y,2);return x(v,T,"M"+u+","+u+"L-"+u+",-"+u+"M"+u+",-"+u+"L-"+u+","+u+"M"+u+","+u+"H-"+u+"V-"+u+"H"+u+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(y,v,T){if(n(v))return P;var u=g(y*1.3,2);return x(v,T,"M"+u+",0L0,"+u+"L-"+u+",0L0,-"+u+"ZM0,-"+u+"V"+u+"M-"+u+",0H"+u)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(y,v,T){if(n(v))return P;var u=g(y*1.3,2),b=g(y*.65,2);return x(v,T,"M"+u+",0L0,"+u+"L-"+u+",0L0,-"+u+"ZM-"+b+",-"+b+"L"+b+","+b+"M-"+b+","+b+"L"+b+",-"+b)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(y,v,T){if(n(v))return P;var u=g(y*1.4,2);return x(v,T,"M0,"+u+"V-"+u+"M"+u+",0H-"+u)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(y,v,T){if(n(v))return P;var u=g(y,2);return x(v,T,"M"+u+","+u+"L-"+u+",-"+u+"M"+u+",-"+u+"L-"+u+","+u)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(y,v,T){if(n(v))return P;var u=g(y*1.2,2),b=g(y*.85,2);return x(v,T,"M0,"+u+"V-"+u+"M"+u+",0H-"+u+"M"+b+","+b+"L-"+b+",-"+b+"M"+b+",-"+b+"L-"+b+","+b)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(y,v,T){if(n(v))return P;var u=g(y/2,2),b=g(y,2);return x(v,T,"M"+u+","+b+"V-"+b+"M"+(u-b)+",-"+b+"V"+b+"M"+b+","+u+"H-"+b+"M-"+b+","+(u-b)+"H"+b)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(y,v,T){if(n(v))return P;var u=g(y*1.2,2),b=g(y*1.6,2),_=g(y*.8,2);return x(v,T,"M-"+u+","+_+"L0,0M"+u+","+_+"L0,0M0,-"+b+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(y,v,T){if(n(v))return P;var u=g(y*1.2,2),b=g(y*1.6,2),_=g(y*.8,2);return x(v,T,"M-"+u+",-"+_+"L0,0M"+u+",-"+_+"L0,0M0,"+b+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(y,v,T){if(n(v))return P;var u=g(y*1.2,2),b=g(y*1.6,2),_=g(y*.8,2);return x(v,T,"M"+_+","+u+"L0,0M"+_+",-"+u+"L0,0M-"+b+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(y,v,T){if(n(v))return P;var u=g(y*1.2,2),b=g(y*1.6,2),_=g(y*.8,2);return x(v,T,"M-"+_+","+u+"L0,0M-"+_+",-"+u+"L0,0M"+b+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(y,v,T){if(n(v))return P;var u=g(y*1.4,2);return x(v,T,"M"+u+",0H-"+u)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(y,v,T){if(n(v))return P;var u=g(y*1.4,2);return x(v,T,"M0,"+u+"V-"+u)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(y,v,T){if(n(v))return P;var u=g(y,2);return x(v,T,"M"+u+",-"+u+"L-"+u+","+u)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(y,v,T){if(n(v))return P;var u=g(y,2);return x(v,T,"M"+u+","+u+"L-"+u+",-"+u)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(y,v,T){if(n(v))return P;var u=g(y,2),b=g(y*2,2);return x(v,T,"M0,0L-"+u+","+b+"H"+u+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(y,v,T){if(n(v))return P;var u=g(y,2),b=g(y*2,2);return x(v,T,"M0,0L-"+u+",-"+b+"H"+u+"Z")},noDot:!0},"arrow-left":{n:47,f:function(y,v,T){if(n(v))return P;var u=g(y*2,2),b=g(y,2);return x(v,T,"M0,0L"+u+",-"+b+"V"+b+"Z")},noDot:!0},"arrow-right":{n:48,f:function(y,v,T){if(n(v))return P;var u=g(y*2,2),b=g(y,2);return x(v,T,"M0,0L-"+u+",-"+b+"V"+b+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(y,v,T){if(n(v))return P;var u=g(y,2),b=g(y*2,2);return x(v,T,"M-"+u+",0H"+u+"M0,0L-"+u+","+b+"H"+u+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(y,v,T){if(n(v))return P;var u=g(y,2),b=g(y*2,2);return x(v,T,"M-"+u+",0H"+u+"M0,0L-"+u+",-"+b+"H"+u+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(y,v,T){if(n(v))return P;var u=g(y*2,2),b=g(y,2);return x(v,T,"M0,-"+b+"V"+b+"M0,0L"+u+",-"+b+"V"+b+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(y,v,T){if(n(v))return P;var u=g(y*2,2),b=g(y,2);return x(v,T,"M0,-"+b+"V"+b+"M0,0L-"+u+",-"+b+"V"+b+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(y,v,T){if(n(v))return P;var u=e/2.5,b=2*y*r(u),_=2*y*a(u);return x(v,T,"M0,0L"+-b+","+_+"L"+b+","+_+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(y,v,T){if(n(v))return P;var u=e/4,b=2*y*r(u),_=2*y*a(u);return x(v,T,"M0,0L"+-b+","+_+"A "+2*y+","+2*y+" 0 0 1 "+b+","+_+"Z")},backoff:.4,noDot:!0}};function n(y){return y===null}var o,i,s,f;function x(y,v,T){if((!y||y%360===0)&&!v)return T;if(s===y&&f===v&&o===T)return i;s=y,f=v,o=T;function u(N,V){var H=r(N),F=a(N),U=V[0],W=V[1]+(v||0);return[U*H-W*F,U*F+W*H]}for(var b=y/180*e,_=0,C=0,M=c(T),E="",A=0;A<M.length;A++){var h=M[A],p=h[0],k=_,w=C;if(p==="M"||p==="L")_=+h[1],C=+h[2];else if(p==="m"||p==="l")_+=+h[1],C+=+h[2];else if(p==="H")_=+h[1];else if(p==="h")_+=+h[1];else if(p==="V")C=+h[1];else if(p==="v")C+=+h[1];else if(p==="A"){_=+h[1],C=+h[2];var R=u(b,[+h[6],+h[7]]);h[6]=R[0],h[7]=R[1],h[3]=+h[3]+y}(p==="H"||p==="V")&&(p="L"),(p==="h"||p==="v")&&(p="l"),(p==="m"||p==="l")&&(_-=k,C-=w);var O=u(b,[_,C]);(p==="H"||p==="V")&&(p="L"),(p==="M"||p==="L"||p==="m"||p==="l")&&(h[1]=O[0],h[2]=O[1]),h[0]=p,E+=h[0]+h.slice(1).join(",")}return i=E,E}}),js=Ft((Q,$)=>{var c=un(),g=bn(),P=g.numberFormat,S=ra(),t=fo(),e=Xo(),r=li(),a=Xc(),n=g.strTranslate,o=tc(),i=Op(),s=Af(),f=s.LINE_SPACING,x=co().DESELECTDIM,y=Ac(),v=yg(),T=Dp().appendArrayPointValue,u=$.exports={};u.font=function(Tt,Lt){var Mt=Lt.variant,te=Lt.style,ve=Lt.weight,oe=Lt.color,Te=Lt.size,He=Lt.family,Ge=Lt.shadow,cr=Lt.lineposition,ur=Lt.textcase;He&&Tt.style("font-family",He),Te+1&&Tt.style("font-size",Te+"px"),oe&&Tt.call(r.fill,oe),ve&&Tt.style("font-weight",ve),te&&Tt.style("font-style",te),Mt&&Tt.style("font-variant",Mt),ur&&Tt.style("text-transform",b(C(ur))),Ge&&Tt.style("text-shadow",Ge==="auto"?o.makeTextShadow(r.contrast(oe)):b(Ge)),cr&&Tt.style("text-decoration-line",b(M(cr)))};function b(Tt){return Tt==="none"?void 0:Tt}var _={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function C(Tt){return _[Tt]}function M(Tt){return Tt.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}u.setPosition=function(Tt,Lt,Mt){Tt.attr("x",Lt).attr("y",Mt)},u.setSize=function(Tt,Lt,Mt){Tt.attr("width",Lt).attr("height",Mt)},u.setRect=function(Tt,Lt,Mt,te,ve){Tt.call(u.setPosition,Lt,Mt).call(u.setSize,te,ve)},u.translatePoint=function(Tt,Lt,Mt,te){var ve=Mt.c2p(Tt.x),oe=te.c2p(Tt.y);if(S(ve)&&S(oe)&&Lt.node())Lt.node().nodeName==="text"?Lt.attr("x",ve).attr("y",oe):Lt.attr("transform",n(ve,oe));else return!1;return!0},u.translatePoints=function(Tt,Lt,Mt){Tt.each(function(te){var ve=c.select(this);u.translatePoint(te,ve,Lt,Mt)})},u.hideOutsideRangePoint=function(Tt,Lt,Mt,te,ve,oe){Lt.attr("display",Mt.isPtWithinRange(Tt,ve)&&te.isPtWithinRange(Tt,oe)?null:"none")},u.hideOutsideRangePoints=function(Tt,Lt){if(Lt._hasClipOnAxisFalse){var Mt=Lt.xaxis,te=Lt.yaxis;Tt.each(function(ve){var oe=ve[0].trace,Te=oe.xcalendar,He=oe.ycalendar,Ge=e.traceIs(oe,"bar-like")?".bartext":".point,.textpoint";Tt.selectAll(Ge).each(function(cr){u.hideOutsideRangePoint(cr,c.select(this),Mt,te,Te,He)})})}},u.crispRound=function(Tt,Lt,Mt){return!Lt||!S(Lt)?Mt||0:Tt._context.staticPlot?Lt:Lt<1?1:Math.round(Lt)},u.singleLineStyle=function(Tt,Lt,Mt,te,ve){Lt.style("fill","none");var oe=(((Tt||[])[0]||{}).trace||{}).line||{},Te=Mt||oe.width||0,He=ve||oe.dash||"";r.stroke(Lt,te||oe.color),u.dashLine(Lt,He,Te)},u.lineGroupStyle=function(Tt,Lt,Mt,te){Tt.style("fill","none").each(function(ve){var oe=(((ve||[])[0]||{}).trace||{}).line||{},Te=Lt||oe.width||0,He=te||oe.dash||"";c.select(this).call(r.stroke,Mt||oe.color).call(u.dashLine,He,Te)})},u.dashLine=function(Tt,Lt,Mt){Mt=+Mt||0,Lt=u.dashStyle(Lt,Mt),Tt.style({"stroke-dasharray":Lt,"stroke-width":Mt+"px"})},u.dashStyle=function(Tt,Lt){Lt=+Lt||1;var Mt=Math.max(Lt,3);return Tt==="solid"?Tt="":Tt==="dot"?Tt=Mt+"px,"+Mt+"px":Tt==="dash"?Tt=3*Mt+"px,"+3*Mt+"px":Tt==="longdash"?Tt=5*Mt+"px,"+5*Mt+"px":Tt==="dashdot"?Tt=3*Mt+"px,"+Mt+"px,"+Mt+"px,"+Mt+"px":Tt==="longdashdot"&&(Tt=5*Mt+"px,"+2*Mt+"px,"+Mt+"px,"+2*Mt+"px"),Tt};function E(Tt,Lt,Mt,te){var ve=Lt.fillpattern,oe=Lt.fillgradient,Te=u.getPatternAttr,He=ve&&(Te(ve.shape,0,"")||Te(ve.path,0,""));if(He){var Ge=Te(ve.bgcolor,0,null),cr=Te(ve.fgcolor,0,null),ur=ve.fgopacity,jr=Te(ve.size,0,8),Hr=Te(ve.solidity,0,.3),br=Lt.uid;u.pattern(Tt,"point",Mt,br,He,jr,Hr,void 0,ve.fillmode,Ge,cr,ur)}else if(oe&&oe.type!=="none"){var Kr=oe.type,rn="scatterfill-"+Lt.uid;if(te&&(rn="legendfill-"+Lt.uid),!te&&(oe.start!==void 0||oe.stop!==void 0)){var Ce,$t;Kr==="horizontal"?(Ce={x:oe.start,y:0},$t={x:oe.stop,y:0}):Kr==="vertical"&&(Ce={x:0,y:oe.start},$t={x:0,y:oe.stop}),Ce.x=Lt._xA.c2p(Ce.x===void 0?Lt._extremes.x.min[0].val:Ce.x,!0),Ce.y=Lt._yA.c2p(Ce.y===void 0?Lt._extremes.y.min[0].val:Ce.y,!0),$t.x=Lt._xA.c2p($t.x===void 0?Lt._extremes.x.max[0].val:$t.x,!0),$t.y=Lt._yA.c2p($t.y===void 0?Lt._extremes.y.max[0].val:$t.y,!0),Tt.call(O,Mt,rn,"linear",oe.colorscale,"fill",Ce,$t,!0,!1)}else Kr==="horizontal"&&(Kr=Kr+"reversed"),Tt.call(u.gradient,Mt,rn,Kr,oe.colorscale,"fill")}else Lt.fillcolor&&Tt.call(r.fill,Lt.fillcolor)}u.singleFillStyle=function(Tt,Lt){var Mt=c.select(Tt.node()),te=Mt.data(),ve=((te[0]||[])[0]||{}).trace||{};E(Tt,ve,Lt,!1)},u.fillGroupStyle=function(Tt,Lt,Mt){Tt.style("stroke-width",0).each(function(te){var ve=c.select(this);te[0].trace&&E(ve,te[0].trace,Lt,Mt)})};var A=Mc();u.symbolNames=[],u.symbolFuncs=[],u.symbolBackOffs=[],u.symbolNeedLines={},u.symbolNoDot={},u.symbolNoFill={},u.symbolList=[],Object.keys(A).forEach(function(Tt){var Lt=A[Tt],Mt=Lt.n;u.symbolList.push(Mt,String(Mt),Tt,Mt+100,String(Mt+100),Tt+"-open"),u.symbolNames[Mt]=Tt,u.symbolFuncs[Mt]=Lt.f,u.symbolBackOffs[Mt]=Lt.backoff||0,Lt.needLine&&(u.symbolNeedLines[Mt]=!0),Lt.noDot?u.symbolNoDot[Mt]=!0:u.symbolList.push(Mt+200,String(Mt+200),Tt+"-dot",Mt+300,String(Mt+300),Tt+"-open-dot"),Lt.noFill&&(u.symbolNoFill[Mt]=!0)});var h=u.symbolNames.length,p="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";u.symbolNumber=function(Tt){if(S(Tt))Tt=+Tt;else if(typeof Tt=="string"){var Lt=0;Tt.indexOf("-open")>0&&(Lt=100,Tt=Tt.replace("-open","")),Tt.indexOf("-dot")>0&&(Lt+=200,Tt=Tt.replace("-dot","")),Tt=u.symbolNames.indexOf(Tt),Tt>=0&&(Tt+=Lt)}return Tt%100>=h||Tt>=400?0:Math.floor(Math.max(Tt,0))};function k(Tt,Lt,Mt,te){var ve=Tt%100;return u.symbolFuncs[ve](Lt,Mt,te)+(Tt>=200?p:"")}var w=P("~f"),R={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}};u.gradient=function(Tt,Lt,Mt,te,ve,oe){var Te=R[te];return O(Tt,Lt,Mt,Te.type,ve,oe,Te.start,Te.stop,!1,Te.reversed)};function O(Tt,Lt,Mt,te,ve,oe,Te,He,Ge,cr){var ur=ve.length,jr;te==="linear"?jr={node:"linearGradient",attrs:{x1:Te.x,y1:Te.y,x2:He.x,y2:He.y,gradientUnits:Ge?"userSpaceOnUse":"objectBoundingBox"},reversed:cr}:te==="radial"&&(jr={node:"radialGradient",reversed:cr});for(var Hr=new Array(ur),br=0;br<ur;br++)jr.reversed?Hr[ur-1-br]=[w((1-ve[br][0])*100),ve[br][1]]:Hr[br]=[w(ve[br][0]*100),ve[br][1]];var Kr=Lt._fullLayout,rn="g"+Kr._uid+"-"+Mt,Ce=Kr._defs.select(".gradients").selectAll("#"+rn).data([te+Hr.join(";")],g.identity);Ce.exit().remove(),Ce.enter().append(jr.node).each(function(){var $t=c.select(this);jr.attrs&&$t.attr(jr.attrs),$t.attr("id",rn);var ne=$t.selectAll("stop").data(Hr);ne.exit().remove(),ne.enter().append("stop"),ne.each(function(Ct){var gt=t(Ct[1]);c.select(this).attr({offset:Ct[0]+"%","stop-color":r.tinyRGB(gt),"stop-opacity":gt.getAlpha()})})}),Tt.style(oe,vt(rn,Lt)).style(oe+"-opacity",null),Tt.classed("gradient_filled",!0)}u.pattern=function(Tt,Lt,Mt,te,ve,oe,Te,He,Ge,cr,ur,jr){var Hr=Lt==="legend";He&&(Ge==="overlay"?(cr=He,ur=r.contrast(cr)):(cr=void 0,ur=He));var br=Mt._fullLayout,Kr="p"+br._uid+"-"+te,rn,Ce,$t=function(Ar,Tr,pr,Jr,Vn){return Jr+(Vn-Jr)*(Ar-Tr)/(pr-Tr)},ne,Ct,gt,St,Nt={},ee=t(ur),le=r.tinyRGB(ee),we=ee.getAlpha(),Ue=jr*we;switch(ve){case"/":rn=oe*Math.sqrt(2),Ce=oe*Math.sqrt(2),ne="M-"+rn/4+","+Ce/4+"l"+rn/2+",-"+Ce/2+"M0,"+Ce+"L"+rn+",0M"+rn/4*3+","+Ce/4*5+"l"+rn/2+",-"+Ce/2,Ct=Te*oe,St="path",Nt={d:ne,opacity:Ue,stroke:le,"stroke-width":Ct+"px"};break;case"\\":rn=oe*Math.sqrt(2),Ce=oe*Math.sqrt(2),ne="M"+rn/4*3+",-"+Ce/4+"l"+rn/2+","+Ce/2+"M0,0L"+rn+","+Ce+"M-"+rn/4+","+Ce/4*3+"l"+rn/2+","+Ce/2,Ct=Te*oe,St="path",Nt={d:ne,opacity:Ue,stroke:le,"stroke-width":Ct+"px"};break;case"x":rn=oe*Math.sqrt(2),Ce=oe*Math.sqrt(2),ne="M-"+rn/4+","+Ce/4+"l"+rn/2+",-"+Ce/2+"M0,"+Ce+"L"+rn+",0M"+rn/4*3+","+Ce/4*5+"l"+rn/2+",-"+Ce/2+"M"+rn/4*3+",-"+Ce/4+"l"+rn/2+","+Ce/2+"M0,0L"+rn+","+Ce+"M-"+rn/4+","+Ce/4*3+"l"+rn/2+","+Ce/2,Ct=oe-oe*Math.sqrt(1-Te),St="path",Nt={d:ne,opacity:Ue,stroke:le,"stroke-width":Ct+"px"};break;case"|":rn=oe,Ce=oe,St="path",ne="M"+rn/2+",0L"+rn/2+","+Ce,Ct=Te*oe,St="path",Nt={d:ne,opacity:Ue,stroke:le,"stroke-width":Ct+"px"};break;case"-":rn=oe,Ce=oe,St="path",ne="M0,"+Ce/2+"L"+rn+","+Ce/2,Ct=Te*oe,St="path",Nt={d:ne,opacity:Ue,stroke:le,"stroke-width":Ct+"px"};break;case"+":rn=oe,Ce=oe,St="path",ne="M"+rn/2+",0L"+rn/2+","+Ce+"M0,"+Ce/2+"L"+rn+","+Ce/2,Ct=oe-oe*Math.sqrt(1-Te),St="path",Nt={d:ne,opacity:Ue,stroke:le,"stroke-width":Ct+"px"};break;case".":rn=oe,Ce=oe,Te<Math.PI/4?gt=Math.sqrt(Te*oe*oe/Math.PI):gt=$t(Te,Math.PI/4,1,oe/2,oe/Math.sqrt(2)),St="circle",Nt={cx:rn/2,cy:Ce/2,r:gt,opacity:Ue,fill:le};break;default:rn=oe,Ce=oe,St="path",Nt={d:ve,opacity:Ue,fill:le};break}var qe=[ve||"noSh",cr||"noBg",ur||"noFg",oe,Te].join(";"),ar=br._defs.select(".patterns").selectAll("#"+Kr).data([qe],g.identity);ar.exit().remove(),ar.enter().append("pattern").each(function(){var Ar=c.select(this);if(Ar.attr({id:Kr,width:rn+"px",height:Ce+"px",patternUnits:"userSpaceOnUse",patternTransform:Hr?"scale(0.8)":""}),cr){var Tr=t(cr),pr=r.tinyRGB(Tr),Jr=Tr.getAlpha(),Vn=Ar.selectAll("rect").data([0]);Vn.exit().remove(),Vn.enter().append("rect").attr({width:rn+"px",height:Ce+"px",fill:pr,"fill-opacity":Jr})}var Hn=Ar.selectAll(St).data([0]);Hn.exit().remove(),Hn.enter().append(St).attr(Nt)}),Tt.style("fill",vt(Kr,Mt)).style("fill-opacity",null),Tt.classed("pattern_filled",!0)},u.initGradients=function(Tt){var Lt=Tt._fullLayout,Mt=g.ensureSingle(Lt._defs,"g","gradients");Mt.selectAll("linearGradient,radialGradient").remove(),c.select(Tt).selectAll(".gradient_filled").classed("gradient_filled",!1)},u.initPatterns=function(Tt){var Lt=Tt._fullLayout,Mt=g.ensureSingle(Lt._defs,"g","patterns");Mt.selectAll("pattern").remove(),c.select(Tt).selectAll(".pattern_filled").classed("pattern_filled",!1)},u.getPatternAttr=function(Tt,Lt,Mt){return Tt&&g.isArrayOrTypedArray(Tt)?Lt<Tt.length?Tt[Lt]:Mt:Tt},u.pointStyle=function(Tt,Lt,Mt,te){if(Tt.size()){var ve=u.makePointStyleFns(Lt);Tt.each(function(oe){u.singlePointStyle(oe,c.select(this),Lt,ve,Mt,te)})}},u.singlePointStyle=function(Tt,Lt,Mt,te,ve,oe){var Te=Mt.marker,He=Te.line;if(oe&&oe.i>=0&&Tt.i===void 0&&(Tt.i=oe.i),Lt.style("opacity",te.selectedOpacityFn?te.selectedOpacityFn(Tt):Tt.mo===void 0?Te.opacity:Tt.mo),te.ms2mrc){var Ge;Tt.ms==="various"||Te.size==="various"?Ge=3:Ge=te.ms2mrc(Tt.ms),Tt.mrc=Ge,te.selectedSizeFn&&(Ge=Tt.mrc=te.selectedSizeFn(Tt));var cr=u.symbolNumber(Tt.mx||Te.symbol)||0;Tt.om=cr%200>=100;var ur=se(Tt,Mt),jr=ft(Tt,Mt);Lt.attr("d",k(cr,Ge,ur,jr))}var Hr=!1,br,Kr,rn;if(Tt.so)rn=He.outlierwidth,Kr=He.outliercolor,br=Te.outliercolor;else{var Ce=(He||{}).width;rn=(Tt.mlw+1||Ce+1||(Tt.trace?(Tt.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Tt?Kr=Tt.mlcc=te.lineScale(Tt.mlc):g.isArrayOrTypedArray(He.color)?Kr=r.defaultLine:Kr=He.color,g.isArrayOrTypedArray(Te.color)&&(br=r.defaultLine,Hr=!0),"mc"in Tt?br=Tt.mcc=te.markerScale(Tt.mc):br=Te.color||Te.colors||"rgba(0,0,0,0)",te.selectedColorFn&&(br=te.selectedColorFn(Tt))}if(Tt.om)Lt.call(r.stroke,br).style({"stroke-width":(rn||1)+"px",fill:"none"});else{Lt.style("stroke-width",(Tt.isBlank?0:rn)+"px");var $t=Te.gradient,ne=Tt.mgt;ne?Hr=!0:ne=$t&&$t.type,g.isArrayOrTypedArray(ne)&&(ne=ne[0],R[ne]||(ne=0));var Ct=Te.pattern,gt=u.getPatternAttr,St=Ct&&(gt(Ct.shape,Tt.i,"")||gt(Ct.path,Tt.i,""));if(ne&&ne!=="none"){var Nt=Tt.mgc;Nt?Hr=!0:Nt=$t.color;var ee=Mt.uid;Hr&&(ee+="-"+Tt.i),u.gradient(Lt,ve,ee,ne,[[0,Nt],[1,br]],"fill")}else if(St){var le=!1,we=Ct.fgcolor;!we&&oe&&oe.color&&(we=oe.color,le=!0);var Ue=gt(we,Tt.i,oe&&oe.color||null),qe=gt(Ct.bgcolor,Tt.i,null),ar=Ct.fgopacity,Ar=gt(Ct.size,Tt.i,8),Tr=gt(Ct.solidity,Tt.i,.3);le=le||Tt.mcc||g.isArrayOrTypedArray(Ct.shape)||g.isArrayOrTypedArray(Ct.path)||g.isArrayOrTypedArray(Ct.bgcolor)||g.isArrayOrTypedArray(Ct.fgcolor)||g.isArrayOrTypedArray(Ct.size)||g.isArrayOrTypedArray(Ct.solidity);var pr=Mt.uid;le&&(pr+="-"+Tt.i),u.pattern(Lt,"point",ve,pr,St,Ar,Tr,Tt.mcc,Ct.fillmode,qe,Ue,ar)}else g.isArrayOrTypedArray(br)?r.fill(Lt,br[Tt.i]):r.fill(Lt,br);rn&&r.stroke(Lt,Kr)}},u.makePointStyleFns=function(Tt){var Lt={},Mt=Tt.marker;return Lt.markerScale=u.tryColorscale(Mt,""),Lt.lineScale=u.tryColorscale(Mt,"line"),e.traceIs(Tt,"symbols")&&(Lt.ms2mrc=y.isBubble(Tt)?v(Tt):function(){return(Mt.size||6)/2}),Tt.selectedpoints&&g.extendFlat(Lt,u.makeSelectedPointStyleFns(Tt)),Lt},u.makeSelectedPointStyleFns=function(Tt){var Lt={},Mt=Tt.selected||{},te=Tt.unselected||{},ve=Tt.marker||{},oe=Mt.marker||{},Te=te.marker||{},He=ve.opacity,Ge=oe.opacity,cr=Te.opacity,ur=Ge!==void 0,jr=cr!==void 0;(g.isArrayOrTypedArray(He)||ur||jr)&&(Lt.selectedOpacityFn=function(gt){var St=gt.mo===void 0?ve.opacity:gt.mo;return gt.selected?ur?Ge:St:jr?cr:x*St});var Hr=ve.color,br=oe.color,Kr=Te.color;(br||Kr)&&(Lt.selectedColorFn=function(gt){var St=gt.mcc||Hr;return gt.selected?br||St:Kr||St});var rn=ve.size,Ce=oe.size,$t=Te.size,ne=Ce!==void 0,Ct=$t!==void 0;return e.traceIs(Tt,"symbols")&&(ne||Ct)&&(Lt.selectedSizeFn=function(gt){var St=gt.mrc||rn/2;return gt.selected?ne?Ce/2:St:Ct?$t/2:St}),Lt},u.makeSelectedTextStyleFns=function(Tt){var Lt={},Mt=Tt.selected||{},te=Tt.unselected||{},ve=Tt.textfont||{},oe=Mt.textfont||{},Te=te.textfont||{},He=ve.color,Ge=oe.color,cr=Te.color;return Lt.selectedTextColorFn=function(ur){var jr=ur.tc||He;return ur.selected?Ge||jr:cr||(Ge?jr:r.addOpacity(jr,x))},Lt},u.selectedPointStyle=function(Tt,Lt){if(!(!Tt.size()||!Lt.selectedpoints)){var Mt=u.makeSelectedPointStyleFns(Lt),te=Lt.marker||{},ve=[];Mt.selectedOpacityFn&&ve.push(function(oe,Te){oe.style("opacity",Mt.selectedOpacityFn(Te))}),Mt.selectedColorFn&&ve.push(function(oe,Te){r.fill(oe,Mt.selectedColorFn(Te))}),Mt.selectedSizeFn&&ve.push(function(oe,Te){var He=Te.mx||te.symbol||0,Ge=Mt.selectedSizeFn(Te);oe.attr("d",k(u.symbolNumber(He),Ge,se(Te,Lt),ft(Te,Lt))),Te.mrc2=Ge}),ve.length&&Tt.each(function(oe){for(var Te=c.select(this),He=0;He<ve.length;He++)ve[He](Te,oe)})}},u.tryColorscale=function(Tt,Lt){var Mt=Lt?g.nestedProperty(Tt,Lt).get():Tt;if(Mt){var te=Mt.color;if((Mt.colorscale||Mt._colorAx)&&g.isArrayOrTypedArray(te))return a.makeColorScaleFuncFromTrace(Mt)}return g.identity};var N={start:1,end:-1,middle:0,bottom:1,top:-1};function V(Tt,Lt,Mt,te,ve){var oe=c.select(Tt.node().parentNode),Te=Lt.indexOf("top")!==-1?"top":Lt.indexOf("bottom")!==-1?"bottom":"middle",He=Lt.indexOf("left")!==-1?"end":Lt.indexOf("right")!==-1?"start":"middle",Ge=te?te/.8+1:0,cr=(o.lineCount(Tt)-1)*f+1,ur=N[He]*Ge,jr=Mt*.75+N[Te]*Ge+(N[Te]-1)*cr*Mt/2;Tt.attr("text-anchor",He),ve||oe.attr("transform",n(ur,jr))}function H(Tt,Lt){var Mt=Tt.ts||Lt.textfont.size;return S(Mt)&&Mt>0?Mt:0}u.textPointStyle=function(Tt,Lt,Mt){if(Tt.size()){var te;if(Lt.selectedpoints){var ve=u.makeSelectedTextStyleFns(Lt);te=ve.selectedTextColorFn}var oe=Lt.texttemplate,Te=Mt._fullLayout;Tt.each(function(He){var Ge=c.select(this),cr=oe?g.extractOption(He,Lt,"txt","texttemplate"):g.extractOption(He,Lt,"tx","text");if(!cr&&cr!==0){Ge.remove();return}if(oe){var ur=Lt._module.formatLabels,jr=ur?ur(He,Lt,Te):{},Hr={};T(Hr,Lt,He.i),cr=g.texttemplateString({data:[Hr,He,Lt._meta],fallback:Lt.texttemplatefallback,labels:jr,locale:Te._d3locale,template:cr})}var br=He.tp||Lt.textposition,Kr=H(He,Lt),rn=te?te(He):He.tc||Lt.textfont.color;Ge.call(u.font,{family:He.tf||Lt.textfont.family,weight:He.tw||Lt.textfont.weight,style:He.ty||Lt.textfont.style,variant:He.tv||Lt.textfont.variant,textcase:He.tC||Lt.textfont.textcase,lineposition:He.tE||Lt.textfont.lineposition,shadow:He.tS||Lt.textfont.shadow,size:Kr,color:rn}).text(cr).call(o.convertToTspans,Mt).call(V,br,Kr,He.mrc)})}},u.selectedTextStyle=function(Tt,Lt){if(!(!Tt.size()||!Lt.selectedpoints)){var Mt=u.makeSelectedTextStyleFns(Lt);Tt.each(function(te){var ve=c.select(this),oe=Mt.selectedTextColorFn(te),Te=te.tp||Lt.textposition,He=H(te,Lt);r.fill(ve,oe);var Ge=e.traceIs(Lt,"bar-like");V(ve,Te,He,te.mrc2||te.mrc,Ge)})}};var F=.5;u.smoothopen=function(Tt,Lt){if(Tt.length<3)return"M"+Tt.join("L");var Mt="M"+Tt[0],te=[],ve;for(ve=1;ve<Tt.length-1;ve++)te.push(yt(Tt[ve-1],Tt[ve],Tt[ve+1],Lt));for(Mt+="Q"+te[0][0]+" "+Tt[1],ve=2;ve<Tt.length-1;ve++)Mt+="C"+te[ve-2][1]+" "+te[ve-1][0]+" "+Tt[ve];return Mt+="Q"+te[Tt.length-3][1]+" "+Tt[Tt.length-1],Mt},u.smoothclosed=function(Tt,Lt){if(Tt.length<3)return"M"+Tt.join("L")+"Z";var Mt="M"+Tt[0],te=Tt.length-1,ve=[yt(Tt[te],Tt[0],Tt[1],Lt)],oe;for(oe=1;oe<te;oe++)ve.push(yt(Tt[oe-1],Tt[oe],Tt[oe+1],Lt));for(ve.push(yt(Tt[te-1],Tt[te],Tt[0],Lt)),oe=1;oe<=te;oe++)Mt+="C"+ve[oe-1][1]+" "+ve[oe][0]+" "+Tt[oe];return Mt+="C"+ve[te][1]+" "+ve[0][0]+" "+Tt[0]+"Z",Mt};var U,W;function q(Tt,Lt,Mt){return Mt&&(Tt=tt(Tt)),Lt?lt(Tt[1]):X(Tt[0])}function X(Tt){var Lt=c.round(Tt,2);return U=Lt,Lt}function lt(Tt){var Lt=c.round(Tt,2);return W=Lt,Lt}function yt(Tt,Lt,Mt,te){var ve=Tt[0]-Lt[0],oe=Tt[1]-Lt[1],Te=Mt[0]-Lt[0],He=Mt[1]-Lt[1],Ge=Math.pow(ve*ve+oe*oe,F/2),cr=Math.pow(Te*Te+He*He,F/2),ur=(cr*cr*ve-Ge*Ge*Te)*te,jr=(cr*cr*oe-Ge*Ge*He)*te,Hr=3*cr*(Ge+cr),br=3*Ge*(Ge+cr);return[[X(Lt[0]+(Hr&&ur/Hr)),lt(Lt[1]+(Hr&&jr/Hr))],[X(Lt[0]-(br&&ur/br)),lt(Lt[1]-(br&&jr/br))]]}var pt={hv:function(Tt,Lt,Mt){return"H"+X(Lt[0])+"V"+q(Lt,1,Mt)},vh:function(Tt,Lt,Mt){return"V"+lt(Lt[1])+"H"+q(Lt,0,Mt)},hvh:function(Tt,Lt,Mt){return"H"+X((Tt[0]+Lt[0])/2)+"V"+lt(Lt[1])+"H"+q(Lt,0,Mt)},vhv:function(Tt,Lt,Mt){return"V"+lt((Tt[1]+Lt[1])/2)+"H"+X(Lt[0])+"V"+q(Lt,1,Mt)}},st=function(Tt,Lt,Mt){return"L"+q(Lt,0,Mt)+","+q(Lt,1,Mt)};u.steps=function(Tt){var Lt=pt[Tt]||st;return function(Mt){for(var te="M"+X(Mt[0][0])+","+lt(Mt[0][1]),ve=Mt.length,oe=1;oe<ve;oe++)te+=Lt(Mt[oe-1],Mt[oe],oe===ve-1);return te}};function tt(Tt,Lt){var Mt=Tt.backoff,te=Tt.trace,ve=Tt.d,oe=Tt.i;if(Mt&&te&&te.marker&&te.marker.angle%360===0&&te.line&&te.line.shape!=="spline"){var Te=g.isArrayOrTypedArray(Mt),He=Tt,Ge=Lt?Lt[0]:U||0,cr=Lt?Lt[1]:W||0,ur=He[0],jr=He[1],Hr=ur-Ge,br=jr-cr,Kr=Math.atan2(br,Hr),rn=Te?Mt[oe]:Mt;if(rn==="auto"){var Ce=He.i;te.type==="scatter"&&Ce--;var $t=He.marker,ne=$t.symbol;g.isArrayOrTypedArray(ne)&&(ne=ne[Ce]);var Ct=$t.size;g.isArrayOrTypedArray(Ct)&&(Ct=Ct[Ce]),rn=$t?u.symbolBackOffs[u.symbolNumber(ne)]*Ct:0,rn+=u.getMarkerStandoff(ve[Ce],te)||0}var gt=ur-rn*Math.cos(Kr),St=jr-rn*Math.sin(Kr);(gt<=ur&&gt>=Ge||gt>=ur&&gt<=Ge)&&(St<=jr&&St>=cr||St>=jr&&St<=cr)&&(Tt=[gt,St])}return Tt}u.applyBackoff=tt,u.makeTester=function(){var Tt=g.ensureSingleById(c.select("body"),"svg","js-plotly-tester",function(Mt){Mt.attr(i.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),Lt=g.ensureSingle(Tt,"path","js-reference-point",function(Mt){Mt.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});u.tester=Tt,u.testref=Lt},u.savedBBoxes={};var dt=0,rt=1e4;u.bBox=function(Tt,Lt,Mt){Mt||(Mt=at(Tt));var te;if(Mt){if(te=u.savedBBoxes[Mt],te)return g.extendFlat({},te)}else if(Tt.childNodes.length===1){var ve=Tt.childNodes[0];if(Mt=at(ve),Mt){var oe=+ve.getAttribute("x")||0,Te=+ve.getAttribute("y")||0,He=ve.getAttribute("transform");if(!He){var Ge=u.bBox(ve,!1,Mt);return oe&&(Ge.left+=oe,Ge.right+=oe),Te&&(Ge.top+=Te,Ge.bottom+=Te),Ge}if(Mt+="~"+oe+"~"+Te+"~"+He,te=u.savedBBoxes[Mt],te)return g.extendFlat({},te)}}var cr,ur;Lt?cr=Tt:(ur=u.tester.node(),cr=Tt.cloneNode(!0),ur.appendChild(cr)),c.select(cr).attr("transform",null).call(o.positionText,0,0);var jr=cr.getBoundingClientRect(),Hr=u.testref.node().getBoundingClientRect();Lt||ur.removeChild(cr);var br={height:jr.height,width:jr.width,left:jr.left-Hr.left,top:jr.top-Hr.top,right:jr.right-Hr.left,bottom:jr.bottom-Hr.top};return dt>=rt&&(u.savedBBoxes={},dt=0),Mt&&(u.savedBBoxes[Mt]=br),dt++,g.extendFlat({},br)};function at(Tt){var Lt=Tt.getAttribute("data-unformatted");if(Lt!==null)return Lt+Tt.getAttribute("data-math")+Tt.getAttribute("text-anchor")+Tt.getAttribute("style")}u.setClipUrl=function(Tt,Lt,Mt){Tt.attr("clip-path",vt(Lt,Mt))};function vt(Tt,Lt){if(!Tt)return null;var Mt=Lt._context,te=Mt._exportedPlot?"":Mt._baseUrl||"";return te?"url('"+te+"#"+Tt+"')":"url(#"+Tt+")"}u.getTranslate=function(Tt){var Lt=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,Mt=Tt.attr?"attr":"getAttribute",te=Tt[Mt]("transform")||"",ve=te.replace(Lt,function(oe,Te,He){return[Te,He].join(" ")}).split(" ");return{x:+ve[0]||0,y:+ve[1]||0}},u.setTranslate=function(Tt,Lt,Mt){var te=/(\btranslate\(.*?\);?)/,ve=Tt.attr?"attr":"getAttribute",oe=Tt.attr?"attr":"setAttribute",Te=Tt[ve]("transform")||"";return Lt=Lt||0,Mt=Mt||0,Te=Te.replace(te,"").trim(),Te+=n(Lt,Mt),Te=Te.trim(),Tt[oe]("transform",Te),Te},u.getScale=function(Tt){var Lt=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,Mt=Tt.attr?"attr":"getAttribute",te=Tt[Mt]("transform")||"",ve=te.replace(Lt,function(oe,Te,He){return[Te,He].join(" ")}).split(" ");return{x:+ve[0]||1,y:+ve[1]||1}},u.setScale=function(Tt,Lt,Mt){var te=/(\bscale\(.*?\);?)/,ve=Tt.attr?"attr":"getAttribute",oe=Tt.attr?"attr":"setAttribute",Te=Tt[ve]("transform")||"";return Lt=Lt||1,Mt=Mt||1,Te=Te.replace(te,"").trim(),Te+="scale("+Lt+","+Mt+")",Te=Te.trim(),Tt[oe]("transform",Te),Te};var it=/\s*sc.*/;u.setPointGroupScale=function(Tt,Lt,Mt){if(Lt=Lt||1,Mt=Mt||1,!!Tt){var te=Lt===1&&Mt===1?"":"scale("+Lt+","+Mt+")";Tt.each(function(){var ve=(this.getAttribute("transform")||"").replace(it,"");ve+=te,ve=ve.trim(),this.setAttribute("transform",ve)})}};var Y=/translate\([^)]*\)\s*$/;u.setTextPointsScale=function(Tt,Lt,Mt){Tt&&Tt.each(function(){var te,ve=c.select(this),oe=ve.select("text");if(oe.node()){var Te=parseFloat(oe.attr("x")||0),He=parseFloat(oe.attr("y")||0),Ge=(ve.attr("transform")||"").match(Y);Lt===1&&Mt===1?te=[]:te=[n(Te,He),"scale("+Lt+","+Mt+")",n(-Te,-He)],Ge&&te.push(Ge),ve.attr("transform",te.join(""))}})};function ft(Tt,Lt){var Mt;return Tt&&(Mt=Tt.mf),Mt===void 0&&(Mt=Lt.marker&&Lt.marker.standoff||0),!Lt._geo&&!Lt._xA?-Mt:Mt}u.getMarkerStandoff=ft;var ut=Math.atan2,wt=Math.cos,zt=Math.sin;function Pt(Tt,Lt){var Mt=Lt[0],te=Lt[1];return[Mt*wt(Tt)-te*zt(Tt),Mt*zt(Tt)+te*wt(Tt)]}var Wt,Ht,Jt,ge,he,de;function se(Tt,Lt){var Mt=Tt.ma;Mt===void 0&&(Mt=Lt.marker.angle,(!Mt||g.isArrayOrTypedArray(Mt))&&(Mt=0));var te,ve,oe=Lt.marker.angleref;if(oe==="previous"||oe==="north"){if(Lt._geo){var Te=Lt._geo.project(Tt.lonlat);te=Te[0],ve=Te[1]}else{var He=Lt._xA,Ge=Lt._yA;if(He&&Ge)te=He.c2p(Tt.x),ve=Ge.c2p(Tt.y);else return 90}if(Lt._geo){var cr=Tt.lonlat[0],ur=Tt.lonlat[1],jr=Lt._geo.project([cr,ur+1e-5]),Hr=Lt._geo.project([cr+1e-5,ur]),br=ut(Hr[1]-ve,Hr[0]-te),Kr=ut(jr[1]-ve,jr[0]-te),rn;if(oe==="north")rn=Mt/180*Math.PI;else if(oe==="previous"){var Ce=cr/180*Math.PI,$t=ur/180*Math.PI,ne=Wt/180*Math.PI,Ct=Ht/180*Math.PI,gt=ne-Ce,St=wt(Ct)*zt(gt),Nt=zt(Ct)*wt($t)-wt(Ct)*zt($t)*wt(gt);rn=-ut(St,Nt)-Math.PI,Wt=cr,Ht=ur}var ee=Pt(br,[wt(rn),0]),le=Pt(Kr,[zt(rn),0]);Mt=ut(ee[1]+le[1],ee[0]+le[0])/Math.PI*180,oe==="previous"&&!(de===Lt.uid&&Tt.i===he+1)&&(Mt=null)}if(oe==="previous"&&!Lt._geo)if(de===Lt.uid&&Tt.i===he+1&&S(te)&&S(ve)){var we=te-Jt,Ue=ve-ge,qe=Lt.line&&Lt.line.shape||"",ar=qe.slice(qe.length-1);ar==="h"&&(Ue=0),ar==="v"&&(we=0),Mt+=ut(Ue,we)/Math.PI*180+90}else Mt=null}return Jt=te,ge=ve,he=Tt.i,de=Lt.uid,Mt}u.getMarkerAngle=se}),lp=Ft((Q,$)=>{var c=un(),g=ra(),P=Kc(),S=Xo(),t=bn(),e=t.strTranslate,r=js(),a=li(),n=tc(),o=co(),i=Af().OPPOSITE_SIDE,s=/ [XY][0-9]* /,f=1.6,x=1.6;function y(v,T,u){var b=v._fullLayout,_=u.propContainer,C=u.propName,M=u.placeholder,E=u.traceIndex,A=u.avoid||{},h=u.attributes,p=u.transform,k=u.containerGroup,w=1,R=_.title,O=(R&&R.text?R.text:"").trim(),N=!1,V=R&&R.font?R.font:{},H=V.family,F=V.size,U=V.color,W=V.weight,q=V.style,X=V.variant,lt=V.textcase,yt=V.lineposition,pt=V.shadow,st=u.subtitlePropName,tt=!!st,dt=u.subtitlePlaceholder,rt=(_.title||{}).subtitle||{text:"",font:{}},at=(rt.text||"").trim(),vt=!1,it=1,Y=rt.font,ft=Y.family,ut=Y.size,wt=Y.color,zt=Y.weight,Pt=Y.style,Wt=Y.variant,Ht=Y.textcase,Jt=Y.lineposition,ge=Y.shadow,he;C==="title.text"?he="titleText":C.indexOf("axis")!==-1?he="axisTitleText":C.indexOf("colorbar")!==-1&&(he="colorbarTitleText");var de=v._context.edits[he];function se(Hr,br){return Hr===void 0||br===void 0?!1:Hr.replace(s," % ")===br.replace(s," % ")}O===""?w=0:se(O,M)&&(de||(O=""),w=.2,N=!0),tt&&(at===""?it=0:se(at,dt)&&(de||(at=""),it=.2,vt=!0)),u._meta?O=t.templateString(O,u._meta):b._meta&&(O=t.templateString(O,b._meta));var Tt=O||at||de,Lt;k||(k=t.ensureSingle(b._infolayer,"g","g-"+T),Lt=b._hColorbarMoveTitle);var Mt=k.selectAll("text."+T).data(Tt?[0]:[]);Mt.enter().append("text"),Mt.text(O).attr("class",T),Mt.exit().remove();var te=null,ve=T+"-subtitle",oe=at||de;if(tt&&(te=k.selectAll("text."+ve).data(oe?[0]:[]),te.enter().append("text"),te.text(at).attr("class",ve),te.exit().remove()),!Tt)return k;function Te(Hr,br){t.syncOrAsync([He,Ge],{title:Hr,subtitle:br})}function He(Hr){var br=Hr.title,Kr=Hr.subtitle,rn;!p&&Lt&&(p={}),p?(rn="",p.rotate&&(rn+="rotate("+[p.rotate,h.x,h.y]+")"),(p.offset||Lt)&&(rn+=e(0,(p.offset||0)-(Lt||0)))):rn=null,br.attr("transform",rn);function Ce(Nt){if(Nt){var ee=c.select(Nt.node().parentNode).select("."+ve);if(!ee.empty()){var le=Nt.node().getBBox();if(le.height){var we=le.y+le.height+f*ut;ee.attr("y",we)}}}}if(br.style("opacity",w*a.opacity(U)).call(r.font,{color:a.rgb(U),size:c.round(F,2),family:H,weight:W,style:q,variant:X,textcase:lt,shadow:pt,lineposition:yt}).attr(h).call(n.convertToTspans,v,Ce),Kr&&!Kr.empty()){var $t=k.select("."+T+"-math-group"),ne=br.node().getBBox(),Ct=$t.node()?$t.node().getBBox():void 0,gt=Ct?Ct.y+Ct.height+f*ut:ne.y+ne.height+x*ut,St=t.extendFlat({},h,{y:gt});Kr.attr("transform",rn),Kr.style("opacity",it*a.opacity(wt)).call(r.font,{color:a.rgb(wt),size:c.round(ut,2),family:ft,weight:zt,style:Pt,variant:Wt,textcase:Ht,shadow:ge,lineposition:Jt}).attr(St).call(n.convertToTspans,v)}return P.previousPromises(v)}function Ge(Hr){var br=Hr.title,Kr=c.select(br.node().parentNode);if(A&&A.selection&&A.side&&O){Kr.attr("transform",null);var rn=i[A.side],Ce=A.side==="left"||A.side==="top"?-1:1,$t=g(A.pad)?A.pad:2,ne=r.bBox(Kr.node()),Ct={t:0,b:0,l:0,r:0},gt=v._fullLayout._reservedMargin;for(var St in gt)for(var Nt in gt[St]){var ee=gt[St][Nt];Ct[Nt]=Math.max(Ct[Nt],ee)}var le={left:Ct.l,top:Ct.t,right:b.width-Ct.r,bottom:b.height-Ct.b},we=A.maxShift||Ce*(le[A.side]-ne[A.side]),Ue=0;if(we<0)Ue=we;else{var qe=A.offsetLeft||0,ar=A.offsetTop||0;ne.left-=qe,ne.right-=qe,ne.top-=ar,ne.bottom-=ar,A.selection.each(function(){var Tr=r.bBox(this);t.bBoxIntersect(ne,Tr,$t)&&(Ue=Math.max(Ue,Ce*(Tr[A.side]-ne[rn])+$t))}),Ue=Math.min(we,Ue),_._titleScoot=Math.abs(Ue)}if(Ue>0||we<0){var Ar={left:[-Ue,0],right:[Ue,0],top:[0,-Ue],bottom:[0,Ue]}[A.side];Kr.attr("transform",e(Ar[0],Ar[1]))}}}Mt.call(Te,te);function cr(Hr,br){Hr.text(br).on("mouseover.opacity",function(){c.select(this).transition().duration(o.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){c.select(this).transition().duration(o.HIDE_PLACEHOLDER).style("opacity",0)})}if(de&&(O?Mt.on(".opacity",null):(cr(Mt,M),N=!0),Mt.call(n.makeEditable,{gd:v}).on("edit",function(Hr){E!==void 0?S.call("_guiRestyle",v,C,Hr,E):S.call("_guiRelayout",v,C,Hr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Te)}).on("input",function(Hr){this.text(Hr||" ").call(n.positionText,h.x,h.y)}),tt)){if(tt&&!O){var ur=Mt.node().getBBox(),jr=ur.y+ur.height+x*ut;te.attr("y",jr)}at?te.on(".opacity",null):(cr(te,dt),vt=!0),te.call(n.makeEditable,{gd:v}).on("edit",function(Hr){S.call("_guiRelayout",v,"title.subtitle.text",Hr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Te)}).on("input",function(Hr){this.text(Hr||" ").call(n.positionText,te.attr("x"),te.attr("y"))})}return Mt.classed("js-placeholder",N),te&&!te.empty()&&te.classed("js-placeholder",vt),k}$.exports={draw:y,SUBTITLE_PADDING_EM:x,SUBTITLE_PADDING_MATHJAX_EM:f}}),i0=Ft((Q,$)=>{var c=un(),g=fa().utcFormat,P=bn(),S=P.numberFormat,t=ra(),e=P.cleanNumber,r=P.ms2DateTime,a=P.dateTime2ms,n=P.ensureNumber,o=P.isArrayOrTypedArray,i=Da(),s=i.FP_SAFE,f=i.BADNUM,x=i.LOG_CLIP,y=i.ONEWEEK,v=i.ONEDAY,T=i.ONEHOUR,u=i.ONEMIN,b=i.ONESEC,_=Rc(),C=ic(),M=C.HOUR_PATTERN,E=C.WEEKDAY_PATTERN;function A(p){return Math.pow(10,p)}function h(p){return p!=null}$.exports=function(p,k){k=k||{};var w=p._id||"x",R=w.charAt(0);function O(rt,at){if(rt>0)return Math.log(rt)/Math.LN10;if(rt<=0&&at&&p.range&&p.range.length===2){var vt=p.range[0],it=p.range[1];return .5*(vt+it-2*x*Math.abs(vt-it))}else return f}function N(rt,at,vt,it){if((it||{}).msUTC&&t(rt))return+rt;var Y=a(rt,vt||p.calendar);if(Y===f)if(t(rt)){rt=+rt;var ft=Math.floor(P.mod(rt+.05,1)*10),ut=Math.round(rt-ft/10);Y=a(new Date(ut))+ft/10}else return f;return Y}function V(rt,at,vt){return r(rt,at,vt||p.calendar)}function H(rt){return p._categories[Math.round(rt)]}function F(rt){if(h(rt)){if(p._categoriesMap===void 0&&(p._categoriesMap={}),p._categoriesMap[rt]!==void 0)return p._categoriesMap[rt];p._categories.push(typeof rt=="number"?String(rt):rt);var at=p._categories.length-1;return p._categoriesMap[rt]=at,at}return f}function U(rt,at){for(var vt=new Array(at),it=0;it<at;it++){var Y=(rt[0]||[])[it],ft=(rt[1]||[])[it];vt[it]=W([Y,ft])}return vt}function W(rt){if(p._categoriesMap)return p._categoriesMap[rt]}function q(rt){var at=W(rt);if(at!==void 0)return at;if(t(rt))return+rt}function X(rt){return t(rt)?+rt:W(rt)}function lt(rt,at,vt){return c.round(vt+at*rt,2)}function yt(rt,at,vt){return(rt-vt)/at}var pt=function(rt){return t(rt)?lt(rt,p._m,p._b):f},st=function(rt){return yt(rt,p._m,p._b)};if(p.rangebreaks){var tt=R==="y";pt=function(rt){if(!t(rt))return f;var at=p._rangebreaks.length;if(!at)return lt(rt,p._m,p._b);var vt=tt;p.range[0]>p.range[1]&&(vt=!vt);for(var it=vt?-1:1,Y=it*rt,ft=0,ut=0;ut<at;ut++){var wt=it*p._rangebreaks[ut].min,zt=it*p._rangebreaks[ut].max;if(Y<wt)break;if(Y>zt)ft=ut+1;else{ft=Y<(wt+zt)/2?ut:ut+1;break}}var Pt=p._B[ft]||0;return isFinite(Pt)?lt(rt,p._m2,Pt):0},st=function(rt){var at=p._rangebreaks.length;if(!at)return yt(rt,p._m,p._b);for(var vt=0,it=0;it<at&&!(rt<p._rangebreaks[it].pmin);it++)rt>p._rangebreaks[it].pmax&&(vt=it+1);return yt(rt,p._m2,p._B[vt])}}p.c2l=p.type==="log"?O:n,p.l2c=p.type==="log"?A:n,p.l2p=pt,p.p2l=st,p.c2p=p.type==="log"?function(rt,at){return pt(O(rt,at))}:pt,p.p2c=p.type==="log"?function(rt){return A(st(rt))}:st,["linear","-"].indexOf(p.type)!==-1?(p.d2r=p.r2d=p.d2c=p.r2c=p.d2l=p.r2l=e,p.c2d=p.c2r=p.l2d=p.l2r=n,p.d2p=p.r2p=function(rt){return p.l2p(e(rt))},p.p2d=p.p2r=st,p.cleanPos=n):p.type==="log"?(p.d2r=p.d2l=function(rt,at){return O(e(rt),at)},p.r2d=p.r2c=function(rt){return A(e(rt))},p.d2c=p.r2l=e,p.c2d=p.l2r=n,p.c2r=O,p.l2d=A,p.d2p=function(rt,at){return p.l2p(p.d2r(rt,at))},p.p2d=function(rt){return A(st(rt))},p.r2p=function(rt){return p.l2p(e(rt))},p.p2r=st,p.cleanPos=n):p.type==="date"?(p.d2r=p.r2d=P.identity,p.d2c=p.r2c=p.d2l=p.r2l=N,p.c2d=p.c2r=p.l2d=p.l2r=V,p.d2p=p.r2p=function(rt,at,vt){return p.l2p(N(rt,0,vt))},p.p2d=p.p2r=function(rt,at,vt){return V(st(rt),at,vt)},p.cleanPos=function(rt){return P.cleanDate(rt,f,p.calendar)}):p.type==="category"?(p.d2c=p.d2l=F,p.r2d=p.c2d=p.l2d=H,p.d2r=p.d2l_noadd=q,p.r2c=function(rt){var at=X(rt);return at!==void 0?at:p.fraction2r(.5)},p.l2r=p.c2r=n,p.r2l=X,p.d2p=function(rt){return p.l2p(p.r2c(rt))},p.p2d=function(rt){return H(st(rt))},p.r2p=p.d2p,p.p2r=st,p.cleanPos=function(rt){return typeof rt=="string"&&rt!==""?rt:n(rt)}):p.type==="multicategory"&&(p.r2d=p.c2d=p.l2d=H,p.d2r=p.d2l_noadd=q,p.r2c=function(rt){var at=q(rt);return at!==void 0?at:p.fraction2r(.5)},p.r2c_just_indices=W,p.l2r=p.c2r=n,p.r2l=q,p.d2p=function(rt){return p.l2p(p.r2c(rt))},p.p2d=function(rt){return H(st(rt))},p.r2p=p.d2p,p.p2r=st,p.cleanPos=function(rt){return Array.isArray(rt)||typeof rt=="string"&&rt!==""?rt:n(rt)},p.setupMultiCategory=function(rt){var at=p._traceIndices,vt,it,Y=p._matchGroup;if(Y&&p._categories.length===0){for(var ft in Y)if(ft!==w){var ut=k[_.id2name(ft)];at=at.concat(ut._traceIndices)}}var wt=[[0,{}],[0,{}]],zt=[];for(vt=0;vt<at.length;vt++){var Pt=rt[at[vt]];if(R in Pt){var Wt=Pt[R],Ht=Pt._length||P.minRowLength(Wt);if(o(Wt[0])&&o(Wt[1]))for(it=0;it<Ht;it++){var Jt=Wt[0][it],ge=Wt[1][it];h(Jt)&&h(ge)&&(zt.push([Jt,ge]),Jt in wt[0][1]||(wt[0][1][Jt]=wt[0][0]++),ge in wt[1][1]||(wt[1][1][ge]=wt[1][0]++))}}}for(zt.sort(function(he,de){var se=wt[0][1],Tt=se[he[0]]-se[de[0]];if(Tt)return Tt;var Lt=wt[1][1];return Lt[he[1]]-Lt[de[1]]}),vt=0;vt<zt.length;vt++)F(zt[vt])}),p.fraction2r=function(rt){var at=p.r2l(p.range[0]),vt=p.r2l(p.range[1]);return p.l2r(at+rt*(vt-at))},p.r2fraction=function(rt){var at=p.r2l(p.range[0]),vt=p.r2l(p.range[1]);return(p.r2l(rt)-at)/(vt-at)},p.limitRange=function(rt){var at=p.minallowed,vt=p.maxallowed;if(!(at===void 0&&vt===void 0)){rt||(rt="range");var it=P.nestedProperty(p,rt).get(),Y=P.simpleMap(it,p.r2l),ft=Y[1]<Y[0];ft&&Y.reverse();var ut=P.simpleMap([at,vt],p.r2l);if(at!==void 0&&Y[0]<ut[0]&&(it[ft?1:0]=at),vt!==void 0&&Y[1]>ut[1]&&(it[ft?0:1]=vt),it[0]===it[1]){var wt=p.l2r(at),zt=p.l2r(vt);if(at!==void 0){var Pt=wt+1;vt!==void 0&&(Pt=Math.min(Pt,zt)),it[ft?1:0]=Pt}if(vt!==void 0){var Wt=zt+1;at!==void 0&&(Wt=Math.max(Wt,wt)),it[ft?0:1]=Wt}}}},p.cleanRange=function(rt,at){p._cleanRange(rt,at),p.limitRange(rt)},p._cleanRange=function(rt,at){at||(at={}),rt||(rt="range");var vt=P.nestedProperty(p,rt).get(),it,Y;if(p.type==="date"?Y=P.dfltRange(p.calendar):R==="y"?Y=C.DFLTRANGEY:p._name==="realaxis"?Y=[0,1]:Y=at.dfltRange||C.DFLTRANGEX,Y=Y.slice(),(p.rangemode==="tozero"||p.rangemode==="nonnegative")&&(Y[0]=0),!vt||vt.length!==2){P.nestedProperty(p,rt).set(Y);return}var ft=vt[0]===null,ut=vt[1]===null;for(p.type==="date"&&!p.autorange&&(vt[0]=P.cleanDate(vt[0],f,p.calendar),vt[1]=P.cleanDate(vt[1],f,p.calendar)),it=0;it<2;it++)if(p.type==="date"){if(!P.isDateTime(vt[it],p.calendar)){p[rt]=Y;break}if(p.r2l(vt[0])===p.r2l(vt[1])){var wt=P.constrain(p.r2l(vt[0]),P.MIN_MS+1e3,P.MAX_MS-1e3);vt[0]=p.l2r(wt-1e3),vt[1]=p.l2r(wt+1e3);break}}else{if(!t(vt[it]))if(!(ft||ut)&&t(vt[1-it]))vt[it]=vt[1-it]*(it?10:.1);else{p[rt]=Y;break}if(vt[it]<-s?vt[it]=-s:vt[it]>s&&(vt[it]=s),vt[0]===vt[1]){var zt=Math.max(1,Math.abs(vt[0]*1e-6));vt[0]-=zt,vt[1]+=zt}}},p.setScale=function(rt){var at=k._size;if(p.overlaying){var vt=_.getFromId({_fullLayout:k},p.overlaying);p.domain=vt.domain}var it=rt&&p._r?"_r":"range",Y=p.calendar;p.cleanRange(it);var ft=p.r2l(p[it][0],Y),ut=p.r2l(p[it][1],Y),wt=R==="y";if(wt?(p._offset=at.t+(1-p.domain[1])*at.h,p._length=at.h*(p.domain[1]-p.domain[0]),p._m=p._length/(ft-ut),p._b=-p._m*ut):(p._offset=at.l+p.domain[0]*at.w,p._length=at.w*(p.domain[1]-p.domain[0]),p._m=p._length/(ut-ft),p._b=-p._m*ft),p._rangebreaks=[],p._lBreaks=0,p._m2=0,p._B=[],p.rangebreaks){var zt,Pt;if(p._rangebreaks=p.locateBreaks(Math.min(ft,ut),Math.max(ft,ut)),p._rangebreaks.length){for(zt=0;zt<p._rangebreaks.length;zt++)Pt=p._rangebreaks[zt],p._lBreaks+=Math.abs(Pt.max-Pt.min);var Wt=wt;ft>ut&&(Wt=!Wt),Wt&&p._rangebreaks.reverse();var Ht=Wt?-1:1;for(p._m2=Ht*p._length/(Math.abs(ut-ft)-p._lBreaks),p._B.push(-p._m2*(wt?ut:ft)),zt=0;zt<p._rangebreaks.length;zt++)Pt=p._rangebreaks[zt],p._B.push(p._B[p._B.length-1]-Ht*p._m2*(Pt.max-Pt.min));for(zt=0;zt<p._rangebreaks.length;zt++)Pt=p._rangebreaks[zt],Pt.pmin=pt(Pt.min),Pt.pmax=pt(Pt.max)}}if(!isFinite(p._m)||!isFinite(p._b)||p._length<0)throw k._replotting=!1,new Error("Something went wrong with axis scaling")},p.maskBreaks=function(rt){var at=p.rangebreaks||[],vt,it,Y,ft,ut;at._cachedPatterns||(at._cachedPatterns=at.map(function(se){return se.enabled&&se.bounds?P.simpleMap(se.bounds,se.pattern?e:p.d2c):null})),at._cachedValues||(at._cachedValues=at.map(function(se){return se.enabled&&se.values?P.simpleMap(se.values,p.d2c).sort(P.sorterAsc):null}));for(var wt=0;wt<at.length;wt++){var zt=at[wt];if(zt.enabled){if(zt.bounds){var Pt=zt.pattern;switch(vt=at._cachedPatterns[wt],it=vt[0],Y=vt[1],Pt){case E:ut=new Date(rt),ft=ut.getUTCDay(),it>Y&&(Y+=7,ft<it&&(ft+=7));break;case M:ut=new Date(rt);var Wt=ut.getUTCHours(),Ht=ut.getUTCMinutes(),Jt=ut.getUTCSeconds(),ge=ut.getUTCMilliseconds();ft=Wt+(Ht/60+Jt/3600+ge/36e5),it>Y&&(Y+=24,ft<it&&(ft+=24));break;case"":ft=rt;break}if(ft>=it&&ft<Y)return f}else for(var he=at._cachedValues[wt],de=0;de<he.length;de++)if(it=he[de],Y=it+zt.dvalue,rt>=it&&rt<Y)return f}}return rt},p.locateBreaks=function(rt,at){var vt,it,Y,ft,ut=[];if(!p.rangebreaks)return ut;var wt=p.rangebreaks.slice().sort(function(Lt,Mt){return Lt.pattern===E&&Mt.pattern===M?-1:Mt.pattern===E&&Lt.pattern===M?1:0}),zt=function(Lt,Mt){if(Lt=P.constrain(Lt,rt,at),Mt=P.constrain(Mt,rt,at),Lt!==Mt){for(var te=!0,ve=0;ve<ut.length;ve++){var oe=ut[ve];Lt<oe.max&&Mt>=oe.min&&(Lt<oe.min&&(oe.min=Lt),Mt>oe.max&&(oe.max=Mt),te=!1)}te&&ut.push({min:Lt,max:Mt})}};for(vt=0;vt<wt.length;vt++){var Pt=wt[vt];if(Pt.enabled)if(Pt.bounds){var Wt=rt,Ht=at;Pt.pattern&&(Wt=Math.floor(Wt)),it=P.simpleMap(Pt.bounds,Pt.pattern?e:p.r2l),Y=it[0],ft=it[1];var Jt=new Date(Wt),ge,he;switch(Pt.pattern){case E:he=y,ge=((ft<Y?7:0)+(ft-Y))*v,Wt+=Y*v-(Jt.getUTCDay()*v+Jt.getUTCHours()*T+Jt.getUTCMinutes()*u+Jt.getUTCSeconds()*b+Jt.getUTCMilliseconds());break;case M:he=v,ge=((ft<Y?24:0)+(ft-Y))*T,Wt+=Y*T-(Jt.getUTCHours()*T+Jt.getUTCMinutes()*u+Jt.getUTCSeconds()*b+Jt.getUTCMilliseconds());break;default:Wt=Math.min(it[0],it[1]),Ht=Math.max(it[0],it[1]),he=Ht-Wt,ge=he}for(var de=Wt;de<Ht;de+=he)zt(de,de+ge)}else for(var se=P.simpleMap(Pt.values,p.d2c),Tt=0;Tt<se.length;Tt++)Y=se[Tt],ft=Y+Pt.dvalue,zt(Y,ft)}return ut.sort(function(Lt,Mt){return Lt.min-Mt.min}),ut},p.makeCalcdata=function(rt,at,vt){var it,Y,ft,ut,wt=p.type,zt=wt==="date"&&rt[at+"calendar"];if(at in rt){if(it=rt[at],ut=rt._length||P.minRowLength(it),P.isTypedArray(it)&&(wt==="linear"||wt==="log")){if(ut===it.length)return it;if(it.subarray)return it.subarray(0,ut)}if(wt==="multicategory")return U(it,ut);for(Y=new Array(ut),ft=0;ft<ut;ft++)Y[ft]=p.d2c(it[ft],0,zt,vt)}else{var Pt=at+"0"in rt?p.d2c(rt[at+"0"],0,zt):0,Wt=rt["d"+at]?Number(rt["d"+at]):1;for(it=rt[{x:"y",y:"x"}[at]],ut=rt._length||it.length,Y=new Array(ut),ft=0;ft<ut;ft++)Y[ft]=Pt+ft*Wt}if(p.rangebreaks)for(ft=0;ft<ut;ft++)Y[ft]=p.maskBreaks(Y[ft]);return Y},p.isValidRange=function(rt,at){return Array.isArray(rt)&&rt.length===2&&(at&&rt[0]===null||t(p.r2l(rt[0])))&&(at&&rt[1]===null||t(p.r2l(rt[1])))},p.getAutorangeDflt=function(rt,at){var vt=!p.isValidRange(rt,"nullOk");return vt&&at&&at.reverseDflt?vt="reversed":rt&&(rt[0]===null&&rt[1]===null?vt=!0:rt[0]===null&&rt[1]!==null?vt="min":rt[0]!==null&&rt[1]===null&&(vt="max")),vt},p.isReversed=function(){var rt=p.autorange;return rt==="reversed"||rt==="min reversed"||rt==="max reversed"},p.isPtWithinRange=function(rt,at){var vt=p.c2l(rt[R],null,at),it=p.r2l(p.range[0]),Y=p.r2l(p.range[1]);return it<Y?it<=vt&&vt<=Y:Y<=vt&&vt<=it},p._emptyCategories=function(){p._categories=[],p._categoriesMap={}},p.clearCalc=function(){var rt=p._matchGroup;if(rt){var at=null,vt=null;for(var it in rt){var Y=k[_.id2name(it)];if(Y._categories){at=Y._categories,vt=Y._categoriesMap;break}}at&&vt?(p._categories=at,p._categoriesMap=vt):p._emptyCategories()}else p._emptyCategories();if(p._initialCategories)for(var ft=0;ft<p._initialCategories.length;ft++)F(p._initialCategories[ft])},p.sortByInitialCategories=function(){var rt=[];if(p._emptyCategories(),p._initialCategories)for(var at=0;at<p._initialCategories.length;at++)F(p._initialCategories[at]);rt=rt.concat(p._traceIndices);var vt=p._matchGroup;for(var it in vt)if(w!==it){var Y=k[_.id2name(it)];Y._categories=p._categories,Y._categoriesMap=p._categoriesMap,rt=rt.concat(Y._traceIndices)}return rt};var dt=k._d3locale;p.type==="date"&&(p._dateFormat=dt?dt.timeFormat:g,p._extraFormat=k._extraFormat),p._separators=k.separators,p._numFormat=dt?dt.numberFormat:S,delete p._minDtick,delete p._forceTick0}}),dv=Ft((Q,$)=>{var c=ra(),g=bn(),P=Da().BADNUM,S=g.isArrayOrTypedArray,t=g.isDateTime,e=g.cleanNumber,r=Math.round;$.exports=function(x,y,v){var T=x,u=v.noMultiCategory;if(S(T)&&!T.length)return"-";if(!u&&f(T))return"multicategory";if(u&&Array.isArray(T[0])){for(var b=[],_=0;_<T.length;_++)if(S(T[_]))for(var C=0;C<T[_].length;C++)b.push(T[_][C]);T=b}if(o(T,y))return"date";var M=v.autotypenumbers!=="strict";return s(T,M)?"category":n(T,M)?"linear":"-"};function a(x,y){return y?c(x):typeof x=="number"}function n(x,y){for(var v=x.length,T=0;T<v;T++)if(a(x[T],y))return!0;return!1}function o(x,y){for(var v=x.length,T=i(v),u=0,b=0,_={},C=0;C<v;C+=T){var M=r(C),E=x[M],A=String(E);_[A]||(_[A]=1,t(E,y)&&u++,c(E)&&b++)}return u>b*2}function i(x){return Math.max(1,(x-1)/1e3)}function s(x,y){for(var v=x.length,T=i(v),u=0,b=0,_={},C=0;C<v;C+=T){var M=r(C),E=x[M],A=String(E);if(!_[A]){_[A]=1;var h=typeof E;h==="boolean"?b++:(y?e(E)!==P:h==="number")?u++:h==="string"&&b++}}return b>u*2}function f(x){return S(x[0])&&S(x[1])}}),Y0=Ft((Q,$)=>{var c=un(),g=ra(),P=bn(),S=Da().FP_SAFE,t=Xo(),e=js(),r=Rc(),a=r.getFromId,n=r.isLinked;$.exports={applyAutorangeOptions:k,getAutoRange:o,makePadFn:s,doAutoRange:v,findExtremes:T,concatExtremes:y};function o(w,R){var O,N,V=[],H=w._fullLayout,F=s(H,R,0),U=s(H,R,1),W=y(w,R),q=W.min,X=W.max;if(q.length===0||X.length===0)return P.simpleMap(R.range,R.r2l);var lt=q[0].val,yt=X[0].val;for(O=1;O<q.length&&lt===yt;O++)lt=Math.min(lt,q[O].val);for(O=1;O<X.length&&lt===yt;O++)yt=Math.max(yt,X[O].val);var pt=R.autorange,st=pt==="reversed"||pt==="min reversed"||pt==="max reversed";if(!st&&R.range){var tt=P.simpleMap(R.range,R.r2l);st=tt[1]<tt[0]}R.autorange==="reversed"&&(R.autorange=!0);var dt=R.rangemode,rt=dt==="tozero",at=dt==="nonnegative",vt=R._length,it=vt/10,Y=0,ft,ut,wt,zt,Pt,Wt;for(O=0;O<q.length;O++)for(ft=q[O],N=0;N<X.length;N++)ut=X[N],Wt=ut.val-ft.val-i(R,ft.val,ut.val),Wt>0&&(Pt=vt-F(ft)-U(ut),Pt>it?Wt/Pt>Y&&(wt=ft,zt=ut,Y=Wt/Pt):Wt/vt>Y&&(wt={val:ft.val,nopad:1},zt={val:ut.val,nopad:1},Y=Wt/vt));function Ht(se,Tt){return Math.max(se,U(Tt))}if(lt===yt){var Jt=lt-1,ge=lt+1;if(rt)if(lt===0)V=[0,1];else{var he=(lt>0?X:q).reduce(Ht,0),de=lt/(1-Math.min(.5,he/vt));V=lt>0?[0,de]:[de,0]}else at?V=[Math.max(0,Jt),Math.max(1,ge)]:V=[Jt,ge]}else rt?(wt.val>=0&&(wt={val:0,nopad:1}),zt.val<=0&&(zt={val:0,nopad:1})):at&&(wt.val-Y*F(wt)<0&&(wt={val:0,nopad:1}),zt.val<=0&&(zt={val:1,nopad:1})),Y=(zt.val-wt.val-i(R,ft.val,ut.val))/(vt-F(wt)-U(zt)),V=[wt.val-Y*F(wt),zt.val+Y*U(zt)];return V=k(V,R),R.limitRange&&R.limitRange(),st&&V.reverse(),P.simpleMap(V,R.l2r||Number)}function i(w,R,O){var N=0;if(w.rangebreaks)for(var V=w.locateBreaks(R,O),H=0;H<V.length;H++){var F=V[H];N+=F.max-F.min}return N}function s(w,R,O){var N=.05*R._length,V=R._anchorAxis||{};if((R.ticklabelposition||"").indexOf("inside")!==-1||(V.ticklabelposition||"").indexOf("inside")!==-1){var H=R.isReversed();if(!H){var F=P.simpleMap(R.range,R.r2l);H=F[1]<F[0]}H&&(O=!O)}var U=0;return n(w,R._id)||(U=x(w,R,O)),N=Math.max(U,N),R.constrain==="domain"&&R._inputDomain&&(N*=(R._inputDomain[1]-R._inputDomain[0])/(R.domain[1]-R.domain[0])),function(W){return W.nopad?0:W.pad+(W.extrapad?N:U)}}var f=3;function x(w,R,O){var N=0,V=R._id.charAt(0)==="x";for(var H in w._plots){var F=w._plots[H];if(!(R._id!==F.xaxis._id&&R._id!==F.yaxis._id)){var U=(V?F.yaxis:F.xaxis)||{};if((U.ticklabelposition||"").indexOf("inside")!==-1&&(!O&&(U.side==="left"||U.side==="bottom")||O&&(U.side==="top"||U.side==="right"))){if(U._vals){var W=P.deg2rad(U._tickAngles[U._id+"tick"]||0),q=Math.abs(Math.cos(W)),X=Math.abs(Math.sin(W));if(!U._vals[0].bb){var lt=U._id+"tick",yt=U._selections[lt];yt.each(function(at){var vt=c.select(this),it=vt.select(".text-math-group");it.empty()&&(at.bb=e.bBox(vt.node()))})}for(var pt=0;pt<U._vals.length;pt++){var st=U._vals[pt],tt=st.bb;if(tt){var dt=2*f+tt.width,rt=2*f+tt.height;N=Math.max(N,V?Math.max(dt*q,rt*X):Math.max(rt*q,dt*X))}}}U.ticks==="inside"&&U.ticklabelposition==="inside"&&(N+=U.ticklen||0)}}}return N}function y(w,R,O){var N=R._id,V=w._fullData,H=w._fullLayout,F=[],U=[],W,q,X;function lt(dt,rt){for(W=0;W<rt.length;W++){var at=dt[rt[W]],vt=(at._extremes||{})[N];if(at.visible===!0&&vt){for(q=0;q<vt.min.length;q++)X=vt.min[q],u(F,X.val,X.pad,{extrapad:X.extrapad});for(q=0;q<vt.max.length;q++)X=vt.max[q],b(U,X.val,X.pad,{extrapad:X.extrapad})}}}if(lt(V,R._traceIndices),lt(H.annotations||[],R._annIndices||[]),lt(H.shapes||[],R._shapeIndices||[]),R._matchGroup&&!O){for(var yt in R._matchGroup)if(yt!==R._id){var pt=a(w,yt),st=y(w,pt,!0),tt=R._length/pt._length;for(q=0;q<st.min.length;q++)X=st.min[q],u(F,X.val,X.pad*tt,{extrapad:X.extrapad});for(q=0;q<st.max.length;q++)X=st.max[q],b(U,X.val,X.pad*tt,{extrapad:X.extrapad})}}return{min:F,max:U}}function v(w,R,O){if(R.setScale(),R.autorange){R.range=O?O.slice():o(w,R),R._r=R.range.slice(),R._rl=P.simpleMap(R._r,R.r2l);var N=R._input,V={};V[R._attr+".range"]=R.range,V[R._attr+".autorange"]=R.autorange,t.call("_storeDirectGUIEdit",w.layout,w._fullLayout._preGUI,V),N.range=R.range.slice(),N.autorange=R.autorange}var H=R._anchorAxis;if(H&&H.rangeslider){var F=H.rangeslider[R._name];F&&F.rangemode==="auto"&&(F.range=o(w,R)),H._input.rangeslider[R._name]=P.extendFlat({},F)}}function T(w,R,O){O||(O={}),w._m||w.setScale();var N=[],V=[],H=R.length,F=O.padded||!1,U=O.tozero&&(w.type==="linear"||w.type==="-"),W=w.type==="log",q=!1,X=O.vpadLinearized||!1,lt,yt,pt,st,tt,dt,rt,at,vt;function it(Ht){if(Array.isArray(Ht))return q=!0,function(ge){return Math.max(Number(Ht[ge]||0),0)};var Jt=Math.max(Number(Ht||0),0);return function(){return Jt}}var Y=it((w._m>0?O.ppadplus:O.ppadminus)||O.ppad||0),ft=it((w._m>0?O.ppadminus:O.ppadplus)||O.ppad||0),ut=it(O.vpadplus||O.vpad),wt=it(O.vpadminus||O.vpad);if(!q){if(at=1/0,vt=-1/0,W)for(lt=0;lt<H;lt++)yt=R[lt],yt<at&&yt>0&&(at=yt),yt>vt&&yt<S&&(vt=yt);else for(lt=0;lt<H;lt++)yt=R[lt],yt<at&&yt>-S&&(at=yt),yt>vt&&yt<S&&(vt=yt);R=[at,vt],H=2}var zt={tozero:U,extrapad:F};function Pt(Ht){pt=R[Ht],g(pt)&&(dt=Y(Ht),rt=ft(Ht),X?(st=w.c2l(pt)-wt(Ht),tt=w.c2l(pt)+ut(Ht)):(at=pt-wt(Ht),vt=pt+ut(Ht),W&&at<vt/10&&(at=vt/10),st=w.c2l(at),tt=w.c2l(vt)),U&&(st=Math.min(0,st),tt=Math.max(0,tt)),C(st)&&u(N,st,rt,zt),C(tt)&&b(V,tt,dt,zt))}var Wt=Math.min(6,H);for(lt=0;lt<Wt;lt++)Pt(lt);for(lt=H-1;lt>=Wt;lt--)Pt(lt);return{min:N,max:V,opts:O}}function u(w,R,O,N){_(w,R,O,N,M)}function b(w,R,O,N){_(w,R,O,N,E)}function _(w,R,O,N,V){for(var H=N.tozero,F=N.extrapad,U=!0,W=0;W<w.length&&U;W++){var q=w[W];if(V(q.val,R)&&q.pad>=O&&(q.extrapad||!F)){U=!1;break}else V(R,q.val)&&q.pad<=O&&(F||!q.extrapad)&&(w.splice(W,1),W--)}if(U){var X=H&&R===0;w.push({val:R,pad:X?0:O,extrapad:X?!1:F})}}function C(w){return g(w)&&Math.abs(w)<S}function M(w,R){return w<=R}function E(w,R){return w>=R}function A(w,R){var O=R.autorangeoptions;return O&&O.minallowed!==void 0&&p(R,O.minallowed,O.maxallowed)?O.minallowed:O&&O.clipmin!==void 0&&p(R,O.clipmin,O.clipmax)?Math.max(w,R.d2l(O.clipmin)):w}function h(w,R){var O=R.autorangeoptions;return O&&O.maxallowed!==void 0&&p(R,O.minallowed,O.maxallowed)?O.maxallowed:O&&O.clipmax!==void 0&&p(R,O.clipmin,O.clipmax)?Math.min(w,R.d2l(O.clipmax)):w}function p(w,R,O){return R!==void 0&&O!==void 0?(R=w.d2l(R),O=w.d2l(O),R<O):!0}function k(w,R){if(!R||!R.autorangeoptions)return w;var O=w[0],N=w[1],V=R.autorangeoptions.include;if(V!==void 0){var H=R.d2l(O),F=R.d2l(N);P.isArrayOrTypedArray(V)||(V=[V]);for(var U=0;U<V.length;U++){var W=R.d2l(V[U]);H>=W&&(H=W,O=W),F<=W&&(F=W,N=W)}}return O=A(O,R),N=h(N,R),[O,N]}}),Es=Ft((Q,$)=>{var c=un(),g=ra(),P=Kc(),S=Xo(),t=bn(),e=t.strTranslate,r=tc(),a=lp(),n=li(),o=js(),i=Ad(),s=Bh(),f=Da(),x=f.ONEMAXYEAR,y=f.ONEAVGYEAR,v=f.ONEMINYEAR,T=f.ONEMAXQUARTER,u=f.ONEAVGQUARTER,b=f.ONEMINQUARTER,_=f.ONEMAXMONTH,C=f.ONEAVGMONTH,M=f.ONEMINMONTH,E=f.ONEWEEK,A=f.ONEDAY,h=A/2,p=f.ONEHOUR,k=f.ONEMIN,w=f.ONESEC,R=f.ONEMILLI,O=f.ONEMICROSEC,N=f.MINUS_SIGN,V=f.BADNUM,H={K:"zeroline"},F={K:"gridline",L:"path"},U={K:"minor-gridline",L:"path"},W={K:"tick",L:"path"},q={K:"tick",L:"text"},X={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},lt=Af(),yt=lt.MID_SHIFT,pt=lt.CAP_SHIFT,st=lt.LINE_SPACING,tt=lt.OPPOSITE_SIDE,dt=3,rt=$.exports={};rt.setConvert=i0();var at=dv(),vt=Rc(),it=vt.idSort,Y=vt.isLinked;rt.id2name=vt.id2name,rt.name2id=vt.name2id,rt.cleanId=vt.cleanId,rt.list=vt.list,rt.listIds=vt.listIds,rt.getFromId=vt.getFromId,rt.getFromTrace=vt.getFromTrace;var ft=Y0();rt.getAutoRange=ft.getAutoRange,rt.findExtremes=ft.findExtremes;var ut=1e-4;function wt(ze){var Pe=(ze[1]-ze[0])*ut;return[ze[0]-Pe,ze[1]+Pe]}rt.coerceRef=function(ze,Pe,Rr,qr,$r,Br){var Gr=qr.charAt(qr.length-1),dn=Rr._fullLayout._subplots[Gr+"axis"],an=qr+"ref",Ee={};return $r||($r=dn[0]||(typeof Br=="string"?Br:Br[0])),Br||(Br=$r),dn=dn.concat(dn.map(function(dr){return dr+" domain"})),Ee[an]={valType:"enumerated",values:dn.concat(Br?typeof Br=="string"?[Br]:Br:[]),dflt:$r},t.coerce(ze,Pe,Ee,an)},rt.getRefType=function(ze){return ze===void 0?ze:ze==="paper"?"paper":ze==="pixel"?"pixel":/( domain)$/.test(ze)?"domain":"range"},rt.coercePosition=function(ze,Pe,Rr,qr,$r,Br){var Gr,dn,an=rt.getRefType(qr);if(an!=="range")Gr=t.ensureNumber,dn=Rr($r,Br);else{var Ee=rt.getFromId(Pe,qr);Br=Ee.fraction2r(Br),dn=Rr($r,Br),Gr=Ee.cleanPos}ze[$r]=Gr(dn)},rt.cleanPosition=function(ze,Pe,Rr){var qr=Rr==="paper"||Rr==="pixel"?t.ensureNumber:rt.getFromId(Pe,Rr).cleanPos;return qr(ze)},rt.redrawComponents=function(ze,Pe){Pe=Pe||rt.listIds(ze);var Rr=ze._fullLayout;function qr($r,Br,Gr,dn){for(var an=S.getComponentMethod($r,Br),Ee={},dr=0;dr<Pe.length;dr++)for(var Vr=Rr[rt.id2name(Pe[dr])],yn=Vr[Gr],Fn=0;Fn<yn.length;Fn++){var Xn=yn[Fn];if(!Ee[Xn]&&(an(ze,Xn),Ee[Xn]=1,dn))return}}qr("annotations","drawOne","_annIndices"),qr("shapes","drawOne","_shapeIndices"),qr("images","draw","_imgIndices",!0),qr("selections","drawOne","_selectionIndices")};var zt=rt.getDataConversions=function(ze,Pe,Rr,qr){var $r,Br=Rr==="x"||Rr==="y"||Rr==="z"?Rr:qr;if(t.isArrayOrTypedArray(Br)){if($r={type:at(qr,void 0,{autotypenumbers:ze._fullLayout.autotypenumbers}),_categories:[]},rt.setConvert($r),$r.type==="category")for(var Gr=0;Gr<qr.length;Gr++)$r.d2c(qr[Gr])}else $r=rt.getFromTrace(ze,Pe,Br);return $r?{d2c:$r.d2c,c2d:$r.c2d}:Br==="ids"?{d2c:Wt,c2d:Wt}:{d2c:Pt,c2d:Pt}};function Pt(ze){return+ze}function Wt(ze){return String(ze)}rt.getDataToCoordFunc=function(ze,Pe,Rr,qr){return zt(ze,Pe,Rr,qr).d2c},rt.counterLetter=function(ze){var Pe=ze.charAt(0);if(Pe==="x")return"y";if(Pe==="y")return"x"},rt.minDtick=function(ze,Pe,Rr,qr){["log","category","multicategory"].indexOf(ze.type)!==-1||!qr?ze._minDtick=0:ze._minDtick===void 0?(ze._minDtick=Pe,ze._forceTick0=Rr):ze._minDtick&&((ze._minDtick/Pe+1e-6)%1<2e-6&&((Rr-ze._forceTick0)/Pe%1+1.000001)%1<2e-6?(ze._minDtick=Pe,ze._forceTick0=Rr):((Pe/ze._minDtick+1e-6)%1>2e-6||((Rr-ze._forceTick0)/ze._minDtick%1+1.000001)%1>2e-6)&&(ze._minDtick=0))},rt.saveRangeInitial=function(ze,Pe){for(var Rr=rt.list(ze,"",!0),qr=!1,$r=0;$r<Rr.length;$r++){var Br=Rr[$r],Gr=Br._rangeInitial0===void 0&&Br._rangeInitial1===void 0,dn=Gr||Br.range[0]!==Br._rangeInitial0||Br.range[1]!==Br._rangeInitial1,an=Br.autorange;(Gr&&an!==!0||Pe&&dn)&&(Br._rangeInitial0=an==="min"||an==="max reversed"?void 0:Br.range[0],Br._rangeInitial1=an==="max"||an==="min reversed"?void 0:Br.range[1],Br._autorangeInitial=an,qr=!0)}return qr},rt.saveShowSpikeInitial=function(ze,Pe){for(var Rr=rt.list(ze,"",!0),qr=!1,$r="on",Br=0;Br<Rr.length;Br++){var Gr=Rr[Br],dn=Gr._showSpikeInitial===void 0,an=dn||Gr.showspikes!==Gr._showspikes;(dn||Pe&&an)&&(Gr._showSpikeInitial=Gr.showspikes,qr=!0),$r==="on"&&!Gr.showspikes&&($r="off")}return ze._fullLayout._cartesianSpikesEnabled=$r,qr},rt.autoBin=function(ze,Pe,Rr,qr,$r,Br){var Gr=t.aggNums(Math.min,null,ze),dn=t.aggNums(Math.max,null,ze);if(Pe.type==="category"||Pe.type==="multicategory")return{start:Gr-.5,end:dn+.5,size:Math.max(1,Math.round(Br)||1),_dataSpan:dn-Gr};$r||($r=Pe.calendar);var an;if(Pe.type==="log"?an={type:"linear",range:[Gr,dn]}:an={type:Pe.type,range:t.simpleMap([Gr,dn],Pe.c2r,0,$r),calendar:$r},rt.setConvert(an),Br=Br&&s.dtick(Br,an.type),Br)an.dtick=Br,an.tick0=s.tick0(void 0,an.type,$r);else{var Ee;if(Rr)Ee=(dn-Gr)/Rr;else{var dr=t.distinctVals(ze),Vr=Math.pow(10,Math.floor(Math.log(dr.minDiff)/Math.LN10)),yn=Vr*t.roundUp(dr.minDiff/Vr,[.9,1.9,4.9,9.9],!0);Ee=Math.max(yn,2*t.stdev(ze)/Math.pow(ze.length,qr?.25:.4)),g(Ee)||(Ee=1)}rt.autoTicks(an,Ee)}var Fn=an.dtick,Xn=rt.tickIncrement(rt.tickFirst(an),Fn,"reverse",$r),Pn,En;if(typeof Fn=="number")Xn=Ht(Xn,ze,an,Gr,dn),En=1+Math.floor((dn-Xn)/Fn),Pn=Xn+En*Fn;else for(an.dtick.charAt(0)==="M"&&(Xn=Jt(Xn,ze,Fn,Gr,$r)),Pn=Xn,En=0;Pn<=dn;)Pn=rt.tickIncrement(Pn,Fn,!1,$r),En++;return{start:Pe.c2r(Xn,0,$r),end:Pe.c2r(Pn,0,$r),size:Fn,_dataSpan:dn-Gr}};function Ht(ze,Pe,Rr,qr,$r){var Br=0,Gr=0,dn=0,an=0;function Ee(Fn){return(1+(Fn-ze)*100/Rr.dtick)%100<2}for(var dr=0;dr<Pe.length;dr++)Pe[dr]%1===0?dn++:g(Pe[dr])||an++,Ee(Pe[dr])&&Br++,Ee(Pe[dr]+Rr.dtick/2)&&Gr++;var Vr=Pe.length-an;if(dn===Vr&&Rr.type!=="date")Rr.dtick<1?ze=qr-.5*Rr.dtick:(ze-=.5,ze+Rr.dtick<qr&&(ze+=Rr.dtick));else if(Gr<Vr*.1&&(Br>Vr*.3||Ee(qr)||Ee($r))){var yn=Rr.dtick/2;ze+=ze+yn<qr?yn:-yn}return ze}function Jt(ze,Pe,Rr,qr,$r){var Br=t.findExactDates(Pe,$r),Gr=.8;if(Br.exactDays>Gr){var dn=Number(Rr.substr(1));Br.exactYears>Gr&&dn%12===0?ze=rt.tickIncrement(ze,"M6","reverse")+A*1.5:Br.exactMonths>Gr?ze=rt.tickIncrement(ze,"M1","reverse")+A*15.5:ze-=h;var an=rt.tickIncrement(ze,Rr);if(an<=qr)return an}return ze}rt.prepMinorTicks=function(ze,Pe,Rr){if(!Pe.minor.dtick){delete ze.dtick;var qr=Pe.dtick&&g(Pe._tmin),$r;if(qr){var Br=rt.tickIncrement(Pe._tmin,Pe.dtick,!0);$r=[Pe._tmin,Br*.99+Pe._tmin*.01]}else{var Gr=t.simpleMap(Pe.range,Pe.r2l);$r=[Gr[0],.8*Gr[0]+.2*Gr[1]]}if(ze.range=t.simpleMap($r,Pe.l2r),ze._isMinor=!0,rt.prepTicks(ze,Rr),qr){var dn=g(Pe.dtick),an=g(ze.dtick),Ee=dn?Pe.dtick:+Pe.dtick.substring(1),dr=an?ze.dtick:+ze.dtick.substring(1);dn&&an?ge(Ee,dr)?Ee===2*E&&dr===2*A&&(ze.dtick=E):Ee===2*E&&dr===3*A?ze.dtick=E:Ee===E&&!(Pe._input.minor||{}).nticks?ze.dtick=A:he(Ee/dr,2.5)?ze.dtick=Ee/2:ze.dtick=Ee:String(Pe.dtick).charAt(0)==="M"?an?ze.dtick="M1":ge(Ee,dr)?Ee>=12&&dr===2&&(ze.dtick="M3"):ze.dtick=Pe.dtick:String(ze.dtick).charAt(0)==="L"?String(Pe.dtick).charAt(0)==="L"?ge(Ee,dr)||(ze.dtick=he(Ee/dr,2.5)?Pe.dtick/2:Pe.dtick):ze.dtick="D1":ze.dtick==="D2"&&+Pe.dtick>1&&(ze.dtick=1)}ze.range=Pe.range}Pe.minor._tick0Init===void 0&&(ze.tick0=Pe.tick0)};function ge(ze,Pe){return Math.abs((ze/Pe+.5)%1-.5)<.001}function he(ze,Pe){return Math.abs(ze/Pe-1)<.001}rt.prepTicks=function(ze,Pe){var Rr=t.simpleMap(ze.range,ze.r2l,void 0,void 0,Pe);if(ze.tickmode==="auto"||!ze.dtick){var qr=ze.nticks,$r;qr||(ze.type==="category"||ze.type==="multicategory"?($r=ze.tickfont?t.bigFont(ze.tickfont.size||12):15,qr=ze._length/$r):($r=ze._id.charAt(0)==="y"?40:80,qr=t.constrain(ze._length/$r,4,9)+1),ze._name==="radialaxis"&&(qr*=2)),ze.minor&&ze.minor.tickmode!=="array"||ze.tickmode==="array"&&(qr*=100),ze._roughDTick=Math.abs(Rr[1]-Rr[0])/qr,rt.autoTicks(ze,ze._roughDTick),ze._minDtick>0&&ze.dtick<ze._minDtick*2&&(ze.dtick=ze._minDtick,ze.tick0=ze.l2r(ze._forceTick0))}ze.ticklabelmode==="period"&&se(ze),ze.tick0||(ze.tick0=ze.type==="date"?"2000-01-01":0),ze.type==="date"&&ze.dtick<.1&&(ze.dtick=.1),Hr(ze)};function de(ze){return+ze.substring(1)}function se(ze){var Pe;function Rr(){return!(g(ze.dtick)||ze.dtick.charAt(0)!=="M")}var qr=Rr(),$r=rt.getTickFormat(ze);if($r){var Br=ze._dtickInit!==ze.dtick;/%[fLQsSMX]/.test($r)||(/%[HI]/.test($r)?(Pe=p,Br&&!qr&&ze.dtick<p&&(ze.dtick=p)):/%p/.test($r)?(Pe=h,Br&&!qr&&ze.dtick<h&&(ze.dtick=h)):/%[Aadejuwx]/.test($r)?(Pe=A,Br&&!qr&&ze.dtick<A&&(ze.dtick=A)):/%[UVW]/.test($r)?(Pe=E,Br&&!qr&&ze.dtick<E&&(ze.dtick=E)):/%[Bbm]/.test($r)?(Pe=C,Br&&(qr?de(ze.dtick)<1:ze.dtick<M)&&(ze.dtick="M1")):/%[q]/.test($r)?(Pe=u,Br&&(qr?de(ze.dtick)<3:ze.dtick<b)&&(ze.dtick="M3")):/%[Yy]/.test($r)&&(Pe=y,Br&&(qr?de(ze.dtick)<12:ze.dtick<v)&&(ze.dtick="M12")))}qr=Rr(),qr&&ze.tick0===ze._dowTick0&&(ze.tick0=ze._rawTick0),ze._definedDelta=Pe}function Tt(ze,Pe,Rr){for(var qr=0;qr<ze.length;qr++){var $r=ze[qr].value,Br=qr,Gr=qr+1;qr<ze.length-1?(Br=qr,Gr=qr+1):qr>0?(Br=qr-1,Gr=qr):(Br=qr,Gr=qr);var dn=ze[Br].value,an=ze[Gr].value,Ee=Math.abs(an-dn),dr=Rr||Ee,Vr=0;dr>=v?Ee>=v&&Ee<=x?Vr=Ee:Vr=y:Rr===u&&dr>=b?Ee>=b&&Ee<=T?Vr=Ee:Vr=u:dr>=M?Ee>=M&&Ee<=_?Vr=Ee:Vr=C:Rr===E&&dr>=E?Vr=E:dr>=A?Vr=A:Rr===h&&dr>=h?Vr=h:Rr===p&&dr>=p&&(Vr=p);var yn;Vr>=Ee&&(Vr=Ee,yn=!0);var Fn=$r+Vr;if(Pe.rangebreaks&&Vr>0){for(var Xn=84,Pn=0,En=0;En<Xn;En++){var Zn=(En+.5)/Xn;Pe.maskBreaks($r*(1-Zn)+Zn*Fn)!==V&&Pn++}Vr*=Pn/Xn,Vr||(ze[qr].drop=!0),yn&&Ee>E&&(Vr=Ee)}(Vr>0||qr===0)&&(ze[qr].periodX=$r+Vr/2)}}rt.calcTicks=function(ze,Pe){for(var Rr=ze.type,qr=ze.calendar,$r=ze.ticklabelstep,Br=ze.ticklabelmode==="period",Gr=ze.range[0]>ze.range[1],dn=!ze.ticklabelindex||t.isArrayOrTypedArray(ze.ticklabelindex)?ze.ticklabelindex:[ze.ticklabelindex],an=t.simpleMap(ze.range,ze.r2l,void 0,void 0,Pe),Ee=an[1]<an[0],dr=Math.min(an[0],an[1]),Vr=Math.max(an[0],an[1]),yn=Math.max(1e3,ze._length||0),Fn=[],Xn=[],Pn=[],En=[],Zn=[],Ca=ze.minor&&(ze.minor.ticks||ze.minor.showgrid),Ri=1;Ri>=(Ca?0:1);Ri--){var Ja=!Ri;Ri?(ze._dtickInit=ze.dtick,ze._tick0Init=ze.tick0):(ze.minor._dtickInit=ze.minor.dtick,ze.minor._tick0Init=ze.minor.tick0);var Xa=Ri?ze:t.extendFlat({},ze,ze.minor);if(Ja?rt.prepMinorTicks(Xa,ze,Pe):rt.prepTicks(Xa,Pe),Xa.tickmode==="array"){Ri?(Pn=[],Fn=te(ze,!Ja)):(En=[],Xn=te(ze,!Ja));continue}if(Xa.tickmode==="sync"){Pn=[],Fn=Mt(ze);continue}var Io=wt(an),po=Io[0],Do=Io[1],Ia=g(Xa.dtick),gs=Rr==="log"&&!(Ia||Xa.dtick.charAt(0)==="L"),is=rt.tickFirst(Xa,Pe);if(Ri){if(ze._tmin=is,is<po!==Ee)break;(Rr==="category"||Rr==="multicategory")&&(Do=Ee?Math.max(-.5,Do):Math.min(ze._categories.length-.5,Do))}var ll=null,Ho=is,Gs;if(Ri){var as;Ia?as=ze.dtick:Rr==="date"?typeof ze.dtick=="string"&&ze.dtick.charAt(0)==="M"&&(as=C*ze.dtick.substring(1)):as=ze._roughDTick,Gs=Math.round((ze.r2l(Ho)-ze.r2l(ze.tick0))/as)-1}var ul=Xa.dtick;for(Xa.rangebreaks&&Xa._tick0Init!==Xa.tick0&&(Ho=Pi(Ho,ze),Ee||(Ho=rt.tickIncrement(Ho,ul,!Ee,qr))),Ri&&Br&&(Ho=rt.tickIncrement(Ho,ul,!Ee,qr),Gs--);Ee?Ho>=Do:Ho<=Do;Ho=rt.tickIncrement(Ho,ul,Ee,qr)){if(Ri&&Gs++,Xa.rangebreaks&&!Ee){if(Ho<po)continue;if(Xa.maskBreaks(Ho)===V&&Pi(Ho,Xa)>=Vr)break}if(Pn.length>yn||Ho===ll)break;ll=Ho;var Js={value:Ho};Ri?(gs&&Ho!==(Ho|0)&&(Js.simpleLabel=!0),$r>1&&Gs%$r&&(Js.skipLabel=!0),Pn.push(Js)):(Js.minor=!0,En.push(Js))}}if(!En||En.length<2)dn=!1;else{var Rl=(En[1].value-En[0].value)*(Gr?-1:1);Wa(Rl,ze.tickformat)||(dn=!1)}if(!dn)Zn=Pn;else{var ls=Pn.concat(En);Br&&Pn.length&&(ls=ls.slice(1)),ls=ls.sort(function(cl,Qo){return cl.value-Qo.value}).filter(function(cl,Qo,Mu){return Qo===0||cl.value!==Mu[Qo-1].value});var Cs=ls.map(function(cl,Qo){return cl.minor===void 0&&!cl.skipLabel?Qo:null}).filter(function(cl){return cl!==null});Cs.forEach(function(cl){dn.map(function(Qo){var Mu=cl+Qo;Mu>=0&&Mu<ls.length&&t.pushUnique(Zn,ls[Mu])})})}if(Ca){var Co=ze.minor.ticks==="inside"&&ze.ticks==="outside"||ze.minor.ticks==="outside"&&ze.ticks==="inside";if(!Co){for(var ks=Pn.map(function(cl){return cl.value}),kl=[],Vl=0;Vl<En.length;Vl++){var Yl=En[Vl],Ns=Yl.value;if(ks.indexOf(Ns)===-1){for(var La=!1,uo=0;!La&&uo<Pn.length;uo++)1e7+Pn[uo].value===1e7+Ns&&(La=!0);La||kl.push(Yl)}}En=kl}}Br&&Tt(Zn,ze,ze._definedDelta);var Hs;if(ze.rangebreaks){var Kl=ze._id.charAt(0)==="y",Go=1;ze.tickmode==="auto"&&(Go=ze.tickfont?ze.tickfont.size:12);var ql=NaN;for(Hs=Pn.length-1;Hs>-1;Hs--){if(Pn[Hs].drop){Pn.splice(Hs,1);continue}Pn[Hs].value=Pi(Pn[Hs].value,ze);var il=ze.c2p(Pn[Hs].value);(Kl?ql>il-Go:ql<il+Go)?Pn.splice(Ee?Hs+1:Hs,1):ql=il}}xi(ze)&&Math.abs(an[1]-an[0])===360&&Pn.pop(),ze._tmax=(Pn[Pn.length-1]||{}).value,ze._prevDateHead="",ze._inCalcTicks=!0;var Cl,Fu=function(cl){cl.text="",ze._prevDateHead=Cl};Pn=Pn.concat(En);function ao(cl,Qo){var Mu=rt.tickText(cl,Qo.value,!1,Qo.simpleLabel),Gu=Qo.periodX;return Gu!==void 0&&(Mu.periodX=Gu,(Gu>Vr||Gu<dr)&&(Gu>Vr&&(Mu.periodX=Vr),Gu<dr&&(Mu.periodX=dr),Fu(Mu))),Mu}var Ts;for(Hs=0;Hs<Pn.length;Hs++){var Ls=Pn[Hs].minor,nu=Pn[Hs].value;Ls?(dn&&Zn.indexOf(Pn[Hs])!==-1?Ts=ao(ze,Pn[Hs]):Ts={x:nu},Ts.minor=!0,Xn.push(Ts)):(Cl=ze._prevDateHead,Ts=ao(ze,Pn[Hs]),(Pn[Hs].skipLabel||dn&&Zn.indexOf(Pn[Hs])===-1)&&Fu(Ts),Fn.push(Ts))}return Fn=Fn.concat(Xn),ze._inCalcTicks=!1,Br&&Fn.length&&(Fn[0].noTick=!0),Fn};function Lt(ze,Pe){return ze.rangebreaks&&(Pe=Pe.filter(function(Rr){return ze.maskBreaks(Rr.x)!==V})),Pe}function Mt(ze){var Pe=ze._mainAxis,Rr=[];if(Pe._vals){for(var qr=0;qr<Pe._vals.length;qr++)if(!Pe._vals[qr].noTick){var $r=Pe.l2p(Pe._vals[qr].x),Br=ze.p2l($r),Gr=rt.tickText(ze,Br);Pe._vals[qr].minor&&(Gr.minor=!0,Gr.text=""),Rr.push(Gr)}}return Rr=Lt(ze,Rr),Rr}function te(ze,Pe){var Rr=t.simpleMap(ze.range,ze.r2l),qr=wt(Rr),$r=Math.min(qr[0],qr[1]),Br=Math.max(qr[0],qr[1]),Gr=ze.type==="category"?ze.d2l_noadd:ze.d2l;ze.type==="log"&&String(ze.dtick).charAt(0)!=="L"&&(ze.dtick="L"+Math.pow(10,Math.floor(Math.min(ze.range[0],ze.range[1]))-1));for(var dn=[],an=0;an<=1;an++)if(!(Pe!==void 0&&(Pe&&an||Pe===!1&&!an))&&!(an&&!ze.minor)){var Ee=an?ze.minor.tickvals:ze.tickvals,dr=an?[]:ze.ticktext;if(Ee){t.isArrayOrTypedArray(dr)||(dr=[]);for(var Vr=0;Vr<Ee.length;Vr++){var yn=Gr(Ee[Vr]);if(yn>$r&&yn<Br){var Fn=rt.tickText(ze,yn,!1,String(dr[Vr]));an&&(Fn.minor=!0,Fn.text=""),dn.push(Fn)}}}}return dn=Lt(ze,dn),dn}var ve=[2,5,10],oe=[1,2,3,6,12],Te=[1,2,5,10,15,30],He=[1,2,3,7,14],Ge=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],cr=[-.301,0,.301,.699,1],ur=[15,30,45,90,180];function jr(ze,Pe,Rr){return Pe*t.roundUp(ze/Pe,Rr)}rt.autoTicks=function(ze,Pe,Rr){var qr;function $r(Vr){return Math.pow(Vr,Math.floor(Math.log(Pe)/Math.LN10))}if(ze.type==="date"){ze.tick0=t.dateTick0(ze.calendar,0);var Br=2*Pe;if(Br>y)Pe/=y,qr=$r(10),ze.dtick="M"+12*jr(Pe,qr,ve);else if(Br>C)Pe/=C,ze.dtick="M"+jr(Pe,1,oe);else if(Br>A){if(ze.dtick=jr(Pe,A,ze._hasDayOfWeekBreaks?[1,2,7,14]:He),!Rr){var Gr=rt.getTickFormat(ze),dn=ze.ticklabelmode==="period";dn&&(ze._rawTick0=ze.tick0),/%[uVW]/.test(Gr)?ze.tick0=t.dateTick0(ze.calendar,2):ze.tick0=t.dateTick0(ze.calendar,1),dn&&(ze._dowTick0=ze.tick0)}}else Br>p?ze.dtick=jr(Pe,p,oe):Br>k?ze.dtick=jr(Pe,k,Te):Br>w?ze.dtick=jr(Pe,w,Te):(qr=$r(10),ze.dtick=jr(Pe,qr,ve))}else if(ze.type==="log"){ze.tick0=0;var an=t.simpleMap(ze.range,ze.r2l);if(ze._isMinor&&(Pe*=1.5),Pe>.7)ze.dtick=Math.ceil(Pe);else if(Math.abs(an[1]-an[0])<1){var Ee=1.5*Math.abs((an[1]-an[0])/Pe);Pe=Math.abs(Math.pow(10,an[1])-Math.pow(10,an[0]))/Ee,qr=$r(10),ze.dtick="L"+jr(Pe,qr,ve)}else ze.dtick=Pe>.3?"D2":"D1"}else ze.type==="category"||ze.type==="multicategory"?(ze.tick0=0,ze.dtick=Math.ceil(Math.max(Pe,1))):xi(ze)?(ze.tick0=0,qr=1,ze.dtick=jr(Pe,qr,ur)):(ze.tick0=0,qr=$r(10),ze.dtick=jr(Pe,qr,ve));if(ze.dtick===0&&(ze.dtick=1),!g(ze.dtick)&&typeof ze.dtick!="string"){var dr=ze.dtick;throw ze.dtick=1,"ax.dtick error: "+String(dr)}};function Hr(ze){var Pe=ze.dtick;if(ze._tickexponent=0,!g(Pe)&&typeof Pe!="string"&&(Pe=1),(ze.type==="category"||ze.type==="multicategory")&&(ze._tickround=null),ze.type==="date"){var Rr=ze.r2l(ze.tick0),qr=ze.l2r(Rr).replace(/(^-|i)/g,""),$r=qr.length;if(String(Pe).charAt(0)==="M")$r>10||qr.substr(5)!=="01-01"?ze._tickround="d":ze._tickround=+Pe.substr(1)%12===0?"y":"m";else if(Pe>=A&&$r<=10||Pe>=A*15)ze._tickround="d";else if(Pe>=k&&$r<=16||Pe>=p)ze._tickround="M";else if(Pe>=w&&$r<=19||Pe>=k)ze._tickround="S";else{var Br=ze.l2r(Rr+Pe).replace(/^-/,"").length;ze._tickround=Math.max($r,Br)-20,ze._tickround<0&&(ze._tickround=4)}}else if(g(Pe)||Pe.charAt(0)==="L"){var Gr=ze.range.map(ze.r2d||Number);g(Pe)||(Pe=Number(Pe.substr(1))),ze._tickround=2-Math.floor(Math.log(Pe)/Math.LN10+.01);var dn=Math.max(Math.abs(Gr[0]),Math.abs(Gr[1])),an=Math.floor(Math.log(dn)/Math.LN10+.01),Ee=ze.minexponent===void 0?3:ze.minexponent;Math.abs(an)>Ee&&(ee(ze.exponentformat)&&ze.exponentformat!=="SI extended"&&!le(an)||ee(ze.exponentformat)&&ze.exponentformat==="SI extended"&&!we(an)?ze._tickexponent=3*Math.round((an-1)/3):ze._tickexponent=an)}else ze._tickround=null}rt.tickIncrement=function(ze,Pe,Rr,qr){var $r=Rr?-1:1;if(g(Pe))return t.increment(ze,$r*Pe);var Br=Pe.charAt(0),Gr=$r*Number(Pe.substr(1));if(Br==="M")return t.incrementMonth(ze,Gr,qr);if(Br==="L")return Math.log(Math.pow(10,ze)+Gr)/Math.LN10;if(Br==="D"){var dn=Pe==="D2"?cr:Ge,an=ze+$r*.01,Ee=t.roundUp(t.mod(an,1),dn,Rr);return Math.floor(an)+Math.log(c.round(Math.pow(10,Ee),1))/Math.LN10}throw"unrecognized dtick "+String(Pe)},rt.tickFirst=function(ze,Pe){var Rr=ze.r2l||Number,qr=t.simpleMap(ze.range,Rr,void 0,void 0,Pe),$r=qr[1]<qr[0],Br=$r?Math.floor:Math.ceil,Gr=wt(qr)[0],dn=ze.dtick,an=Rr(ze.tick0);if(g(dn)){var Ee=Br((Gr-an)/dn)*dn+an;return(ze.type==="category"||ze.type==="multicategory")&&(Ee=t.constrain(Ee,0,ze._categories.length-1)),Ee}var dr=dn.charAt(0),Vr=Number(dn.substr(1));if(dr==="M"){for(var yn=0,Fn=an,Xn,Pn,En;yn<10;){if(Xn=rt.tickIncrement(Fn,dn,$r,ze.calendar),(Xn-Gr)*(Fn-Gr)<=0)return $r?Math.min(Fn,Xn):Math.max(Fn,Xn);Pn=(Gr-(Fn+Xn)/2)/(Xn-Fn),En=dr+(Math.abs(Math.round(Pn))||1)*Vr,Fn=rt.tickIncrement(Fn,En,Pn<0?!$r:$r,ze.calendar),yn++}return t.error("tickFirst did not converge",ze),Fn}else{if(dr==="L")return Math.log(Br((Math.pow(10,Gr)-an)/Vr)*Vr+an)/Math.LN10;if(dr==="D"){var Zn=dn==="D2"?cr:Ge,Ca=t.roundUp(t.mod(Gr,1),Zn,$r);return Math.floor(Gr)+Math.log(c.round(Math.pow(10,Ca),1))/Math.LN10}else throw"unrecognized dtick "+String(dn)}},rt.tickText=function(ze,Pe,Rr,qr){var $r=br(ze,Pe),Br=ze.tickmode==="array",Gr=Rr||Br,dn=ze.type,an=dn==="category"?ze.d2l_noadd:ze.d2l,Ee,dr=function(En){var Zn=ze.l2p(En);return Zn>=0&&Zn<=ze._length?En:null};if(Br&&t.isArrayOrTypedArray(ze.ticktext)){var Vr=t.simpleMap(ze.range,ze.r2l),yn=(Math.abs(Vr[1]-Vr[0])-(ze._lBreaks||0))/1e4;for(Ee=0;Ee<ze.ticktext.length&&!(Math.abs(Pe-an(ze.tickvals[Ee]))<yn);Ee++);if(Ee<ze.ticktext.length)return $r.text=String(ze.ticktext[Ee]),$r.xbnd=[dr($r.x-.5),dr($r.x+ze.dtick-.5)],$r}function Fn(En){if(En===void 0)return!0;if(Rr)return En==="none";var Zn={first:ze._tmin,last:ze._tmax}[En];return En!=="all"&&Pe!==Zn}var Xn=Rr?"never":ze.exponentformat!=="none"&&Fn(ze.showexponent)?"hide":"";if(dn==="date"?Kr(ze,$r,Rr,Gr):dn==="log"?rn(ze,$r,Rr,Gr,Xn):dn==="category"?Ce(ze,$r):dn==="multicategory"?$t(ze,$r,Rr):xi(ze)?Ct(ze,$r,Rr,Gr,Xn):ne(ze,$r,Rr,Gr,Xn),qr||(ze.tickprefix&&!Fn(ze.showtickprefix)&&($r.text=ze.tickprefix+$r.text),ze.ticksuffix&&!Fn(ze.showticksuffix)&&($r.text+=ze.ticksuffix)),ze.labelalias&&ze.labelalias.hasOwnProperty($r.text)){var Pn=ze.labelalias[$r.text];typeof Pn=="string"&&($r.text=Pn)}return(ze.tickson==="boundaries"||ze.showdividers)&&($r.xbnd=[dr($r.x-.5),dr($r.x+ze.dtick-.5)]),$r},rt.hoverLabelText=function(ze,Pe,Rr){Rr&&(ze=t.extendFlat({},ze,{hoverformat:Rr}));var qr=t.isArrayOrTypedArray(Pe)?Pe[0]:Pe,$r=t.isArrayOrTypedArray(Pe)?Pe[1]:void 0;if($r!==void 0&&$r!==qr)return rt.hoverLabelText(ze,qr,Rr)+" - "+rt.hoverLabelText(ze,$r,Rr);var Br=ze.type==="log"&&qr<=0,Gr=rt.tickText(ze,ze.c2l(Br?-qr:qr),"hover").text;return Br?qr===0?"0":N+Gr:Gr};function br(ze,Pe,Rr){var qr=ze.tickfont||{};return{x:Pe,dx:0,dy:0,text:Rr||"",fontSize:qr.size,font:qr.family,fontWeight:qr.weight,fontStyle:qr.style,fontVariant:qr.variant,fontTextcase:qr.textcase,fontLineposition:qr.lineposition,fontShadow:qr.shadow,fontColor:qr.color}}function Kr(ze,Pe,Rr,qr){var $r=ze._tickround,Br=Rr&&ze.hoverformat||rt.getTickFormat(ze);qr=!Br&&qr,qr&&(g($r)?$r=4:$r={y:"m",m:"d",d:"M",M:"S",S:4}[$r]);var Gr=t.formatDate(Pe.x,Br,$r,ze._dateFormat,ze.calendar,ze._extraFormat),dn,an=Gr.indexOf(`
`);if(an!==-1&&(dn=Gr.substr(an+1),Gr=Gr.substr(0,an)),qr&&(dn!==void 0&&(Gr==="00:00:00"||Gr==="00:00")?(Gr=dn,dn=""):Gr.length===8&&(Gr=Gr.replace(/:00$/,""))),dn)if(Rr)$r==="d"?Gr+=", "+dn:Gr=dn+(Gr?", "+Gr:"");else if(!ze._inCalcTicks||ze._prevDateHead!==dn)ze._prevDateHead=dn,Gr+="<br>"+dn;else{var Ee=Di(ze),dr=ze._trueSide||ze.side;(!Ee&&dr==="top"||Ee&&dr==="bottom")&&(Gr+="<br> ")}Pe.text=Gr}function rn(ze,Pe,Rr,qr,$r){var Br=ze.dtick,Gr=Pe.x,dn=ze.tickformat,an=typeof Br=="string"&&Br.charAt(0);if($r==="never"&&($r=""),qr&&an!=="L"&&(Br="L3",an="L"),dn||an==="L")Pe.text=qe(Math.pow(10,Gr),ze,$r,qr);else if(g(Br)||an==="D"&&(ze.minorloglabels==="complete"||t.mod(Gr+.01,1)<.1)){ze.minorloglabels==="complete"&&!(t.mod(Gr+.01,1)<.1)&&(Pe.fontSize*=.75);var Ee=Math.pow(10,Gr).toExponential(0),dr=Ee.split("e"),Vr=+dr[1],yn=Math.abs(Vr),Fn=ze.exponentformat;Fn==="power"||ee(Fn)&&Fn!=="SI extended"&&le(Vr)||ee(Fn)&&Fn==="SI extended"&&we(Vr)?(Pe.text=dr[0],yn>0&&(Pe.text+="x10"),Pe.text==="1x10"&&(Pe.text="10"),Vr!==0&&Vr!==1&&(Pe.text+="<sup>"+(Vr>0?"":N)+yn+"</sup>"),Pe.fontSize*=1.25):(Fn==="e"||Fn==="E")&&yn>2?Pe.text=dr[0]+Fn+(Vr>0?"+":N)+yn:(Pe.text=qe(Math.pow(10,Gr),ze,"","fakehover"),Br==="D1"&&ze._id.charAt(0)==="y"&&(Pe.dy-=Pe.fontSize/6))}else if(an==="D")Pe.text=ze.minorloglabels==="none"?"":String(Math.round(Math.pow(10,t.mod(Gr,1)))),Pe.fontSize*=.75;else throw"unrecognized dtick "+String(Br);if(ze.dtick==="D1"){var Xn=String(Pe.text).charAt(0);(Xn==="0"||Xn==="1")&&(ze._id.charAt(0)==="y"?Pe.dx-=Pe.fontSize/4:(Pe.dy+=Pe.fontSize/2,Pe.dx+=(ze.range[1]>ze.range[0]?1:-1)*Pe.fontSize*(Gr<0?.5:.25)))}}function Ce(ze,Pe){var Rr=ze._categories[Math.round(Pe.x)];Rr===void 0&&(Rr=""),Pe.text=String(Rr)}function $t(ze,Pe,Rr){var qr=Math.round(Pe.x),$r=ze._categories[qr]||[],Br=$r[1]===void 0?"":String($r[1]),Gr=$r[0]===void 0?"":String($r[0]);Rr?Pe.text=Gr+" - "+Br:(Pe.text=Br,Pe.text2=Gr)}function ne(ze,Pe,Rr,qr,$r){$r==="never"?$r="":ze.showexponent==="all"&&Math.abs(Pe.x/ze.dtick)<1e-6&&($r="hide"),Pe.text=qe(Pe.x,ze,$r,qr)}function Ct(ze,Pe,Rr,qr,$r){if(ze.thetaunit==="radians"&&!Rr){var Br=Pe.x/180;if(Br===0)Pe.text="0";else{var Gr=gt(Br);if(Gr[1]>=100)Pe.text=qe(t.deg2rad(Pe.x),ze,$r,qr);else{var dn=Pe.x<0;Gr[1]===1?Gr[0]===1?Pe.text="π":Pe.text=Gr[0]+"π":Pe.text=["<sup>",Gr[0],"</sup>","","<sub>",Gr[1],"</sub>","π"].join(""),dn&&(Pe.text=N+Pe.text)}}}else Pe.text=qe(Pe.x,ze,$r,qr)}function gt(ze){function Pe(dn,an){return Math.abs(dn-an)<=1e-6}function Rr(dn,an){return Pe(an,0)?dn:Rr(an,dn%an)}function qr(dn){for(var an=1;!Pe(Math.round(dn*an)/an,dn);)an*=10;return an}var $r=qr(ze),Br=ze*$r,Gr=Math.abs(Rr(Br,$r));return[Math.round(Br/Gr),Math.round($r/Gr)]}var St=["f","p","n","μ","m","","k","M","G","T"],Nt=["q","r","y","z","a",...St,"P","E","Z","Y","R","Q"],ee=ze=>["SI","SI extended","B"].includes(ze);function le(ze){return ze>14||ze<-15}function we(ze){return ze>32||ze<-30}function Ue(ze,Pe){return ee(Pe)?!!(Pe==="SI extended"&&we(ze)||Pe!=="SI extended"&&le(ze)):!1}function qe(ze,Pe,Rr,qr){var $r=ze<0,Br=Pe._tickround,Gr=Rr||Pe.exponentformat||"B",dn=Pe._tickexponent,an=rt.getTickFormat(Pe),Ee=Pe.separatethousands;if(qr){var dr={exponentformat:Gr,minexponent:Pe.minexponent,dtick:Pe.showexponent==="none"?Pe.dtick:g(ze)&&Math.abs(ze)||1,range:Pe.showexponent==="none"?Pe.range.map(Pe.r2d):[0,ze||1]};Hr(dr),Br=(Number(dr._tickround)||0)+4,dn=dr._tickexponent,Pe.hoverformat&&(an=Pe.hoverformat)}if(an)return Pe._numFormat(an)(ze).replace(/-/g,N);var Vr=Math.pow(10,-Br)/2;if(Gr==="none"&&(dn=0),ze=Math.abs(ze),ze<Vr)ze="0",$r=!1;else{if(ze+=Vr,dn&&(ze*=Math.pow(10,-dn),Br+=dn),Br===0)ze=String(Math.floor(ze));else if(Br<0){ze=String(Math.round(ze)),ze=ze.substr(0,ze.length+Br);for(var yn=Br;yn<0;yn++)ze+="0"}else{ze=String(ze);var Fn=ze.indexOf(".")+1;Fn&&(ze=ze.substr(0,Fn+Br).replace(/\.?0+$/,""))}ze=t.numSeparate(ze,Pe._separators,Ee)}if(dn&&Gr!=="hide"){Ue(dn,Gr)&&(Gr="power");var Xn;dn<0?Xn=N+-dn:Gr!=="power"?Xn="+"+dn:Xn=String(dn),Gr==="e"||Gr==="E"?ze+=Gr+Xn:Gr==="power"?ze+="×10<sup>"+Xn+"</sup>":Gr==="B"&&dn===9?ze+="B":ee(Gr)&&(ze+=Gr==="SI extended"?Nt[dn/3+10]:St[dn/3+5])}return $r?N+ze:ze}rt.getTickFormat=function(ze){var Pe;function Rr(an){return typeof an!="string"?an:Number(an.replace("M",""))*C}function qr(an,Ee){var dr=["L","D"];if(typeof an==typeof Ee){if(typeof an=="number")return an-Ee;var Vr=dr.indexOf(an.charAt(0)),yn=dr.indexOf(Ee.charAt(0));return Vr===yn?Number(an.replace(/(L|D)/g,""))-Number(Ee.replace(/(L|D)/g,"")):Vr-yn}else return typeof an=="number"?1:-1}function $r(an,Ee,dr){var Vr=dr||function(Xn){return Xn},yn=Ee[0],Fn=Ee[1];return(!yn&&typeof yn!="number"||Vr(yn)<=Vr(an))&&(!Fn&&typeof Fn!="number"||Vr(Fn)>=Vr(an))}function Br(an,Ee){var dr=Ee[0]===null,Vr=Ee[1]===null,yn=qr(an,Ee[0])>=0,Fn=qr(an,Ee[1])<=0;return(dr||yn)&&(Vr||Fn)}var Gr,dn;if(ze.tickformatstops&&ze.tickformatstops.length>0)switch(ze.type){case"date":case"linear":{for(Pe=0;Pe<ze.tickformatstops.length;Pe++)if(dn=ze.tickformatstops[Pe],dn.enabled&&$r(ze.dtick,dn.dtickrange,Rr)){Gr=dn;break}break}case"log":{for(Pe=0;Pe<ze.tickformatstops.length;Pe++)if(dn=ze.tickformatstops[Pe],dn.enabled&&Br(ze.dtick,dn.dtickrange)){Gr=dn;break}break}}return Gr?Gr.value:ze.tickformat},rt.getSubplots=function(ze,Pe){var Rr=ze._fullLayout._subplots,qr=Rr.cartesian.concat(Rr.gl2d||[]),$r=Pe?rt.findSubplotsWithAxis(qr,Pe):qr;return $r.sort(function(Br,Gr){var dn=Br.substr(1).split("y"),an=Gr.substr(1).split("y");return dn[0]===an[0]?+dn[1]-+an[1]:+dn[0]-+an[0]}),$r},rt.findSubplotsWithAxis=function(ze,Pe){for(var Rr=new RegExp(Pe._id.charAt(0)==="x"?"^"+Pe._id+"y":Pe._id+"$"),qr=[],$r=0;$r<ze.length;$r++){var Br=ze[$r];Rr.test(Br)&&qr.push(Br)}return qr},rt.makeClipPaths=function(ze){var Pe=ze._fullLayout;if(!Pe._hasOnlyLargeSploms){var Rr={_offset:0,_length:Pe.width,_id:""},qr={_offset:0,_length:Pe.height,_id:""},$r=rt.list(ze,"x",!0),Br=rt.list(ze,"y",!0),Gr=[],dn,an;for(dn=0;dn<$r.length;dn++)for(Gr.push({x:$r[dn],y:qr}),an=0;an<Br.length;an++)dn===0&&Gr.push({x:Rr,y:Br[an]}),Gr.push({x:$r[dn],y:Br[an]});var Ee=Pe._clips.selectAll(".axesclip").data(Gr,function(dr){return dr.x._id+dr.y._id});Ee.enter().append("clipPath").classed("axesclip",!0).attr("id",function(dr){return"clip"+Pe._uid+dr.x._id+dr.y._id}).append("rect"),Ee.exit().remove(),Ee.each(function(dr){c.select(this).select("rect").attr({x:dr.x._offset||0,y:dr.y._offset||0,width:dr.x._length||1,height:dr.y._length||1})})}},rt.draw=function(ze,Pe,Rr){var qr=ze._fullLayout;Pe==="redraw"&&qr._paper.selectAll("g.subplot").each(function(an){var Ee=an[0],dr=qr._plots[Ee];if(dr){var Vr=dr.xaxis,yn=dr.yaxis;dr.xaxislayer.selectAll("."+Vr._id+"tick").remove(),dr.yaxislayer.selectAll("."+yn._id+"tick").remove(),dr.xaxislayer.selectAll("."+Vr._id+"tick2").remove(),dr.yaxislayer.selectAll("."+yn._id+"tick2").remove(),dr.xaxislayer.selectAll("."+Vr._id+"divider").remove(),dr.yaxislayer.selectAll("."+yn._id+"divider").remove(),dr.minorGridlayer&&dr.minorGridlayer.selectAll("path").remove(),dr.gridlayer&&dr.gridlayer.selectAll("path").remove(),dr.zerolinelayer&&dr.zerolinelayer.selectAll("path").remove(),dr.zerolinelayerAbove&&dr.zerolinelayerAbove.selectAll("path").remove(),qr._infolayer.select(".g-"+Vr._id+"title").remove(),qr._infolayer.select(".g-"+yn._id+"title").remove()}});var $r=!Pe||Pe==="redraw"?rt.listIds(ze):Pe,Br=rt.list(ze),Gr=Br.filter(function(an){return an.autoshift}).map(function(an){return an.overlaying});$r.map(function(an){var Ee=rt.getFromId(ze,an);if(Ee.tickmode==="sync"&&Ee.overlaying){var dr=$r.findIndex(function(Vr){return Vr===Ee.overlaying});dr>=0&&$r.unshift($r.splice(dr,1).shift())}});var dn={false:{left:0,right:0}};return t.syncOrAsync($r.map(function(an){return function(){if(an){var Ee=rt.getFromId(ze,an);Rr||(Rr={}),Rr.axShifts=dn,Rr.overlayingShiftedAx=Gr;var dr=rt.drawOne(ze,Ee,Rr);return Ee._shiftPusher&&ui(Ee,Ee._fullDepth||0,dn,!0),Ee._r=Ee.range.slice(),Ee._rl=t.simpleMap(Ee._r,Ee.r2l),dr}}}))},rt.drawOne=function(ze,Pe,Rr){Rr=Rr||{};var qr=Rr.axShifts||{},$r=Rr.overlayingShiftedAx||[],Br,Gr,dn;Pe.setScale();var an=ze._fullLayout,Ee=Pe._id,dr=Ee.charAt(0),Vr=rt.counterLetter(Ee),yn=an._plots[Pe._mainSubplot],Fn=Pe.zerolinelayer==="above traces";if(!yn)return;if(Pe._shiftPusher=Pe.autoshift||$r.indexOf(Pe._id)!==-1||$r.indexOf(Pe.overlaying)!==-1,Pe._shiftPusher&Pe.anchor==="free"){var Xn=Pe.linewidth/2||0;Pe.ticks==="inside"&&(Xn+=Pe.ticklen),ui(Pe,Xn,qr,!0),ui(Pe,Pe.shift||0,qr,!1)}(Rr.skipTitle!==!0||Pe._shift===void 0)&&(Pe._shift=Pa(Pe,qr));var Pn=yn[dr+"axislayer"],En=Pe._mainLinePosition,Zn=En+=Pe._shift,Ca=Pe._mainMirrorPosition,Ri=Pe._vals=rt.calcTicks(Pe),Ja=[Pe.mirror,Zn,Ca].join("_");for(Br=0;Br<Ri.length;Br++)Ri[Br].axInfo=Ja;Pe._selections={},Pe._tickAngles&&(Pe._prevTickAngles=Pe._tickAngles),Pe._tickAngles={},Pe._depth=null;var Xa={};function Io(cl){var Qo=Ee+(cl||"tick");return Xa[Qo]||(Xa[Qo]=Jr(Pe,Qo,Zn)),Xa[Qo]}if(Pe.visible){var po=rt.makeTransTickFn(Pe),Do=rt.makeTransTickLabelFn(Pe),Ia,gs,is=Pe.ticks==="inside",ll=Pe.ticks==="outside";if(Pe.tickson==="boundaries"){var Ho=Ar(Pe,Ri);gs=rt.clipEnds(Pe,Ho),Ia=is?gs:Ho}else gs=rt.clipEnds(Pe,Ri),Ia=is&&Pe.ticklabelmode!=="period"?gs:Ri;var Gs=Pe._gridVals=gs,as=pr(Pe,Ri);if(!an._hasOnlyLargeSploms){var ul=Pe._subplotsWith,Js={};for(Br=0;Br<ul.length;Br++){Gr=ul[Br],dn=an._plots[Gr];var Rl=dn[Vr+"axis"],ls=Rl._mainAxis._id;if(!Js[ls]){Js[ls]=1;var Cs=dr==="x"?"M0,"+Rl._offset+"v"+Rl._length:"M"+Rl._offset+",0h"+Rl._length;rt.drawGrid(ze,Pe,{vals:Gs,counterAxis:Rl,layer:dn.gridlayer.select("."+Ee),minorLayer:dn.minorGridlayer.select("."+Ee),path:Cs,transFn:po}),rt.drawZeroLine(ze,Pe,{counterAxis:Rl,layer:Fn?dn.zerolinelayerAbove:dn.zerolinelayer,path:Cs,transFn:po})}}}var Co,ks=rt.getTickSigns(Pe),kl=rt.getTickSigns(Pe,"minor");if(Pe.ticks||Pe.minor&&Pe.minor.ticks){var Vl=rt.makeTickPath(Pe,Zn,ks[2]),Yl=rt.makeTickPath(Pe,Zn,kl[2],{minor:!0}),Ns,La,uo,Hs;if(Pe._anchorAxis&&Pe.mirror&&Pe.mirror!==!0?(Ns=rt.makeTickPath(Pe,Ca,ks[3]),La=rt.makeTickPath(Pe,Ca,kl[3],{minor:!0}),uo=Vl+Ns,Hs=Yl+La):(Ns="",La="",uo=Vl,Hs=Yl),Pe.showdividers&&ll&&Pe.tickson==="boundaries"){var Kl={};for(Br=0;Br<as.length;Br++)Kl[as[Br].x]=1;Co=function(cl){return Kl[cl.x]?Ns:uo}}else Co=function(cl){return cl.minor?Hs:uo}}if(rt.drawTicks(ze,Pe,{vals:Ia,layer:Pn,path:Co,transFn:po}),Pe.mirror==="allticks"){var Go=Object.keys(Pe._linepositions||{});for(Br=0;Br<Go.length;Br++){Gr=Go[Br],dn=an._plots[Gr];var ql=Pe._linepositions[Gr]||[],il=ql[0],Cl=ql[1],Fu=ql[2],ao=rt.makeTickPath(Pe,il,Fu?ks[0]:kl[0],{minor:Fu})+rt.makeTickPath(Pe,Cl,Fu?ks[1]:kl[1],{minor:Fu});rt.drawTicks(ze,Pe,{vals:Ia,layer:dn[dr+"axislayer"],path:ao,transFn:po})}}var Ts=[];if(Ts.push(function(){return rt.drawLabels(ze,Pe,{vals:Ri,layer:Pn,plotinfo:dn,transFn:Do,labelFns:rt.makeLabelFns(Pe,Zn)})}),Pe.type==="multicategory"){var Ls={x:2,y:10}[dr];Ts.push(function(){var cl={x:"height",y:"width"}[dr],Qo=Io()[cl]+Ls+(Pe._tickAngles[Ee+"tick"]?Pe.tickfont.size*st:0);return rt.drawLabels(ze,Pe,{vals:Tr(Pe,Ri),layer:Pn,cls:Ee+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:po,labelFns:rt.makeLabelFns(Pe,Zn+Qo*ks[4])})}),Ts.push(function(){return Pe._depth=ks[4]*(Io("tick2")[Pe.side]-Zn),Ci(ze,Pe,{vals:as,layer:Pn,path:rt.makeTickPath(Pe,Zn,ks[4],{len:Pe._depth}),transFn:po})})}else Pe.title.hasOwnProperty("standoff")&&Ts.push(function(){Pe._depth=ks[4]*(Io()[Pe.side]-Zn)});var nu=S.getComponentMethod("rangeslider","isVisible")(Pe);return!Rr.skipTitle&&!(nu&&Pe.side==="bottom")&&Ts.push(function(){return qn(ze,Pe)}),Ts.push(function(){var cl=Pe.side.charAt(0),Qo=tt[Pe.side].charAt(0),Mu=rt.getPxPosition(ze,Pe),Gu=ll?Pe.ticklen:0,_l,Ol,Xl,tu;(Pe.automargin||nu||Pe._shiftPusher)&&(Pe.type==="multicategory"?_l=Io("tick2"):(_l=Io(),dr==="x"&&cl==="b"&&(Pe._depth=Math.max(_l.width>0?_l.bottom-Mu:0,Gu))));var ac=0,ph=0;if(Pe._shiftPusher&&(ac=Math.max(Gu,_l.height>0?cl==="l"?Mu-_l.left:_l.right-Mu:0),Pe.title.text!==an._dfltTitle[dr]&&(ph=(Pe._titleStandoff||0)+(Pe._titleScoot||0),cl==="l"&&(ph+=ii(Pe))),Pe._fullDepth=Math.max(ac,ph)),Pe.automargin){Ol={x:0,y:0,r:0,l:0,t:0,b:0};var Jc=[0,1],ah=typeof Pe._shift=="number"?Pe._shift:0;if(dr==="x"){if(cl==="b"?Ol[cl]=Pe._depth:(Ol[cl]=Pe._depth=Math.max(_l.width>0?Mu-_l.top:0,Gu),Jc.reverse()),_l.width>0){var Nf=_l.right-(Pe._offset+Pe._length);Nf>0&&(Ol.xr=1,Ol.r=Nf);var Sf=Pe._offset-_l.left;Sf>0&&(Ol.xl=0,Ol.l=Sf)}}else if(cl==="l"?(Pe._depth=Math.max(_l.height>0?Mu-_l.left:0,Gu),Ol[cl]=Pe._depth-ah):(Pe._depth=Math.max(_l.height>0?_l.right-Mu:0,Gu),Ol[cl]=Pe._depth+ah,Jc.reverse()),_l.height>0){var Dl=_l.bottom-(Pe._offset+Pe._length);Dl>0&&(Ol.yb=0,Ol.b=Dl);var Bc=Pe._offset-_l.top;Bc>0&&(Ol.yt=1,Ol.t=Bc)}Ol[Vr]=Pe.anchor==="free"?Pe.position:Pe._anchorAxis.domain[Jc[0]],Pe.title.text!==an._dfltTitle[dr]&&(Ol[cl]+=ii(Pe)+(Pe.title.standoff||0)),Pe.mirror&&Pe.anchor!=="free"&&(Xl={x:0,y:0,r:0,l:0,t:0,b:0},Xl[Qo]=Pe.linewidth,Pe.mirror&&Pe.mirror!==!0&&(Xl[Qo]+=Gu),Pe.mirror===!0||Pe.mirror==="ticks"?Xl[Vr]=Pe._anchorAxis.domain[Jc[1]]:(Pe.mirror==="all"||Pe.mirror==="allticks")&&(Xl[Vr]=[Pe._counterDomainMin,Pe._counterDomainMax][Jc[1]]))}nu&&(tu=S.getComponentMethod("rangeslider","autoMarginOpts")(ze,Pe)),typeof Pe.automargin=="string"&&(ar(Ol,Pe.automargin),ar(Xl,Pe.automargin)),P.autoMargin(ze,fr(Pe),Ol),P.autoMargin(ze,xr(Pe),Xl),P.autoMargin(ze,Qr(Pe),tu)}),t.syncOrAsync(Ts)}};function ar(ze,Pe){if(ze){var Rr=Object.keys(X).reduce(function(qr,$r){return Pe.indexOf($r)!==-1&&X[$r].forEach(function(Br){qr[Br]=1}),qr},{});Object.keys(ze).forEach(function(qr){Rr[qr]||(qr.length===1?ze[qr]=0:delete ze[qr])})}}function Ar(ze,Pe){var Rr=[],qr,$r=function(Br,Gr){var dn=Br.xbnd[Gr];dn!==null&&Rr.push(t.extendFlat({},Br,{x:dn}))};if(Pe.length){for(qr=0;qr<Pe.length;qr++)$r(Pe[qr],0);$r(Pe[qr-1],1)}return Rr}function Tr(ze,Pe){for(var Rr=[],qr={},$r=0;$r<Pe.length;$r++){var Br=Pe[$r];qr[Br.text2]?qr[Br.text2].push(Br.x):qr[Br.text2]=[Br.x]}for(var Gr in qr)Rr.push(br(ze,t.interp(qr[Gr],.5),Gr));return Rr}function pr(ze,Pe){var Rr=[],qr,$r,Br=Pe.length&&Pe[Pe.length-1].x<Pe[0].x,Gr=function(an,Ee){var dr=an.xbnd[Ee];dr!==null&&Rr.push(t.extendFlat({},an,{x:dr}))};if(ze.showdividers&&Pe.length){for(qr=0;qr<Pe.length;qr++){var dn=Pe[qr];dn.text2!==$r&&Gr(dn,Br?1:0),$r=dn.text2}Gr(Pe[qr-1],Br?0:1)}return Rr}function Jr(ze,Pe,Rr){var qr,$r,Br,Gr;if(ze._selections[Pe].size())qr=1/0,$r=-1/0,Br=1/0,Gr=-1/0,ze._selections[Pe].each(function(){var an=rr(this);if(an.node().style.display!=="none"){var Ee=o.bBox(an.node().parentNode);qr=Math.min(qr,Ee.top),$r=Math.max($r,Ee.bottom),Br=Math.min(Br,Ee.left),Gr=Math.max(Gr,Ee.right)}});else{var dn=rt.makeLabelFns(ze,Rr);qr=$r=dn.yFn({dx:0,dy:0,fontSize:0}),Br=Gr=dn.xFn({dx:0,dy:0,fontSize:0})}return{top:qr,bottom:$r,left:Br,right:Gr,height:$r-qr,width:Gr-Br}}rt.getTickSigns=function(ze,Pe){var Rr=ze._id.charAt(0),qr={x:"top",y:"right"}[Rr],$r=ze.side===qr?1:-1,Br=[-1,1,$r,-$r],Gr=Pe?(ze.minor||{}).ticks:ze.ticks;return Gr!=="inside"==(Rr==="x")&&(Br=Br.map(function(dn){return-dn})),ze.side&&Br.push({l:-1,t:-1,r:1,b:1}[ze.side.charAt(0)]),Br},rt.makeTransTickFn=function(ze){return ze._id.charAt(0)==="x"?function(Pe){return e(ze._offset+ze.l2p(Pe.x),0)}:function(Pe){return e(0,ze._offset+ze.l2p(Pe.x))}},rt.makeTransTickLabelFn=function(ze){var Pe=Hn(ze),Rr=ze.ticklabelshift||0,qr=ze.ticklabelstandoff||0,$r=Pe[0],Br=Pe[1],Gr=ze.range[0]>ze.range[1],dn=ze.ticklabelposition&&ze.ticklabelposition.indexOf("inside")!==-1,an=!dn;if(Rr){var Ee=Gr?-1:1;Rr=Rr*Ee}if(qr){var dr=ze.side,Vr=dn&&(dr==="top"||dr==="left")||an&&(dr==="bottom"||dr==="right")?1:-1;qr=qr*Vr}return ze._id.charAt(0)==="x"?function(yn){return e($r+ze._offset+ze.l2p(Vn(yn))+Rr,Br+qr)}:function(yn){return e(Br+qr,$r+ze._offset+ze.l2p(Vn(yn))+Rr)}};function Vn(ze){return ze.periodX!==void 0?ze.periodX:ze.x}function Hn(ze){var Pe=ze.ticklabelposition||"",Rr=ze.tickson||"",qr=function(Xn){return Pe.indexOf(Xn)!==-1},$r=qr("top"),Br=qr("left"),Gr=qr("right"),dn=qr("bottom"),an=qr("inside"),Ee=Rr!=="boundaries"&&(dn||Br||$r||Gr);if(!Ee&&!an)return[0,0];var dr=ze.side,Vr=Ee?(ze.tickwidth||0)/2:0,yn=dt,Fn=ze.tickfont?ze.tickfont.size:12;return(dn||$r)&&(Vr+=Fn*pt,yn+=(ze.linewidth||0)/2),(Br||Gr)&&(Vr+=(ze.linewidth||0)/2,yn+=dt),an&&dr==="top"&&(yn-=Fn*(1-pt)),(Br||$r)&&(Vr=-Vr),(dr==="bottom"||dr==="right")&&(yn=-yn),[Ee?Vr:0,an?yn:0]}rt.makeTickPath=function(ze,Pe,Rr,qr){qr||(qr={});var $r=qr.minor;if($r&&!ze.minor)return"";var Br=qr.len!==void 0?qr.len:$r?ze.minor.ticklen:ze.ticklen,Gr=ze._id.charAt(0),dn=(ze.linewidth||1)/2;return Gr==="x"?"M0,"+(Pe+dn*Rr)+"v"+Br*Rr:"M"+(Pe+dn*Rr)+",0h"+Br*Rr},rt.makeLabelFns=function(ze,Pe,Rr){var qr=ze.ticklabelposition||"",$r=ze.tickson||"",Br=function(Ho){return qr.indexOf(Ho)!==-1},Gr=Br("top"),dn=Br("left"),an=Br("right"),Ee=Br("bottom"),dr=$r!=="boundaries"&&(Ee||dn||Gr||an),Vr=Br("inside"),yn=qr==="inside"&&ze.ticks==="inside"||!Vr&&ze.ticks==="outside"&&$r!=="boundaries",Fn=0,Xn=0,Pn=yn?ze.ticklen:0;if(Vr?Pn*=-1:dr&&(Pn=0),yn&&(Fn+=Pn,Rr)){var En=t.deg2rad(Rr);Fn=Pn*Math.cos(En)+1,Xn=Pn*Math.sin(En)}ze.showticklabels&&(yn||ze.showline)&&(Fn+=.2*ze.tickfont.size),Fn+=(ze.linewidth||1)/2*(Vr?-1:1);var Zn={labelStandoff:Fn,labelShift:Xn},Ca,Ri,Ja,Xa,Io=0,po=ze.side,Do=ze._id.charAt(0),Ia=ze.tickangle,gs;if(Do==="x")gs=!Vr&&po==="bottom"||Vr&&po==="top",Xa=gs?1:-1,Vr&&(Xa*=-1),Ca=Xn*Xa,Ri=Pe+Fn*Xa,Ja=gs?1:-.2,Math.abs(Ia)===90&&(Vr?Ja+=yt:Ia===-90&&po==="bottom"?Ja=pt:Ia===90&&po==="top"?Ja=yt:Ja=.5,Io=yt/2*(Ia/90)),Zn.xFn=function(Ho){return Ho.dx+Ca+Io*Ho.fontSize},Zn.yFn=function(Ho){return Ho.dy+Ri+Ho.fontSize*Ja},Zn.anchorFn=function(Ho,Gs){if(dr){if(dn)return"end";if(an)return"start"}return!g(Gs)||Gs===0||Gs===180?"middle":Gs*Xa<0!==Vr?"end":"start"},Zn.heightFn=function(Ho,Gs,as){return Gs<-60||Gs>60?-.5*as:ze.side==="top"!==Vr?-as:0};else if(Do==="y"){if(gs=!Vr&&po==="left"||Vr&&po==="right",Xa=gs?1:-1,Vr&&(Xa*=-1),Ca=Fn,Ri=Xn*Xa,Ja=0,!Vr&&Math.abs(Ia)===90&&(Ia===-90&&po==="left"||Ia===90&&po==="right"?Ja=pt:Ja=.5),Vr){var is=g(Ia)?+Ia:0;if(is!==0){var ll=t.deg2rad(is);Io=Math.abs(Math.sin(ll))*pt*Xa,Ja=0}}Zn.xFn=function(Ho){return Ho.dx+Pe-(Ca+Ho.fontSize*Ja)*Xa+Io*Ho.fontSize},Zn.yFn=function(Ho){return Ho.dy+Ri+Ho.fontSize*yt},Zn.anchorFn=function(Ho,Gs){return g(Gs)&&Math.abs(Gs)===90?"middle":gs?"end":"start"},Zn.heightFn=function(Ho,Gs,as){return ze.side==="right"&&(Gs*=-1),Gs<-30?-as:Gs<30?-.5*as:0}}return Zn};function Kn(ze){return[ze.text,ze.x,ze.axInfo,ze.font,ze.fontSize,ze.fontColor].join("_")}rt.drawTicks=function(ze,Pe,Rr){Rr=Rr||{};var qr=Pe._id+"tick",$r=[].concat(Pe.minor&&Pe.minor.ticks?Rr.vals.filter(function(Gr){return Gr.minor&&!Gr.noTick}):[]).concat(Pe.ticks?Rr.vals.filter(function(Gr){return!Gr.minor&&!Gr.noTick}):[]),Br=Rr.layer.selectAll("path."+qr).data($r,Kn);Br.exit().remove(),Br.enter().append("path").classed(qr,1).classed("ticks",1).classed("crisp",Rr.crisp!==!1).each(function(Gr){return n.stroke(c.select(this),Gr.minor?Pe.minor.tickcolor:Pe.tickcolor)}).style("stroke-width",function(Gr){return o.crispRound(ze,Gr.minor?Pe.minor.tickwidth:Pe.tickwidth,1)+"px"}).attr("d",Rr.path).style("display",null),Zi(Pe,[W]),Br.attr("transform",Rr.transFn)},rt.drawGrid=function(ze,Pe,Rr){if(Rr=Rr||{},Pe.tickmode!=="sync"){var qr=Pe._id+"grid",$r=Pe.minor&&Pe.minor.showgrid,Br=$r?Rr.vals.filter(function(Zn){return Zn.minor}):[],Gr=Pe.showgrid?Rr.vals.filter(function(Zn){return!Zn.minor}):[],dn=Rr.counterAxis;if(dn&&rt.shouldShowZeroLine(ze,Pe,dn))for(var an=Pe.tickmode==="array",Ee=0;Ee<Gr.length;Ee++){var dr=Gr[Ee].x;if(an?!dr:Math.abs(dr)<Pe.dtick/100)if(Gr=Gr.slice(0,Ee).concat(Gr.slice(Ee+1)),an)Ee--;else break}Pe._gw=o.crispRound(ze,Pe.gridwidth,1);for(var Vr=$r?o.crispRound(ze,Pe.minor.gridwidth,1):0,yn=Rr.layer,Fn=Rr.minorLayer,Xn=1;Xn>=0;Xn--){var Pn=Xn?yn:Fn;if(Pn){var En=Pn.selectAll("path."+qr).data(Xn?Gr:Br,Kn);En.exit().remove(),En.enter().append("path").classed(qr,1).classed("crisp",Rr.crisp!==!1),En.attr("transform",Rr.transFn).attr("d",Rr.path).each(function(Zn){return n.stroke(c.select(this),Zn.minor?Pe.minor.gridcolor:Pe.gridcolor||"#ddd")}).style("stroke-dasharray",function(Zn){return o.dashStyle(Zn.minor?Pe.minor.griddash:Pe.griddash,Zn.minor?Pe.minor.gridwidth:Pe.gridwidth)}).style("stroke-width",function(Zn){return(Zn.minor?Vr:Pe._gw)+"px"}).style("display",null),typeof Rr.path=="function"&&En.attr("d",Rr.path)}}Zi(Pe,[F,U])}},rt.drawZeroLine=function(ze,Pe,Rr){Rr=Rr||Rr;var qr=Pe._id+"zl",$r=rt.shouldShowZeroLine(ze,Pe,Rr.counterAxis),Br=Rr.layer.selectAll("path."+qr).data($r?[{x:0,id:Pe._id}]:[]);Br.exit().remove(),Br.enter().append("path").classed(qr,1).classed("zl",1).classed("crisp",Rr.crisp!==!1).each(function(){Rr.layer.selectAll("path").sort(function(Gr,dn){return it(Gr.id,dn.id)})}),Br.attr("transform",Rr.transFn).attr("d",Rr.path).call(n.stroke,Pe.zerolinecolor||n.defaultLine).style("stroke-width",o.crispRound(ze,Pe.zerolinewidth,Pe._gw||1)+"px").style("display",null),Zi(Pe,[H])},rt.drawLabels=function(ze,Pe,Rr){Rr=Rr||{};var qr=ze._fullLayout,$r=Pe._id,Br=Pe.zerolinelayer==="above traces",Gr=Rr.cls||$r+"tick",dn=Rr.vals.filter(function(ls){return ls.text}),an=Rr.labelFns,Ee=Rr.secondary?0:Pe.tickangle,dr=(Pe._prevTickAngles||{})[Gr],Vr=Rr.layer.selectAll("g."+Gr).data(Pe.showticklabels?dn:[],Kn),yn=[];Vr.enter().append("g").classed(Gr,1).append("text").attr("text-anchor","middle").each(function(ls){var Cs=c.select(this),Co=ze._promises.length;Cs.call(r.positionText,an.xFn(ls),an.yFn(ls)).call(o.font,{family:ls.font,size:ls.fontSize,color:ls.fontColor,weight:ls.fontWeight,style:ls.fontStyle,variant:ls.fontVariant,textcase:ls.fontTextcase,lineposition:ls.fontLineposition,shadow:ls.fontShadow}).text(ls.text).call(r.convertToTspans,ze),ze._promises[Co]?yn.push(ze._promises.pop().then(function(){Fn(Cs,Ee)})):Fn(Cs,Ee)}),Zi(Pe,[q]),Vr.exit().remove(),Rr.repositionOnUpdate&&Vr.each(function(ls){c.select(this).select("text").call(r.positionText,an.xFn(ls),an.yFn(ls))});function Fn(ls,Cs){ls.each(function(Co){var ks=c.select(this),kl=ks.select(".text-math-group"),Vl=an.anchorFn(Co,Cs),Yl=Rr.transFn.call(ks.node(),Co)+(g(Cs)&&+Cs!=0?" rotate("+Cs+","+an.xFn(Co)+","+(an.yFn(Co)-Co.fontSize/2)+")":""),Ns=r.lineCount(ks),La=st*Co.fontSize,uo=an.heightFn(Co,g(Cs)?+Cs:0,(Ns-1)*La);if(uo&&(Yl+=e(0,uo)),kl.empty()){var Hs=ks.select("text");Hs.attr({transform:Yl,"text-anchor":Vl}),Hs.style("display",null),Pe._adjustTickLabelsOverflow&&Pe._adjustTickLabelsOverflow()}else{var Kl=o.bBox(kl.node()).width,Go=Kl*{end:-.5,start:.5}[Vl];kl.attr("transform",Yl+e(Go,0))}})}Pe._adjustTickLabelsOverflow=function(){var ls=Pe.ticklabeloverflow;if(!(!ls||ls==="allow")){var Cs=ls.indexOf("hide")!==-1,Co=Pe._id.charAt(0)==="x",ks=0,kl=Co?ze._fullLayout.width:ze._fullLayout.height;if(ls.indexOf("domain")!==-1){var Vl=t.simpleMap(Pe.range,Pe.r2l);ks=Pe.l2p(Vl[0])+Pe._offset,kl=Pe.l2p(Vl[1])+Pe._offset}var Yl=Math.min(ks,kl),Ns=Math.max(ks,kl),La=Pe.side,uo=1/0,Hs=-1/0;Vr.each(function(il){var Cl=c.select(this),Fu=Cl.select(".text-math-group");if(Fu.empty()){var ao=o.bBox(Cl.node()),Ts=0;Co?(ao.right>Ns||ao.left<Yl)&&(Ts=1):(ao.bottom>Ns||ao.top+(Pe.tickangle?0:il.fontSize/4)<Yl)&&(Ts=1);var Ls=Cl.select("text");Ts?Cs&&Ls.style("display","none"):Ls.node().style.display!=="none"&&(Ls.style("display",null),La==="bottom"||La==="right"?uo=Math.min(uo,Co?ao.top:ao.left):uo=-1/0,La==="top"||La==="left"?Hs=Math.max(Hs,Co?ao.bottom:ao.right):Hs=1/0)}});for(var Kl in qr._plots){var Go=qr._plots[Kl];if(!(Pe._id!==Go.xaxis._id&&Pe._id!==Go.yaxis._id)){var ql=Co?Go.yaxis:Go.xaxis;ql&&(ql["_visibleLabelMin_"+Pe._id]=uo,ql["_visibleLabelMax_"+Pe._id]=Hs)}}}},Pe._hideCounterAxisInsideTickLabels=function(ls){var Cs=Pe._id.charAt(0)==="x",Co=[];for(var ks in qr._plots){var kl=qr._plots[ks];Pe._id!==kl.xaxis._id&&Pe._id!==kl.yaxis._id||Co.push(Cs?kl.yaxis:kl.xaxis)}Co.forEach(function(Vl,Yl){Vl&&Di(Vl)&&(ls||[H,U,F,W,q]).forEach(function(Ns){var La=Ns.K==="tick"&&Ns.L==="text"&&Pe.ticklabelmode==="period",uo=qr._plots[Pe._mainSubplot],Hs;if(Ns.K===H.K){var Kl=Br?uo.zerolinelayerAbove:uo.zerolinelayer;Hs=Kl.selectAll("."+Pe._id+"zl")}else Ns.K===U.K?Hs=uo.minorGridlayer.selectAll("."+Pe._id):Ns.K===F.K?Hs=uo.gridlayer.selectAll("."+Pe._id):Hs=uo[Pe._id.charAt(0)+"axislayer"];Hs.each(function(){var Go=c.select(this);Ns.L&&(Go=Go.selectAll(Ns.L)),Go.each(function(ql){var il=Pe.l2p(La?Vn(ql):ql.x)+Pe._offset,Cl=c.select(this);il<Pe["_visibleLabelMax_"+Vl._id]&&il>Pe["_visibleLabelMin_"+Vl._id]?Cl.style("display","none"):Ns.K==="tick"&&!Yl&&Cl.node().style.display!=="none"&&Cl.style("display",null)})})})})},Fn(Vr,dr+1?dr:Ee);function Xn(){return yn.length&&Promise.all(yn)}var Pn=null;function En(){if(Fn(Vr,Ee),dn.length&&Pe.autotickangles&&(Pe.type!=="log"||String(Pe.dtick).charAt(0)!=="D")){Pn=Pe.autotickangles[0];var ls=0,Cs=[],Co,ks=1;Vr.each(function(Ol){ls=Math.max(ls,Ol.fontSize);var Xl=Pe.l2p(Ol.x),tu=rr(this),ac=o.bBox(tu.node());ks=Math.max(ks,r.lineCount(tu)),Cs.push({top:0,bottom:10,height:10,left:Xl-ac.width/2,right:Xl+ac.width/2+2,width:ac.width+2})});var kl=(Pe.tickson==="boundaries"||Pe.showdividers)&&!Rr.secondary,Vl=dn.length,Yl=Math.abs((dn[Vl-1].x-dn[0].x)*Pe._m)/(Vl-1),Ns=kl?Yl/2:Yl,La=kl?Pe.ticklen:ls*1.25*ks,uo=Math.sqrt(Math.pow(Ns,2)+Math.pow(La,2)),Hs=Ns/uo,Kl=Pe.autotickangles.map(function(Ol){return Ol*Math.PI/180}),Go=Kl.find(function(Ol){return Math.abs(Math.cos(Ol))<=Hs});Go===void 0&&(Go=Kl.reduce(function(Ol,Xl){return Math.abs(Math.cos(Ol))<Math.abs(Math.cos(Xl))?Ol:Xl},Kl[0]));var ql=Go*(180/Math.PI);if(kl){var il=2;for(Pe.ticks&&(il+=Pe.tickwidth/2),Co=0;Co<Cs.length;Co++){var Cl=dn[Co].xbnd,Fu=Cs[Co];if(Cl[0]!==null&&Fu.left-Pe.l2p(Cl[0])<il||Cl[1]!==null&&Pe.l2p(Cl[1])-Fu.right<il){Pn=ql;break}}}else{var ao=Pe.ticklabelposition||"",Ts=Pe.tickson||"",Ls=function(Ol){return ao.indexOf(Ol)!==-1},nu=Ls("top"),cl=Ls("left"),Qo=Ls("right"),Mu=Ls("bottom"),Gu=Ts!=="boundaries"&&(Mu||cl||nu||Qo),_l=Gu?(Pe.tickwidth||0)+2*dt:0;for(Co=0;Co<Cs.length-1;Co++)if(t.bBoxIntersect(Cs[Co],Cs[Co+1],_l)){Pn=ql;break}}Pn&&Fn(Vr,Pn)}}Pe._selections&&(Pe._selections[Gr]=Vr);var Zn=[Xn];Pe.automargin&&qr._redrawFromAutoMarginCount&&dr===90?(Pn=dr,Zn.push(function(){Fn(Vr,dr)})):Zn.push(En),Pe._tickAngles&&Zn.push(function(){Pe._tickAngles[Gr]=Pn===null?g(Ee)?Ee:0:Pn});var Ca=function(){var ls=0,Cs=0;return Vr.each(function(Co,ks){var kl=rr(this),Vl=kl.select(".text-math-group");if(Vl.empty()){var Yl;Pe._vals[ks]&&(Yl=Pe._vals[ks].bb||o.bBox(kl.node()),Pe._vals[ks].bb=Yl),ls=Math.max(ls,Yl.width),Cs=Math.max(Cs,Yl.height)}}),{labelsMaxW:ls,labelsMaxH:Cs}},Ri=Pe._anchorAxis;if(Ri&&(Ri.autorange||Ri.insiderange)&&Di(Pe)&&!Y(qr,Pe._id)&&(qr._insideTickLabelsUpdaterange||(qr._insideTickLabelsUpdaterange={}),Ri.autorange&&(qr._insideTickLabelsUpdaterange[Ri._name+".autorange"]=Ri.autorange,Zn.push(Ca)),Ri.insiderange)){var Ja=Ca(),Xa=Pe._id.charAt(0)==="y"?Ja.labelsMaxW:Ja.labelsMaxH;Xa+=2*dt,Pe.ticklabelposition==="inside"&&(Xa+=Pe.ticklen||0);var Io=Pe.side==="right"||Pe.side==="top"?1:-1,po=Io===1?1:0,Do=Io===1?0:1,Ia=[];Ia[Do]=Ri.range[Do];var gs=Ri.range,is=Ri.r2p(gs[po]),ll=Ri.r2p(gs[Do]),Ho=qr._insideTickLabelsUpdaterange[Ri._name+".range"];if(Ho){var Gs=Ri.r2p(Ho[po]),as=Ri.r2p(Ho[Do]),ul=Io*(Pe._id.charAt(0)==="y"?1:-1);ul*is<ul*Gs&&(is=Gs,Ia[po]=gs[po]=Ho[po]),ul*ll>ul*as&&(ll=as,Ia[Do]=gs[Do]=Ho[Do])}var Js=Math.abs(ll-is);Js-Xa>0?(Js-=Xa,Xa*=1+Xa/Js):Xa=0,Pe._id.charAt(0)!=="y"&&(Xa=-Xa),Ia[po]=Ri.p2r(Ri.r2p(gs[po])+Io*Xa),Ri.autorange==="min"||Ri.autorange==="max reversed"?(Ia[0]=null,Ri._rangeInitial0=void 0,Ri._rangeInitial1=void 0):(Ri.autorange==="max"||Ri.autorange==="min reversed")&&(Ia[1]=null,Ri._rangeInitial0=void 0,Ri._rangeInitial1=void 0),qr._insideTickLabelsUpdaterange[Ri._name+".range"]=Ia}var Rl=t.syncOrAsync(Zn);return Rl&&Rl.then&&ze._promises.push(Rl),Rl};function Ci(ze,Pe,Rr){var qr=Pe._id+"divider",$r=Rr.vals,Br=Rr.layer.selectAll("path."+qr).data($r,Kn);Br.exit().remove(),Br.enter().insert("path",":first-child").classed(qr,1).classed("crisp",1).call(n.stroke,Pe.dividercolor).style("stroke-width",o.crispRound(ze,Pe.dividerwidth,1)+"px"),Br.attr("transform",Rr.transFn).attr("d",Rr.path)}rt.getPxPosition=function(ze,Pe){var Rr=ze._fullLayout._size,qr=Pe._id.charAt(0),$r=Pe.side,Br;if(Pe.anchor!=="free"?Br=Pe._anchorAxis:qr==="x"?Br={_offset:Rr.t+(1-(Pe.position||0))*Rr.h,_length:0}:qr==="y"&&(Br={_offset:Rr.l+(Pe.position||0)*Rr.w+Pe._shift,_length:0}),$r==="top"||$r==="left")return Br._offset;if($r==="bottom"||$r==="right")return Br._offset+Br._length};function ii(ze){var Pe=ze.title.font.size,Rr=(ze.title.text.match(r.BR_TAG_ALL)||[]).length;return ze.title.hasOwnProperty("standoff")?Pe*(pt+Rr*st):Rr?Pe*(Rr+1)*st:Pe}function qn(ze,Pe){var Rr=ze._fullLayout,qr=Pe._id,$r=qr.charAt(0),Br=Pe.title.font.size,Gr,dn=(Pe.title.text.match(r.BR_TAG_ALL)||[]).length;if(Pe.title.hasOwnProperty("standoff"))Pe.side==="bottom"||Pe.side==="right"?Gr=Pe._depth+Pe.title.standoff+Br*pt:(Pe.side==="top"||Pe.side==="left")&&(Gr=Pe._depth+Pe.title.standoff+Br*(yt+dn*st));else{var an=Di(Pe);if(Pe.type==="multicategory")Gr=Pe._depth;else{var Ee=1.5*Br;an&&(Ee=.5*Br,Pe.ticks==="outside"&&(Ee+=Pe.ticklen)),Gr=10+Ee+(Pe.linewidth?Pe.linewidth-1:0)}an||($r==="x"?Gr+=Pe.side==="top"?Br*(Pe.showticklabels?1:0):Br*(Pe.showticklabels?1.5:.5):Gr+=Pe.side==="right"?Br*(Pe.showticklabels?1:.5):Br*(Pe.showticklabels?.5:0))}var dr=rt.getPxPosition(ze,Pe),Vr,yn,Fn;$r==="x"?(yn=Pe._offset+Pe._length/2,Fn=Pe.side==="top"?dr-Gr:dr+Gr):(Fn=Pe._offset+Pe._length/2,yn=Pe.side==="right"?dr+Gr:dr-Gr,Vr={rotate:"-90",offset:0});var Xn;if(Pe.type!=="multicategory"){var Pn=Pe._selections[Pe._id+"tick"];if(Xn={selection:Pn,side:Pe.side},Pn&&Pn.node()&&Pn.node().parentNode){var En=o.getTranslate(Pn.node().parentNode);Xn.offsetLeft=En.x,Xn.offsetTop=En.y}Pe.title.hasOwnProperty("standoff")&&(Xn.pad=0)}return Pe._titleStandoff=Gr,a.draw(ze,qr+"title",{propContainer:Pe,propName:Pe._name+".title.text",placeholder:Rr._dfltTitle[$r],avoid:Xn,transform:Vr,attributes:{x:yn,y:Fn,"text-anchor":"middle"}})}rt.shouldShowZeroLine=function(ze,Pe,Rr){var qr=t.simpleMap(Pe.range,Pe.r2l);return qr[0]*qr[1]<=0&&Pe.zeroline&&(Pe.type==="linear"||Pe.type==="-")&&!(Pe.rangebreaks&&Pe.maskBreaks(0)===V)&&(oa(Pe,0)||!Hi(ze,Pe,Rr,qr)||We(ze,Pe))},rt.clipEnds=function(ze,Pe){return Pe.filter(function(Rr){return oa(ze,Rr.x)})};function oa(ze,Pe){var Rr=ze.l2p(Pe);return Rr>1&&Rr<ze._length-1}function Hi(ze,Pe,Rr,qr){var $r=Rr._mainAxis;if(!$r)return;var Br=ze._fullLayout,Gr=Pe._id.charAt(0),dn=rt.counterLetter(Pe._id),an=Pe._offset+(Math.abs(qr[0])<Math.abs(qr[1])==(Gr==="x")?0:Pe._length);function Ee(Xn){if(!Xn.showline||!Xn.linewidth)return!1;var Pn=Math.max((Xn.linewidth+Pe.zerolinewidth)/2,1);function En(Ri){return typeof Ri=="number"&&Math.abs(Ri-an)<Pn}if(En(Xn._mainLinePosition)||En(Xn._mainMirrorPosition))return!0;var Zn=Xn._linepositions||{};for(var Ca in Zn)if(En(Zn[Ca][0])||En(Zn[Ca][1]))return!0}var dr=Br._plots[Rr._mainSubplot];if(!(dr.mainplotinfo||dr).overlays.length)return Ee(Rr);for(var Vr=rt.list(ze,dn),yn=0;yn<Vr.length;yn++){var Fn=Vr[yn];if(Fn._mainAxis===$r&&Ee(Fn))return!0}}function We(ze,Pe){for(var Rr=ze._fullData,qr=Pe._mainSubplot,$r=Pe._id.charAt(0),Br=0;Br<Rr.length;Br++){var Gr=Rr[Br];if(Gr.visible===!0&&Gr.xaxis+Gr.yaxis===qr&&(S.traceIs(Gr,"bar-like")&&Gr.orientation==={x:"h",y:"v"}[$r]||Gr.fill&&Gr.fill.charAt(Gr.fill.length-1)===$r))return!0}return!1}function rr(ze){var Pe=c.select(ze),Rr=Pe.select(".text-math-group");return Rr.empty()?Pe.select("text"):Rr}rt.allowAutoMargin=function(ze){for(var Pe=rt.list(ze,"",!0),Rr=0;Rr<Pe.length;Rr++){var qr=Pe[Rr];qr.automargin&&(P.allowAutoMargin(ze,fr(qr)),qr.mirror&&P.allowAutoMargin(ze,xr(qr))),S.getComponentMethod("rangeslider","isVisible")(qr)&&P.allowAutoMargin(ze,Qr(qr))}};function fr(ze){return ze._id+".automargin"}function xr(ze){return fr(ze)+".mirror"}function Qr(ze){return ze._id+".rangeslider"}rt.swap=function(ze,Pe){for(var Rr=Cn(ze,Pe),qr=0;qr<Rr.length;qr++)Mn(ze,Rr[qr].x,Rr[qr].y)};function Cn(ze,Pe){var Rr=[],qr,$r;for(qr=0;qr<Pe.length;qr++){var Br=[],Gr=ze._fullData[Pe[qr]].xaxis,dn=ze._fullData[Pe[qr]].yaxis;if(!(!Gr||!dn)){for($r=0;$r<Rr.length;$r++)(Rr[$r].x.indexOf(Gr)!==-1||Rr[$r].y.indexOf(dn)!==-1)&&Br.push($r);if(!Br.length){Rr.push({x:[Gr],y:[dn]});continue}var an=Rr[Br[0]],Ee;if(Br.length>1)for($r=1;$r<Br.length;$r++)Ee=Rr[Br[$r]],wn(an.x,Ee.x),wn(an.y,Ee.y);wn(an.x,[Gr]),wn(an.y,[dn])}}return Rr}function wn(ze,Pe){for(var Rr=0;Rr<Pe.length;Rr++)ze.indexOf(Pe[Rr])===-1&&ze.push(Pe[Rr])}function Mn(ze,Pe,Rr){var qr=[],$r=[],Br=ze.layout,Gr,dn;for(Gr=0;Gr<Pe.length;Gr++)qr.push(rt.getFromId(ze,Pe[Gr]));for(Gr=0;Gr<Rr.length;Gr++)$r.push(rt.getFromId(ze,Rr[Gr]));var an=Object.keys(i),Ee=["anchor","domain","overlaying","position","side","tickangle","editType"],dr=["linear","log"];for(Gr=0;Gr<an.length;Gr++){var Vr=an[Gr],yn=qr[0][Vr],Fn=$r[0][Vr],Xn=!0,Pn=!1,En=!1;if(!(Vr.charAt(0)==="_"||typeof yn=="function"||Ee.indexOf(Vr)!==-1)){for(dn=1;dn<qr.length&&Xn;dn++){var Zn=qr[dn][Vr];Vr==="type"&&dr.indexOf(yn)!==-1&&dr.indexOf(Zn)!==-1&&yn!==Zn?Pn=!0:Zn!==yn&&(Xn=!1)}for(dn=1;dn<$r.length&&Xn;dn++){var Ca=$r[dn][Vr];Vr==="type"&&dr.indexOf(Fn)!==-1&&dr.indexOf(Ca)!==-1&&Fn!==Ca?En=!0:$r[dn][Vr]!==Fn&&(Xn=!1)}Xn&&(Pn&&(Br[qr[0]._name].type="linear"),En&&(Br[$r[0]._name].type="linear"),ci(Br,Vr,qr,$r,ze._fullLayout._dfltTitle))}}for(Gr=0;Gr<ze._fullLayout.annotations.length;Gr++){var Ri=ze._fullLayout.annotations[Gr];Pe.indexOf(Ri.xref)!==-1&&Rr.indexOf(Ri.yref)!==-1&&t.swapAttrs(Br.annotations[Gr],["?"])}}function ci(ze,Pe,Rr,qr,$r){var Br=t.nestedProperty,Gr=Br(ze[Rr[0]._name],Pe).get(),dn=Br(ze[qr[0]._name],Pe).get(),an;for(Pe==="title"&&(Gr&&Gr.text===$r.x&&(Gr.text=$r.y),dn&&dn.text===$r.y&&(dn.text=$r.x)),an=0;an<Rr.length;an++)Br(ze,Rr[an]._name+"."+Pe).set(dn);for(an=0;an<qr.length;an++)Br(ze,qr[an]._name+"."+Pe).set(Gr)}function xi(ze){return ze._id==="angularaxis"}function Pi(ze,Pe){for(var Rr=Pe._rangebreaks.length,qr=0;qr<Rr;qr++){var $r=Pe._rangebreaks[qr];if(ze>=$r.min&&ze<$r.max)return $r.max}return ze}function Di(ze){return(ze.ticklabelposition||"").indexOf("inside")!==-1}function Zi(ze,Pe){Di(ze._anchorAxis||{})&&ze._hideCounterAxisInsideTickLabels&&ze._hideCounterAxisInsideTickLabels(Pe)}function ui(ze,Pe,Rr,qr){var $r=ze.anchor!=="free"&&(ze.overlaying===void 0||ze.overlaying===!1)?ze._id:ze.overlaying,Br;qr?Br=ze.side==="right"?Pe:-Pe:Br=Pe,$r in Rr||(Rr[$r]={}),ze.side in Rr[$r]||(Rr[$r][ze.side]=0),Rr[$r][ze.side]+=Br}function Pa(ze,Pe){return ze.autoshift?Pe[ze.overlaying][ze.side]:ze.shift||0}function Wa(ze,Pe){return/%f/.test(Pe)?ze>=O:/%L/.test(Pe)?ze>=R:/%[SX]/.test(Pe)?ze>=w:/%M/.test(Pe)?ze>=k:/%[HI]/.test(Pe)?ze>=p:/%p/.test(Pe)?ze>=h:/%[Aadejuwx]/.test(Pe)?ze>=A:/%[UVW]/.test(Pe)?ze>=E:/%[Bbm]/.test(Pe)?ze>=M:/%[q]/.test(Pe)?ze>=b:/%[Yy]/.test(Pe)?ze>=v:!0}}),gw=Ft((Q,$)=>{$.exports=function(c,g,P){var S,t;if(P){var e=g==="reversed"||g==="min reversed"||g==="max reversed";S=P[e?1:0],t=P[e?0:1]}var r=c("autorangeoptions.minallowed",t===null?S:void 0),a=c("autorangeoptions.maxallowed",S===null?t:void 0);r===void 0&&c("autorangeoptions.clipmin"),a===void 0&&c("autorangeoptions.clipmax"),c("autorangeoptions.include")}}),E_=Ft((Q,$)=>{var c=gw();$.exports=function(g,P,S,t){var e=P._template||{},r=P.type||e.type||"-";S("minallowed"),S("maxallowed");var a=S("range");if(!a){var n;!t.noInsiderange&&r!=="log"&&(n=S("insiderange"),n&&(n[0]===null||n[1]===null)&&(P.insiderange=!1,n=void 0),n&&(a=S("range",n)))}var o=P.getAutorangeDflt(a,t),i=S("autorange",o),s;a&&(a[0]===null&&a[1]===null||(a[0]===null||a[1]===null)&&(i==="reversed"||i===!0)||a[0]!==null&&(i==="min"||i==="max reversed")||a[1]!==null&&(i==="max"||i==="min reversed"))&&(a=void 0,delete P.range,P.autorange=!0,s=!0),s||(o=P.getAutorangeDflt(a,t),i=S("autorange",o)),i&&(c(S,i,a),(r==="linear"||r==="-")&&S("rangemode")),P.cleanRange()}}),h6=Ft((Q,$)=>{var c={left:0,top:0};$.exports=g;function g(S,t,e){t=t||S.currentTarget||S.srcElement,Array.isArray(e)||(e=[0,0]);var r=S.clientX||0,a=S.clientY||0,n=P(t);return e[0]=r-n.left,e[1]=a-n.top,e}function P(S){return S===window||S===document||S===document.body?c:S.getBoundingClientRect()}}),C_=Ft((Q,$)=>{var c=Wu();function g(){var P=!1;try{var S=Object.defineProperty({},"passive",{get:function(){P=!0}});window.addEventListener("test",null,S),window.removeEventListener("test",null,S)}catch{P=!1}return P}$.exports=c&&g()}),L_=Ft((Q,$)=>{$.exports=function(c,g,P,S,t){var e=(c-P)/(S-P),r=e+g/(S-P),a=(e+r)/2;return t==="left"||t==="bottom"?e:t==="center"||t==="middle"?a:t==="right"||t==="top"?r:e<2/3-a?e:r>4/3-a?r:a}}),f6=Ft((Q,$)=>{var c=bn(),g=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];$.exports=function(P,S,t,e){return t==="left"?P=0:t==="center"?P=1:t==="right"?P=2:P=c.constrain(Math.floor(P*3),0,2),e==="bottom"?S=0:e==="middle"?S=1:e==="top"?S=2:S=c.constrain(Math.floor(S*3),0,2),g[S][P]}}),K0=Ft((Q,$)=>{var c=Om(),g=A_(),P=r0().getGraphDiv,S=go(),t=$.exports={};t.wrapped=function(e,r,a){e=P(e),e._fullLayout&&g.clear(e._fullLayout._uid+S.HOVERID),t.raw(e,r,a)},t.raw=function(e,r){var a=e._fullLayout,n=e._hoverdata;r||(r={}),!(r.target&&!e._dragged&&c.triggerHandler(e,"plotly_beforehover",r)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,r.target&&n&&e.emit("plotly_unhover",{event:r,points:n}))}}),up=Ft((Q,$)=>{var c=h6(),g=Rf(),P=C_(),S=bn().removeElement,t=ic(),e=$.exports={};e.align=L_(),e.getCursor=f6();var r=K0();e.unhover=r.wrapped,e.unhoverRaw=r.raw,e.init=function(o){var i=o.gd,s=1,f=i._context.doubleClickDelay,x=o.element,y,v,T,u,b,_,C,M;i._mouseDownTime||(i._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=h,P?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=h,x.addEventListener("touchstart",h,{passive:!1})):x.ontouchstart=h;function E(w,R,O){return Math.abs(w)<O&&(w=0),Math.abs(R)<O&&(R=0),[w,R]}var A=o.clampFn||E;function h(w){i._dragged=!1,i._dragging=!0;var R=n(w);y=R[0],v=R[1],C=w.target,_=w,M=w.buttons===2||w.ctrlKey,typeof w.clientX>"u"&&typeof w.clientY>"u"&&(w.clientX=y,w.clientY=v),T=new Date().getTime(),T-i._mouseDownTime<f?s+=1:(s=1,i._mouseDownTime=T),o.prepFn&&o.prepFn(w,y,v),g&&!M?(b=a(),b.style.cursor=window.getComputedStyle(x).cursor):g||(b=document,u=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(x).cursor),document.addEventListener("mouseup",k),document.addEventListener("touchend",k),o.dragmode!==!1&&(w.preventDefault(),document.addEventListener("mousemove",p),document.addEventListener("touchmove",p,{passive:!1}))}function p(w){w.preventDefault();var R=n(w),O=o.minDrag||t.MINDRAG,N=A(R[0]-y,R[1]-v,O),V=N[0],H=N[1];(V||H)&&(i._dragged=!0,e.unhover(i,w)),i._dragged&&o.moveFn&&!M&&(i._dragdata={element:x,dx:V,dy:H},o.moveFn(V,H))}function k(w){if(delete i._dragdata,o.dragmode!==!1&&(w.preventDefault(),document.removeEventListener("mousemove",p),document.removeEventListener("touchmove",p)),document.removeEventListener("mouseup",k),document.removeEventListener("touchend",k),g?S(b):u&&(b.documentElement.style.cursor=u,u=null),!i._dragging){i._dragged=!1;return}if(i._dragging=!1,new Date().getTime()-i._mouseDownTime>f&&(s=Math.max(s-1,1)),i._dragged)o.doneFn&&o.doneFn();else{var R;_.target===C?R=_:(R={target:C,srcElement:C,toElement:C},Object.keys(_).concat(Object.keys(_.__proto__)).forEach(O=>{var N=_[O];!R[O]&&typeof N!="function"&&(R[O]=N)})),o.clickFn&&o.clickFn(s,R),M||C.dispatchEvent(new MouseEvent("click",w))}i._dragging=!1,i._dragged=!1}};function a(){var o=document.createElement("div");o.className="dragcover";var i=o.style;return i.position="fixed",i.left=0,i.right=0,i.top=0,i.bottom=0,i.zIndex=999999999,i.background="none",document.body.appendChild(o),o}e.coverSlip=a;function n(o){return c(o.changedTouches?o.changedTouches[0]:o,document.body)}}),P0=Ft((Q,$)=>{$.exports=function(c,g){(c.attr("class")||"").split(" ").forEach(function(P){P.indexOf("cursor-")===0&&c.classed(P,!1)}),g&&c.classed("cursor-"+g,!0)}}),Fm=Ft((Q,$)=>{var c=P0(),g="data-savedcursor",P="!!";$.exports=function(S,t){var e=S.attr(g);if(t){if(!e){for(var r=(S.attr("class")||"").split(" "),a=0;a<r.length;a++){var n=r[a];n.indexOf("cursor-")===0&&S.attr(g,n.substr(7)).classed(n,!1)}S.attr(g)||S.attr(g,P)}c(S,t)}else e&&(S.attr(g,null),e===P?c(S):c(S,e))}}),P_=Ft((Q,$)=>{var c=Ea(),g=bi();$.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:g.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:c({editType:"legend"}),grouptitlefont:c({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:c({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}),Fy=Ft(Q=>{Q.isGrouped=function($){return($.traceorder||"").indexOf("grouped")!==-1},Q.isVertical=function($){return $.orientation!=="h"},Q.isReversed=function($){return($.traceorder||"").indexOf("reversed")!==-1}}),Ry=Ft((Q,$)=>{var c=Xo(),g=bn(),P=pu(),S=$o(),t=P_(),e=x1(),r=Fy();function a(n,o,i,s){var f=o[n]||{},x=P.newContainer(i,n);function y(st,tt){return g.coerce(f,x,t,st,tt)}var v=g.coerceFont(y,"font",i.font);y("bgcolor",i.paper_bgcolor),y("bordercolor");var T=y("visible");if(T){for(var u,b=function(st,tt){var dt=u._input,rt=u;return g.coerce(dt,rt,S,st,tt)},_=i.font||{},C=g.coerceFont(y,"grouptitlefont",_,{overrideDflt:{size:Math.round(_.size*1.1)}}),M=0,E=!1,A="normal",h=(i.shapes||[]).filter(function(st){return st.showlegend}),p=s.concat(h).filter(function(st){return n===(st.legend||"legend")}),k=0;k<p.length;k++)if(u=p[k],!!u.visible){var w=u._isShape;(u.showlegend||u._dfltShowLegend&&!(u._module&&u._module.attributes&&u._module.attributes.showlegend&&u._module.attributes.showlegend.dflt===!1))&&(M++,u.showlegend&&(E=!0,(!w&&c.traceIs(u,"pie-like")||u._input.showlegend===!0)&&M++),g.coerceFont(b,"legendgrouptitle.font",C)),(!w&&c.traceIs(u,"bar")&&i.barmode==="stack"||["tonextx","tonexty"].indexOf(u.fill)!==-1)&&(A=r.isGrouped({traceorder:A})?"grouped+reversed":"reversed"),u.legendgroup!==void 0&&u.legendgroup!==""&&(A=r.isReversed({traceorder:A})?"reversed+grouped":"grouped")}var R=g.coerce(o,i,e,"showlegend",E&&M>(n==="legend"?1:0));if(R===!1&&(i[n]=void 0),!(R===!1&&!f.uirevision)&&(y("uirevision",i.uirevision),R!==!1)){y("borderwidth");var O=y("orientation"),N=y("yref"),V=y("xref"),H=O==="h",F=N==="paper",U=V==="paper",W,q,X,lt="left";H?(W=0,c.getComponentMethod("rangeslider","isVisible")(o.xaxis)?F?(q=1.1,X="bottom"):(q=1,X="top"):F?(q=-.1,X="top"):(q=0,X="bottom")):(q=1,X="auto",U?W=1.02:(W=1,lt="right")),g.coerce(f,x,{x:{valType:"number",editType:"legend",min:U?-2:0,max:U?3:1,dflt:W}},"x"),g.coerce(f,x,{y:{valType:"number",editType:"legend",min:F?-2:0,max:F?3:1,dflt:q}},"y"),y("traceorder",A),r.isGrouped(i[n])&&y("tracegroupgap"),y("entrywidth"),y("entrywidthmode"),y("indentation"),y("itemsizing"),y("itemwidth"),y("itemclick"),y("itemdoubleclick"),y("groupclick"),y("xanchor",lt),y("yanchor",X),y("maxheight"),y("valign"),g.noneOrAll(f,x,["x","y"]);var yt=y("title.text");if(yt){y("title.side",H?"left":"top");var pt=g.extendFlat({},v,{size:g.bigFont(v.size)});g.coerceFont(y,"title.font",pt)}}}}$.exports=function(n,o,i){var s,f=i.slice(),x=o.shapes;if(x)for(s=0;s<x.length;s++){var y=x[s];if(y.showlegend){var v={_input:y._input,visible:y.visible,showlegend:y.showlegend,legend:y.legend};f.push(v)}}var T=["legend"];for(s=0;s<f.length;s++)g.pushUnique(T,f[s].legend);for(o._legends=[],s=0;s<T.length;s++){var u=T[s];a(u,n,o,f),o[u]&&(o[u]._id=u),o._legends.push(u)}}}),d6=Ft((Q,$)=>{var c=Xo(),g=bn(),P=g.pushUnique,S=!0;$.exports=function(t,e,r){var a=e._fullLayout;if(e._dragged||e._editing)return;var n=a.legend.itemclick,o=a.legend.itemdoubleclick,i=a.legend.groupclick;r===1&&n==="toggle"&&o==="toggleothers"&&S&&e.data&&e._context.showTips&&g.notifier(g._(e,"Double-click on legend to isolate one trace"),"long"),S=!1;var s;if(r===1?s=n:r===2&&(s=o),!s)return;var f=i==="togglegroup",x=a.hiddenlabels?a.hiddenlabels.slice():[],y=t.data()[0][0];if(y.groupTitle&&y.noClick)return;var v=e._fullData,T=(a.shapes||[]).filter(function(se){return se.showlegend}),u=v.concat(T),b=y.trace;b._isShape&&(b=b._fullInput);var _=b.legendgroup,C,M,E,A,h,p,k={},w=[],R=[],O=[];function N(se,Tt){var Lt=w.indexOf(se),Mt=k.visible;return Mt||(Mt=k.visible=[]),w.indexOf(se)===-1&&(w.push(se),Lt=w.length-1),Mt[Lt]=Tt,Lt}var V=(a.shapes||[]).map(function(se){return se._input}),H=!1;function F(se,Tt){V[se].visible=Tt,H=!0}function U(se,Tt){if(!(y.groupTitle&&!f)){var Lt=se._fullInput||se,Mt=Lt._isShape,te=Lt.index;te===void 0&&(te=Lt._index);var ve=Lt.visible===!1?!1:Tt;Mt?F(te,ve):N(te,ve)}}var W=b.legend,q=b._fullInput,X=q&&q._isShape;if(!X&&c.traceIs(b,"pie-like")){var lt=y.label,yt=x.indexOf(lt);if(s==="toggle")yt===-1?x.push(lt):x.splice(yt,1);else if(s==="toggleothers"){var pt=yt!==-1,st=[];for(C=0;C<e.calcdata.length;C++){var tt=e.calcdata[C];for(M=0;M<tt.length;M++){var dt=tt[M],rt=dt.label;W===tt[0].trace.legend&&lt!==rt&&(x.indexOf(rt)===-1&&(pt=!0),P(x,rt),st.push(rt))}}if(!pt)for(var at=0;at<st.length;at++){var vt=x.indexOf(st[at]);vt!==-1&&x.splice(vt,1)}}c.call("_guiRelayout",e,"hiddenlabels",x)}else{var it=_&&_.length,Y=[],ft;if(it)for(C=0;C<u.length;C++)ft=u[C],ft.visible&&ft.legendgroup===_&&Y.push(C);if(s==="toggle"){var ut;switch(b.visible){case!0:ut="legendonly";break;case!1:ut=!1;break;case"legendonly":ut=!0;break}if(it)if(f)for(C=0;C<u.length;C++){var wt=u[C];wt.visible!==!1&&wt.legendgroup===_&&U(wt,ut)}else U(b,ut);else U(b,ut)}else if(s==="toggleothers"){var zt,Pt,Wt,Ht,Jt,ge=!0;for(C=0;C<u.length;C++)if(Jt=u[C],zt=Jt===b,Wt=Jt.showlegend!==!0,!(zt||Wt)&&(Pt=it&&Jt.legendgroup===_,!Pt&&Jt.legend===W&&Jt.visible===!0&&!c.traceIs(Jt,"notLegendIsolatable"))){ge=!1;break}for(C=0;C<u.length;C++)if(Jt=u[C],!(Jt.visible===!1||Jt.legend!==W)&&!c.traceIs(Jt,"notLegendIsolatable"))switch(b.visible){case"legendonly":U(Jt,!0);break;case!0:Ht=ge?!0:"legendonly",zt=Jt===b,Wt=Jt.showlegend!==!0&&!Jt.legendgroup,Pt=zt||it&&Jt.legendgroup===_,U(Jt,Pt||Wt?!0:Ht);break}}for(C=0;C<R.length;C++)if(E=R[C],!!E){var he=E.constructUpdate(),de=Object.keys(he);for(M=0;M<de.length;M++)A=de[M],p=k[A]=k[A]||[],p[O[C]]=he[A]}for(h=Object.keys(k),C=0;C<h.length;C++)for(A=h[C],M=0;M<w.length;M++)k[A].hasOwnProperty(M)||(k[A][M]=void 0);H?c.call("_guiUpdate",e,k,{shapes:V},w):c.call("_guiRestyle",e,k,w)}}}),z_=Ft((Q,$)=>{$.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}),vw=Ft((Q,$)=>{var c=Xo(),g=Fy();$.exports=function(P,S,t){var e=S._inHover,r=g.isGrouped(S),a=g.isReversed(S),n={},o=[],i=!1,s={},f=0,x=0,y,v;function T(U,W,q){if(S.visible!==!1&&!(t&&U!==S._id))if(W===""||!g.isGrouped(S)){var X="~~i"+f;o.push(X),n[X]=[q],f++}else o.indexOf(W)===-1?(o.push(W),i=!0,n[W]=[q]):n[W].push(q)}for(y=0;y<P.length;y++){var u=P[y],b=u[0],_=b.trace,C=_.legend,M=_.legendgroup;if(!(!e&&(!_.visible||!_.showlegend)))if(c.traceIs(_,"pie-like"))for(s[M]||(s[M]={}),v=0;v<u.length;v++){var E=u[v].label;s[M][E]||(T(C,M,{label:E,color:u[v].color,i:u[v].i,trace:_,pts:u[v].pts}),s[M][E]=!0,x=Math.max(x,(E||"").length))}else T(C,M,b),x=Math.max(x,(_.name||"").length)}if(!o.length)return[];var A=!i||!r,h=[];for(y=0;y<o.length;y++){var p=n[o[y]];A?h.push(p[0]):h.push(p)}for(A&&(h=[h]),y=0;y<h.length;y++){var k=1/0;for(v=0;v<h[y].length;v++){var w=h[y][v].trace.legendrank;k>w&&(k=w)}h[y][0]._groupMinRank=k,h[y][0]._preGroupSort=y}var R=function(U,W){return U[0]._groupMinRank-W[0]._groupMinRank||U[0]._preGroupSort-W[0]._preGroupSort},O=function(U,W){return U.trace.legendrank-W.trace.legendrank||U._preSort-W._preSort};for(h.forEach(function(U,W){U[0]._preGroupSort=W}),h.sort(R),y=0;y<h.length;y++){h[y].forEach(function(U,W){U._preSort=W}),h[y].sort(O);var N=h[y][0].trace,V=null;for(v=0;v<h[y].length;v++){var H=h[y][v].trace.legendgrouptitle;if(H&&H.text){V=H,e&&(H.font=S._groupTitleFont);break}}if(a&&h[y].reverse(),V){var F=!1;for(v=0;v<h[y].length;v++)if(c.traceIs(h[y][v].trace,"pie-like")){F=!0;break}h[y].unshift({i:-1,groupTitle:V,noClick:F,trace:{showlegend:N.showlegend,legendgroup:N.legendgroup,visible:S.groupclick==="toggleitem"?!0:N.visible}})}for(v=0;v<h[y].length;v++)h[y][v]=[h[y][v]]}return S._lgroupsLength=h.length,S._maxNameLength=x,h}}),xg=Ft(Q=>{var $=bn();function c(g){return g.indexOf("e")!==-1?g.replace(/[.]?0+e/,"e"):g.indexOf(".")!==-1?g.replace(/[.]?0+$/,""):g}Q.formatPiePercent=function(g,P){var S=c((g*100).toPrecision(3));return $.numSeparate(S,P)+"%"},Q.formatPieValue=function(g,P){var S=c(g.toPrecision(10));return $.numSeparate(S,P)},Q.getFirstFilled=function(g,P){if($.isArrayOrTypedArray(g))for(var S=0;S<P.length;S++){var t=g[P[S]];if(t||t===0||t==="")return t}},Q.castOption=function(g,P){if($.isArrayOrTypedArray(g))return Q.getFirstFilled(g,P);if(g)return g},Q.getRotationAngle=function(g){return(g==="auto"?0:g)*Math.PI/180}}),p6=Ft((Q,$)=>{var c=js(),g=li();$.exports=function(P,S,t,e){var r=t.marker.pattern;r&&r.shape?c.pointStyle(P,t,e,S):g.fill(P,S.color)}}),_g=Ft((Q,$)=>{var c=li(),g=xg().castOption,P=p6();$.exports=function(S,t,e,r){var a=e.marker.line,n=g(a.color,t.pts)||c.defaultLine,o=g(a.width,t.pts)||0;S.call(P,t,e,r).style("stroke-width",o).call(c.stroke,n)}}),yw=Ft((Q,$)=>{var c=un(),g=Xo(),P=bn(),S=P.strTranslate,t=js(),e=li(),r=Hd().extractOpts,a=Ac(),n=_g(),o=xg().castOption,i=z_(),s=12,f=5,x=2,y=10,v=5;$.exports=function(_,C,M){var E=C._fullLayout;M||(M=E.legend);var A=M.itemsizing==="constant",h=M.itemwidth,p=(h+i.itemGap*2)/2,k=S(p,0),w=function(st,tt,dt,rt){var at;if(st+1)at=st;else if(tt&&tt.width>0)at=tt.width;else return 0;return A?rt:Math.min(at,dt)};_.each(function(st){var tt=c.select(this),dt=P.ensureSingle(tt,"g","layers");dt.style("opacity",st[0].trace.opacity);var rt=M.indentation,at=M.valign,vt=st[0].lineHeight,it=st[0].height;if(at==="middle"&&rt===0||!vt||!it)dt.attr("transform",null);else{var Y={top:1,bottom:-1}[at],ft=Y*(.5*(vt-it+3))||0,ut=M.indentation;dt.attr("transform",S(ut,ft))}var wt=dt.selectAll("g.legendfill").data([st]);wt.enter().append("g").classed("legendfill",!0);var zt=dt.selectAll("g.legendlines").data([st]);zt.enter().append("g").classed("legendlines",!0);var Pt=dt.selectAll("g.legendsymbols").data([st]);Pt.enter().append("g").classed("legendsymbols",!0),Pt.selectAll("g.legendpoints").data([st]).enter().append("g").classed("legendpoints",!0)}).each(pt).each(N).each(H).each(V).each(U).each(lt).each(X).each(R).each(O).each(W).each(q);function R(st){var tt=u(st),dt=tt.showFill,rt=tt.showLine,at=tt.showGradientLine,vt=tt.showGradientFill,it=tt.anyFill,Y=tt.anyLine,ft=st[0],ut=ft.trace,wt,zt,Pt=r(ut),Wt=Pt.colorscale,Ht=Pt.reversescale,Jt=function(Mt){if(Mt.size())if(dt)t.fillGroupStyle(Mt,C,!0);else{var te="legendfill-"+ut.uid;t.gradient(Mt,C,te,T(Ht),Wt,"fill")}},ge=function(Mt){if(Mt.size()){var te="legendline-"+ut.uid;t.lineGroupStyle(Mt),t.gradient(Mt,C,te,T(Ht),Wt,"stroke")}},he=a.hasMarkers(ut)||!it?"M5,0":Y?"M5,-2":"M5,-3",de=c.select(this),se=de.select(".legendfill").selectAll("path").data(dt||vt?[st]:[]);if(se.enter().append("path").classed("js-fill",!0),se.exit().remove(),se.attr("d",he+"h"+h+"v6h-"+h+"z").call(Jt),rt||at){var Tt=w(void 0,ut.line,y,f);zt=P.minExtend(ut,{line:{width:Tt}}),wt=[P.minExtend(ft,{trace:zt})]}var Lt=de.select(".legendlines").selectAll("path").data(rt||at?[wt]:[]);Lt.enter().append("path").classed("js-line",!0),Lt.exit().remove(),Lt.attr("d",he+(at?"l"+h+",0.0001":"h"+h)).call(rt?t.lineGroupStyle:ge)}function O(st){var tt=u(st),dt=tt.anyFill,rt=tt.anyLine,at=tt.showLine,vt=tt.showMarker,it=st[0],Y=it.trace,ft=!vt&&!rt&&!dt&&a.hasText(Y),ut,wt;function zt(se,Tt,Lt,Mt){var te=P.nestedProperty(Y,se).get(),ve=P.isArrayOrTypedArray(te)&&Tt?Tt(te):te;if(A&&ve&&Mt!==void 0&&(ve=Mt),Lt){if(ve<Lt[0])return Lt[0];if(ve>Lt[1])return Lt[1]}return ve}function Pt(se){return it._distinct&&it.index&&se[it.index]?se[it.index]:se[0]}if(vt||ft||at){var Wt={},Ht={};if(vt){Wt.mc=zt("marker.color",Pt),Wt.mx=zt("marker.symbol",Pt),Wt.mo=zt("marker.opacity",P.mean,[.2,1]),Wt.mlc=zt("marker.line.color",Pt),Wt.mlw=zt("marker.line.width",P.mean,[0,5],x),Ht.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var Jt=zt("marker.size",P.mean,[2,16],s);Wt.ms=Jt,Ht.marker.size=Jt}at&&(Ht.line={width:zt("line.width",Pt,[0,10],f)}),ft&&(Wt.tx="Aa",Wt.tp=zt("textposition",Pt),Wt.ts=10,Wt.tc=zt("textfont.color",Pt),Wt.tf=zt("textfont.family",Pt),Wt.tw=zt("textfont.weight",Pt),Wt.ty=zt("textfont.style",Pt),Wt.tv=zt("textfont.variant",Pt),Wt.tC=zt("textfont.textcase",Pt),Wt.tE=zt("textfont.lineposition",Pt),Wt.tS=zt("textfont.shadow",Pt)),ut=[P.minExtend(it,Wt)],wt=P.minExtend(Y,Ht),wt.selectedpoints=null,wt.texttemplate=null}var ge=c.select(this).select("g.legendpoints"),he=ge.selectAll("path.scatterpts").data(vt?ut:[]);he.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",k),he.exit().remove(),he.call(t.pointStyle,wt,C),vt&&(ut[0].mrc=3);var de=ge.selectAll("g.pointtext").data(ft?ut:[]);de.enter().append("g").classed("pointtext",!0).append("text").attr("transform",k),de.exit().remove(),de.selectAll("text").call(t.textPointStyle,wt,C)}function N(st){var tt=st[0].trace,dt=tt.type==="waterfall";if(st[0]._distinct&&dt){var rt=st[0].trace[st[0].dir].marker;return st[0].mc=rt.color,st[0].mlw=rt.line.width,st[0].mlc=rt.line.color,F(st,this,"waterfall")}var at=[];tt.visible&&dt&&(at=st[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 vt=c.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(at);vt.enter().append("path").classed("legendwaterfall",!0).attr("transform",k).style("stroke-miterlimit",1),vt.exit().remove(),vt.each(function(it){var Y=c.select(this),ft=tt[it[0]].marker,ut=w(void 0,ft.line,v,x);Y.attr("d",it[1]).style("stroke-width",ut+"px").call(e.fill,ft.color),ut&&Y.call(e.stroke,ft.line.color)})}function V(st){F(st,this)}function H(st){F(st,this,"funnel")}function F(st,tt,dt){var rt=st[0].trace,at=rt.marker||{},vt=at.line||{},it=at.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",Y=dt?rt.visible&&rt.type===dt:g.traceIs(rt,"bar"),ft=c.select(tt).select("g.legendpoints").selectAll("path.legend"+dt).data(Y?[st]:[]);ft.enter().append("path").classed("legend"+dt,!0).attr("d",it).attr("transform",k),ft.exit().remove(),ft.each(function(ut){var wt=c.select(this),zt=ut[0],Pt=w(zt.mlw,at.line,v,x);wt.style("stroke-width",Pt+"px");var Wt=zt.mcc;if(!M._inHover&&"mc"in zt){var Ht=r(at),Jt=Ht.mid;Jt===void 0&&(Jt=(Ht.max+Ht.min)/2),Wt=t.tryColorscale(at,"")(Jt)}var ge=Wt||zt.mc||at.color,he=at.pattern,de=t.getPatternAttr,se=he&&(de(he.shape,0,"")||de(he.path,0,""));if(se){var Tt=de(he.bgcolor,0,null),Lt=de(he.fgcolor,0,null),Mt=he.fgopacity,te=b(he.size,8,10),ve=b(he.solidity,.5,1),oe="legend-"+rt.uid;wt.call(t.pattern,"legend",C,oe,se,te,ve,Wt,he.fillmode,Tt,Lt,Mt)}else wt.call(e.fill,ge);Pt&&e.stroke(wt,zt.mlc||vt.color)})}function U(st){var tt=st[0].trace,dt=c.select(this).select("g.legendpoints").selectAll("path.legendbox").data(tt.visible&&g.traceIs(tt,"box-violin")?[st]:[]);dt.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",k),dt.exit().remove(),dt.each(function(){var rt=c.select(this);if((tt.boxpoints==="all"||tt.points==="all")&&e.opacity(tt.fillcolor)===0&&e.opacity((tt.line||{}).color)===0){var at=P.minExtend(tt,{marker:{size:A?s:P.constrain(tt.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});dt.call(t.pointStyle,at,C)}else{var vt=w(void 0,tt.line,v,x);rt.style("stroke-width",vt+"px").call(e.fill,tt.fillcolor),vt&&e.stroke(rt,tt.line.color)}})}function W(st){var tt=st[0].trace,dt=c.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(tt.visible&&tt.type==="candlestick"?[st,st]:[]);dt.enter().append("path").classed("legendcandle",!0).attr("d",function(rt,at){return at?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",k).style("stroke-miterlimit",1),dt.exit().remove(),dt.each(function(rt,at){var vt=c.select(this),it=tt[at?"increasing":"decreasing"],Y=w(void 0,it.line,v,x);vt.style("stroke-width",Y+"px").call(e.fill,it.fillcolor),Y&&e.stroke(vt,it.line.color)})}function q(st){var tt=st[0].trace,dt=c.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(tt.visible&&tt.type==="ohlc"?[st,st]:[]);dt.enter().append("path").classed("legendohlc",!0).attr("d",function(rt,at){return at?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",k).style("stroke-miterlimit",1),dt.exit().remove(),dt.each(function(rt,at){var vt=c.select(this),it=tt[at?"increasing":"decreasing"],Y=w(void 0,it.line,v,x);vt.style("fill","none").call(t.dashLine,it.line.dash,Y),Y&&e.stroke(vt,it.line.color)})}function X(st){yt(st,this,"pie")}function lt(st){yt(st,this,"funnelarea")}function yt(st,tt,dt){var rt=st[0],at=rt.trace,vt=dt?at.visible&&at.type===dt:g.traceIs(at,dt),it=c.select(tt).select("g.legendpoints").selectAll("path.legend"+dt).data(vt?[st]:[]);if(it.enter().append("path").classed("legend"+dt,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",k),it.exit().remove(),it.size()){var Y=at.marker||{},ft=w(o(Y.line.width,rt.pts),Y.line,v,x),ut="pieLike",wt=P.minExtend(at,{marker:{line:{width:ft}}},ut),zt=P.minExtend(rt,{trace:wt},ut);n(it,zt,wt,C)}}function pt(st){var tt=st[0].trace,dt,rt=[];if(tt.visible)switch(tt.type){case"histogram2d":case"heatmap":rt=[["M-15,-2V4H15V-2Z"]],dt=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":rt=[["M-6,-6V6H6V-6Z"]],dt=!0;break;case"densitymapbox":case"densitymap":rt=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],dt="radial";break;case"cone":rt=[["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"]],dt=!1;break;case"streamtube":rt=[["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"]],dt=!1;break;case"surface":rt=[["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"]],dt=!0;break;case"mesh3d":rt=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],dt=!1;break;case"volume":rt=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],dt=!0;break;case"isosurface":rt=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],dt=!1;break}var at=c.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(rt);at.enter().append("path").classed("legend3dandfriends",!0).attr("transform",k).style("stroke-miterlimit",1),at.exit().remove(),at.each(function(vt,it){var Y=c.select(this),ft=r(tt),ut=ft.colorscale,wt=ft.reversescale,zt=function(Jt){if(Jt.size()){var ge="legendfill-"+tt.uid;t.gradient(Jt,C,ge,T(wt,dt==="radial"),ut,"fill")}},Pt;if(ut){if(!dt){var Wt=ut.length;Pt=it===0?ut[wt?Wt-1:0][1]:it===1?ut[wt?0:Wt-1][1]:ut[Math.floor((Wt-1)/2)][1]}}else{var Ht=tt.vertexcolor||tt.facecolor||tt.color;Pt=P.isArrayOrTypedArray(Ht)?Ht[it]||Ht[0]:Ht}Y.attr("d",vt[0]),Pt?Y.call(e.fill,Pt):Y.call(zt)})}};function T(_,C){var M=C?"radial":"horizontal";return M+(_?"":"reversed")}function u(_){var C=_[0].trace,M=C.contours,E=a.hasLines(C),A=a.hasMarkers(C),h=C.visible&&C.fill&&C.fill!=="none",p=!1,k=!1;if(M){var w=M.coloring;w==="lines"?p=!0:E=w==="none"||w==="heatmap"||M.showlines,M.type==="constraint"?h=M._operation!=="=":(w==="fill"||w==="heatmap")&&(k=!0)}return{showMarker:A,showLine:E,showFill:h,showGradientLine:p,showGradientFill:k,anyLine:E||p,anyFill:h||k}}function b(_,C,M){return _&&P.isArrayOrTypedArray(_)?C:_>M?M:_}}),I_=Ft((Q,$)=>{var c=un(),g=bn(),P=Kc(),S=Xo(),t=Om(),e=up(),r=js(),a=li(),n=tc(),o=d6(),i=z_(),s=Af(),f=s.LINE_SPACING,x=s.FROM_TL,y=s.FROM_BR,v=vw(),T=yw(),u=Fy(),b=1,_=/^legend[0-9]*$/;$.exports=function(W,q){if(q)M(W,q);else{var X=W._fullLayout,lt=X._legends,yt=X._infolayer.selectAll('[class^="legend"]');yt.each(function(){var dt=c.select(this),rt=dt.attr("class"),at=rt.split(" ")[0];at.match(_)&&lt.indexOf(at)===-1&&dt.remove()});for(var pt=0;pt<lt.length;pt++){var st=lt[pt],tt=W._fullLayout[st];M(W,tt)}}};function C(W,q,X){if(!(q.title.side!=="top center"&&q.title.side!=="top right")){var lt=q.title.font,yt=lt.size*f,pt=0,st=W.node(),tt=r.bBox(st).width;q.title.side==="top center"?pt=.5*(q._width-2*X-2*i.titlePad-tt):q.title.side==="top right"&&(pt=q._width-2*X-2*i.titlePad-tt),n.positionText(W,X+i.titlePad+pt,X+yt)}}function M(W,q){var X=q||{},lt=W._fullLayout,yt=U(X),pt,st,tt=X._inHover;if(tt?(st=X.layer,pt="hover"):(st=lt._infolayer,pt=yt),!!st){pt+=lt._uid,W._legendMouseDownTime||(W._legendMouseDownTime=0);var dt;if(tt){if(!X.entries)return;dt=v(X.entries,X)}else{for(var rt=(W.calcdata||[]).slice(),at=lt.shapes,vt=0;vt<at.length;vt++){var it=at[vt];if(it.showlegend){var Y={_isShape:!0,_fullInput:it,index:it._index,name:it.name||it.label.text||"shape "+it._index,legend:it.legend,legendgroup:it.legendgroup,legendgrouptitle:it.legendgrouptitle,legendrank:it.legendrank,legendwidth:it.legendwidth,showlegend:it.showlegend,visible:it.visible,opacity:it.opacity,mode:it.type==="line"?"lines":"markers",line:it.line,marker:{line:it.line,color:it.fillcolor,size:12,symbol:it.type==="rect"?"square":it.type==="circle"?"circle":"hexagon2"}};rt.push([{trace:Y}])}}dt=lt.showlegend&&v(rt,X,lt._legends.length>1)}var ft=lt.hiddenlabels||[];if(!tt&&(!lt.showlegend||!dt.length))return st.selectAll("."+yt).remove(),lt._topdefs.select("#"+pt).remove(),P.autoMargin(W,yt);var ut=g.ensureSingle(st,"g",yt,function(de){tt||de.attr("pointer-events","all")}),wt=g.ensureSingleById(lt._topdefs,"clipPath",pt,function(de){de.append("rect")}),zt=g.ensureSingle(ut,"rect","bg",function(de){de.attr("shape-rendering","crispEdges")});zt.call(a.stroke,X.bordercolor).call(a.fill,X.bgcolor).style("stroke-width",X.borderwidth+"px");var Pt=g.ensureSingle(ut,"g","scrollbox"),Wt=X.title;X._titleWidth=0,X._titleHeight=0;var Ht;Wt.text?(Ht=g.ensureSingle(Pt,"text",yt+"titletext"),Ht.attr("text-anchor","start").call(r.font,Wt.font).text(Wt.text),w(Ht,Pt,W,X,b)):Pt.selectAll("."+yt+"titletext").remove();var Jt=g.ensureSingle(ut,"rect","scrollbar",function(de){de.attr(i.scrollBarEnterAttrs).call(a.fill,i.scrollBarColor)}),ge=Pt.selectAll("g.groups").data(dt);ge.enter().append("g").attr("class","groups"),ge.exit().remove();var he=ge.selectAll("g.traces").data(g.identity);he.enter().append("g").attr("class","traces"),he.exit().remove(),he.style("opacity",function(de){var se=de[0].trace;return S.traceIs(se,"pie-like")?ft.indexOf(de[0].label)!==-1?.5:1:se.visible==="legendonly"?.5:1}).each(function(){c.select(this).call(h,W,X)}).call(T,W,X).each(function(){tt||c.select(this).call(k,W,yt)}),g.syncOrAsync([P.previousPromises,function(){return N(W,ge,he,X)},function(){var de=lt._size,se=X.borderwidth,Tt=X.xref==="paper",Lt=X.yref==="paper";if(Wt.text&&C(Ht,X,se),!tt){var Mt,te;Tt?Mt=de.l+de.w*X.x-x[H(X)]*X._width:Mt=lt.width*X.x-x[H(X)]*X._width,Lt?te=de.t+de.h*(1-X.y)-x[F(X)]*X._effHeight:te=lt.height*(1-X.y)-x[F(X)]*X._effHeight;var ve=V(W,yt,Mt,te);if(ve)return;if(lt.margin.autoexpand){var oe=Mt,Te=te;Mt=Tt?g.constrain(Mt,0,lt.width-X._width):oe,te=Lt?g.constrain(te,0,lt.height-X._effHeight):Te,Mt!==oe&&g.log("Constrain "+yt+".x to make legend fit inside graph"),te!==Te&&g.log("Constrain "+yt+".y to make legend fit inside graph")}r.setTranslate(ut,Mt,te)}if(Jt.on(".drag",null),ut.on("wheel",null),tt||X._height<=X._maxHeight||W._context.staticPlot){var He=X._effHeight;tt&&(He=X._height),zt.attr({width:X._width-se,height:He-se,x:se/2,y:se/2}),r.setTranslate(Pt,0,0),wt.select("rect").attr({width:X._width-2*se,height:He-2*se,x:se,y:se}),r.setClipUrl(Pt,pt,W),r.setRect(Jt,0,0,0,0),delete X._scrollY}else{var Ge=Math.max(i.scrollBarMinHeight,X._effHeight*X._effHeight/X._height),cr=X._effHeight-Ge-2*i.scrollBarMargin,ur=X._height-X._effHeight,jr=cr/ur,Hr=Math.min(X._scrollY||0,ur);zt.attr({width:X._width-2*se+i.scrollBarWidth+i.scrollBarMargin,height:X._effHeight-se,x:se/2,y:se/2}),wt.select("rect").attr({width:X._width-2*se+i.scrollBarWidth+i.scrollBarMargin,height:X._effHeight-2*se,x:se,y:se+Hr}),r.setClipUrl(Pt,pt,W),gt(Hr,Ge,jr),ut.on("wheel",function(){Hr=g.constrain(X._scrollY+c.event.deltaY/ur*cr,0,ur),gt(Hr,Ge,jr),Hr!==0&&Hr!==ur&&c.event.preventDefault()});var br,Kr,rn,Ce=function(we,Ue,qe){var ar=(qe-Ue)/jr+we;return g.constrain(ar,0,ur)},$t=function(we,Ue,qe){var ar=(Ue-qe)/jr+we;return g.constrain(ar,0,ur)},ne=c.behavior.drag().on("dragstart",function(){var we=c.event.sourceEvent;we.type==="touchstart"?br=we.changedTouches[0].clientY:br=we.clientY,rn=Hr}).on("drag",function(){var we=c.event.sourceEvent;we.buttons===2||we.ctrlKey||(we.type==="touchmove"?Kr=we.changedTouches[0].clientY:Kr=we.clientY,Hr=Ce(rn,br,Kr),gt(Hr,Ge,jr))});Jt.call(ne);var Ct=c.behavior.drag().on("dragstart",function(){var we=c.event.sourceEvent;we.type==="touchstart"&&(br=we.changedTouches[0].clientY,rn=Hr)}).on("drag",function(){var we=c.event.sourceEvent;we.type==="touchmove"&&(Kr=we.changedTouches[0].clientY,Hr=$t(rn,br,Kr),gt(Hr,Ge,jr))});Pt.call(Ct)}function gt(we,Ue,qe){X._scrollY=W._fullLayout[yt]._scrollY=we,r.setTranslate(Pt,0,-we),r.setRect(Jt,X._width,i.scrollBarMargin+we*qe,i.scrollBarWidth,Ue),wt.select("rect").attr("y",se+we)}if(W._context.edits.legendPosition){var St,Nt,ee,le;ut.classed("cursor-move",!0),e.init({element:ut.node(),gd:W,prepFn:function(we){if(we.target!==Jt.node()){var Ue=r.getTranslate(ut);ee=Ue.x,le=Ue.y}},moveFn:function(we,Ue){if(ee!==void 0&&le!==void 0){var qe=ee+we,ar=le+Ue;r.setTranslate(ut,qe,ar),St=e.align(qe,X._width,de.l,de.l+de.w,X.xanchor),Nt=e.align(ar+X._height,-X._height,de.t+de.h,de.t,X.yanchor)}},doneFn:function(){if(St!==void 0&&Nt!==void 0){var we={};we[yt+".x"]=St,we[yt+".y"]=Nt,S.call("_guiRelayout",W,we)}},clickFn:function(we,Ue){var qe=st.selectAll("g.traces").filter(function(){var ar=this.getBoundingClientRect();return Ue.clientX>=ar.left&&Ue.clientX<=ar.right&&Ue.clientY>=ar.top&&Ue.clientY<=ar.bottom});qe.size()>0&&A(W,ut,qe,we,Ue)}})}}],W)}}function E(W,q,X){var lt=W[0],yt=lt.width,pt=q.entrywidthmode,st=lt.trace.legendwidth||q.entrywidth;return pt==="fraction"?q._maxWidth*st:X+(st||yt)}function A(W,q,X,lt,yt){var pt=X.data()[0][0].trace,st={event:yt,node:X.node(),curveNumber:pt.index,expandedIndex:pt.index,data:W.data,layout:W.layout,frames:W._transitionData._frames,config:W._context,fullData:W._fullData,fullLayout:W._fullLayout};pt._group&&(st.group=pt._group),S.traceIs(pt,"pie-like")&&(st.label=X.datum()[0].label);var tt=t.triggerHandler(W,"plotly_legendclick",st);if(lt===1){if(tt===!1)return;q._clickTimeout=setTimeout(function(){W._fullLayout&&o(X,W,lt)},W._context.doubleClickDelay)}else if(lt===2){q._clickTimeout&&clearTimeout(q._clickTimeout),W._legendMouseDownTime=0;var dt=t.triggerHandler(W,"plotly_legenddoubleclick",st);dt!==!1&&tt!==!1&&o(X,W,lt)}}function h(W,q,X){var lt=U(X),yt=W.data()[0][0],pt=yt.trace,st=S.traceIs(pt,"pie-like"),tt=!X._inHover&&q._context.edits.legendText&&!st,dt=X._maxNameLength,rt,at;yt.groupTitle?(rt=yt.groupTitle.text,at=yt.groupTitle.font):(at=X.font,X.entries?rt=yt.text:(rt=st?yt.label:pt.name,pt._meta&&(rt=g.templateString(rt,pt._meta))));var vt=g.ensureSingle(W,"text",lt+"text");vt.attr("text-anchor","start").call(r.font,at).text(tt?p(rt,dt):rt);var it=X.indentation+X.itemwidth+i.itemGap*2;n.positionText(vt,it,0),tt?vt.call(n.makeEditable,{gd:q,text:rt}).call(w,W,q,X).on("edit",function(Y){this.text(p(Y,dt)).call(w,W,q,X);var ft=yt.trace._fullInput||{},ut={};return ut.name=Y,ft._isShape?S.call("_guiRelayout",q,"shapes["+pt.index+"].name",ut.name):S.call("_guiRestyle",q,ut,pt.index)}):w(vt,W,q,X)}function p(W,q){var X=Math.max(4,q);if(W&&W.trim().length>=X/2)return W;W=W||"";for(var lt=X-W.length;lt>0;lt--)W+=" ";return W}function k(W,q,X){var lt=q._context.doubleClickDelay,yt,pt=1,st=g.ensureSingle(W,"rect",X+"toggle",function(tt){q._context.staticPlot||tt.style("cursor","pointer").attr("pointer-events","all"),tt.call(a.fill,"rgba(0,0,0,0)")});q._context.staticPlot||(st.on("mousedown",function(){yt=new Date().getTime(),yt-q._legendMouseDownTime<lt?pt+=1:(pt=1,q._legendMouseDownTime=yt)}),st.on("mouseup",function(){if(!(q._dragged||q._editing)){var tt=q._fullLayout[X];new Date().getTime()-q._legendMouseDownTime>lt&&(pt=Math.max(pt-1,1)),A(q,tt,W,pt,c.event)}}))}function w(W,q,X,lt,yt){lt._inHover&&W.attr("data-notex",!0),n.convertToTspans(W,X,function(){R(q,X,lt,yt)})}function R(W,q,X,lt){var yt=W.data()[0][0];if(!X._inHover&&yt&&!yt.trace.showlegend){W.remove();return}var pt=W.select("g[class*=math-group]"),st=pt.node(),tt=U(X);X||(X=q._fullLayout[tt]);var dt=X.borderwidth,rt;lt===b?rt=X.title.font:yt.groupTitle?rt=yt.groupTitle.font:rt=X.font;var at=rt.size*f,vt,it;if(st){var Y=r.bBox(st);vt=Y.height,it=Y.width,lt===b?r.setTranslate(pt,dt,dt+vt*.75):r.setTranslate(pt,0,vt*.25)}else{var ft="."+tt+(lt===b?"title":"")+"text",ut=W.select(ft),wt=n.lineCount(ut),zt=ut.node();if(vt=at*wt,it=zt?r.bBox(zt).width:0,lt===b)X.title.side==="left"&&(it+=i.itemGap*2),n.positionText(ut,dt+i.titlePad,dt+at);else{var Pt=i.itemGap*2+X.indentation+X.itemwidth;yt.groupTitle&&(Pt=i.itemGap,it-=X.indentation+X.itemwidth),n.positionText(ut,Pt,-at*((wt-1)/2-.3))}}lt===b?(X._titleWidth=it,X._titleHeight=vt):(yt.lineHeight=at,yt.height=Math.max(vt,16)+3,yt.width=it)}function O(W){var q=0,X=0,lt=W.title.side;return lt&&(lt.indexOf("left")!==-1&&(q=W._titleWidth),lt.indexOf("top")!==-1&&(X=W._titleHeight)),[q,X]}function N(W,q,X,lt){var yt=W._fullLayout,pt=U(lt);lt||(lt=yt[pt]);var st=yt._size,tt=u.isVertical(lt),dt=u.isGrouped(lt),rt=lt.entrywidthmode==="fraction",at=lt.borderwidth,vt=2*at,it=i.itemGap,Y=lt.indentation+lt.itemwidth+it*2,ft=2*(at+it),ut=F(lt),wt=lt.y<0||lt.y===0&&ut==="top",zt=lt.y>1||lt.y===1&&ut==="bottom",Pt=lt.tracegroupgap,Wt={};let{orientation:Ht,yref:Jt}=lt,{maxheight:ge}=lt,he=wt||zt||Ht!=="v"||Jt!=="paper";ge||(ge=he?.5:1);let de=he?yt.height:st.h;lt._maxHeight=Math.max(ge>1?ge:ge*de,30);var se=0;lt._width=0,lt._height=0;var Tt=O(lt);if(tt)X.each(function(gt){var St=gt[0].height;r.setTranslate(this,at+Tt[0],at+Tt[1]+lt._height+St/2+it),lt._height+=St,lt._width=Math.max(lt._width,gt[0].width)}),se=Y+lt._width,lt._width+=it+Y+vt,lt._height+=ft,dt&&(q.each(function(gt,St){r.setTranslate(this,0,St*lt.tracegroupgap)}),lt._height+=(lt._lgroupsLength-1)*lt.tracegroupgap);else{var Lt=H(lt),Mt=lt.x<0||lt.x===0&&Lt==="right",te=lt.x>1||lt.x===1&&Lt==="left",ve=zt||wt,oe=yt.width/2;lt._maxWidth=Math.max(Mt?ve&&Lt==="left"?st.l+st.w:oe:te?ve&&Lt==="right"?st.r+st.w:oe:st.w,2*Y);var Te=0,He=0;X.each(function(gt){var St=E(gt,lt,Y);Te=Math.max(Te,St),He+=St}),se=null;var Ge=0;if(dt){var cr=0,ur=0,jr=0;q.each(function(){var gt=0,St=0;c.select(this).selectAll("g.traces").each(function(ee){var le=E(ee,lt,Y),we=ee[0].height;r.setTranslate(this,Tt[0],Tt[1]+at+it+we/2+St),St+=we,gt=Math.max(gt,le),Wt[ee[0].trace.legendgroup]=gt});var Nt=gt+it;ur>0&&Nt+at+ur>lt._maxWidth?(Ge=Math.max(Ge,ur),ur=0,jr+=cr+Pt,cr=St):cr=Math.max(cr,St),r.setTranslate(this,ur,jr),ur+=Nt}),lt._width=Math.max(Ge,ur)+at,lt._height=jr+cr+ft}else{var Hr=X.size(),br=He+vt+(Hr-1)*it<lt._maxWidth,Kr=0,rn=0,Ce=0,$t=0;X.each(function(gt){var St=gt[0].height,Nt=E(gt,lt,Y),ee=br?Nt:Te;rt||(ee+=it),ee+at+rn-it>=lt._maxWidth&&(Ge=Math.max(Ge,$t),rn=0,Ce+=Kr,lt._height+=Kr,Kr=0),r.setTranslate(this,Tt[0]+at+rn,Tt[1]+at+Ce+St/2+it),$t=rn+Nt+it,rn+=ee,Kr=Math.max(Kr,St)}),br?(lt._width=rn+vt,lt._height=Kr+ft):(lt._width=Math.max(Ge,$t)+vt,lt._height+=Kr+ft)}}lt._width=Math.ceil(Math.max(lt._width+Tt[0],lt._titleWidth+2*(at+i.titlePad))),lt._height=Math.ceil(Math.max(lt._height+Tt[1],lt._titleHeight+2*(at+i.itemGap))),lt._effHeight=Math.min(lt._height,lt._maxHeight);var ne=W._context.edits,Ct=ne.legendText||ne.legendPosition;X.each(function(gt){var St=c.select(this).select("."+pt+"toggle"),Nt=gt[0].height,ee=gt[0].trace.legendgroup,le=E(gt,lt,Y);dt&&ee!==""&&(le=Wt[ee]);var we=Ct?Y:se||le;!tt&&!rt&&(we+=it/2),r.setRect(St,0,-Nt/2,we,Nt)})}function V(W,q,X,lt){var yt=W._fullLayout,pt=yt[q],st=H(pt),tt=F(pt),dt=pt.xref==="paper",rt=pt.yref==="paper";W._fullLayout._reservedMargin[q]={};var at=pt.y<.5?"b":"t",vt=pt.x<.5?"l":"r",it={r:yt.width-X,l:X+pt._width,b:yt.height-lt,t:lt+pt._effHeight};if(dt&&rt)return P.autoMargin(W,q,{x:pt.x,y:pt.y,l:pt._width*x[st],r:pt._width*y[st],b:pt._effHeight*y[tt],t:pt._effHeight*x[tt]});dt?W._fullLayout._reservedMargin[q][at]=it[at]:rt||pt.orientation==="v"?W._fullLayout._reservedMargin[q][vt]=it[vt]:W._fullLayout._reservedMargin[q][at]=it[at]}function H(W){return g.isRightAnchor(W)?"right":g.isCenterAnchor(W)?"center":"left"}function F(W){return g.isBottomAnchor(W)?"bottom":g.isMiddleAnchor(W)?"middle":"top"}function U(W){return W._id||"legend"}}),O_=Ft(Q=>{var $=un(),c=ra(),g=fo(),P=bn(),S=P.pushUnique,t=P.strTranslate,e=P.strRotate,r=Om(),a=tc(),n=Fm(),o=js(),i=li(),s=up(),f=Es(),x=ic().zindexSeparator,y=Xo(),v=Dp(),T=go(),u=Ry(),b=I_(),_=T.YANGLE,C=Math.PI*_/180,M=1/Math.sin(C),E=Math.cos(C),A=Math.sin(C),h=T.HOVERARROWSIZE,p=T.HOVERTEXTPAD,k={box:!0,ohlc:!0,violin:!0,candlestick:!0},w={scatter:!0,scattergl:!0,splom:!0};function R(Y,ft){return Y.distance-ft.distance}Q.hover=function(Y,ft,ut,wt){Y=P.getGraphDiv(Y);var zt=ft.target;P.throttle(Y._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){O(Y,ft,ut,wt,zt)})},Q.loneHover=function(Y,ft){var ut=!0;Array.isArray(Y)||(ut=!1,Y=[Y]);var wt=ft.gd,zt=at(wt),Pt=vt(wt),Wt=Y.map(function(Mt){var te=Mt._x0||Mt.x0||Mt.x||0,ve=Mt._x1||Mt.x1||Mt.x||0,oe=Mt._y0||Mt.y0||Mt.y||0,Te=Mt._y1||Mt.y1||Mt.y||0,He=Mt.eventData;if(He){var Ge=Math.min(te,ve),cr=Math.max(te,ve),ur=Math.min(oe,Te),jr=Math.max(oe,Te),Hr=Mt.trace;if(y.traceIs(Hr,"gl3d")){var br=wt._fullLayout[Hr.scene]._scene.container,Kr=br.offsetLeft,rn=br.offsetTop;Ge+=Kr,cr+=Kr,ur+=rn,jr+=rn}He.bbox={x0:Ge+Pt,x1:cr+Pt,y0:ur+zt,y1:jr+zt},ft.inOut_bbox&&ft.inOut_bbox.push(He.bbox)}else He=!1;return{color:Mt.color||i.defaultLine,x0:Mt.x0||Mt.x||0,x1:Mt.x1||Mt.x||0,y0:Mt.y0||Mt.y||0,y1:Mt.y1||Mt.y||0,xLabel:Mt.xLabel,yLabel:Mt.yLabel,zLabel:Mt.zLabel,text:Mt.text,name:Mt.name,idealAlign:Mt.idealAlign,borderColor:Mt.borderColor,fontFamily:Mt.fontFamily,fontSize:Mt.fontSize,fontColor:Mt.fontColor,fontWeight:Mt.fontWeight,fontStyle:Mt.fontStyle,fontVariant:Mt.fontVariant,nameLength:Mt.nameLength,textAlign:Mt.textAlign,trace:Mt.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Mt.hovertemplate||!1,hovertemplateLabels:Mt.hovertemplateLabels||!1,eventData:He}}),Ht=!1,Jt=H(Wt,{gd:wt,hovermode:"closest",rotateLabels:Ht,bgColor:ft.bgColor||i.background,container:$.select(ft.container),outerContainer:ft.outerContainer||ft.container}),ge=Jt.hoverLabels,he=5,de=0,se=0;ge.sort(function(Mt,te){return Mt.y0-te.y0}).each(function(Mt,te){var ve=Mt.y0-Mt.by/2;ve-he<de?Mt.offset=de-ve+he:Mt.offset=0,de=ve+Mt.by+Mt.offset,te===ft.anchorIndex&&(se=Mt.offset)}).each(function(Mt){Mt.offset-=se});var Tt=wt._fullLayout._invScaleX,Lt=wt._fullLayout._invScaleY;return X(ge,Ht,Tt,Lt),ut?ge:ge.node()};function O(Y,ft,ut,wt,zt){ut||(ut="xy"),typeof ut=="string"&&(ut=ut.split(x)[0]);var Pt=Array.isArray(ut)?ut:[ut],Wt,Ht=Y._fullLayout,Jt=Ht.hoversubplots,ge=Ht._plots||[],he=ge[ut],de=Ht._has("cartesian"),se=ft.hovermode||Ht.hovermode,Tt=(se||"").charAt(0)==="x",Lt=(se||"").charAt(0)==="y",Mt,te;if(de&&(Tt||Lt)&&Jt==="axis"){for(var ve=Pt.length,oe=0;oe<ve;oe++)if(Wt=Pt[oe],ge[Wt]){Mt=f.getFromId(Y,Wt,"x"),te=f.getFromId(Y,Wt,"y");var Te=(Tt?Mt:te)._subplotsWith;if(Te&&Te.length)for(var He=0;He<Te.length;He++)S(Pt,Te[He])}}if(he&&Jt!=="single"){var Ge=he.overlays.map(function(Ia){return Ia.id});Pt=Pt.concat(Ge)}for(var cr=Pt.length,ur=new Array(cr),jr=new Array(cr),Hr=!1,br=0;br<cr;br++)if(Wt=Pt[br],ge[Wt])Hr=!0,ur[br]=ge[Wt].xaxis,jr[br]=ge[Wt].yaxis;else if(Ht[Wt]&&Ht[Wt]._subplot){var Kr=Ht[Wt]._subplot;ur[br]=Kr.xaxis,jr[br]=Kr.yaxis}else{P.warn("Unrecognized subplot: "+Wt);return}if(se&&!Hr&&(se="closest"),["x","y","closest","x unified","y unified"].indexOf(se)===-1||!Y.calcdata||Y.querySelector(".zoombox")||Y._dragging)return s.unhoverRaw(Y,ft);var rn=Ht.hoverdistance;rn===-1&&(rn=1/0);var Ce=Ht.spikedistance;Ce===-1&&(Ce=1/0);var $t=[],ne=[],Ct,gt,St,Nt,ee,le,we,Ue,qe,ar,Ar,Tr,pr,Jr={hLinePoint:null,vLinePoint:null},Vn=!1;if(Array.isArray(ft))for(se="array",St=0;St<ft.length;St++)ee=Y.calcdata[ft[St].curveNumber||0],ee&&(le=ee[0].trace,ee[0].trace.hoverinfo!=="skip"&&(ne.push(ee),le.orientation==="h"&&(Vn=!0)));else{var Hn=Y.calcdata.slice();for(Hn.sort(function(Ia,gs){var is=Ia[0].trace.zorder||0,ll=gs[0].trace.zorder||0;return is-ll}),Nt=0;Nt<Hn.length;Nt++)ee=Hn[Nt],le=ee[0].trace,le.hoverinfo!=="skip"&&v.isTraceInSubplots(le,Pt)&&(ne.push(ee),le.orientation==="h"&&(Vn=!0));var Kn=!zt,Ci,ii;if(Kn)"xpx"in ft?Ci=ft.xpx:Ci=ur[0]._length/2,"ypx"in ft?ii=ft.ypx:ii=jr[0]._length/2;else{if(r.triggerHandler(Y,"plotly_beforehover",ft)===!1)return;var qn=zt.getBoundingClientRect();Ci=ft.clientX-qn.left,ii=ft.clientY-qn.top,Ht._calcInverseTransform(Y);var oa=P.apply3DTransform(Ht._invTransform)(Ci,ii);if(Ci=oa[0],ii=oa[1],Ci<0||Ci>ur[0]._length||ii<0||ii>jr[0]._length)return s.unhoverRaw(Y,ft)}if(ft.pointerX=Ci+ur[0]._offset,ft.pointerY=ii+jr[0]._offset,"xval"in ft?Ct=v.flat(Pt,ft.xval):Ct=v.p2c(ur,Ci),"yval"in ft?gt=v.flat(Pt,ft.yval):gt=v.p2c(jr,ii),!c(Ct[0])||!c(gt[0]))return P.warn("Fx.hover failed",ft,Y),s.unhoverRaw(Y,ft)}var Hi=1/0;function We(Ia,gs){for(Nt=0;Nt<ne.length;Nt++)if(ee=ne[Nt],!(!ee||!ee[0]||!ee[0].trace)&&(le=ee[0].trace,!(le.visible!==!0||le._length===0)&&["carpet","contourcarpet"].indexOf(le._module.name)===-1)){if(qe=se,v.isUnifiedHover(qe)&&(qe=qe.charAt(0)),le.type==="splom"?(Ue=0,we=Pt[Ue]):(we=v.getSubplot(le),Ue=Pt.indexOf(we)),Tr={cd:ee,trace:le,xa:ur[Ue],ya:jr[Ue],maxHoverDistance:rn,maxSpikeDistance:Ce,index:!1,distance:Math.min(Hi,rn),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:i.defaultLine,name:le.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},Ht[we]&&(Tr.subplot=Ht[we]._subplot),Ht._splomScenes&&Ht._splomScenes[le.uid]&&(Tr.scene=Ht._splomScenes[le.uid]),qe==="array"){var is=ft[Nt];"pointNumber"in is?(Tr.index=is.pointNumber,qe="closest"):(qe="","xval"in is&&(ar=is.xval,qe="x"),"yval"in is&&(Ar=is.yval,qe=qe?"closest":"y"))}else Ia!==void 0&&gs!==void 0?(ar=Ia,Ar=gs):(ar=Ct[Ue],Ar=gt[Ue]);if(pr=$t.length,rn!==0)if(le._module&&le._module.hoverPoints){var ll=le._module.hoverPoints(Tr,ar,Ar,qe,{finiteRange:!0,hoverLayer:Ht._hoverlayer,hoversubplots:Jt,gd:Y});if(ll)for(var Ho,Gs=0;Gs<ll.length;Gs++)Ho=ll[Gs],c(Ho.x0)&&c(Ho.y0)&&$t.push(lt(Ho,se))}else P.log("Unrecognized trace type in hover:",le);if(se==="closest"&&$t.length>pr&&($t.splice(0,pr),Hi=$t[0].distance),de&&Ce!==0&&$t.length===0){Tr.distance=Ce,Tr.index=!1;var as=le._module.hoverPoints(Tr,ar,Ar,"closest",{hoverLayer:Ht._hoverlayer});if(as&&(as=as.filter(function(Co){return Co.spikeDistance<=Ce})),as&&as.length){var ul,Js=as.filter(function(Co){return Co.xa.showspikes&&Co.xa.spikesnap!=="hovered data"});if(Js.length){var Rl=Js[0];c(Rl.x0)&&c(Rl.y0)&&(ul=fr(Rl),(!Jr.vLinePoint||Jr.vLinePoint.spikeDistance>ul.spikeDistance)&&(Jr.vLinePoint=ul))}var ls=as.filter(function(Co){return Co.ya.showspikes&&Co.ya.spikesnap!=="hovered data"});if(ls.length){var Cs=ls[0];c(Cs.x0)&&c(Cs.y0)&&(ul=fr(Cs),(!Jr.hLinePoint||Jr.hLinePoint.spikeDistance>ul.spikeDistance)&&(Jr.hLinePoint=ul))}}}}}We();function rr(Ia,gs,is){for(var ll=null,Ho=1/0,Gs,as=0;as<Ia.length;as++)Mt&&Mt._id!==Ia[as].xa._id||te&&te._id!==Ia[as].ya._id||(Gs=Ia[as].spikeDistance,is&&as===0&&(Gs=-1/0),Gs<=Ho&&Gs<=gs&&(ll=Ia[as],Ho=Gs));return ll}function fr(Ia){return Ia?{xa:Ia.xa,ya:Ia.ya,x:Ia.xSpike!==void 0?Ia.xSpike:(Ia.x0+Ia.x1)/2,y:Ia.ySpike!==void 0?Ia.ySpike:(Ia.y0+Ia.y1)/2,distance:Ia.distance,spikeDistance:Ia.spikeDistance,curveNumber:Ia.trace.index,color:Ia.color,pointNumber:Ia.index}:null}var xr={fullLayout:Ht,container:Ht._hoverlayer,event:ft};Y._spikepoints;var Qr={vLinePoint:Jr.vLinePoint,hLinePoint:Jr.hLinePoint};Y._spikepoints=Qr;var Cn=function(){var Ia=$t.filter(function(is){return Mt&&Mt._id===is.xa._id&&te&&te._id===is.ya._id}),gs=$t.filter(function(is){return!(Mt&&Mt._id===is.xa._id&&te&&te._id===is.ya._id)});Ia.sort(R),gs.sort(R),$t=Ia.concat(gs),$t=dt($t,se)};Cn();var wn=se.charAt(0),Mn=(wn==="x"||wn==="y")&&$t[0]&&w[$t[0].trace.type];if(de&&Ce!==0&&$t.length!==0){var ci=$t.filter(function(Ia){return Ia.ya.showspikes}),xi=rr(ci,Ce,Mn);Jr.hLinePoint=fr(xi);var Pi=$t.filter(function(Ia){return Ia.xa.showspikes}),Di=rr(Pi,Ce,Mn);Jr.vLinePoint=fr(Di)}if($t.length===0){var Zi=s.unhoverRaw(Y,ft);return de&&(Jr.hLinePoint!==null||Jr.vLinePoint!==null)&&st()&&yt(Y,Jr,xr),Zi}if(de&&st()&&yt(Y,Jr,xr),v.isXYhover(qe)&&$t[0].length!==0&&$t[0].trace.type!=="splom"){var ui=$t[0];k[ui.trace.type]?$t=$t.filter(Ia=>Ia.trace.index===ui.trace.index):$t=[ui];var Pa=$t.length,Wa=rt("x",ui,Ht),ze=rt("y",ui,Ht);We(Wa,ze);var Pe=[],Rr={},qr=0,$r=function(Ia){var gs=k[Ia.trace.type]?N(Ia):Ia.trace.index;if(!Rr[gs])qr++,Rr[gs]=qr,Pe.push(Ia);else{var is=Rr[gs]-1,ll=Pe[is];is>0&&Math.abs(Ia.distance)<Math.abs(ll.distance)&&(Pe[is]=Ia)}},Br;for(Br=0;Br<Pa;Br++)$r($t[Br]);for(Br=$t.length-1;Br>Pa-1;Br--)$r($t[Br]);$t=Pe,Cn()}var Gr=Y._hoverdata,dn=[],an=at(Y),Ee=vt(Y);for(let Ia of $t){var dr=v.makeEventData(Ia,Ia.trace,Ia.cd);if(Ia.hovertemplate!==!1){var Vr=!1;Ia.cd[Ia.index]&&Ia.cd[Ia.index].ht&&(Vr=Ia.cd[Ia.index].ht),Ia.hovertemplate=Vr||Ia.trace.hovertemplate||!1}if(Ia.xa&&Ia.ya){var yn=Ia.x0+Ia.xa._offset,Fn=Ia.x1+Ia.xa._offset,Xn=Ia.y0+Ia.ya._offset,Pn=Ia.y1+Ia.ya._offset,En=Math.min(yn,Fn),Zn=Math.max(yn,Fn),Ca=Math.min(Xn,Pn),Ri=Math.max(Xn,Pn);dr.bbox={x0:En+Ee,x1:Zn+Ee,y0:Ca+an,y1:Ri+an}}Ia.eventData=[dr],dn.push(dr)}Y._hoverdata=dn;var Ja=se==="y"&&(ne.length>1||$t.length>1)||se==="closest"&&Vn&&$t.length>1,Xa=i.combine(Ht.plot_bgcolor||i.background,Ht.paper_bgcolor),Io=H($t,{gd:Y,hovermode:se,rotateLabels:Ja,bgColor:Xa,container:Ht._hoverlayer,outerContainer:Ht._paper.node(),commonLabelOpts:Ht.hoverlabel,hoverdistance:Ht.hoverdistance}),po=Io.hoverLabels;if(v.isUnifiedHover(se)||(U(po,Ja,Ht,Io.commonLabelBoundingBox),X(po,Ja,Ht._invScaleX,Ht._invScaleY)),zt&&zt.tagName){var Do=y.getComponentMethod("annotations","hasClickToShow")(Y,dn);n($.select(zt),Do?"pointer":"")}!zt||wt||!pt(Y,ft,Gr)||(Gr&&Y.emit("plotly_unhover",{event:ft,points:Gr}),Y.emit("plotly_hover",{event:ft,points:Y._hoverdata,xaxes:ur,yaxes:jr,xvals:Ct,yvals:gt}))}function N(Y){return[Y.trace.index,Y.index,Y.x0,Y.y0,Y.name,Y.attr,Y.xa?Y.xa._id:"",Y.ya?Y.ya._id:""].join(",")}var V=/<extra>([\s\S]*)<\/extra>/;function H(Y,ft){var ut=ft.gd,wt=ut._fullLayout,zt=ft.hovermode,Pt=ft.rotateLabels,Wt=ft.bgColor,Ht=ft.container,Jt=ft.outerContainer,ge=ft.commonLabelOpts||{};if(Y.length===0)return[[]];var he=ft.fontFamily||T.HOVERFONT,de=ft.fontSize||T.HOVERFONTSIZE,se=ft.fontWeight||wt.font.weight,Tt=ft.fontStyle||wt.font.style,Lt=ft.fontVariant||wt.font.variant,Mt=ft.fontTextcase||wt.font.textcase,te=ft.fontLineposition||wt.font.lineposition,ve=ft.fontShadow||wt.font.shadow,oe=Y[0],Te=oe.xa,He=oe.ya,Ge=zt.charAt(0),cr=Ge+"Label",ur=oe[cr];if(ur===void 0&&Te.type==="multicategory")for(var jr=0;jr<Y.length&&(ur=Y[jr][cr],ur===void 0);jr++);var Hr=it(ut,Jt),br=Hr.top,Kr=Hr.width,rn=Hr.height,Ce=ur!==void 0&&oe.distance<=ft.hoverdistance&&(zt==="x"||zt==="y");if(Ce){var $t=!0,ne,Ct;for(ne=0;ne<Y.length;ne++)if($t&&Y[ne].zLabel===void 0&&($t=!1),Ct=Y[ne].hoverinfo||Y[ne].trace.hoverinfo,Ct){var gt=Array.isArray(Ct)?Ct:Ct.split("+");if(gt.indexOf("all")===-1&&gt.indexOf(zt)===-1){Ce=!1;break}}$t&&(Ce=!1)}var St=Ht.selectAll("g.axistext").data(Ce?[0]:[]);St.enter().append("g").classed("axistext",!0),St.exit().remove();var Nt={minX:0,maxX:0,minY:0,maxY:0};if(St.each(function(){var ui=$.select(this),Pa=P.ensureSingle(ui,"path","",function(Ja){Ja.style({"stroke-width":"1px"})}),Wa=P.ensureSingle(ui,"text","",function(Ja){Ja.attr("data-notex",1)}),ze=ge.bgcolor||i.defaultLine,Pe=ge.bordercolor||i.contrast(ze),Rr=i.contrast(ze),qr=ge.font,$r={weight:qr.weight||se,style:qr.style||Tt,variant:qr.variant||Lt,textcase:qr.textcase||Mt,lineposition:qr.lineposition||te,shadow:qr.shadow||ve,family:qr.family||he,size:qr.size||de,color:qr.color||Rr};Pa.style({fill:ze,stroke:Pe}),Wa.text(ur).call(o.font,$r).call(a.positionText,0,0).call(a.convertToTspans,ut),ui.attr("transform","");var Br=it(ut,Wa.node()),Gr,dn;if(zt==="x"){var an=Te.side==="top"?"-":"";Wa.attr("text-anchor","middle").call(a.positionText,0,Te.side==="top"?br-Br.bottom-h-p:br-Br.top+h+p),Gr=Te._offset+(oe.x0+oe.x1)/2,dn=He._offset+(Te.side==="top"?0:He._length);var Ee=Br.width/2+p,dr=Gr;Gr<Ee?dr=Ee:Gr>wt.width-Ee&&(dr=wt.width-Ee),Pa.attr("d","M"+(Gr-dr)+",0L"+(Gr-dr+h)+","+an+h+"H"+Ee+"v"+an+(p*2+Br.height)+"H"+-Ee+"V"+an+h+"H"+(Gr-dr-h)+"Z"),Gr=dr,Nt.minX=Gr-Ee,Nt.maxX=Gr+Ee,Te.side==="top"?(Nt.minY=dn-(p*2+Br.height),Nt.maxY=dn-p):(Nt.minY=dn+p,Nt.maxY=dn+(p*2+Br.height))}else{var Vr,yn,Fn;He.side==="right"?(Vr="start",yn=1,Fn="",Gr=Te._offset+Te._length):(Vr="end",yn=-1,Fn="-",Gr=Te._offset),dn=He._offset+(oe.y0+oe.y1)/2,Wa.attr("text-anchor",Vr),Pa.attr("d","M0,0L"+Fn+h+","+h+"V"+(p+Br.height/2)+"h"+Fn+(p*2+Br.width)+"V-"+(p+Br.height/2)+"H"+Fn+h+"V-"+h+"Z"),Nt.minY=dn-(p+Br.height/2),Nt.maxY=dn+(p+Br.height/2),He.side==="right"?(Nt.minX=Gr+h,Nt.maxX=Gr+h+(p*2+Br.width)):(Nt.minX=Gr-h-(p*2+Br.width),Nt.maxX=Gr-h);var Xn=Br.height/2,Pn=br-Br.top-Xn,En="clip"+wt._uid+"commonlabel"+He._id,Zn;if(Gr<Br.width+2*p+h){Zn="M-"+(h+p)+"-"+Xn+"h-"+(Br.width-p)+"V"+Xn+"h"+(Br.width-p)+"Z";var Ca=Br.width-Gr+p;a.positionText(Wa,Ca,Pn),Vr==="end"&&Wa.selectAll("tspan").each(function(){var Ja=$.select(this),Xa=o.tester.append("text").text(Ja.text()).call(o.font,$r),Io=it(ut,Xa.node());Math.round(Io.width)<Math.round(Br.width)&&Ja.attr("x",Ca-Io.width),Xa.remove()})}else a.positionText(Wa,yn*(p+h),Pn),Zn=null;var Ri=wt._topclips.selectAll("#"+En).data(Zn?[0]:[]);Ri.enter().append("clipPath").attr("id",En).append("path"),Ri.exit().remove(),Ri.select("path").attr("d",Zn),o.setClipUrl(Wa,Zn?En:null,ut)}ui.attr("transform",t(Gr,dn))}),v.isUnifiedHover(zt)){Ht.selectAll("g.hovertext").remove();let ui=Y.filter(Pa=>Pa.hoverinfo!=="none");if(ui.length===0)return[];var ee=wt.hoverlabel,le=ee.font,we=ui[0],Ue=((zt==="x unified"?we.xa:we.ya).unifiedhovertitle||{}).text,qe=Ue?P.hovertemplateString({data:zt==="x unified"?[{xa:we.xa,x:we.xVal}]:[{ya:we.ya,y:we.yVal}],fallback:we.trace.hovertemplatefallback,locale:wt._d3locale,template:Ue}):ur,ar={showlegend:!0,legend:{title:{text:qe,font:le},font:le,bgcolor:ee.bgcolor,bordercolor:ee.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:wt.legend?wt.legend.traceorder:void 0,orientation:"v"}},Ar={font:le};u(ar,Ar,ut._fullData);var Tr=Ar.legend;Tr.entries=[];for(var pr=0;pr<ui.length;pr++){var Jr=ui[pr];if(Jr.hoverinfo!=="none"){var Vn=F(Jr,!0,zt,wt,ur),Hn=Vn[0],Kn=Vn[1];Jr.name=Kn,Kn!==""?Jr.text=Kn+" : "+Hn:Jr.text=Hn;var Ci=Jr.cd[Jr.index];Ci&&(Ci.mc&&(Jr.mc=Ci.mc),Ci.mcc&&(Jr.mc=Ci.mcc),Ci.mlc&&(Jr.mlc=Ci.mlc),Ci.mlcc&&(Jr.mlc=Ci.mlcc),Ci.mlw&&(Jr.mlw=Ci.mlw),Ci.mrc&&(Jr.mrc=Ci.mrc),Ci.dir&&(Jr.dir=Ci.dir)),Jr._distinct=!0,Tr.entries.push([Jr])}}Tr.entries.sort(function(Pa,Wa){return Pa[0].trace.index-Wa[0].trace.index}),Tr.layer=Ht,Tr._inHover=!0,Tr._groupTitleFont=ee.grouptitlefont,b(ut,Tr);var ii=Ht.select("g.legend"),qn=it(ut,ii.node()),oa=qn.width+2*p,Hi=qn.height+2*p,We=ui[0],rr=(We.x0+We.x1)/2,fr=(We.y0+We.y1)/2,xr=!(y.traceIs(We.trace,"bar-like")||y.traceIs(We.trace,"box-violin")),Qr,Cn;Ge==="y"?xr?(Cn=fr-p,Qr=fr+p):(Cn=Math.min.apply(null,ui.map(function(Pa){return Math.min(Pa.y0,Pa.y1)})),Qr=Math.max.apply(null,ui.map(function(Pa){return Math.max(Pa.y0,Pa.y1)}))):Cn=Qr=P.mean(ui.map(function(Pa){return(Pa.y0+Pa.y1)/2}))-Hi/2;var wn,Mn;Ge==="x"?xr?(wn=rr+p,Mn=rr-p):(wn=Math.max.apply(null,ui.map(function(Pa){return Math.max(Pa.x0,Pa.x1)})),Mn=Math.min.apply(null,ui.map(function(Pa){return Math.min(Pa.x0,Pa.x1)}))):wn=Mn=P.mean(ui.map(function(Pa){return(Pa.x0+Pa.x1)/2}))-oa/2;var ci=Te._offset,xi=He._offset;Qr+=xi,wn+=ci,Mn+=ci-oa,Cn+=xi-Hi;var Pi,Di;return wn+oa<Kr&&wn>=0?Pi=wn:Mn+oa<Kr&&Mn>=0?Pi=Mn:ci+oa<Kr?Pi=ci:wn-rr<rr-Mn+oa?Pi=Kr-oa:Pi=0,Pi+=p,Qr+Hi<rn&&Qr>=0?Di=Qr:Cn+Hi<rn&&Cn>=0?Di=Cn:xi+Hi<rn?Di=xi:Qr-fr<fr-Cn+Hi?Di=rn-Hi:Di=0,Di+=p,ii.attr("transform",t(Pi-1,Di-1)),ii}var Zi=Ht.selectAll("g.hovertext").data(Y,function(ui){return N(ui)});return Zi.enter().append("g").classed("hovertext",!0).each(function(){var ui=$.select(this);ui.append("rect").call(i.fill,i.addOpacity(Wt,.8)),ui.append("text").classed("name",!0),ui.append("path").style("stroke-width","1px"),ui.append("text").classed("nums",!0).call(o.font,{weight:se,style:Tt,variant:Lt,textcase:Mt,lineposition:te,shadow:ve,family:he,size:de})}),Zi.exit().remove(),Zi.each(function(ui){var Pa=$.select(this).attr("transform",""),Wa=ui.color;Array.isArray(Wa)&&(Wa=Wa[ui.eventData[0].pointNumber]);var ze=ui.bgcolor||Wa,Pe=i.combine(i.opacity(ze)?ze:i.defaultLine,Wt),Rr=i.combine(i.opacity(Wa)?Wa:i.defaultLine,Wt),qr=ui.borderColor||i.contrast(Pe),$r=F(ui,Ce,zt,wt,ur,Pa),Br=$r[0],Gr=$r[1],dn=Pa.select("text.nums").call(o.font,{family:ui.fontFamily||he,size:ui.fontSize||de,color:ui.fontColor||qr,weight:ui.fontWeight||se,style:ui.fontStyle||Tt,variant:ui.fontVariant||Lt,textcase:ui.fontTextcase||Mt,lineposition:ui.fontLineposition||te,shadow:ui.fontShadow||ve}).text(Br).attr("data-notex",1).call(a.positionText,0,0).call(a.convertToTspans,ut),an=Pa.select("text.name"),Ee=0,dr=0;if(Gr&&Gr!==Br){an.call(o.font,{family:ui.fontFamily||he,size:ui.fontSize||de,color:Rr,weight:ui.fontWeight||se,style:ui.fontStyle||Tt,variant:ui.fontVariant||Lt,textcase:ui.fontTextcase||Mt,lineposition:ui.fontLineposition||te,shadow:ui.fontShadow||ve}).text(Gr).attr("data-notex",1).call(a.positionText,0,0).call(a.convertToTspans,ut);var Vr=it(ut,an.node());Ee=Vr.width+2*p,dr=Vr.height+2*p}else an.remove(),Pa.select("rect").remove();Pa.select("path").style({fill:Pe,stroke:qr});var yn=ui.xa._offset+(ui.x0+ui.x1)/2,Fn=ui.ya._offset+(ui.y0+ui.y1)/2,Xn=Math.abs(ui.x1-ui.x0),Pn=Math.abs(ui.y1-ui.y0),En=it(ut,dn.node()),Zn=En.width/wt._invScaleX,Ca=En.height/wt._invScaleY;ui.ty0=(br-En.top)/wt._invScaleY,ui.bx=Zn+2*p,ui.by=Math.max(Ca+2*p,dr),ui.anchor="start",ui.txwidth=Zn,ui.tx2width=Ee,ui.offset=0;var Ri=(Zn+h+p+Ee)*wt._invScaleX,Ja,Xa;if(Pt)ui.pos=yn,Ja=Fn+Pn/2+Ri<=rn,Xa=Fn-Pn/2-Ri>=0,(ui.idealAlign==="top"||!Ja)&&Xa?(Fn-=Pn/2,ui.anchor="end"):Ja?(Fn+=Pn/2,ui.anchor="start"):ui.anchor="middle",ui.crossPos=Fn;else{if(ui.pos=Fn,Ja=yn+Xn/2+Ri<=Kr,Xa=yn-Xn/2-Ri>=0,(ui.idealAlign==="left"||!Ja)&&Xa)yn-=Xn/2,ui.anchor="end";else if(Ja)yn+=Xn/2,ui.anchor="start";else{ui.anchor="middle";var Io=Ri/2,po=yn+Io-Kr,Do=yn-Io;po>0&&(yn-=po),Do<0&&(yn+=-Do)}ui.crossPos=yn}dn.attr("text-anchor",ui.anchor),Ee&&an.attr("text-anchor",ui.anchor),Pa.attr("transform",t(yn,Fn)+(Pt?e(_):""))}),{hoverLabels:Zi,commonLabelBoundingBox:Nt}}function F(Y,ft,ut,wt,zt,Pt){var Wt="",Ht="";Y.nameOverride!==void 0&&(Y.name=Y.nameOverride),Y.name&&(Y.trace._meta&&(Y.name=P.templateString(Y.name,Y.trace._meta)),Wt=tt(Y.name,Y.nameLength));var Jt=ut.charAt(0),ge=Jt==="x"?"y":"x";Y.zLabel!==void 0?(Y.xLabel!==void 0&&(Ht+="x: "+Y.xLabel+"<br>"),Y.yLabel!==void 0&&(Ht+="y: "+Y.yLabel+"<br>"),Y.trace.type!=="choropleth"&&Y.trace.type!=="choroplethmapbox"&&Y.trace.type!=="choroplethmap"&&(Ht+=(Ht?"z: ":"")+Y.zLabel)):ft&&Y[Jt+"Label"]===zt?Ht=Y[ge+"Label"]||"":Y.xLabel===void 0?Y.yLabel!==void 0&&Y.trace.type!=="scattercarpet"&&(Ht=Y.yLabel):Y.yLabel===void 0?Ht=Y.xLabel:Ht="("+Y.xLabel+", "+Y.yLabel+")",(Y.text||Y.text===0)&&!Array.isArray(Y.text)&&(Ht+=(Ht?"<br>":"")+Y.text),Y.extraText!==void 0&&(Ht+=(Ht?"<br>":"")+Y.extraText),Pt&&Ht===""&&!Y.hovertemplate&&(Wt===""&&Pt.remove(),Ht=Wt);let{hovertemplate:he=!1}=Y;if(he){let de=Y.hovertemplateLabels||Y;Y[Jt+"Label"]!==zt&&(de[Jt+"other"]=de[Jt+"Val"],de[Jt+"otherLabel"]=de[Jt+"Label"]),Ht=P.hovertemplateString({data:[Y.eventData[0]||{},Y.trace._meta],fallback:Y.trace.hovertemplatefallback,labels:de,locale:wt._d3locale,template:he}),Ht=Ht.replace(V,(se,Tt)=>(Wt=tt(Tt,Y.nameLength),""))}return[Ht,Wt]}function U(Y,ft,ut,wt){var zt=ft?"xa":"ya",Pt=ft?"ya":"xa",Wt=0,Ht=1,Jt=Y.size(),ge=new Array(Jt),he=0,de=wt.minX,se=wt.maxX,Tt=wt.minY,Lt=wt.maxY,Mt=function(Ct){return Ct*ut._invScaleX},te=function(Ct){return Ct*ut._invScaleY};Y.each(function(Ct){var gt=Ct[zt],St=Ct[Pt],Nt=gt._id.charAt(0)==="x",ee=gt.range;he===0&&ee&&ee[0]>ee[1]!==Nt&&(Ht=-1);var le=0,we=Nt?ut.width:ut.height;if(ut.hovermode==="x"||ut.hovermode==="y"){var Ue=W(Ct,ft),qe=Ct.anchor,ar=qe==="end"?-1:1,Ar,Tr;if(qe==="middle")Ar=Ct.crossPos+(Nt?te(Ue.y-Ct.by/2):Mt(Ct.bx/2+Ct.tx2width/2)),Tr=Ar+(Nt?te(Ct.by):Mt(Ct.bx));else if(Nt)Ar=Ct.crossPos+te(h+Ue.y)-te(Ct.by/2-h),Tr=Ar+te(Ct.by);else{var pr=Mt(ar*h+Ue.x),Jr=pr+Mt(ar*Ct.bx);Ar=Ct.crossPos+Math.min(pr,Jr),Tr=Ct.crossPos+Math.max(pr,Jr)}Nt?Tt!==void 0&&Lt!==void 0&&Math.min(Tr,Lt)-Math.max(Ar,Tt)>1&&(St.side==="left"?(le=St._mainLinePosition,we=ut.width):we=St._mainLinePosition):de!==void 0&&se!==void 0&&Math.min(Tr,se)-Math.max(Ar,de)>1&&(St.side==="top"?(le=St._mainLinePosition,we=ut.height):we=St._mainLinePosition)}ge[he++]=[{datum:Ct,traceIndex:Ct.trace.index,dp:0,pos:Ct.pos,posref:Ct.posref,size:Ct.by*(Nt?M:1)/2,pmin:le,pmax:we}]}),ge.sort(function(Ct,gt){return Ct[0].posref-gt[0].posref||Ht*(gt[0].traceIndex-Ct[0].traceIndex)});var ve,oe,Te,He,Ge,cr,ur;function jr(Ct){var gt=Ct[0],St=Ct[Ct.length-1];if(oe=gt.pmin-gt.pos-gt.dp+gt.size,Te=St.pos+St.dp+St.size-gt.pmax,oe>.01){for(Ge=Ct.length-1;Ge>=0;Ge--)Ct[Ge].dp+=oe;ve=!1}if(!(Te<.01)){if(oe<-.01){for(Ge=Ct.length-1;Ge>=0;Ge--)Ct[Ge].dp-=Te;ve=!1}if(ve){var Nt=0;for(He=0;He<Ct.length;He++)cr=Ct[He],cr.pos+cr.dp+cr.size>gt.pmax&&Nt++;for(He=Ct.length-1;He>=0&&!(Nt<=0);He--)cr=Ct[He],cr.pos>gt.pmax-1&&(cr.del=!0,Nt--);for(He=0;He<Ct.length&&!(Nt<=0);He++)if(cr=Ct[He],cr.pos<gt.pmin+1)for(cr.del=!0,Nt--,Te=cr.size*2,Ge=Ct.length-1;Ge>=0;Ge--)Ct[Ge].dp-=Te;for(He=Ct.length-1;He>=0&&!(Nt<=0);He--)cr=Ct[He],cr.pos+cr.dp+cr.size>gt.pmax&&(cr.del=!0,Nt--)}}}for(;!ve&&Wt<=Jt;){for(Wt++,ve=!0,He=0;He<ge.length-1;){var Hr=ge[He],br=ge[He+1],Kr=Hr[Hr.length-1],rn=br[0];if(oe=Kr.pos+Kr.dp+Kr.size-rn.pos-rn.dp+rn.size,oe>.01){for(Ge=br.length-1;Ge>=0;Ge--)br[Ge].dp+=oe;for(Hr.push.apply(Hr,br),ge.splice(He+1,1),ur=0,Ge=Hr.length-1;Ge>=0;Ge--)ur+=Hr[Ge].dp;for(Te=ur/Hr.length,Ge=Hr.length-1;Ge>=0;Ge--)Hr[Ge].dp-=Te;ve=!1}else He++}ge.forEach(jr)}for(He=ge.length-1;He>=0;He--){var Ce=ge[He];for(Ge=Ce.length-1;Ge>=0;Ge--){var $t=Ce[Ge],ne=$t.datum;ne.offset=$t.dp,ne.del=$t.del}}}function W(Y,ft){var ut=0,wt=Y.offset;return ft&&(wt*=-A,ut=Y.offset*E),{x:ut,y:wt}}function q(Y){var ft={start:1,end:-1,middle:0}[Y.anchor],ut=ft*(h+p),wt=ut+ft*(Y.txwidth+p),zt=Y.anchor==="middle";return zt&&(ut-=Y.tx2width/2,wt+=Y.txwidth/2+p),{alignShift:ft,textShiftX:ut,text2ShiftX:wt}}function X(Y,ft,ut,wt){var zt=function(Wt){return Wt*ut},Pt=function(Wt){return Wt*wt};Y.each(function(Wt){var Ht=$.select(this);if(Wt.del)return Ht.remove();var Jt=Ht.select("text.nums"),ge=Wt.anchor,he=ge==="end"?-1:1,de=q(Wt),se=W(Wt,ft),Tt=se.x,Lt=se.y,Mt=ge==="middle",te="hoverlabel"in Wt.trace?Wt.trace.hoverlabel.showarrow:!0,ve;Mt?ve="M-"+zt(Wt.bx/2+Wt.tx2width/2)+","+Pt(Lt-Wt.by/2)+"h"+zt(Wt.bx)+"v"+Pt(Wt.by)+"h-"+zt(Wt.bx)+"Z":te?ve="M0,0L"+zt(he*h+Tt)+","+Pt(h+Lt)+"v"+Pt(Wt.by/2-h)+"h"+zt(he*Wt.bx)+"v-"+Pt(Wt.by)+"H"+zt(he*h+Tt)+"V"+Pt(Lt-h)+"Z":ve="M"+zt(he*h+Tt)+","+Pt(Lt-Wt.by/2)+"h"+zt(he*Wt.bx)+"v"+Pt(Wt.by)+"h"+zt(-he*Wt.bx)+"Z",Ht.select("path").attr("d",ve);var oe=Tt+de.textShiftX,Te=Lt+Wt.ty0-Wt.by/2+p,He=Wt.textAlign||"auto";He!=="auto"&&(He==="left"&&ge!=="start"?(Jt.attr("text-anchor","start"),oe=Mt?-Wt.bx/2-Wt.tx2width/2+p:-Wt.bx-p):He==="right"&&ge!=="end"&&(Jt.attr("text-anchor","end"),oe=Mt?Wt.bx/2-Wt.tx2width/2-p:Wt.bx+p)),Jt.call(a.positionText,zt(oe),Pt(Te)),Wt.tx2width&&(Ht.select("text.name").call(a.positionText,zt(de.text2ShiftX+de.alignShift*p+Tt),Pt(Lt+Wt.ty0-Wt.by/2+p)),Ht.select("rect").call(o.setRect,zt(de.text2ShiftX+(de.alignShift-1)*Wt.tx2width/2+Tt),Pt(Lt-Wt.by/2-1),zt(Wt.tx2width),Pt(Wt.by+2)))})}function lt(Y,ft){var ut=Y.index,wt=Y.trace||{},zt=Y.cd[0],Pt=Y.cd[ut]||{};function Wt(se){return se||c(se)&&se===0}var Ht=Array.isArray(ut)?function(se,Tt){var Lt=P.castOption(zt,ut,se);return Wt(Lt)?Lt:P.extractOption({},wt,"",Tt)}:function(se,Tt){return P.extractOption(Pt,wt,se,Tt)};function Jt(se,Tt,Lt){var Mt=Ht(Tt,Lt);Wt(Mt)&&(Y[se]=Mt)}if(Jt("hoverinfo","hi","hoverinfo"),Jt("bgcolor","hbg","hoverlabel.bgcolor"),Jt("borderColor","hbc","hoverlabel.bordercolor"),Jt("fontFamily","htf","hoverlabel.font.family"),Jt("fontSize","hts","hoverlabel.font.size"),Jt("fontColor","htc","hoverlabel.font.color"),Jt("fontWeight","htw","hoverlabel.font.weight"),Jt("fontStyle","hty","hoverlabel.font.style"),Jt("fontVariant","htv","hoverlabel.font.variant"),Jt("nameLength","hnl","hoverlabel.namelength"),Jt("textAlign","hta","hoverlabel.align"),Y.posref=ft==="y"||ft==="closest"&&wt.orientation==="h"?Y.xa._offset+(Y.x0+Y.x1)/2:Y.ya._offset+(Y.y0+Y.y1)/2,Y.x0=P.constrain(Y.x0,0,Y.xa._length),Y.x1=P.constrain(Y.x1,0,Y.xa._length),Y.y0=P.constrain(Y.y0,0,Y.ya._length),Y.y1=P.constrain(Y.y1,0,Y.ya._length),Y.xLabelVal!==void 0&&(Y.xLabel="xLabel"in Y?Y.xLabel:f.hoverLabelText(Y.xa,Y.xLabelVal,wt.xhoverformat),Y.xVal=Y.xa.c2d(Y.xLabelVal)),Y.yLabelVal!==void 0&&(Y.yLabel="yLabel"in Y?Y.yLabel:f.hoverLabelText(Y.ya,Y.yLabelVal,wt.yhoverformat),Y.yVal=Y.ya.c2d(Y.yLabelVal)),Y.zLabelVal!==void 0&&Y.zLabel===void 0&&(Y.zLabel=String(Y.zLabelVal)),!isNaN(Y.xerr)&&!(Y.xa.type==="log"&&Y.xerr<=0)){var ge=f.tickText(Y.xa,Y.xa.c2l(Y.xerr),"hover").text;Y.xerrneg!==void 0?Y.xLabel+=" +"+ge+" / -"+f.tickText(Y.xa,Y.xa.c2l(Y.xerrneg),"hover").text:Y.xLabel+=" ± "+ge,ft==="x"&&(Y.distance+=1)}if(!isNaN(Y.yerr)&&!(Y.ya.type==="log"&&Y.yerr<=0)){var he=f.tickText(Y.ya,Y.ya.c2l(Y.yerr),"hover").text;Y.yerrneg!==void 0?Y.yLabel+=" +"+he+" / -"+f.tickText(Y.ya,Y.ya.c2l(Y.yerrneg),"hover").text:Y.yLabel+=" ± "+he,ft==="y"&&(Y.distance+=1)}var de=Y.hoverinfo||Y.trace.hoverinfo;return de&&de!=="all"&&(de=Array.isArray(de)?de:de.split("+"),de.indexOf("x")===-1&&(Y.xLabel=void 0),de.indexOf("y")===-1&&(Y.yLabel=void 0),de.indexOf("z")===-1&&(Y.zLabel=void 0),de.indexOf("text")===-1&&(Y.text=void 0),de.indexOf("name")===-1&&(Y.name=void 0)),Y}function yt(Y,ft,ut){var wt=ut.container,zt=ut.fullLayout,Pt=zt._size,Wt=ut.event,Ht=!!ft.hLinePoint,Jt=!!ft.vLinePoint,ge,he;if(wt.selectAll(".spikeline").remove(),!!(Jt||Ht)){var de=i.combine(zt.plot_bgcolor,zt.paper_bgcolor);if(Ht){var se=ft.hLinePoint,Tt,Lt;ge=se&&se.xa,he=se&&se.ya;var Mt=he.spikesnap;Mt==="cursor"?(Tt=Wt.pointerX,Lt=Wt.pointerY):(Tt=ge._offset+se.x,Lt=he._offset+se.y);var te=g.readability(se.color,de)<1.5?i.contrast(de):se.color,ve=he.spikemode,oe=he.spikethickness,Te=he.spikecolor||te,He=f.getPxPosition(Y,he),Ge,cr;if(ve.indexOf("toaxis")!==-1||ve.indexOf("across")!==-1){if(ve.indexOf("toaxis")!==-1&&(Ge=He,cr=Tt),ve.indexOf("across")!==-1){var ur=he._counterDomainMin,jr=he._counterDomainMax;he.anchor==="free"&&(ur=Math.min(ur,he.position),jr=Math.max(jr,he.position)),Ge=Pt.l+ur*Pt.w,cr=Pt.l+jr*Pt.w}wt.insert("line",":first-child").attr({x1:Ge,x2:cr,y1:Lt,y2:Lt,"stroke-width":oe,stroke:Te,"stroke-dasharray":o.dashStyle(he.spikedash,oe)}).classed("spikeline",!0).classed("crisp",!0),wt.insert("line",":first-child").attr({x1:Ge,x2:cr,y1:Lt,y2:Lt,"stroke-width":oe+2,stroke:de}).classed("spikeline",!0).classed("crisp",!0)}ve.indexOf("marker")!==-1&&wt.insert("circle",":first-child").attr({cx:He+(he.side!=="right"?oe:-oe),cy:Lt,r:oe,fill:Te}).classed("spikeline",!0)}if(Jt){var Hr=ft.vLinePoint,br,Kr;ge=Hr&&Hr.xa,he=Hr&&Hr.ya;var rn=ge.spikesnap;rn==="cursor"?(br=Wt.pointerX,Kr=Wt.pointerY):(br=ge._offset+Hr.x,Kr=he._offset+Hr.y);var Ce=g.readability(Hr.color,de)<1.5?i.contrast(de):Hr.color,$t=ge.spikemode,ne=ge.spikethickness,Ct=ge.spikecolor||Ce,gt=f.getPxPosition(Y,ge),St,Nt;if($t.indexOf("toaxis")!==-1||$t.indexOf("across")!==-1){if($t.indexOf("toaxis")!==-1&&(St=gt,Nt=Kr),$t.indexOf("across")!==-1){var ee=ge._counterDomainMin,le=ge._counterDomainMax;ge.anchor==="free"&&(ee=Math.min(ee,ge.position),le=Math.max(le,ge.position)),St=Pt.t+(1-le)*Pt.h,Nt=Pt.t+(1-ee)*Pt.h}wt.insert("line",":first-child").attr({x1:br,x2:br,y1:St,y2:Nt,"stroke-width":ne,stroke:Ct,"stroke-dasharray":o.dashStyle(ge.spikedash,ne)}).classed("spikeline",!0).classed("crisp",!0),wt.insert("line",":first-child").attr({x1:br,x2:br,y1:St,y2:Nt,"stroke-width":ne+2,stroke:de}).classed("spikeline",!0).classed("crisp",!0)}$t.indexOf("marker")!==-1&&wt.insert("circle",":first-child").attr({cx:br,cy:gt-(ge.side!=="top"?ne:-ne),r:ne,fill:Ct}).classed("spikeline",!0)}}}function pt(Y,ft,ut){if(!ut||ut.length!==Y._hoverdata.length)return!0;for(var wt=ut.length-1;wt>=0;wt--){var zt=ut[wt],Pt=Y._hoverdata[wt];if(zt.curveNumber!==Pt.curveNumber||String(zt.pointNumber)!==String(Pt.pointNumber)||String(zt.pointNumbers)!==String(Pt.pointNumbers)||zt.binNumber!==Pt.binNumber)return!0}return!1}function st(Y,ft){return!0}function tt(Y,ft){return a.plainText(Y||"",{len:ft,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function dt(Y,ft){for(var ut=ft.charAt(0),wt=[],zt=[],Pt=[],Wt=0;Wt<Y.length;Wt++){var Ht=Y[Wt];y.traceIs(Ht.trace,"bar-like")||y.traceIs(Ht.trace,"box-violin")?Pt.push(Ht):Ht.trace[ut+"period"]?zt.push(Ht):wt.push(Ht)}return wt.concat(zt).concat(Pt)}function rt(Y,ft,ut){var wt=ft[Y+"a"],zt=ft[Y+"Val"],Pt=ft.cd[0];if(wt.type==="category"||wt.type==="multicategory")zt=wt._categoriesMap[zt];else if(wt.type==="date"){var Wt=ft.trace[Y+"periodalignment"];if(Wt){var Ht=ft.cd[ft.index],Jt=Ht[Y+"Start"];Jt===void 0&&(Jt=Ht[Y]);var ge=Ht[Y+"End"];ge===void 0&&(ge=Ht[Y]);var he=ge-Jt;Wt==="end"?zt+=he:Wt==="middle"&&(zt+=he/2)}zt=wt.d2c(zt)}return Pt&&Pt.t&&Pt.t.posLetter===wt._id&&(ut.boxmode==="group"||ut.violinmode==="group")&&(zt+=Pt.t.dPos),zt}var at=Y=>Y.offsetTop+Y.clientTop,vt=Y=>Y.offsetLeft+Y.clientLeft;function it(Y,ft){var ut=Y._fullLayout,wt=ft.getBoundingClientRect(),zt=wt.left,Pt=wt.top,Wt=zt+wt.width,Ht=Pt+wt.height,Jt=P.apply3DTransform(ut._invTransform)(zt,Pt),ge=P.apply3DTransform(ut._invTransform)(Wt,Ht),he=Jt[0],de=Jt[1],se=ge[0],Tt=ge[1];return{x:he,y:de,width:se-he,height:Tt-de,top:Math.min(de,Tt),left:Math.min(he,se),right:Math.max(he,se),bottom:Math.max(de,Tt)}}}),bg=Ft((Q,$)=>{var c=bn(),g=li(),P=Dp().isUnifiedHover;$.exports=function(S,t,e,r){r=r||{};var a=t.legend;function n(o){r.font[o]||(r.font[o]=a?t.legend.font[o]:t.font[o])}t&&P(t.hovermode)&&(r.font||(r.font={}),n("size"),n("family"),n("color"),n("weight"),n("style"),n("variant"),a?(r.bgcolor||(r.bgcolor=g.combine(t.legend.bgcolor,t.paper_bgcolor)),r.bordercolor||(r.bordercolor=t.legend.bordercolor)):r.bgcolor||(r.bgcolor=t.paper_bgcolor)),e("hoverlabel.bgcolor",r.bgcolor),e("hoverlabel.bordercolor",r.bordercolor),e("hoverlabel.namelength",r.namelength),e("hoverlabel.showarrow",r.showarrow),c.coerceFont(e,"hoverlabel.font",r.font),e("hoverlabel.align",r.align)}}),wg=Ft((Q,$)=>{var c=bn(),g=bg(),P=Ao();$.exports=function(S,t){function e(r,a){return c.coerce(S,t,P,r,a)}g(S,t,e)}}),m6=Ft((Q,$)=>{var c=bn(),g=Ps(),P=bg();$.exports=function(S,t,e,r){function a(o,i){return c.coerce(S,t,g,o,i)}var n=c.extendFlat({},r.hoverlabel);t.hovertemplate&&(n.namelength=-1),P(S,t,a,n)}}),pv=Ft((Q,$)=>{var c=bn(),g=Ao();$.exports=function(P,S){function t(e,r){return S[e]!==void 0?S[e]:c.coerce(P,S,g,e,r)}return t("clickmode"),t("hoversubplots"),t("hovermode")}}),g0=Ft((Q,$)=>{var c=bn(),g=Ao(),P=pv(),S=bg();$.exports=function(t,e){function r(x,y){return c.coerce(t,e,g,x,y)}var a=P(t,e);a&&(r("hoverdistance"),r("spikedistance"));var n=r("dragmode");n==="select"&&r("selectdirection");var o=e._has("mapbox"),i=e._has("map"),s=e._has("geo"),f=e._basePlotModules.length;e.dragmode==="zoom"&&((o||i||s)&&f===1||(o||i)&&s&&f===2)&&(e.dragmode="pan"),S(t,e,r),c.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}}),xw=Ft((Q,$)=>{var c=bn(),g=Xo();$.exports=function(S){var t=S.calcdata,e=S._fullLayout;function r(s){return function(f){return c.coerceHoverinfo({hoverinfo:f},{_module:s._module},e)}}for(var a=0;a<t.length;a++){var n=t[a],o=n[0].trace;if(!g.traceIs(o,"pie-like")){var i=g.traceIs(o,"2dMap")?P:c.fillArray;i(o.hoverinfo,n,"hi",r(o)),o.hovertemplate&&i(o.hovertemplate,n,"ht"),o.hoverlabel&&(i(o.hoverlabel.bgcolor,n,"hbg"),i(o.hoverlabel.bordercolor,n,"hbc"),i(o.hoverlabel.font.size,n,"hts"),i(o.hoverlabel.font.color,n,"htc"),i(o.hoverlabel.font.family,n,"htf"),i(o.hoverlabel.font.weight,n,"htw"),i(o.hoverlabel.font.style,n,"hty"),i(o.hoverlabel.font.variant,n,"htv"),i(o.hoverlabel.namelength,n,"hnl"),i(o.hoverlabel.align,n,"hta"),i(o.hoverlabel.showarrow,n,"htsa"))}}};function P(S,t,e,r){r=r||c.identity,Array.isArray(S)&&(t[0][e]=r(S))}}),_w=Ft((Q,$)=>{var c=Xo(),g=O_().hover;$.exports=function(P,S,t){var e=c.getComponentMethod("annotations","onClick")(P,P._hoverdata);t!==void 0&&g(P,S,t,!0);function r(){P.emit("plotly_click",{points:P._hoverdata,event:S})}P._hoverdata&&S&&S.target&&(e&&e.then?e.then(r):r(),S.stopImmediatePropagation&&S.stopImmediatePropagation())}}),Qh=Ft((Q,$)=>{var c=un(),g=bn(),P=up(),S=Dp(),t=Ao(),e=O_();$.exports={moduleType:"component",name:"fx",constants:go(),schema:{layout:t},attributes:Ps(),layoutAttributes:t,supplyLayoutGlobalDefaults:wg(),supplyDefaults:m6(),supplyLayoutDefaults:g0(),calc:xw(),getDistanceFunction:S.getDistanceFunction,getClosest:S.getClosest,inbox:S.inbox,quadrature:S.quadrature,appendArrayPointValue:S.appendArrayPointValue,castHoverOption:a,castHoverinfo:n,hover:e.hover,unhover:P.unhover,loneHover:e.loneHover,loneUnhover:r,click:_w()};function r(o){var i=g.isD3Selection(o)?o:c.select(o);i.selectAll("g.hovertext").remove(),i.selectAll(".spikeline").remove()}function a(o,i,s){return g.castOption(o,i,"hoverlabel."+s)}function n(o,i,s){function f(x){return g.coerceHoverinfo({hoverinfo:x},{_module:o._module},i)}return g.castOption(o,s,"hoverinfo",f)}}),v0=Ft(Q=>{Q.selectMode=function($){return $==="lasso"||$==="select"},Q.drawMode=function($){return $==="drawclosedpath"||$==="drawopenpath"||$==="drawline"||$==="drawrect"||$==="drawcircle"},Q.openMode=function($){return $==="drawline"||$==="drawopenpath"},Q.rectMode=function($){return $==="select"||$==="drawline"||$==="drawrect"||$==="drawcircle"},Q.freeMode=function($){return $==="lasso"||$==="drawclosedpath"||$==="drawopenpath"},Q.selectingOrDrawing=function($){return Q.freeMode($)||Q.rectMode($)}}),mv=Ft((Q,$)=>{$.exports=function(c){var g=c._fullLayout;g._glcanvas&&g._glcanvas.size()&&g._glcanvas.each(function(P){P.regl&&P.regl.clear({color:!0,depth:!0})})}}),D_=Ft((Q,$)=>{$.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("")}}}),F_=Ft((Q,$)=>{var c=32;$.exports={CIRCLE_SIDES:c,i000:0,i090:c/4,i180:c/2,i270:c/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}),By=Ft((Q,$)=>{var c=bn().strTranslate;function g(e,r){switch(e.type){case"log":return e.p2d(r);case"date":return e.p2r(r,0,e.calendar);default:return e.p2r(r)}}function P(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 S(e){var r=e._id.charAt(0)==="y"?1:0;return function(a){return g(e,a[r])}}function t(e){return c(e.xaxis._offset,e.yaxis._offset)}$.exports={p2r:g,r2p:P,axValue:S,getTransform:t}}),kg=Ft(Q=>{var $=A1(),c=F_(),g=c.CIRCLE_SIDES,P=c.SQRT2,S=By(),t=S.p2r,e=S.r2p,r=[0,3,4,5,6,1,2],a=[0,3,4,1,2];Q.writePaths=function(i){var s=i.length;if(!s)return"M0,0Z";for(var f="",x=0;x<s;x++)for(var y=i[x].length,v=0;v<y;v++){var T=i[x][v][0];if(T==="Z")f+="Z";else for(var u=i[x][v].length,b=0;b<u;b++){var _=b;T==="Q"||T==="S"?_=a[b]:T==="C"&&(_=r[b]),f+=i[x][v][_],b>0&&b<u-1&&(f+=",")}}return f},Q.readPaths=function(i,s,f,x){var y=$(i),v=[],T=-1,u=function(){T++,v[T]=[]},b,_=0,C=0,M,E,A=function(){M=_,E=C};A();for(var h=0;h<y.length;h++){var p=[],k,w,R,O,N=y[h][0],V=N;switch(N){case"M":u(),_=+y[h][1],C=+y[h][2],p.push([V,_,C]),A();break;case"Q":case"S":k=+y[h][1],R=+y[h][2],_=+y[h][3],C=+y[h][4],p.push([V,_,C,k,R]);break;case"C":k=+y[h][1],R=+y[h][2],w=+y[h][3],O=+y[h][4],_=+y[h][5],C=+y[h][6],p.push([V,_,C,k,R,w,O]);break;case"T":case"L":_=+y[h][1],C=+y[h][2],p.push([V,_,C]);break;case"H":V="L",_=+y[h][1],p.push([V,_,C]);break;case"V":V="L",C=+y[h][1],p.push([V,_,C]);break;case"A":V="L";var H=+y[h][1],F=+y[h][2];+y[h][4]||(H=-H,F=-F);var U=_-H,W=C;for(b=1;b<=g/2;b++){var q=2*Math.PI*b/g;p.push([V,U+H*Math.cos(q),W+F*Math.sin(q)])}break;case"Z":(_!==M||C!==E)&&(_=M,C=E,p.push([V,_,C]));break}for(var X=(f||{}).domain,lt=s._fullLayout._size,yt=f&&f.xsizemode==="pixel",pt=f&&f.ysizemode==="pixel",st=x===!1,tt=0;tt<p.length;tt++){for(b=0;b+2<7;b+=2){var dt=p[tt][b+1],rt=p[tt][b+2];dt===void 0||rt===void 0||(_=dt,C=rt,f&&(f.xaxis&&f.xaxis.p2r?(st&&(dt-=f.xaxis._offset),yt?dt=e(f.xaxis,f.xanchor)+dt:dt=t(f.xaxis,dt)):(st&&(dt-=lt.l),X?dt=X.x[0]+dt/lt.w:dt=dt/lt.w),f.yaxis&&f.yaxis.p2r?(st&&(rt-=f.yaxis._offset),pt?rt=e(f.yaxis,f.yanchor)-rt:rt=t(f.yaxis,rt)):(st&&(rt-=lt.t),X?rt=X.y[1]-rt/lt.h:rt=1-rt/lt.h)),p[tt][b+1]=dt,p[tt][b+2]=rt)}v[T].push(p[tt].slice())}}return v};function n(i,s){return Math.abs(i-s)<=1e-6}function o(i,s){var f=s[1]-i[1],x=s[2]-i[2];return Math.sqrt(f*f+x*x)}Q.pointsOnRectangle=function(i){var s=i.length;if(s!==5)return!1;for(var f=1;f<3;f++){var x=i[0][f]-i[1][f],y=i[3][f]-i[2][f];if(!n(x,y))return!1;var v=i[0][f]-i[3][f],T=i[1][f]-i[2][f];if(!n(v,T))return!1}return!n(i[0][1],i[1][1])&&!n(i[0][1],i[3][1])?!1:!!(o(i[0],i[1])*o(i[0],i[3]))},Q.pointsOnEllipse=function(i){var s=i.length;if(s!==g+1)return!1;s=g;for(var f=0;f<s;f++){var x=(s*2-f)%s,y=(s/2+x)%s,v=(s/2+f)%s;if(!n(o(i[f],i[v]),o(i[x],i[y])))return!1}return!0},Q.handleEllipse=function(i,s,f){if(!i)return[s,f];var x=Q.ellipseOver({x0:s[0],y0:s[1],x1:f[0],y1:f[1]}),y=(x.x1+x.x0)/2,v=(x.y1+x.y0)/2,T=(x.x1-x.x0)/2,u=(x.y1-x.y0)/2;T||(T=u=u/P),u||(u=T=T/P);for(var b=[],_=0;_<g;_++){var C=_*2*Math.PI/g;b.push([y+T*Math.cos(C),v+u*Math.sin(C)])}return b},Q.ellipseOver=function(i){var s=i.x0,f=i.y0,x=i.x1,y=i.y1,v=x-s,T=y-f;s-=v,f-=T;var u=(s+x)/2,b=(f+y)/2,_=P;return v*=_,T*=_,{x0:u-v,y0:b-T,x1:u+v,y1:b+T}},Q.fixDatesForPaths=function(i,s,f){var x=s.type==="date",y=f.type==="date";if(!x&&!y)return i;for(var v=0;v<i.length;v++)for(var T=0;T<i[v].length;T++)for(var u=0;u+2<i[v][T].length;u+=2)x&&(i[v][T][u+1]=i[v][T][u+1].replace(" ","_")),y&&(i[v][T][u+2]=i[v][T][u+2].replace(" ","_"));return i}}),a0=Ft((Q,$)=>{var c=Rc(),g=v0(),P=g.drawMode,S=g.openMode,t=F_(),e=t.i000,r=t.i090,a=t.i180,n=t.i270,o=t.cos45,i=t.sin45,s=By(),f=s.p2r,x=s.r2p,y=C0(),v=y.clearOutline,T=kg(),u=T.readPaths,b=T.writePaths,_=T.ellipseOver,C=T.fixDatesForPaths;function M(A,h){if(A.length){var p=A[0][0];if(p){var k=h.gd,w=h.isActiveShape,R=h.dragmode,O=(k.layout||{}).shapes||[];if(!P(R)&&w!==void 0){var N=k._fullLayout._activeShapeIndex;if(N<O.length)switch(k._fullLayout.shapes[N].type){case"rect":R="drawrect";break;case"circle":R="drawcircle";break;case"line":R="drawline";break;case"path":var V=O[N].path||"";V[V.length-1]==="Z"?R="drawclosedpath":R="drawopenpath";break}}var H=E(A,h,R);v(k);for(var F=h.editHelpers,U=(F||{}).modifyItem,W=[],q=0;q<O.length;q++){var X=k._fullLayout.shapes[q];if(W[q]=X._input,w!==void 0&&q===k._fullLayout._activeShapeIndex){var lt=H;switch(X.type){case"line":case"rect":case"circle":var yt=c.getFromId(k,X.xref);X.xref.charAt(0)==="x"&&yt.type.includes("category")?(U("x0",lt.x0-(X.x0shift||0)),U("x1",lt.x1-(X.x1shift||0))):(U("x0",lt.x0),U("x1",lt.x1));var pt=c.getFromId(k,X.yref);X.yref.charAt(0)==="y"&&pt.type.includes("category")?(U("y0",lt.y0-(X.y0shift||0)),U("y1",lt.y1-(X.y1shift||0))):(U("y0",lt.y0),U("y1",lt.y1));break;case"path":U("path",lt.path);break}}}return w===void 0?(W.push(H),W):F?F.getUpdateObj():{}}}}function E(A,h,p){var k=A[0][0],w=h.gd,R=k.getAttribute("d"),O=w._fullLayout.newshape,N=h.plotinfo,V=h.isActiveShape,H=N.xaxis,F=N.yaxis,U=!!N.domain||!N.xaxis,W=!!N.domain||!N.yaxis,q=S(p),X=u(R,w,N,V),lt={editable:!0,visible:O.visible,name:O.name,showlegend:O.showlegend,legend:O.legend,legendwidth:O.legendwidth,legendgroup:O.legendgroup,legendgrouptitle:{text:O.legendgrouptitle.text,font:O.legendgrouptitle.font},legendrank:O.legendrank,label:O.label,xref:U?"paper":H._id,yref:W?"paper":F._id,layer:O.layer,opacity:O.opacity,line:{color:O.line.color,width:O.line.width,dash:O.line.dash}};q||(lt.fillcolor=O.fillcolor,lt.fillrule=O.fillrule);var yt;if(X.length===1&&(yt=X[0]),yt&&yt.length===5&&p==="drawrect")lt.type="rect",lt.x0=yt[0][1],lt.y0=yt[0][2],lt.x1=yt[2][1],lt.y1=yt[2][2];else if(yt&&p==="drawline")lt.type="line",lt.x0=yt[0][1],lt.y0=yt[0][2],lt.x1=yt[1][1],lt.y1=yt[1][2];else if(yt&&p==="drawcircle"){lt.type="circle";var pt=yt[e][1],st=yt[r][1],tt=yt[a][1],dt=yt[n][1],rt=yt[e][2],at=yt[r][2],vt=yt[a][2],it=yt[n][2],Y=N.xaxis&&(N.xaxis.type==="date"||N.xaxis.type==="log"),ft=N.yaxis&&(N.yaxis.type==="date"||N.yaxis.type==="log");Y&&(pt=x(N.xaxis,pt),st=x(N.xaxis,st),tt=x(N.xaxis,tt),dt=x(N.xaxis,dt)),ft&&(rt=x(N.yaxis,rt),at=x(N.yaxis,at),vt=x(N.yaxis,vt),it=x(N.yaxis,it));var ut=(st+dt)/2,wt=(rt+vt)/2,zt=(dt-st+tt-pt)/2,Pt=(it-at+vt-rt)/2,Wt=_({x0:ut,y0:wt,x1:ut+zt*o,y1:wt+Pt*i});Y&&(Wt.x0=f(N.xaxis,Wt.x0),Wt.x1=f(N.xaxis,Wt.x1)),ft&&(Wt.y0=f(N.yaxis,Wt.y0),Wt.y1=f(N.yaxis,Wt.y1)),lt.x0=Wt.x0,lt.y0=Wt.y0,lt.x1=Wt.x1,lt.y1=Wt.y1}else lt.type="path",H&&F&&C(X,H,F),lt.path=b(X),yt=null;return lt}$.exports={newShapes:M,createShapeObj:E}}),Tg=Ft((Q,$)=>{var c=v0(),g=c.selectMode,P=C0(),S=P.clearOutline,t=kg(),e=t.readPaths,r=t.writePaths,a=t.fixDatesForPaths;$.exports=function(n,o){if(n.length){var i=n[0][0];if(i){var s=i.getAttribute("d"),f=o.gd,x=f._fullLayout.newselection,y=o.plotinfo,v=y.xaxis,T=y.yaxis,u=o.isActiveSelection,b=o.dragmode,_=(f.layout||{}).selections||[];if(!g(b)&&u!==void 0){var C=f._fullLayout._activeSelectionIndex;if(C<_.length)switch(f._fullLayout.selections[C].type){case"rect":b="select";break;case"path":b="lasso";break}}var M=e(s,f,y,u),E={xref:v._id,yref:T._id,opacity:x.opacity,line:{color:x.line.color,width:x.line.width,dash:x.line.dash}},A;M.length===1&&(A=M[0]),A&&A.length===5&&b==="select"?(E.type="rect",E.x0=A[0][1],E.y0=A[0][2],E.x1=A[2][1],E.y1=A[2][2]):(E.type="path",v&&T&&a(M,v,T),E.path=r(M),A=null),S(f);for(var h=o.editHelpers,p=(h||{}).modifyItem,k=[],w=0;w<_.length;w++){var R=f._fullLayout.selections[w];if(!R){k[w]=R;continue}if(k[w]=R._input,u!==void 0&&w===f._fullLayout._activeSelectionIndex){var O=E;switch(R.type){case"rect":p("x0",O.x0),p("x1",O.x1),p("y0",O.y0),p("y1",O.y1);break;case"path":p("path",O.path);break}}}return u===void 0?(k.push(E),k):h?h.getUpdateObj():{}}}}}),Ny=Ft((Q,$)=>{$.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}}}),bp=Ft(Q=>{var $=Ny(),c=bn(),g=Es();Q.rangeToShapePosition=function(t){return t.type==="log"?t.r2d:function(e){return e}},Q.shapePositionToRange=function(t){return t.type==="log"?t.d2r:function(e){return e}},Q.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},Q.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},Q.extractPathCoords=function(t,e,r){var a=[],n=t.match($.segmentRE);return n.forEach(function(o){var i=e[o.charAt(0)].drawn;if(i!==void 0){var s=o.substr(1).match($.paramRE);if(!(!s||s.length<i)){var f=s[i],x=r?f:c.cleanNumber(f);a.push(x)}}}),a},Q.getDataToPixel=function(t,e,r,a,n){var o=t._fullLayout._size,i;if(e)if(n==="domain")i=function(f){return e._length*(a?1-f:f)+e._offset};else{var s=Q.shapePositionToRange(e);i=function(f){var x=S(e,r);return e._offset+e.r2p(s(f,!0))+x},e.type==="date"&&(i=Q.decodeDate(i))}else a?i=function(f){return o.t+o.h*(1-f)}:i=function(f){return o.l+o.w*f};return i},Q.getPixelToData=function(t,e,r,a){var n=t._fullLayout._size,o;if(e)if(a==="domain")o=function(s){var f=(s-e._offset)/e._length;return r?1-f:f};else{var i=Q.rangeToShapePosition(e);o=function(s){return i(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},Q.roundPositionForSharpStrokeRendering=function(t,e){var r=Math.round(e%2)===1,a=Math.round(t);return r?a+.5:a},Q.makeShapesOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.shapes[e]||{},a=t._fullLayout._plots[r.xref+r.yref],n=!!a;return n?a._hadPlotinfo=!0:(a={},r.xref&&r.xref!=="paper"&&(a.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&r.yref!=="paper"&&(a.yaxis=t._fullLayout[r.yref+"axis"])),a.xsizemode=r.xsizemode,a.ysizemode=r.ysizemode,a.xanchor=r.xanchor,a.yanchor=r.yanchor,{options:r,plotinfo:a}},Q.makeSelectionsOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.selections[e]||{},a=t._fullLayout._plots[r.xref+r.yref],n=!!a;return n?a._hadPlotinfo=!0:(a={},r.xref&&(a.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&(a.yaxis=t._fullLayout[r.yref+"axis"])),{options:r,plotinfo:a}},Q.getPathString=function(t,e){var r=e.type,a=g.getRefType(e.xref),n=g.getRefType(e.yref),o=g.getFromId(t,e.xref),i=g.getFromId(t,e.yref),s=t._fullLayout._size,f,x,y,v,T=S(o,e.x0shift),u=S(o,e.x1shift),b=S(i,e.y0shift),_=S(i,e.y1shift),C,M,E,A;if(o?a==="domain"?x=function(F){return o._offset+o._length*F}:(f=Q.shapePositionToRange(o),x=function(F){return o._offset+o.r2p(f(F,!0))}):x=function(F){return s.l+s.w*F},i?n==="domain"?v=function(F){return i._offset+i._length*(1-F)}:(y=Q.shapePositionToRange(i),v=function(F){return i._offset+i.r2p(y(F,!0))}):v=function(F){return s.t+s.h*(1-F)},r==="path")return o&&o.type==="date"&&(x=Q.decodeDate(x)),i&&i.type==="date"&&(v=Q.decodeDate(v)),P(e,x,v);if(e.xsizemode==="pixel"){var h=x(e.xanchor);C=h+e.x0+T,M=h+e.x1+u}else C=x(e.x0)+T,M=x(e.x1)+u;if(e.ysizemode==="pixel"){var p=v(e.yanchor);E=p-e.y0+b,A=p-e.y1+_}else E=v(e.y0)+b,A=v(e.y1)+_;if(r==="line")return"M"+C+","+E+"L"+M+","+A;if(r==="rect")return"M"+C+","+E+"H"+M+"V"+A+"H"+C+"Z";var k=(C+M)/2,w=(E+A)/2,R=Math.abs(k-C),O=Math.abs(w-E),N="A"+R+","+O,V=k+R+","+w,H=k+","+(w-O);return"M"+V+N+" 0 1,1 "+H+N+" 0 0,1 "+V+"Z"};function P(t,e,r){var a=t.path,n=t.xsizemode,o=t.ysizemode,i=t.xanchor,s=t.yanchor;return a.replace($.segmentRE,function(f){var x=0,y=f.charAt(0),v=$.paramIsX[y],T=$.paramIsY[y],u=$.numParams[y],b=f.substr(1).replace($.paramRE,function(_){return v[x]?n==="pixel"?_=e(i)+Number(_):_=e(_):T[x]&&(o==="pixel"?_=r(s)-Number(_):_=r(_)),x++,x>u&&(_="X"),_});return x>u&&(b=b.replace(/[\s,]*X.*/,""),c.log("Ignoring extra params in segment "+f)),y+b})}function S(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}}),bw=Ft((Q,$)=>{var c=bn(),g=Es(),P=tc(),S=js(),t=kg().readPaths,e=bp(),r=e.getPathString,a=y1(),n=Af().FROM_TL;$.exports=function(s,f,x,y){if(y.selectAll(".shape-label").remove(),!!(x.label.text||x.label.texttemplate)){var v;if(x.label.texttemplate){var T={};if(x.type!=="path"){var u=g.getFromId(s,x.xref),b=g.getFromId(s,x.yref);for(var _ in a){var C=a[_](x,u,b);C!==void 0&&(T[_]=C)}}v=c.texttemplateStringForShapes({data:[T],fallback:x.label.texttemplatefallback,locale:s._fullLayout._d3locale,template:x.label.texttemplate})}else v=x.label.text;var M={"data-index":f},E=x.label.font,A={"data-notex":1},h=y.append("g").attr(M).classed("shape-label",!0),p=h.append("text").attr(A).classed("shape-label-text",!0).text(v),k,w,R,O;if(x.path){var N=r(s,x),V=t(N,s);k=1/0,R=1/0,w=-1/0,O=-1/0;for(var H=0;H<V.length;H++)for(var F=0;F<V[H].length;F++)for(var U=V[H][F],W=1;W<U.length;W+=2){var q=U[W],X=U[W+1];k=Math.min(k,q),w=Math.max(w,q),R=Math.min(R,X),O=Math.max(O,X)}}else{var lt=g.getFromId(s,x.xref),yt=x.x0shift,pt=x.x1shift,st=g.getRefType(x.xref),tt=g.getFromId(s,x.yref),dt=x.y0shift,rt=x.y1shift,at=g.getRefType(x.yref),vt=function(Wt,Ht){var Jt=e.getDataToPixel(s,lt,Ht,!1,st);return Jt(Wt)},it=function(Wt,Ht){var Jt=e.getDataToPixel(s,tt,Ht,!0,at);return Jt(Wt)};k=vt(x.x0,yt),w=vt(x.x1,pt),R=it(x.y0,dt),O=it(x.y1,rt)}var Y=x.label.textangle;Y==="auto"&&(x.type==="line"?Y=o(k,R,w,O):Y=0),p.call(function(Wt){return Wt.call(S.font,E).attr({}),P.convertToTspans(Wt,s),Wt});var ft=S.bBox(p.node()),ut=i(k,R,w,O,x,Y,ft),wt=ut.textx,zt=ut.texty,Pt=ut.xanchor;p.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[Pt],y:zt,x:wt,transform:"rotate("+Y+","+wt+","+zt+")"}).call(P.positionText,wt,zt)}};function o(s,f,x,y){var v,T;return T=Math.abs(x-s),x>=s?v=f-y:v=y-f,-180/Math.PI*Math.atan2(v,T)}function i(s,f,x,y,v,T,u){var b=v.label.textposition,_=v.label.textangle,C=v.label.padding,M=v.type,E=Math.PI/180*T,A=Math.sin(E),h=Math.cos(E),p=v.label.xanchor,k=v.label.yanchor,w,R,O,N;if(M==="line"){b==="start"?(w=s,R=f):b==="end"?(w=x,R=y):(w=(s+x)/2,R=(f+y)/2),p==="auto"&&(b==="start"?_==="auto"?x>s?p="left":x<s?p="right":p="center":x>s?p="right":x<s?p="left":p="center":b==="end"?_==="auto"?x>s?p="right":x<s?p="left":p="center":x>s?p="left":x<s?p="right":p="center":p="center");var V={left:1,center:0,right:-1},H={bottom:-1,middle:0,top:1};if(_==="auto"){var F=H[k];O=-C*A*F,N=C*h*F}else{var U=V[p],W=H[k];O=C*U,N=C*W}w=w+O,R=R+N}else O=C+3,b.indexOf("right")!==-1?(w=Math.max(s,x)-O,p==="auto"&&(p="right")):b.indexOf("left")!==-1?(w=Math.min(s,x)+O,p==="auto"&&(p="left")):(w=(s+x)/2,p==="auto"&&(p="center")),b.indexOf("top")!==-1?R=Math.min(f,y):b.indexOf("bottom")!==-1?R=Math.max(f,y):R=(f+y)/2,N=C,k==="bottom"?R=R-N:k==="top"&&(R=R+N);var q=n[k],X=v.label.font.size,lt=u.height,yt=(lt*q-X)*A,pt=-(lt*q-X)*h;return{textx:w+yt,texty:R+pt,xanchor:p}}}),Rm=Ft((Q,$)=>{var c=bn(),g=c.strTranslate,P=up(),S=v0(),t=S.drawMode,e=S.selectMode,r=Xo(),a=li(),n=F_(),o=n.i000,i=n.i090,s=n.i180,f=n.i270,x=C0(),y=x.clearOutlineControllers,v=kg(),T=v.pointsOnRectangle,u=v.pointsOnEllipse,b=v.writePaths,_=a0().newShapes,C=a0().createShapeObj,M=Tg(),E=bw();$.exports=function k(w,R,O,N){N||(N=0);var V=O.gd;function H(){k(w,R,O,N++),(u(w[0])||O.hasText)&&F({redrawing:!0})}function F(de){var se={};O.isActiveShape!==void 0&&(O.isActiveShape=!1,se=_(R,O)),O.isActiveSelection!==void 0&&(O.isActiveSelection=!1,se=M(R,O),V._fullLayout._reselect=!0),Object.keys(se).length&&r.call((de||{}).redrawing?"relayout":"_guiRelayout",V,se)}var U=V._fullLayout,W=U._zoomlayer,q=O.dragmode,X=t(q),lt=e(q);(X||lt)&&(V._fullLayout._outlining=!0),y(V),R.attr("d",b(w));var yt,pt,st,tt,dt;if(!N&&(O.isActiveShape||O.isActiveSelection)){dt=A([],w);var rt=W.append("g").attr("class","outline-controllers");zt(rt),he()}if(X&&O.hasText){var at=W.select(".label-temp"),vt=C(R,O,O.dragmode);E(V,"label-temp",vt,at)}function it(de){st=+de.srcElement.getAttribute("data-i"),tt=+de.srcElement.getAttribute("data-j"),yt[st][tt].moveFn=Y}function Y(de,se){if(w.length){var Tt=dt[st][tt][1],Lt=dt[st][tt][2],Mt=w[st],te=Mt.length;if(T(Mt)){var ve=de,oe=se;if(O.isActiveSelection){var Te=h(Mt,tt);Te[1]===Mt[tt][1]?oe=0:ve=0}for(var He=0;He<te;He++)if(He!==tt){var Ge=Mt[He];Ge[1]===Mt[tt][1]&&(Ge[1]=Tt+ve),Ge[2]===Mt[tt][2]&&(Ge[2]=Lt+oe)}if(Mt[tt][1]=Tt+ve,Mt[tt][2]=Lt+oe,!T(Mt))for(var cr=0;cr<te;cr++)for(var ur=0;ur<Mt[cr].length;ur++)Mt[cr][ur]=dt[st][cr][ur]}else Mt[tt][1]=Tt+de,Mt[tt][2]=Lt+se;H()}}function ft(){F()}function ut(){if(w.length&&w[st]&&w[st].length){for(var de=[],se=0;se<w[st].length;se++)se!==tt&&de.push(w[st][se]);de.length>1&&!(de.length===2&&de[1][0]==="Z")&&(tt===0&&(de[0][0]="M"),w[st]=de,H(),F())}}function wt(de,se){if(de===2){st=+se.srcElement.getAttribute("data-i"),tt=+se.srcElement.getAttribute("data-j");var Tt=w[st];!T(Tt)&&!u(Tt)&&ut()}}function zt(de){yt=[];for(var se=0;se<w.length;se++){var Tt=w[se],Lt=T(Tt),Mt=!Lt&&u(Tt);yt[se]=[];for(var te=Tt.length,ve=0;ve<te;ve++)if(Tt[ve][0]!=="Z"&&!(Mt&&ve!==o&&ve!==i&&ve!==s&&ve!==f)){var oe=Lt&&O.isActiveSelection,Te;oe&&(Te=h(Tt,ve));var He=Tt[ve][1],Ge=Tt[ve][2],cr=de.append(oe?"rect":"circle").attr("data-i",se).attr("data-j",ve).style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(oe){var ur=Te[1]-He,jr=Te[2]-Ge,Hr=jr?5:Math.max(Math.min(25,Math.abs(ur)-5),5),br=ur?5:Math.max(Math.min(25,Math.abs(jr)-5),5);cr.classed(jr?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",Hr).attr("height",br).attr("x",He-Hr/2).attr("y",Ge-br/2).attr("transform",g(ur/2,jr/2))}else cr.classed("cursor-grab",!0).attr("r",5).attr("cx",He).attr("cy",Ge);yt[se][ve]={element:cr.node(),gd:V,prepFn:it,doneFn:ft,clickFn:wt},P.init(yt[se][ve])}}}function Pt(de,se){if(w.length)for(var Tt=0;Tt<w.length;Tt++)for(var Lt=0;Lt<w[Tt].length;Lt++)for(var Mt=0;Mt+2<w[Tt][Lt].length;Mt+=2)w[Tt][Lt][Mt+1]=dt[Tt][Lt][Mt+1]+de,w[Tt][Lt][Mt+2]=dt[Tt][Lt][Mt+2]+se}function Wt(de,se){Pt(de,se),H()}function Ht(de){st=+de.srcElement.getAttribute("data-i"),st||(st=0),pt[st].moveFn=Wt}function Jt(){F()}function ge(de){de===2&&p(V)}function he(){if(pt=[],!!w.length){var de=0;pt[de]={element:R[0][0],gd:V,prepFn:Ht,doneFn:Jt,clickFn:ge},P.init(pt[de])}}};function A(k,w){for(var R=0;R<w.length;R++){var O=w[R];k[R]=[];for(var N=0;N<O.length;N++){k[R][N]=[];for(var V=0;V<O[N].length;V++)k[R][N][V]=O[N][V]}}return k}function h(k,w){var R=k[w][1],O=k[w][2],N=k.length,V,H,F;return V=(w+1)%N,H=k[V][1],F=k[V][2],H===R&&F===O&&(V=(w+2)%N,H=k[V][1],F=k[V][2]),[V,H,F]}function p(k){if(e(k._fullLayout.dragmode)){y(k);var w=k._fullLayout._activeSelectionIndex,R=(k.layout||{}).selections||[];if(w<R.length){for(var O=[],N=0;N<R.length;N++)N!==w&&O.push(R[N]);delete k._fullLayout._activeSelectionIndex;var V=k._fullLayout.selections[w];k._fullLayout._deselect={xref:V.xref,yref:V.yref},r.call("_guiRelayout",k,{selections:O})}}}}),R_=Ft((Q,$)=>{var c=un(),g=Xo(),P=bn(),S=Es(),t=kg().readPaths,e=Rm(),r=bw(),a=C0().clearOutlineControllers,n=li(),o=js(),i=pu().arrayEditor,s=up(),f=P0(),x=Ny(),y=bp(),v=y.getPathString;$.exports={draw:T,drawOne:_,eraseActiveShape:p,drawLabel:r};function T(k){var w=k._fullLayout;w._shapeUpperLayer.selectAll("path").remove(),w._shapeLowerLayer.selectAll("path").remove(),w._shapeUpperLayer.selectAll("text").remove(),w._shapeLowerLayer.selectAll("text").remove();for(var R in w._plots){var O=w._plots[R].shapelayer;O&&(O.selectAll("path").remove(),O.selectAll("text").remove())}for(var N=0;N<w.shapes.length;N++)w.shapes[N].visible===!0&&_(k,N)}function u(k){return!!k._fullLayout._outlining}function b(k){return!k._context.edits.shapePosition}function _(k,w){k._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+w+'"]').remove();var R=y.makeShapesOptionsAndPlotinfo(k,w),O=R.options,N=R.plotinfo;if(!O._input||O.visible!==!0)return;if(O.layer==="above")H(k._fullLayout._shapeUpperLayer);else if(O.xref==="paper"||O.yref==="paper")H(k._fullLayout._shapeLowerLayer);else if(O.layer==="between")H(N.shapelayerBetween);else if(N._hadPlotinfo){var V=N.mainplotinfo||N;H(V.shapelayer)}else H(k._fullLayout._shapeLowerLayer);function H(F){var U=v(k,O),W={"data-index":w,"fill-rule":O.fillrule,d:U},q=O.opacity,X=O.fillcolor,lt=O.line.width?O.line.color:"rgba(0,0,0,0)",yt=O.line.width,pt=O.line.dash;!yt&&O.editable===!0&&(yt=5,pt="solid");var st=U[U.length-1]!=="Z",tt=b(k)&&O.editable&&k._fullLayout._activeShapeIndex===w;tt&&(X=st?"rgba(0,0,0,0)":k._fullLayout.activeshape.fillcolor,q=k._fullLayout.activeshape.opacity);var dt=F.append("g").classed("shape-group",!0).attr({"data-index":w}),rt=dt.append("path").attr(W).style("opacity",q).call(n.stroke,lt).call(n.fill,X).call(o.dashLine,pt,yt);C(dt,k,O),r(k,w,O,dt);var at;if((tt||k._context.edits.shapePosition)&&(at=i(k.layout,"shapes",O)),tt){rt.style({cursor:"move"});var vt={element:rt.node(),plotinfo:N,gd:k,editHelpers:at,hasText:O.label.text||O.label.texttemplate,isActiveShape:!0},it=t(U,k);e(it,rt,vt)}else k._context.edits.shapePosition?M(k,rt,O,w,F,at):O.editable===!0&&rt.style("pointer-events",st||n.opacity(X)*q<=.5?"stroke":"all");rt.node().addEventListener("click",function(){return A(k,rt)})}}function C(k,w,R){var O=(R.xref+R.yref).replace(/paper/g,"").replace(/[xyz][0-9]* *domain/g,"");o.setClipUrl(k,O?"clip"+w._fullLayout._uid+O:null,w)}function M(k,w,R,O,N,V){var H=10,F=10,U=R.xsizemode==="pixel",W=R.ysizemode==="pixel",q=R.type==="line",X=R.type==="path",lt=V.modifyItem,yt,pt,st,tt,dt,rt,at,vt,it,Y,ft,ut,wt,zt,Pt,Wt=c.select(w.node().parentNode),Ht=S.getFromId(k,R.xref),Jt=S.getRefType(R.xref),ge=S.getFromId(k,R.yref),he=S.getRefType(R.yref),de=R.x0shift,se=R.x1shift,Tt=R.y0shift,Lt=R.y1shift,Mt=function(gt,St){var Nt=y.getDataToPixel(k,Ht,St,!1,Jt);return Nt(gt)},te=function(gt,St){var Nt=y.getDataToPixel(k,ge,St,!0,he);return Nt(gt)},ve=y.getPixelToData(k,Ht,!1,Jt),oe=y.getPixelToData(k,ge,!0,he),Te=cr(),He={element:Te.node(),gd:k,prepFn:Hr,doneFn:br,clickFn:Kr},Ge;s.init(He),Te.node().onmousemove=jr;function cr(){return q?ur():w}function ur(){var gt=10,St=Math.max(R.line.width,gt),Nt=N.append("g").attr("data-index",O).attr("drag-helper",!0);Nt.append("path").attr("d",w.attr("d")).style({cursor:"move","stroke-width":St,"stroke-opacity":"0"});var ee={"fill-opacity":"0"},le=Math.max(St/2,gt);return Nt.append("circle").attr({"data-line-point":"start-point",cx:U?Mt(R.xanchor)+R.x0:Mt(R.x0,de),cy:W?te(R.yanchor)-R.y0:te(R.y0,Tt),r:le}).style(ee).classed("cursor-grab",!0),Nt.append("circle").attr({"data-line-point":"end-point",cx:U?Mt(R.xanchor)+R.x1:Mt(R.x1,se),cy:W?te(R.yanchor)-R.y1:te(R.y1,Lt),r:le}).style(ee).classed("cursor-grab",!0),Nt}function jr(gt){if(u(k)){Ge=null;return}if(q)gt.target.tagName==="path"?Ge="move":Ge=gt.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var St=He.element.getBoundingClientRect(),Nt=St.right-St.left,ee=St.bottom-St.top,le=gt.clientX-St.left,we=gt.clientY-St.top,Ue=!X&&Nt>H&&ee>F&&!gt.shiftKey?s.getCursor(le/Nt,1-we/ee):"move";f(w,Ue),Ge=Ue.split("-")[0]}}function Hr(gt){u(k)||(U&&(dt=Mt(R.xanchor)),W&&(rt=te(R.yanchor)),R.type==="path"?Pt=R.path:(yt=U?R.x0:Mt(R.x0),pt=W?R.y0:te(R.y0),st=U?R.x1:Mt(R.x1),tt=W?R.y1:te(R.y1)),yt<st?(it=yt,wt="x0",Y=st,zt="x1"):(it=st,wt="x1",Y=yt,zt="x0"),!W&&pt<tt||W&&pt>tt?(at=pt,ft="y0",vt=tt,ut="y1"):(at=tt,ft="y1",vt=pt,ut="y0"),jr(gt),$t(N,R),Ct(w,R,k),He.moveFn=Ge==="move"?rn:Ce,He.altKey=gt.altKey)}function br(){u(k)||(f(w),ne(N),C(w,k,R),g.call("_guiRelayout",k,V.getUpdateObj()))}function Kr(){u(k)||ne(N)}function rn(gt,St){if(R.type==="path"){var Nt=function(we){return we},ee=Nt,le=Nt;U?lt("xanchor",R.xanchor=ve(dt+gt)):(ee=function(we){return ve(Mt(we)+gt)},Ht&&Ht.type==="date"&&(ee=y.encodeDate(ee))),W?lt("yanchor",R.yanchor=oe(rt+St)):(le=function(we){return oe(te(we)+St)},ge&&ge.type==="date"&&(le=y.encodeDate(le))),lt("path",R.path=E(Pt,ee,le))}else U?lt("xanchor",R.xanchor=ve(dt+gt)):(lt("x0",R.x0=ve(yt+gt)),lt("x1",R.x1=ve(st+gt))),W?lt("yanchor",R.yanchor=oe(rt+St)):(lt("y0",R.y0=oe(pt+St)),lt("y1",R.y1=oe(tt+St)));w.attr("d",v(k,R)),$t(N,R),r(k,O,R,Wt)}function Ce(gt,St){if(X){var Nt=function(qn){return qn},ee=Nt,le=Nt;U?lt("xanchor",R.xanchor=ve(dt+gt)):(ee=function(qn){return ve(Mt(qn)+gt)},Ht&&Ht.type==="date"&&(ee=y.encodeDate(ee))),W?lt("yanchor",R.yanchor=oe(rt+St)):(le=function(qn){return oe(te(qn)+St)},ge&&ge.type==="date"&&(le=y.encodeDate(le))),lt("path",R.path=E(Pt,ee,le))}else if(q){if(Ge==="resize-over-start-point"){var we=yt+gt,Ue=W?pt-St:pt+St;lt("x0",R.x0=U?we:ve(we)),lt("y0",R.y0=W?Ue:oe(Ue))}else if(Ge==="resize-over-end-point"){var qe=st+gt,ar=W?tt-St:tt+St;lt("x1",R.x1=U?qe:ve(qe)),lt("y1",R.y1=W?ar:oe(ar))}}else{var Ar=function(qn){return Ge.indexOf(qn)!==-1},Tr=Ar("n"),pr=Ar("s"),Jr=Ar("w"),Vn=Ar("e"),Hn=Tr?at+St:at,Kn=pr?vt+St:vt,Ci=Jr?it+gt:it,ii=Vn?Y+gt:Y;W&&(Tr&&(Hn=at-St),pr&&(Kn=vt-St)),(!W&&Kn-Hn>F||W&&Hn-Kn>F)&&(lt(ft,R[ft]=W?Hn:oe(Hn)),lt(ut,R[ut]=W?Kn:oe(Kn))),ii-Ci>H&&(lt(wt,R[wt]=U?Ci:ve(Ci)),lt(zt,R[zt]=U?ii:ve(ii)))}w.attr("d",v(k,R)),$t(N,R),r(k,O,R,Wt)}function $t(gt,St){(U||W)&&Nt();function Nt(){var ee=St.type!=="path",le=gt.selectAll(".visual-cue").data([0]),we=1;le.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":we}).classed("visual-cue",!0);var Ue=Mt(U?St.xanchor:P.midRange(ee?[St.x0,St.x1]:y.extractPathCoords(St.path,x.paramIsX))),qe=te(W?St.yanchor:P.midRange(ee?[St.y0,St.y1]:y.extractPathCoords(St.path,x.paramIsY)));if(Ue=y.roundPositionForSharpStrokeRendering(Ue,we),qe=y.roundPositionForSharpStrokeRendering(qe,we),U&&W){var ar="M"+(Ue-1-we)+","+(qe-1-we)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";le.attr("d",ar)}else if(U){var Ar="M"+(Ue-1-we)+","+(qe-9-we)+"v18 h2 v-18 Z";le.attr("d",Ar)}else{var Tr="M"+(Ue-9-we)+","+(qe-1-we)+"h18 v2 h-18 Z";le.attr("d",Tr)}}}function ne(gt){gt.selectAll(".visual-cue").remove()}function Ct(gt,St,Nt){var ee=St.xref,le=St.yref,we=S.getFromId(Nt,ee),Ue=S.getFromId(Nt,le),qe="";ee!=="paper"&&!we.autorange&&(qe+=ee),le!=="paper"&&!Ue.autorange&&(qe+=le),o.setClipUrl(gt,qe?"clip"+Nt._fullLayout._uid+qe:null,Nt)}}function E(k,w,R){return k.replace(x.segmentRE,function(O){var N=0,V=O.charAt(0),H=x.paramIsX[V],F=x.paramIsY[V],U=x.numParams[V],W=O.substr(1).replace(x.paramRE,function(q){return N>=U||(H[N]?q=w(q):F[N]&&(q=R(q)),N++),q});return V+W})}function A(k,w){if(b(k)){var R=w.node(),O=+R.getAttribute("data-index");if(O>=0){if(O===k._fullLayout._activeShapeIndex){h(k);return}k._fullLayout._activeShapeIndex=O,k._fullLayout._deactivateShape=h,T(k)}}}function h(k){if(b(k)){var w=k._fullLayout._activeShapeIndex;w>=0&&(a(k),delete k._fullLayout._activeShapeIndex,T(k))}}function p(k){if(b(k)){a(k);var w=k._fullLayout._activeShapeIndex,R=(k.layout||{}).shapes||[];if(w<R.length){for(var O=[],N=0;N<R.length;N++)N!==w&&O.push(R[N]);return delete k._fullLayout._activeShapeIndex,g.call("_guiRelayout",k,{shapes:O})}}}}),gv=Ft((Q,$)=>{var c=Xo(),g=Kc(),P=Rc(),S=D_(),t=R_().eraseActiveShape,e=bn(),r=e._,a=$.exports={};a.toImage={name:"toImage",title:function(M){var E=M._context.toImageButtonOptions||{},A=E.format||"png";return A==="png"?r(M,"Download plot as a PNG"):r(M,"Download plot")},icon:S.camera,click:function(M){var E=M._context.toImageButtonOptions,A={format:E.format||"png"};e.notifier(r(M,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(h){h in E&&(A[h]=E[h])}),c.call("downloadImage",M,A).then(function(h){e.notifier(r(M,"Snapshot succeeded")+" - "+h,"long")}).catch(function(){e.notifier(r(M,"Sorry, there was a problem downloading your snapshot!"),"long")})}},a.sendDataToCloud={name:"sendDataToCloud",title:function(M){return r(M,"Edit in Chart Studio")},icon:S.disk,click:function(M){g.sendDataToCloud(M)}},a.editInChartStudio={name:"editInChartStudio",title:function(M){return r(M,"Edit in Chart Studio")},icon:S.pencil,click:function(M){g.sendDataToCloud(M)}},a.zoom2d={name:"zoom2d",_cat:"zoom",title:function(M){return r(M,"Zoom")},attr:"dragmode",val:"zoom",icon:S.zoombox,click:n},a.pan2d={name:"pan2d",_cat:"pan",title:function(M){return r(M,"Pan")},attr:"dragmode",val:"pan",icon:S.pan,click:n},a.select2d={name:"select2d",_cat:"select",title:function(M){return r(M,"Box Select")},attr:"dragmode",val:"select",icon:S.selectbox,click:n},a.lasso2d={name:"lasso2d",_cat:"lasso",title:function(M){return r(M,"Lasso Select")},attr:"dragmode",val:"lasso",icon:S.lasso,click:n},a.drawclosedpath={name:"drawclosedpath",title:function(M){return r(M,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:S.drawclosedpath,click:n},a.drawopenpath={name:"drawopenpath",title:function(M){return r(M,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:S.drawopenpath,click:n},a.drawline={name:"drawline",title:function(M){return r(M,"Draw line")},attr:"dragmode",val:"drawline",icon:S.drawline,click:n},a.drawrect={name:"drawrect",title:function(M){return r(M,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:S.drawrect,click:n},a.drawcircle={name:"drawcircle",title:function(M){return r(M,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:S.drawcircle,click:n},a.eraseshape={name:"eraseshape",title:function(M){return r(M,"Erase active shape")},icon:S.eraseshape,click:t},a.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(M){return r(M,"Zoom in")},attr:"zoom",val:"in",icon:S.zoom_plus,click:n},a.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(M){return r(M,"Zoom out")},attr:"zoom",val:"out",icon:S.zoom_minus,click:n},a.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(M){return r(M,"Autoscale")},attr:"zoom",val:"auto",icon:S.autoscale,click:n},a.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(M){return r(M,"Reset axes")},attr:"zoom",val:"reset",icon:S.home,click:n},a.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(M){return r(M,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:S.tooltip_basic,gravity:"ne",click:n},a.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(M){return r(M,"Compare data on hover")},attr:"hovermode",val:function(M){return M._fullLayout._isHoriz?"y":"x"},icon:S.tooltip_compare,gravity:"ne",click:n};function n(M,E){var A=E.currentTarget,h=A.getAttribute("data-attr"),p=A.getAttribute("data-val")||!0,k=M._fullLayout,w={},R=P.list(M,null,!0),O=k._cartesianSpikesEnabled,N,V;if(h==="zoom"){var H=p==="in"?.5:2,F=(1+H)/2,U=(1-H)/2,W,q;for(V=0;V<R.length;V++)if(N=R[V],q=N.modebardisable==="none"||N.modebardisable.indexOf(p==="auto"||p==="reset"?"autoscale":"zoominout")===-1,q&&!N.fixedrange)if(W=N._name,p==="auto")w[W+".autorange"]=!0;else if(p==="reset")N._rangeInitial0===void 0&&N._rangeInitial1===void 0?w[W+".autorange"]=!0:N._rangeInitial0===void 0?(w[W+".autorange"]=N._autorangeInitial,w[W+".range"]=[null,N._rangeInitial1]):N._rangeInitial1===void 0?(w[W+".range"]=[N._rangeInitial0,null],w[W+".autorange"]=N._autorangeInitial):w[W+".range"]=[N._rangeInitial0,N._rangeInitial1],N._showSpikeInitial!==void 0&&(w[W+".showspikes"]=N._showSpikeInitial,O==="on"&&!N._showSpikeInitial&&(O="off"));else{var X=[N.r2l(N.range[0]),N.r2l(N.range[1])],lt=[F*X[0]+U*X[1],F*X[1]+U*X[0]];w[W+".range[0]"]=N.l2r(lt[0]),w[W+".range[1]"]=N.l2r(lt[1])}}else h==="hovermode"&&(p==="x"||p==="y")&&(p=k._isHoriz?"y":"x",A.setAttribute("data-val",p)),w[h]=p;k._cartesianSpikesEnabled=O,c.call("_guiRelayout",M,w)}a.zoom3d={name:"zoom3d",_cat:"zoom",title:function(M){return r(M,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:S.zoombox,click:o},a.pan3d={name:"pan3d",_cat:"pan",title:function(M){return r(M,"Pan")},attr:"scene.dragmode",val:"pan",icon:S.pan,click:o},a.orbitRotation={name:"orbitRotation",title:function(M){return r(M,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:S["3d_rotate"],click:o},a.tableRotation={name:"tableRotation",title:function(M){return r(M,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:S["z-axis"],click:o};function o(M,E){for(var A=E.currentTarget,h=A.getAttribute("data-attr"),p=A.getAttribute("data-val")||!0,k=M._fullLayout._subplots.gl3d||[],w={},R=h.split("."),O=0;O<k.length;O++)w[k[O]+"."+R[1]]=p;var N=p==="pan"?p:"zoom";w.dragmode=N,c.call("_guiRelayout",M,w)}a.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(M){return r(M,"Reset camera to default")},attr:"resetDefault",icon:S.home,click:i},a.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(M){return r(M,"Reset camera to last save")},attr:"resetLastSave",icon:S.movie,click:i};function i(M,E){for(var A=E.currentTarget,h=A.getAttribute("data-attr"),p=h==="resetLastSave",k=h==="resetDefault",w=M._fullLayout,R=w._subplots.gl3d||[],O={},N=0;N<R.length;N++){var V=R[N],H=V+".camera",F=V+".aspectratio",U=V+".aspectmode",W=w[V]._scene,q;p?(O[H+".up"]=W.viewInitial.up,O[H+".eye"]=W.viewInitial.eye,O[H+".center"]=W.viewInitial.center,q=!0):k&&(O[H+".up"]=null,O[H+".eye"]=null,O[H+".center"]=null,q=!0),q&&(O[F+".x"]=W.viewInitial.aspectratio.x,O[F+".y"]=W.viewInitial.aspectratio.y,O[F+".z"]=W.viewInitial.aspectratio.z,O[U]=W.viewInitial.aspectmode)}c.call("_guiRelayout",M,O)}a.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(M){return r(M,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:S.tooltip_basic,gravity:"ne",click:f};function s(M,E){var A=E.currentTarget,h=A._previousVal,p=M._fullLayout,k=p._subplots.gl3d||[],w=["xaxis","yaxis","zaxis"],R={},O={};if(h)O=h,A._previousVal=null;else{for(var N=0;N<k.length;N++){var V=k[N],H=p[V],F=V+".hovermode";R[F]=H.hovermode,O[F]=!1;for(var U=0;U<3;U++){var W=w[U],q=V+"."+W+".showspikes";O[q]=!1,R[q]=H[W].showspikes}}A._previousVal=R}return O}function f(M,E){var A=s(M,E);c.call("_guiRelayout",M,A)}a.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(M){return r(M,"Zoom in")},attr:"zoom",val:"in",icon:S.zoom_plus,click:x},a.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(M){return r(M,"Zoom out")},attr:"zoom",val:"out",icon:S.zoom_minus,click:x},a.resetGeo={name:"resetGeo",_cat:"reset",title:function(M){return r(M,"Reset")},attr:"reset",val:null,icon:S.autoscale,click:x},a.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(M){return r(M,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:S.tooltip_basic,gravity:"ne",click:v};function x(M,E){for(var A=E.currentTarget,h=A.getAttribute("data-attr"),p=A.getAttribute("data-val")||!0,k=M._fullLayout,w=k._subplots.geo||[],R=0;R<w.length;R++){var O=w[R],N=k[O];if(h==="zoom"){var V=N.projection.scale,H=p==="in"?2*V:.5*V;c.call("_guiRelayout",M,O+".projection.scale",H)}}h==="reset"&&C(M,"geo")}a.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(M){return r(M,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:S.tooltip_basic,gravity:"ne",click:v};function y(M){var E=M._fullLayout;return E.hovermode?!1:E._has("cartesian")?E._isHoriz?"y":"x":"closest"}function v(M){var E=y(M);c.call("_guiRelayout",M,"hovermode",E)}a.resetViewSankey={name:"resetSankeyGroup",title:function(M){return r(M,"Reset view")},icon:S.home,click:function(M){for(var E={"node.groups":[],"node.x":[],"node.y":[]},A=0;A<M._fullData.length;A++){var h=M._fullData[A]._viewInitial;E["node.groups"].push(h.node.groups.slice()),E["node.x"].push(h.node.x.slice()),E["node.y"].push(h.node.y.slice())}c.call("restyle",M,E)}},a.toggleHover={name:"toggleHover",title:function(M){return r(M,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:S.tooltip_basic,gravity:"ne",click:function(M,E){var A=s(M,E);A.hovermode=y(M),c.call("_guiRelayout",M,A)}},a.resetViews={name:"resetViews",title:function(M){return r(M,"Reset views")},icon:S.home,click:function(M,E){var A=E.currentTarget;A.setAttribute("data-attr","zoom"),A.setAttribute("data-val","reset"),n(M,E),A.setAttribute("data-attr","resetLastSave"),i(M,E),C(M,"geo"),C(M,"mapbox"),C(M,"map")}},a.toggleSpikelines={name:"toggleSpikelines",title:function(M){return r(M,"Toggle Spike Lines")},icon:S.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(M){var E=M._fullLayout,A=E._cartesianSpikesEnabled;E._cartesianSpikesEnabled=A==="on"?"off":"on",c.call("_guiRelayout",M,T(M))}};function T(M){for(var E=M._fullLayout,A=E._cartesianSpikesEnabled==="on",h=P.list(M,null,!0),p={},k=0;k<h.length;k++){var w=h[k];p[w._name+".showspikes"]=A?!0:w._showSpikeInitial}return p}a.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(M){return r(M,"Reset view")},attr:"reset",icon:S.home,click:function(M){C(M,"mapbox")}},a.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(M){return r(M,"Reset view")},attr:"reset",icon:S.home,click:function(M){C(M,"map")}},a.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(M){return r(M,"Zoom in")},attr:"zoom",val:"in",icon:S.zoom_plus,click:u},a.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(M){return r(M,"Zoom in")},attr:"zoom",val:"in",icon:S.zoom_plus,click:b},a.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(M){return r(M,"Zoom out")},attr:"zoom",val:"out",icon:S.zoom_minus,click:u},a.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(M){return r(M,"Zoom out")},attr:"zoom",val:"out",icon:S.zoom_minus,click:b};function u(M,E){_(M,E,"mapbox")}function b(M,E){_(M,E,"map")}function _(M,E,A){for(var h=E.currentTarget,p=h.getAttribute("data-val"),k=M._fullLayout,w=k._subplots[A]||[],R=1.05,O={},N=0;N<w.length;N++){var V=w[N],H=k[V].zoom,F=p==="in"?R*H:H/R;O[V+".zoom"]=F}c.call("_guiRelayout",M,O)}function C(M,E){for(var A=M._fullLayout,h=A._subplots[E]||[],p={},k=0;k<h.length;k++)for(var w=h[k],R=A[w]._subplot,O=R.viewInitial,N=Object.keys(O),V=0;V<N.length;V++){var H=N[V];p[w+"."+H]=O[H]}c.call("_guiRelayout",M,p)}}),B_=Ft((Q,$)=>{var c=gv(),g=Object.keys(c),P=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],S=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(P),t=[],e=function(r){if(S.indexOf(r._cat||r.name)===-1){var a=r.name,n=(r._cat||r.name).toLowerCase();t.indexOf(a)===-1&&t.push(a),t.indexOf(n)===-1&&t.push(n)}};g.forEach(function(r){e(c[r])}),t.sort(),$.exports={DRAW_MODES:P,backButtons:S,foreButtons:t}}),M1=Ft((Q,$)=>{B_(),$.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"}}}),g6=Ft((Q,$)=>{var c=bn(),g=li(),P=pu(),S=M1();$.exports=function(t,e){var r=t.modebar||{},a=P.newContainer(e,"modebar");function n(i,s){return c.coerce(r,a,S,i,s)}n("orientation"),n("bgcolor",g.addOpacity(e.paper_bgcolor,.5));var o=g.contrast(g.rgb(e.modebar.bgcolor));n("color",g.addOpacity(o,.3)),n("activecolor",g.addOpacity(o,.7)),n("uirevision",e.uirevision),n("add"),n("remove")}}),Bm=Ft((Q,$)=>{var c=un(),g=ra(),P=bn(),S=D_(),t=Qi().version,e=new DOMParser;function r(i){this.container=i.container,this.element=document.createElement("div"),this.update(i.graphInfo,i.buttons),this.container.appendChild(this.element)}var a=r.prototype;a.update=function(i,s){this.graphInfo=i;var f=this.graphInfo._context,x=this.graphInfo._fullLayout,y="modebar-"+x._uid;this.element.setAttribute("id",y),this.element.setAttribute("role","toolbar"),this._uid=y,this.element.className="modebar modebar--custom",f.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),x.modebar.orientation==="v"&&(this.element.className+=" vertical",s=s.reverse());var v=x.modebar,T="#"+y+" .modebar-group";document.querySelectorAll(T).forEach(function(M){M.style.backgroundColor=v.bgcolor});var u=!this.hasButtons(s),b=this.hasLogo!==f.displaylogo,_=this.locale!==f.locale;if(this.locale=f.locale,(u||b||_)&&(this.removeAllButtons(),this.updateButtons(s),f.watermark||f.displaylogo)){var C=this.getLogo();f.watermark&&(C.className=C.className+" watermark"),x.modebar.orientation==="v"?this.element.insertBefore(C,this.element.childNodes[0]):this.element.appendChild(C),this.hasLogo=!0}this.updateActiveButton(),P.setStyleOnHover("#"+y+" .modebar-btn",".active",".icon path","fill: "+v.activecolor,"fill: "+v.color,this.element)},a.updateButtons=function(i){var s=this;this.buttons=i,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(f){var x=s.createGroup();f.forEach(function(y){var v=y.name;if(!v)throw new Error("must provide button 'name' in button config");if(s.buttonsNames.indexOf(v)!==-1)throw new Error("button name '"+v+"' is taken");s.buttonsNames.push(v);var T=s.createButton(y);s.buttonElements.push(T),x.appendChild(T)}),s.element.appendChild(x)})},a.createGroup=function(){var i=document.createElement("div");i.className="modebar-group";var s=this.graphInfo._fullLayout.modebar;return i.style.backgroundColor=s.bgcolor,i},a.createButton=function(i){var s=this,f=document.createElement("button");f.setAttribute("type","button"),f.setAttribute("rel","tooltip"),f.className="modebar-btn";var x=i.title;x===void 0?x=i.name:typeof x=="function"&&(x=x(this.graphInfo)),(x||x===0)&&(f.setAttribute("data-title",x),f.setAttribute("aria-label",x)),i.attr!==void 0&&f.setAttribute("data-attr",i.attr);var y=i.val;y!==void 0&&(typeof y=="function"&&(y=y(this.graphInfo)),f.setAttribute("data-val",y));var v=i.click;if(typeof v!="function")throw new Error("must provide button 'click' function in button config");f.addEventListener("click",function(u){i.click(s.graphInfo,u),s.updateActiveButton(u.currentTarget)}),f.setAttribute("data-toggle",i.toggle||!1),i.toggle&&c.select(f).classed("active",!0);var T=i.icon;return typeof T=="function"?f.appendChild(T()):f.appendChild(this.createIcon(T||S.question)),f.setAttribute("data-gravity",i.gravity||"n"),f},a.createIcon=function(i){var s=g(i.height)?Number(i.height):i.ascent-i.descent,f="http://www.w3.org/2000/svg",x;if(i.path){x=document.createElementNS(f,"svg"),x.setAttribute("viewBox",[0,0,i.width,s].join(" ")),x.setAttribute("class","icon");var y=document.createElementNS(f,"path");y.setAttribute("d",i.path),i.transform?y.setAttribute("transform",i.transform):i.ascent!==void 0&&y.setAttribute("transform","matrix(1 0 0 -1 0 "+i.ascent+")"),x.appendChild(y)}if(i.svg){var v=e.parseFromString(i.svg,"application/xml");x=v.childNodes[0]}return x.setAttribute("height","1em"),x.setAttribute("width","1em"),x},a.updateActiveButton=function(i){var s=this.graphInfo._fullLayout,f=i!==void 0?i.getAttribute("data-attr"):null;this.buttonElements.forEach(function(x){var y=x.getAttribute("data-val")||!0,v=x.getAttribute("data-attr"),T=x.getAttribute("data-toggle")==="true",u=c.select(x),b=function(M,E){var A=s.modebar,h=M.querySelector(".icon path");h&&(E||M.matches(":hover")?h.style.fill=A.activecolor:h.style.fill=A.color)};if(T){if(v===f){var _=!u.classed("active");u.classed("active",_),b(x,_)}}else{var C=v===null?v:P.nestedProperty(s,v).get();u.classed("active",C===y),b(x,C===y)}})},a.hasButtons=function(i){var s=this.buttons;if(!s||i.length!==s.length)return!1;for(var f=0;f<i.length;++f){if(i[f].length!==s[f].length)return!1;for(var x=0;x<i[f].length;x++)if(i[f][x].name!==s[f][x].name)return!1}return!0};function n(i){return i+" (v"+t+")"}a.getLogo=function(){var i=this.createGroup(),s=document.createElement("a");return s.href="https://plotly.com/",s.target="_blank",s.setAttribute("data-title",n(P._(this.graphInfo,"Produced with Plotly.js"))),s.className="modebar-btn plotlyjsicon modebar-btn--logo",s.appendChild(this.createIcon(S.newplotlylogo)),i.appendChild(s),i},a.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},a.destroy=function(){P.removeElement(this.container.querySelector(".modebar"))};function o(i,s){var f=i._fullLayout,x=new r({graphInfo:i,container:f._modebardiv.node(),buttons:s});return f._privateplot&&c.select(x.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),x}$.exports=o}),jy=Ft((Q,$)=>{var c=Rc(),g=Ac(),P=Xo(),S=Dp().isUnifiedHover,t=Bm(),e=gv(),r=B_().DRAW_MODES,a=bn().extendDeep;$.exports=function(y){var v=y._fullLayout,T=y._context,u=v._modeBar;if(!T.displayModeBar&&!T.watermark){u&&(u.destroy(),delete v._modeBar);return}if(!Array.isArray(T.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(T.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var b=T.modeBarButtons,_;Array.isArray(b)&&b.length?_=x(b):!T.displayModeBar&&T.watermark?_=[]:_=n(y),u?u.update(y,_):v._modeBar=t(y,_)};function n(y){var v=y._fullLayout,T=y._fullData,u=y._context;function b(Y,ft){if(typeof ft=="string"){if(ft.toLowerCase()===Y.toLowerCase())return!0}else{var ut=ft.name,wt=ft._cat||ft.name;if(ut===Y||wt===Y.toLowerCase())return!0}return!1}var _=v.modebar.add;typeof _=="string"&&(_=[_]);var C=v.modebar.remove;typeof C=="string"&&(C=[C]);var M=u.modeBarButtonsToAdd.concat(_.filter(function(Y){for(var ft=0;ft<u.modeBarButtonsToRemove.length;ft++)if(b(Y,u.modeBarButtonsToRemove[ft]))return!1;return!0})),E=u.modeBarButtonsToRemove.concat(C.filter(function(Y){for(var ft=0;ft<u.modeBarButtonsToAdd.length;ft++)if(b(Y,u.modeBarButtonsToAdd[ft]))return!1;return!0})),A=v._has("cartesian"),h=v._has("gl3d"),p=v._has("geo"),k=v._has("pie"),w=v._has("funnelarea"),R=v._has("ternary"),O=v._has("mapbox"),N=v._has("map"),V=v._has("polar"),H=v._has("smith"),F=v._has("sankey"),U=o(v),W=S(v.hovermode),q=[];function X(Y){if(Y.length){for(var ft=[],ut=0;ut<Y.length;ut++){for(var wt=Y[ut],zt=e[wt],Pt=zt.name.toLowerCase(),Wt=(zt._cat||zt.name).toLowerCase(),Ht=!1,Jt=0;Jt<E.length;Jt++){var ge=E[Jt].toLowerCase();if(ge===Pt||ge===Wt){Ht=!0;break}}Ht||ft.push(e[wt])}q.push(ft)}}var lt=["toImage"];u.showEditInChartStudio?lt.push("editInChartStudio"):u.showSendToCloud&&lt.push("sendDataToCloud"),X(lt);var yt=[],pt=[],st=[],tt=[];(A||k||w||R)+p+h+O+N+V+H>1?(pt=["toggleHover"],st=["resetViews"]):p?(yt=["zoomInGeo","zoomOutGeo"],pt=["hoverClosestGeo"],st=["resetGeo"]):h?(pt=["hoverClosest3d"],st=["resetCameraDefault3d","resetCameraLastSave3d"]):O?(yt=["zoomInMapbox","zoomOutMapbox"],pt=["toggleHover"],st=["resetViewMapbox"]):N?(yt=["zoomInMap","zoomOutMap"],pt=["toggleHover"],st=["resetViewMap"]):k?pt=["hoverClosestPie"]:F?(pt=["hoverClosestCartesian","hoverCompareCartesian"],st=["resetViewSankey"]):pt=["toggleHover"],A&&pt.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||W)&&(pt=[]),A&&!U&&(yt=["zoomIn2d","zoomOut2d","autoScale2d"],st[0]!=="resetViews"&&(st=["resetScale2d"])),h?tt=["zoom3d","pan3d","orbitRotation","tableRotation"]:A&&!U||R?tt=["zoom2d","pan2d"]:O||N||p?tt=["pan2d"]:V&&(tt=["zoom2d"]),i(T)&&tt.push("select2d","lasso2d");var dt=[],rt=function(Y){dt.indexOf(Y)===-1&&pt.indexOf(Y)!==-1&&dt.push(Y)};if(Array.isArray(M)){for(var at=[],vt=0;vt<M.length;vt++){var it=M[vt];typeof it=="string"?(it=it.toLowerCase(),r.indexOf(it)!==-1?(v._has("mapbox")||v._has("map")||v._has("cartesian"))&&tt.push(it):it==="togglespikelines"?rt("toggleSpikelines"):it==="togglehover"?rt("toggleHover"):it==="hovercompare"?rt("hoverCompareCartesian"):it==="hoverclosest"?(rt("hoverClosestCartesian"),rt("hoverClosestGeo"),rt("hoverClosest3d"),rt("hoverClosestPie")):it==="v1hovermode"&&(rt("hoverClosestCartesian"),rt("hoverCompareCartesian"),rt("hoverClosestGeo"),rt("hoverClosest3d"),rt("hoverClosestPie"))):at.push(it)}M=at}return X(tt),X(yt.concat(st)),X(dt),f(q,M)}function o(y){for(var v=c.list({_fullLayout:y},null,!0),T=0;T<v.length;T++){var u=v[T].modebardisable;if(!v[T].fixedrange&&u!=="autoscale+zoominout"&&u!=="zoominout+autoscale")return!1}return!0}function i(y){for(var v=!1,T=0;T<y.length&&!v;T++){var u=y[T];!u._module||!u._module.selectPoints||(P.traceIs(u,"scatter-like")?(g.hasMarkers(u)||g.hasText(u))&&(v=!0):P.traceIs(u,"box-violin")?(u.boxpoints==="all"||u.points==="all")&&(v=!0):v=!0)}return v}function s(y){for(var v=0;v<y.length;v++)if(!P.traceIs(y[v],"noHover"))return!1;return!0}function f(y,v){if(v.length)if(Array.isArray(v[0]))for(var T=0;T<v.length;T++)y.push(v[T]);else y.push(v);return y}function x(y){for(var v=a([],y),T=0;T<v.length;T++)for(var u=v[T],b=0;b<u.length;b++){var _=u[b];if(typeof _=="string")if(e[_]!==void 0)v[T][b]=e[_];else throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "))}return v}}),ww=Ft((Q,$)=>{$.exports={moduleType:"component",name:"modebar",layoutAttributes:M1(),supplyLayoutDefaults:g6(),manage:jy()}}),Uy=Ft((Q,$)=>{var c=Af().FROM_BL;$.exports=function(g,P,S){S===void 0&&(S=c[g.constraintoward||"center"]);var t=[g.r2l(g.range[0]),g.r2l(g.range[1])],e=t[0]+(t[1]-t[0])*S;g.range=g._input.range=[g.l2r(e+(t[0]-e)*P),g.l2r(e+(t[1]-e)*P)],g.setScale()}}),vv=Ft(Q=>{var $=bn(),c=Y0(),g=Rc().id2name,P=Ad(),S=Uy(),t=i0(),e=Da().ALMOST_EQUAL,r=Af().FROM_BL;Q.handleDefaults=function(y,v,T){var u=T.axIds,b=T.axHasImage,_=v._axisConstraintGroups=[],C=v._axisMatchGroups=[],M,E,A,h,p,k,w,R;for(M=0;M<u.length;M++)h=g(u[M]),p=y[h],k=v[h],a(p,k,{axIds:u,layoutOut:v,hasImage:b[h]});function O(lt,yt){for(M=0;M<lt.length;M++){E=lt[M];for(A in E)v[g(A)][yt]=E}}for(O(C,"_matchGroup"),M=0;M<_.length;M++){E=_[M];for(A in E)if(k=v[g(A)],k.fixedrange){for(var N in E){var V=g(N);(y[V]||{}).fixedrange===!1&&$.warn("fixedrange was specified as false for axis "+V+" but was overridden because another axis in its constraint group has fixedrange true"),v[V].fixedrange=!0}break}}for(M=0;M<_.length;){E=_[M];for(A in E){k=v[g(A)],k._matchGroup&&Object.keys(k._matchGroup).length===Object.keys(E).length&&(_.splice(M,1),M--);break}M++}O(_,"_constraintGroup");var H=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],F=!1,U=!1;function W(){R=k[w],w==="rangebreaks"&&(U=k._hasDayOfWeekBreaks)}for(M=0;M<C.length;M++){E=C[M];for(var q=0;q<H.length;q++){w=H[q],R=null;var X;for(A in E)if(h=g(A),p=y[h],k=v[h],w in k){if(!k.matches&&(X=k,w in p)){W();break}R===null&&w in p&&W()}if(w==="range"&&R&&p.range&&p.range.length===2&&p.range[0]!==null&&p.range[1]!==null&&(F=!0),w==="autorange"&&R===null&&F&&(R=!1),R===null&&w in X&&(R=X[w]),R!==null)for(A in E)k=v[g(A)],k[w]=w==="range"?R.slice():R,w==="rangebreaks"&&(k._hasDayOfWeekBreaks=U,t(k,v))}}};function a(y,v,T){var u=T.axIds,b=T.layoutOut,_=T.hasImage,C=b._axisConstraintGroups,M=b._axisMatchGroups,E=v._id,A=E.charAt(0),h=((b._splomAxes||{})[A]||{})[E]||{},p=v._id,k=p.charAt(0)==="x";v._matchGroup=null,v._constraintGroup=null;function w(tt,dt){return $.coerce(y,v,P,tt,dt)}w("constrain",_?"domain":"range"),$.coerce(y,v,{constraintoward:{valType:"enumerated",values:k?["left","center","right"]:["bottom","middle","top"],dflt:k?"center":"middle"}},"constraintoward");var R=v.type,O,N,V=[];for(O=0;O<u.length;O++)if(N=u[O],N!==p){var H=b[g(N)];H.type===R&&V.push(N)}var F=o(C,p);if(F){var U=[];for(O=0;O<V.length;O++)N=V[O],F[N]||U.push(N);V=U}var W=V.length,q,X;W&&(y.matches||h.matches)&&(q=$.coerce(y,v,{matches:{valType:"enumerated",values:V,dflt:V.indexOf(h.matches)!==-1?h.matches:void 0}},"matches"));var lt=_&&!k?v.anchor:void 0;if(W&&!q&&(y.scaleanchor||lt)&&(X=$.coerce(y,v,{scaleanchor:{valType:"enumerated",values:V.concat([!1])}},"scaleanchor",lt)),q){v._matchGroup=i(M,p,q,1);var yt=b[g(q)],pt=n(b,v)/n(b,yt);k!==(q.charAt(0)==="x")&&(pt=(k?"x":"y")+pt),i(C,p,q,pt)}else y.matches&&u.indexOf(y.matches)!==-1&&$.warn("ignored "+v._name+'.matches: "'+y.matches+'" to avoid an infinite loop');if(X){var st=w("scaleratio");st||(st=v.scaleratio=1),i(C,p,X,st)}else y.scaleanchor&&u.indexOf(y.scaleanchor)!==-1&&$.warn("ignored "+v._name+'.scaleanchor: "'+y.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function n(y,v){var T=v.domain;return T||(T=y[g(v.overlaying)].domain),T[1]-T[0]}function o(y,v){for(var T=0;T<y.length;T++)if(y[T][v])return y[T];return null}function i(y,v,T,u){var b,_,C,M,E,A=o(y,v);A===null?(A={},A[v]=1,E=y.length,y.push(A)):E=y.indexOf(A);var h=Object.keys(A);for(b=0;b<y.length;b++)if(C=y[b],b!==E&&C[T]){var p=C[T];for(_=0;_<h.length;_++)M=h[_],C[M]=s(p,s(u,A[M]));y.splice(E,1);return}if(u!==1)for(_=0;_<h.length;_++){var k=h[_];A[k]=s(u,A[k])}A[T]=1}function s(y,v){var T="",u="",b,_;typeof y=="string"&&(T=y.match(/^[xy]*/)[0],b=T.length,y=+y.substr(b)),typeof v=="string"&&(u=v.match(/^[xy]*/)[0],_=u.length,v=+v.substr(_));var C=y*v;return!b&&!_?C:!b||!_||T.charAt(0)===u.charAt(0)?T+u+y*v:b===_?C:(b>_?T.substr(_):u.substr(b))+C}function f(y,v){for(var T=v._size,u=T.h/T.w,b={},_=Object.keys(y),C=0;C<_.length;C++){var M=_[C],E=y[M];if(typeof E=="string"){var A=E.match(/^[xy]*/)[0],h=A.length;E=+E.substr(h);for(var p=A.charAt(0)==="y"?u:1/u,k=0;k<h;k++)E*=p}b[M]=E}return b}Q.enforce=function(y){var v=y._fullLayout,T=v._axisConstraintGroups||[],u,b,_,C,M,E,A,h;for(u=0;u<T.length;u++){_=f(T[u],v);var p=Object.keys(_),k=1/0,w=0,R=1/0,O={},N={},V=!1;for(b=0;b<p.length;b++)C=p[b],N[C]=M=v[g(C)],M._inputDomain?M.domain=M._inputDomain.slice():M._inputDomain=M.domain.slice(),M._inputRange||(M._inputRange=M.range.slice()),M.setScale(),O[C]=E=Math.abs(M._m)/_[C],k=Math.min(k,E),(M.constrain==="domain"||!M._constraintShrinkable)&&(R=Math.min(R,E)),delete M._constraintShrinkable,w=Math.max(w,E),M.constrain==="domain"&&(V=!0);if(!(k>e*w&&!V)){for(b=0;b<p.length;b++)if(C=p[b],E=O[C],M=N[C],A=M.constrain,E!==R||A==="domain")if(h=E/R,A==="range")S(M,h);else{var H=M._inputDomain,F=(M.domain[1]-M.domain[0])/(H[1]-H[0]),U=(M.r2l(M.range[1])-M.r2l(M.range[0]))/(M.r2l(M._inputRange[1])-M.r2l(M._inputRange[0]));if(h/=F,h*U<1){M.domain=M._input.domain=H.slice(),S(M,h);continue}if(U<1&&(M.range=M._input.range=M._inputRange.slice(),h*=U),M.autorange){var W=M.r2l(M.range[0]),q=M.r2l(M.range[1]),X=(W+q)/2,lt=X,yt=X,pt=Math.abs(q-X),st=X-pt*h*1.0001,tt=X+pt*h*1.0001,dt=c.makePadFn(v,M,0),rt=c.makePadFn(v,M,1);x(M,h);var at=Math.abs(M._m),vt=c.concatExtremes(y,M),it=vt.min,Y=vt.max,ft,ut;for(ut=0;ut<it.length;ut++)ft=it[ut].val-dt(it[ut])/at,ft>st&&ft<lt&&(lt=ft);for(ut=0;ut<Y.length;ut++)ft=Y[ut].val+rt(Y[ut])/at,ft<tt&&ft>yt&&(yt=ft);var wt=(yt-lt)/(2*pt);h/=wt,lt=M.l2r(lt),yt=M.l2r(yt),M.range=M._input.range=W<q?[lt,yt]:[yt,lt]}x(M,h)}}}},Q.getAxisGroup=function(y,v){for(var T=y._axisMatchGroups,u=0;u<T.length;u++){var b=T[u];if(b[v])return"g"+u}return v},Q.clean=function(y,v){if(v._inputDomain){for(var T=!1,u=v._id,b=y._fullLayout._axisConstraintGroups,_=0;_<b.length;_++)if(b[_][u]){T=!0;break}(!T||v.constrain!=="domain")&&(v._input.domain=v.domain=v._inputDomain,delete v._inputDomain)}};function x(y,v){var T=y._inputDomain,u=r[y.constraintoward],b=T[0]+(T[1]-T[0])*u;y.domain=y._input.domain=[b+(T[0]-b)/v,b+(T[1]-b)/v],y.setScale()}}),y0=Ft(Q=>{var $=un(),c=Xo(),g=Kc(),P=bn(),S=tc(),t=mv(),e=li(),r=js(),a=lp(),n=ww(),o=Es(),i=Af(),s=vv(),f=s.enforce,x=s.clean,y=Y0().doAutoRange,v="start",T="middle",u="end",b=ic().zindexSeparator;Q.layoutStyles=function(F){return P.syncOrAsync([g.doAutoMargin,C],F)};function _(F,U,W){for(var q=0;q<W.length;q++){var X=W[q][0],lt=W[q][1];if(!(X[0]>=F[1]||X[1]<=F[0])&&lt[0]<U[1]&&lt[1]>U[0])return!0}return!1}function C(F){var U=F._fullLayout,W=U._size,q=W.p,X=o.list(F,"",!0),lt,yt,pt,st,tt,dt;if(U._paperdiv.style({width:F._context.responsive&&U.autosize&&!F._context._hasZeroWidth&&!F.layout.width?"100%":U.width+"px",height:F._context.responsive&&U.autosize&&!F._context._hasZeroHeight&&!F.layout.height?"100%":U.height+"px"}).selectAll(".main-svg").call(r.setSize,U.width,U.height),F._context.setBackground(F,U.paper_bgcolor),Q.drawMainTitle(F),n.manage(F),!U._has("cartesian"))return g.previousPromises(F);function rt(Ct,gt,St){var Nt=Ct._lw/2;if(Ct._id.charAt(0)==="x"){if(gt){if(St==="top")return gt._offset-q-Nt}else return W.t+W.h*(1-(Ct.position||0))+Nt%1;return gt._offset+gt._length+q+Nt}if(gt){if(St==="right")return gt._offset+gt._length+q+Nt}else return W.l+W.w*(Ct.position||0)+Nt%1;return gt._offset-q-Nt}for(lt=0;lt<X.length;lt++){st=X[lt];var at=st._anchorAxis;st._linepositions={},st._lw=r.crispRound(F,st.linewidth,1),st._mainLinePosition=rt(st,at,st.side),st._mainMirrorPosition=st.mirror&&at?rt(st,at,i.OPPOSITE_SIDE[st.side]):null}var vt=[],it=[],Y=[],ft=e.opacity(U.paper_bgcolor)===1&&e.opacity(U.plot_bgcolor)===1&&U.paper_bgcolor===U.plot_bgcolor;for(yt in U._plots)if(pt=U._plots[yt],pt.mainplot)pt.bg&&pt.bg.remove(),pt.bg=void 0;else{var ut=pt.xaxis.domain,wt=pt.yaxis.domain,zt=pt.plotgroup;if(_(ut,wt,Y)&&yt.indexOf(b)===-1){var Pt=zt.node(),Wt=pt.bg=P.ensureSingle(zt,"rect","bg");Pt.insertBefore(Wt.node(),Pt.childNodes[0]),it.push(yt)}else zt.select("rect.bg").remove(),Y.push([ut,wt]),ft||(vt.push(yt),it.push(yt))}var Ht=U._bgLayer.selectAll(".bg").data(vt);for(Ht.enter().append("rect").classed("bg",!0),Ht.exit().remove(),Ht.each(function(Ct){U._plots[Ct].bg=$.select(this)}),lt=0;lt<it.length;lt++)pt=U._plots[it[lt]],tt=pt.xaxis,dt=pt.yaxis,pt.bg&&tt._offset!==void 0&&dt._offset!==void 0&&pt.bg.call(r.setRect,tt._offset-q,dt._offset-q,tt._length+2*q,dt._length+2*q).call(e.fill,U.plot_bgcolor).style("stroke-width",0);if(!U._hasOnlyLargeSploms)for(yt in U._plots){pt=U._plots[yt],tt=pt.xaxis,dt=pt.yaxis;var Jt=pt.clipId="clip"+U._uid+yt+"plot",ge=P.ensureSingleById(U._clips,"clipPath",Jt,function(Ct){Ct.classed("plotclip",!0).append("rect")});pt.clipRect=ge.select("rect").attr({width:tt._length,height:dt._length}),r.setTranslate(pt.plot,tt._offset,dt._offset);var he,de;pt._hasClipOnAxisFalse?(he=null,de=Jt):(he=Jt,de=null),r.setClipUrl(pt.plot,he,F),pt.layerClipId=de}var se,Tt,Lt,Mt,te,ve,oe,Te,He,Ge,cr,ur,jr;function Hr(Ct){return"M"+se+","+Ct+"H"+Tt}function br(Ct){return"M"+tt._offset+","+Ct+"h"+tt._length}function Kr(Ct){return"M"+Ct+","+Te+"V"+oe}function rn(Ct){return dt._shift!==void 0&&(Ct+=dt._shift),"M"+Ct+","+dt._offset+"v"+dt._length}function Ce(Ct,gt,St){if(!Ct.showline||yt!==Ct._mainSubplot)return"";if(!Ct._anchorAxis)return St(Ct._mainLinePosition);var Nt=gt(Ct._mainLinePosition);return Ct.mirror&&(Nt+=gt(Ct._mainMirrorPosition)),Nt}for(yt in U._plots){pt=U._plots[yt],tt=pt.xaxis,dt=pt.yaxis;var $t="M0,0";M(tt,yt)&&(te=A(tt,"left",dt,X),se=tt._offset-(te?q+te:0),ve=A(tt,"right",dt,X),Tt=tt._offset+tt._length+(ve?q+ve:0),Lt=rt(tt,dt,"bottom"),Mt=rt(tt,dt,"top"),jr=!tt._anchorAxis||yt!==tt._mainSubplot,jr&&(tt.mirror==="allticks"||tt.mirror==="all")&&(tt._linepositions[yt]=[Lt,Mt]),$t=Ce(tt,Hr,br),jr&&tt.showline&&(tt.mirror==="all"||tt.mirror==="allticks")&&($t+=Hr(Lt)+Hr(Mt)),pt.xlines.style("stroke-width",tt._lw+"px").call(e.stroke,tt.showline?tt.linecolor:"rgba(0,0,0,0)")),pt.xlines.attr("d",$t);var ne="M0,0";M(dt,yt)&&(cr=A(dt,"bottom",tt,X),oe=dt._offset+dt._length+(cr?q:0),ur=A(dt,"top",tt,X),Te=dt._offset-(ur?q:0),He=rt(dt,tt,"left"),Ge=rt(dt,tt,"right"),jr=!dt._anchorAxis||yt!==dt._mainSubplot,jr&&(dt.mirror==="allticks"||dt.mirror==="all")&&(dt._linepositions[yt]=[He,Ge]),ne=Ce(dt,Kr,rn),jr&&dt.showline&&(dt.mirror==="all"||dt.mirror==="allticks")&&(ne+=Kr(He)+Kr(Ge)),pt.ylines.style("stroke-width",dt._lw+"px").call(e.stroke,dt.showline?dt.linecolor:"rgba(0,0,0,0)")),pt.ylines.attr("d",ne)}return o.makeClipPaths(F),g.previousPromises(F)}function M(F,U){return(F.ticks||F.showline)&&(U===F._mainSubplot||F.mirror==="all"||F.mirror==="allticks")}function E(F,U,W){if(!W.showline||!W._lw)return!1;if(W.mirror==="all"||W.mirror==="allticks")return!0;var q=W._anchorAxis;if(!q)return!1;var X=i.FROM_BL[U];return W.side===U?q.domain[X]===F.domain[X]:W.mirror&&q.domain[1-X]===F.domain[1-X]}function A(F,U,W,q){if(E(F,U,W))return W._lw;for(var X=0;X<q.length;X++){var lt=q[X];if(lt._mainAxis===W._mainAxis&&E(F,U,lt))return lt._lw}return 0}Q.drawMainTitle=function(F){var U=F._fullLayout.title,W=F._fullLayout,q=V(W),X=H(W),lt=O(W,X),yt=R(W,q);if(a.draw(F,"gtitle",{propContainer:W,propName:"title.text",subtitlePropName:"title.subtitle.text",placeholder:W._dfltTitle.plot,subtitlePlaceholder:W._dfltTitle.subtitle,attributes:{x:yt,y:lt,"text-anchor":q,dy:X}}),U.text&&U.automargin){var pt=$.select(F).selectAll(".gtitle"),st=r.bBox($.select(F).selectAll(".g-gtitle").node()).height,tt=k(F,U,st);if(tt>0){w(F,lt,tt,st),pt.attr({x:yt,y:lt,"text-anchor":q,dy:N(U.yanchor)}).call(S.positionText,yt,lt);var dt=(U.text.match(S.BR_TAG_ALL)||[]).length;if(dt){var rt=i.LINE_SPACING*dt+i.MID_SHIFT;U.y===0&&(rt=-rt),pt.selectAll(".line").each(function(){var ft=+this.getAttribute("dy").slice(0,-2)-rt+"em";this.setAttribute("dy",ft)})}var at=$.select(F).selectAll(".gtitle-subtitle");if(at.node()){var vt=pt.node().getBBox(),it=vt.y+vt.height,Y=it+a.SUBTITLE_PADDING_EM*U.subtitle.font.size;at.attr({x:yt,y:Y,"text-anchor":q,dy:N(U.yanchor)}).call(S.positionText,yt,Y)}}}};function h(F,U,W,q,X){var lt=U.yref==="paper"?F._fullLayout._size.h:F._fullLayout.height,yt=P.isTopAnchor(U)?q:q-X,pt=W==="b"?lt-yt:yt;return P.isTopAnchor(U)&&W==="t"||P.isBottomAnchor(U)&&W==="b"?!1:pt<X}function p(F,U,W,q,X){var lt=0;return W==="middle"&&(lt+=X/2),F==="t"?(W==="top"&&(lt+=X),lt+=q-U*q):(W==="bottom"&&(lt+=X),lt+=U*q),lt}function k(F,U,W){var q=U.y,X=U.yanchor,lt=q>.5?"t":"b",yt=F._fullLayout.margin[lt],pt=0;return U.yref==="paper"?pt=W+U.pad.t+U.pad.b:U.yref==="container"&&(pt=p(lt,q,X,F._fullLayout.height,W)+U.pad.t+U.pad.b),pt>yt?pt:0}function w(F,U,W,q){var X="title.automargin",lt=F._fullLayout.title,yt=lt.y>.5?"t":"b",pt={x:lt.x,y:lt.y,t:0,b:0},st={};lt.yref==="paper"&&h(F,lt,yt,U,q)?pt[yt]=W:lt.yref==="container"&&(st[yt]=W,F._fullLayout._reservedMargin[X]=st),g.allowAutoMargin(F,X),g.autoMargin(F,X,pt)}function R(F,U){var W=F.title,q=F._size,X=0;switch(U===v?X=W.pad.l:U===u&&(X=-W.pad.r),W.xref){case"paper":return q.l+q.w*W.x+X;case"container":default:return F.width*W.x+X}}function O(F,U){var W=F.title,q=F._size,X=0;if(U==="0em"||!U?X=-W.pad.b:U===i.CAP_SHIFT+"em"&&(X=W.pad.t),W.y==="auto")return q.t/2;switch(W.yref){case"paper":return q.t+q.h-q.h*W.y+X;case"container":default:return F.height-F.height*W.y+X}}function N(F){return F==="top"?i.CAP_SHIFT+.3+"em":F==="bottom"?"-0.3em":i.MID_SHIFT+"em"}function V(F){var U=F.title,W=T;return P.isRightAnchor(U)?W=u:P.isLeftAnchor(U)&&(W=v),W}function H(F){var U=F.title,W="0em";return P.isTopAnchor(U)?W=i.CAP_SHIFT+"em":P.isMiddleAnchor(U)&&(W=i.MID_SHIFT+"em"),W}Q.doTraceStyle=function(F){var U=F.calcdata,W=[],q;for(q=0;q<U.length;q++){var X=U[q],lt=X[0]||{},yt=lt.trace||{},pt=yt._module||{},st=pt.arraysToCalcdata;st&&st(X,yt);var tt=pt.editStyle;tt&&W.push({fn:tt,cd0:lt})}if(W.length){for(q=0;q<W.length;q++){var dt=W[q];dt.fn(F,dt.cd0)}t(F),Q.redrawReglTraces(F)}return g.style(F),c.getComponentMethod("legend","draw")(F),g.previousPromises(F)},Q.doColorBars=function(F){return c.getComponentMethod("colorbar","draw")(F),g.previousPromises(F)},Q.layoutReplot=function(F){var U=F.layout;return F.layout=void 0,c.call("_doPlot",F,"",U)},Q.doLegend=function(F){return c.getComponentMethod("legend","draw")(F),g.previousPromises(F)},Q.doTicksRelayout=function(F){return o.draw(F,"redraw"),F._fullLayout._hasOnlyLargeSploms&&(c.subplotsRegistry.splom.updateGrid(F),t(F),Q.redrawReglTraces(F)),Q.drawMainTitle(F),g.previousPromises(F)},Q.doModeBar=function(F){var U=F._fullLayout;n.manage(F);for(var W=0;W<U._basePlotModules.length;W++){var q=U._basePlotModules[W].updateFx;q&&q(F)}return g.previousPromises(F)},Q.doCamera=function(F){for(var U=F._fullLayout,W=U._subplots.gl3d,q=0;q<W.length;q++){var X=U[W[q]],lt=X._scene;lt.setViewport(X)}},Q.drawData=function(F){var U=F._fullLayout;t(F);for(var W=U._basePlotModules,q=0;q<W.length;q++)W[q].plot(F);return Q.redrawReglTraces(F),g.style(F),c.getComponentMethod("selections","draw")(F),c.getComponentMethod("shapes","draw")(F),c.getComponentMethod("annotations","draw")(F),c.getComponentMethod("images","draw")(F),U._replotting=!1,g.previousPromises(F)},Q.redrawReglTraces=function(F){var U=F._fullLayout;if(U._has("regl")){var W=F._fullData,q=[],X=[],lt,yt;for(U._hasOnlyLargeSploms&&U._splomGrid.draw(),lt=0;lt<W.length;lt++){var pt=W[lt];pt.visible===!0&&pt._length!==0&&(pt.type==="splom"?U._splomScenes[pt.uid].draw():pt.type==="scattergl"?P.pushUnique(q,pt.xaxis+pt.yaxis):pt.type==="scatterpolargl"&&P.pushUnique(X,pt.subplot))}for(lt=0;lt<q.length;lt++)yt=U._plots[q[lt]],yt._scene&&yt._scene.draw();for(lt=0;lt<X.length;lt++)yt=U[X[lt]]._subplot,yt._scene&&yt._scene.draw()}},Q.doAutoRangeAndConstraints=function(F){for(var U=o.list(F,"",!0),W,q={},X=0;X<U.length;X++)if(W=U[X],!q[W._id]){q[W._id]=1,x(F,W),y(F,W);var lt=W._matchGroup;if(lt)for(var yt in lt){var pt=o.getFromId(F,yt);y(F,pt,W.range),q[yt]=1}}f(F)},Q.finalDraw=function(F){c.getComponentMethod("rangeslider","draw")(F),c.getComponentMethod("rangeselector","draw")(F)},Q.drawMarginPushers=function(F){c.getComponentMethod("legend","draw")(F),c.getComponentMethod("rangeselector","draw")(F),c.getComponentMethod("sliders","draw")(F),c.getComponentMethod("updatemenus","draw")(F),c.getComponentMethod("colorbar","draw")(F)}}),kw=Ft((Q,$)=>{var c=kg().readPaths,g=Rm(),P=C0().clearOutlineControllers,S=li(),t=js(),e=pu().arrayEditor,r=bp(),a=r.getPathString;$.exports={draw:n,drawOne:i,activateLastSelection:x};function n(v){var T=v._fullLayout;P(v),T._selectionLayer.selectAll("path").remove();for(var u in T._plots){var b=T._plots[u].selectionLayer;b&&b.selectAll("path").remove()}for(var _=0;_<T.selections.length;_++)i(v,_)}function o(v){return v._context.editSelection}function i(v,T){v._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+T+'"]').remove();var u=r.makeSelectionsOptionsAndPlotinfo(v,T),b=u.options,_=u.plotinfo;if(!b._input)return;C(v._fullLayout._selectionLayer);function C(M){var E=a(v,b),A={"data-index":T,"fill-rule":"evenodd",d:E},h=b.opacity,p="rgba(0,0,0,0)",k=b.line.color||S.contrast(v._fullLayout.plot_bgcolor),w=b.line.width,R=b.line.dash;w||(w=5,R="solid");var O=o(v)&&v._fullLayout._activeSelectionIndex===T;O&&(p=v._fullLayout.activeselection.fillcolor,h=v._fullLayout.activeselection.opacity);for(var N=[],V=1;V>=0;V--){var H=M.append("path").attr(A).style("opacity",V?.1:h).call(S.stroke,k).call(S.fill,p).call(t.dashLine,V?"solid":R,V?4+w:w);if(s(H,v,b),O){var F=e(v.layout,"selections",b);H.style({cursor:"move"});var U={element:H.node(),plotinfo:_,gd:v,editHelpers:F,isActiveSelection:!0},W=c(E,v);g(W,H,U)}else H.style("pointer-events",V?"all":"none");N[V]=H}var q=N[0],X=N[1];X.node().addEventListener("click",function(){return f(v,q)})}}function s(v,T,u){var b=u.xref+u.yref;t.setClipUrl(v,"clip"+T._fullLayout._uid+b,T)}function f(v,T){if(o(v)){var u=T.node(),b=+u.getAttribute("data-index");if(b>=0){if(b===v._fullLayout._activeSelectionIndex){y(v);return}v._fullLayout._activeSelectionIndex=b,v._fullLayout._deactivateSelection=y,n(v)}}}function x(v){if(o(v)){var T=v._fullLayout.selections.length-1;v._fullLayout._activeSelectionIndex=T,v._fullLayout._deactivateSelection=y,n(v)}}function y(v){if(o(v)){var T=v._fullLayout._activeSelectionIndex;T>=0&&(P(v),delete v._fullLayout._activeSelectionIndex,n(v))}}}),yv=Ft((Q,$)=>{function c(){var g,P=0,S=!1;function t(e,r){return g.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),g}return g={list:[],segmentId:function(){return P++},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,a){return t("temp_status",{seg:e,above:r,below:a})},rewind:function(e){return t("rewind",{seg:e})},status:function(e,r,a){return t("status",{seg:e,above:r,below:a})},vert:function(e){return e===S?g:(S=e,t("vert",{x:e}))},log:function(e){return typeof e!="string"&&(e=JSON.stringify(e,!1," ")),t("log",{txt:e})},reset:function(){return t("reset")},selected:function(e){return t("selected",{segs:e})},chainStart:function(e){return t("chain_start",{seg:e})},chainRemoveHead:function(e,r){return t("chain_rem_head",{index:e,pt:r})},chainRemoveTail:function(e,r){return t("chain_rem_tail",{index:e,pt:r})},chainNew:function(e,r){return t("chain_new",{pt1:e,pt2:r})},chainMatch:function(e){return t("chain_match",{index:e})},chainClose:function(e){return t("chain_close",{index:e})},chainAddHead:function(e,r){return t("chain_add_head",{index:e,pt:r})},chainAddTail:function(e,r){return t("chain_add_tail",{index:e,pt:r})},chainConnect:function(e,r){return t("chain_con",{index1:e,index2:r})},chainReverse:function(e){return t("chain_rev",{index:e})},chainJoin:function(e,r){return t("chain_join",{index1:e,index2:r})},done:function(){return t("done")}},g}$.exports=c}),v6=Ft((Q,$)=>{function c(g){typeof g!="number"&&(g=1e-10);var P={epsilon:function(S){return typeof S=="number"&&(g=S),g},pointAboveOrOnLine:function(S,t,e){var r=t[0],a=t[1],n=e[0],o=e[1],i=S[0],s=S[1];return(n-r)*(s-a)-(o-a)*(i-r)>=-g},pointBetween:function(S,t,e){var r=S[1]-t[1],a=e[0]-t[0],n=S[0]-t[0],o=e[1]-t[1],i=n*a+r*o;if(i<g)return!1;var s=a*a+o*o;return!(i-s>-g)},pointsSameX:function(S,t){return Math.abs(S[0]-t[0])<g},pointsSameY:function(S,t){return Math.abs(S[1]-t[1])<g},pointsSame:function(S,t){return P.pointsSameX(S,t)&&P.pointsSameY(S,t)},pointsCompare:function(S,t){return P.pointsSameX(S,t)?P.pointsSameY(S,t)?0:S[1]<t[1]?-1:1:S[0]<t[0]?-1:1},pointsCollinear:function(S,t,e){var r=S[0]-t[0],a=S[1]-t[1],n=t[0]-e[0],o=t[1]-e[1];return Math.abs(r*o-n*a)<g},linesIntersect:function(S,t,e,r){var a=t[0]-S[0],n=t[1]-S[1],o=r[0]-e[0],i=r[1]-e[1],s=a*i-n*o;if(Math.abs(s)<g)return!1;var f=S[0]-e[0],x=S[1]-e[1],y=(o*x-i*f)/s,v=(a*x-n*f)/s,T={alongA:0,alongB:0,pt:[S[0]+y*a,S[1]+y*n]};return y<=-g?T.alongA=-2:y<g?T.alongA=-1:y-1<=-g?T.alongA=0:y-1<g?T.alongA=1:T.alongA=2,v<=-g?T.alongB=-2:v<g?T.alongB=-1:v-1<=-g?T.alongB=0:v-1<g?T.alongB=1:T.alongB=2,T},pointInsideRegion:function(S,t){for(var e=S[0],r=S[1],a=t[t.length-1][0],n=t[t.length-1][1],o=!1,i=0;i<t.length;i++){var s=t[i][0],f=t[i][1];f-r>g!=n-r>g&&(a-s)*(r-f)/(n-f)+s-e>g&&(o=!o),a=s,n=f}return o}};return P}$.exports=c}),pm=Ft((Q,$)=>{var c={create:function(){var g={root:{root:!0,next:null},exists:function(P){return!(P===null||P===g.root)},isEmpty:function(){return g.root.next===null},getHead:function(){return g.root.next},insertBefore:function(P,S){for(var t=g.root,e=g.root.next;e!==null;){if(S(e)){P.prev=e.prev,P.next=e,e.prev.next=P,e.prev=P;return}t=e,e=e.next}t.next=P,P.prev=t,P.next=null},findTransition:function(P){for(var S=g.root,t=g.root.next;t!==null&&!P(t);)S=t,t=t.next;return{before:S===g.root?null:S,after:t,insert:function(e){return e.prev=S,e.next=t,S.next=e,t!==null&&(t.prev=e),e}}}};return g},node:function(g){return g.prev=null,g.next=null,g.remove=function(){g.prev.next=g.next,g.next&&(g.next.prev=g.prev),g.prev=null,g.next=null},g}};$.exports=c}),Vy=Ft((Q,$)=>{var c=pm();function g(P,S,t){function e(T,u){return{id:t?t.segmentId():-1,start:T,end:u,myFill:{above:null,below:null},otherFill:null}}function r(T,u,b){return{id:t?t.segmentId():-1,start:T,end:u,myFill:{above:b.myFill.above,below:b.myFill.below},otherFill:null}}var a=c.create();function n(T,u,b,_,C,M){var E=S.pointsCompare(u,C);return E!==0?E:S.pointsSame(b,M)?0:T!==_?T?1:-1:S.pointAboveOrOnLine(b,_?C:M,_?M:C)?1:-1}function o(T,u){a.insertBefore(T,function(b){var _=n(T.isStart,T.pt,u,b.isStart,b.pt,b.other.pt);return _<0})}function i(T,u){var b=c.node({isStart:!0,pt:T.start,seg:T,primary:u,other:null,status:null});return o(b,T.end),b}function s(T,u,b){var _=c.node({isStart:!1,pt:u.end,seg:u,primary:b,other:T,status:null});T.other=_,o(_,T.pt)}function f(T,u){var b=i(T,u);return s(b,T,u),b}function x(T,u){t&&t.segmentChop(T.seg,u),T.other.remove(),T.seg.end=u,T.other.pt=u,o(T.other,T.pt)}function y(T,u){var b=r(u,T.seg.end,T.seg);return x(T,u),f(b,T.primary)}function v(T,u){var b=c.create();function _(H,F){var U=H.seg.start,W=H.seg.end,q=F.seg.start,X=F.seg.end;return S.pointsCollinear(U,q,X)?S.pointsCollinear(W,q,X)||S.pointAboveOrOnLine(W,q,X)?1:-1:S.pointAboveOrOnLine(U,q,X)?1:-1}function C(H){return b.findTransition(function(F){var U=_(H,F.ev);return U>0})}function M(H,F){var U=H.seg,W=F.seg,q=U.start,X=U.end,lt=W.start,yt=W.end;t&&t.checkIntersection(U,W);var pt=S.linesIntersect(q,X,lt,yt);if(pt===!1){if(!S.pointsCollinear(q,X,lt)||S.pointsSame(q,yt)||S.pointsSame(X,lt))return!1;var st=S.pointsSame(q,lt),tt=S.pointsSame(X,yt);if(st&&tt)return F;var dt=!st&&S.pointBetween(q,lt,yt),rt=!tt&&S.pointBetween(X,lt,yt);if(st)return rt?y(F,X):y(H,yt),F;dt&&(tt||(rt?y(F,X):y(H,yt)),y(F,q))}else pt.alongA===0&&(pt.alongB===-1?y(H,lt):pt.alongB===0?y(H,pt.pt):pt.alongB===1&&y(H,yt)),pt.alongB===0&&(pt.alongA===-1?y(F,q):pt.alongA===0?y(F,pt.pt):pt.alongA===1&&y(F,X));return!1}for(var E=[];!a.isEmpty();){var A=a.getHead();if(t&&t.vert(A.pt[0]),A.isStart){let H=function(){if(p){var F=M(A,p);if(F)return F}return k?M(A,k):!1};t&&t.segmentNew(A.seg,A.primary);var h=C(A),p=h.before?h.before.ev:null,k=h.after?h.after.ev:null;t&&t.tempStatus(A.seg,p?p.seg:!1,k?k.seg:!1);var w=H();if(w){if(P){var R;A.seg.myFill.below===null?R=!0:R=A.seg.myFill.above!==A.seg.myFill.below,R&&(w.seg.myFill.above=!w.seg.myFill.above)}else w.seg.otherFill=A.seg.myFill;t&&t.segmentUpdate(w.seg),A.other.remove(),A.remove()}if(a.getHead()!==A){t&&t.rewind(A.seg);continue}if(P){var R;A.seg.myFill.below===null?R=!0:R=A.seg.myFill.above!==A.seg.myFill.below,k?A.seg.myFill.below=k.seg.myFill.above:A.seg.myFill.below=T,R?A.seg.myFill.above=!A.seg.myFill.below:A.seg.myFill.above=A.seg.myFill.below}else if(A.seg.otherFill===null){var O;k?A.primary===k.primary?O=k.seg.otherFill.above:O=k.seg.myFill.above:O=A.primary?u:T,A.seg.otherFill={above:O,below:O}}t&&t.status(A.seg,p?p.seg:!1,k?k.seg:!1),A.other.status=h.insert(c.node({ev:A}))}else{var N=A.status;if(N===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(b.exists(N.prev)&&b.exists(N.next)&&M(N.prev.ev,N.next.ev),t&&t.statusRemove(N.ev.seg),N.remove(),!A.primary){var V=A.seg.myFill;A.seg.myFill=A.seg.otherFill,A.seg.otherFill=V}E.push(A.seg)}a.getHead().remove()}return t&&t.done(),E}return P?{addRegion:function(T){for(var u,b=T[T.length-1],_=0;_<T.length;_++){u=b,b=T[_];var C=S.pointsCompare(u,b);C!==0&&f(e(C<0?u:b,C<0?b:u),!0)}},calculate:function(T){return v(T,!1)}}:{calculate:function(T,u,b,_){return T.forEach(function(C){f(r(C.start,C.end,C),!0)}),b.forEach(function(C){f(r(C.start,C.end,C),!1)}),v(u,_)}}}$.exports=g}),Tw=Ft((Q,$)=>{function c(g,P,S){var t=[],e=[];return g.forEach(function(r){var a=r.start,n=r.end;if(P.pointsSame(a,n)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}S&&S.chainStart(r);var o={index:0,matches_head:!1,matches_pt1:!1},i={index:0,matches_head:!1,matches_pt1:!1},s=o;function f(O,N,V){return s.index=O,s.matches_head=N,s.matches_pt1=V,s===o?(s=i,!1):(s=null,!0)}for(var x=0;x<t.length;x++){var y=t[x],v=y[0];y[1];var T=y[y.length-1];if(y[y.length-2],P.pointsSame(v,a)){if(f(x,!0,!0))break}else if(P.pointsSame(v,n)){if(f(x,!0,!1))break}else if(P.pointsSame(T,a)){if(f(x,!1,!0))break}else if(P.pointsSame(T,n)&&f(x,!1,!1))break}if(s===o){t.push([a,n]),S&&S.chainNew(a,n);return}if(s===i){S&&S.chainMatch(o.index);var u=o.index,b=o.matches_pt1?n:a,_=o.matches_head,y=t[u],C=_?y[0]:y[y.length-1],M=_?y[1]:y[y.length-2],E=_?y[y.length-1]:y[0],A=_?y[y.length-2]:y[1];if(P.pointsCollinear(M,C,b)&&(_?(S&&S.chainRemoveHead(o.index,b),y.shift()):(S&&S.chainRemoveTail(o.index,b),y.pop()),C=M),P.pointsSame(E,b)){t.splice(u,1),P.pointsCollinear(A,E,C)&&(_?(S&&S.chainRemoveTail(o.index,C),y.pop()):(S&&S.chainRemoveHead(o.index,C),y.shift())),S&&S.chainClose(o.index),e.push(y);return}_?(S&&S.chainAddHead(o.index,b),y.unshift(b)):(S&&S.chainAddTail(o.index,b),y.push(b));return}function h(O){S&&S.chainReverse(O),t[O].reverse()}function p(O,N){var V=t[O],H=t[N],F=V[V.length-1],U=V[V.length-2],W=H[0],q=H[1];P.pointsCollinear(U,F,W)&&(S&&S.chainRemoveTail(O,F),V.pop(),F=U),P.pointsCollinear(F,W,q)&&(S&&S.chainRemoveHead(N,W),H.shift()),S&&S.chainJoin(O,N),t[O]=V.concat(H),t.splice(N,1)}var k=o.index,w=i.index;S&&S.chainConnect(k,w);var R=t[k].length<t[w].length;o.matches_head?i.matches_head?R?(h(k),p(k,w)):(h(w),p(w,k)):p(w,k):i.matches_head?p(k,w):R?(h(k),p(w,k)):(h(w),p(k,w))}),e}$.exports=c}),N_=Ft((Q,$)=>{function c(P,S,t){var e=[];return P.forEach(function(r){var a=(r.myFill.above?8:0)+(r.myFill.below?4:0)+(r.otherFill&&r.otherFill.above?2:0)+(r.otherFill&&r.otherFill.below?1:0);S[a]!==0&&e.push({id:t?t.segmentId():-1,start:r.start,end:r.end,myFill:{above:S[a]===1,below:S[a]===2},otherFill:null})}),t&&t.selected(e),e}var g={union:function(P,S){return c(P,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],S)},intersect:function(P,S){return c(P,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],S)},difference:function(P,S){return c(P,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],S)},differenceRev:function(P,S){return c(P,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],S)},xor:function(P,S){return c(P,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],S)}};$.exports=g}),Hy=Ft((Q,$)=>{var c={toPolygon:function(g,P){function S(r){if(r.length<=0)return g.segments({inverted:!1,regions:[]});function a(i){var s=i.slice(0,i.length-1);return g.segments({inverted:!1,regions:[s]})}for(var n=a(r[0]),o=1;o<r.length;o++)n=g.selectDifference(g.combine(n,a(r[o])));return n}if(P.type==="Polygon")return g.polygon(S(P.coordinates));if(P.type==="MultiPolygon"){for(var t=g.segments({inverted:!1,regions:[]}),e=0;e<P.coordinates.length;e++)t=g.selectUnion(g.combine(t,S(P.coordinates[e])));return g.polygon(t)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(g,P,S){S=g.polygon(g.segments(S));function t(y,v){return P.pointInsideRegion([(y[0][0]+y[1][0])*.5,(y[0][1]+y[1][1])*.5],v)}function e(y){return{region:y,children:[]}}var r=e(null);function a(y,v){for(var T=0;T<y.children.length;T++){var u=y.children[T];if(t(v,u.region)){a(u,v);return}}for(var b=e(v),T=0;T<y.children.length;T++){var u=y.children[T];t(u.region,v)&&(b.children.push(u),y.children.splice(T,1),T--)}y.children.push(b)}for(var n=0;n<S.regions.length;n++){var o=S.regions[n];o.length<3||a(r,o)}function i(y,v){for(var T=0,u=y[y.length-1][0],b=y[y.length-1][1],_=[],C=0;C<y.length;C++){var M=y[C][0],E=y[C][1];_.push([M,E]),T+=E*u-M*b,u=M,b=E}var A=T<0;return A!==v&&_.reverse(),_.push([_[0][0],_[0][1]]),_}var s=[];function f(y){var v=[i(y.region,!1)];s.push(v);for(var T=0;T<y.children.length;T++)v.push(x(y.children[T]))}function x(y){for(var v=0;v<y.children.length;v++)f(y.children[v]);return i(y.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}}};$.exports=c}),j_=Ft((Q,$)=>{var c=yv(),g=v6(),P=Vy(),S=Tw(),t=N_(),e=Hy(),r=!1,a=g(),n;n={buildLog:function(i){return i===!0?r=c():i===!1&&(r=!1),r===!1?!1:r.list},epsilon:function(i){return a.epsilon(i)},segments:function(i){var s=P(!0,a,r);return i.regions.forEach(s.addRegion),{segments:s.calculate(i.inverted),inverted:i.inverted}},combine:function(i,s){var f=P(!1,a,r);return{combined:f.calculate(i.segments,i.inverted,s.segments,s.inverted),inverted1:i.inverted,inverted2:s.inverted}},selectUnion:function(i){return{segments:t.union(i.combined,r),inverted:i.inverted1||i.inverted2}},selectIntersect:function(i){return{segments:t.intersect(i.combined,r),inverted:i.inverted1&&i.inverted2}},selectDifference:function(i){return{segments:t.difference(i.combined,r),inverted:i.inverted1&&!i.inverted2}},selectDifferenceRev:function(i){return{segments:t.differenceRev(i.combined,r),inverted:!i.inverted1&&i.inverted2}},selectXor:function(i){return{segments:t.xor(i.combined,r),inverted:i.inverted1!==i.inverted2}},polygon:function(i){return{regions:S(i.segments,a,r),inverted:i.inverted}},polygonFromGeoJSON:function(i){return e.toPolygon(n,i)},polygonToGeoJSON:function(i){return e.fromPolygon(n,a,i)},union:function(i,s){return o(i,s,n.selectUnion)},intersect:function(i,s){return o(i,s,n.selectIntersect)},difference:function(i,s){return o(i,s,n.selectDifference)},differenceRev:function(i,s){return o(i,s,n.selectDifferenceRev)},xor:function(i,s){return o(i,s,n.selectXor)}};function o(i,s,f){var x=n.segments(i),y=n.segments(s),v=n.combine(x,y),T=f(v);return n.polygon(T)}typeof window=="object"&&(window.PolyBool=n),$.exports=n}),Wy=Ft((Q,$)=>{$.exports=function(c,g,P,S){var t=c[0],e=c[1],r=!1;P===void 0&&(P=0),S===void 0&&(S=g.length);for(var a=S-P,n=0,o=a-1;n<a;o=n++){var i=g[n+P][0],s=g[n+P][1],f=g[o+P][0],x=g[o+P][1],y=s>e!=x>e&&t<(f-i)*(e-s)/(x-s)+i;y&&(r=!r)}return r}}),mm=Ft((Q,$)=>{var c=w_().dot,g=Da().BADNUM,P=$.exports={};P.tester=function(S){var t=S.slice(),e=t[0][0],r=e,a=t[0][1],n=a,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]),a=Math.min(a,t[o][1]),n=Math.max(n,t[o][1]);var i=!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]&&(i=!0,s=function(T){return T[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]&&(i=!0,s=function(T){return T[1]===t[0][1]}));function f(T,u){var b=T[0],_=T[1];return!(b===g||b<e||b>r||_===g||_<a||_>n||u&&s(T))}function x(T,u){var b=T[0],_=T[1];if(b===g||b<e||b>r||_===g||_<a||_>n)return!1;var C=t.length,M=t[0][0],E=t[0][1],A=0,h,p,k,w,R;for(h=1;h<C;h++)if(p=M,k=E,M=t[h][0],E=t[h][1],w=Math.min(p,M),!(b<w||b>Math.max(p,M)||_>Math.max(k,E)))if(_<Math.min(k,E))b!==w&&A++;else{if(M===p?R=_:R=k+(b-p)*(E-k)/(M-p),_===R)return!(h===1&&u);_<=R&&b!==w&&A++}return A%2===1}var y=!0,v=t[0];for(o=1;o<t.length;o++)if(v[0]!==t[o][0]||v[1]!==t[o][1]){y=!1;break}return{xmin:e,xmax:r,ymin:a,ymax:n,pts:t,contains:i?f:x,isRect:i,degenerate:y}},P.isSegmentBent=function(S,t,e,r){var a=S[t],n=[S[e][0]-a[0],S[e][1]-a[1]],o=c(n,n),i=Math.sqrt(o),s=[-n[1]/i,n[0]/i],f,x,y;for(f=t+1;f<e;f++)if(x=[S[f][0]-a[0],S[f][1]-a[1]],y=c(x,n),y<0||y>o||Math.abs(c(x,s))>r)return!0;return!1},P.filter=function(S,t){var e=[S[0]],r=0,a=0;function n(i){S.push(i);var s=e.length,f=r;e.splice(a+1);for(var x=f+1;x<S.length;x++)(x===S.length-1||P.isSegmentBent(S,f,x+1,t))&&(e.push(S[x]),e.length<s-2&&(r=x,a=e.length-1),f=x)}if(S.length>1){var o=S.pop();n(o)}return{addPt:n,raw:S,filtered:e}}}),qy=Ft((Q,$)=>{$.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}),U_=Ft((Q,$)=>{var c=j_(),g=Wy(),P=Xo(),S=js().dashStyle,t=li(),e=Qh(),r=Dp().makeEventData,a=v0(),n=a.freeMode,o=a.rectMode,i=a.drawMode,s=a.openMode,f=a.selectMode,x=bp(),y=Ny(),v=Rm(),T=C0().clearOutline,u=kg(),b=u.handleEllipse,_=u.readPaths,C=a0().newShapes,M=Tg(),E=kw().activateLastSelection,A=bn(),h=A.sorterAsc,p=mm(),k=A_(),w=Rc().getFromId,R=mv(),O=y0().redrawReglTraces,N=qy(),V=N.MINSELECT,H=p.filter,F=p.tester,U=By(),W=U.p2r,q=U.axValue,X=U.getTransform;function lt($t){return $t.subplot!==void 0}function yt($t,ne,Ct,gt,St){var Nt=!lt(gt),ee=n(St),le=o(St),we=s(St),Ue=i(St),qe=f(St),ar=St==="drawline",Ar=St==="drawcircle",Tr=ar||Ar,pr=gt.gd,Jr=pr._fullLayout,Vn=qe&&Jr.newselection.mode==="immediate"&&Nt,Hn=Jr._zoomlayer,Kn=gt.element.getBoundingClientRect(),Ci=gt.plotinfo,ii=X(Ci),qn=ne-Kn.left,oa=Ct-Kn.top;Jr._calcInverseTransform(pr);var Hi=A.apply3DTransform(Jr._invTransform)(qn,oa);qn=Hi[0],oa=Hi[1];var We=Jr._invScaleX,rr=Jr._invScaleY,fr=qn,xr=oa,Qr="M"+qn+","+oa,Cn=gt.xaxes[0],wn=gt.yaxes[0],Mn=Cn._length,ci=wn._length,xi=$t.altKey&&!(i(St)&&we),Pi,Di,Zi,ui,Pa,Wa,ze;at($t,pr,gt),ee&&(Pi=H([[qn,oa]],N.BENDPX));var Pe=Hn.selectAll("path.select-outline-"+Ci.id).data([1]),Rr=Ue?Jr.newshape:Jr.newselection;Ue&&(gt.hasText=Rr.label.text||Rr.label.texttemplate);var qr=Ue&&!we?Rr.fillcolor:"rgba(0,0,0,0)",$r=Rr.line.color||(Nt?t.contrast(pr._fullLayout.plot_bgcolor):"#7f7f7f");Pe.enter().append("path").attr("class","select-outline select-outline-"+Ci.id).style({opacity:Ue?Rr.opacity/2:1,"stroke-dasharray":S(Rr.line.dash,Rr.line.width),"stroke-width":Rr.line.width+"px","shape-rendering":"crispEdges"}).call(t.stroke,$r).call(t.fill,qr).attr("fill-rule","evenodd").classed("cursor-move",!!Ue).attr("transform",ii).attr("d",Qr+"Z");var Br=Hn.append("path").attr("class","zoombox-corners").style({fill:t.background,stroke:t.defaultLine,"stroke-width":1}).attr("transform",ii).attr("d","M0,0Z");if(Ue&&gt.hasText){var Gr=Hn.select(".label-temp");Gr.empty()&&(Gr=Hn.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var dn=Jr._uid+N.SELECTID,an=[],Ee=ut(pr,gt.xaxes,gt.yaxes,gt.subplot);Vn&&!$t.shiftKey&&(gt._clearSubplotSelections=function(){if(Nt){var Vr=Cn._id,yn=wn._id;oe(pr,Vr,yn,Ee);for(var Fn=(pr.layout||{}).selections||[],Xn=[],Pn=!1,En=0;En<Fn.length;En++){var Zn=Jr.selections[En];!Zn||Zn.xref!==Vr||Zn.yref!==yn?Xn.push(Fn[En]):Pn=!0}Pn&&(pr._fullLayout._noEmitSelectedAtStart=!0,P.call("_guiRelayout",pr,{selections:Xn}))}});var dr=br(gt);gt.moveFn=function(Vr,yn){gt._clearSubplotSelections&&(gt._clearSubplotSelections(),gt._clearSubplotSelections=void 0),fr=Math.max(0,Math.min(Mn,We*Vr+qn)),xr=Math.max(0,Math.min(ci,rr*yn+oa));var Fn=Math.abs(fr-qn),Xn=Math.abs(xr-oa);if(le){var Pn,En,Zn;if(qe){var Ca=Jr.selectdirection;switch(Ca==="any"?Xn<Math.min(Fn*.6,V)?Pn="h":Fn<Math.min(Xn*.6,V)?Pn="v":Pn="d":Pn=Ca,Pn){case"h":En=Ar?ci/2:0,Zn=ci;break;case"v":En=Ar?Mn/2:0,Zn=Mn;break}}if(Ue)switch(Jr.newshape.drawdirection){case"vertical":Pn="h",En=Ar?ci/2:0,Zn=ci;break;case"horizontal":Pn="v",En=Ar?Mn/2:0,Zn=Mn;break;case"ortho":Fn<Xn?(Pn="h",En=oa,Zn=xr):(Pn="v",En=qn,Zn=fr);break;default:Pn="d"}Pn==="h"?(ui=Tr?b(Ar,[fr,En],[fr,Zn]):[[qn,En],[qn,Zn],[fr,Zn],[fr,En]],ui.xmin=Tr?fr:Math.min(qn,fr),ui.xmax=Tr?fr:Math.max(qn,fr),ui.ymin=Math.min(En,Zn),ui.ymax=Math.max(En,Zn),Br.attr("d","M"+ui.xmin+","+(oa-V)+"h-4v"+2*V+"h4ZM"+(ui.xmax-1)+","+(oa-V)+"h4v"+2*V+"h-4Z")):Pn==="v"?(ui=Tr?b(Ar,[En,xr],[Zn,xr]):[[En,oa],[En,xr],[Zn,xr],[Zn,oa]],ui.xmin=Math.min(En,Zn),ui.xmax=Math.max(En,Zn),ui.ymin=Tr?xr:Math.min(oa,xr),ui.ymax=Tr?xr:Math.max(oa,xr),Br.attr("d","M"+(qn-V)+","+ui.ymin+"v-4h"+2*V+"v4ZM"+(qn-V)+","+(ui.ymax-1)+"v4h"+2*V+"v-4Z")):Pn==="d"&&(ui=Tr?b(Ar,[qn,oa],[fr,xr]):[[qn,oa],[qn,xr],[fr,xr],[fr,oa]],ui.xmin=Math.min(qn,fr),ui.xmax=Math.max(qn,fr),ui.ymin=Math.min(oa,xr),ui.ymax=Math.max(oa,xr),Br.attr("d","M0,0Z"))}else ee&&(Pi.addPt([fr,xr]),ui=Pi.filtered);if(gt.selectionDefs&&gt.selectionDefs.length?(Zi=de(gt.mergedPolygons,ui,xi),ui.subtract=xi,Di=rt(gt.selectionDefs.concat([ui]))):(Zi=[ui],Di=F(ui)),v(Tt(Zi,we),Pe,gt),qe){var Ri=Mt(pr,!1),Ja=Ri.eventData?Ri.eventData.points.slice():[];Ri=Mt(pr,!1,Di,Ee,gt),Di=Ri.selectionTesters,ze=Ri.eventData;var Xa;Pi?Xa=Pi.filtered:Xa=ur(Zi),k.throttle(dn,N.SELECTDELAY,function(){an=Lt(Di,Ee);for(var Io=an.slice(),po=0;po<Ja.length;po++){for(var Do=Ja[po],Ia=!1,gs=0;gs<Io.length;gs++)if(Io[gs].curveNumber===Do.curveNumber&&Io[gs].pointNumber===Do.pointNumber){Ia=!0;break}Ia||Io.push(Do)}Io.length&&(ze||(ze={}),ze.points=Io),dr(ze,Xa),Kr(pr,ze)})}},gt.clickFn=function(Vr,yn){if(Br.remove(),pr._fullLayout._activeShapeIndex>=0){pr._fullLayout._deactivateShape(pr);return}if(!Ue){var Fn=Jr.clickmode;k.done(dn).then(function(){if(k.clear(dn),Vr===2){for(Pe.remove(),Pa=0;Pa<Ee.length;Pa++)Wa=Ee[Pa],Wa._module.selectPoints(Wa,!1);if(ge(pr,Ee),Y(gt),Ce(pr),Ee.length){var Xn=Ee[0].xaxis,Pn=Ee[0].yaxis;if(Xn&&Pn){for(var En=[],Zn=pr._fullLayout.selections,Ca=0;Ca<Zn.length;Ca++){var Ri=Zn[Ca];Ri&&(Ri.xref!==Xn._id||Ri.yref!==Pn._id)&&En.push(Ri)}En.length<Zn.length&&(pr._fullLayout._noEmitSelectedAtStart=!0,P.call("_guiRelayout",pr,{selections:En}))}}}else Fn.indexOf("select")>-1&&pt(yn,pr,gt.xaxes,gt.yaxes,gt.subplot,gt,Pe),Fn==="event"&&rn(pr,void 0);e.click(pr,yn,Ci.id)}).catch(A.error)}},gt.doneFn=function(){Br.remove(),k.done(dn).then(function(){k.clear(dn),!Vn&&ui&&gt.selectionDefs&&(ui.subtract=xi,gt.selectionDefs.push(ui),gt.mergedPolygons.length=0,[].push.apply(gt.mergedPolygons,Zi)),(Vn||Ue)&&Y(gt,Vn),gt.doneFnCompleted&&gt.doneFnCompleted(an),qe&&rn(pr,ze)}).catch(A.error)}}function pt($t,ne,Ct,gt,St,Nt,ee){var le=ne._hoverdata,we=ne._fullLayout,Ue=we.clickmode,qe=Ue.indexOf("event")>-1,ar=[],Ar,Tr,pr,Jr,Vn,Hn,Kn,Ci,ii,qn;if(zt(le)){at($t,ne,Nt),Ar=ut(ne,Ct,gt,St);var oa=Pt(le,Ar),Hi=oa.pointNumbers.length>0;if(Hi?Ht(Ar,oa):Jt(Ar)&&(Kn=Wt(oa))){for(ee&&ee.remove(),qn=0;qn<Ar.length;qn++)Tr=Ar[qn],Tr._module.selectPoints(Tr,!1);ge(ne,Ar),Y(Nt),qe&&Ce(ne)}else{Ci=$t.shiftKey&&(Kn!==void 0?Kn:Wt(oa)),pr=st(oa.pointNumber,oa.searchInfo,Ci);var We=Nt.selectionDefs.concat([pr]);for(Jr=rt(We),qn=0;qn<Ar.length;qn++)if(Vn=Ar[qn]._module.selectPoints(Ar[qn],Jr),Hn=se(Vn,Ar[qn]),ar.length)for(var rr=0;rr<Hn.length;rr++)ar.push(Hn[rr]);else ar=Hn;if(ii={points:ar},ge(ne,Ar,ii),pr&&Nt&&Nt.selectionDefs.push(pr),ee){var fr=Nt.mergedPolygons,xr=s(Nt.dragmode);v(Tt(fr,xr),ee,Nt)}qe&&rn(ne,ii)}}}function st($t,ne,Ct){return{pointNumber:$t,searchInfo:ne,subtract:!!Ct}}function tt($t){return"pointNumber"in $t&&"searchInfo"in $t}function dt($t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(ne,Ct,gt,St){var Nt=$t.searchInfo.cd[0].trace.index,ee=St.cd[0].trace.index;return ee===Nt&&gt===$t.pointNumber},isRect:!1,degenerate:!1,subtract:!!$t.subtract}}function rt($t){if(!$t.length)return;for(var ne=[],Ct=tt($t[0])?0:$t[0][0][0],gt=Ct,St=tt($t[0])?0:$t[0][0][1],Nt=St,ee=0;ee<$t.length;ee++)if(tt($t[ee]))ne.push(dt($t[ee]));else{var le=F($t[ee]);le.subtract=!!$t[ee].subtract,ne.push(le),Ct=Math.min(Ct,le.xmin),gt=Math.max(gt,le.xmax),St=Math.min(St,le.ymin),Nt=Math.max(Nt,le.ymax)}function we(Ue,qe,ar,Ar){for(var Tr=!1,pr=0;pr<ne.length;pr++)ne[pr].contains(Ue,qe,ar,Ar)&&(Tr=!ne[pr].subtract);return Tr}return{xmin:Ct,xmax:gt,ymin:St,ymax:Nt,pts:[],contains:we,isRect:!1,degenerate:!1}}function at($t,ne,Ct){var gt=ne._fullLayout,St=Ct.plotinfo,Nt=Ct.dragmode,ee=gt._lastSelectedSubplot&&gt._lastSelectedSubplot===St.id,le=($t.shiftKey||$t.altKey)&&!(i(Nt)&&s(Nt));ee&&le&&St.selection&&St.selection.selectionDefs&&!Ct.selectionDefs?(Ct.selectionDefs=St.selection.selectionDefs,Ct.mergedPolygons=St.selection.mergedPolygons):(!le||!St.selection)&&Y(Ct),ee||(T(ne),gt._lastSelectedSubplot=St.id)}function vt($t){return $t._fullLayout._activeShapeIndex>=0}function it($t){return $t._fullLayout._activeSelectionIndex>=0}function Y($t,ne){var Ct=$t.dragmode,gt=$t.plotinfo,St=$t.gd;vt(St)&&St._fullLayout._deactivateShape(St),it(St)&&St._fullLayout._deactivateSelection(St);var Nt=St._fullLayout,ee=Nt._zoomlayer,le=i(Ct),we=f(Ct);if(le||we){var Ue=ee.selectAll(".select-outline-"+gt.id);if(Ue&&St._fullLayout._outlining){var qe;le&&(qe=C(Ue,$t)),qe&&P.call("_guiRelayout",St,{shapes:qe});var ar;we&&!lt($t)&&(ar=M(Ue,$t)),ar&&(St._fullLayout._noEmitSelectedAtStart=!0,P.call("_guiRelayout",St,{selections:ar}).then(function(){ne&&E(St)})),St._fullLayout._outlining=!1}}gt.selection={},gt.selection.selectionDefs=$t.selectionDefs=[],gt.selection.mergedPolygons=$t.mergedPolygons=[]}function ft($t){return $t._id}function ut($t,ne,Ct,gt){if(!$t.calcdata)return[];var St=[],Nt=ne.map(ft),ee=Ct.map(ft),le,we,Ue;for(Ue=0;Ue<$t.calcdata.length;Ue++)if(le=$t.calcdata[Ue],we=le[0].trace,!(we.visible!==!0||!we._module||!we._module.selectPoints))if(lt({subplot:gt})&&(we.subplot===gt||we.geo===gt))St.push(wt(we._module,le,ne[0],Ct[0]));else if(we.type==="splom"){if(we._xaxes[Nt[0]]&&we._yaxes[ee[0]]){var qe=wt(we._module,le,ne[0],Ct[0]);qe.scene=$t._fullLayout._splomScenes[we.uid],St.push(qe)}}else if(we.type==="sankey"){var ar=wt(we._module,le,ne[0],Ct[0]);St.push(ar)}else{if(Nt.indexOf(we.xaxis)===-1&&(!we._xA||!we._xA.overlaying)||ee.indexOf(we.yaxis)===-1&&(!we._yA||!we._yA.overlaying))continue;St.push(wt(we._module,le,w($t,we.xaxis),w($t,we.yaxis)))}return St}function wt($t,ne,Ct,gt){return{_module:$t,cd:ne,xaxis:Ct,yaxis:gt}}function zt($t){return $t&&Array.isArray($t)&&$t[0].hoverOnBox!==!0}function Pt($t,ne){var Ct=$t[0],gt=-1,St=[],Nt,ee;for(ee=0;ee<ne.length;ee++)if(Nt=ne[ee],Ct.fullData.index===Nt.cd[0].trace.index){if(Ct.hoverOnBox===!0)break;Ct.pointNumber!==void 0?gt=Ct.pointNumber:Ct.binNumber!==void 0&&(gt=Ct.binNumber,St=Ct.pointNumbers);break}return{pointNumber:gt,pointNumbers:St,searchInfo:Nt}}function Wt($t){var ne=$t.searchInfo.cd[0].trace,Ct=$t.pointNumber,gt=$t.pointNumbers,St=gt.length>0,Nt=St?gt[0]:Ct;return ne.selectedpoints?ne.selectedpoints.indexOf(Nt)>-1:!1}function Ht($t,ne){var Ct=[],gt,St,Nt,ee;for(ee=0;ee<$t.length;ee++)gt=$t[ee],gt.cd[0].trace.selectedpoints&&gt.cd[0].trace.selectedpoints.length>0&&Ct.push(gt);if(Ct.length===1&&(Nt=Ct[0]===ne.searchInfo,Nt&&(St=ne.searchInfo.cd[0].trace,St.selectedpoints.length===ne.pointNumbers.length))){for(ee=0;ee<ne.pointNumbers.length;ee++)if(St.selectedpoints.indexOf(ne.pointNumbers[ee])<0)return!1;return!0}return!1}function Jt($t){var ne=0,Ct,gt,St;for(St=0;St<$t.length;St++)if(Ct=$t[St],gt=Ct.cd[0].trace,gt.selectedpoints&&(gt.selectedpoints.length>1||(ne+=gt.selectedpoints.length,ne>1)))return!1;return ne===1}function ge($t,ne,Ct){var gt;for(gt=0;gt<ne.length;gt++){var St=ne[gt].cd[0].trace._fullInput,Nt=$t._fullLayout._tracePreGUI[St.uid]||{};Nt.selectedpoints===void 0&&(Nt.selectedpoints=St._input.selectedpoints||null)}var ee;if(Ct){var le=Ct.points||[];for(gt=0;gt<ne.length;gt++)ee=ne[gt].cd[0].trace,ee._input.selectedpoints=ee._fullInput.selectedpoints=[],ee._fullInput!==ee&&(ee.selectedpoints=[]);for(var we=0;we<le.length;we++){var Ue=le[we],qe=Ue.data,ar=Ue.fullData,Ar=Ue.pointIndex,Tr=Ue.pointIndices;Tr?([].push.apply(qe.selectedpoints,Tr),ee._fullInput!==ee&&[].push.apply(ar.selectedpoints,Tr)):(qe.selectedpoints.push(Ar),ee._fullInput!==ee&&ar.selectedpoints.push(Ar))}}else for(gt=0;gt<ne.length;gt++)ee=ne[gt].cd[0].trace,delete ee.selectedpoints,delete ee._input.selectedpoints,ee._fullInput!==ee&&delete ee._fullInput.selectedpoints;he($t,ne)}function he($t,ne){for(var Ct=!1,gt=0;gt<ne.length;gt++){var St=ne[gt],Nt=St.cd;P.traceIs(Nt[0].trace,"regl")&&(Ct=!0);var ee=St._module,le=ee.styleOnSelect||ee.style;le&&(le($t,Nt,Nt[0].node3),Nt[0].nodeRangePlot3&&le($t,Nt,Nt[0].nodeRangePlot3))}Ct&&(R($t),O($t))}function de($t,ne,Ct){for(var gt=Ct?c.difference:c.union,St=gt({regions:$t},{regions:[ne]}),Nt=St.regions.reverse(),ee=0;ee<Nt.length;ee++){var le=Nt[ee];le.subtract=Ge(le,Nt.slice(0,ee))}return Nt}function se($t,ne){if(Array.isArray($t))for(var Ct=ne.cd,gt=ne.cd[0].trace,St=0;St<$t.length;St++)$t[St]=r($t[St],gt,Ct);return $t}function Tt($t,ne){for(var Ct=[],gt=0;gt<$t.length;gt++){Ct[gt]=[];for(var St=0;St<$t[gt].length;St++){Ct[gt][St]=[],Ct[gt][St][0]=St?"L":"M";for(var Nt=0;Nt<$t[gt][St].length;Nt++)Ct[gt][St].push($t[gt][St][Nt])}ne||Ct[gt].push(["Z",Ct[gt][0][1],Ct[gt][0][2]])}return Ct}function Lt($t,ne){for(var Ct=[],gt,St=[],Nt,ee=0;ee<ne.length;ee++){var le=ne[ee];Nt=le._module.selectPoints(le,$t),St.push(Nt),gt=se(Nt,le),Ct=Ct.concat(gt)}return Ct}function Mt($t,ne,Ct,gt,St){var Nt=!!gt,ee,le,we;St&&(ee=St.plotinfo,le=St.xaxes[0]._id,we=St.yaxes[0]._id);var Ue=[],qe=[],ar=He($t),Ar=$t._fullLayout;if(ee){var Tr=Ar._zoomlayer,pr=Ar.dragmode,Jr=i(pr),Vn=f(pr);if(Jr||Vn){var Hn=w($t,le,"x"),Kn=w($t,we,"y");if(Hn&&Kn){var Ci=Tr.selectAll(".select-outline-"+ee.id);if(Ci&&$t._fullLayout._outlining&&Ci.length){for(var ii=Ci[0][0],qn=ii.getAttribute("d"),oa=_(qn,$t,ee),Hi=[],We=0;We<oa.length;We++){for(var rr=oa[We],fr=[],xr=0;xr<rr.length;xr++)fr.push([cr(Hn,rr[xr][1]),cr(Kn,rr[xr][2])]);fr.xref=le,fr.yref=we,fr.subtract=Ge(fr,Hi),Hi.push(fr)}ar=ar.concat(Hi)}}}}var Qr=le&&we?[le+we]:Ar._subplots.cartesian;te($t);for(var Cn={},wn=0;wn<Qr.length;wn++){var Mn=Qr[wn],ci=Mn.indexOf("y"),xi=Mn.slice(0,ci),Pi=Mn.slice(ci),Di=le&&we?Ct:void 0;if(Di=Te(ar,xi,Pi,Di),Di){var Zi=gt;if(!Nt){var ui=w($t,xi,"x"),Pa=w($t,Pi,"y");Zi=ut($t,[ui],[Pa],Mn);for(var Wa=0;Wa<Zi.length;Wa++){var ze=Zi[Wa],Pe=ze.cd[0],Rr=Pe.trace;if(ze._module.name==="scattergl"&&!Pe.t.xpx){var qr=Rr.x,$r=Rr.y,Br=Rr._length;Pe.t.xpx=[],Pe.t.ypx=[];for(var Gr=0;Gr<Br;Gr++)Pe.t.xpx[Gr]=ui.c2p(qr[Gr]),Pe.t.ypx[Gr]=Pa.c2p($r[Gr])}ze._module.name==="splom"&&(Cn[Rr.uid]||(Cn[Rr.uid]=!0))}}var dn=Lt(Di,Zi);Ue=Ue.concat(dn),qe=qe.concat(Zi)}}var an={points:Ue};ge($t,qe,an);var Ee=Ar.clickmode,dr=Ee.indexOf("event")>-1&&ne;if(!ee&&ne){var Vr=He($t,!0);if(Vr.length){var yn=Vr[0].xref,Fn=Vr[0].yref;if(yn&&Fn){var Xn=ur(Vr),Pn=Hr([w($t,yn,"x"),w($t,Fn,"y")]);Pn(an,Xn)}}$t._fullLayout._noEmitSelectedAtStart?$t._fullLayout._noEmitSelectedAtStart=!1:dr&&rn($t,an),Ar._reselect=!1}if(!ee&&Ar._deselect){var En=Ar._deselect;le=En.xref,we=En.yref,ve(le,we,qe)||oe($t,le,we,gt),dr&&(an.points.length?rn($t,an):Ce($t)),Ar._deselect=!1}return{eventData:an,selectionTesters:Ct}}function te($t){var ne=$t.calcdata;if(ne)for(var Ct=0;Ct<ne.length;Ct++){var gt=ne[Ct][0],St=gt.trace,Nt=$t._fullLayout._splomScenes;if(Nt){var ee=Nt[St.uid];ee&&(ee.selectBatch=[])}}}function ve($t,ne,Ct){for(var gt=0;gt<Ct.length;gt++){var St=Ct[gt];if(St.xaxis&&St.xaxis._id===$t&&St.yaxis&&St.yaxis._id===ne)return!0}return!1}function oe($t,ne,Ct,gt){gt=ut($t,[w($t,ne,"x")],[w($t,Ct,"y")],ne+Ct);for(var St=0;St<gt.length;St++){var Nt=gt[St];Nt._module.selectPoints(Nt,!1)}ge($t,gt)}function Te($t,ne,Ct,gt){for(var St,Nt=0;Nt<$t.length;Nt++){var ee=$t[Nt];if(!(ne!==ee.xref||Ct!==ee.yref))if(St){var le=!!ee.subtract;St=de(St,ee,le),gt=rt(St)}else St=[ee],gt=F(ee)}return gt}function He($t,ne){for(var Ct=[],gt=$t._fullLayout,St=gt.selections,Nt=St.length,ee=0;ee<Nt;ee++)if(!(ne&&ee!==gt._activeSelectionIndex)){var le=St[ee];if(le){var we=le.xref,Ue=le.yref,qe=w($t,we,"x"),ar=w($t,Ue,"y"),Ar,Tr,pr,Jr,Vn;if(le.type==="rect"){Vn=[];var Hn=cr(qe,le.x0),Kn=cr(qe,le.x1),Ci=cr(ar,le.y0),ii=cr(ar,le.y1);Vn=[[Hn,Ci],[Hn,ii],[Kn,ii],[Kn,Ci]],Ar=Math.min(Hn,Kn),Tr=Math.max(Hn,Kn),pr=Math.min(Ci,ii),Jr=Math.max(Ci,ii),Vn.xmin=Ar,Vn.xmax=Tr,Vn.ymin=pr,Vn.ymax=Jr,Vn.xref=we,Vn.yref=Ue,Vn.subtract=!1,Vn.isRect=!0,Ct.push(Vn)}else if(le.type==="path")for(var qn=le.path.split("Z"),oa=[],Hi=0;Hi<qn.length;Hi++){var We=qn[Hi];if(We){We+="Z";var rr=x.extractPathCoords(We,y.paramIsX,"raw"),fr=x.extractPathCoords(We,y.paramIsY,"raw");Ar=1/0,Tr=-1/0,pr=1/0,Jr=-1/0,Vn=[];for(var xr=0;xr<rr.length;xr++){var Qr=cr(qe,rr[xr]),Cn=cr(ar,fr[xr]);Vn.push([Qr,Cn]),Ar=Math.min(Qr,Ar),Tr=Math.max(Qr,Tr),pr=Math.min(Cn,pr),Jr=Math.max(Cn,Jr)}Vn.xmin=Ar,Vn.xmax=Tr,Vn.ymin=pr,Vn.ymax=Jr,Vn.xref=we,Vn.yref=Ue,Vn.subtract=Ge(Vn,oa),oa.push(Vn),Ct.push(Vn)}}}}return Ct}function Ge($t,ne){for(var Ct=!1,gt=0;gt<ne.length;gt++)for(var St=ne[gt],Nt=0;Nt<$t.length;Nt++)if(g($t[Nt],St)){Ct=!Ct;break}return Ct}function cr($t,ne){return $t.type==="date"&&(ne=ne.replace("_"," ")),$t.type==="log"?$t.c2p(ne):$t.r2p(ne,null,$t.calendar)}function ur($t){for(var ne=$t.length,Ct=[],gt=0;gt<ne;gt++){var St=$t[gt];Ct=Ct.concat(St),Ct=Ct.concat([St[0]])}return jr(Ct)}function jr($t){return $t.isRect=$t.length===5&&$t[0][0]===$t[4][0]&&$t[0][1]===$t[4][1]&&$t[0][0]===$t[1][0]&&$t[2][0]===$t[3][0]&&$t[0][1]===$t[3][1]&&$t[1][1]===$t[2][1]||$t[0][1]===$t[1][1]&&$t[2][1]===$t[3][1]&&$t[0][0]===$t[3][0]&&$t[1][0]===$t[2][0],$t.isRect&&($t.xmin=Math.min($t[0][0],$t[2][0]),$t.xmax=Math.max($t[0][0],$t[2][0]),$t.ymin=Math.min($t[0][1],$t[2][1]),$t.ymax=Math.max($t[0][1],$t[2][1])),$t}function Hr($t){return function(ne,Ct){for(var gt,St,Nt=0;Nt<$t.length;Nt++){var ee=$t[Nt],le=ee._id,we=le.charAt(0);if(Ct.isRect){gt||(gt={});var Ue=Ct[we+"min"],qe=Ct[we+"max"];Ue!==void 0&&qe!==void 0&&(gt[le]=[W(ee,Ue),W(ee,qe)].sort(h))}else St||(St={}),St[le]=Ct.map(q(ee))}gt&&(ne.range=gt),St&&(ne.lassoPoints=St)}}function br($t){var ne=$t.plotinfo;return ne.fillRangeItems||Hr($t.xaxes.concat($t.yaxes))}function Kr($t,ne){$t.emit("plotly_selecting",ne)}function rn($t,ne){ne&&(ne.selections=($t.layout||{}).selections||[]),$t.emit("plotly_selected",ne)}function Ce($t){$t.emit("plotly_deselect",null)}$.exports={reselect:Mt,prepSelect:yt,clearOutline:T,clearSelectionsCache:Y,selectOnClick:pt}}),V_=Ft((Q,$)=>{$.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}]}),Zy=Ft((Q,$)=>{$.exports={axisRefDescription:function(c,g,P){return["If set to a",c,"axis id (e.g. *"+c+"* or","*"+c+"2*), the `"+c+"` position refers to a",c,"coordinate. If set to *paper*, the `"+c+"`","position refers to the distance from the",g,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",g,"("+P+"). If set to a",c,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",g,"of the domain of that axis: e.g.,","*"+c+"2 domain* refers to the domain of the second",c," axis and a",c,"position of 0.5 refers to the","point between the",g,"and the",P,"of the domain of the","second",c,"axis."].join(" ")}}}),gm=Ft((Q,$)=>{var c=V_(),g=Ea(),P=ic(),S=pu().templatedArray;Zy(),$.exports=S("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:g({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:c.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:c.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",P.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",P.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",P.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",P.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:g({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}),vm=Ft((Q,$)=>{$.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}),z0=Ft((Q,$)=>{$.exports=function(c){return{valType:"color",editType:"style",anim:!0}}}),tf=Ft((Q,$)=>{var c=fh().axisHoverFormat,{hovertemplateAttrs:g,texttemplateAttrs:P,templatefallbackAttrs:S}=$u(),t=Tc(),e=Ea(),r=Td().dash,a=Td().pattern,n=js(),o=vm(),i=Ta().extendFlat,s=z0();function f(v){return{valType:"any",dflt:0,editType:"calc"}}function x(v){return{valType:"any",editType:"calc"}}function y(v){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}$.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:x(),yperiod0:x(),xperiodalignment:y(),yperiodalignment:y(),xhoverformat:c("x"),yhoverformat:c("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:P(),texttemplatefallback:S({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:g({},{keys:o.eventDataKeys}),hovertemplatefallback:S(),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:i({},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:i({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:a,marker:i({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:i({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"}}}),H_=Ft((Q,$)=>{var c=gm(),g=tf().line,P=Td().dash,S=Ta().extendFlat,t=Yc().overrideAll,e=pu().templatedArray;Zy(),$.exports=t(e("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:S({},c.xref,{}),yref:S({},c.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:g.color,width:S({},g.width,{min:1,dflt:1}),dash:S({},P,{dflt:"dot"})}}),"arraydraw","from-root")}),y6=Ft((Q,$)=>{var c=bn(),g=Es(),P=Md(),S=H_(),t=bp();$.exports=function(r,a){P(r,a,{name:"selections",handleItemDefaults:e});for(var n=a.selections,o=0;o<n.length;o++){var i=n[o];i&&i.path===void 0&&(i.x0===void 0||i.x1===void 0||i.y0===void 0||i.y1===void 0)&&(a.selections[o]=null)}};function e(r,a,n){function o(R,O){return c.coerce(r,a,S,R,O)}var i=o("path"),s=i?"path":"rect",f=o("type",s),x=f!=="path";x&&delete a.path,o("opacity"),o("line.color"),o("line.width"),o("line.dash");for(var y=["x","y"],v=0;v<2;v++){var T=y[v],u={_fullLayout:n},b,_,C,M=g.coerceRef(r,a,u,T);if(b=g.getFromId(u,M),b._selectionIndices.push(a._index),C=t.rangeToShapePosition(b),_=t.shapePositionToRange(b),x){var E=T+"0",A=T+"1",h=r[E],p=r[A];r[E]=_(r[E],!0),r[A]=_(r[A],!0),g.coercePosition(a,u,o,M,E),g.coercePosition(a,u,o,M,A);var k=a[E],w=a[A];k!==void 0&&w!==void 0&&(a[E]=C(k),a[A]=C(w),r[E]=h,r[A]=p)}}x&&c.noneOrAll(r,a,["x0","x1","y0","y1"])}}),X0=Ft((Q,$)=>{$.exports=function(c,g,P){P("newselection.mode");var S=P("newselection.line.width");S&&(P("newselection.line.color"),P("newselection.line.dash")),P("activeselection.fillcolor"),P("activeselection.opacity")}}),Ag=Ft((Q,$)=>{var c=Xo(),g=bn(),P=Rc();$.exports=function(S){return function(t,e){var r=t[S];if(Array.isArray(r))for(var a=c.subplotsRegistry.cartesian,n=a.idRegex,o=e._subplots,i=o.xaxis,s=o.yaxis,f=o.cartesian,x=e._has("cartesian"),y=0;y<r.length;y++){var v=r[y];if(g.isPlainObject(v)){var T=P.cleanId(v.xref,"x",!1),u=P.cleanId(v.yref,"y",!1),b=n.x.test(T),_=n.y.test(u);if(b||_){x||g.pushUnique(e._basePlotModules,a);var C=!1;b&&i.indexOf(T)===-1&&(i.push(T),C=!0),_&&s.indexOf(u)===-1&&(s.push(u),C=!0),C&&b&&_&&f.push(T+u)}}}}}}),vf=Ft((Q,$)=>{var c=kw(),g=U_();$.exports={moduleType:"component",name:"selections",layoutAttributes:H_(),supplyLayoutDefaults:y6(),supplyDrawNewSelectionDefaults:X0(),includeBasePlot:Ag()("selections"),draw:c.draw,drawOne:c.drawOne,reselect:g.reselect,prepSelect:g.prepSelect,clearOutline:g.clearOutline,clearSelectionsCache:g.clearSelectionsCache,selectOnClick:g.selectOnClick}}),S1=Ft((Q,$)=>{var c=un(),g=bn(),P=g.numberFormat,S=fo(),t=C_(),e=Xo(),r=g.strTranslate,a=tc(),n=li(),o=js(),i=Qh(),s=Es(),f=P0(),x=up(),y=v0(),v=y.selectingOrDrawing,T=y.freeMode,u=Af().FROM_TL,b=mv(),_=y0().redrawReglTraces,C=Kc(),M=Rc().getFromId,E=vf().prepSelect,A=vf().clearOutline,h=vf().selectOnClick,p=Uy(),k=ic(),w=k.MINDRAG,R=k.MINZOOM,O=!0;function N(wt,zt,Pt,Wt,Ht,Jt,ge,he){var de=wt._fullLayout._zoomlayer,se=ge+he==="nsew",Tt=(ge+he).length===1,Lt,Mt,te,ve,oe,Te,He,Ge,cr,ur,jr,Hr,br,Kr,rn,Ce,$t,ne,Ct,gt,St,Nt,ee;Pt+=zt.yaxis._shift;function le(){if(Lt=zt.xaxis,Mt=zt.yaxis,cr=Lt._length,ur=Mt._length,He=Lt._offset,Ge=Mt._offset,te={},te[Lt._id]=Lt,ve={},ve[Mt._id]=Mt,ge&&he)for(var Pe=zt.overlays,Rr=0;Rr<Pe.length;Rr++){var qr=Pe[Rr].xaxis;te[qr._id]=qr;var $r=Pe[Rr].yaxis;ve[$r._id]=$r}oe=ut(te),Te=ut(ve),br=F(oe,he),Kr=F(Te,ge),rn=!Kr&&!br,Hr=Y(wt,wt._fullLayout._axisMatchGroups,te,ve),jr=Y(wt,wt._fullLayout._axisConstraintGroups,te,ve,Hr);var Br=jr.isSubplotConstrained||Hr.isSubplotConstrained;Ce=he||Br,$t=ge||Br;var Gr=wt._fullLayout;ne=Gr._has("scattergl"),Ct=Gr._has("splom"),gt=Gr._has("svg")}le();var we=lt(Kr+br,wt._fullLayout.dragmode,se),Ue=H(zt,ge+he+"drag",we,Pt,Wt,Ht,Jt);if(rn&&!se)return Ue.onmousedown=null,Ue.style.pointerEvents="none",Ue;var qe={element:Ue,gd:wt,plotinfo:zt};qe.prepFn=function(Pe,Rr,qr){var $r=qe.dragmode,Br=wt._fullLayout.dragmode;Br!==$r&&(qe.dragmode=Br),le(),Nt=wt._fullLayout._invScaleX,ee=wt._fullLayout._invScaleY,rn||(se?Pe.shiftKey?Br==="pan"?Br="zoom":v(Br)||(Br="pan"):Pe.ctrlKey&&(Br="pan"):Br="pan"),T(Br)?qe.minDrag=1:qe.minDrag=void 0,v(Br)?(qe.xaxes=oe,qe.yaxes=Te,E(Pe,Rr,qr,qe,Br)):(qe.clickFn=Ar,v($r)&&ar(),rn||(Br==="zoom"?(qe.moveFn=We,qe.doneFn=fr,qe.minDrag=1,Hi(Pe,Rr,qr)):Br==="pan"&&(qe.moveFn=ci,qe.doneFn=Zi))),wt._fullLayout._redrag=function(){var Gr=wt._dragdata;if(Gr&&Gr.element===Ue){var dn=wt._fullLayout.dragmode;v(dn)||(le(),ui([0,0,cr,ur]),qe.moveFn(Gr.dx,Gr.dy))}}};function ar(){qe.plotinfo.selection=!1,A(wt)}function Ar(Pe,Rr){var qr=qe.gd;if(qr._fullLayout._activeShapeIndex>=0){qr._fullLayout._deactivateShape(qr);return}var $r=qr._fullLayout.clickmode;if(dt(qr),Pe===2&&!Tt&&Di(),se)$r.indexOf("select")>-1&&h(Rr,qr,oe,Te,zt.id,qe),$r.indexOf("event")>-1&&i.click(qr,Rr,zt.id);else if(Pe===1&&Tt){var Br=ge?Mt:Lt,Gr=ge==="s"||he==="w"?0:1,dn=Br._name+".range["+Gr+"]",an=U(Br,Gr),Ee="left",dr="middle";if(Br.fixedrange)return;ge?(dr=ge==="n"?"top":"bottom",Br.side==="right"&&(Ee="right")):he==="e"&&(Ee="right"),qr._context.showAxisRangeEntryBoxes&&c.select(Ue).call(a.makeEditable,{gd:qr,immediate:!0,background:qr._fullLayout.paper_bgcolor,text:String(an),fill:Br.tickfont?Br.tickfont.color:"#444",horizontalAlign:Ee,verticalAlign:dr}).on("edit",function(Vr){var yn=Br.d2r(Vr);yn!==void 0&&e.call("_guiRelayout",qr,dn,yn)})}}x.init(qe);var Tr,pr,Jr,Vn,Hn,Kn,Ci,ii,qn,oa;function Hi(Pe,Rr,qr){var $r=Ue.getBoundingClientRect();Tr=Rr-$r.left,pr=qr-$r.top,wt._fullLayout._calcInverseTransform(wt);var Br=g.apply3DTransform(wt._fullLayout._invTransform)(Tr,pr);Tr=Br[0],pr=Br[1],Jr={l:Tr,r:Tr,w:0,t:pr,b:pr,h:0},Vn=wt._hmpixcount?wt._hmlumcount/wt._hmpixcount:S(wt._fullLayout.plot_bgcolor).getLuminance(),Hn="M0,0H"+cr+"V"+ur+"H0V0",Kn=!1,Ci="xy",oa=!1,ii=yt(de,Vn,He,Ge,Hn),qn=pt(de,He,Ge)}function We(Pe,Rr){if(wt._transitioningWithDuration)return!1;var qr=Math.max(0,Math.min(cr,Nt*Pe+Tr)),$r=Math.max(0,Math.min(ur,ee*Rr+pr)),Br=Math.abs(qr-Tr),Gr=Math.abs($r-pr);Jr.l=Math.min(Tr,qr),Jr.r=Math.max(Tr,qr),Jr.t=Math.min(pr,$r),Jr.b=Math.max(pr,$r);function dn(){Ci="",Jr.r=Jr.l,Jr.t=Jr.b,qn.attr("d","M0,0Z")}if(jr.isSubplotConstrained)Br>R||Gr>R?(Ci="xy",Br/cr>Gr/ur?(Gr=Br*ur/cr,pr>$r?Jr.t=pr-Gr:Jr.b=pr+Gr):(Br=Gr*cr/ur,Tr>qr?Jr.l=Tr-Br:Jr.r=Tr+Br),qn.attr("d",it(Jr))):dn();else if(Hr.isSubplotConstrained)if(Br>R||Gr>R){Ci="xy";var an=Math.min(Jr.l/cr,(ur-Jr.b)/ur),Ee=Math.max(Jr.r/cr,(ur-Jr.t)/ur);Jr.l=an*cr,Jr.r=Ee*cr,Jr.b=(1-an)*ur,Jr.t=(1-Ee)*ur,qn.attr("d",it(Jr))}else dn();else!Kr||Gr<Math.min(Math.max(Br*.6,w),R)?Br<w||!br?dn():(Jr.t=0,Jr.b=ur,Ci="x",qn.attr("d",at(Jr,pr))):!br||Br<Math.min(Gr*.6,R)?(Jr.l=0,Jr.r=cr,Ci="y",qn.attr("d",vt(Jr,Tr))):(Ci="xy",qn.attr("d",it(Jr)));Jr.w=Jr.r-Jr.l,Jr.h=Jr.b-Jr.t,Ci&&(oa=!0),wt._dragged=oa,st(ii,qn,Jr,Hn,Kn,Vn),rr(),wt.emit("plotly_relayouting",St),Kn=!0}function rr(){St={},(Ci==="xy"||Ci==="x")&&(W(oe,Jr.l/cr,Jr.r/cr,St,jr.xaxes),xi("x",St)),(Ci==="xy"||Ci==="y")&&(W(Te,(ur-Jr.b)/ur,(ur-Jr.t)/ur,St,jr.yaxes),xi("y",St))}function fr(){rr(),dt(wt),Zi(),rt(wt)}var xr=[0,0,cr,ur],Qr=null,Cn=k.REDRAWDELAY,wn=zt.mainplot?wt._fullLayout._plots[zt.mainplot]:zt;function Mn(Pe){if(!wt._context._scrollZoom.cartesian&&!wt._fullLayout._enablescrollzoom)return;if(ar(),wt._transitioningWithDuration){Pe.preventDefault(),Pe.stopPropagation();return}le(),clearTimeout(Qr);var Rr=-Pe.deltaY;if(isFinite(Rr)||(Rr=Pe.wheelDelta/10),!isFinite(Rr)){g.log("Did not find wheel motion attributes: ",Pe);return}var qr=Math.exp(-Math.min(Math.max(Rr,-20),20)/200),$r=wn.draglayer.select(".nsewdrag").node().getBoundingClientRect(),Br=(Pe.clientX-$r.left)/$r.width,Gr=($r.bottom-Pe.clientY)/$r.height,dn;function an(Ee,dr,Vr){if(Ee.fixedrange)return;var yn=g.simpleMap(Ee.range,Ee.r2l),Fn=yn[0]+(yn[1]-yn[0])*dr;function Xn(Pn){return Ee.l2r(Fn+(Pn-Fn)*Vr)}Ee.range=yn.map(Xn)}if(Ce){for(he||(Br=.5),dn=0;dn<oe.length;dn++)an(oe[dn],Br,qr);xi("x"),xr[2]*=qr,xr[0]+=xr[2]*Br*(1/qr-1)}if($t){for(ge||(Gr=.5),dn=0;dn<Te.length;dn++)an(Te[dn],Gr,qr);xi("y"),xr[3]*=qr,xr[1]+=xr[3]*(1-Gr)*(1/qr-1)}ui(xr),Pi(),wt.emit("plotly_relayouting",St),Qr=setTimeout(function(){wt._fullLayout&&(xr=[0,0,cr,ur],Zi())},Cn),Pe.preventDefault()}ge.length*he.length!==1&&ft(Ue,Mn);function ci(Pe,Rr){if(Pe=Pe*Nt,Rr=Rr*ee,wt._transitioningWithDuration)return;if(wt._fullLayout._replotting=!0,br==="ew"||Kr==="ns"){var qr=br?-Pe:0,$r=Kr?-Rr:0;if(Hr.isSubplotConstrained){if(br&&Kr){var Br=(Pe/cr-Rr/ur)/2;Pe=Br*cr,Rr=-Br*ur,qr=-Pe,$r=-Rr}Kr?qr=-$r*cr/ur:$r=-qr*ur/cr}br&&(q(oe,Pe),xi("x")),Kr&&(q(Te,Rr),xi("y")),ui([qr,$r,cr,ur]),Pi(),wt.emit("plotly_relayouting",St);return}function Gr(Xn,Pn,En){for(var Zn=1-Pn,Ca,Ri,Ja=0;Ja<Xn.length;Ja++){var Xa=Xn[Ja];if(!Xa.fixedrange){Ca=Xa,Ri=Xa._rl[Zn]+(Xa._rl[Pn]-Xa._rl[Zn])/X(En/Xa._length);var Io=Xa.l2r(Ri);Io!==!1&&Io!==void 0&&(Xa.range[Pn]=Io)}}return Ca._length*(Ca._rl[Pn]-Ri)/(Ca._rl[Pn]-Ca._rl[Zn])}var dn=br==="w"==(Kr==="n")?1:-1;if(br&&Kr&&(jr.isSubplotConstrained||Hr.isSubplotConstrained)){var an=(Pe/cr+dn*Rr/ur)/2;Pe=an*cr,Rr=dn*an*ur}var Ee,dr;if(br==="w"?Pe=Gr(oe,0,Pe):br==="e"?Pe=Gr(oe,1,-Pe):br||(Pe=0),Kr==="n"?Rr=Gr(Te,1,Rr):Kr==="s"?Rr=Gr(Te,0,-Rr):Kr||(Rr=0),Ee=br==="w"?Pe:0,dr=Kr==="n"?Rr:0,jr.isSubplotConstrained&&!Hr.isSubplotConstrained||Hr.isSubplotConstrained&&br&&Kr&&dn>0){var Vr;if(Hr.isSubplotConstrained||!br&&Kr.length===1){for(Vr=0;Vr<oe.length;Vr++)oe[Vr].range=oe[Vr]._r.slice(),p(oe[Vr],1-Rr/ur);Pe=Rr*cr/ur,Ee=Pe/2}if(Hr.isSubplotConstrained||!Kr&&br.length===1){for(Vr=0;Vr<Te.length;Vr++)Te[Vr].range=Te[Vr]._r.slice(),p(Te[Vr],1-Pe/cr);Rr=Pe*ur/cr,dr=Rr/2}}(!Hr.isSubplotConstrained||!Kr)&&xi("x"),(!Hr.isSubplotConstrained||!br)&&xi("y");var yn=cr-Pe,Fn=ur-Rr;Hr.isSubplotConstrained&&!(br&&Kr)&&(br?(dr=Ee?0:Pe*ur/cr,Fn=yn*ur/cr):(Ee=dr?0:Rr*cr/ur,yn=Fn*cr/ur)),ui([Ee,dr,yn,Fn]),Pi(),wt.emit("plotly_relayouting",St)}function xi(Pe,Rr){for(var qr=Hr.isSubplotConstrained?{x:Te,y:oe}[Pe]:Hr[Pe+"axes"],$r=Hr.isSubplotConstrained?{x:oe,y:Te}[Pe]:[],Br=0;Br<qr.length;Br++){var Gr=qr[Br],dn=Gr._id,an=Hr.xLinks[dn]||Hr.yLinks[dn],Ee=$r[0]||te[an]||ve[an];Ee&&(Rr?(Rr[Gr._name+".range[0]"]=Rr[Ee._name+".range[0]"],Rr[Gr._name+".range[1]"]=Rr[Ee._name+".range[1]"]):Gr.range=Ee.range.slice())}}function Pi(){var Pe=[],Rr;function qr(dn){for(Rr=0;Rr<dn.length;Rr++)dn[Rr].fixedrange||Pe.push(dn[Rr]._id)}function $r(dn,an){for(Rr=0;Rr<dn.length;Rr++){var Ee=dn[Rr],dr=Ee[an];!Ee.fixedrange&&dr.tickmode==="sync"&&Pe.push(dr._id)}}for(Ce&&(qr(oe),qr(jr.xaxes),qr(Hr.xaxes),$r(zt.overlays,"xaxis")),$t&&(qr(Te),qr(jr.yaxes),qr(Hr.yaxes),$r(zt.overlays,"yaxis")),St={},Rr=0;Rr<Pe.length;Rr++){var Br=Pe[Rr],Gr=M(wt,Br);s.drawOne(wt,Gr,{skipTitle:!0}),St[Gr._name+".range[0]"]=Gr.range[0],St[Gr._name+".range[1]"]=Gr.range[1]}s.redrawComponents(wt,Pe)}function Di(){if(!wt._transitioningWithDuration){var Pe=wt._context.doubleClick,Rr=[];br&&(Rr=Rr.concat(oe)),Kr&&(Rr=Rr.concat(Te)),Hr.xaxes&&(Rr=Rr.concat(Hr.xaxes)),Hr.yaxes&&(Rr=Rr.concat(Hr.yaxes));var qr={},$r,Br;if(Pe==="reset+autosize")for(Pe="autosize",Br=0;Br<Rr.length;Br++){$r=Rr[Br];var Gr=$r._rangeInitial0,dn=$r._rangeInitial1,an=Gr!==void 0||dn!==void 0;if(an&&(Gr!==void 0&&Gr!==$r.range[0]||dn!==void 0&&dn!==$r.range[1])||!an&&$r.autorange!==!0){Pe="reset";break}}if(Pe==="autosize")for(Br=0;Br<Rr.length;Br++)$r=Rr[Br],$r.fixedrange||(qr[$r._name+".autorange"]=!0);else if(Pe==="reset"){for((br||jr.isSubplotConstrained)&&(Rr=Rr.concat(jr.xaxes)),Kr&&!jr.isSubplotConstrained&&(Rr=Rr.concat(jr.yaxes)),jr.isSubplotConstrained&&(br?Kr||(Rr=Rr.concat(Te)):Rr=Rr.concat(oe)),Br=0;Br<Rr.length;Br++)if($r=Rr[Br],!$r.fixedrange){var Ee=$r._name,dr=$r._autorangeInitial;$r._rangeInitial0===void 0&&$r._rangeInitial1===void 0?qr[Ee+".autorange"]=!0:$r._rangeInitial0===void 0?(qr[Ee+".autorange"]=dr,qr[Ee+".range"]=[null,$r._rangeInitial1]):$r._rangeInitial1===void 0?(qr[Ee+".range"]=[$r._rangeInitial0,null],qr[Ee+".autorange"]=dr):qr[Ee+".range"]=[$r._rangeInitial0,$r._rangeInitial1]}}wt.emit("plotly_doubleclick",null),e.call("_guiRelayout",wt,qr)}}function Zi(){ui([0,0,cr,ur]),g.syncOrAsync([C.previousPromises,function(){wt._fullLayout._replotting=!1,e.call("_guiRelayout",wt,St)}],wt)}function ui(Pe){var Rr=wt._fullLayout,qr=Rr._plots,$r=Rr._subplots.cartesian,Br,Gr,dn,an;if(Ct&&e.subplotsRegistry.splom.drag(wt),ne){for(Br=0;Br<$r.length;Br++)if(Gr=qr[$r[Br]],dn=Gr.xaxis,an=Gr.yaxis,Gr._scene){dn.limitRange&&dn.limitRange(),an.limitRange&&an.limitRange();var Ee=g.simpleMap(dn.range,dn.r2l),dr=g.simpleMap(an.range,an.r2l);Gr._scene.update({range:[Ee[0],dr[0],Ee[1],dr[1]]})}}if((Ct||ne)&&(b(wt),_(wt)),gt){var Vr=Pe[2]/Lt._length,yn=Pe[3]/Mt._length;for(Br=0;Br<$r.length;Br++){Gr=qr[$r[Br]],dn=Gr.xaxis,an=Gr.yaxis;var Fn=(Ce||Hr.isSubplotConstrained)&&!dn.fixedrange&&te[dn._id],Xn=($t||Hr.isSubplotConstrained)&&!an.fixedrange&&ve[an._id],Pn,En,Zn,Ca;if(Fn?(Pn=Vr,Zn=he||Hr.isSubplotConstrained?Pe[0]:ze(dn,Pn)):Hr.xaHash[dn._id]?(Pn=Vr,Zn=Pe[0]*dn._length/Lt._length):Hr.yaHash[dn._id]?(Pn=yn,Zn=Kr==="ns"?-Pe[1]*dn._length/Mt._length:ze(dn,Pn,{n:"top",s:"bottom"}[Kr])):(Pn=Pa(dn,Vr,yn),Zn=Wa(dn,Pn)),Pn>1&&(dn.maxallowed!==void 0&&Ce===(dn.range[0]<dn.range[1]?"e":"w")||dn.minallowed!==void 0&&Ce===(dn.range[0]<dn.range[1]?"w":"e"))&&(Pn=1,Zn=0),Xn?(En=yn,Ca=ge||Hr.isSubplotConstrained?Pe[1]:ze(an,En)):Hr.yaHash[an._id]?(En=yn,Ca=Pe[1]*an._length/Mt._length):Hr.xaHash[an._id]?(En=Vr,Ca=br==="ew"?-Pe[0]*an._length/Lt._length:ze(an,En,{e:"right",w:"left"}[br])):(En=Pa(an,Vr,yn),Ca=Wa(an,En)),En>1&&(an.maxallowed!==void 0&&$t===(an.range[0]<an.range[1]?"n":"s")||an.minallowed!==void 0&&$t===(an.range[0]<an.range[1]?"s":"n"))&&(En=1,Ca=0),!(!Pn&&!En)){Pn||(Pn=1),En||(En=1);var Ri=dn._offset-Zn/Pn,Ja=an._offset-Ca/En;Gr.clipRect.call(o.setTranslate,Zn,Ca).call(o.setScale,Pn,En),Gr.plot.call(o.setTranslate,Ri,Ja).call(o.setScale,1/Pn,1/En),(Pn!==Gr.xScaleFactor||En!==Gr.yScaleFactor)&&(o.setPointGroupScale(Gr.zoomScalePts,Pn,En),o.setTextPointsScale(Gr.zoomScaleTxt,Pn,En)),o.hideOutsideRangePoints(Gr.clipOnAxisFalseTraces,Gr),Gr.xScaleFactor=Pn,Gr.yScaleFactor=En}}}}function Pa(Pe,Rr,qr){return Pe.fixedrange?0:Ce&&jr.xaHash[Pe._id]?Rr:$t&&(jr.isSubplotConstrained?jr.xaHash:jr.yaHash)[Pe._id]?qr:0}function Wa(Pe,Rr){return Rr?(Pe.range=Pe._r.slice(),p(Pe,Rr),ze(Pe,Rr)):0}function ze(Pe,Rr,qr){return Pe._length*(1-Rr)*u[qr||Pe.constraintoward||"middle"]}return Ue}function V(wt,zt,Pt,Wt){var Ht=g.ensureSingle(wt.draglayer,zt,Pt,function(Jt){Jt.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",wt.id)});return Ht.call(f,Wt),Ht.node()}function H(wt,zt,Pt,Wt,Ht,Jt,ge){var he=V(wt,"rect",zt,Pt);return c.select(he).call(o.setRect,Wt,Ht,Jt,ge),he}function F(wt,zt){for(var Pt=0;Pt<wt.length;Pt++)if(!wt[Pt].fixedrange)return zt;return""}function U(wt,zt){var Pt=wt.range[zt],Wt=Math.abs(Pt-wt.range[1-zt]),Ht;return wt.type==="date"?Pt:wt.type==="log"?(Ht=Math.ceil(Math.max(0,-Math.log(Wt)/Math.LN10))+3,P("."+Ht+"g")(Math.pow(10,Pt))):(Ht=Math.floor(Math.log(Math.abs(Pt))/Math.LN10)-Math.floor(Math.log(Wt)/Math.LN10)+4,P("."+String(Ht)+"g")(Pt))}function W(wt,zt,Pt,Wt,Ht){for(var Jt=0;Jt<wt.length;Jt++){var ge=wt[Jt];if(!ge.fixedrange)if(ge.rangebreaks){var he=ge._id.charAt(0)==="y",de=he?1-zt:zt,se=he?1-Pt:Pt;Wt[ge._name+".range[0]"]=ge.l2r(ge.p2l(de*ge._length)),Wt[ge._name+".range[1]"]=ge.l2r(ge.p2l(se*ge._length))}else{var Tt=ge._rl[0],Lt=ge._rl[1]-Tt;Wt[ge._name+".range[0]"]=ge.l2r(Tt+Lt*zt),Wt[ge._name+".range[1]"]=ge.l2r(Tt+Lt*Pt)}}if(Ht&&Ht.length){var Mt=(zt+(1-Pt))/2;W(Ht,Mt,1-Mt,Wt,[])}}function q(wt,zt){for(var Pt=0;Pt<wt.length;Pt++){var Wt=wt[Pt];if(!Wt.fixedrange){if(Wt.rangebreaks){var Ht=0,Jt=Wt._length,ge=Wt.p2l(Ht+zt)-Wt.p2l(Ht),he=Wt.p2l(Jt+zt)-Wt.p2l(Jt),de=(ge+he)/2;Wt.range=[Wt.l2r(Wt._rl[0]-de),Wt.l2r(Wt._rl[1]-de)]}else Wt.range=[Wt.l2r(Wt._rl[0]-zt/Wt._m),Wt.l2r(Wt._rl[1]-zt/Wt._m)];Wt.limitRange&&Wt.limitRange()}}}function X(wt){return 1-(wt>=0?Math.min(wt,.9):1/(1/Math.max(wt,-.3)+3.222))}function lt(wt,zt,Pt){return wt?wt==="nsew"?Pt?"":zt==="pan"?"move":"crosshair":wt.toLowerCase()+"-resize":"pointer"}function yt(wt,zt,Pt,Wt,Ht){return wt.append("path").attr("class","zoombox").style({fill:zt>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Pt,Wt)).attr("d",Ht+"Z")}function pt(wt,zt,Pt){return wt.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(zt,Pt)).attr("d","M0,0Z")}function st(wt,zt,Pt,Wt,Ht,Jt){wt.attr("d",Wt+"M"+Pt.l+","+Pt.t+"v"+Pt.h+"h"+Pt.w+"v-"+Pt.h+"h-"+Pt.w+"Z"),tt(wt,zt,Ht,Jt)}function tt(wt,zt,Pt,Wt){Pt||(wt.transition().style("fill",Wt>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),zt.transition().style("opacity",1).duration(200))}function dt(wt){c.select(wt).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function rt(wt){O&&wt.data&&wt._context.showTips&&(g.notifier(g._(wt,"Double-click to zoom back out"),"long"),O=!1)}function at(wt,zt){return"M"+(wt.l-.5)+","+(zt-R-.5)+"h-3v"+(2*R+1)+"h3ZM"+(wt.r+.5)+","+(zt-R-.5)+"h3v"+(2*R+1)+"h-3Z"}function vt(wt,zt){return"M"+(zt-R-.5)+","+(wt.t-.5)+"v-3h"+(2*R+1)+"v3ZM"+(zt-R-.5)+","+(wt.b+.5)+"v3h"+(2*R+1)+"v-3Z"}function it(wt){var zt=Math.floor(Math.min(wt.b-wt.t,wt.r-wt.l,R)/2);return"M"+(wt.l-3.5)+","+(wt.t-.5+zt)+"h3v"+-zt+"h"+zt+"v-3h-"+(zt+3)+"ZM"+(wt.r+3.5)+","+(wt.t-.5+zt)+"h-3v"+-zt+"h"+-zt+"v-3h"+(zt+3)+"ZM"+(wt.r+3.5)+","+(wt.b+.5-zt)+"h-3v"+zt+"h"+-zt+"v3h"+(zt+3)+"ZM"+(wt.l-3.5)+","+(wt.b+.5-zt)+"h3v"+zt+"h"+zt+"v3h-"+(zt+3)+"Z"}function Y(wt,zt,Pt,Wt,Ht){for(var Jt=!1,ge={},he={},de,se,Tt,Lt,Mt=(Ht||{}).xaHash,te=(Ht||{}).yaHash,ve=0;ve<zt.length;ve++){var oe=zt[ve];for(de in Pt)if(oe[de]){for(Tt in oe)!(Ht&&(Mt[Tt]||te[Tt]))&&!(Tt.charAt(0)==="x"?Pt:Wt)[Tt]&&(ge[Tt]=de);for(se in Wt)!(Ht&&(Mt[se]||te[se]))&&oe[se]&&(Jt=!0)}for(se in Wt)if(oe[se])for(Lt in oe)!(Ht&&(Mt[Lt]||te[Lt]))&&!(Lt.charAt(0)==="x"?Pt:Wt)[Lt]&&(he[Lt]=se)}Jt&&(g.extendFlat(ge,he),he={});var Te={},He=[];for(Tt in ge){var Ge=M(wt,Tt);He.push(Ge),Te[Ge._id]=Ge}var cr={},ur=[];for(Lt in he){var jr=M(wt,Lt);ur.push(jr),cr[jr._id]=jr}return{xaHash:Te,yaHash:cr,xaxes:He,yaxes:ur,xLinks:ge,yLinks:he,isSubplotConstrained:Jt}}function ft(wt,zt){if(!t)wt.onwheel!==void 0?wt.onwheel=zt:wt.onmousewheel!==void 0?wt.onmousewheel=zt:wt.isAddedWheelEvent||(wt.isAddedWheelEvent=!0,wt.addEventListener("wheel",zt,{passive:!1}));else{var Pt=wt.onwheel!==void 0?"wheel":"mousewheel";wt._onwheel&&wt.removeEventListener(Pt,wt._onwheel),wt._onwheel=zt,wt.addEventListener(Pt,zt,{passive:!1})}}function ut(wt){var zt=[];for(var Pt in wt)zt.push(wt[Pt]);return zt}$.exports={makeDragBox:N,makeDragger:V,makeRectDragger:H,makeZoombox:yt,makeCorners:pt,updateZoombox:st,xyCorners:it,transitionZoombox:tt,removeZoombox:dt,showDoubleClickNotifier:rt,attachWheelEventHandler:ft}}),Aw=Ft(Q=>{var $=un(),c=Qh(),g=up(),P=P0(),S=S1().makeDragBox,t=ic().DRAGGERSIZE;Q.initInteractions=function(e){var r=e._fullLayout;if(e._context.staticPlot){$.select(e).selectAll(".drag").remove();return}if(!(!r._has("cartesian")&&!r._has("splom"))){var a=Object.keys(r._plots||{}).sort(function(o,i){if((r._plots[o].mainplot&&!0)===(r._plots[i].mainplot&&!0)){var s=o.split("y"),f=i.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});a.forEach(function(o){var i=r._plots[o],s=i.xaxis,f=i.yaxis;if(!i.mainplot){var x=S(e,i,s._offset,f._offset,s._length,f._length,"ns","ew");x.onmousemove=function(T){e._fullLayout._rehover=function(){e._fullLayout._hoversubplot===o&&e._fullLayout._plots[o]&&c.hover(e,T,o)},c.hover(e,T,o),e._fullLayout._lasthover=x,e._fullLayout._hoversubplot=o},x.onmouseout=function(T){e._dragging||(e._fullLayout._hoversubplot=null,g.unhover(e,T))},e._context.showAxisDragHandles&&(S(e,i,s._offset-t,f._offset-t,t,t,"n","w"),S(e,i,s._offset+s._length,f._offset-t,t,t,"n","e"),S(e,i,s._offset-t,f._offset+f._length,t,t,"s","w"),S(e,i,s._offset+s._length,f._offset+f._length,t,t,"s","e"))}if(e._context.showAxisDragHandles){if(o===s._mainSubplot){var y=s._mainLinePosition;s.side==="top"&&(y-=t),S(e,i,s._offset+s._length*.1,y,s._length*.8,t,"","ew"),S(e,i,s._offset,y,s._length*.1,t,"","w"),S(e,i,s._offset+s._length*.9,y,s._length*.1,t,"","e")}if(o===f._mainSubplot){var v=f._mainLinePosition;f.side!=="right"&&(v-=t),S(e,i,v,f._offset+f._length*.1,t,f._length*.8,"ns",""),S(e,i,v,f._offset+f._length*.9,t,f._length*.1,"s",""),S(e,i,v,f._offset,t,f._length*.1,"n","")}}});var n=r._hoverlayer.node();n.onmousemove=function(o){o.target=e._fullLayout._lasthover,c.hover(e,o,r._hoversubplot)},n.onclick=function(o){o.target=e._fullLayout._lasthover,c.click(e,o)},n.onmousedown=function(o){e._fullLayout._lasthover.onmousedown(o)},Q.updateFx(e)}},Q.updateFx=function(e){var r=e._fullLayout,a=r.dragmode==="pan"?"move":"crosshair";P(r._draggers,a)}}),Mw=Ft((Q,$)=>{var c=Xo();$.exports=function(g){for(var P=c.layoutArrayContainers,S=c.layoutArrayRegexes,t=g.split("[")[0],e,r,a=0;a<S.length;a++)if(r=g.match(S[a]),r&&r.index===0){e=r[0];break}if(e||(e=P[P.indexOf(t)]),!e)return!1;var n=g.substr(e.length);return n?(r=n.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/),r?{array:e,index:Number(r[1]),property:r[3]||""}:!1):{array:e,index:"",property:""}}}),x6=Ft(Q=>{var $=Ei(),c=Oo(),g=Ko(),P=T_().sorterAsc,S=Xo();Q.containerArrayMatch=Mw();var t=Q.isAddVal=function(r){return r==="add"||$(r)},e=Q.isRemoveVal=function(r){return r===null||r==="remove"};Q.applyContainerArrayChanges=function(r,a,n,o,i){var s=a.astr,f=S.getComponentMethod(s,"supplyLayoutDefaults"),x=S.getComponentMethod(s,"draw"),y=S.getComponentMethod(s,"drawOne"),v=o.replot||o.recalc||f===c||x===c,T=r.layout,u=r._fullLayout;if(n[""]){Object.keys(n).length>1&&g.warn("Full array edits are incompatible with other edits",s);var b=n[""][""];if(e(b))a.set(null);else if(Array.isArray(b))a.set(b);else return g.warn("Unrecognized full array edit value",s,b),!0;return v?!1:(f(T,u),x(r),!0)}var _=Object.keys(n).map(Number).sort(P),C=a.get(),M=C||[],E=i(u,s).get(),A=[],h=-1,p=M.length,k,w,R,O,N,V,H,F;for(k=0;k<_.length;k++){if(R=_[k],O=n[R],N=Object.keys(O),V=O[""],H=t(V),R<0||R>M.length-(H?0:1)){g.warn("index out of range",s,R);continue}if(V!==void 0)N.length>1&&g.warn("Insertion & removal are incompatible with edits to the same index.",s,R),e(V)?A.push(R):H?(V==="add"&&(V={}),M.splice(R,0,V),E&&E.splice(R,0,{})):g.warn("Unrecognized full object edit value",s,R,V),h===-1&&(h=R);else for(w=0;w<N.length;w++)F=s+"["+R+"].",i(M[R],N[w],F).set(O[N[w]])}for(k=A.length-1;k>=0;k--)M.splice(A[k],1),E&&E.splice(A[k],1);if(M.length?C||a.set(M):a.set(null),v)return!1;if(f(T,u),y!==c){var U;if(h===-1)U=_;else{for(p=Math.max(M.length,p),U=[],k=0;k<_.length&&(R=_[k],!(R>=h));k++)U.push(R);for(k=h;k<p;k++)U.push(k)}for(k=0;k<U.length;k++)y(r,U[k])}else x(r);return!0}}),E1=Ft(Q=>{var $=ra(),c=Xo(),g=bn(),P=Kc(),S=Rc(),t=li(),e=S.cleanId,r=S.getFromTrace,a=c.traceIs,n=["x","y","z"];Q.clearPromiseQueue=function(u){Array.isArray(u._promises)&&u._promises.length>0&&g.log("Clearing previous rejected promises from queue."),u._promises=[]},Q.cleanLayout=function(u){var b;u||(u={}),u.xaxis1&&(u.xaxis||(u.xaxis=u.xaxis1),delete u.xaxis1),u.yaxis1&&(u.yaxis||(u.yaxis=u.yaxis1),delete u.yaxis1),u.scene1&&(u.scene||(u.scene=u.scene1),delete u.scene1);var _=(P.subplotsRegistry.cartesian||{}).attrRegex;(P.subplotsRegistry.polar||{}).attrRegex,(P.subplotsRegistry.ternary||{}).attrRegex,(P.subplotsRegistry.gl3d||{}).attrRegex;var C=Object.keys(u);for(b=0;b<C.length;b++){var M=C[b];if(_&&_.test(M)){var E=u[M];E.anchor&&E.anchor!=="free"&&(E.anchor=e(E.anchor)),E.overlaying&&(E.overlaying=e(E.overlaying)),E.type||(E.isdate?E.type="date":E.islog?E.type="log":E.isdate===!1&&E.islog===!1&&(E.type="linear")),(E.autorange==="withzero"||E.autorange==="tozero")&&(E.autorange=!0,E.rangemode="tozero"),E.insiderange&&delete E.range,delete E.islog,delete E.isdate,delete E.categories,x(E,"domain")&&delete E.domain}}var A=Array.isArray(u.annotations)?u.annotations.length:0;for(b=0;b<A;b++){var h=u.annotations[b];g.isPlainObject(h)&&(o(h,"xref"),o(h,"yref"))}var p=Array.isArray(u.shapes)?u.shapes.length:0;for(b=0;b<p;b++){var k=u.shapes[b];g.isPlainObject(k)&&(o(k,"xref"),o(k,"yref"))}var w=Array.isArray(u.images)?u.images.length:0;for(b=0;b<w;b++){var R=u.images[b];g.isPlainObject(R)&&(o(R,"xref"),o(R,"yref"))}var O=u.legend;return O&&(O.x>3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),u.dragmode==="rotate"&&(u.dragmode="orbit"),t.clean(u),u.template&&u.template.layout&&Q.cleanLayout(u.template.layout),u};function o(u,b){var _=u[b],C=b.charAt(0);_&&_!=="paper"&&(u[b]=e(_,C,!0))}Q.cleanData=function(u){for(var b=0;b<u.length;b++){var _=u[b],C;if(_.type==="histogramy"&&"xbins"in _&&!("ybins"in _)&&(_.ybins=_.xbins,delete _.xbins),_.type==="histogramy"&&Q.swapXYData(_),(_.type==="histogramx"||_.type==="histogramy")&&(_.type="histogram"),"scl"in _&&!("colorscale"in _)&&(_.colorscale=_.scl,delete _.scl),"reversescl"in _&&!("reversescale"in _)&&(_.reversescale=_.reversescl,delete _.reversescl),_.xaxis&&(_.xaxis=e(_.xaxis,"x")),_.yaxis&&(_.yaxis=e(_.yaxis,"y")),a(_,"gl3d")&&_.scene&&(_.scene=P.subplotsRegistry.gl3d.cleanId(_.scene)),!a(_,"pie-like")&&!a(_,"bar-like"))if(Array.isArray(_.textposition))for(C=0;C<_.textposition.length;C++)_.textposition[C]=f(_.textposition[C]);else _.textposition&&(_.textposition=f(_.textposition));var M=c.getModule(_);if(M&&M.colorbar){var E=M.colorbar.container,A=E?_[E]:_;A&&A.colorscale&&(A.colorscale==="YIGnBu"&&(A.colorscale="YlGnBu"),A.colorscale==="YIOrRd"&&(A.colorscale="YlOrRd"))}if(_.type==="surface"&&g.isPlainObject(_.contours)){var h=["x","y","z"];for(C=0;C<h.length;C++){var p=_.contours[h[C]];g.isPlainObject(p)&&(p.highlightColor&&(p.highlightcolor=p.highlightColor,delete p.highlightColor),p.highlightWidth&&(p.highlightwidth=p.highlightWidth,delete p.highlightWidth))}}if(_.type==="candlestick"||_.type==="ohlc"){var k=(_.increasing||{}).showlegend!==!1,w=(_.decreasing||{}).showlegend!==!1,R=i(_.increasing),O=i(_.decreasing);if(R!==!1&&O!==!1){var N=s(R,O,k,w);N&&(_.name=N)}else(R||O)&&!_.name&&(_.name=R||O)}x(_,"line")&&delete _.line,"marker"in _&&(x(_.marker,"line")&&delete _.marker.line,x(_,"marker")&&delete _.marker),t.clean(_),_.autobinx&&(delete _.autobinx,delete _.xbins),_.autobiny&&(delete _.autobiny,delete _.ybins)}};function i(u){if(!g.isPlainObject(u))return!1;var b=u.name;return delete u.name,delete u.showlegend,(typeof b=="string"||typeof b=="number")&&String(b)}function s(u,b,_,C){if(_&&!C)return u;if(C&&!_||!u.trim())return b;if(!b.trim())return u;var M=Math.min(u.length,b.length),E;for(E=0;E<M&&u.charAt(E)===b.charAt(E);E++);var A=u.substr(0,E);return A.trim()}function f(u){var b="middle",_="center";return typeof u=="string"&&(u.indexOf("top")!==-1?b="top":u.indexOf("bottom")!==-1&&(b="bottom"),u.indexOf("left")!==-1?_="left":u.indexOf("right")!==-1&&(_="right")),b+" "+_}function x(u,b){return b in u&&typeof u[b]=="object"&&Object.keys(u[b]).length===0}Q.swapXYData=function(u){var b;if(g.swapAttrs(u,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(u.z)&&Array.isArray(u.z[0])&&(u.transpose?delete u.transpose:u.transpose=!0),u.error_x&&u.error_y){var _=u.error_y,C="copy_ystyle"in _?_.copy_ystyle:!(_.color||_.thickness||_.width);g.swapAttrs(u,["error_?.copy_ystyle"]),C&&g.swapAttrs(u,["error_?.color","error_?.thickness","error_?.width"])}if(typeof u.hoverinfo=="string"){var M=u.hoverinfo.split("+");for(b=0;b<M.length;b++)M[b]==="x"?M[b]="y":M[b]==="y"&&(M[b]="x");u.hoverinfo=M.join("+")}},Q.coerceTraceIndices=function(u,b){if($(b))return[b];if(!Array.isArray(b)||!b.length)return u.data.map(function(M,E){return E});if(Array.isArray(b)){for(var _=[],C=0;C<b.length;C++)g.isIndex(b[C],u.data.length)?_.push(b[C]):g.warn("trace index (",b[C],") is not a number or is out of bounds");return _}return b},Q.manageArrayContainers=function(u,b,_){var C=u.obj,M=u.parts,E=M.length,A=M[E-1],h=$(A);if(h&&b===null){var p=M.slice(0,E-1).join("."),k=g.nestedProperty(C,p).get();k.splice(A,1)}else h&&u.get()===void 0&&u.get()===void 0&&(_[u.astr]=null),u.set(b)};var y=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function v(u){var b=u.search(y);if(b>0)return u.substr(0,b)}Q.hasParent=function(u,b){for(var _=v(b);_;){if(_ in u)return!0;_=v(_)}return!1},Q.clearAxisTypes=function(u,b,_){for(var C=0;C<b.length;C++)for(var M=u._fullData[C],E=0;E<3;E++){var A=r(u,M,n[E]);if(A&&A.type!=="log"){var h=A._name,p=A._id.substr(1);if(p.substr(0,5)==="scene"){if(_[p]!==void 0)continue;h=p+"."+h}var k=h+".type";_[h]===void 0&&_[k]===void 0&&g.nestedProperty(u.layout,k).set(null)}}};var T=(u,b)=>{let _=(...C)=>C.every(M=>g.isPlainObject(M))||C.every(M=>Array.isArray(M));if([u,b].every(C=>Array.isArray(C))){if(u.length!==b.length)return!1;for(let C=0;C<u.length;C++){let M=u[C],E=b[C];if(M!==E&&!(_(M,E)&&T(M,E)))return!1}return!0}else if([u,b].every(C=>g.isPlainObject(C))){if(Object.keys(u).length!==Object.keys(b).length)return!1;for(let C in u){if(C.startsWith("_"))continue;let M=u[C],E=b[C];if(M!==E&&!(_(M,E)&&T(M,E)))return!1}return!0}return!1};Q.collectionsAreEqual=T}),W_=Ft(Q=>{var $=un(),c=ra(),g=Rf(),P=bn(),S=P.nestedProperty,t=Om(),e=m0(),r=Xo(),a=Dm(),n=Kc(),o=Es(),i=E_(),s=Ad(),f=js(),x=li(),y=Aw().initInteractions,v=Op(),T=vf().clearOutline,u=ms().dfltConfig,b=x6(),_=E1(),C=y0(),M=Yc(),E=ic().AX_NAME_PATTERN,A=0,h=5;function p(Ct,gt,St,Nt){var ee;if(Ct=P.getGraphDiv(Ct),t.init(Ct),P.isPlainObject(gt)){var le=gt;gt=le.data,St=le.layout,Nt=le.config,ee=le.frames}var we=t.triggerHandler(Ct,"plotly_beforeplot",[gt,St,Nt]);if(we===!1)return Promise.reject();!gt&&!St&&!P.isPlotDiv(Ct)&&P.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",Ct);function Ue(){if(ee)return Q.addFrames(Ct,ee)}N(Ct,Nt),St||(St={}),$.select(Ct).classed("js-plotly-plot",!0),f.makeTester(),Array.isArray(Ct._promises)||(Ct._promises=[]);var qe=(Ct.data||[]).length===0&&Array.isArray(gt);Array.isArray(gt)&&(_.cleanData(gt),qe?Ct.data=gt:Ct.data.push.apply(Ct.data,gt),Ct.empty=!1),(!Ct.layout||qe)&&(Ct.layout=_.cleanLayout(St)),n.supplyDefaults(Ct);var ar=Ct._fullLayout,Ar=ar._has("cartesian");ar._replotting=!0,(qe||ar._shouldCreateBgLayer)&&(ne(Ct),ar._shouldCreateBgLayer&&delete ar._shouldCreateBgLayer),f.initGradients(Ct),f.initPatterns(Ct),qe&&o.saveShowSpikeInitial(Ct);var Tr=!Ct.calcdata||Ct.calcdata.length!==(Ct._fullData||[]).length;Tr&&n.doCalcdata(Ct);for(var pr=0;pr<Ct.calcdata.length;pr++)Ct.calcdata[pr][0].trace=Ct._fullData[pr];Ct._context.responsive?Ct._responsiveChartHandler||(Ct._responsiveChartHandler=function(){P.isHidden(Ct)||n.resize(Ct)},window.addEventListener("resize",Ct._responsiveChartHandler)):P.clearResponsive(Ct);var Jr=P.extendFlat({},ar._size),Vn=0;function Hn(){for(var rr=ar._basePlotModules,fr=0;fr<rr.length;fr++)rr[fr].drawFramework&&rr[fr].drawFramework(Ct);!ar._glcanvas&&ar._has("gl")&&(ar._glcanvas=ar._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],function(wn){return wn.key}),ar._glcanvas.enter().append("canvas").attr("class",function(wn){return"gl-canvas gl-canvas-"+wn.key.replace("Layer","")}).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"}));var xr=Ct._context.plotGlPixelRatio;if(ar._glcanvas){ar._glcanvas.attr("width",ar.width*xr).attr("height",ar.height*xr).style("width",ar.width+"px").style("height",ar.height+"px");var Qr=ar._glcanvas.data()[0].regl;if(Qr&&(Math.floor(ar.width*xr)!==Qr._gl.drawingBufferWidth||Math.floor(ar.height*xr)!==Qr._gl.drawingBufferHeight)){var Cn="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(Vn)P.error(Cn);else return P.log(Cn+" Clearing graph and plotting again."),n.cleanPlot([],{},Ct._fullData,ar),n.supplyDefaults(Ct),ar=Ct._fullLayout,n.doCalcdata(Ct),Vn++,Hn()}}return ar.modebar.orientation==="h"?ar._modebardiv.style("height",null).style("width","100%"):ar._modebardiv.style("width",null).style("height",ar.height+"px"),n.previousPromises(Ct)}function Kn(){if(n.clearAutoMarginIds(Ct),C.drawMarginPushers(Ct),o.allowAutoMargin(Ct),Ct._fullLayout.title.text&&Ct._fullLayout.title.automargin&&n.allowAutoMargin(Ct,"title.automargin"),ar._has("pie"))for(var rr=Ct._fullData,fr=0;fr<rr.length;fr++){var xr=rr[fr];xr.type==="pie"&&xr.automargin&&n.allowAutoMargin(Ct,"pie."+xr.uid+".automargin")}return n.doAutoMargin(Ct),n.previousPromises(Ct)}function Ci(){if(n.didMarginChange(Jr,ar._size))return P.syncOrAsync([Kn,C.layoutStyles],Ct)}function ii(){if(!Tr){qn();return}return P.syncOrAsync([r.getComponentMethod("shapes","calcAutorange"),r.getComponentMethod("annotations","calcAutorange"),qn],Ct)}function qn(){Ct._transitioning||(C.doAutoRangeAndConstraints(Ct),qe&&o.saveRangeInitial(Ct),r.getComponentMethod("rangeslider","calcAutorange")(Ct))}function oa(){return o.draw(Ct,qe?"":"redraw")}var Hi=[n.previousPromises,Ue,Hn,Kn,Ci];Ar&&Hi.push(ii),Hi.push(C.layoutStyles),Ar&&Hi.push(oa,function(rr){var fr=rr._fullLayout._insideTickLabelsUpdaterange;if(fr)return rr._fullLayout._insideTickLabelsUpdaterange=void 0,zt(rr,fr).then(function(){o.saveRangeInitial(rr,!0)})}),Hi.push(C.drawData,C.finalDraw,y,n.addLinks,n.rehover,n.redrag,n.reselect,n.doAutoMargin,n.previousPromises);var We=P.syncOrAsync(Hi,Ct);return(!We||!We.then)&&(We=Promise.resolve()),We.then(function(){return k(Ct),Ct})}function k(Ct){var gt=Ct._fullLayout;gt._redrawFromAutoMarginCount?gt._redrawFromAutoMarginCount--:Ct.emit("plotly_afterplot")}function w(Ct){return P.extendFlat(u,Ct)}function R(Ct,gt){try{Ct._fullLayout._paper.style("background",gt)}catch(St){P.error(St)}}function O(Ct,gt){var St=x.combine(gt,"white");R(Ct,St)}function N(Ct,gt){if(!Ct._context){Ct._context=P.extendDeep({},u);var St=$.select("base");Ct._context._baseUrl=St.size()&&St.attr("href")?window.location.href.split("#")[0]:""}var Nt=Ct._context,ee,le,we;if(gt){for(le=Object.keys(gt),ee=0;ee<le.length;ee++)we=le[ee],!(we==="editable"||we==="edits")&&we in Nt&&(we==="setBackground"&&gt[we]==="opaque"?Nt[we]=O:Nt[we]=gt[we]);var Ue=gt.editable;if(Ue!==void 0)for(Nt.editable=Ue,le=Object.keys(Nt.edits),ee=0;ee<le.length;ee++)Nt.edits[le[ee]]=Ue;if(gt.edits)for(le=Object.keys(gt.edits),ee=0;ee<le.length;ee++)we=le[ee],we in Nt.edits&&(Nt.edits[we]=gt.edits[we]);Nt._exportedPlot=gt._exportedPlot}Nt.staticPlot&&(Nt.editable=!1,Nt.edits={},Nt.autosizable=!1,Nt.scrollZoom=!1,Nt.doubleClick=!1,Nt.showTips=!1,Nt.showLink=!1,Nt.displayModeBar=!1),Nt.displayModeBar==="hover"&&!g&&(Nt.displayModeBar=!0),(Nt.setBackground==="transparent"||typeof Nt.setBackground!="function")&&(Nt.setBackground=R),Nt._hasZeroHeight=Nt._hasZeroHeight||Ct.clientHeight===0,Nt._hasZeroWidth=Nt._hasZeroWidth||Ct.clientWidth===0;var qe=Nt.scrollZoom,ar=Nt._scrollZoom={};if(qe===!0)ar.cartesian=1,ar.gl3d=1,ar.geo=1,ar.mapbox=1,ar.map=1;else if(typeof qe=="string"){var Ar=qe.split("+");for(ee=0;ee<Ar.length;ee++)ar[Ar[ee]]=1}else qe!==!1&&(ar.gl3d=1,ar.geo=1,ar.mapbox=1,ar.map=1)}function V(Ct){if(Ct=P.getGraphDiv(Ct),!P.isPlotDiv(Ct))throw new Error("This element is not a Plotly plot: "+Ct);return _.cleanData(Ct.data),_.cleanLayout(Ct.layout),Ct.calcdata=void 0,Q._doPlot(Ct).then(function(){return Ct.emit("plotly_redraw"),Ct})}function H(Ct,gt,St,Nt){return Ct=P.getGraphDiv(Ct),n.cleanPlot([],{},Ct._fullData||[],Ct._fullLayout||{}),n.purge(Ct),Q._doPlot(Ct,gt,St,Nt)}function F(Ct,gt){var St=gt+1,Nt=[],ee,le;for(ee=0;ee<Ct.length;ee++)le=Ct[ee],le<0?Nt.push(St+le):Nt.push(le);return Nt}function U(Ct,gt,St){var Nt,ee;for(Nt=0;Nt<gt.length;Nt++){if(ee=gt[Nt],ee!==parseInt(ee,10))throw new Error("all values in "+St+" must be integers");if(ee>=Ct.data.length||ee<-Ct.data.length)throw new Error(St+" must be valid indices for gd.data.");if(gt.indexOf(ee,Nt+1)>-1||ee>=0&&gt.indexOf(-Ct.data.length+ee)>-1||ee<0&&gt.indexOf(Ct.data.length+ee)>-1)throw new Error("each index in "+St+" must be unique.")}}function W(Ct,gt,St){if(!Array.isArray(Ct.data))throw new Error("gd.data must be an array.");if(typeof gt>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(gt)||(gt=[gt]),U(Ct,gt,"currentIndices"),typeof St<"u"&&!Array.isArray(St)&&(St=[St]),typeof St<"u"&&U(Ct,St,"newIndices"),typeof St<"u"&&gt.length!==St.length)throw new Error("current and new indices must be of equal length.")}function q(Ct,gt,St){var Nt,ee;if(!Array.isArray(Ct.data))throw new Error("gd.data must be an array.");if(typeof gt>"u")throw new Error("traces must be defined.");for(Array.isArray(gt)||(gt=[gt]),Nt=0;Nt<gt.length;Nt++)if(ee=gt[Nt],typeof ee!="object"||Array.isArray(ee)||ee===null)throw new Error("all values in traces array must be non-array objects");if(typeof St<"u"&&!Array.isArray(St)&&(St=[St]),typeof St<"u"&&St.length!==gt.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function X(Ct,gt,St,Nt){var ee=P.isPlainObject(Nt);if(!Array.isArray(Ct.data))throw new Error("gd.data must be an array");if(!P.isPlainObject(gt))throw new Error("update must be a key:value object");if(typeof St>"u")throw new Error("indices must be an integer or array of integers");U(Ct,St,"indices");for(var le in gt){if(!Array.isArray(gt[le])||gt[le].length!==St.length)throw new Error("attribute "+le+" must be an array of length equal to indices array length");if(ee&&(!(le in Nt)||!Array.isArray(Nt[le])||Nt[le].length!==gt[le].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 lt(Ct,gt,St,Nt){var ee=P.isPlainObject(Nt),le=[],we,Ue,qe,ar,Ar;Array.isArray(St)||(St=[St]),St=F(St,Ct.data.length-1);for(var Tr in gt)for(var pr=0;pr<St.length;pr++){if(we=Ct.data[St[pr]],qe=S(we,Tr),Ue=qe.get(),ar=gt[Tr][pr],!P.isArrayOrTypedArray(ar))throw new Error("attribute: "+Tr+" index: "+pr+" must be an array");if(!P.isArrayOrTypedArray(Ue))throw new Error("cannot extend missing or non-array attribute: "+Tr);if(Ue.constructor!==ar.constructor)throw new Error("cannot extend array with an array of a different type: "+Tr);Ar=ee?Nt[Tr][pr]:Nt,c(Ar)||(Ar=-1),le.push({prop:qe,target:Ue,insert:ar,maxp:Math.floor(Ar)})}return le}function yt(Ct,gt,St,Nt,ee){X(Ct,gt,St,Nt);for(var le=lt(Ct,gt,St,Nt),we={},Ue={},qe=0;qe<le.length;qe++){var ar=le[qe].prop,Ar=le[qe].maxp,Tr=ee(le[qe].target,le[qe].insert,Ar);ar.set(Tr[0]),Array.isArray(we[ar.astr])||(we[ar.astr]=[]),we[ar.astr].push(Tr[1]),Array.isArray(Ue[ar.astr])||(Ue[ar.astr]=[]),Ue[ar.astr].push(le[qe].target.length)}return{update:we,maxPoints:Ue}}function pt(Ct,gt){var St=new Ct.constructor(Ct.length+gt.length);return St.set(Ct),St.set(gt,Ct.length),St}function st(Ct,gt,St,Nt){Ct=P.getGraphDiv(Ct);function ee(qe,ar,Ar){var Tr,pr;if(P.isTypedArray(qe))if(Ar<0){var Jr=new qe.constructor(0),Vn=pt(qe,ar);Ar<0?(Tr=Vn,pr=Jr):(Tr=Jr,pr=Vn)}else if(Tr=new qe.constructor(Ar),pr=new qe.constructor(qe.length+ar.length-Ar),Ar===ar.length)Tr.set(ar),pr.set(qe);else if(Ar<ar.length){var Hn=ar.length-Ar;Tr.set(ar.subarray(Hn)),pr.set(qe),pr.set(ar.subarray(0,Hn),qe.length)}else{var Kn=Ar-ar.length,Ci=qe.length-Kn;Tr.set(qe.subarray(Ci)),Tr.set(ar,Kn),pr.set(qe.subarray(0,Ci))}else Tr=qe.concat(ar),pr=Ar>=0&&Ar<Tr.length?Tr.splice(0,Tr.length-Ar):[];return[Tr,pr]}var le=yt(Ct,gt,St,Nt,ee),we=Q.redraw(Ct),Ue=[Ct,le.update,St,le.maxPoints];return e.add(Ct,Q.prependTraces,Ue,st,arguments),we}function tt(Ct,gt,St,Nt){Ct=P.getGraphDiv(Ct);function ee(qe,ar,Ar){var Tr,pr;if(P.isTypedArray(qe))if(Ar<=0){var Jr=new qe.constructor(0),Vn=pt(ar,qe);Ar<0?(Tr=Vn,pr=Jr):(Tr=Jr,pr=Vn)}else if(Tr=new qe.constructor(Ar),pr=new qe.constructor(qe.length+ar.length-Ar),Ar===ar.length)Tr.set(ar),pr.set(qe);else if(Ar<ar.length){var Hn=ar.length-Ar;Tr.set(ar.subarray(0,Hn)),pr.set(ar.subarray(Hn)),pr.set(qe,Hn)}else{var Kn=Ar-ar.length;Tr.set(ar),Tr.set(qe.subarray(0,Kn),ar.length),pr.set(qe.subarray(Kn))}else Tr=ar.concat(qe),pr=Ar>=0&&Ar<Tr.length?Tr.splice(Ar,Tr.length):[];return[Tr,pr]}var le=yt(Ct,gt,St,Nt,ee),we=Q.redraw(Ct),Ue=[Ct,le.update,St,le.maxPoints];return e.add(Ct,Q.extendTraces,Ue,tt,arguments),we}function dt(Ct,gt,St){Ct=P.getGraphDiv(Ct);var Nt=[],ee=Q.deleteTraces,le=dt,we=[Ct,Nt],Ue=[Ct,gt],qe,ar;for(q(Ct,gt,St),Array.isArray(gt)||(gt=[gt]),gt=gt.map(function(Ar){return P.extendFlat({},Ar)}),_.cleanData(gt),qe=0;qe<gt.length;qe++)Ct.data.push(gt[qe]);for(qe=0;qe<gt.length;qe++)Nt.push(-gt.length+qe);if(typeof St>"u")return ar=Q.redraw(Ct),e.add(Ct,ee,we,le,Ue),ar;Array.isArray(St)||(St=[St]);try{W(Ct,Nt,St)}catch(Ar){throw Ct.data.splice(Ct.data.length-gt.length,gt.length),Ar}return e.startSequence(Ct),e.add(Ct,ee,we,le,Ue),ar=Q.moveTraces(Ct,Nt,St),e.stopSequence(Ct),ar}function rt(Ct,gt){Ct=P.getGraphDiv(Ct);var St=[],Nt=Q.addTraces,ee=rt,le=[Ct,St,gt],we=[Ct,gt],Ue,qe;if(typeof gt>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(gt)||(gt=[gt]),U(Ct,gt,"indices"),gt=F(gt,Ct.data.length-1),gt.sort(P.sorterDes),Ue=0;Ue<gt.length;Ue+=1)qe=Ct.data.splice(gt[Ue],1)[0],St.push(qe);var ar=Q.redraw(Ct);return e.add(Ct,Nt,le,ee,we),ar}function at(Ct,gt,St){Ct=P.getGraphDiv(Ct);var Nt=[],ee=[],le=at,we=at,Ue=[Ct,St,gt],qe=[Ct,gt,St],ar;if(W(Ct,gt,St),gt=Array.isArray(gt)?gt:[gt],typeof St>"u")for(St=[],ar=0;ar<gt.length;ar++)St.push(-gt.length+ar);for(St=Array.isArray(St)?St:[St],gt=F(gt,Ct.data.length-1),St=F(St,Ct.data.length-1),ar=0;ar<Ct.data.length;ar++)gt.indexOf(ar)===-1&&Nt.push(Ct.data[ar]);for(ar=0;ar<gt.length;ar++)ee.push({newIndex:St[ar],trace:Ct.data[gt[ar]]});for(ee.sort(function(Tr,pr){return Tr.newIndex-pr.newIndex}),ar=0;ar<ee.length;ar+=1)Nt.splice(ee[ar].newIndex,0,ee[ar].trace);Ct.data=Nt;var Ar=Q.redraw(Ct);return e.add(Ct,le,Ue,we,qe),Ar}function vt(Ct,gt,St,Nt){Ct=P.getGraphDiv(Ct),_.clearPromiseQueue(Ct);var ee={};if(typeof gt=="string")ee[gt]=St;else if(P.isPlainObject(gt))ee=P.extendFlat({},gt),Nt===void 0&&(Nt=St);else return P.warn("Restyle fail.",gt,St,Nt),Promise.reject();Object.keys(ee).length&&(Ct.changed=!0);var le=_.coerceTraceIndices(Ct,Nt),we=wt(Ct,ee,le),Ue=we.flags;Ue.calc&&(Ct.calcdata=void 0),Ue.clearAxisTypes&&_.clearAxisTypes(Ct,le,{});var qe=[];Ue.fullReplot?qe.push(Q._doPlot):(qe.push(n.previousPromises),n.supplyDefaults(Ct),Ue.markerSize&&(n.doCalcdata(Ct),Wt(qe)),Ue.style&&qe.push(C.doTraceStyle),Ue.colorbars&&qe.push(C.doColorBars),qe.push(k)),qe.push(n.rehover,n.redrag,n.reselect),e.add(Ct,vt,[Ct,we.undoit,we.traces],vt,[Ct,we.redoit,we.traces]);var ar=P.syncOrAsync(qe,Ct);return(!ar||!ar.then)&&(ar=Promise.resolve()),ar.then(function(){return Ct.emit("plotly_restyle",we.eventData),Ct})}function it(Ct){return Ct===void 0?null:Ct}function Y(Ct,gt){return gt?function(St,Nt,ee){var le=S(St,Nt),we=le.set;return le.set=function(Ue){var qe=(ee||"")+Nt;ft(qe,le.get(),Ue,Ct),we(Ue)},le}:S}function ft(Ct,gt,St,Nt){if(Array.isArray(gt)||Array.isArray(St))for(var ee=Array.isArray(gt)?gt:[],le=Array.isArray(St)?St:[],we=Math.max(ee.length,le.length),Ue=0;Ue<we;Ue++)ft(Ct+"["+Ue+"]",ee[Ue],le[Ue],Nt);else if(P.isPlainObject(gt)||P.isPlainObject(St)){var qe=P.isPlainObject(gt)?gt:{},ar=P.isPlainObject(St)?St:{},Ar=P.extendFlat({},qe,ar);for(var Tr in Ar)ft(Ct+"."+Tr,qe[Tr],ar[Tr],Nt)}else Nt[Ct]===void 0&&(Nt[Ct]=it(gt))}function ut(Ct,gt,St){for(var Nt in St){var ee=S(Ct,Nt);ft(Nt,ee.get(),St[Nt],gt)}}function wt(Ct,gt,St){var Nt=Ct._fullLayout,ee=Ct._fullData,le=Ct.data,we=Nt._guiEditing,Ue=Y(Nt._preGUI,we),qe=P.extendDeepAll({},gt),ar,Ar=M.traceFlags(),Tr={},pr={},Jr;function Vn(){return St.map(function(){})}function Hn(dr){var Vr=o.id2name(dr);Jr.indexOf(Vr)===-1&&Jr.push(Vr)}function Kn(dr){return"LAYOUT"+dr+".autorange"}function Ci(dr){return"LAYOUT"+dr+".range"}function ii(dr){for(var Vr=dr;Vr<ee.length;Vr++)if(ee[Vr]._input===le[dr])return ee[Vr]}function qn(dr,Vr,yn){if(Array.isArray(dr)){dr.forEach(function(En){qn(En,Vr,yn)});return}if(!(dr in gt||_.hasParent(gt,dr))){var Fn;if(dr.substr(0,6)==="LAYOUT")Fn=Ue(Ct.layout,dr.replace("LAYOUT",""));else{var Xn=St[yn],Pn=Nt._tracePreGUI[ii(Xn)._fullInput.uid];Fn=Y(Pn,we)(le[Xn],dr)}dr in pr||(pr[dr]=Vn()),pr[dr][yn]===void 0&&(pr[dr][yn]=it(Fn.get())),Vr!==void 0&&Fn.set(Vr)}}function oa(dr){return function(Vr){return ee[Vr][dr]}}function Hi(dr){return function(Vr,yn){return Vr===!1?ee[St[yn]][dr]:null}}for(var We in gt){if(_.hasParent(gt,We))throw new Error("cannot set "+We+" and a parent attribute simultaneously");var rr=gt[We],fr,xr,Qr,Cn,wn,Mn;if((We==="autobinx"||We==="autobiny")&&(We=We.charAt(We.length-1)+"bins",Array.isArray(rr)?rr=rr.map(Hi(We)):rr===!1?rr=St.map(oa(We)):rr=null),Tr[We]=rr,We.substr(0,6)==="LAYOUT"){Qr=Ue(Ct.layout,We.replace("LAYOUT","")),pr[We]=[it(Qr.get())],Qr.set(Array.isArray(rr)?rr[0]:rr),Ar.calc=!0;continue}for(pr[We]=Vn(),ar=0;ar<St.length;ar++){fr=le[St[ar]],xr=ii(St[ar]);var ci=Nt._tracePreGUI[xr._fullInput.uid];if(Qr=Y(ci,we)(fr,We),Cn=Qr.get(),wn=Array.isArray(rr)?rr[ar%rr.length]:rr,wn!==void 0){var xi=Qr.parts[Qr.parts.length-1],Pi=We.substr(0,We.length-xi.length-1),Di=Pi?Pi+".":"",Zi=Pi?S(xr,Pi).get():xr;if(Mn=a.getTraceValObject(xr,Qr.parts),Mn&&Mn.impliedEdits&&wn!==null)for(var ui in Mn.impliedEdits)qn(P.relativeAttr(We,ui),Mn.impliedEdits[ui],ar);else if((xi==="thicknessmode"||xi==="lenmode")&&Cn!==wn&&(wn==="fraction"||wn==="pixels")&&Zi){var Pa=Nt._size,Wa=Zi.orient,ze=Wa==="top"||Wa==="bottom";if(xi==="thicknessmode"){var Pe=ze?Pa.h:Pa.w;qn(Di+"thickness",Zi.thickness*(wn==="fraction"?1/Pe:Pe),ar)}else{var Rr=ze?Pa.w:Pa.h;qn(Di+"len",Zi.len*(wn==="fraction"?1/Rr:Rr),ar)}}else if(We==="type"&&(wn==="pie"!=(Cn==="pie")||wn==="funnelarea"!=(Cn==="funnelarea"))){var qr="x",$r="y";(wn==="bar"||Cn==="bar")&&fr.orientation==="h"&&(qr="y",$r="x"),P.swapAttrs(fr,["?","?src"],"labels",qr),P.swapAttrs(fr,["d?","?0"],"label",qr),P.swapAttrs(fr,["?","?src"],"values",$r),Cn==="pie"||Cn==="funnelarea"?(S(fr,"marker.color").set(S(fr,"marker.colors").get()),Nt._pielayer.selectAll("g.trace").remove()):r.traceIs(fr,"cartesian")&&S(fr,"marker.colors").set(S(fr,"marker.color").get())}pr[We][ar]=it(Cn);var Br=["swapxy","swapxyaxes","orientation","orientationaxes"];if(Br.indexOf(We)!==-1){if(We==="orientation"){Qr.set(wn);var Gr=fr.x&&!fr.y?"h":"v";if((Qr.get()||Gr)===xr.orientation)continue}else We==="orientationaxes"&&(fr.orientation={v:"h",h:"v"}[xr.orientation]);_.swapXYData(fr),Ar.calc=Ar.clearAxisTypes=!0}else n.dataArrayContainers.indexOf(Qr.parts[0])!==-1?(_.manageArrayContainers(Qr,wn,pr),Ar.calc=!0):(Mn?Mn.arrayOk&&!r.traceIs(xr,"regl")&&(P.isArrayOrTypedArray(wn)||P.isArrayOrTypedArray(Cn))?Ar.calc=!0:M.update(Ar,Mn):Ar.calc=!0,Qr.set(wn))}}if(["swapxyaxes","orientationaxes"].indexOf(We)!==-1&&o.swap(Ct,St),We==="orientationaxes"){var dn=S(Ct.layout,"hovermode"),an=dn.get();an==="x"?dn.set("y"):an==="y"?dn.set("x"):an==="x unified"?dn.set("y unified"):an==="y unified"&&dn.set("x unified")}if(["orientation","type"].indexOf(We)!==-1){for(Jr=[],ar=0;ar<St.length;ar++){var Ee=le[St[ar]];r.traceIs(Ee,"cartesian")&&(Hn(Ee.xaxis||"x"),Hn(Ee.yaxis||"y"))}qn(Jr.map(Kn),!0,0),qn(Jr.map(Ci),[0,1],0)}}return(Ar.calc||Ar.plot)&&(Ar.fullReplot=!0),{flags:Ar,undoit:pr,redoit:Tr,traces:St,eventData:P.extendDeepNoArrays([],[qe,St])}}function zt(Ct,gt,St){Ct=P.getGraphDiv(Ct),_.clearPromiseQueue(Ct);var Nt={};if(typeof gt=="string")Nt[gt]=St;else if(P.isPlainObject(gt))Nt=P.extendFlat({},gt);else return P.warn("Relayout fail.",gt,St),Promise.reject();Object.keys(Nt).length&&(Ct.changed=!0);var ee=he(Ct,Nt),le=ee.flags;le.calc&&(Ct.calcdata=void 0);var we=[n.previousPromises];le.layoutReplot?we.push(C.layoutReplot):Object.keys(Nt).length&&(Pt(Ct,le,ee)||n.supplyDefaults(Ct),le.legend&&we.push(C.doLegend),le.layoutstyle&&we.push(C.layoutStyles),le.axrange&&Wt(we,ee.rangesAltered),le.ticks&&we.push(C.doTicksRelayout),le.modebar&&we.push(C.doModeBar),le.camera&&we.push(C.doCamera),le.colorbars&&we.push(C.doColorBars),we.push(k)),we.push(n.rehover,n.redrag,n.reselect),e.add(Ct,zt,[Ct,ee.undoit],zt,[Ct,ee.redoit]);var Ue=P.syncOrAsync(we,Ct);return(!Ue||!Ue.then)&&(Ue=Promise.resolve(Ct)),Ue.then(function(){return Ct.emit("plotly_relayout",ee.eventData),Ct})}function Pt(Ct,gt,St){var Nt=Ct._fullLayout;if(!gt.axrange)return!1;for(var ee in gt)if(ee!=="axrange"&&gt[ee])return!1;var le,we,Ue=function(Jr,Vn){return P.coerce(le,we,s,Jr,Vn)},qe={};for(var ar in St.rangesAltered){var Ar=o.id2name(ar);if(le=Ct.layout[Ar],we=Nt[Ar],i(le,we,Ue,qe),we._matchGroup){for(var Tr in we._matchGroup)if(Tr!==ar){var pr=Nt[o.id2name(Tr)];pr.autorange=we.autorange,pr.range=we.range.slice(),pr._input.range=we.range.slice()}}}return!0}function Wt(Ct,gt){var St=gt?function(Nt){var ee=[],le=!0;for(var we in gt){var Ue=o.getFromId(Nt,we);if(ee.push(we),(Ue.ticklabelposition||"").indexOf("inside")!==-1&&Ue._anchorAxis&&ee.push(Ue._anchorAxis._id),Ue._matchGroup)for(var qe in Ue._matchGroup)gt[qe]||ee.push(qe)}return o.draw(Nt,ee,{skipTitle:le})}:function(Nt){return o.draw(Nt,"redraw")};Ct.push(T,C.doAutoRangeAndConstraints,St,C.drawData,C.finalDraw)}var Ht=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Jt=/^[xyz]axis[0-9]*\.autorange$/,ge=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function he(Ct,gt){var St=Ct.layout,Nt=Ct._fullLayout,ee=Nt._guiEditing,le=Y(Nt._preGUI,ee),we=Object.keys(gt),Ue=o.list(Ct),qe=P.extendDeepAll({},gt),ar={},Ar,Tr,pr;for(we=Object.keys(gt),Tr=0;Tr<we.length;Tr++)if(we[Tr].indexOf("allaxes")===0){for(pr=0;pr<Ue.length;pr++){var Jr=Ue[pr]._id.substr(1),Vn=Jr.indexOf("scene")!==-1?Jr+".":"",Hn=we[Tr].replace("allaxes",Vn+Ue[pr]._name);gt[Hn]||(gt[Hn]=gt[we[Tr]])}delete gt[we[Tr]]}var Kn=M.layoutFlags(),Ci={},ii={};function qn(Pn,En){if(Array.isArray(Pn)){Pn.forEach(function(Ca){qn(Ca,En)});return}if(!(Pn in gt||_.hasParent(gt,Pn))){var Zn=le(St,Pn);Pn in ii||(ii[Pn]=it(Zn.get())),En!==void 0&&Zn.set(En)}}var oa={},Hi;function We(Pn){var En=o.name2id(Pn.split(".")[0]);return oa[En]=1,En}for(var rr in gt){if(_.hasParent(gt,rr))throw new Error("cannot set "+rr+" and a parent attribute simultaneously");for(var fr=le(St,rr),xr=gt[rr],Qr=fr.parts.length,Cn=Qr-1;Cn>0&&typeof fr.parts[Cn]!="string";)Cn--;var wn=fr.parts[Cn],Mn=fr.parts[Cn-1]+"."+wn,ci=fr.parts.slice(0,Cn).join("."),xi=S(Ct.layout,ci).get(),Pi=S(Nt,ci).get(),Di=fr.get();if(xr!==void 0){Ci[rr]=xr,ii[rr]=wn==="reverse"?xr:it(Di);var Zi=a.getLayoutValObject(Nt,fr.parts);if(Zi&&Zi.impliedEdits&&xr!==null)for(var ui in Zi.impliedEdits)qn(P.relativeAttr(rr,ui),Zi.impliedEdits[ui]);if(["width","height"].indexOf(rr)!==-1)if(xr){qn("autosize",null);var Pa=rr==="height"?"width":"height";qn(Pa,Nt[Pa])}else Nt[rr]=Ct._initialAutoSize[rr];else if(rr==="autosize")qn("width",xr?null:Nt.width),qn("height",xr?null:Nt.height);else if(Mn.match(Ht))We(Mn),S(Nt,ci+"._inputRange").set(null);else if(Mn.match(Jt)){We(Mn),S(Nt,ci+"._inputRange").set(null);var Wa=S(Nt,ci).get();Wa._inputDomain&&(Wa._input.domain=Wa._inputDomain.slice())}else Mn.match(ge)&&S(Nt,ci+"._inputDomain").set(null);if(wn==="type"){Hi=xi;var ze=Pi.type==="linear"&&xr==="log",Pe=Pi.type==="log"&&xr==="linear";if(ze||Pe){if(!Hi||!Hi.range)qn(ci+".autorange",!0);else if(Pi.autorange)ze&&(Hi.range=Hi.range[1]>Hi.range[0]?[1,2]:[2,1]);else{var Rr=Hi.range[0],qr=Hi.range[1];ze?(Rr<=0&&qr<=0&&qn(ci+".autorange",!0),Rr<=0?Rr=qr/1e6:qr<=0&&(qr=Rr/1e6),qn(ci+".range[0]",Math.log(Rr)/Math.LN10),qn(ci+".range[1]",Math.log(qr)/Math.LN10)):(qn(ci+".range[0]",Math.pow(10,Rr)),qn(ci+".range[1]",Math.pow(10,qr)))}Array.isArray(Nt._subplots.polar)&&Nt._subplots.polar.length&&Nt[fr.parts[0]]&&fr.parts[1]==="radialaxis"&&delete Nt[fr.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(Ct,Pi,xr,qn),r.getComponentMethod("images","convertCoords")(Ct,Pi,xr,qn)}else qn(ci+".autorange",!0),qn(ci+".range",null);S(Nt,ci+"._inputRange").set(null)}else if(wn.match(E)){var $r=S(Nt,rr).get(),Br=(xr||{}).type;(!Br||Br==="-")&&(Br="linear"),r.getComponentMethod("annotations","convertCoords")(Ct,$r,Br,qn),r.getComponentMethod("images","convertCoords")(Ct,$r,Br,qn)}var Gr=b.containerArrayMatch(rr);if(Gr){Ar=Gr.array,Tr=Gr.index;var dn=Gr.property,an=Zi||{editType:"calc"};Tr!==""&&dn===""&&(b.isAddVal(xr)?ii[rr]=null:b.isRemoveVal(xr)?ii[rr]=(S(St,Ar).get()||[])[Tr]:P.warn("unrecognized full object value",gt)),M.update(Kn,an),ar[Ar]||(ar[Ar]={});var Ee=ar[Ar][Tr];Ee||(Ee=ar[Ar][Tr]={}),Ee[dn]=xr,delete gt[rr]}else wn==="reverse"?(xi.range?xi.range.reverse():(qn(ci+".autorange",!0),xi.range=[1,0]),Pi.autorange?Kn.calc=!0:Kn.plot=!0):(rr==="dragmode"&&(xr===!1&&Di!==!1||xr!==!1&&Di===!1)||Nt._has("scatter-like")&&Nt._has("regl")&&rr==="dragmode"&&(xr==="lasso"||xr==="select")&&!(Di==="lasso"||Di==="select")?Kn.plot=!0:Zi?M.update(Kn,Zi):Kn.calc=!0,fr.set(xr))}}for(Ar in ar){var dr=b.applyContainerArrayChanges(Ct,le(St,Ar),ar[Ar],Kn,le);dr||(Kn.plot=!0)}for(var Vr in oa){Hi=o.getFromId(Ct,Vr);var yn=Hi&&Hi._constraintGroup;if(yn){Kn.calc=!0;for(var Fn in yn)oa[Fn]||(o.getFromId(Ct,Fn)._constraintShrinkable=!0)}}(de(Ct)||gt.height||gt.width)&&(Kn.plot=!0);var Xn=Nt.shapes;for(Tr=0;Tr<Xn.length;Tr++)if(Xn[Tr].showlegend){Kn.calc=!0;break}return(Kn.plot||Kn.calc)&&(Kn.layoutReplot=!0),{flags:Kn,rangesAltered:oa,undoit:ii,redoit:Ci,eventData:qe}}function de(Ct){var gt=Ct._fullLayout,St=gt.width,Nt=gt.height;return Ct.layout.autosize&&n.plotAutoSize(Ct,Ct.layout,gt),gt.width!==St||gt.height!==Nt}function se(Ct,gt,St,Nt){Ct=P.getGraphDiv(Ct),_.clearPromiseQueue(Ct),P.isPlainObject(gt)||(gt={}),P.isPlainObject(St)||(St={}),Object.keys(gt).length&&(Ct.changed=!0),Object.keys(St).length&&(Ct.changed=!0);var ee=_.coerceTraceIndices(Ct,Nt),le=wt(Ct,P.extendFlat({},gt),ee),we=le.flags,Ue=he(Ct,P.extendFlat({},St)),qe=Ue.flags;(we.calc||qe.calc)&&(Ct.calcdata=void 0),we.clearAxisTypes&&_.clearAxisTypes(Ct,ee,St);var ar=[];qe.layoutReplot?ar.push(C.layoutReplot):we.fullReplot?ar.push(Q._doPlot):(ar.push(n.previousPromises),Pt(Ct,qe,Ue)||n.supplyDefaults(Ct),we.style&&ar.push(C.doTraceStyle),(we.colorbars||qe.colorbars)&&ar.push(C.doColorBars),qe.legend&&ar.push(C.doLegend),qe.layoutstyle&&ar.push(C.layoutStyles),qe.axrange&&Wt(ar,Ue.rangesAltered),qe.ticks&&ar.push(C.doTicksRelayout),qe.modebar&&ar.push(C.doModeBar),qe.camera&&ar.push(C.doCamera),ar.push(k)),ar.push(n.rehover,n.redrag,n.reselect),e.add(Ct,se,[Ct,le.undoit,Ue.undoit,le.traces],se,[Ct,le.redoit,Ue.redoit,le.traces]);var Ar=P.syncOrAsync(ar,Ct);return(!Ar||!Ar.then)&&(Ar=Promise.resolve(Ct)),Ar.then(function(){return Ct.emit("plotly_update",{data:le.eventData,layout:Ue.eventData}),Ct})}function Tt(Ct){return function(gt){gt._fullLayout._guiEditing=!0;var St=Ct.apply(null,arguments);return gt._fullLayout._guiEditing=!1,St}}var Lt=[{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"}],Mt=[{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 te(Ct,gt){for(var St=0;St<gt.length;St++){var Nt=gt[St],ee=Ct.match(Nt.pattern);if(ee){var le=ee[1]||"";return{head:le,tail:Ct.substr(le.length+1),attr:Nt.attr}}}}function ve(Ct,gt){var St=S(gt,Ct).get();if(St!==void 0)return St;var Nt=Ct.split(".");for(Nt.pop();Nt.length>1;)if(Nt.pop(),St=S(gt,Nt.join(".")+".uirevision").get(),St!==void 0)return St;return gt.uirevision}function oe(Ct,gt){for(var St=0;St<gt.length;St++)if(gt[St]._fullInput.uid===Ct)return St;return-1}function Te(Ct,gt,St){for(var Nt=0;Nt<gt.length;Nt++)if(gt[Nt].uid===Ct)return Nt;return!gt[St]||gt[St].uid?-1:St}function He(Ct,gt){var St=P.isPlainObject(Ct),Nt=Array.isArray(Ct);return St||Nt?(St&&P.isPlainObject(gt)||Nt&&Array.isArray(gt))&&JSON.stringify(Ct)===JSON.stringify(gt):Ct===gt}function Ge(Ct,gt,St,Nt){var ee=Nt._preGUI,le,we,Ue,qe,ar,Ar,Tr,pr,Jr,Vn,Hn=[],Kn={},Ci={};for(le in ee){if(ar=te(le,Lt),ar){if(Jr=ar.head,Vn=ar.tail,we=ar.attr||Jr+".uirevision",Ue=S(Nt,we).get(),qe=Ue&&ve(we,gt),qe&&qe===Ue){if(Ar=ee[le],Ar===null&&(Ar=void 0),Tr=S(gt,le),pr=Tr.get(),He(pr,Ar)){pr===void 0&&Vn==="autorange"&&Hn.push(Jr),Tr.set(it(S(Nt,le).get()));continue}else if(Vn==="autorange"||Vn.substr(0,6)==="range["){var ii=ee[Jr+".range[0]"],qn=ee[Jr+".range[1]"],oa=ee[Jr+".autorange"];if(oa||oa===null&&ii===null&&qn===null){if(!(Jr in Kn)){var Hi=S(gt,Jr).get();Kn[Jr]=Hi&&(Hi.autorange||Hi.autorange!==!1&&(!Hi.range||Hi.range.length!==2))}if(Kn[Jr]){Tr.set(it(S(Nt,le).get()));continue}}}}}else P.warn("unrecognized GUI edit: "+le);delete ee[le],ar&&ar.tail.substr(0,6)==="range["&&(Ci[ar.head]=1)}for(var We=0;We<Hn.length;We++){var rr=Hn[We];if(Ci[rr]){var fr=S(gt,rr).get();fr&&delete fr.autorange}}var xr=Nt._tracePreGUI;for(var Qr in xr){var Cn=xr[Qr],wn=null,Mn;for(le in Cn){if(!wn){var ci=oe(Qr,St);if(ci<0){delete xr[Qr];break}var xi=St[ci];Mn=xi._fullInput;var Pi=Te(Qr,Ct,Mn.index);if(Pi<0){delete xr[Qr];break}wn=Ct[Pi]}if(ar=te(le,Mt),ar){if(ar.attr?(Ue=S(Nt,ar.attr).get(),qe=Ue&&ve(ar.attr,gt)):(Ue=Mn.uirevision,qe=wn.uirevision,qe===void 0&&(qe=gt.uirevision)),qe&&qe===Ue&&(Ar=Cn[le],Ar===null&&(Ar=void 0),Tr=S(wn,le),pr=Tr.get(),He(pr,Ar))){Tr.set(it(S(Mn,le).get()));continue}}else P.warn("unrecognized GUI edit: "+le+" in trace uid "+Qr);delete Cn[le]}}}function cr(Ct,gt,St,Nt){var ee,le;function we(){return Q.addFrames(Ct,ee)}Ct=P.getGraphDiv(Ct),_.clearPromiseQueue(Ct);var Ue=Ct._fullData,qe=Ct._fullLayout;if(!P.isPlotDiv(Ct)||!Ue||!qe)le=Q.newPlot(Ct,gt,St,Nt);else{if(P.isPlainObject(gt)){var ar=gt;gt=ar.data,St=ar.layout,Nt=ar.config,ee=ar.frames}var Ar=!1;if(Nt){let Mn=P.extendDeepAll({},Ct._context);Ct._context=void 0,N(Ct,Nt),Ar=!_.collectionsAreEqual(Mn,Ct._context)}if(Ar){let Mn=Ct._ev.eventNames().map(ci=>[ci,Ct._ev.listeners(ci)]);le=Q.newPlot(Ct,gt,St,Nt).then(()=>{for(let[ci,xi]of Mn)xi.forEach(Pi=>Ct.on(ci,Pi));return Q.react(Ct,gt,St,Nt)})}else{Ct.data=gt||[],_.cleanData(Ct.data),Ct.layout=St||{},_.cleanLayout(Ct.layout),Ge(Ct.data,Ct.layout,Ue,qe),n.supplyDefaults(Ct,{skipUpdateCalc:!0});var Tr=Ct._fullData,pr=Ct._fullLayout,Jr=pr.datarevision===void 0,Vn=pr.transition,Hn=jr(Ct,qe,pr,Jr,Vn),Kn=Hn.newDataRevision,Ci=ur(Ct,Ue,Tr,Jr,Vn,Kn);if(de(Ct)&&(Hn.layoutReplot=!0),Ci.calc||Hn.calc){Ct.calcdata=void 0;for(var ii=Object.getOwnPropertyNames(pr),qn=0;qn<ii.length;qn++){var oa=ii[qn],Hi=oa.substring(0,5);if(Hi==="xaxis"||Hi==="yaxis"){var We=pr[oa]._emptyCategories;We&&We()}}}else n.supplyDefaultsUpdateCalc(Ct.calcdata,Tr);var rr=[];if(ee&&(Ct._transitionData={},n.createTransitionData(Ct),rr.push(we)),pr.transition&&(Ci.anim||Hn.anim))Hn.ticks&&rr.push(C.doTicksRelayout),n.doCalcdata(Ct),C.doAutoRangeAndConstraints(Ct),rr.push(function(){return n.transitionFromReact(Ct,Ci,Hn,qe)});else if(Ci.fullReplot||Hn.layoutReplot)Ct._fullLayout._skipDefaults=!0,rr.push(Q._doPlot);else{for(var fr in Hn.arrays){var xr=Hn.arrays[fr];if(xr.length){var Qr=r.getComponentMethod(fr,"drawOne");if(Qr!==P.noop)for(var Cn=0;Cn<xr.length;Cn++)Qr(Ct,xr[Cn]);else{var wn=r.getComponentMethod(fr,"draw");if(wn===P.noop)throw new Error("cannot draw components: "+fr);wn(Ct)}}}rr.push(n.previousPromises),Ci.style&&rr.push(C.doTraceStyle),(Ci.colorbars||Hn.colorbars)&&rr.push(C.doColorBars),Hn.legend&&rr.push(C.doLegend),Hn.layoutstyle&&rr.push(C.layoutStyles),Hn.axrange&&Wt(rr),Hn.ticks&&rr.push(C.doTicksRelayout),Hn.modebar&&rr.push(C.doModeBar),Hn.camera&&rr.push(C.doCamera),rr.push(k)}rr.push(n.rehover,n.redrag,n.reselect),le=P.syncOrAsync(rr,Ct),(!le||!le.then)&&(le=Promise.resolve(Ct))}}return le.then(()=>(Ar||Ct.emit("plotly_react",{config:Nt,data:gt,layout:St}),Ct))}function ur(Ct,gt,St,Nt,ee,le){var we=gt.length===St.length;if(!ee&&!we)return{fullReplot:!0,calc:!0};var Ue=M.traceFlags();Ue.arrays={},Ue.nChanges=0,Ue.nChangesAnim=0;var qe,ar;function Ar(Jr){var Vn=a.getTraceValObject(ar,Jr);return!ar._module.animatable&&Vn.anim&&(Vn.anim=!1),Vn}var Tr={getValObject:Ar,flags:Ue,immutable:Nt,transition:ee,newDataRevision:le,gd:Ct},pr={};for(qe=0;qe<gt.length;qe++)if(St[qe]){if(ar=St[qe]._fullInput,pr[ar.uid])continue;pr[ar.uid]=1,Hr(gt[qe]._fullInput,ar,[],Tr)}return(Ue.calc||Ue.plot)&&(Ue.fullReplot=!0),ee&&Ue.nChanges&&Ue.nChangesAnim&&(Ue.anim=Ue.nChanges===Ue.nChangesAnim&&we?"all":"some"),Ue}function jr(Ct,gt,St,Nt,ee){var le=M.layoutFlags();le.arrays={},le.rangesAltered={},le.nChanges=0,le.nChangesAnim=0;function we(pr){return a.getLayoutValObject(St,pr)}for(var Ue in St)if(!(!Ue.startsWith("xaxis")&&!Ue.startsWith("yaxis"))&&gt[Ue]){var qe=St[Ue].domain,ar=gt[Ue].domain,Ar=gt[Ue]._inputDomain;gt[Ue]._inputDomain&&(qe[0]===Ar[0]&&qe[1]===Ar[1]?St[Ue].domain=gt[Ue].domain:(qe[0]!==ar[0]||qe[1]!==ar[1])&&(St[Ue]._inputDomain=null))}var Tr={getValObject:we,flags:le,immutable:Nt,transition:ee,gd:Ct};return Hr(gt,St,[],Tr),(le.plot||le.calc)&&(le.layoutReplot=!0),ee&&le.nChanges&&le.nChangesAnim&&(le.anim=le.nChanges===le.nChangesAnim?"all":"some"),le}function Hr(Ct,gt,St,Nt){var ee,le,we,Ue=Nt.getValObject,qe=Nt.flags,ar=Nt.immutable,Ar=Nt.inArray,Tr=Nt.arrayIndex;function pr(){var ci=ee.editType;if(Ar&&ci.indexOf("arraydraw")!==-1){P.pushUnique(qe.arrays[Ar],Tr);return}M.update(qe,ee),ci!=="none"&&qe.nChanges++,Nt.transition&&ee.anim&&qe.nChangesAnim++,(Ht.test(we)||Jt.test(we))&&(qe.rangesAltered[St[0]]=1),le==="datarevision"&&(qe.newDataRevision=1)}function Jr(ci){return ci.valType==="data_array"||ci.arrayOk}for(le in Ct){if(qe.calc&&!Nt.transition)return;var Vn=Ct[le],Hn=gt[le],Kn=St.concat(le);if(we=Kn.join("."),!(le.charAt(0)==="_"||typeof Vn=="function"||Vn===Hn)){if((le==="tick0"||le==="dtick")&&St[0]!=="geo"){var Ci=gt.tickmode;if(Ci==="auto"||Ci==="array"||!Ci)continue}if(!(le==="range"&&gt.autorange)&&!((le==="zmin"||le==="zmax")&&gt.type==="contourcarpet")&&(ee=Ue(Kn),!!ee&&!(ee._compareAsJSON&&JSON.stringify(Vn)===JSON.stringify(Hn)))){var ii=ee.valType,qn,oa=Jr(ee),Hi=Array.isArray(Vn),We=Array.isArray(Hn);if(Hi&&We){var rr="_input_"+le,fr=Ct[rr],xr=gt[rr];if(Array.isArray(fr)&&fr===xr)continue}if(Hn===void 0)oa&&Hi?qe.calc=!0:pr();else if(ee._isLinkedToArray){var Qr=[],Cn=!1;Ar||(qe.arrays[le]=Qr);var wn=Math.min(Vn.length,Hn.length),Mn=Math.max(Vn.length,Hn.length);if(wn!==Mn)if(ee.editType==="arraydraw")Cn=!0;else{pr();continue}for(qn=0;qn<wn;qn++)Hr(Vn[qn],Hn[qn],Kn.concat(qn),P.extendFlat({inArray:le,arrayIndex:qn},Nt));if(Cn)for(qn=wn;qn<Mn;qn++)Qr.push(qn)}else!ii&&P.isPlainObject(Vn)?Hr(Vn,Hn,Kn,Nt):oa?Hi&&We?(ar&&(qe.calc=!0),(ar||Nt.newDataRevision)&&pr()):Hi!==We?qe.calc=!0:pr():Hi&&We?(Vn.length!==Hn.length||String(Vn)!==String(Hn))&&pr():pr()}}}for(le in gt)if(!(le in Ct||le.charAt(0)==="_"||typeof gt[le]=="function"))if(ee=Ue(St.concat(le)),Jr(ee)&&Array.isArray(gt[le])){qe.calc=!0;return}else pr()}function br(Ct,gt,St){if(Ct=P.getGraphDiv(Ct),!P.isPlotDiv(Ct))throw new Error("This element is not a Plotly plot: "+Ct+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var Nt=Ct._transitionData;Nt._frameQueue||(Nt._frameQueue=[]),St=n.supplyAnimationDefaults(St);var ee=St.transition,le=St.frame;Nt._frameWaitingCnt===void 0&&(Nt._frameWaitingCnt=0);function we(ar){return Array.isArray(ee)?ar>=ee.length?ee[0]:ee[ar]:ee}function Ue(ar){return Array.isArray(le)?ar>=le.length?le[0]:le[ar]:le}function qe(ar,Ar){var Tr=0;return function(){if(ar&&++Tr===Ar)return ar()}}return new Promise(function(ar,Ar){function Tr(){if(Nt._frameQueue.length!==0){for(;Nt._frameQueue.length;){var wn=Nt._frameQueue.pop();wn.onInterrupt&&wn.onInterrupt()}Ct.emit("plotly_animationinterrupted",[])}}function pr(wn){if(wn.length!==0){for(var Mn=0;Mn<wn.length;Mn++){var ci;wn[Mn].type==="byname"?ci=n.computeFrame(Ct,wn[Mn].name):ci=wn[Mn].data;var xi=Ue(Mn),Pi=we(Mn);Pi.duration=Math.min(Pi.duration,xi.duration);var Di={frame:ci,name:wn[Mn].name,frameOpts:xi,transitionOpts:Pi};Mn===wn.length-1&&(Di.onComplete=qe(ar,2),Di.onInterrupt=Ar),Nt._frameQueue.push(Di)}St.mode==="immediate"&&(Nt._lastFrameAt=-1/0),Nt._animationRaf||Hn()}}function Jr(){Ct.emit("plotly_animated"),window.cancelAnimationFrame(Nt._animationRaf),Nt._animationRaf=null}function Vn(){Nt._currentFrame&&Nt._currentFrame.onComplete&&Nt._currentFrame.onComplete();var wn=Nt._currentFrame=Nt._frameQueue.shift();if(wn){var Mn=wn.name?wn.name.toString():null;Ct._fullLayout._currentFrame=Mn,Nt._lastFrameAt=Date.now(),Nt._timeToNext=wn.frameOpts.duration,n.transition(Ct,wn.frame.data,wn.frame.layout,_.coerceTraceIndices(Ct,wn.frame.traces),wn.frameOpts,wn.transitionOpts).then(function(){wn.onComplete&&wn.onComplete()}),Ct.emit("plotly_animatingframe",{name:Mn,frame:wn.frame,animation:{frame:wn.frameOpts,transition:wn.transitionOpts}})}else Jr()}function Hn(){Ct.emit("plotly_animating"),Nt._lastFrameAt=-1/0,Nt._timeToNext=0,Nt._runningTransitions=0,Nt._currentFrame=null;var wn=function(){Nt._animationRaf=window.requestAnimationFrame(wn),Date.now()-Nt._lastFrameAt>Nt._timeToNext&&Vn()};wn()}var Kn=0;function Ci(wn){return Array.isArray(ee)?Kn>=ee.length?wn.transitionOpts=ee[Kn]:wn.transitionOpts=ee[0]:wn.transitionOpts=ee,Kn++,wn}var ii,qn,oa=[],Hi=gt==null,We=Array.isArray(gt),rr=!Hi&&!We&&P.isPlainObject(gt);if(rr)oa.push({type:"object",data:Ci(P.extendFlat({},gt))});else if(Hi||["string","number"].indexOf(typeof gt)!==-1)for(ii=0;ii<Nt._frames.length;ii++)qn=Nt._frames[ii],qn&&(Hi||String(qn.group)===String(gt))&&oa.push({type:"byname",name:String(qn.name),data:Ci({name:qn.name})});else if(We)for(ii=0;ii<gt.length;ii++){var fr=gt[ii];["number","string"].indexOf(typeof fr)!==-1?(fr=String(fr),oa.push({type:"byname",name:fr,data:Ci({name:fr})})):P.isPlainObject(fr)&&oa.push({type:"object",data:Ci(P.extendFlat({},fr))})}for(ii=0;ii<oa.length;ii++)if(qn=oa[ii],qn.type==="byname"&&!Nt._frameHash[qn.data.name]){P.warn('animate failure: frame not found: "'+qn.data.name+'"'),Ar();return}["next","immediate"].indexOf(St.mode)!==-1&&Tr(),St.direction==="reverse"&&oa.reverse();var xr=Ct._fullLayout._currentFrame;if(xr&&St.fromcurrent){var Qr=-1;for(ii=0;ii<oa.length;ii++)if(qn=oa[ii],qn.type==="byname"&&qn.name===xr){Qr=ii;break}if(Qr>0&&Qr<oa.length-1){var Cn=[];for(ii=0;ii<oa.length;ii++)qn=oa[ii],(oa[ii].type!=="byname"||ii>Qr)&&Cn.push(qn);oa=Cn}}oa.length>0?pr(oa):(Ct.emit("plotly_animated"),ar())})}function Kr(Ct,gt,St){if(Ct=P.getGraphDiv(Ct),gt==null)return Promise.resolve();if(!P.isPlotDiv(Ct))throw new Error("This element is not a Plotly plot: "+Ct+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Nt,ee,le,we,Ue=Ct._transitionData._frames,qe=Ct._transitionData._frameHash;if(!Array.isArray(gt))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+gt);var ar=Ue.length+gt.length*2,Ar=[],Tr={};for(Nt=gt.length-1;Nt>=0;Nt--)if(P.isPlainObject(gt[Nt])){var pr=gt[Nt].name,Jr=(qe[pr]||Tr[pr]||{}).name,Vn=gt[Nt].name,Hn=qe[Jr]||Tr[Jr];Jr&&Vn&&typeof Vn=="number"&&Hn&&A<h&&(A++,P.warn('addFrames: overwriting frame "'+(qe[Jr]||Tr[Jr]).name+'" with a frame whose name of type "number" also equates to "'+Jr+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),A===h&&P.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.")),Tr[pr]={name:pr},Ar.push({frame:n.supplyFrameDefaults(gt[Nt]),index:St&&St[Nt]!==void 0&&St[Nt]!==null?St[Nt]:ar+Nt})}Ar.sort(function(rr,fr){return rr.index>fr.index?-1:rr.index<fr.index?1:0});var Kn=[],Ci=[],ii=Ue.length;for(Nt=Ar.length-1;Nt>=0;Nt--){if(ee=Ar[Nt].frame,typeof ee.name=="number"&&P.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!ee.name)for(;qe[ee.name="frame "+Ct._transitionData._counter++];);if(qe[ee.name]){for(le=0;le<Ue.length&&(Ue[le]||{}).name!==ee.name;le++);Kn.push({type:"replace",index:le,value:ee}),Ci.unshift({type:"replace",index:le,value:Ue[le]})}else we=Math.max(0,Math.min(Ar[Nt].index,ii)),Kn.push({type:"insert",index:we,value:ee}),Ci.unshift({type:"delete",index:we}),ii++}var qn=n.modifyFrames,oa=n.modifyFrames,Hi=[Ct,Ci],We=[Ct,Kn];return e&&e.add(Ct,qn,Hi,oa,We),n.modifyFrames(Ct,Kn)}function rn(Ct,gt){if(Ct=P.getGraphDiv(Ct),!P.isPlotDiv(Ct))throw new Error("This element is not a Plotly plot: "+Ct);var St,Nt,ee=Ct._transitionData._frames,le=[],we=[];if(!gt)for(gt=[],St=0;St<ee.length;St++)gt.push(St);for(gt=gt.slice(),gt.sort(),St=gt.length-1;St>=0;St--)Nt=gt[St],le.push({type:"delete",index:Nt}),we.unshift({type:"insert",index:Nt,value:ee[Nt]});var Ue=n.modifyFrames,qe=n.modifyFrames,ar=[Ct,we],Ar=[Ct,le];return e&&e.add(Ct,Ue,ar,qe,Ar),n.modifyFrames(Ct,le)}function Ce(Ct){Ct=P.getGraphDiv(Ct);var gt=Ct._fullLayout||{},St=Ct._fullData||[];return n.cleanPlot([],{},St,gt),n.purge(Ct),t.purge(Ct),gt._container&&gt._container.remove(),delete Ct._context,Ct}function $t(Ct){var gt=Ct._fullLayout,St=Ct.getBoundingClientRect();if(!P.equalDomRects(St,gt._lastBBox)){var Nt=gt._invTransform=P.inverseTransformMatrix(P.getFullTransformMatrix(Ct));gt._invScaleX=Math.sqrt(Nt[0][0]*Nt[0][0]+Nt[0][1]*Nt[0][1]+Nt[0][2]*Nt[0][2]),gt._invScaleY=Math.sqrt(Nt[1][0]*Nt[1][0]+Nt[1][1]*Nt[1][1]+Nt[1][2]*Nt[1][2]),gt._lastBBox=St}}function ne(Ct){var gt=$.select(Ct),St=Ct._fullLayout;if(St._calcInverseTransform=$t,St._calcInverseTransform(Ct),St._container=gt.selectAll(".plot-container").data([0]),St._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),St._paperdiv=St._container.selectAll(".svg-container").data([0]),St._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),St._glcontainer=St._paperdiv.selectAll(".gl-container").data([{}]),St._glcontainer.enter().append("div").classed("gl-container",!0),St._paperdiv.selectAll(".main-svg").remove(),St._paperdiv.select(".modebar-container").remove(),St._paper=St._paperdiv.insert("svg",":first-child").classed("main-svg",!0),St._toppaper=St._paperdiv.append("svg").classed("main-svg",!0),St._modebardiv=St._paperdiv.append("div"),delete St._modeBar,St._hoverpaper=St._paperdiv.append("svg").classed("main-svg",!0),!St._uid){var Nt={};$.selectAll("defs").each(function(){this.id&&(Nt[this.id.split("-")[1]]=1)}),St._uid=P.randstr(Nt)}St._paperdiv.selectAll(".main-svg").attr(v.svgAttrs),St._defs=St._paper.append("defs").attr("id","defs-"+St._uid),St._clips=St._defs.append("g").classed("clips",!0),St._topdefs=St._toppaper.append("defs").attr("id","topdefs-"+St._uid),St._topclips=St._topdefs.append("g").classed("clips",!0),St._bgLayer=St._paper.append("g").classed("bglayer",!0),St._draggers=St._paper.append("g").classed("draglayer",!0);var ee=St._paper.append("g").classed("layer-below",!0);St._imageLowerLayer=ee.append("g").classed("imagelayer",!0),St._shapeLowerLayer=ee.append("g").classed("shapelayer",!0),St._cartesianlayer=St._paper.append("g").classed("cartesianlayer",!0),St._polarlayer=St._paper.append("g").classed("polarlayer",!0),St._smithlayer=St._paper.append("g").classed("smithlayer",!0),St._ternarylayer=St._paper.append("g").classed("ternarylayer",!0),St._geolayer=St._paper.append("g").classed("geolayer",!0),St._funnelarealayer=St._paper.append("g").classed("funnelarealayer",!0),St._pielayer=St._paper.append("g").classed("pielayer",!0),St._iciclelayer=St._paper.append("g").classed("iciclelayer",!0),St._treemaplayer=St._paper.append("g").classed("treemaplayer",!0),St._sunburstlayer=St._paper.append("g").classed("sunburstlayer",!0),St._indicatorlayer=St._toppaper.append("g").classed("indicatorlayer",!0),St._glimages=St._paper.append("g").classed("glimages",!0);var le=St._toppaper.append("g").classed("layer-above",!0);St._imageUpperLayer=le.append("g").classed("imagelayer",!0),St._shapeUpperLayer=le.append("g").classed("shapelayer",!0),St._selectionLayer=St._toppaper.append("g").classed("selectionlayer",!0),St._infolayer=St._toppaper.append("g").classed("infolayer",!0),St._menulayer=St._toppaper.append("g").classed("menulayer",!0),St._zoomlayer=St._toppaper.append("g").classed("zoomlayer",!0),St._hoverlayer=St._hoverpaper.append("g").classed("hoverlayer",!0),St._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),Ct.emit("plotly_framework")}Q.animate=br,Q.addFrames=Kr,Q.deleteFrames=rn,Q.addTraces=dt,Q.deleteTraces=rt,Q.extendTraces=st,Q.moveTraces=at,Q.prependTraces=tt,Q.newPlot=H,Q._doPlot=p,Q.purge=Ce,Q.react=cr,Q.redraw=V,Q.relayout=zt,Q.restyle=vt,Q.setPlotConfig=w,Q.update=se,Q._guiRelayout=Tt(zt),Q._guiRestyle=Tt(vt),Q._guiUpdate=Tt(se),Q._storeDirectGUIEdit=ut}),o0=Ft(Q=>{var $=Xo();Q.getDelay=function(P){return P._has&&(P._has("gl3d")||P._has("mapbox")||P._has("map"))?500:0},Q.getRedrawFunc=function(P){return function(){$.getComponentMethod("colorbar","draw")(P)}},Q.encodeSVG=function(P){return"data:image/svg+xml,"+encodeURIComponent(P)},Q.encodeJSON=function(P){return"data:application/json,"+encodeURIComponent(P)};var c=window.URL||window.webkitURL;Q.createObjectURL=function(P){return c.createObjectURL(P)},Q.revokeObjectURL=function(P){return c.revokeObjectURL(P)},Q.createBlob=function(P,S){if(S==="svg")return new window.Blob([P],{type:"image/svg+xml;charset=utf-8"});if(S==="full-json")return new window.Blob([P],{type:"application/json;charset=utf-8"});var t=g(window.atob(P));return new window.Blob([t],{type:"image/"+S})},Q.octetStream=function(P){document.location.href="data:application/octet-stream"+P};function g(P){for(var S=P.length,t=new ArrayBuffer(S),e=new Uint8Array(t),r=0;r<S;r++)e[r]=P.charCodeAt(r);return t}Q.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/}),$y=Ft((Q,$)=>{var c=un();bn();var g=js(),P=li();Op();var S=/"/g,t="TOBESTRIPPED",e=new RegExp('("'+t+")|("+t+'")',"g");function r(n){var o=c.select("body").append("div").style({display:"none"}).html(""),i=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(),i}function a(n){return n.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")}$.exports=function(n,o,i){var s=n._fullLayout,f=s._paper,x=s._toppaper,y=s.width,v=s.height,T;f.insert("rect",":first-child").call(g.setRect,0,0,y,v).call(P.fill,s.paper_bgcolor);var u=s._basePlotModules||[];for(T=0;T<u.length;T++){var b=u[T];b.toSVG&&b.toSVG(n)}if(x){var _=x.node().childNodes,C=Array.prototype.slice.call(_);for(T=0;T<C.length;T++){var M=C[T];M.childNodes.length&&f.node().appendChild(M)}}s._draggers&&s._draggers.remove(),f.node().style.background="",f.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var A=c.select(this);if(this.style.visibility==="hidden"||this.style.display==="none"){A.remove();return}else A.style({visibility:null,display:null});var h=this.style.fontFamily;h&&h.indexOf('"')!==-1&&A.style("font-family",h.replace(S,t));var p=this.style.fontWeight;p&&(p==="normal"||p==="400")&&A.style("font-weight",void 0);var k=this.style.fontStyle;k&&k==="normal"&&A.style("font-style",void 0);var w=this.style.fontVariant;w&&w==="normal"&&A.style("font-variant",void 0)}),f.selectAll(".gradient_filled,.pattern_filled").each(function(){var A=c.select(this),h=this.style.fill;h&&h.indexOf("url(")!==-1&&A.style("fill",h.replace(S,t));var p=this.style.stroke;p&&p.indexOf("url(")!==-1&&A.style("stroke",p.replace(S,t))}),(o==="pdf"||o==="eps")&&f.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),o==="svg"&&i&&(f.attr("width",i*y),f.attr("height",i*v),f.attr("viewBox","0 0 "+y+" "+v));var E=new window.XMLSerializer().serializeToString(f.node());return E=r(E),E=a(E),E=E.replace(e,"'"),E}}),Gy=Ft((Q,$)=>{var c=bn(),g=Im().EventEmitter,P=o0();function S(t){var e=t.emitter||new g,r=new Promise(function(a,n){var o=window.Image,i=t.svg,s=t.format||"png",f=t.canvas,x=t.scale||1,y=t.width||300,v=t.height||150,T=x*y,u=x*v,b=f.getContext("2d",{willReadFrequently:!0}),_=new o,C,M;s==="svg"||c.isSafari()?M=P.encodeSVG(i):(C=P.createBlob(i,"svg"),M=P.createObjectURL(C)),f.width=T,f.height=u,_.onload=function(){var E;switch(C=null,P.revokeObjectURL(M),s!=="svg"&&b.drawImage(_,0,0,T,u),s){case"jpeg":E=f.toDataURL("image/jpeg");break;case"png":E=f.toDataURL("image/png");break;case"webp":E=f.toDataURL("image/webp");break;case"svg":E=M;break;default:var A="Image format is not jpeg, png, svg or webp.";if(n(new Error(A)),!t.promise)return e.emit("error",A)}a(E),t.promise||e.emit("success",E)},_.onerror=function(E){if(C=null,P.revokeObjectURL(M),n(E),!t.promise)return e.emit("error",E)},_.src=M});return t.promise?r:e}$.exports=S}),Sw=Ft((Q,$)=>{var c=ra(),g=W_(),P=Kc(),S=bn(),t=o0(),e=$y(),r=Gy(),a=Qi().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(i,s){s=s||{};var f,x,y,v;S.isPlainObject(i)?(f=i.data||[],x=i.layout||{},y=i.config||{},v={}):(i=S.getGraphDiv(i),f=S.extendDeep([],i.data),x=S.extendDeep({},i.layout),y=i._context,v=i._fullLayout||{});function T(H){return!(H in s)||S.validate(s[H],n[H])}if(!T("width")&&s.width!==null||!T("height")&&s.height!==null)throw new Error("Height and width should be pixel values.");if(!T("format"))throw new Error("Export format is not "+S.join2(n.format.values,", "," or ")+".");var u={};function b(H,F){return S.coerce(s,u,n,H,F)}var _=b("format"),C=b("width"),M=b("height"),E=b("scale"),A=b("setBackground"),h=b("imageDataOnly"),p=document.createElement("div");p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var k=S.extendFlat({},x);C?k.width=C:s.width===null&&c(v.width)&&(k.width=v.width),M?k.height=M:s.height===null&&c(v.height)&&(k.height=v.height);var w=S.extendFlat({},y,{_exportedPlot:!0,staticPlot:!0,setBackground:A}),R=t.getRedrawFunc(p);function O(){return new Promise(function(H){setTimeout(H,t.getDelay(p._fullLayout))})}function N(){return new Promise(function(H,F){var U=e(p,_,E),W=p._fullLayout.width,q=p._fullLayout.height;function X(){g.purge(p),document.body.removeChild(p)}if(_==="full-json"){var lt=P.graphJson(p,!1,"keepdata","object",!0,!0);return lt.version=a,lt=JSON.stringify(lt),X(),H(h?lt:t.encodeJSON(lt))}if(X(),_==="svg")return H(h?U:t.encodeSVG(U));var yt=document.createElement("canvas");yt.id=S.randstr(),r({format:_,width:W,height:q,scale:E,canvas:yt,svg:U,promise:!0}).then(H).catch(F)})}function V(H){return h?H.replace(t.IMAGE_URL_PREFIX,""):H}return new Promise(function(H,F){g.newPlot(p,f,k,w).then(R).then(O).then(N).then(function(U){H(V(U))}).catch(function(U){F(U)})})}$.exports=o}),ym=Ft((Q,$)=>{var c=bn(),g=Kc(),P=Dm(),S=ms().dfltConfig,t=c.isPlainObject,e=Array.isArray,r=c.isArrayOrTypedArray;$.exports=function(u,b){u===void 0&&(u=[]),b===void 0&&(b={});var _=P.get(),C=[],M={_context:c.extendFlat({},S)},E,A;e(u)?(M.data=c.extendDeep([],u),E=u):(M.data=[],E=[],C.push(s("array","data"))),t(b)?(M.layout=c.extendDeep({},b),A=b):(M.layout={},A={},arguments.length>1&&C.push(s("object","layout"))),g.supplyDefaults(M);for(var h=M._fullData,p=E.length,k=0;k<p;k++){var w=E[k],R=["data",k];if(!t(w)){C.push(s("object",R));continue}var O=h[k],N=O.type,V=_.traces[N].attributes;V.type={valType:"enumerated",values:[N]},O.visible===!1&&w.visible!==!1&&C.push(s("invisible",R)),a(w,O,V,C,R)}var H=M._fullLayout,F=n(_,h);return a(A,H,F,C,"layout"),C.length===0?void 0:C};function a(u,b,_,C,M,E){E=E||[];for(var A=Object.keys(u),h=0;h<A.length;h++){var p=A[h],k=E.slice();k.push(p);var w=u[p],R=b[p],O=x(_,p),N=(O||{}).valType,V=N==="info_array",H=N==="colorscale",F=(O||{}).items;if(!f(_,p))C.push(s("schema",M,k));else if(t(w)&&t(R)&&N!=="any")a(w,R,O,C,M,k);else if(V&&e(w)){w.length>R.length&&C.push(s("unused",M,k.concat(R.length)));var U=R.length,W=Array.isArray(F);W&&(U=Math.min(U,F.length));var q,X,lt,yt,pt;if(O.dimensions===2)for(X=0;X<U;X++)if(e(w[X])){w[X].length>R[X].length&&C.push(s("unused",M,k.concat(X,R[X].length)));var st=R[X].length;for(q=0;q<(W?Math.min(st,F[X].length):st);q++)lt=W?F[X][q]:F,yt=w[X][q],pt=R[X][q],c.validate(yt,lt)?pt!==yt&&pt!==+yt&&C.push(s("dynamic",M,k.concat(X,q),yt,pt)):C.push(s("value",M,k.concat(X,q),yt))}else C.push(s("array",M,k.concat(X),w[X]));else for(X=0;X<U;X++)lt=W?F[X]:F,yt=w[X],pt=R[X],c.validate(yt,lt)?pt!==yt&&pt!==+yt&&C.push(s("dynamic",M,k.concat(X),yt,pt)):C.push(s("value",M,k.concat(X),yt))}else if(O.items&&!V&&e(w)){var tt=F[Object.keys(F)[0]],dt=[],rt,at;for(rt=0;rt<R.length;rt++){var vt=R[rt]._index||rt;if(at=k.slice(),at.push(vt),t(w[vt])&&t(R[rt])){dt.push(vt);var it=w[vt],Y=R[rt];t(it)&&it.visible!==!1&&Y.visible===!1?C.push(s("invisible",M,at)):a(it,Y,tt,C,M,at)}}for(rt=0;rt<w.length;rt++)at=k.slice(),at.push(rt),t(w[rt])?dt.indexOf(rt)===-1&&C.push(s("unused",M,at)):C.push(s("object",M,at,w[rt]))}else!t(w)&&t(R)?C.push(s("object",M,k,w)):!r(w)&&r(R)&&!V&&!H?C.push(s("array",M,k,w)):p in b?c.validate(w,O)?O.valType==="enumerated"&&(O.coerceNumber&&w!==+R||!r(w)&&w!==R||String(w)!==String(R))&&C.push(s("dynamic",M,k,w,R)):C.push(s("value",M,k,w)):C.push(s("unused",M,k,w))}return C}function n(u,b){for(var _=u.layout.layoutAttributes,C=0;C<b.length;C++){var M=b[C],E=u.traces[M.type],A=E.layoutAttributes;A&&(M.subplot?c.extendFlat(_[E.attributes.subplot.dflt],A):c.extendFlat(_,A))}return _}var o={object:function(u,b){var _;return u==="layout"&&b===""?_="The layout argument":u[0]==="data"&&b===""?_="Trace "+u[1]+" in the data argument":_=i(u)+"key "+b,_+" must be linked to an object container"},array:function(u,b){var _;return u==="data"?_="The data argument":_=i(u)+"key "+b,_+" must be linked to an array container"},schema:function(u,b){return i(u)+"key "+b+" is not part of the schema"},unused:function(u,b,_){var C=t(_)?"container":"key";return i(u)+C+" "+b+" did not get coerced"},dynamic:function(u,b,_,C){return[i(u)+"key",b,"(set to '"+_+"')","got reset to","'"+C+"'","during defaults."].join(" ")},invisible:function(u,b){return(b?i(u)+"item "+b:"Trace "+u[1])+" got defaulted to be not visible"},value:function(u,b,_){return[i(u)+"key "+b,"is set to an invalid value ("+_+")"].join(" ")}};function i(u){return e(u)?"In data trace "+u[1]+", ":"In "+u+", "}function s(u,b,_,C,M){_=_||"";var E,A;e(b)?(E=b[0],A=b[1]):(E=b,A=null);var h=T(_),p=o[u](b,h,C,M);return c.log(p),{code:u,container:E,trace:A,path:_,astr:h,msg:p}}function f(u,b){var _=v(b),C=_.keyMinusId,M=_.id;return C in u&&u[C]._isSubplotObj&&M?!0:b in u}function x(u,b){if(b in u)return u[b];var _=v(b);return u[_.keyMinusId]}var y=c.counterRegex("([a-z]+)");function v(u){var b=u.match(y);return{keyMinusId:b&&b[1],id:b&&b[2]}}function T(u){if(!e(u))return String(u);for(var b="",_=0;_<u.length;_++){var C=u[_];typeof C=="number"?b=b.substr(0,b.length-1)+"["+C+"]":b+=C,_<u.length-1&&(b+=".")}return b}}),Ew=Ft((Q,$)=>{var c=bn(),g=o0();function P(S,t,e){var r=document.createElement("a"),a="download"in r,n=new Promise(function(o,i){var s,f;if(a)return s=g.createBlob(S,e),f=g.createObjectURL(s),r.href=f,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),g.revokeObjectURL(f),s=null,o(t);if(c.isSafari()){var x=e==="svg"?",":";base64,";return g.octetStream(x+encodeURIComponent(S)),o(t)}i(new Error("download error"))});return n}$.exports=P}),q_=Ft((Q,$)=>{var c=bn(),g=Sw(),P=Ew();o0();function S(t,e){var r;return c.isPlainObject(t)||(r=c.getGraphDiv(t)),e=e||{},e.format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise(function(a,n){r&&r._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),r&&(r._snapshotInProgress=!0);var o=g(t,e),i=e.filename||t.fn||"newplot";i+="."+e.format.replace("-","."),o.then(function(s){return r&&(r._snapshotInProgress=!1),P(s,i,e.format)}).then(function(s){a(s)}).catch(function(s){r&&(r._snapshotInProgress=!1),n(s)})})}$.exports=S}),C1=Ft(Q=>{var $=bn(),c=$.isPlainObject,g=Dm(),P=Kc(),S=$o(),t=pu(),e=ms().dfltConfig;Q.makeTemplate=function(y){y=$.isPlainObject(y)?y:$.getGraphDiv(y),y=$.extendDeep({_context:e},{data:y.data,layout:y.layout}),P.supplyDefaults(y);var v=y.data||[],T=y.layout||{};T._basePlotModules=y._fullLayout._basePlotModules,T._modules=y._fullLayout._modules;var u={data:{},layout:{}};v.forEach(function(w){var R={};n(w,R,i.bind(null,w));var O=$.coerce(w,{},S,"type"),N=u.data[O];N||(N=u.data[O]=[]),N.push(R)}),n(T,u.layout,o.bind(null,T)),delete u.layout.template;var b=T.template;if(c(b)){var _=b.layout,C,M,E,A,h,p;c(_)&&r(_,u.layout);var k=b.data;if(c(k)){for(M in u.data)if(E=k[M],Array.isArray(E)){for(h=u.data[M],p=h.length,A=E.length,C=0;C<p;C++)r(E[C%A],h[C]);for(C=p;C<A;C++)h.push($.extendDeep({},E[C]))}for(M in k)M in u.data||(u.data[M]=$.extendDeep([],k[M]))}}return u};function r(y,v){y=$.extendDeep({},y);var T=Object.keys(y).sort(),u,b;function _(h,p,k){if(c(p)&&c(h))r(h,p);else if(Array.isArray(p)&&Array.isArray(h)){var w=t.arrayTemplater({_template:y},k);for(b=0;b<p.length;b++){var R=p[b],O=w.newItem(R)._template;O&&r(O,R)}var N=w.defaultItems();for(b=0;b<N.length;b++)p.push(N[b]._template);for(b=0;b<p.length;b++)delete p[b].templateitemname}}for(u=0;u<T.length;u++){var C=T[u],M=y[C];if(C in v?_(M,v[C],C):v[C]=M,a(C)===C)for(var E in v){var A=a(E);E!==A&&A===C&&!(E in y)&&_(M,v[E],C)}}}function a(y){return y.replace(/[0-9]+$/,"")}function n(y,v,T,u,b){var _=b&&T(b);for(var C in y){var M=y[C],E=s(y,C,u),A=s(y,C,b),h=T(A);if(!h){var p=a(C);p!==C&&(A=s(y,p,b),h=T(A))}if(!(_&&_===h)&&!(!h||h._noTemplating||h.valType==="data_array"||h.arrayOk&&Array.isArray(M)))if(!h.valType&&c(M))n(M,v,T,E,A);else if(h._isLinkedToArray&&Array.isArray(M))for(var k=!1,w=0,R={},O=0;O<M.length;O++){var N=M[O];if(c(N)){var V=N.name;if(V)R[V]||(n(N,v,T,s(M,w,E),s(M,w,A)),w++,R[V]=1);else if(!k){var H=t.arrayDefaultKey(C),F=s(y,H,u),U=s(M,w,E);n(N,v,T,U,s(M,w,A));var W=$.nestedProperty(v,U),q=$.nestedProperty(v,F);q.set(W.get()),W.set(null),k=!0}}}else{var X=$.nestedProperty(v,E);X.set(M)}}}function o(y,v){return g.getLayoutValObject(y,$.nestedProperty({},v).parts)}function i(y,v){return g.getTraceValObject(y,$.nestedProperty({},v).parts)}function s(y,v,T){var u;return T?Array.isArray(y)?u=T+"["+v+"]":u=T+"."+v:u=v,u}Q.validateTemplate=function(y,v){var T=$.extendDeep({},{_context:e,data:y.data,layout:y.layout}),u=T.layout||{};c(v)||(v=u.template||{});var b=v.layout,_=v.data,C=[];T.layout=u,T.layout.template=v,P.supplyDefaults(T);var M=T._fullLayout,E=T._fullData,A={};function h(F,U){for(var W in F)if(W.charAt(0)!=="_"&&c(F[W])){var q=a(W),X=[],lt;for(lt=0;lt<U.length;lt++)X.push(s(F,W,U[lt])),q!==W&&X.push(s(F,q,U[lt]));for(lt=0;lt<X.length;lt++)A[X[lt]]=1;h(F[W],X)}}function p(F,U){for(var W in F)if(W.indexOf("defaults")===-1&&c(F[W])){var q=s(F,W,U);A[q]?p(F[W],q):C.push({code:"unused",path:q})}}if(c(b)?(h(M,["layout"]),p(b,"layout")):C.push({code:"layout"}),!c(_))C.push({code:"data"});else{for(var k={},w,R=0;R<E.length;R++){var O=E[R];w=O.type,k[w]=(k[w]||0)+1,O._fullInput._template||C.push({code:"missing",index:O.index,traceType:w})}for(w in _){var N=_[w].length,V=k[w]||0;N>V?C.push({code:"unused",traceType:w,templateCount:N,dataCount:V}):V>N&&C.push({code:"reused",traceType:w,templateCount:N,dataCount:V})}}function H(F,U){for(var W in F)if(W.charAt(0)!=="_"){var q=F[W],X=s(F,W,U);c(q)?(Array.isArray(F)&&q._template===!1&&q.templateitemname&&C.push({code:"missing",path:X,templateitemname:q.templateitemname}),H(q,X)):Array.isArray(q)&&f(q)&&H(q,X)}}if(H({data:E,layout:M},""),C.length)return C.map(x)};function f(y){for(var v=0;v<y.length;v++)if(c(y[v]))return!0}function x(y){var v;switch(y.code){case"data":v="The template has no key data.";break;case"layout":v="The template has no key layout.";break;case"missing":y.path?v="There are no templates for item "+y.path+" with name "+y.templateitemname:v="There are no templates for trace "+y.index+", of type "+y.traceType+".";break;case"unused":y.path?v="The template item at "+y.path+" was not used in constructing the plot.":y.dataCount?v="Some of the templates of type "+y.traceType+" were not used. The template has "+y.templateCount+" traces, the data only has "+y.dataCount+" of this type.":v="The template has "+y.templateCount+" traces of type "+y.traceType+" but there are none in the data.";break;case"reused":v="Some of the templates of type "+y.traceType+" were used more than once. The template has "+y.templateCount+" traces, the data has "+y.dataCount+" of this type.";break}return y.msg=v,y}}),_6=Ft(Q=>{var $=W_();Q._doPlot=$._doPlot,Q.newPlot=$.newPlot,Q.restyle=$.restyle,Q.relayout=$.relayout,Q.redraw=$.redraw,Q.update=$.update,Q._guiRestyle=$._guiRestyle,Q._guiRelayout=$._guiRelayout,Q._guiUpdate=$._guiUpdate,Q._storeDirectGUIEdit=$._storeDirectGUIEdit,Q.react=$.react,Q.extendTraces=$.extendTraces,Q.prependTraces=$.prependTraces,Q.addTraces=$.addTraces,Q.deleteTraces=$.deleteTraces,Q.moveTraces=$.moveTraces,Q.purge=$.purge,Q.addFrames=$.addFrames,Q.deleteFrames=$.deleteFrames,Q.animate=$.animate,Q.setPlotConfig=$.setPlotConfig;var c=r0().getGraphDiv,g=R_().eraseActiveShape;Q.deleteActiveShape=function(S){return g(c(S))},Q.toImage=Sw(),Q.validate=ym(),Q.downloadImage=q_();var P=C1();Q.makeTemplate=P.makeTemplate,Q.validateTemplate=P.validateTemplate}),Nm=Ft((Q,$)=>{var c=bn(),g=Xo();$.exports=function(P,S,t,e){var r=e("x"),a=e("y"),n,o=g.getComponentMethod("calendars","handleTraceDefaults");if(o(P,S,["x","y"],t),r){var i=c.minRowLength(r);a?n=Math.min(i,c.minRowLength(a)):(n=i,e("y0"),e("dy"))}else{if(!a)return 0;n=c.minRowLength(a),e("x0"),e("dx")}return S._length=n,n}}),Fp=Ft((Q,$)=>{var c=bn().dateTick0,g=Da(),P=g.ONEWEEK;function S(t,e){return t%P===0?c(e,1):c(e,0)}$.exports=function(t,e,r,a,n){if(n||(n={x:!0,y:!0}),n.x){var o=a("xperiod");o&&(a("xperiod0",S(o,e.xcalendar)),a("xperiodalignment"))}if(n.y){var i=a("yperiod");i&&(a("yperiod0",S(i,e.ycalendar)),a("yperiodalignment"))}}}),Cw=Ft((Q,$)=>{var c=["orientation","groupnorm","stackgaps"];$.exports=function(g,P,S,t){var e=S._scatterStackOpts,r=t("stackgroup");if(r){var a=P.xaxis+P.yaxis,n=e[a];n||(n=e[a]={});var o=n[r],i=!1;o?o.traces.push(P):(o=n[r]={traceIndices:[],traces:[P]},i=!0);for(var s={orientation:P.x&&!P.y?"h":"v"},f=0;f<c.length;f++){var x=c[f],y=x+"Found";if(!o[y]){var v=g[x]!==void 0,T=x==="orientation";if((v||i)&&(o[x]=t(x,s[x]),T&&(o.fillDflt=o[x]==="h"?"tonextx":"tonexty"),v&&(o[y]=!0,!i&&(delete o.traces[0][x],T))))for(var u=0;u<o.traces.length-1;u++){var b=o.traces[u];b._input.fill!==b.fill&&(b.fill=o.fillDflt)}}}return o}}}),s0=Ft((Q,$)=>{var c=li(),g=Hd().hasColorscale,P=mc(),S=Ac();$.exports=function(t,e,r,a,n,o){var i=S.isBubble(t),s=(t.line||{}).color,f;if(o=o||{},s&&(r=s),n("marker.symbol"),n("marker.opacity",i?.7:1),n("marker.size"),o.noAngle||(n("marker.angle"),o.noAngleRef||n("marker.angleref"),o.noStandOff||n("marker.standoff")),n("marker.color",r),g(t,"marker")&&P(t,e,a,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:i?f=c.background:f=c.defaultLine,n("marker.line.color",f),g(t,"marker.line")&&P(t,e,a,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width",i?1:0)),i&&(n("marker.sizeref"),n("marker.sizemin"),n("marker.sizemode")),o.gradient){var x=n("marker.gradient.type");x!=="none"&&n("marker.gradient.color")}}}),I0=Ft((Q,$)=>{var c=bn().isArrayOrTypedArray,g=Hd().hasColorscale,P=mc();$.exports=function(S,t,e,r,a,n){n||(n={});var o=(S.marker||{}).color;if(o&&o._inputArray&&(o=o._inputArray),a("line.color",e),g(S,"line"))P(S,t,r,a,{prefix:"line.",cLetter:"c"});else{var i=(c(o)?!1:o)||e;a("line.color",i)}a("line.width"),n.noDash||a("line.dash"),n.backoff&&a("line.backoff")}}),xv=Ft((Q,$)=>{$.exports=function(c,g,P){var S=P("line.shape");S==="spline"&&P("line.smoothing")}}),x0=Ft((Q,$)=>{var c=bn();$.exports=function(g,P,S,t,e){e=e||{},t("textposition"),c.coerceFont(t,"textfont",e.font||S.font,e),e.noSelect||(t("selected.textfont.color"),t("unselected.textfont.color"))}}),O0=Ft((Q,$)=>{var c=li(),g=bn().isArrayOrTypedArray;function P(S){for(var t=c.interpolate(S[0][1],S[1][1],.5),e=2;e<S.length;e++){var r=c.interpolate(S[e-1][1],S[e][1],.5);t=c.interpolate(t,r,S[e-1][0]/S[e][0])}return t}$.exports=function(S,t,e,r,a){a||(a={});var n=!1;if(t.marker){var o=t.marker.color,i=(t.marker.line||{}).color;o&&!g(o)?n=o:i&&!g(i)&&(n=i)}var s;if(a.moduleHasFillgradient){var f=r("fillgradient.type");if(f!=="none"){r("fillgradient.start"),r("fillgradient.stop");var x=r("fillgradient.colorscale");x&&(s=P(x))}}r("fillcolor",c.addOpacity((t.line||{}).color||n||s||e,.5))}}),Lw=Ft((Q,$)=>{var c=bn(),g=Xo(),P=tf(),S=vm(),t=Ac(),e=Nm(),r=Fp(),a=Cw(),n=s0(),o=I0(),i=xv(),s=x0(),f=O0(),x=bn().coercePattern;$.exports=function(y,v,T,u){function b(k,w){return c.coerce(y,v,P,k,w)}var _=e(y,v,u,b);if(_||(v.visible=!1),!!v.visible){r(y,v,u,b),b("xhoverformat"),b("yhoverformat"),b("zorder");var C=a(y,v,u,b);u.scattermode==="group"&&v.orientation===void 0&&b("orientation","v");var M=!C&&_<S.PTS_LINESONLY?"lines+markers":"lines";b("text"),b("hovertext"),b("mode",M),t.hasMarkers(v)&&n(y,v,T,u,b,{gradient:!0}),t.hasLines(v)&&(o(y,v,T,u,b,{backoff:!0}),i(y,v,b),b("connectgaps"),b("line.simplify")),t.hasText(v)&&(b("texttemplate"),b("texttemplatefallback"),s(y,v,u,b));var E=[];(t.hasMarkers(v)||t.hasText(v))&&(b("cliponaxis"),b("marker.maxdisplayed"),E.push("points")),b("fill",C?C.fillDflt:"none"),v.fill!=="none"&&(f(y,v,T,b,{moduleHasFillgradient:!0}),t.hasLines(v)||i(y,v,b),x(b,"fillpattern",v.fillcolor,!1));var A=(v.line||{}).color,h=(v.marker||{}).color;(v.fill==="tonext"||v.fill==="toself")&&E.push("fills"),b("hoveron",E.join("+")||"points"),v.hoveron!=="fills"&&(b("hovertemplate"),b("hovertemplatefallback"));var p=g.getComponentMethod("errorbars","supplyDefaults");p(y,v,A||h||T,{axis:"y"}),p(y,v,A||h||T,{axis:"x",inherit:"y"}),c.coerceSelectionMarkerOpacity(v,b)}}}),Mg=Ft((Q,$)=>{var c=vv().getAxisGroup;$.exports=function(g,P,S,t,e){var r=P.orientation,a=P[{v:"x",h:"y"}[r]+"axis"],n=c(S,a)+r,o=S._alignmentOpts||{},i=t("alignmentgroup"),s=o[n];s||(s=o[n]={});var f=s[i];f?f.traces.push(P):f=s[i]={traces:[P],alignmentIndex:Object.keys(s).length,offsetGroups:{}};var x=t("offsetgroup")||"",y=f.offsetGroups,v=y[x];P._offsetIndex=0,(e!=="group"||x)&&(v||(v=y[x]={offsetIndex:Object.keys(y).length}),P._offsetIndex=v.offsetIndex)}}),Pw=Ft((Q,$)=>{var c=bn(),g=Mg(),P=tf();$.exports=function(S,t){var e,r,a,n=t.scattermode;function o(y){return c.coerce(r._input,r,P,y)}if(t.scattermode==="group")for(a=0;a<S.length;a++)r=S[a],r.type==="scatter"&&(e=r._input,g(e,r,t,o,n));for(a=0;a<S.length;a++){var i=S[a];if(i.type==="scatter"){var s=i.fill;if(!(s==="none"||s==="toself")&&(i.opacity=void 0,s==="tonexty"||s==="tonextx"))for(var f=a-1;f>=0;f--){var x=S[f];if(x.type==="scatter"&&x.xaxis===i.xaxis&&x.yaxis===i.yaxis){x.opacity=void 0;break}}}}}}),zw=Ft((Q,$)=>{var c=bn(),g=pg();$.exports=function(P,S){function t(r,a){return c.coerce(P,S,g,r,a)}var e=S.barmode==="group";S.scattermode==="group"&&t("scattergap",e?S.bargap:.2)}}),D0=Ft((Q,$)=>{var c=ra(),g=bn(),P=g.dateTime2ms,S=g.incrementMonth,t=Da(),e=t.ONEAVGMONTH;$.exports=function(r,a,n,o){if(a.type!=="date")return{vals:o};var i=r[n+"periodalignment"];if(!i)return{vals:o};var s=r[n+"period"],f;if(c(s)){if(s=+s,s<=0)return{vals:o}}else if(typeof s=="string"&&s.charAt(0)==="M"){var x=+s.substring(1);if(x>0&&Math.round(x)===x)f=x;else return{vals:o}}for(var y=a.calendar,v=i==="start",T=i==="end",u=r[n+"period0"],b=P(u,y)||0,_=[],C=[],M=[],E=o.length,A=0;A<E;A++){var h=o[A],p,k,w;if(f){for(p=Math.round((h-b)/(f*e)),w=S(b,f*p,y);w>h;)w=S(w,-f,y);for(;w<=h;)w=S(w,f,y);k=S(w,-f,y)}else{for(p=Math.round((h-b)/s),w=b+p*s;w>h;)w-=s;for(;w<=h;)w+=s;k=w-s}_[A]=v?k:T?w:(k+w)/2,C[A]=k,M[A]=w}return{vals:_,starts:C,ends:M}}}),F0=Ft((Q,$)=>{var c=Hd().hasColorscale,g=Jd(),P=Ac();$.exports=function(S,t){P.hasLines(t)&&c(t,"line")&&g(S,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),P.hasMarkers(t)&&(c(t,"marker")&&g(S,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),c(t,"marker.line")&&g(S,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}),ct=Ft((Q,$)=>{var c=bn();$.exports=function(g,P){for(var S=0;S<g.length;S++)g[S].i=S;c.mergeArray(P.text,g,"tx"),c.mergeArray(P.texttemplate,g,"txt"),c.mergeArray(P.hovertext,g,"htx"),c.mergeArray(P.customdata,g,"data"),c.mergeArray(P.textposition,g,"tp"),P.textfont&&(c.mergeArrayCastPositive(P.textfont.size,g,"ts"),c.mergeArray(P.textfont.color,g,"tc"),c.mergeArray(P.textfont.family,g,"tf"),c.mergeArray(P.textfont.weight,g,"tw"),c.mergeArray(P.textfont.style,g,"ty"),c.mergeArray(P.textfont.variant,g,"tv"),c.mergeArray(P.textfont.textcase,g,"tC"),c.mergeArray(P.textfont.lineposition,g,"tE"),c.mergeArray(P.textfont.shadow,g,"tS"));var t=P.marker;if(t){c.mergeArrayCastPositive(t.size,g,"ms"),c.mergeArrayCastPositive(t.opacity,g,"mo"),c.mergeArray(t.symbol,g,"mx"),c.mergeArray(t.angle,g,"ma"),c.mergeArray(t.standoff,g,"mf"),c.mergeArray(t.color,g,"mc");var e=t.line;t.line&&(c.mergeArray(e.color,g,"mlc"),c.mergeArrayCastPositive(e.width,g,"mlw"));var r=t.gradient;r&&r.type!=="none"&&(c.mergeArray(r.type,g,"mgt"),c.mergeArray(r.color,g,"mgc"))}}}),Bt=Ft((Q,$)=>{var c=bn();$.exports=function(g,P){c.isArrayOrTypedArray(P.selectedpoints)&&c.tagSelected(g,P)}}),me=Ft((Q,$)=>{var c=ra(),g=bn(),P=Es(),S=D0(),t=Da().BADNUM,e=Ac(),r=F0(),a=ct(),n=Bt();function o(v,T){var u=v._fullLayout,b=T._xA=P.getFromId(v,T.xaxis||"x","x"),_=T._yA=P.getFromId(v,T.yaxis||"y","y"),C=b.makeCalcdata(T,"x"),M=_.makeCalcdata(T,"y"),E=S(T,b,"x",C),A=S(T,_,"y",M),h=E.vals,p=A.vals,k=T._length,w=new Array(k),R=T.ids,O=y(T,u,b,_),N=!1,V,H,F,U,W,q;f(u,T);var X="x",lt="y",yt;if(O)g.pushUnique(O.traceIndices,T.index),V=O.orientation==="v",V?(lt="s",yt="x"):(X="s",yt="y"),W=O.stackgaps==="interpolate";else{var pt=s(T,k);i(v,T,b,_,h,p,pt)}var st=!!T.xperiodalignment,tt=!!T.yperiodalignment;for(H=0;H<k;H++){var dt=w[H]={},rt=c(h[H]),at=c(p[H]);rt&&at?(dt[X]=h[H],dt[lt]=p[H],st&&(dt.orig_x=C[H],dt.xEnd=E.ends[H],dt.xStart=E.starts[H]),tt&&(dt.orig_y=M[H],dt.yEnd=A.ends[H],dt.yStart=A.starts[H])):O&&(V?rt:at)?(dt[yt]=V?h[H]:p[H],dt.gap=!0,W?(dt.s=t,N=!0):dt.s=0):dt[X]=dt[lt]=t,R&&(dt.id=String(R[H]))}if(a(w,T),r(v,T),n(w,T),O){for(H=0;H<w.length;)w[H][yt]===t?w.splice(H,1):H++;if(g.sort(w,function(ft,ut){return ft[yt]-ut[yt]||ft.i-ut.i}),N){for(H=0;H<w.length-1&&w[H].gap;)H++;for(q=w[H].s,q||(q=w[H].s=0),F=0;F<H;F++)w[F].s=q;for(U=w.length-1;U>H&&w[U].gap;)U--;for(q=w[U].s,F=w.length-1;F>U;F--)w[F].s=q;for(;H<U;)if(H++,w[H].gap){for(F=H+1;w[F].gap;)F++;for(var vt=w[H-1][yt],it=w[H-1].s,Y=(w[F].s-it)/(w[F][yt]-vt);H<F;)w[H].s=it+(w[H][yt]-vt)*Y,H++}}}return w}function i(v,T,u,b,_,C,M){var E=T._length,A=v._fullLayout,h=u._id,p=b._id,k=A._firstScatter[x(T)]===T.uid,w=(y(T,A,u,b)||{}).orientation,R=T.fill;u._minDtick=0,b._minDtick=0;var O={padded:!0},N={padded:!0};M&&(O.ppad=N.ppad=M);var V=E<2||_[0]!==_[E-1]||C[0]!==C[E-1];V&&(R==="tozerox"||R==="tonextx"&&(k||w==="h"))?O.tozero=!0:!(T.error_y||{}).visible&&(R==="tonexty"||R==="tozeroy"||!e.hasMarkers(T)&&!e.hasText(T))&&(O.padded=!1,O.ppad=0),V&&(R==="tozeroy"||R==="tonexty"&&(k||w==="v"))?N.tozero=!0:(R==="tonextx"||R==="tozerox")&&(N.padded=!1),h&&(T._extremes[h]=P.findExtremes(u,_,O)),p&&(T._extremes[p]=P.findExtremes(b,C,N))}function s(v,T){if(e.hasMarkers(v)){var u=v.marker,b=1.6*(v.marker.sizeref||1),_;if(v.marker.sizemode==="area"?_=function(h){return Math.max(Math.sqrt((h||0)/b),3)}:_=function(h){return Math.max((h||0)/b,3)},g.isArrayOrTypedArray(u.size)){var C={type:"linear"};P.setConvert(C);for(var M=C.makeCalcdata(v.marker,"size"),E=new Array(T),A=0;A<T;A++)E[A]=_(M[A]);return E}else return _(u.size)}}function f(v,T){var u=x(T),b=v._firstScatter;b[u]||(b[u]=T.uid)}function x(v){var T=v.stackgroup;return v.xaxis+v.yaxis+v.type+(T?"-"+T:"")}function y(v,T,u,b){var _=v.stackgroup;if(_){var C=T._scatterStackOpts[u._id+b._id][_],M=C.orientation==="v"?b:u;if(M.type==="linear"||M.type==="log")return C}}$.exports={calc:o,calcMarkerSize:s,calcAxisExpansion:i,setFirstScatter:f,getStackOpts:y}}),Qe=Ft((Q,$)=>{$.exports=g;var c=bn().distinctVals;function g(P,S){this.traces=P,this.sepNegVal=S.sepNegVal,this.overlapNoMerge=S.overlapNoMerge;for(var t=1/0,e=S.posAxis._id.charAt(0),r=[],a=0;a<P.length;a++){for(var n=P[a],o=0;o<n.length;o++){var i=n[o],s=i.p;s===void 0&&(s=i[e]),s!==void 0&&r.push(s)}n[0]&&n[0].width1&&(t=Math.min(n[0].width1,t))}this.positions=r;var f=c(r);this.distinctPositions=f.vals,f.vals.length===1&&t!==1/0?this.minDiff=t:this.minDiff=Math.min(f.minDiff,t);var x=(S.posAxis||{}).type;(x==="category"||x==="multicategory")&&(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}g.prototype.put=function(P,S,t){var e=this.getLabel(P,S,t),r=this.bins[e]||0;return this.bins[e]=r+t,r},g.prototype.get=function(P,S,t){var e=this.getLabel(P,S,t);return this.bins[e]||0},g.prototype.getLabel=function(P,S,t){var e=t<0&&this.sepNegVal?"v":"^",r=this.overlapNoMerge?P:Math.round(P/this.binWidth);return e+r+"g"+S}}),Pr=Ft((Q,$)=>{var c=ra(),g=bn().isArrayOrTypedArray,P=Da().BADNUM,S=Xo(),t=Es(),e=vv().getAxisGroup,r=Qe();function a(w,R){for(var O=R.xaxis,N=R.yaxis,V=w._fullLayout,H=w._fullData,F=w.calcdata,U=[],W=[],q=0;q<H.length;q++){var X=H[q];if(X.visible===!0&&S.traceIs(X,"bar")&&X.xaxis===O._id&&X.yaxis===N._id&&(X.orientation==="h"?U.push(F[q]):W.push(F[q]),X._computePh))for(var lt=w.calcdata[q],yt=0;yt<lt.length;yt++)typeof lt[yt].ph0=="function"&&(lt[yt].ph0=lt[yt].ph0()),typeof lt[yt].ph1=="function"&&(lt[yt].ph1=lt[yt].ph1())}var pt={xCat:O.type==="category"||O.type==="multicategory",yCat:N.type==="category"||N.type==="multicategory",mode:V.barmode,norm:V.barnorm,gap:V.bargap,groupgap:V.bargroupgap};n(w,O,N,W,pt),n(w,N,O,U,pt)}function n(w,R,O,N,V){if(N.length){var H,F,U,W,q;switch(s(O,N),V.mode){case"overlay":f(w,R,O,N,V);break;case"group":for(H=[],F=[],U=0;U<N.length;U++)W=N[U],q=W[0].trace,q.offset===void 0?F.push(W):H.push(W);F.length&&x(w,R,O,F,V),H.length&&f(w,R,O,H,V);break;case"stack":case"relative":for(H=[],F=[],U=0;U<N.length;U++)W=N[U],q=W[0].trace,q.base===void 0?F.push(W):H.push(W);i(F),F.length&&y(w,R,O,F,V),H.length&&f(w,R,O,H,V);break}o(N),p(N,R)}}function o(w){var R,O,N,V,H,F,U;for(R=0;R<w.length;R++)O=w[R],N=O[0].trace,V=O[0].t,V.cornerradiusvalue===void 0&&(H=N.marker?N.marker.cornerradius:void 0,H!==void 0&&(F=c(H)?+H:+H.slice(0,-1),U=c(H)?"px":"%",V.cornerradiusvalue=F,V.cornerradiusform=U))}function i(w){if(!(w.length<2)){var R,O,N,V,H,F,U;for(R=0;R<w.length&&(O=w[R],N=O[0].trace,H=N.marker?N.marker.cornerradius:void 0,H===void 0);R++);if(H!==void 0)for(F=c(H)?+H:+H.slice(0,-1),U=c(H)?"px":"%",R=0;R<w.length;R++)O=w[R],V=O[0].t,V.cornerradiusvalue=F,V.cornerradiusform=U}}function s(w,R){var O,N;for(O=0;O<R.length;O++){var V=R[O],H=V[0].trace,F=H.type==="funnel"?H._base:H.base,U,W=H.orientation==="h"?H.xcalendar:H.ycalendar,q=w.type==="category"||w.type==="multicategory"?function(){return null}:w.d2c;if(g(F)){for(N=0;N<Math.min(F.length,V.length);N++)U=q(F[N],0,W),c(U)?(V[N].b=+U,V[N].hasB=1):V[N].b=0;for(;N<V.length;N++)V[N].b=0}else{U=q(F,0,W);var X=c(U);for(U=X?U:0,N=0;N<V.length;N++)V[N].b=U,X&&(V[N].hasB=1)}}}function f(w,R,O,N,V){for(var H=0;H<N.length;H++){var F=N[H],U=new r([F],{posAxis:R,sepNegVal:!1,overlapNoMerge:!V.norm});v(w,R,U,V),V.norm?(M(U),A(O,U,V)):_(O,U)}}function x(w,R,O,N,V){var H=new r(N,{posAxis:R,sepNegVal:!1,overlapNoMerge:!V.norm});v(w,R,H,V),E(H,R),V.norm?(M(H),A(O,H,V)):_(O,H)}function y(w,R,O,N,V){var H=new r(N,{posAxis:R,sepNegVal:V.mode==="relative",overlapNoMerge:!(V.norm||V.mode==="stack"||V.mode==="relative")});v(w,R,H,V),C(O,H,V);for(var F=0;F<N.length;F++)for(var U=N[F],W=U[0].t.offsetindex,q=0;q<U.length;q++){var X=U[q];if(X.s!==P){var lt=X.b+X.s===H.get(X.p,W,X.s);lt&&(X._outmost=!0)}}V.norm&&A(O,H,V)}function v(w,R,O,N){var V=w._fullLayout,H=O.positions,F=O.distinctPositions,U=O.minDiff,W=O.traces,q=W.length,X=H.length!==F.length,lt=U*(1-N.gap),yt,pt,st,tt;if(R._id==="angularaxis")yt=lt,pt=yt*(1-(N.groupgap||0)),st=-pt/2;else{var dt=e(V,R._id)+W[0][0].trace.orientation;tt=V._alignmentOpts[dt]||{}}for(var rt=0;rt<q;rt++){var at=W[rt],vt=at[0].trace;if(R._id!=="angularaxis"){var it=tt[vt.alignmentgroup]||{},Y=Object.keys(it.offsetGroups||{}).length;Y?yt=lt/Y:yt=X?lt/q:lt,pt=yt*(1-(N.groupgap||0)),Y?st=((2*vt._offsetIndex+1-Y)*yt-pt)/2:st=X?((2*rt+1-q)*yt-pt)/2:-pt/2}var ft=at[0].t;ft.barwidth=pt,ft.offsetindex=vt._offsetIndex||0,ft.poffset=st,ft.bargroupwidth=lt,ft.bardelta=U}O.binWidth=W[0][0].t.barwidth/100,T(O),u(R,O),R._id==="angularaxis"?b(R,O):b(R,O,X)}function T(w){var R=w.traces,O,N;for(O=0;O<R.length;O++){var V=R[O],H=V[0],F=H.trace,U=H.t,W=F._offset||F.offset,q=U.poffset,X;if(g(W)){for(X=Array.prototype.slice.call(W,0,V.length),N=0;N<X.length;N++)c(X[N])||(X[N]=q);for(N=X.length;N<V.length;N++)X.push(q);U.poffset=X}else W!==void 0&&(U.poffset=W);var lt=F._width||F.width,yt=U.barwidth;if(g(lt)){var pt=Array.prototype.slice.call(lt,0,V.length);for(N=0;N<pt.length;N++)c(pt[N])||(pt[N]=yt);for(N=pt.length;N<V.length;N++)pt.push(yt);if(U.barwidth=pt,W===void 0){for(X=[],N=0;N<V.length;N++)X.push(q+(yt-pt[N])/2);U.poffset=X}}else lt!==void 0&&(U.barwidth=lt,W===void 0&&(U.poffset=q+(yt-lt)/2))}}function u(w,R){for(var O=R.traces,N=k(w),V=0;V<O.length;V++)for(var H=O[V],F=H[0].t,U=F.poffset,W=g(U),q=F.barwidth,X=g(q),lt=0;lt<H.length;lt++){var yt=H[lt],pt=yt.w=X?q[lt]:q;yt.p===void 0&&(yt.p=yt[N],yt["orig_"+N]=yt[N]);var st=(W?U[lt]:U)+pt/2;yt[N]=yt.p+st}}function b(w,R,O){var N=R.traces,V=R.minDiff,H=V/2;t.minDtick(w,R.minDiff,R.distinctPositions[0],O);for(var F=0;F<N.length;F++){var U=N[F],W=U[0],q=W.trace,X=[],lt,yt,pt,st;for(st=0;st<U.length;st++)lt=U[st],yt=lt.p-H,pt=lt.p+H,X.push(yt,pt);if(q.width||q.offset){var tt=W.t,dt=tt.poffset,rt=tt.barwidth,at=g(dt),vt=g(rt);for(st=0;st<U.length;st++){lt=U[st];var it=at?dt[st]:dt,Y=vt?rt[st]:rt;yt=lt.p+it,pt=yt+Y,X.push(yt,pt)}}q._extremes[w._id]=t.findExtremes(w,X,{padded:!1})}}function _(w,R){for(var O=R.traces,N=k(w),V=0;V<O.length;V++){for(var H=O[V],F=H[0].trace,U=F.type==="scatter",W=F.orientation==="v",q=[],X=!1,lt=0;lt<H.length;lt++){var yt=H[lt],pt=U?0:yt.b,st=U?W?yt.y:yt.x:pt+yt.s;yt[N]=st,q.push(st),yt.hasB&&q.push(pt),(!yt.hasB||!yt.b)&&(X=!0)}F._extremes[w._id]=t.findExtremes(w,q,{tozero:X,padded:!0})}}function C(w,R,O){var N=k(w),V=R.traces,H,F,U,W,q,X,lt;for(W=0;W<V.length;W++)if(H=V[W],F=H[0].trace,F.type==="funnel")for(lt=H[0].t.offsetindex,q=0;q<H.length;q++)X=H[q],X.s!==P&&R.put(X.p,lt,-.5*X.s);for(W=0;W<V.length;W++){H=V[W],F=H[0].trace,U=F.type==="funnel",lt=F.type==="barpolar"?0:H[0].t.offsetindex;var yt=[];for(q=0;q<H.length;q++)if(X=H[q],X.s!==P){var pt;U?pt=X.s:pt=X.s+X.b;var st=R.put(X.p,lt,pt),tt=st+pt;X.b=st,X[N]=tt,O.norm||(yt.push(tt),X.hasB&&yt.push(st))}O.norm||(F._extremes[w._id]=t.findExtremes(w,yt,{tozero:!0,padded:!0}))}}function M(w){for(var R=w.traces,O=0;O<R.length;O++)for(var N=R[O],V=N[0].t.offsetindex,H=0;H<N.length;H++){var F=N[H];F.s!==P&&w.put(F.p,V,F.b+F.s)}}function E(w,R){for(var O=w.traces,N=0;N<O.length;N++){var V=O[N],H=V[0].trace,F=V[0].t.offsetindex;if(H.base===void 0)for(var U=new r([V],{posAxis:R,sepNegVal:!0,overlapNoMerge:!0}),W=0;W<V.length;W++){var q=V[W];if(q.p!==P){var X=U.put(q.p,F,q.b+q.s);X&&(q.b=X)}}}}function A(w,R,O){var N=R.traces,V=k(w),H=O.norm==="fraction"?1:100,F=H/1e9,U=w.l2c(w.c2l(0)),W=O.mode==="stack"?H:U;function q(ft){return c(w.c2l(ft))&&(ft<U-F||ft>W+F||!c(U))}for(var X=0;X<N.length;X++){for(var lt=N[X],yt=lt[0].t.offsetindex,pt=lt[0].trace,st=[],tt=!1,dt=!1,rt=0;rt<lt.length;rt++){var at=lt[rt];if(at.s!==P){var vt=Math.abs(H/R.get(at.p,yt,at.s));at.b*=vt,at.s*=vt;var it=at.b,Y=it+at.s;at[V]=Y,st.push(Y),dt=dt||q(Y),at.hasB&&(st.push(it),dt=dt||q(it)),(!at.hasB||!at.b)&&(tt=!0)}}pt._extremes[w._id]=t.findExtremes(w,st,{tozero:tt,padded:dt})}}function h(w,R,O,N){for(var V=k(N),H=0;H<w.length;H++)for(var F=w[H],U=0;U<F.length;U++){var W=F[U],q=W[V];W._sMin=R[q],W._sMax=O[q]}}function p(w,R){var O=k(R),N={},V,H,F,U=1/0,W=-1/0;for(V=0;V<w.length;V++)for(F=w[V],H=0;H<F.length;H++){var q=F[H].p;c(q)&&(U=Math.min(U,q),W=Math.max(W,q))}var X=1e4/(W-U),lt=N.round=function(wt){return String(Math.round(X*(wt-U)))},yt={},pt={},st=w.some(function(wt){var zt=wt[0].trace;return"marker"in zt&&zt.marker.cornerradius});for(V=0;V<w.length;V++){F=w[V],F[0].t.extents=N;var tt=F[0].t.poffset,dt=g(tt);for(H=0;H<F.length;H++){var rt=F[H],at=rt[O]-rt.w/2;if(c(at)){var vt=rt[O]+rt.w/2,it=lt(rt.p);N[it]?N[it]=[Math.min(at,N[it][0]),Math.max(vt,N[it][1])]:N[it]=[at,vt]}if(rt.p0=rt.p+(dt?tt[H]:tt),rt.p1=rt.p0+rt.w,rt.s0=rt.b,rt.s1=rt.s0+rt.s,st){var Y=Math.min(rt.s0,rt.s1)||0,ft=Math.max(rt.s0,rt.s1)||0,ut=rt[O];yt[ut]=ut in yt?Math.min(yt[ut],Y):Y,pt[ut]=ut in pt?Math.max(pt[ut],ft):ft}}}st&&h(w,yt,pt,R)}function k(w){return w._id.charAt(0)}$.exports={crossTraceCalc:a,setGroupPositions:n}}),Tn=Ft((Q,$)=>{var c=me(),g=Pr().setGroupPositions;function P(e,r){for(var a=r.xaxis,n=r.yaxis,o=e._fullLayout,i=e._fullData,s=e.calcdata,f=[],x=[],y=0;y<i.length;y++){var v=i[y];v.visible===!0&&v.type==="scatter"&&v.xaxis===a._id&&v.yaxis===n._id&&(v.orientation==="h"?f.push(s[y]):v.orientation==="v"&&x.push(s[y]))}var T={mode:o.scattermode,gap:o.scattergap};g(e,a,n,x,T),g(e,n,a,f,T)}$.exports=function(e,r){e._fullLayout.scattermode==="group"&&P(e,r);var a=r.xaxis,n=r.yaxis,o=a._id+n._id,i=e._fullLayout._scatterStackOpts[o];if(i){var s=e.calcdata,f,x,y,v,T,u,b,_,C,M,E,A,h,p,k;for(var w in i){M=i[w];var R=M.traceIndices;if(R.length){for(E=M.stackgaps==="interpolate",A=M.groupnorm,M.orientation==="v"?(h="x",p="y"):(h="y",p="x"),k=new Array(R.length),f=0;f<k.length;f++)k[f]=!1;u=s[R[0]];var O=new Array(u.length);for(f=0;f<u.length;f++)O[f]=u[f][h];for(f=1;f<R.length;f++){for(T=s[R[f]],x=y=0;x<T.length;x++){for(b=T[x][h];b>O[y]&&y<O.length;y++)S(T,x,O[y],f,k,E,h),x++;if(b!==O[y]){for(v=0;v<f;v++)S(s[R[v]],y,b,v,k,E,h);O.splice(y,0,b)}y++}for(;y<O.length;y++)S(T,x,O[y],f,k,E,h),x++}var N=O.length;for(x=0;x<u.length;x++){for(_=u[x][p]=u[x].s,f=1;f<R.length;f++)T=s[R[f]],T[0].trace._rawLength=T[0].trace._length,T[0].trace._length=N,_+=T[x].s,T[x][p]=_;if(A)for(C=(A==="fraction"?_:_/100)||1,f=0;f<R.length;f++){var V=s[R[f]][x];V[p]/=C,V.sNorm=V.s/C}}for(f=0;f<R.length;f++){T=s[R[f]];var H=T[0].trace,F=c.calcMarkerSize(H,H._rawLength),U=Array.isArray(F);if(F&&k[f]||U){var W=F;for(F=new Array(N),x=0;x<N;x++)F[x]=T[x].gap?0:U?W[T[x].i]:W}var q=new Array(N),X=new Array(N);for(x=0;x<N;x++)q[x]=T[x].x,X[x]=T[x].y;c.calcAxisExpansion(e,H,a,n,q,X,F),T[0].t.orientation=M.orientation}}}}};function S(e,r,a,n,o,i,s){o[n]=!0;var f={i:null,gap:!0,s:0};if(f[s]=a,e.splice(r,0,f),r&&a===e[r-1][s]){var x=e[r-1];f.s=x.s,f.i=x.i,f.gap=x.gap}else i&&(f.s=t(e,r,a,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,a,n){var o=e[r-1],i=e[r+1];return i?o?o.s+(i.s-o.s)*(a-o[n])/(i[n]-o[n]):i.s:o.s}}),ji=Ft((Q,$)=>{var c=js(),g=Da(),P=g.BADNUM,S=g.LOG_CLIP,t=S+.5,e=S-.5,r=bn(),a=r.segmentsIntersect,n=r.constrain,o=vm();$.exports=function(i,s){var f=s.trace||{},x=s.xaxis,y=s.yaxis,v=x.type==="log",T=y.type==="log",u=x._length,b=y._length,_=s.backoff,C=f.marker,M=s.connectGaps,E=s.baseTolerance,A=s.shape,h=A==="linear",p=f.fill&&f.fill!=="none",k=[],w=o.minTolerance,R=i.length,O=new Array(R),N=0,V,H,F,U,W,q,X,lt,yt,pt,st,tt,dt,rt,at,vt;function it(we){var Ue=i[we];if(!Ue)return!1;var qe=s.linearized?x.l2p(Ue.x):x.c2p(Ue.x),ar=s.linearized?y.l2p(Ue.y):y.c2p(Ue.y);if(qe===P){if(v&&(qe=x.c2p(Ue.x,!0)),qe===P)return!1;T&&ar===P&&(qe*=Math.abs(x._m*b*(x._m>0?t:e)/(y._m*u*(y._m>0?t:e)))),qe*=1e3}if(ar===P){if(T&&(ar=y.c2p(Ue.y,!0)),ar===P)return!1;ar*=1e3}return[qe,ar]}function Y(we,Ue,qe,ar){var Ar=qe-we,Tr=ar-Ue,pr=.5-we,Jr=.5-Ue,Vn=Ar*Ar+Tr*Tr,Hn=Ar*pr+Tr*Jr;if(Hn>0&&Hn<Vn){var Kn=pr*Tr-Jr*Ar;if(Kn*Kn<Vn)return!0}}var ft,ut;function wt(we,Ue){var qe=we[0]/u,ar=we[1]/b,Ar=Math.max(0,-qe,qe-1,-ar,ar-1);return Ar&&ft!==void 0&&Y(qe,ar,ft,ut)&&(Ar=0),Ar&&Ue&&Y(qe,ar,Ue[0]/u,Ue[1]/b)&&(Ar=0),(1+o.toleranceGrowth*Ar)*E}function zt(we,Ue){var qe=we[0]-Ue[0],ar=we[1]-Ue[1];return Math.sqrt(qe*qe+ar*ar)}var Pt=o.maxScreensAway,Wt=-u*Pt,Ht=u*(1+Pt),Jt=-b*Pt,ge=b*(1+Pt),he=[[Wt,Jt,Ht,Jt],[Ht,Jt,Ht,ge],[Ht,ge,Wt,ge],[Wt,ge,Wt,Jt]],de,se,Tt,Lt,Mt,te;function ve(we,Ue){for(var qe=[],ar=0,Ar=0;Ar<4;Ar++){var Tr=he[Ar],pr=a(we[0],we[1],Ue[0],Ue[1],Tr[0],Tr[1],Tr[2],Tr[3]);pr&&(!ar||Math.abs(pr.x-qe[0][0])>1||Math.abs(pr.y-qe[0][1])>1)&&(pr=[pr.x,pr.y],ar&&zt(pr,we)<zt(qe[0],we)?qe.unshift(pr):qe.push(pr),ar++)}return qe}function oe(we){if(we[0]<Wt||we[0]>Ht||we[1]<Jt||we[1]>ge)return[n(we[0],Wt,Ht),n(we[1],Jt,ge)]}function Te(we,Ue){if(we[0]===Ue[0]&&(we[0]===Wt||we[0]===Ht)||we[1]===Ue[1]&&(we[1]===Jt||we[1]===ge))return!0}function He(we,Ue){var qe=[],ar=oe(we),Ar=oe(Ue);return ar&&Ar&&Te(ar,Ar)||(ar&&qe.push(ar),Ar&&qe.push(Ar)),qe}function Ge(we,Ue,qe){return function(ar,Ar){var Tr=oe(ar),pr=oe(Ar),Jr=[];if(Tr&&pr&&Te(Tr,pr))return Jr;Tr&&Jr.push(Tr),pr&&Jr.push(pr);var Vn=2*r.constrain((ar[we]+Ar[we])/2,Ue,qe)-((Tr||ar)[we]+(pr||Ar)[we]);if(Vn){var Hn;Tr&&pr?Hn=Vn>0==Tr[we]>pr[we]?Tr:pr:Hn=Tr||pr,Hn[we]+=Vn}return Jr}}var cr;A==="linear"||A==="spline"?cr=ve:A==="hv"||A==="vh"?cr=He:A==="hvh"?cr=Ge(0,Wt,Ht):A==="vhv"&&(cr=Ge(1,Jt,ge));function ur(we,Ue){var qe=Ue[0]-we[0],ar=(Ue[1]-we[1])/qe,Ar=(we[1]*Ue[0]-Ue[1]*we[0])/qe;return Ar>0?[ar>0?Wt:Ht,ge]:[ar>0?Ht:Wt,Jt]}function jr(we){var Ue=we[0],qe=we[1],ar=Ue===O[N-1][0],Ar=qe===O[N-1][1];if(!(ar&&Ar))if(N>1){var Tr=Ue===O[N-2][0],pr=qe===O[N-2][1];ar&&(Ue===Wt||Ue===Ht)&&Tr?pr?N--:O[N-1]=we:Ar&&(qe===Jt||qe===ge)&&pr?Tr?N--:O[N-1]=we:O[N++]=we}else O[N++]=we}function Hr(we){O[N-1][0]!==we[0]&&O[N-1][1]!==we[1]&&jr([Tt,Lt]),jr(we),Mt=null,Tt=Lt=0}var br=r.isArrayOrTypedArray(C);function Kr(we){if(we&&_&&(we.i=V,we.d=i,we.trace=f,we.marker=br?C[we.i]:C,we.backoff=_),ft=we[0]/u,ut=we[1]/b,de=we[0]<Wt?Wt:we[0]>Ht?Ht:0,se=we[1]<Jt?Jt:we[1]>ge?ge:0,de||se){if(!N)O[N++]=[de||we[0],se||we[1]];else if(Mt){var Ue=cr(Mt,we);Ue.length>1&&(Hr(Ue[0]),O[N++]=Ue[1])}else te=cr(O[N-1],we)[0],O[N++]=te;var qe=O[N-1];de&&se&&(qe[0]!==de||qe[1]!==se)?(Mt&&(Tt!==de&&Lt!==se?jr(Tt&&Lt?ur(Mt,we):[Tt||de,Lt||se]):Tt&&Lt&&jr([Tt,Lt])),jr([de,se])):Tt-de&&Lt-se&&jr([de||Tt,se||Lt]),Mt=we,Tt=de,Lt=se}else Mt&&Hr(cr(Mt,we)[0]),O[N++]=we}for(V=0;V<R;V++)if(H=it(V),!!H){for(N=0,Mt=null,Kr(H),V++;V<R;V++){if(U=it(V),!U){if(M)continue;break}if(!h||!s.simplify){Kr(U);continue}var rn=it(V+1);if(pt=zt(U,H),!(!(p&&(N===0||N===R-1))&&pt<wt(U,rn)*w)){for(lt=[(U[0]-H[0])/pt,(U[1]-H[1])/pt],W=H,st=pt,tt=rt=at=0,X=!1,F=U,V++;V<i.length;V++){if(q=rn,rn=it(V+1),!q){if(M)continue;break}if(yt=[q[0]-H[0],q[1]-H[1]],vt=yt[0]*lt[1]-yt[1]*lt[0],rt=Math.min(rt,vt),at=Math.max(at,vt),at-rt>wt(q,rn))break;F=q,dt=yt[0]*lt[0]+yt[1]*lt[1],dt>st?(st=dt,U=q,X=!1):dt<tt&&(tt=dt,W=q,X=!0)}if(X?(Kr(U),F!==W&&Kr(W)):(W!==H&&Kr(W),F!==U&&Kr(U)),Kr(F),V>=i.length||!q)break;Kr(q),H=q}}Mt&&jr([Tt||Mt[0],Lt||Mt[1]]),k.push(O.slice(0,N))}var Ce=A.slice(A.length-1);if(_&&Ce!=="h"&&Ce!=="v"){for(var $t=!1,ne=-1,Ct=[],gt=0;gt<k.length;gt++)for(var St=0;St<k[gt].length-1;St++){var Nt=k[gt][St],ee=k[gt][St+1],le=c.applyBackoff(ee,Nt);(le[0]!==ee[0]||le[1]!==ee[1])&&($t=!0),Ct[ne+1]||(ne++,Ct[ne]=[Nt,[le[0],le[1]]])}return $t?Ct:k}return k}}),Na=Ft((Q,$)=>{var c={tonextx:1,tonexty:1,tonext:1};$.exports=function(g,P,S){var t,e,r,a,n,o={},i=!1,s=-1,f=0,x=-1;for(e=0;e<S.length;e++)t=S[e][0].trace,r=t.stackgroup||"",r?r in o?n=o[r]:(n=o[r]=f,f++):t.fill in c&&x>=0?n=x:(n=x=f,f++),n<s&&(i=!0),t._groupIndex=s=n;var y=S.slice();i&&y.sort(function(T,u){var b=T[0].trace,_=u[0].trace;return b._groupIndex-_._groupIndex||b.index-_.index});var v={};for(e=0;e<y.length;e++)t=y[e][0].trace,r=t.stackgroup||"",t.visible===!0?(t._nexttrace=null,t.fill in c&&(a=v[r],t._prevtrace=a||null,a&&(a._nexttrace=t)),t._ownfill=t.fill&&(t.fill.substr(0,6)==="tozero"||t.fill==="toself"||t.fill.substr(0,2)==="to"&&!t._prevtrace),v[r]=t):t._prevtrace=t._nexttrace=t._ownfill=null;return y}}),Ya=Ft((Q,$)=>{var c=un(),g=Xo(),P=bn(),S=P.ensureSingle,t=P.identity,e=js(),r=Ac(),a=ji(),n=Na(),o=mm().tester;$.exports=function(x,y,v,T,u,b){var _,C,M=!u,E=!!u&&u.duration>0,A=n(x,y,v);if(_=T.selectAll("g.trace").data(A,function(p){return p[0].trace.uid}),_.enter().append("g").attr("class",function(p){return"trace scatter trace"+p[0].trace.uid}).style("stroke-miterlimit",2),_.order(),i(x,_,y),E){b&&(C=b());var h=c.transition().duration(u.duration).ease(u.easing).each("end",function(){C&&C()}).each("interrupt",function(){C&&C()});h.each(function(){T.selectAll("g.trace").each(function(p,k){s(x,k,y,p,A,this,u)})})}else _.each(function(p,k){s(x,k,y,p,A,this,u)});M&&_.exit().remove(),T.selectAll("path:not([d])").remove()};function i(x,y,v){y.each(function(T){var u=S(c.select(this),"g","fills");e.setClipUrl(u,v.layerClipId,x);var b=T[0].trace,_=[];b._ownfill&&_.push("_ownFill"),b._nexttrace&&_.push("_nextFill");var C=u.selectAll("g").data(_,t);C.enter().append("g"),C.exit().each(function(M){b[M]=null}).remove(),C.order().each(function(M){b[M]=S(c.select(this),"path","js-fill")})})}function s(x,y,v,T,u,b,_){var C=x._context.staticPlot,M;f(x,y,v,T,u);var E=!!_&&_.duration>0;function A(Hr){return E?Hr.transition():Hr}var h=v.xaxis,p=v.yaxis,k=T[0].trace,w=k.line,R=c.select(b),O=S(R,"g","errorbars"),N=S(R,"g","lines"),V=S(R,"g","points"),H=S(R,"g","text");if(g.getComponentMethod("errorbars","plot")(x,O,v,_),k.visible!==!0)return;A(R).style("opacity",k.opacity);var F,U,W=k.fill.charAt(k.fill.length-1);W!=="x"&&W!=="y"&&(W="");var q,X;W==="y"?(q=1,X=p.c2p(0,!0)):W==="x"&&(q=0,X=h.c2p(0,!0)),T[0][v.isRangePlot?"nodeRangePlot3":"node3"]=R;var lt="",yt=[],pt=k._prevtrace,st=null,tt=null;pt&&(lt=pt._prevRevpath||"",U=pt._nextFill,yt=pt._ownPolygons,st=pt._fillsegments,tt=pt._fillElement);var dt,rt,at="",vt="",it,Y,ft,ut,wt,zt,Pt=[];k._polygons=[];var Wt=[],Ht=[],Jt=P.noop;if(F=k._ownFill,r.hasLines(k)||k.fill!=="none"){U&&U.datum(T),["hv","vh","hvh","vhv"].indexOf(w.shape)!==-1?(it=e.steps(w.shape),Y=e.steps(w.shape.split("").reverse().join(""))):w.shape==="spline"?it=Y=function(Hr){var br=Hr[Hr.length-1];return Hr.length>1&&Hr[0][0]===br[0]&&Hr[0][1]===br[1]?e.smoothclosed(Hr.slice(1),w.smoothing):e.smoothopen(Hr,w.smoothing)}:it=Y=function(Hr){return"M"+Hr.join("L")},ft=function(Hr){return Y(Hr.reverse())},Ht=a(T,{xaxis:h,yaxis:p,trace:k,connectGaps:k.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:k.fill}),Wt=new Array(Ht.length);var ge=0;for(M=0;M<Ht.length;M++){var he,de=Ht[M];!he||!W?(he=de.slice(),Wt[ge]=he,ge++):he.push.apply(he,de)}k._fillElement=null,k._fillExclusionElement=tt,k._fillsegments=Wt.slice(0,ge),Wt=k._fillsegments,Ht.length&&(ut=Ht[0][0].slice(),wt=Ht[Ht.length-1],zt=wt[wt.length-1].slice()),Jt=function(Hr){return function(br){if(dt=it(br),rt=ft(br),at?W?(at+="L"+dt.substr(1),vt=rt+("L"+vt.substr(1))):(at+="Z"+dt,vt=rt+"Z"+vt):(at=dt,vt=rt),r.hasLines(k)){var Kr=c.select(this);if(Kr.datum(T),Hr)A(Kr.style("opacity",0).attr("d",dt).call(e.lineGroupStyle)).style("opacity",1);else{var rn=A(Kr);rn.attr("d",dt),e.singleLineStyle(T,rn)}}}}}var se=N.selectAll(".js-line").data(Ht);A(se.exit()).style("opacity",0).remove(),se.each(Jt(!1)),se.enter().append("path").classed("js-line",!0).style("vector-effect",C?"none":"non-scaling-stroke").call(e.lineGroupStyle).each(Jt(!0)),e.setClipUrl(se,v.layerClipId,x);function Tt(Hr){A(Hr).attr("d","M0,0Z")}var Lt=function(){var Hr=new Array(Wt.length);for(M=0;M<Wt.length;M++)Hr[M]=o(Wt[M]);return Hr},Mt=function(Hr){var br,Kr;if(!Hr||Hr.length===0)for(br=new Array(Wt.length),Kr=0;Kr<Wt.length;Kr++){var rn=Wt[Kr][0].slice(),Ce=Wt[Kr][Wt[Kr].length-1].slice();rn[q]=Ce[q]=X;var $t=[Ce,rn],ne=$t.concat(Wt[Kr]);br[Kr]=o(ne)}else{for(br=new Array(Hr.length-1+Wt.length),Kr=0;Kr<Hr.length-1;Kr++)br[Kr]=o(Hr[Kr]);var Ct=Hr[Hr.length-1].slice();for(Ct.reverse(),Kr=0;Kr<Wt.length;Kr++)br[Hr.length-1+Kr]=o(Wt[Kr].concat(Ct))}return br};Ht.length?(F?(F.datum(T),ut&&zt&&(W?(ut[q]=zt[q]=X,A(F).attr("d","M"+zt+"L"+ut+"L"+at.substr(1)).call(e.singleFillStyle,x),Pt=Mt(null)):(A(F).attr("d",at+"Z").call(e.singleFillStyle,x),Pt=Lt())),k._polygons=Pt,k._fillElement=F):U&&(k.fill.substr(0,6)==="tonext"&&at&&lt?(k.fill==="tonext"?(A(U).attr("d",at+"Z"+lt+"Z").call(e.singleFillStyle,x),Pt=Lt(),k._polygons=Pt.concat(yt)):(A(U).attr("d",at+"L"+lt.substr(1)+"Z").call(e.singleFillStyle,x),Pt=Mt(st),k._polygons=Pt),k._fillElement=U):Tt(U)),k._prevRevpath=vt):(F?Tt(F):U&&Tt(U),k._prevRevpath=null),k._ownPolygons=Pt;function te(Hr){return Hr.filter(function(br){return!br.gap&&br.vis})}function ve(Hr){return Hr.filter(function(br){return br.vis})}function oe(Hr){return Hr.filter(function(br){return!br.gap})}function Te(Hr){return Hr.id}function He(Hr){if(Hr.ids)return Te}function Ge(){return!1}function cr(Hr,br,Kr){var rn,Ce,$t,ne=Kr[0].trace,Ct=r.hasMarkers(ne),gt=r.hasText(ne),St=He(ne),Nt=Ge,ee=Ge;if(Ct||gt){var le=t,we=ne.stackgroup,Ue=we&&x._fullLayout._scatterStackOpts[h._id+p._id][we].stackgaps==="infer zero";ne.marker.maxdisplayed||ne._needsCull?le=Ue?ve:te:we&&!Ue&&(le=oe),Ct&&(Nt=le),gt&&(ee=le)}Ce=Hr.selectAll("path.point"),rn=Ce.data(Nt,St);var qe=rn.enter().append("path").classed("point",!0);E&&qe.call(e.pointStyle,ne,x).call(e.translatePoints,h,p).style("opacity",0).transition().style("opacity",1),rn.order();var ar;Ct&&(ar=e.makePointStyleFns(ne)),rn.each(function(Ar){var Tr=c.select(this),pr=A(Tr);$t=e.translatePoint(Ar,pr,h,p),$t?(e.singlePointStyle(Ar,pr,ne,ar,x),v.layerClipId&&e.hideOutsideRangePoint(Ar,pr,h,p,ne.xcalendar,ne.ycalendar),ne.customdata&&Tr.classed("plotly-customdata",Ar.data!==null&&Ar.data!==void 0)):pr.remove()}),E?rn.exit().transition().style("opacity",0).remove():rn.exit().remove(),Ce=br.selectAll("g"),rn=Ce.data(ee,St),rn.enter().append("g").classed("textpoint",!0).append("text"),rn.order(),rn.each(function(Ar){var Tr=c.select(this),pr=A(Tr.select("text"));$t=e.translatePoint(Ar,pr,h,p),$t?v.layerClipId&&e.hideOutsideRangePoint(Ar,Tr,h,p,ne.xcalendar,ne.ycalendar):Tr.remove()}),rn.selectAll("text").call(e.textPointStyle,ne,x).each(function(Ar){var Tr=h.c2p(Ar.x),pr=p.c2p(Ar.y);c.select(this).selectAll("tspan.line").each(function(){A(c.select(this)).attr({x:Tr,y:pr})})}),rn.exit().remove()}V.datum(T),H.datum(T),cr(V,H,T);var ur=k.cliponaxis===!1,jr=ur?null:v.layerClipId;e.setClipUrl(V,jr,x),e.setClipUrl(H,jr,x)}function f(x,y,v,T,u){var b=v.xaxis,_=v.yaxis,C=c.extent(P.simpleMap(b.range,b.r2c)),M=c.extent(P.simpleMap(_.range,_.r2c)),E=T[0].trace;if(r.hasMarkers(E)){var A=E.marker.maxdisplayed;if(A!==0){var h=T.filter(function(R){return R.x>=C[0]&&R.x<=C[1]&&R.y>=M[0]&&R.y<=M[1]}),p=Math.ceil(h.length/A),k=0;u.forEach(function(R,O){var N=R[0].trace;r.hasMarkers(N)&&N.marker.maxdisplayed>0&&O<y&&k++});var w=Math.round(k*p/3+Math.floor(k/3)*p/7.1);T.forEach(function(R){delete R.vis}),h.forEach(function(R,O){Math.round((O+w)%p)===0&&(R.vis=!0)})}}}}),xo=Ft((Q,$)=>{$.exports={container:"marker",min:"cmin",max:"cmax"}}),Vs=Ft((Q,$)=>{var c=Es();$.exports=function(g,P,S){var t={},e={_fullLayout:S},r=c.getFromTrace(e,P,"x"),a=c.getFromTrace(e,P,"y"),n=g.orig_x;n===void 0&&(n=g.x);var o=g.orig_y;return o===void 0&&(o=g.y),t.xLabel=c.tickText(r,r.c2l(n),!0).text,t.yLabel=c.tickText(a,a.c2l(o),!0).text,t}}),xl=Ft((Q,$)=>{var c=un(),g=js(),P=Xo();function S(a){var n=c.select(a).selectAll("g.trace.scatter");n.style("opacity",function(o){return o[0].trace.opacity}),n.selectAll("g.points").each(function(o){var i=c.select(this),s=o.trace||o[0].trace;t(i,s,a)}),n.selectAll("g.text").each(function(o){var i=c.select(this),s=o.trace||o[0].trace;e(i,s,a)}),n.selectAll("g.trace path.js-line").call(g.lineGroupStyle),n.selectAll("g.trace path.js-fill").call(g.fillGroupStyle,a,!1),P.getComponentMethod("errorbars","style")(n)}function t(a,n,o){g.pointStyle(a.selectAll("path.point"),n,o)}function e(a,n,o){g.textPointStyle(a.selectAll("text"),n,o)}function r(a,n,o){var i=n[0].trace;i.selectedpoints?(g.selectedPointStyle(o.selectAll("path.point"),i),g.selectedTextStyle(o.selectAll("text"),i)):(t(o,i,a),e(o,i,a))}$.exports={style:S,stylePoints:t,styleText:e,styleOnSelect:r}}),Du=Ft((Q,$)=>{var c=li(),g=Ac();$.exports=function(P,S){var t,e;if(P.mode==="lines")return t=P.line.color,t&&c.opacity(t)?t:P.fillcolor;if(P.mode==="none")return P.fill?P.fillcolor:"";var r=S.mcc||(P.marker||{}).color,a=S.mlcc||((P.marker||{}).line||{}).color;return e=r&&c.opacity(r)?r:a&&c.opacity(a)&&(S.mlw||((P.marker||{}).line||{}).width)?a:"",e?c.opacity(e)<.3?c.addOpacity(e,.3):e:(t=(P.line||{}).color,t&&c.opacity(t)&&g.hasLines(P)&&P.line.width?t:P.fillcolor)}}),Sd=Ft((Q,$)=>{var c=bn(),g=Qh(),P=Xo(),S=Du(),t=li(),e=c.fillText;$.exports=function(r,a,n,o){var i=r.cd,s=i[0].trace,f=r.xa,x=r.ya,y=f.c2p(a),v=x.c2p(n),T=[y,v],u=s.hoveron||"",b=s.mode.indexOf("markers")!==-1?3:.5,_=!!s.xperiodalignment,C=!!s.yperiodalignment;if(u.indexOf("points")!==-1){var M=function(lt){if(_){var yt=f.c2p(lt.xStart),pt=f.c2p(lt.xEnd);return y>=Math.min(yt,pt)&&y<=Math.max(yt,pt)?0:1/0}var st=Math.max(3,lt.mrc||0),tt=1-1/st,dt=Math.abs(f.c2p(lt.x)-y);return dt<st?tt*dt/st:dt-st+tt},E=function(lt){if(C){var yt=x.c2p(lt.yStart),pt=x.c2p(lt.yEnd);return v>=Math.min(yt,pt)&&v<=Math.max(yt,pt)?0:1/0}var st=Math.max(3,lt.mrc||0),tt=1-1/st,dt=Math.abs(x.c2p(lt.y)-v);return dt<st?tt*dt/st:dt-st+tt},A=function(lt){var yt=Math.max(b,lt.mrc||0),pt=f.c2p(lt.x)-y,st=x.c2p(lt.y)-v;return Math.max(Math.sqrt(pt*pt+st*st)-yt,1-b/yt)},h=g.getDistanceFunction(o,M,E,A);if(g.getClosest(i,h,r),r.index!==!1){var p=i[r.index],k=f.c2p(p.x,!0),w=x.c2p(p.y,!0),R=p.mrc||1;r.index=p.i;var O=i[0].t.orientation,N=O&&(p.sNorm||p.s),V=O==="h"?N:p.orig_x!==void 0?p.orig_x:p.x,H=O==="v"?N:p.orig_y!==void 0?p.orig_y:p.y;return c.extendFlat(r,{color:S(s,p),x0:k-R,x1:k+R,xLabelVal:V,y0:w-R,y1:w+R,yLabelVal:H,spikeDistance:A(p),hovertemplate:s.hovertemplate}),e(p,s,r),P.getComponentMethod("errorbars","hoverInfo")(p,s,r),[r]}}function F(lt){if(!lt)return!1;var yt=lt.node();try{var pt=new DOMPoint(T[0],T[1]);return yt.isPointInFill(pt)}catch{var st=yt.ownerSVGElement.createSVGPoint();return st.x=T[0],st.y=T[1],yt.isPointInFill(st)}}function U(lt){var yt,pt=[],st=1/0,tt=-1/0,dt=1/0,rt=-1/0,at;for(yt=0;yt<lt.length;yt++){var vt=lt[yt];vt.contains(T)&&(pt.push(vt),dt=Math.min(dt,vt.ymin),rt=Math.max(rt,vt.ymax))}if(pt.length===0)return null;dt=Math.max(dt,0),rt=Math.min(rt,x._length),at=(dt+rt)/2;var it,Y,ft,ut,wt,zt,Pt;for(yt=0;yt<pt.length;yt++)for(Y=pt[yt].pts,it=1;it<Y.length;it++)zt=Y[it-1][1],Pt=Y[it][1],zt>at!=Pt>=at&&(ut=Y[it-1][0],wt=Y[it][0],Pt-zt&&(ft=ut+(wt-ut)*(at-zt)/(Pt-zt),st=Math.min(st,ft),tt=Math.max(tt,ft)));return st=Math.max(st,0),tt=Math.min(tt,f._length),{x0:st,x1:tt,y0:at,y1:at}}if(u.indexOf("fills")!==-1&&s._fillElement){var W=F(s._fillElement)&&!F(s._fillExclusionElement);if(W){var q=U(s._polygons);q===null&&(q={x0:T[0],x1:T[0],y0:T[1],y1:T[1]});var X=t.defaultLine;return t.opacity(s.fillcolor)?X=s.fillcolor:t.opacity((s.line||{}).color)&&(X=s.line.color),c.extendFlat(r,{distance:r.maxHoverDistance,x0:q.x0,x1:q.x1,y0:q.y0,y1:q.y1,color:X,hovertemplate:!1}),delete r.index,s.text&&!c.isArrayOrTypedArray(s.text)?r.text=String(s.text):r.text=s.name,[r]}}}}),Bf=Ft((Q,$)=>{var c=Ac();$.exports=function(g,P){var S=g.cd,t=g.xaxis,e=g.yaxis,r=[],a=S[0].trace,n,o,i,s,f=!c.hasMarkers(a)&&!c.hasText(a);if(f)return[];if(P===!1)for(n=0;n<S.length;n++)S[n].selected=0;else for(n=0;n<S.length;n++)o=S[n],i=t.c2p(o.x),s=e.c2p(o.y),o.i!==null&&P.contains([i,s],!1,n,g)?(r.push({pointNumber:o.i,x:t.c2d(o.x),y:e.c2d(o.y)}),o.selected=1):o.selected=0;return r}}),_0=Ft((Q,$)=>{$.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}),wp=Ft((Q,$)=>{var c=Xo().traceIs,g=dv();$.exports=function(r,a,n,o){n("autotypenumbers",o.autotypenumbersDflt);var i=n("type",(o.splomStash||{}).type);i==="-"&&(P(a,o.data),a.type==="-"?a.type="linear":r.type=a.type)};function P(r,a){if(r.type==="-"){var n=r._id,o=n.charAt(0),i;n.indexOf("scene")!==-1&&(n=o);var s=S(a,n,o);if(s){if(s.type==="histogram"&&o==={v:"y",h:"x"}[s.orientation||"v"]){r.type="linear";return}var f=o+"calendar",x=s[f],y={noMultiCategory:!c(s,"cartesian")||c(s,"noMultiCategory")};if(s.type==="box"&&s._hasPreCompStats&&o==={h:"x",v:"y"}[s.orientation||"v"]&&(y.noMultiCategory=!0),y.autotypenumbers=r.autotypenumbers,e(s,o)){var v=t(s),T=[];for(i=0;i<a.length;i++){var u=a[i];!c(u,"box-violin")||(u[o+"axis"]||o)!==n||(u[v]!==void 0?T.push(u[v][0]):u.name!==void 0?T.push(u.name):T.push("text"),u[f]!==x&&(x=void 0))}r.type=g(T,x,y)}else if(s.type==="splom"){var b=s.dimensions,_=b[s._axesDim[n]];_.visible&&(r.type=g(_.values,x,y))}else r.type=g(s[o]||[s[o+"0"]],x,y)}}}function S(r,a,n){for(var o=0;o<r.length;o++){var i=r[o];if(i.type==="splom"&&i._length>0&&(i["_"+n+"axes"]||{})[a]||(i[n+"axis"]||n)===a&&(e(i,n)||(i[n]||[]).length||i[n+"0"]))return i}}function t(r){return{v:"x",h:"y"}[r.orientation||"v"]}function e(r,a){var n=t(r),o=c(r,"box-violin"),i=c(r._fullInput||{},"candlestick");return o&&!i&&a===n&&r[n]===void 0&&r[n+"0"]===void 0}}),jm=Ft((Q,$)=>{var c=Va().isTypedArraySpec;function g(P,S){var t=S.dataAttr||P._id.charAt(0),e={},r,a,n;if(S.axData)r=S.axData;else for(r=[],a=0;a<S.data.length;a++){var o=S.data[a];o[t+"axis"]===P._id&&r.push(o)}for(a=0;a<r.length;a++){var i=r[a][t];for(n=0;n<i.length;n++){var s=i[n];s!=null&&(e[s]=1)}}return Object.keys(e)}$.exports=function(P,S,t,e){if(S.type==="category"){var r=P.categoryarray,a=Array.isArray(r)&&r.length>0||c(r),n;a&&(n="array");var o=t("categoryorder",n),i;o==="array"&&(i=t("categoryarray")),!a&&o==="array"&&(o=S.categoryorder="trace"),o==="trace"?S._initialCategories=[]:o==="array"?S._initialCategories=i.slice():(i=g(S,e).sort(),o==="category ascending"?S._initialCategories=i:o==="category descending"&&(S._initialCategories=i.reverse()))}}}),Yy=Ft((Q,$)=>{var c=fo().mix,g=bi(),P=bn();$.exports=function(S,t,e,r){r=r||{};var a=r.dfltColor;function n(p,k){return P.coerce2(S,t,r.attributes,p,k)}var o=n("linecolor",a),i=n("linewidth"),s=e("showline",r.showLine||!!o||!!i);s||(delete t.linecolor,delete t.linewidth);var f=c(a,r.bgColor,r.blend||g.lightFraction).toRgbString(),x=n("gridcolor",f),y=n("gridwidth"),v=n("griddash"),T=e("showgrid",r.showGrid||!!x||!!y||!!v);if(T||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),r.hasMinor){var u=c(t.gridcolor,r.bgColor,67).toRgbString(),b=n("minor.gridcolor",u),_=n("minor.gridwidth",t.gridwidth||1),C=n("minor.griddash",t.griddash||"solid"),M=e("minor.showgrid",!!b||!!_||!!C);M||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!r.noZeroLine){n("zerolinelayer");var E=n("zerolinecolor",a),A=n("zerolinewidth"),h=e("zeroline",r.showGrid||!!E||!!A);h||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}),Ky=Ft((Q,$)=>{var c=ra(),g=Xo(),P=bn(),S=pu(),t=Md(),e=Ad(),r=mg(),a=gg(),n=n0(),o=dm(),i=jm(),s=Yy(),f=E_(),x=i0(),y=ic().WEEKDAY_PATTERN,v=ic().HOUR_PATTERN;$.exports=function(_,C,M,E,A){var h=E.letter,p=E.font||{},k=E.splomStash||{},w=M("visible",!E.visibleDflt),R=C._template||{},O=C.type||R.type||"-",N;if(O==="date"){var V=g.getComponentMethod("calendars","handleDefaults");V(_,C,"calendar",E.calendar),E.noTicklabelmode||(N=M("ticklabelmode"))}!E.noTicklabelindex&&(O==="date"||O==="linear")&&M("ticklabelindex");var H="";(!E.noTicklabelposition||O==="multicategory")&&(H=P.coerce(_,C,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:N==="period"?["outside","inside"]:h==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),E.noTicklabeloverflow||M("ticklabeloverflow",H.indexOf("inside")!==-1?"hide past domain":O==="category"||O==="multicategory"?"allow":"hide past div"),x(C,A),f(_,C,M,E),i(_,C,M,E),E.noHover||(O!=="category"&&M("hoverformat"),E.noUnifiedhovertitle||M("unifiedhovertitle.text"));var F=M("color"),U=F!==e.color.dflt?F:p.color,W=k.label||A._dfltTitle[h];if(o(_,C,M,O,E),!w)return C;M("title.text",W),P.coerceFont(M,"title.font",p,{overrideDflt:{size:P.bigFont(p.size),color:U}}),r(_,C,M,O);var q=E.hasMinor;if(q&&(S.newContainer(C,"minor"),r(_,C,M,O,{isMinor:!0})),n(_,C,M,O,E),a(_,C,M,E),q){var X=E.isMinor;E.isMinor=!0,a(_,C,M,E),E.isMinor=X}s(_,C,M,{dfltColor:F,bgColor:E.bgColor,showGrid:E.showGrid,hasMinor:q,attributes:e}),q&&!C.minor.ticks&&!C.minor.showgrid&&delete C.minor,(C.showline||C.ticks)&&M("mirror");var lt=O==="multicategory";if(!E.noTickson&&(O==="category"||lt)&&(C.ticks||C.showgrid)&&(lt?(M("tickson","boundaries"),delete C.ticklabelposition):M("tickson")),lt){var yt=M("showdividers");yt&&(M("dividercolor"),M("dividerwidth"))}if(O==="date")if(t(_,C,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!C.rangebreaks.length)delete C.rangebreaks;else{for(var pt=0;pt<C.rangebreaks.length;pt++)if(C.rangebreaks[pt].pattern===y){C._hasDayOfWeekBreaks=!0;break}if(x(C,A),A._has("scattergl")||A._has("splom"))for(var st=0;st<E.data.length;st++){var tt=E.data[st];(tt.type==="scattergl"||tt.type==="splom")&&(tt.visible=!1,P.warn(tt.type+" traces do not work on axes with rangebreaks. Setting trace "+tt.index+" to `visible: false`."))}}return C};function T(_,C,M){function E(V,H){return P.coerce(_,C,e.rangebreaks,V,H)}var A=E("enabled");if(A){var h=E("bounds");if(h&&h.length>=2){var p="",k,w;if(h.length===2){for(k=0;k<2;k++)if(w=b(h[k]),w){p=y;break}}var R=E("pattern",p);if(R===y)for(k=0;k<2;k++)w=b(h[k]),w&&(C.bounds[k]=h[k]=w-1);if(R)for(k=0;k<2;k++)switch(w=h[k],R){case y:if(!c(w)){C.enabled=!1;return}if(w=+w,w!==Math.floor(w)||w<0||w>=7){C.enabled=!1;return}C.bounds[k]=h[k]=w;break;case v:if(!c(w)){C.enabled=!1;return}if(w=+w,w<0||w>24){C.enabled=!1;return}C.bounds[k]=h[k]=w;break}if(M.autorange===!1){var O=M.range;if(O[0]<O[1]){if(h[0]<O[0]&&h[1]>O[1]){C.enabled=!1;return}}else if(h[0]>O[0]&&h[1]<O[1]){C.enabled=!1;return}}}else{var N=E("values");if(N&&N.length)E("dvalue");else{C.enabled=!1;return}}}}var u={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function b(_){if(typeof _=="string")return u[_.substr(0,3).toLowerCase()]}}),Z_=Ft((Q,$)=>{var c=ra(),g=bn();$.exports=function(P,S,t,e){var r=e.counterAxes||[],a=e.overlayableAxes||[],n=e.letter,o=e.grid,i=e.overlayingDomain,s,f,x,y,v,T;o&&(f=o._domains[n][o._axisMap[S._id]],s=o._anchors[S._id],f&&(x=o[n+"side"].split(" ")[0],y=o.domain[n][x==="right"||x==="top"?1:0])),f=f||[0,1],s=s||(c(P.position)?"free":r[0]||"free"),x=x||(n==="x"?"bottom":"left"),y=y||0,v=0,T=!1;var u=g.coerce(P,S,{anchor:{valType:"enumerated",values:["free"].concat(r),dflt:s}},"anchor"),b=g.coerce(P,S,{side:{valType:"enumerated",values:n==="x"?["bottom","top"]:["left","right"],dflt:x}},"side");if(u==="free"){if(n==="y"){var _=t("autoshift");_&&(y=b==="left"?i[0]:i[1],T=S.automargin?S.automargin:!0,v=b==="left"?-3:3),t("shift",v)}t("position",y)}t("automargin",T);var C=!1;if(a.length&&(C=g.coerce(P,S,{overlaying:{valType:"enumerated",values:[!1].concat(a),dflt:!1}},"overlaying")),!C){var M=t("domain",f);M[0]>M[1]-1/4096&&(S.domain=f),g.noneOrAll(P.domain,S.domain,f),S.tickmode==="sync"&&(S.tickmode="auto")}return t("layer"),S}}),Iw=Ft((Q,$)=>{var c=bn(),g=li(),P=Dp().isUnifiedHover,S=pv(),t=pu(),e=x1(),r=Ad(),a=wp(),n=Ky(),o=vv(),i=Z_(),s=Rc(),f=s.id2name,x=s.name2id,y=ic().AX_ID_PATTERN,v=Xo(),T=v.traceIs,u=v.getComponentMethod;function b(_,C,M){Array.isArray(_[C])?_[C].push(M):_[C]=[M]}$.exports=function(_,C,M){var E=C.autotypenumbers,A={},h={},p={},k={},w={},R={},O={},N={},V={},H={},F,U;for(F=0;F<M.length;F++){var W=M[F];if(T(W,"cartesian")){var q;if(W.xaxis)q=f(W.xaxis),b(A,q,W);else if(W.xaxes)for(U=0;U<W.xaxes.length;U++)b(A,f(W.xaxes[U]),W);var X;if(W.yaxis)X=f(W.yaxis),b(A,X,W);else if(W.yaxes)for(U=0;U<W.yaxes.length;U++)b(A,f(W.yaxes[U]),W);if(W.type==="funnel"?W.orientation==="h"?(q&&(h[q]=!0),X&&(O[X]=!0)):X&&(p[X]=!0):W.type==="image"?(X&&(N[X]=!0),q&&(N[q]=!0)):(X&&(w[X]=!0,R[X]=!0),(!T(W,"carpet")||W.type==="carpet"&&!W._cheater)&&q&&(k[q]=!0)),W.type==="carpet"&&W._cheater&&q&&(h[q]=!0),T(W,"2dMap")&&(V[q]=!0,V[X]=!0),T(W,"oriented")){var lt=W.orientation==="h"?X:q;H[lt]=!0}}}var yt=C._subplots,pt=yt.xaxis,st=yt.yaxis,tt=c.simpleMap(pt,f),dt=c.simpleMap(st,f),rt=tt.concat(dt),at=g.background;pt.length&&st.length&&(at=c.coerce(_,C,e,"plot_bgcolor"));var vt=g.combine(at,C.paper_bgcolor),it,Y,ft,ut,wt;function zt(){var St=A[it]||[];wt._traceIndices=St.map(function(Nt){return Nt.index}),wt._annIndices=[],wt._shapeIndices=[],wt._selectionIndices=[],wt._imgIndices=[],wt._subplotsWith=[],wt._counterAxes=[],wt._name=wt._attr=it,wt._id=Y}function Pt(St,Nt){return c.coerce(ut,wt,r,St,Nt)}function Wt(St,Nt){return c.coerce2(ut,wt,r,St,Nt)}function Ht(St){return St==="x"?st:pt}function Jt(St,Nt){for(var ee=St==="x"?tt:dt,le=[],we=0;we<ee.length;we++){var Ue=ee[we];Ue!==Nt&&!(_[Ue]||{}).overlaying&&le.push(x(Ue))}return le}var ge={x:Ht("x"),y:Ht("y")},he=ge.x.concat(ge.y),de={},se=[];function Tt(){var St=ut.matches;y.test(St)&&he.indexOf(St)===-1&&(de[St]=ut.type,se=Object.keys(de))}var Lt=S(_,C),Mt=P(Lt);for(F=0;F<rt.length;F++){it=rt[F],Y=x(it),ft=it.charAt(0),c.isPlainObject(_[it])||(_[it]={}),ut=_[it],wt=t.newContainer(C,it,ft+"axis"),zt();var te=ft==="x"&&!k[it]&&h[it]||ft==="y"&&!w[it]&&p[it],ve=ft==="y"&&(!R[it]&&O[it]||N[it]),oe={hasMinor:!0,letter:ft,font:C.font,outerTicks:V[it],showGrid:!H[it],data:A[it]||[],bgColor:vt,calendar:C.calendar,automargin:!0,visibleDflt:te,reverseDflt:ve,autotypenumbersDflt:E,splomStash:((C._splomAxes||{})[ft]||{})[Y],noAutotickangles:ft==="y"};Pt("uirevision",C.uirevision),a(ut,wt,Pt,oe),n(ut,wt,Pt,oe,C);var Te=Mt&&ft===Lt.charAt(0),He=Wt("spikecolor",Mt?wt.color:void 0),Ge=Wt("spikethickness",Mt?1.5:void 0),cr=Wt("spikedash",Mt?"dot":void 0),ur=Wt("spikemode",Mt?"across":void 0),jr=Wt("spikesnap"),Hr=Pt("showspikes",!!Te||!!He||!!Ge||!!cr||!!ur||!!jr);Hr||(delete wt.spikecolor,delete wt.spikethickness,delete wt.spikedash,delete wt.spikemode,delete wt.spikesnap);var br=f(ut.overlaying),Kr=[0,1];if(C[br]!==void 0){var rn=f(C[br].anchor);C[rn]!==void 0&&(Kr=C[rn].domain)}i(ut,wt,Pt,{letter:ft,counterAxes:ge[ft],overlayableAxes:Jt(ft,it),grid:C.grid,overlayingDomain:Kr}),Pt("title.standoff"),Tt(),wt._input=ut}for(F=0;F<se.length;){Y=se[F++],it=f(Y),ft=it.charAt(0),c.isPlainObject(_[it])||(_[it]={}),ut=_[it],wt=t.newContainer(C,it,ft+"axis"),zt();var Ce={letter:ft,font:C.font,outerTicks:V[it],showGrid:!H[it],data:[],bgColor:vt,calendar:C.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:E,splomStash:((C._splomAxes||{})[ft]||{})[Y]};Pt("uirevision",C.uirevision),wt.type=de[Y]||"linear",n(ut,wt,Pt,Ce,C),i(ut,wt,Pt,{letter:ft,counterAxes:ge[ft],overlayableAxes:Jt(ft,it),grid:C.grid}),Pt("fixedrange"),Pt("modebardisable"),Tt(),wt._input=ut}var $t=u("rangeslider","handleDefaults"),ne=u("rangeselector","handleDefaults");for(F=0;F<tt.length;F++)it=tt[F],ut=_[it],wt=C[it],$t(_,C,it),wt.type==="date"&&ne(ut,wt,C,dt,wt.calendar),Pt("fixedrange"),Pt("modebardisable");for(F=0;F<dt.length;F++){it=dt[F],ut=_[it],wt=C[it];var Ct=C[f(wt.anchor)],gt=u("rangeslider","isVisible")(Ct);Pt("fixedrange",gt),Pt("modebardisable")}o.handleDefaults(_,C,{axIds:he.concat(se).sort(s.idSort),axHasImage:N})}}),b6=Ft((Q,$)=>{var c=un(),g=Xo(),P=bn(),S=js(),t=Es();$.exports=function(e,r,a,n){var o=e._fullLayout;if(r.length===0){t.redrawComponents(e);return}function i(C){var M=C.xaxis,E=C.yaxis;o._defs.select("#"+C.clipId+"> rect").call(S.setTranslate,0,0).call(S.setScale,1,1),C.plot.call(S.setTranslate,M._offset,E._offset).call(S.setScale,1,1);var A=C.plot.selectAll(".scatterlayer .trace");A.selectAll(".point").call(S.setPointGroupScale,1,1),A.selectAll(".textpoint").call(S.setTextPointsScale,1,1),A.call(S.hideOutsideRangePoints,C)}function s(C,M){var E=C.plotinfo,A=E.xaxis,h=E.yaxis,p=A._length,k=h._length,w=!!C.xr1,R=!!C.yr1,O=[];if(w){var N=P.simpleMap(C.xr0,A.r2l),V=P.simpleMap(C.xr1,A.r2l),H=N[1]-N[0],F=V[1]-V[0];O[0]=(N[0]*(1-M)+M*V[0]-N[0])/(N[1]-N[0])*p,O[2]=p*(1-M+M*F/H),A.range[0]=A.l2r(N[0]*(1-M)+M*V[0]),A.range[1]=A.l2r(N[1]*(1-M)+M*V[1])}else O[0]=0,O[2]=p;if(R){var U=P.simpleMap(C.yr0,h.r2l),W=P.simpleMap(C.yr1,h.r2l),q=U[1]-U[0],X=W[1]-W[0];O[1]=(U[1]*(1-M)+M*W[1]-U[1])/(U[0]-U[1])*k,O[3]=k*(1-M+M*X/q),h.range[0]=A.l2r(U[0]*(1-M)+M*W[0]),h.range[1]=h.l2r(U[1]*(1-M)+M*W[1])}else O[1]=0,O[3]=k;t.drawOne(e,A,{skipTitle:!0}),t.drawOne(e,h,{skipTitle:!0}),t.redrawComponents(e,[A._id,h._id]);var lt=w?p/O[2]:1,yt=R?k/O[3]:1,pt=w?O[0]:0,st=R?O[1]:0,tt=w?O[0]/O[2]*p:0,dt=R?O[1]/O[3]*k:0,rt=A._offset-tt,at=h._offset-dt;E.clipRect.call(S.setTranslate,pt,st).call(S.setScale,1/lt,1/yt),E.plot.call(S.setTranslate,rt,at).call(S.setScale,lt,yt),S.setPointGroupScale(E.zoomScalePts,1/lt,1/yt),S.setTextPointsScale(E.zoomScaleTxt,1/lt,1/yt)}var f;n&&(f=n());function x(){for(var C={},M=0;M<r.length;M++){var E=r[M],A=E.plotinfo.xaxis,h=E.plotinfo.yaxis;E.xr1&&(C[A._name+".range"]=E.xr1.slice()),E.yr1&&(C[h._name+".range"]=E.yr1.slice())}return f&&f(),g.call("relayout",e,C).then(function(){for(var p=0;p<r.length;p++)i(r[p].plotinfo)})}function y(){for(var C={},M=0;M<r.length;M++){var E=r[M],A=E.plotinfo.xaxis,h=E.plotinfo.yaxis;E.xr0&&(C[A._name+".range"]=E.xr0.slice()),E.yr0&&(C[h._name+".range"]=E.yr0.slice())}return g.call("relayout",e,C).then(function(){for(var p=0;p<r.length;p++)i(r[p].plotinfo)})}var v,T,u,b=c.ease(a.easing);e._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(u),u=null,y()});function _(){T=Date.now();for(var C=Math.min(1,(T-v)/a.duration),M=b(C),E=0;E<r.length;E++)s(r[E],M);T-v>a.duration?(x(),u=window.cancelAnimationFrame(_)):u=window.requestAnimationFrame(_)}return v=Date.now(),u=window.requestAnimationFrame(_),Promise.resolve()}}),Mf=Ft(Q=>{var $=un(),c=Xo(),g=bn(),P=Kc(),S=js(),t=ud().getModuleCalcData,e=Rc(),r=ic(),a=Op(),n=g.ensureSingle;function o(T,u,b){return g.ensureSingle(T,u,b,function(_){_.datum(b)})}var i=r.zindexSeparator;Q.name="cartesian",Q.attr=["xaxis","yaxis"],Q.idRoot=["x","y"],Q.idRegex=r.idRegex,Q.attrRegex=r.attrRegex,Q.attributes=_0(),Q.layoutAttributes=Ad(),Q.supplyLayoutDefaults=Iw(),Q.transitionAxes=b6(),Q.finalizeSubplots=function(T,u){var b=u._subplots,_=b.xaxis,C=b.yaxis,M=b.cartesian,E=M,A={},h={},p,k,w;for(p=0;p<E.length;p++){var R=E[p].split("y");A[R[0]]=1,h["y"+R[1]]=1}for(p=0;p<_.length;p++)k=_[p],A[k]||(w=(T[e.id2name(k)]||{}).anchor,r.idRegex.y.test(w)||(w="y"),M.push(k+w),E.push(k+w),h[w]||(h[w]=1,g.pushUnique(C,w)));for(p=0;p<C.length;p++)w=C[p],h[w]||(k=(T[e.id2name(w)]||{}).anchor,r.idRegex.x.test(k)||(k="x"),M.push(k+w),E.push(k+w),A[k]||(A[k]=1,g.pushUnique(_,k)));if(!E.length){k="",w="";for(var O in T)if(r.attrRegex.test(O)){var N=O.charAt(0);N==="x"?(!k||+O.substr(5)<+k.substr(5))&&(k=O):(!w||+O.substr(5)<+w.substr(5))&&(w=O)}k=k?e.name2id(k):"x",w=w?e.name2id(w):"y",_.push(k),C.push(w),M.push(k+w)}},Q.plot=function(T,u,b,_){var C=T._fullLayout,M=C._subplots.cartesian,E=T.calcdata,A;if(!Array.isArray(u))for(u=[],A=0;A<E.length;A++)u.push(A);for(var h=C._zindices,p=0;p<h.length;p++){var k=h[p];for(A=0;A<M.length;A++){var w=M[A],R=C._plots[w];if(p>0){var O=R.id;if(O.indexOf(i)!==-1)continue;O+=i+(p+1),R=g.extendFlat({},R,{id:O,plot:C._cartesianlayer.selectAll(".subplot").select("."+O)})}for(var N=[],V,H=0;H<E.length;H++){var F=E[H],U=F[0].trace;k===(U.zorder||0)&&U.xaxis+U.yaxis===w&&((u.indexOf(U.index)!==-1||U.carpet)&&(V&&V[0].trace.xaxis+V[0].trace.yaxis===w&&["tonextx","tonexty","tonext"].indexOf(U.fill)!==-1&&N.indexOf(V)===-1&&N.push(V),N.push(F)),V=F)}s(T,R,N,b,_)}}};function s(T,u,b,_,C){for(var M=r.traceLayerClasses,E=T._fullLayout,A=E._zindices,h=E._modules,p,k,w,R=[],O=[],N=0;N<A.length;N++)for(var V=A[N],H=0;H<h.length;H++){p=h[H];var F=p.name,U=c.modules[F].categories;if(U.svg){var W=p.layerName||F+"layer",q=W+(N?Number(N)+1:""),X=p.plot;k=t(b,X,V),w=k[0],b=k[1],w.length&&R.push({i:M.indexOf(W),zindex:N,className:q,plotMethod:X,cdModule:w}),U.zoomScale&&O.push("."+q)}}R.sort(function(pt,st){return(pt.zindex||0)-(st.zindex||0)||pt.i-st.i});var lt=u.plot.selectAll("g.mlayer").data(R,function(pt){return pt.className});if(lt.enter().append("g").attr("class",function(pt){return pt.className}).classed("mlayer",!0).classed("rangeplot",u.isRangePlot),lt.exit().remove(),lt.order(),lt.each(function(pt){var st=$.select(this),tt=pt.className;pt.plotMethod(T,u,pt.cdModule,st,_,C),r.clipOnAxisFalseQuery.indexOf("."+tt)===-1&&S.setClipUrl(st,u.layerClipId,T)}),E._has("scattergl")&&(p=c.getModule("scattergl"),w=t(b,p)[0],p.plot(T,u,w)),!T._context.staticPlot&&(u._hasClipOnAxisFalse&&(u.clipOnAxisFalseTraces=u.plot.selectAll(r.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),O.length)){var yt=u.plot.selectAll(O.join(",")).selectAll(".trace");u.zoomScalePts=yt.selectAll("path.point"),u.zoomScaleTxt=yt.selectAll(".textpoint")}}Q.clean=function(T,u,b,_){var C=_._plots||{},M=u._plots||{},E=_._subplots||{},A,h,p;if(_._hasOnlyLargeSploms&&!u._hasOnlyLargeSploms)for(p in C)A=C[p],A.plotgroup&&A.plotgroup.remove();var k=_._has&&_._has("gl"),w=u._has&&u._has("gl");if(k&&!w)for(p in C)A=C[p],A._scene&&A._scene.destroy();if(E.xaxis&&E.yaxis){var R=e.listIds({_fullLayout:_});for(h=0;h<R.length;h++){var O=R[h];u[e.id2name(O)]||_._infolayer.selectAll(".g-"+O+"title").remove()}}var N=_._has&&_._has("cartesian"),V=u._has&&u._has("cartesian");if(N&&!V)y(_._cartesianlayer.selectAll(".subplot"),_),_._defs.selectAll(".axesclip").remove(),delete _._axisConstraintGroups,delete _._axisMatchGroups;else if(E.cartesian)for(h=0;h<E.cartesian.length;h++){var H=E.cartesian[h];if(H.indexOf(i)===-1&&!M[H]){var F="."+H+",."+H+"-x,."+H+"-y";_._cartesianlayer.selectAll(F).remove(),v(H,_)}}},Q.drawFramework=function(T){var u=T._fullLayout,b=T.calcdata,_,C={};for(_=0;_<b.length;_++){var M=b[_][0],E=M.trace,A=E.zorder||0;C[A]||(C[A]=[]),C[A].push(M)}var h=Object.keys(C).map(Number).sort(g.sorterAsc);h.length||(h=[0]),u._zindices=h;var p=f(T),k=p.length,w=[];for(_=0;_<k;_++)w[_]=p[_].slice();for(var R=1;R<h.length;R++){var O=[];for(_=0;_<k;_++)O[_]=p[_].slice(),O[_][0]+=i+(R+1);w=w.concat(O)}var N=u._cartesianlayer.selectAll(".subplot").data(w,String);N.enter().append("g").attr("class",function(V){return"subplot "+V[0]}),N.order(),N.exit().call(y,u),N.each(function(V){var H=V[0],F=H.indexOf(i),U=F!==-1,W=U?H.slice(0,F):H,q=u._plots[H];q||(q=g.extendFlat({},u._plots[W]),q&&(q.id=H,u._plots[H]=q,u._subplots.cartesian.push(H))),q&&(q.plotgroup=$.select(this),x(T,q),U||(q.draglayer=n(u._draggers,"g",H)))})},Q.rangePlot=function(T,u,b){x(T,u),s(T,u,b),P.style(T)};function f(T){var u=T._fullLayout,b=u._zindices.length,_=u._subplots.cartesian,C=_.length,M,E,A,h,p,k,w=[],R=[];for(M=0;M<C;M++){A=_[M],h=u._plots[A],p=h.xaxis,k=h.yaxis;var O=p._mainAxis,N=k._mainAxis,V=O._id+N._id,H=u._plots[V];h.overlays=[],V!==A&&H?(h.mainplot=V,h.mainplotinfo=H,R.push(A)):(h.mainplot=void 0,h.mainplotinfo=void 0,w.push(A))}for(M=0;M<R.length;M++)A=R[M],h=u._plots[A],h.mainplotinfo.overlays.push(h);var F=w.concat(R),U=[];for(M=0;M<C;M++){A=F[M],h=u._plots[A],p=h.xaxis,k=h.yaxis;for(var W=[],q=1;q<=b;q++){var X="";for(q>1&&(X+=i+q),W.push(A+X),E=0;E<h.overlays.length;E++)W.push(h.overlays[E].id+X)}W=W.concat([p.layer,k.layer,p.overlaying||"",k.overlaying||""]),U.push(W)}return U}function x(T,u){var b=T._fullLayout,_=u.plotgroup,C=u.id,M=C.indexOf(i),E=M!==-1,A=r.layerValue2layerClass[u.xaxis.layer],h=r.layerValue2layerClass[u.yaxis.layer],p=b._hasOnlyLargeSploms,k=b._zindices.length>1,w=u.mainplotinfo;if(!u.mainplot||k)if(p)u.xlines=n(_,"path","xlines-above"),u.ylines=n(_,"path","ylines-above"),u.xaxislayer=n(_,"g","xaxislayer-above"),u.yaxislayer=n(_,"g","yaxislayer-above");else{if(!E){var R=n(_,"g","layer-subplot");u.shapelayer=n(R,"g","shapelayer"),u.imagelayer=n(R,"g","imagelayer"),w&&k?(u.minorGridlayer=w.minorGridlayer,u.gridlayer=w.gridlayer,u.zerolinelayer=w.zerolinelayer):(u.minorGridlayer=n(_,"g","minor-gridlayer"),u.gridlayer=n(_,"g","gridlayer"),u.zerolinelayer=n(_,"g","zerolinelayer"));var O=n(_,"g","layer-between");u.shapelayerBetween=n(O,"g","shapelayer"),u.imagelayerBetween=n(O,"g","imagelayer"),n(_,"path","xlines-below"),n(_,"path","ylines-below"),u.overlinesBelow=n(_,"g","overlines-below"),n(_,"g","xaxislayer-below"),n(_,"g","yaxislayer-below"),u.overaxesBelow=n(_,"g","overaxes-below")}u.overplot=n(_,"g","overplot"),u.plot=n(u.overplot,"g",C),w&&k?u.zerolinelayerAbove=w.zerolinelayerAbove:u.zerolinelayerAbove=n(_,"g","zerolinelayer-above"),E||(u.xlines=n(_,"path","xlines-above"),u.ylines=n(_,"path","ylines-above"),u.overlinesAbove=n(_,"g","overlines-above"),n(_,"g","xaxislayer-above"),n(_,"g","yaxislayer-above"),u.overaxesAbove=n(_,"g","overaxes-above"),u.xlines=_.select(".xlines-"+A),u.ylines=_.select(".ylines-"+h),u.xaxislayer=_.select(".xaxislayer-"+A),u.yaxislayer=_.select(".yaxislayer-"+h))}else{var N=w.plotgroup,V=C+"-x",H=C+"-y";u.minorGridlayer=w.minorGridlayer,u.gridlayer=w.gridlayer,u.zerolinelayer=w.zerolinelayer,u.zerolinelayerAbove=w.zerolinelayerAbove,n(w.overlinesBelow,"path",V),n(w.overlinesBelow,"path",H),n(w.overaxesBelow,"g",V),n(w.overaxesBelow,"g",H),u.plot=n(w.overplot,"g",C),n(w.overlinesAbove,"path",V),n(w.overlinesAbove,"path",H),n(w.overaxesAbove,"g",V),n(w.overaxesAbove,"g",H),u.xlines=N.select(".overlines-"+A).select("."+V),u.ylines=N.select(".overlines-"+h).select("."+H),u.xaxislayer=N.select(".overaxes-"+A).select("."+V),u.yaxislayer=N.select(".overaxes-"+h).select("."+H)}E||(p||(o(u.minorGridlayer,"g",u.xaxis._id),o(u.minorGridlayer,"g",u.yaxis._id),u.minorGridlayer.selectAll("g").map(function(F){return F[0]}).sort(e.idSort),o(u.gridlayer,"g",u.xaxis._id),o(u.gridlayer,"g",u.yaxis._id),u.gridlayer.selectAll("g").map(function(F){return F[0]}).sort(e.idSort)),u.xlines.style("fill","none").classed("crisp",!0),u.ylines.style("fill","none").classed("crisp",!0))}function y(T,u){if(T){var b={};T.each(function(h){var p=h[0],k=$.select(this);k.remove(),v(p,u),b[p]=!0});for(var _ in u._plots)for(var C=u._plots[_],M=C.overlays||[],E=0;E<M.length;E++){var A=M[E];b[A.id]&&A.plot.selectAll(".trace").remove()}}}function v(T,u){u._draggers.selectAll("g."+T).remove(),u._defs.select("#clip"+u._uid+T+"plot").remove()}Q.toSVG=function(T){var u=T._fullLayout._glimages,b=$.select(T).selectAll(".svg-container"),_=b.filter(function(M,E){return E===b.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function C(){var M=this,E=M.toDataURL("image/png"),A=u.append("svg:image");A.attr({xmlns:a.svg,"xlink:href":E,preserveAspectRatio:"none",x:0,y:0,width:M.style.width,height:M.style.height})}_.each(C)},Q.updateFx=Aw().updateFx}),cd=Ft((Q,$)=>{var c=Ac();$.exports={hasLines:c.hasLines,hasMarkers:c.hasMarkers,hasText:c.hasText,isBubble:c.isBubble,attributes:tf(),layoutAttributes:pg(),supplyDefaults:Lw(),crossTraceDefaults:Pw(),supplyLayoutDefaults:zw(),calc:me().calc,crossTraceCalc:Tn(),arraysToCalcdata:ct(),plot:Ya(),colorbar:xo(),formatLabels:Vs(),style:xl().style,styleOnSelect:xl().styleOnSelect,hoverPoints:Sd(),selectPoints:Bf(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Mf(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}),Xy=Ft((Q,$)=>{var c=un(),g=li(),P=V_(),S=bn(),t=S.strScale,e=S.strRotate,r=S.strTranslate;$.exports=function(a,n,o){var i=a.node(),s=P[o.arrowhead||0],f=P[o.startarrowhead||0],x=(o.arrowwidth||1)*(o.arrowsize||1),y=(o.arrowwidth||1)*(o.startarrowsize||1),v=n.indexOf("start")>=0,T=n.indexOf("end")>=0,u=s.backoff*x+o.standoff,b=f.backoff*y+o.startstandoff,_,C,M,E;if(i.nodeName==="line"){_={x:+a.attr("x1"),y:+a.attr("y1")},C={x:+a.attr("x2"),y:+a.attr("y2")};var A=_.x-C.x,h=_.y-C.y;if(M=Math.atan2(h,A),E=M+Math.PI,u&&b&&u+b>Math.sqrt(A*A+h*h)){q();return}if(u){if(u*u>A*A+h*h){q();return}var p=u*Math.cos(M),k=u*Math.sin(M);C.x+=p,C.y+=k,a.attr({x2:C.x,y2:C.y})}if(b){if(b*b>A*A+h*h){q();return}var w=b*Math.cos(M),R=b*Math.sin(M);_.x-=w,_.y-=R,a.attr({x1:_.x,y1:_.y})}}else if(i.nodeName==="path"){var O=i.getTotalLength(),N="";if(O<u+b){q();return}var V=i.getPointAtLength(0),H=i.getPointAtLength(.1);M=Math.atan2(V.y-H.y,V.x-H.x),_=i.getPointAtLength(Math.min(b,O)),N="0px,"+b+"px,";var F=i.getPointAtLength(O),U=i.getPointAtLength(O-.1);E=Math.atan2(F.y-U.y,F.x-U.x),C=i.getPointAtLength(Math.max(0,O-u));var W=N?b+u:u;N+=O-W+"px,"+O+"px",a.style("stroke-dasharray",N)}function q(){a.style("stroke-dasharray","0px,100px")}function X(lt,yt,pt,st){lt.path&&(lt.noRotate&&(pt=0),c.select(i.parentNode).append("path").attr({class:a.attr("class"),d:lt.path,transform:r(yt.x,yt.y)+e(pt*180/Math.PI)+t(st)}).style({fill:g.rgb(o.arrowcolor),"stroke-width":0}))}v&&X(f,_,M,y),T&&X(s,C,E,x)}}),$_=Ft((Q,$)=>{var c=un(),g=Xo(),P=Kc(),S=bn(),t=S.strTranslate,e=Es(),r=li(),a=js(),n=Qh(),o=tc(),i=P0(),s=up(),f=pu().arrayEditor,x=Xy();$.exports={draw:y,drawOne:v,drawRaw:u};function y(b){var _=b._fullLayout;_._infolayer.selectAll(".annotation").remove();for(var C=0;C<_.annotations.length;C++)_.annotations[C].visible&&v(b,C);return P.previousPromises(b)}function v(b,_){var C=b._fullLayout,M=C.annotations[_]||{},E=e.getFromId(b,M.xref),A=e.getFromId(b,M.yref);E&&E.setScale(),A&&A.setScale(),u(b,M,_,!1,E,A)}function T(b,_,C,M,E){var A=E[C],h=E[C+"ref"],p=C.indexOf("y")!==-1,k=e.getRefType(h)==="domain",w=p?M.h:M.w;return b?k?A+(p?-_:_)/b._length:b.p2r(b.r2p(A)+_):A+(p?-_:_)/w}function u(b,_,C,M,E,A){var h=b._fullLayout,p=b._fullLayout._size,k=b._context.edits,w,R;M?(w="annotation-"+M,R=M+".annotations"):(w="annotation",R="annotations");var O=f(b.layout,R,_),N=O.modifyBase,V=O.modifyItem,H=O.getUpdateObj;h._infolayer.selectAll("."+w+'[data-index="'+C+'"]').remove();var F="clip"+h._uid+"_ann"+C;if(!_._input||_.visible===!1){c.selectAll("#"+F).remove();return}var U={x:{},y:{}},W=+_.textangle||0,q=h._infolayer.append("g").classed(w,!0).attr("data-index",String(C)).style("opacity",_.opacity),X=q.append("g").classed("annotation-text-g",!0),lt=k[_.showarrow?"annotationTail":"annotationPosition"],yt=_.captureevents||k.annotationText||lt;function pt(Pt){var Wt={index:C,annotation:_._input,fullAnnotation:_,event:Pt};return M&&(Wt.subplotId=M),Wt}var st=X.append("g").style("pointer-events",yt?"all":null).call(i,"pointer").on("click",function(){b._dragging=!1,b.emit("plotly_clickannotation",pt(c.event))});_.hovertext&&st.on("mouseover",function(){var Pt=_.hoverlabel,Wt=Pt.font,Ht=this.getBoundingClientRect(),Jt=b.getBoundingClientRect();n.loneHover({x0:Ht.left-Jt.left,x1:Ht.right-Jt.left,y:(Ht.top+Ht.bottom)/2-Jt.top,text:_.hovertext,color:Pt.bgcolor,borderColor:Pt.bordercolor,fontFamily:Wt.family,fontSize:Wt.size,fontColor:Wt.color,fontWeight:Wt.weight,fontStyle:Wt.style,fontVariant:Wt.variant,fontShadow:Wt.fontShadow,fontLineposition:Wt.fontLineposition,fontTextcase:Wt.fontTextcase},{container:h._hoverlayer.node(),outerContainer:h._paper.node(),gd:b})}).on("mouseout",function(){n.loneUnhover(h._hoverlayer.node())});var tt=_.borderwidth,dt=_.borderpad,rt=tt+dt,at=st.append("rect").attr("class","bg").style("stroke-width",tt+"px").call(r.stroke,_.bordercolor).call(r.fill,_.bgcolor),vt=_.width||_.height,it=h._topclips.selectAll("#"+F).data(vt?[0]:[]);it.enter().append("clipPath").classed("annclip",!0).attr("id",F).append("rect"),it.exit().remove();var Y=_.font,ft=h._meta?S.templateString(_.text,h._meta):_.text,ut=st.append("text").classed("annotation-text",!0).text(ft);function wt(Pt){return Pt.call(a.font,Y).attr({"text-anchor":{left:"start",right:"end"}[_.align]||"middle"}),o.convertToTspans(Pt,b,zt),Pt}function zt(){var Pt=ut.selectAll("a");if(Pt.size()===1&&Pt.text()===ut.text()){var Wt=st.insert("a",":first-child").attr({"xlink:xlink:href":Pt.attr("xlink:href"),"xlink:xlink:show":Pt.attr("xlink:show")}).style({cursor:"pointer"});Wt.node().appendChild(at.node())}var Ht=st.select(".annotation-text-math-group"),Jt=!Ht.empty(),ge=a.bBox((Jt?Ht:ut).node()),he=ge.width,de=ge.height,se=_.width||he,Tt=_.height||de,Lt=Math.round(se+2*rt),Mt=Math.round(Tt+2*rt);function te(ii,qn){return qn==="auto"&&(ii<1/3?qn="left":ii>2/3?qn="right":qn="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[qn]}for(var ve=!1,oe=["x","y"],Te=0;Te<oe.length;Te++){var He=oe[Te],Ge=_[He+"ref"]||He,cr=_["a"+He+"ref"],ur={x:E,y:A}[He],jr=(W+(He==="x"?0:-90))*Math.PI/180,Hr=Lt*Math.cos(jr),br=Mt*Math.sin(jr),Kr=Math.abs(Hr)+Math.abs(br),rn=_[He+"anchor"],Ce=_[He+"shift"]*(He==="x"?1:-1),$t=U[He],ne,Ct,gt,St,Nt,ee=e.getRefType(Ge);if(ur&&ee!=="domain"){var le=ur.r2fraction(_[He]);(le<0||le>1)&&(cr===Ge?(le=ur.r2fraction(_["a"+He]),(le<0||le>1)&&(ve=!0)):ve=!0),ne=ur._offset+ur.r2p(_[He]),St=.5}else{var we=ee==="domain";He==="x"?(gt=_[He],ne=we?ur._offset+ur._length*gt:ne=p.l+p.w*gt):(gt=1-_[He],ne=we?ur._offset+ur._length*gt:ne=p.t+p.h*gt),St=_.showarrow?.5:gt}if(_.showarrow){$t.head=ne;var Ue=_["a"+He];if(Nt=Hr*te(.5,_.xanchor)-br*te(.5,_.yanchor),cr===Ge){var qe=e.getRefType(cr);qe==="domain"?(He==="y"&&(Ue=1-Ue),$t.tail=ur._offset+ur._length*Ue):qe==="paper"?He==="y"?(Ue=1-Ue,$t.tail=p.t+p.h*Ue):$t.tail=p.l+p.w*Ue:$t.tail=ur._offset+ur.r2p(Ue),Ct=Nt}else $t.tail=ne+Ue,Ct=Nt+Ue;$t.text=$t.tail+Nt;var ar=h[He==="x"?"width":"height"];if(Ge==="paper"&&($t.head=S.constrain($t.head,1,ar-1)),cr==="pixel"){var Ar=-Math.max($t.tail-3,$t.text),Tr=Math.min($t.tail+3,$t.text)-ar;Ar>0?($t.tail+=Ar,$t.text+=Ar):Tr>0&&($t.tail-=Tr,$t.text-=Tr)}$t.tail+=Ce,$t.head+=Ce}else Nt=Kr*te(St,rn),Ct=Nt,$t.text=ne+Nt;$t.text+=Ce,Nt+=Ce,Ct+=Ce,_["_"+He+"padplus"]=Kr/2+Ct,_["_"+He+"padminus"]=Kr/2-Ct,_["_"+He+"size"]=Kr,_["_"+He+"shift"]=Nt}if(ve){st.remove();return}var pr=0,Jr=0;if(_.align!=="left"&&(pr=(se-he)*(_.align==="center"?.5:1)),_.valign!=="top"&&(Jr=(Tt-de)*(_.valign==="middle"?.5:1)),Jt)Ht.select("svg").attr({x:rt+pr-1,y:rt+Jr}).call(a.setClipUrl,vt?F:null,b);else{var Vn=rt+Jr-ge.top,Hn=rt+pr-ge.left;ut.call(o.positionText,Hn,Vn).call(a.setClipUrl,vt?F:null,b)}it.select("rect").call(a.setRect,rt,rt,se,Tt),at.call(a.setRect,tt/2,tt/2,Lt-tt,Mt-tt),st.call(a.setTranslate,Math.round(U.x.text-Lt/2),Math.round(U.y.text-Mt/2)),X.attr({transform:"rotate("+W+","+U.x.text+","+U.y.text+")"});var Kn=function(ii,qn){q.selectAll(".annotation-arrow-g").remove();var oa=U.x.head,Hi=U.y.head,We=U.x.tail+ii,rr=U.y.tail+qn,fr=U.x.text+ii,xr=U.y.text+qn,Qr=S.rotationXYMatrix(W,fr,xr),Cn=S.apply2DTransform(Qr),wn=S.apply2DTransform2(Qr),Mn=+at.attr("width"),ci=+at.attr("height"),xi=fr-.5*Mn,Pi=xi+Mn,Di=xr-.5*ci,Zi=Di+ci,ui=[[xi,Di,xi,Zi],[xi,Zi,Pi,Zi],[Pi,Zi,Pi,Di],[Pi,Di,xi,Di]].map(wn);if(!ui.reduce(function(Ee,dr){return Ee^!!S.segmentsIntersect(oa,Hi,oa+1e6,Hi+1e6,dr[0],dr[1],dr[2],dr[3])},!1)){ui.forEach(function(Ee){var dr=S.segmentsIntersect(We,rr,oa,Hi,Ee[0],Ee[1],Ee[2],Ee[3]);dr&&(We=dr.x,rr=dr.y)});var Pa=_.arrowwidth,Wa=_.arrowcolor,ze=_.arrowside,Pe=q.append("g").style({opacity:r.opacity(Wa)}).classed("annotation-arrow-g",!0),Rr=Pe.append("path").attr("d","M"+We+","+rr+"L"+oa+","+Hi).style("stroke-width",Pa+"px").call(r.stroke,r.rgb(Wa));if(x(Rr,ze,_),k.annotationPosition&&Rr.node().parentNode&&!M){var qr=oa,$r=Hi;if(_.standoff){var Br=Math.sqrt(Math.pow(oa-We,2)+Math.pow(Hi-rr,2));qr+=_.standoff*(We-oa)/Br,$r+=_.standoff*(rr-Hi)/Br}var Gr=Pe.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(We-qr)+","+(rr-$r),transform:t(qr,$r)}).style("stroke-width",Pa+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),dn,an;s.init({element:Gr.node(),gd:b,prepFn:function(){var Ee=a.getTranslate(st);dn=Ee.x,an=Ee.y,E&&E.autorange&&N(E._name+".autorange",!0),A&&A.autorange&&N(A._name+".autorange",!0)},moveFn:function(Ee,dr){var Vr=Cn(dn,an),yn=Vr[0]+Ee,Fn=Vr[1]+dr;st.call(a.setTranslate,yn,Fn),V("x",T(E,Ee,"x",p,_)),V("y",T(A,dr,"y",p,_)),_.axref===_.xref&&V("ax",T(E,Ee,"ax",p,_)),_.ayref===_.yref&&V("ay",T(A,dr,"ay",p,_)),Pe.attr("transform",t(Ee,dr)),X.attr({transform:"rotate("+W+","+yn+","+Fn+")"})},doneFn:function(){g.call("_guiRelayout",b,H());var Ee=document.querySelector(".js-notes-box-panel");Ee&&Ee.redraw(Ee.selectedObj)}})}}};if(_.showarrow&&Kn(0,0),lt){var Ci;s.init({element:st.node(),gd:b,prepFn:function(){Ci=X.attr("transform")},moveFn:function(ii,qn){var oa="pointer";if(_.showarrow)_.axref===_.xref?V("ax",T(E,ii,"ax",p,_)):V("ax",_.ax+ii),_.ayref===_.yref?V("ay",T(A,qn,"ay",p.w,_)):V("ay",_.ay+qn),Kn(ii,qn);else{if(M)return;var Hi,We;if(E)Hi=T(E,ii,"x",p,_);else{var rr=_._xsize/p.w,fr=_.x+(_._xshift-_.xshift)/p.w-rr/2;Hi=s.align(fr+ii/p.w,rr,0,1,_.xanchor)}if(A)We=T(A,qn,"y",p,_);else{var xr=_._ysize/p.h,Qr=_.y-(_._yshift+_.yshift)/p.h-xr/2;We=s.align(Qr-qn/p.h,xr,0,1,_.yanchor)}V("x",Hi),V("y",We),(!E||!A)&&(oa=s.getCursor(E?.5:Hi,A?.5:We,_.xanchor,_.yanchor))}X.attr({transform:t(ii,qn)+Ci}),i(st,oa)},clickFn:function(ii,qn){_.captureevents&&b.emit("plotly_clickannotation",pt(qn))},doneFn:function(){i(st),g.call("_guiRelayout",b,H());var ii=document.querySelector(".js-notes-box-panel");ii&&ii.redraw(ii.selectedObj)}})}}k.annotationText?ut.call(o.makeEditable,{delegate:st,gd:b}).call(wt).on("edit",function(Pt){_.text=Pt,this.call(wt),V("text",Pt),E&&E.autorange&&N(E._name+".autorange",!0),A&&A.autorange&&N(A._name+".autorange",!0),g.call("_guiRelayout",b,H())}):ut.call(wt)}}),w6=Ft((Q,$)=>{var c=bn(),g=Xo(),P=pu().arrayEditor;$.exports={hasClickToShow:S,onClick:t};function S(a,n){var o=e(a,n);return o.on.length>0||o.explicitOff.length>0}function t(a,n){var o=e(a,n),i=o.on,s=o.off.concat(o.explicitOff),f={},x=a._fullLayout.annotations,y,v;if(i.length||s.length){for(y=0;y<i.length;y++)v=P(a.layout,"annotations",x[i[y]]),v.modifyItem("visible",!0),c.extendFlat(f,v.getUpdateObj());for(y=0;y<s.length;y++)v=P(a.layout,"annotations",x[s[y]]),v.modifyItem("visible",!1),c.extendFlat(f,v.getUpdateObj());return g.call("update",a,{},f)}}function e(a,n){var o=a._fullLayout.annotations,i=[],s=[],f=[],x=(n||[]).length,y,v,T,u,b,_,C,M;for(y=0;y<o.length;y++)if(T=o[y],u=T.clicktoshow,u){for(v=0;v<x;v++)if(b=n[v],_=b.xaxis,C=b.yaxis,_._id===T.xref&&C._id===T.yref&&_.d2r(b.x)===r(T._xclick,_)&&C.d2r(b.y)===r(T._yclick,C)){T.visible?u==="onout"?M=s:M=f:M=i,M.push(y);break}v===x&&T.visible&&u==="onout"&&s.push(y)}return{on:i,off:s,explicitOff:f}}function r(a,n){return n.type==="log"?n.l2r(a):n.d2r(a)}}),Ow=Ft((Q,$)=>{var c=bn(),g=li();$.exports=function(P,S,t,e){e("opacity");var r=e("bgcolor"),a=e("bordercolor"),n=g.opacity(a);e("borderpad");var o=e("borderwidth"),i=e("showarrow");e("text",i?" ":t._dfltTitle.annotation),e("textangle"),c.coerceFont(e,"font",t.font),e("width"),e("align");var s=e("height");if(s&&e("valign"),i){var f=e("arrowside"),x,y;f.indexOf("end")!==-1&&(x=e("arrowhead"),y=e("arrowsize")),f.indexOf("start")!==-1&&(e("startarrowhead",x),e("startarrowsize",y)),e("arrowcolor",n?S.bordercolor:g.defaultLine),e("arrowwidth",(n&&o||1)*2),e("standoff"),e("startstandoff")}var v=e("hovertext"),T=t.hoverlabel||{};if(v){var u=e("hoverlabel.bgcolor",T.bgcolor||(g.opacity(r)?g.rgb(r):g.defaultLine)),b=e("hoverlabel.bordercolor",T.bordercolor||g.contrast(u)),_=c.extendFlat({},T.font);_.color||(_.color=b),c.coerceFont(e,"hoverlabel.font",_)}e("captureevents",!!v)}}),G_=Ft((Q,$)=>{var c=bn(),g=Es(),P=Md(),S=Ow(),t=gm();$.exports=function(r,a){P(r,a,{name:"annotations",handleItemDefaults:e})};function e(r,a,n){function o(p,k){return c.coerce(r,a,t,p,k)}var i=o("visible"),s=o("clicktoshow");if(i||s){S(r,a,n,o);for(var f=a.showarrow,x=["x","y"],y=[-10,-30],v={_fullLayout:n},T=0;T<2;T++){var u=x[T],b=g.coerceRef(r,a,v,u,"","paper");if(b!=="paper"){var _=g.getFromId(v,b);_._annIndices.push(a._index)}if(g.coercePosition(a,v,o,b,u,.5),f){var C="a"+u,M=g.coerceRef(r,a,v,C,"pixel",["pixel","paper"]);M!=="pixel"&&M!==b&&(M=a[C]="pixel");var E=M==="pixel"?y[T]:.4;g.coercePosition(a,v,o,M,C,E)}o(u+"anchor"),o(u+"shift")}if(c.noneOrAll(r,a,["x","y"]),f&&c.noneOrAll(r,a,["ax","ay"]),s){var A=o("xclick"),h=o("yclick");a._xclick=A===void 0?a.x:g.cleanPosition(A,v,a.xref),a._yclick=h===void 0?a.y:g.cleanPosition(h,v,a.yref)}}}}),Dw=Ft((Q,$)=>{var c=bn(),g=Es(),P=$_().draw;$.exports=function(e){var r=e._fullLayout,a=c.filterVisible(r.annotations);if(a.length&&e._fullData.length)return c.syncOrAsync([P,S],e)};function S(e){var r=e._fullLayout;c.filterVisible(r.annotations).forEach(function(a){var n=g.getFromId(e,a.xref),o=g.getFromId(e,a.yref),i=g.getRefType(a.xref),s=g.getRefType(a.yref);a._extremes={},i==="range"&&t(a,n),s==="range"&&t(a,o)})}function t(e,r){var a=r._id,n=a.charAt(0),o=e[n],i=e["a"+n],s=e[n+"ref"],f=e["a"+n+"ref"],x=e["_"+n+"padplus"],y=e["_"+n+"padminus"],v={x:1,y:-1}[n]*e[n+"shift"],T=3*e.arrowsize*e.arrowwidth||0,u=T+v,b=T-v,_=3*e.startarrowsize*e.arrowwidth||0,C=_+v,M=_-v,E;if(f===s){var A=g.findExtremes(r,[r.r2c(o)],{ppadplus:u,ppadminus:b}),h=g.findExtremes(r,[r.r2c(i)],{ppadplus:Math.max(x,C),ppadminus:Math.max(y,M)});E={min:[A.min[0],h.min[0]],max:[A.max[0],h.max[0]]}}else C=i?C+i:C,M=i?M-i:M,E=g.findExtremes(r,[r.r2c(o)],{ppadplus:Math.max(x,u,C),ppadminus:Math.max(y,b,M)});e._extremes[a]=E}}),k6=Ft((Q,$)=>{var c=ra(),g=pl();$.exports=function(P,S,t,e){S=S||{};var r=t==="log"&&S.type==="linear",a=t==="linear"&&S.type==="log";if(!(r||a))return;var n=P._fullLayout.annotations,o=S._id.charAt(0),i,s;function f(y){var v=i[y],T=null;r?T=g(v,S.range):T=Math.pow(10,v),c(T)||(T=null),e(s+y,T)}for(var x=0;x<n.length;x++)i=n[x],s="annotations["+x+"].",i[o+"ref"]===S._id&&f(o),i["a"+o+"ref"]===S._id&&f("a"+o)}}),qD=Ft((Q,$)=>{var c=$_(),g=w6();$.exports={moduleType:"component",name:"annotations",layoutAttributes:gm(),supplyLayoutDefaults:G_(),includeBasePlot:Ag()("annotations"),calcAutorange:Dw(),draw:c.draw,drawOne:c.drawOne,drawRaw:c.drawRaw,hasClickToShow:g.hasClickToShow,onClick:g.onClick,convertCoords:k6()}}),T6=Ft((Q,$)=>{var c=gm(),g=Yc().overrideAll,P=pu().templatedArray;$.exports=g(P("annotation",{visible:c.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:c.xanchor,xshift:c.xshift,yanchor:c.yanchor,yshift:c.yshift,text:c.text,textangle:c.textangle,font:c.font,width:c.width,height:c.height,opacity:c.opacity,align:c.align,valign:c.valign,bgcolor:c.bgcolor,bordercolor:c.bordercolor,borderpad:c.borderpad,borderwidth:c.borderwidth,showarrow:c.showarrow,arrowcolor:c.arrowcolor,arrowhead:c.arrowhead,startarrowhead:c.startarrowhead,arrowside:c.arrowside,arrowsize:c.arrowsize,startarrowsize:c.startarrowsize,arrowwidth:c.arrowwidth,standoff:c.standoff,startstandoff:c.startstandoff,hovertext:c.hovertext,hoverlabel:c.hoverlabel,captureevents:c.captureevents}),"calc","from-root")}),ZD=Ft((Q,$)=>{var c=bn(),g=Es(),P=Md(),S=Ow(),t=T6();$.exports=function(r,a,n){P(r,a,{name:"annotations",handleItemDefaults:e,fullLayout:n.fullLayout})};function e(r,a,n,o){function i(x,y){return c.coerce(r,a,t,x,y)}function s(x){var y=x+"axis",v={_fullLayout:{}};return v._fullLayout[y]=n[y],g.coercePosition(a,v,i,x,x,.5)}var f=i("visible");f&&(S(r,a,o.fullLayout,i),s("x"),s("y"),s("z"),c.noneOrAll(r,a,["x","y","z"]),a.xref="x",a.yref="y",a.zref="z",i("xanchor"),i("yanchor"),i("xshift"),i("yshift"),a.showarrow&&(a.axref="pixel",a.ayref="pixel",i("ax",-10),i("ay",-30),c.noneOrAll(r,a,["ax","ay"])))}}),$D=Ft((Q,$)=>{var c=bn(),g=Es();$.exports=function(S){for(var t=S.fullSceneLayout,e=t.annotations,r=0;r<e.length;r++)P(e[r],S);S.fullLayout._infolayer.selectAll(".annotation-"+S.id).remove()};function P(S,t){var e=t.fullSceneLayout,r=e.domain,a=t.fullLayout._size,n={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};S._xa={},c.extendFlat(S._xa,n),g.setConvert(S._xa),S._xa._offset=a.l+r.x[0]*a.w,S._xa.l2p=function(){return .5*(1+S._pdata[0]/S._pdata[3])*a.w*(r.x[1]-r.x[0])},S._ya={},c.extendFlat(S._ya,n),g.setConvert(S._ya),S._ya._offset=a.t+(1-r.y[1])*a.h,S._ya.l2p=function(){return .5*(1-S._pdata[1]/S._pdata[3])*a.h*(r.y[1]-r.y[0])}}}),kM=Ft((Q,$)=>{function c(P,S){var t=[0,0,0,0],e,r;for(e=0;e<4;++e)for(r=0;r<4;++r)t[r]+=P[4*e+r]*S[e];return t}function g(P,S){var t=c(P.projection,c(P.view,c(P.model,[S[0],S[1],S[2],1])));return t}$.exports=g}),GD=Ft((Q,$)=>{var c=$_().drawRaw,g=kM(),P=["x","y","z"];$.exports=function(S){for(var t=S.fullSceneLayout,e=S.dataScale,r=t.annotations,a=0;a<r.length;a++){for(var n=r[a],o=!1,i=0;i<3;i++){var s=P[i],f=n[s],x=t[s+"axis"],y=x.r2fraction(f);if(y<0||y>1){o=!0;break}}o?S.fullLayout._infolayer.select(".annotation-"+S.id+'[data-index="'+a+'"]').remove():(n._pdata=g(S.glplot.cameraParams,[t.xaxis.r2l(n.x)*e[0],t.yaxis.r2l(n.y)*e[1],t.zaxis.r2l(n.z)*e[2]]),c(S.graphDiv,n,a,S.id,n._xa,n._ya))}}}),YD=Ft((Q,$)=>{var c=Xo(),g=bn();$.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:T6()}}},layoutAttributes:T6(),handleDefaults:ZD(),includeBasePlot:P,convert:$D(),draw:GD()};function P(S,t){var e=c.subplotsRegistry.gl3d;if(e)for(var r=e.attrRegex,a=Object.keys(S),n=0;n<a.length;n++){var o=a[n];r.test(o)&&(S[o].annotations||[]).length&&(g.pushUnique(t._basePlotModules,e),g.pushUnique(t._subplots.gl3d,o))}}}),TM=Ft((Q,$)=>{var c=gm(),g=Ea(),P=tf().line,S=Td().dash,t=Ta().extendFlat,e=pu().templatedArray;Zy();var r=$o(),{shapeTexttemplateAttrs:a,templatefallbackAttrs:n}=$u(),o=y1();$.exports=e("shape",{visible:t({},r.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:t({},r.legend,{editType:"calc+arraydraw"}),legendgroup:t({},r.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:t({},r.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:g({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:t({},r.legendrank,{editType:"calc+arraydraw"}),legendwidth:t({},r.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:t({},c.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:t({},c.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:t({},P.color,{editType:"arraydraw"}),width:t({},P.width,{editType:"calc+arraydraw"}),dash:t({},S,{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:a({},{keys:Object.keys(o)}),texttemplatefallback:n({editType:"arraydraw"}),font:g({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})}),KD=Ft((Q,$)=>{var c=bn(),g=Es(),P=Md(),S=TM(),t=bp();$.exports=function(a,n){P(a,n,{name:"shapes",handleItemDefaults:r})};function e(a,n){return a?"bottom":n.indexOf("top")!==-1?"top":n.indexOf("bottom")!==-1?"bottom":"middle"}function r(a,n,o){function i(tt,dt){return c.coerce(a,n,S,tt,dt)}n._isShape=!0;var s=i("visible");if(s){var f=i("showlegend");f&&(i("legend"),i("legendwidth"),i("legendgroup"),i("legendgrouptitle.text"),c.coerceFont(i,"legendgrouptitle.font"),i("legendrank"));var x=i("path"),y=x?"path":"rect",v=i("type",y),T=v!=="path";T&&delete n.path,i("editable"),i("layer"),i("opacity"),i("fillcolor"),i("fillrule");var u=i("line.width");u&&(i("line.color"),i("line.dash"));for(var b=i("xsizemode"),_=i("ysizemode"),C=["x","y"],M=0;M<2;M++){var E=C[M],A=E+"anchor",h=E==="x"?b:_,p={_fullLayout:o},k,w,R,O=g.coerceRef(a,n,p,E,void 0,"paper"),N=g.getRefType(O);if(N==="range"?(k=g.getFromId(p,O),k._shapeIndices.push(n._index),R=t.rangeToShapePosition(k),w=t.shapePositionToRange(k),(k.type==="category"||k.type==="multicategory")&&(i(E+"0shift"),i(E+"1shift"))):w=R=c.identity,T){var V=.25,H=.75,F=E+"0",U=E+"1",W=a[F],q=a[U];a[F]=w(a[F],!0),a[U]=w(a[U],!0),h==="pixel"?(i(F,0),i(U,10)):(g.coercePosition(n,p,i,O,F,V),g.coercePosition(n,p,i,O,U,H)),n[F]=R(n[F]),n[U]=R(n[U]),a[F]=W,a[U]=q}if(h==="pixel"){var X=a[A];a[A]=w(a[A],!0),g.coercePosition(n,p,i,O,A,.25),n[A]=R(n[A]),a[A]=X}}T&&c.noneOrAll(a,n,["x0","x1","y0","y1"]);var lt=v==="line",yt,pt;if(T&&(yt=i("label.texttemplate"),i("label.texttemplatefallback")),yt||(pt=i("label.text")),pt||yt){i("label.textangle");var st=i("label.textposition",lt?"middle":"middle center");i("label.xanchor"),i("label.yanchor",e(lt,st)),i("label.padding"),c.coerceFont(i,"label.font",o.font)}}}}),XD=Ft((Q,$)=>{var c=li(),g=bn();function P(S,t){return S?"bottom":t.indexOf("top")!==-1?"top":t.indexOf("bottom")!==-1?"bottom":"middle"}$.exports=function(S,t,e){e("newshape.visible"),e("newshape.name"),e("newshape.showlegend"),e("newshape.legend"),e("newshape.legendwidth"),e("newshape.legendgroup"),e("newshape.legendgrouptitle.text"),g.coerceFont(e,"newshape.legendgrouptitle.font"),e("newshape.legendrank"),e("newshape.drawdirection"),e("newshape.layer"),e("newshape.fillcolor"),e("newshape.fillrule"),e("newshape.opacity");var r=e("newshape.line.width");if(r){var a=(S||{}).plot_bgcolor||"#FFF";e("newshape.line.color",c.contrast(a)),e("newshape.line.dash")}var n=S.dragmode==="drawline",o=e("newshape.label.text"),i=e("newshape.label.texttemplate");if(e("newshape.label.texttemplatefallback"),o||i){e("newshape.label.textangle");var s=e("newshape.label.textposition",n?"middle":"middle center");e("newshape.label.xanchor"),e("newshape.label.yanchor",P(n,s)),e("newshape.label.padding"),g.coerceFont(e,"newshape.label.font",t.font)}e("activeshape.fillcolor"),e("activeshape.opacity")}}),JD=Ft((Q,$)=>{var c=bn(),g=Es(),P=Ny(),S=bp();$.exports=function(n){var o=n._fullLayout,i=c.filterVisible(o.shapes);if(!(!i.length||!n._fullData.length))for(var s=0;s<i.length;s++){var f=i[s];f._extremes={};var x,y,v=g.getRefType(f.xref),T=g.getRefType(f.yref);f.xref!=="paper"&&v!=="domain"&&(x=g.getFromId(n,f.xref),y=a(x,f,P.paramIsX),y&&(f._extremes[x._id]=g.findExtremes(x,y,t(f)))),f.yref!=="paper"&&T!=="domain"&&(x=g.getFromId(n,f.yref),y=a(x,f,P.paramIsY),y&&(f._extremes[x._id]=g.findExtremes(x,y,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,i,s,f,x){var y=n/2,v=x;if(o==="pixel"){var T=f?S.extractPathCoords(f,x?P.paramIsY:P.paramIsX):[i,s],u=c.aggNums(Math.max,null,T),b=c.aggNums(Math.min,null,T),_=b<0?Math.abs(b)+y:y,C=u>0?u+y:y;return{ppad:y,ppadplus:v?_:C,ppadminus:v?C:_}}else return{ppad:y}}function a(n,o,i){var s=n._id.charAt(0)==="x"?"x":"y",f=n.type==="category"||n.type==="multicategory",x,y,v=0,T=0,u=f?n.r2c:n.d2c,b=o[s+"sizemode"]==="scaled";if(b?(x=o[s+"0"],y=o[s+"1"],f&&(v=o[s+"0shift"],T=o[s+"1shift"])):(x=o[s+"anchor"],y=o[s+"anchor"]),x!==void 0)return[u(x)+v,u(y)+T];if(o.path){var _=1/0,C=-1/0,M=o.path.match(P.segmentRE),E,A,h,p,k;for(n.type==="date"&&(u=S.decodeDate(u)),E=0;E<M.length;E++)A=M[E],h=i[A.charAt(0)].drawn,h!==void 0&&(p=M[E].substr(1).match(P.paramRE),!(!p||p.length<h)&&(k=u(p[h]),k<_&&(_=k),k>C&&(C=k)));if(C>=_)return[_,C]}}}),QD=Ft((Q,$)=>{var c=R_();$.exports={moduleType:"component",name:"shapes",layoutAttributes:TM(),supplyLayoutDefaults:KD(),supplyDrawNewShapeDefaults:XD(),includeBasePlot:Ag()("shapes"),calcAutorange:JD(),draw:c.draw,drawOne:c.drawOne}}),AM=Ft((Q,$)=>{var c=ic(),g=pu().templatedArray;Zy(),$.exports=g("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",c.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",c.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}),tF=Ft((Q,$)=>{var c=bn(),g=Es(),P=Md(),S=AM(),t="images";$.exports=function(r,a){var n={name:t,handleItemDefaults:e};P(r,a,n)};function e(r,a,n){function o(b,_){return c.coerce(r,a,S,b,_)}var i=o("source"),s=o("visible",!!i);if(!s)return a;o("layer"),o("xanchor"),o("yanchor"),o("sizex"),o("sizey"),o("sizing"),o("opacity");for(var f={_fullLayout:n},x=["x","y"],y=0;y<2;y++){var v=x[y],T=g.coerceRef(r,a,f,v,"paper",void 0);if(T!=="paper"){var u=g.getFromId(f,T);u._imgIndices.push(a._index)}g.coercePosition(a,f,o,T,v,0)}return a}}),eF=Ft((Q,$)=>{var c=un(),g=js(),P=Es(),S=Rc(),t=Op();$.exports=function(e){var r=e._fullLayout,a=[],n={},o=[],i,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"){i=S.ref2id(f.xref)+S.ref2id(f.yref);var x=r._plots[i];if(!x){o.push(f);continue}x.mainplot&&(i=x.mainplot.id),n[i]||(n[i]=[]),n[i].push(f)}else f.layer==="above"?a.push(f):o.push(f)}var y={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 v(h){var p=c.select(this);if(this._imgSrc!==h.source)if(p.attr("xmlns",t.svg),!e._context.staticPlot||h.source&&h.source.slice(0,5)==="data:")p.attr("xlink:href",h.source),this._imgSrc=h.source;else{var k=new Promise((function(w){var R=new Image;this.img=R,R.setAttribute("crossOrigin","anonymous"),R.onerror=O,R.onload=function(){var N=document.createElement("canvas");N.width=this.width,N.height=this.height;var V=N.getContext("2d",{willReadFrequently:!0});V.drawImage(this,0,0);var H=N.toDataURL("image/png");p.attr("xlink:href",H),w()},p.on("error",O),R.src=h.source,this._imgSrc=h.source;function O(){p.remove(),w()}}).bind(this));e._promises.push(k)}}function T(h){var p=c.select(this),k=P.getFromId(e,h.xref),w=P.getFromId(e,h.yref),R=P.getRefType(h.xref)==="domain",O=P.getRefType(h.yref)==="domain",N=r._size,V,H;k!==void 0?V=typeof h.xref=="string"&&R?k._length*h.sizex:Math.abs(k.l2p(h.sizex)-k.l2p(0)):V=h.sizex*N.w,w!==void 0?H=typeof h.yref=="string"&&O?w._length*h.sizey:Math.abs(w.l2p(h.sizey)-w.l2p(0)):H=h.sizey*N.h;var F=V*y.x[h.xanchor].offset,U=H*y.y[h.yanchor].offset,W=y.x[h.xanchor].sizing+y.y[h.yanchor].sizing,q,X;switch(k!==void 0?q=typeof h.xref=="string"&&R?k._length*h.x+k._offset:k.r2p(h.x)+k._offset:q=h.x*N.w+N.l,q+=F,w!==void 0?X=typeof h.yref=="string"&&O?w._length*(1-h.y)+w._offset:w.r2p(h.y)+w._offset:X=N.h-h.y*N.h+N.t,X+=U,h.sizing){case"fill":W+=" slice";break;case"stretch":W="none";break}p.attr({x:q,y:X,width:V,height:H,preserveAspectRatio:W,opacity:h.opacity});var lt=k&&P.getRefType(h.xref)!=="domain"?k._id:"",yt=w&&P.getRefType(h.yref)!=="domain"?w._id:"",pt=lt+yt;g.setClipUrl(p,pt?"clip"+r._uid+pt:null,e)}function u(h){return[h.xref,h.x,h.sizex,h.yref,h.y,h.sizey].join("_")}function b(h,p){return h._index-p._index}var _=r._imageLowerLayer.selectAll("image").data(o,u),C=r._imageUpperLayer.selectAll("image").data(a,u);_.enter().append("image"),C.enter().append("image"),_.exit().remove(),C.exit().remove(),_.each(function(h){v.bind(this)(h),T.bind(this)(h)}),C.each(function(h){v.bind(this)(h),T.bind(this)(h)}),_.sort(b),C.sort(b);var M=Object.keys(r._plots);for(s=0;s<M.length;s++){i=M[s];var E=r._plots[i];if(E.imagelayer){var A=E.imagelayer.selectAll("image").data(n[i]||[],u);A.enter().append("image"),A.exit().remove(),A.each(function(h){v.bind(this)(h),T.bind(this)(h)}),A.sort(b)}}}}),rF=Ft((Q,$)=>{var c=ra(),g=pl();$.exports=function(P,S,t,e){S=S||{};var r=t==="log"&&S.type==="linear",a=t==="linear"&&S.type==="log";if(r||a){for(var n=P._fullLayout.images,o=S._id.charAt(0),i,s,f=0;f<n.length;f++)if(i=n[f],s="images["+f+"].",i[o+"ref"]===S._id){var x=i[o],y=i["size"+o],v=null,T=null;if(r){v=g(x,S.range);var u=y/Math.pow(10,v)/2;T=2*Math.log(u+Math.sqrt(1+u*u))/Math.LN10}else v=Math.pow(10,x),T=v*(Math.pow(10,y/2)-Math.pow(10,-y/2));c(v)?c(T)||(T=null):(v=null,T=null),e(s+o,v),e(s+"size"+o,T)}}}}),nF=Ft((Q,$)=>{$.exports={moduleType:"component",name:"images",layoutAttributes:AM(),supplyLayoutDefaults:tF(),includeBasePlot:Ag()("images"),draw:eF(),convertCoords:rF()}}),A6=Ft((Q,$)=>{$.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:"▼"}}}),MM=Ft((Q,$)=>{var c=Ea(),g=bi(),P=Ta().extendFlat,S=Yc().overrideAll,t=Iy(),e=pu().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}});$.exports=S(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:P(t({editType:"arraydraw"}),{}),font:c({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:g.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}),iF=Ft((Q,$)=>{var c=bn(),g=Md(),P=MM(),S=A6(),t=S.name,e=P.buttons;$.exports=function(n,o){var i={name:t,handleItemDefaults:r};g(n,o,i)};function r(n,o,i){function s(y,v){return c.coerce(n,o,P,y,v)}var f=g(n,o,{name:"buttons",handleItemDefaults:a}),x=s("visible",f.length>0);x&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),c.noneOrAll(n,o,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),c.coerceFont(s,"font",i.font),s("bgcolor",i.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function a(n,o){function i(f,x){return c.coerce(n,o,e,f,x)}var s=i("visible",n.method==="skip"||Array.isArray(n.args));s&&(i("method"),i("args"),i("args2"),i("label"),i("execute"))}}),aF=Ft((Q,$)=>{$.exports=t;var c=un(),g=li(),P=js(),S=bn();function t(e,r,a){this.gd=e,this.container=r,this.id=a,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,a){var n=this.gd._fullLayout,o=n.width,i=n.height;this.position=e;var s=this.position.l,f=this.position.w,x=this.position.t,y=this.position.h,v=this.position.direction,T=v==="down",u=v==="left",b=v==="right",_=v==="up",C=f,M=y,E,A,h,p;!T&&!u&&!b&&!_&&(this.position.direction="down",T=!0);var k=T||_;k?(E=s,A=E+C,T?(h=x,p=Math.min(h+M,i),M=p-h):(p=x+M,h=Math.max(p-M,0),M=p-h)):(h=x,p=h+M,u?(A=s+C,E=Math.max(A-C,0),C=A-E):(E=s,A=Math.min(E+C,o),C=A-E)),this._box={l:E,t:h,w:C,h:M};var w=f>C,R=t.barLength+2*t.barPad,O=t.barWidth+2*t.barPad,N=s,V=x+y;V+O>i&&(V=i-O);var H=this.container.selectAll("rect.scrollbar-horizontal").data(w?[0]:[]);H.exit().on(".drag",null).remove(),H.enter().append("rect").classed("scrollbar-horizontal",!0).call(g.fill,t.barColor),w?(this.hbar=H.attr({rx:t.barRadius,ry:t.barRadius,x:N,y:V,width:R,height:O}),this._hbarXMin=N+R/2,this._hbarTranslateMax=C-R):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var F=y>M,U=t.barWidth+2*t.barPad,W=t.barLength+2*t.barPad,q=s+f,X=x;q+U>o&&(q=o-U);var lt=this.container.selectAll("rect.scrollbar-vertical").data(F?[0]:[]);lt.exit().on(".drag",null).remove(),lt.enter().append("rect").classed("scrollbar-vertical",!0).call(g.fill,t.barColor),F?(this.vbar=lt.attr({rx:t.barRadius,ry:t.barRadius,x:q,y:X,width:U,height:W}),this._vbarYMin=X+W/2,this._vbarTranslateMax=M-W):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var yt=this.id,pt=E-.5,st=F?A+U+.5:A+.5,tt=h-.5,dt=w?p+O+.5:p+.5,rt=n._topdefs.selectAll("#"+yt).data(w||F?[0]:[]);if(rt.exit().remove(),rt.enter().append("clipPath").attr("id",yt).append("rect"),w||F?(this._clipRect=rt.select("rect").attr({x:Math.floor(pt),y:Math.floor(tt),width:Math.ceil(st)-Math.floor(pt),height:Math.ceil(dt)-Math.floor(tt)}),this.container.call(P.setClipUrl,yt,this.gd),this.bg.attr({x:s,y:x,width:f,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(P.setClipUrl,null),delete this._clipRect),w||F){var at=c.behavior.drag().on("dragstart",function(){c.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(at);var vt=c.behavior.drag().on("dragstart",function(){c.event.sourceEvent.preventDefault(),c.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));w&&this.hbar.on(".drag",null).call(vt),F&&this.vbar.on(".drag",null).call(vt)}this.setTranslate(r,a)},t.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(P.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},t.prototype._onBoxDrag=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e-=c.event.dx),this.vbar&&(r-=c.event.dy),this.setTranslate(e,r)},t.prototype._onBoxWheel=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e+=c.event.deltaY),this.vbar&&(r+=c.event.deltaY),this.setTranslate(e,r)},t.prototype._onBarDrag=function(){var e=this.translateX,r=this.translateY;if(this.hbar){var a=e+this._hbarXMin,n=a+this._hbarTranslateMax,o=S.constrain(c.event.x,a,n),i=(o-a)/(n-a),s=this.position.w-this._box.w;e=i*s}if(this.vbar){var f=r+this._vbarYMin,x=f+this._vbarTranslateMax,y=S.constrain(c.event.y,f,x),v=(y-f)/(x-f),T=this.position.h-this._box.h;r=v*T}this.setTranslate(e,r)},t.prototype.setTranslate=function(e,r){var a=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=S.constrain(e||0,0,a),r=S.constrain(r||0,0,n),this.translateX=e,this.translateY=r,this.container.call(P.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/a;this.hbar.call(P.setTranslate,e+o*this._hbarTranslateMax,r)}if(this.vbar){var i=r/n;this.vbar.call(P.setTranslate,e,r+i*this._vbarTranslateMax)}}}),oF=Ft((Q,$)=>{var c=un(),g=Kc(),P=li(),S=js(),t=bn(),e=tc(),r=pu().arrayEditor,a=Af().LINE_SPACING,n=A6(),o=aF();$.exports=function(R){var O=R._fullLayout,N=t.filterVisible(O[n.name]);function V(yt){g.autoMargin(R,p(yt))}var H=O._menulayer.selectAll("g."+n.containerClassName).data(N.length>0?[0]:[]);if(H.enter().append("g").classed(n.containerClassName,!0).style("cursor","pointer"),H.exit().each(function(){c.select(this).selectAll("g."+n.headerGroupClassName).each(V)}).remove(),N.length!==0){var F=H.selectAll("g."+n.headerGroupClassName).data(N,i);F.enter().append("g").classed(n.headerGroupClassName,!0);for(var U=t.ensureSingle(H,"g",n.dropdownButtonGroupClassName,function(yt){yt.style("pointer-events","all")}),W=0;W<N.length;W++){var q=N[W];h(R,q)}var X="updatemenus"+O._uid,lt=new o(R,U,X);F.enter().size()&&(U.node().parentNode.appendChild(U.node()),U.call(w)),F.exit().each(function(yt){U.call(w),V(yt)}).remove(),F.each(function(yt){var pt=c.select(this),st=yt.type==="dropdown"?U:null;g.manageCommandObserver(R,yt,yt.buttons,function(tt){x(R,yt,yt.buttons[tt.index],pt,st,lt,tt.index,!0)}),yt.type==="dropdown"?(y(R,pt,U,lt,yt),f(U,yt)&&v(R,pt,U,lt,yt)):v(R,pt,null,null,yt)})}};function i(R){return R._index}function s(R){return+R.attr(n.menuIndexAttrName)==-1}function f(R,O){return+R.attr(n.menuIndexAttrName)===O._index}function x(R,O,N,V,H,F,U,W){O.active=U,r(R.layout,n.name,O).applyUpdate("active",U),O.type==="buttons"?v(R,V,null,null,O):O.type==="dropdown"&&(H.attr(n.menuIndexAttrName,"-1"),y(R,V,H,F,O),W||v(R,V,H,F,O))}function y(R,O,N,V,H){var F=t.ensureSingle(O,"g",n.headerClassName,function(pt){pt.style("pointer-events","all")}),U=H._dims,W=H.active,q=H.buttons[W]||n.blankHeaderOpts,X={y:H.pad.t,yPad:0,x:H.pad.l,xPad:0,index:0},lt={width:U.headerWidth,height:U.headerHeight};F.call(b,H,q,R).call(k,H,X,lt);var yt=t.ensureSingle(O,"text",n.headerArrowClassName,function(pt){pt.attr("text-anchor","end").call(S.font,H.font).text(n.arrowSymbol[H.direction])});yt.attr({x:U.headerWidth-n.arrowOffsetX+H.pad.l,y:U.headerHeight/2+n.textOffsetY+H.pad.t}),F.on("click",function(){N.call(w,String(f(N,H)?-1:H._index)),v(R,O,N,V,H)}),F.on("mouseover",function(){F.call(E)}),F.on("mouseout",function(){F.call(A,H)}),S.setTranslate(O,U.lx,U.ly)}function v(R,O,N,V,H){N||(N=O,N.attr("pointer-events","all"));var F=!s(N)||H.type==="buttons"?H.buttons:[],U=H.type==="dropdown"?n.dropdownButtonClassName:n.buttonClassName,W=N.selectAll("g."+U).data(t.filterVisible(F)),q=W.enter().append("g").classed(U,!0),X=W.exit();H.type==="dropdown"?(q.attr("opacity","0").transition().attr("opacity","1"),X.transition().attr("opacity","0").remove()):X.remove();var lt=0,yt=0,pt=H._dims,st=["up","down"].indexOf(H.direction)!==-1;H.type==="dropdown"&&(st?yt=pt.headerHeight+n.gapButtonHeader:lt=pt.headerWidth+n.gapButtonHeader),H.type==="dropdown"&&H.direction==="up"&&(yt=-n.gapButtonHeader+n.gapButton-pt.openHeight),H.type==="dropdown"&&H.direction==="left"&&(lt=-n.gapButtonHeader+n.gapButton-pt.openWidth);var tt={x:pt.lx+lt+H.pad.l,y:pt.ly+yt+H.pad.t,yPad:n.gapButton,xPad:n.gapButton,index:0},dt={l:tt.x+H.borderwidth,t:tt.y+H.borderwidth};W.each(function(rt,at){var vt=c.select(this);vt.call(b,H,rt,R).call(k,H,tt),vt.on("click",function(){c.event.defaultPrevented||(rt.execute&&(rt.args2&&H.active===at?(x(R,H,rt,O,N,V,-1),g.executeAPICommand(R,rt.method,rt.args2)):(x(R,H,rt,O,N,V,at),g.executeAPICommand(R,rt.method,rt.args))),R.emit("plotly_buttonclicked",{menu:H,button:rt,active:H.active}))}),vt.on("mouseover",function(){vt.call(E)}),vt.on("mouseout",function(){vt.call(A,H),W.call(M,H)})}),W.call(M,H),st?(dt.w=Math.max(pt.openWidth,pt.headerWidth),dt.h=tt.y-dt.t):(dt.w=tt.x-dt.l,dt.h=Math.max(pt.openHeight,pt.headerHeight)),dt.direction=H.direction,V&&(W.size()?T(R,O,N,V,H,dt):u(V))}function T(R,O,N,V,H,F){var U=H.direction,W=U==="up"||U==="down",q=H._dims,X=H.active,lt,yt,pt;if(W)for(yt=0,pt=0;pt<X;pt++)yt+=q.heights[pt]+n.gapButton;else for(lt=0,pt=0;pt<X;pt++)lt+=q.widths[pt]+n.gapButton;V.enable(F,lt,yt),V.hbar&&V.hbar.attr("opacity","0").transition().attr("opacity","1"),V.vbar&&V.vbar.attr("opacity","0").transition().attr("opacity","1")}function u(R){var O=!!R.hbar,N=!!R.vbar;O&&R.hbar.transition().attr("opacity","0").each("end",function(){O=!1,N||R.disable()}),N&&R.vbar.transition().attr("opacity","0").each("end",function(){N=!1,O||R.disable()})}function b(R,O,N,V){R.call(_,O).call(C,O,N,V)}function _(R,O){var N=t.ensureSingle(R,"rect",n.itemRectClassName,function(V){V.attr({rx:n.rx,ry:n.ry,"shape-rendering":"crispEdges"})});N.call(P.stroke,O.bordercolor).call(P.fill,O.bgcolor).style("stroke-width",O.borderwidth+"px")}function C(R,O,N,V){var H=t.ensureSingle(R,"text",n.itemTextClassName,function(W){W.attr({"text-anchor":"start","data-notex":1})}),F=N.label,U=V._fullLayout._meta;U&&(F=t.templateString(F,U)),H.call(S.font,O.font).text(F).call(e.convertToTspans,V)}function M(R,O){var N=O.active;R.each(function(V,H){var F=c.select(this);H===N&&O.showactive&&F.select("rect."+n.itemRectClassName).call(P.fill,n.activeColor)})}function E(R){R.select("rect."+n.itemRectClassName).call(P.fill,n.hoverColor)}function A(R,O){R.select("rect."+n.itemRectClassName).call(P.fill,O.bgcolor)}function h(R,O){var N=O._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},V=S.tester.selectAll("g."+n.dropdownButtonClassName).data(t.filterVisible(O.buttons));V.enter().append("g").classed(n.dropdownButtonClassName,!0);var H=["up","down"].indexOf(O.direction)!==-1;V.each(function(lt,yt){var pt=c.select(this);pt.call(b,O,lt,R);var st=pt.select("."+n.itemTextClassName),tt=st.node()&&S.bBox(st.node()).width,dt=Math.max(tt+n.textPadX,n.minWidth),rt=O.font.size*a,at=e.lineCount(st),vt=Math.max(rt*at,n.minHeight)+n.textOffsetY;vt=Math.ceil(vt),dt=Math.ceil(dt),N.widths[yt]=dt,N.heights[yt]=vt,N.height1=Math.max(N.height1,vt),N.width1=Math.max(N.width1,dt),H?(N.totalWidth=Math.max(N.totalWidth,dt),N.openWidth=N.totalWidth,N.totalHeight+=vt+n.gapButton,N.openHeight+=vt+n.gapButton):(N.totalWidth+=dt+n.gapButton,N.openWidth+=dt+n.gapButton,N.totalHeight=Math.max(N.totalHeight,vt),N.openHeight=N.totalHeight)}),H?N.totalHeight-=n.gapButton:N.totalWidth-=n.gapButton,N.headerWidth=N.width1+n.arrowPadX,N.headerHeight=N.height1,O.type==="dropdown"&&(H?(N.width1+=n.arrowPadX,N.totalHeight=N.height1):N.totalWidth=N.width1,N.totalWidth+=n.arrowPadX),V.remove();var F=N.totalWidth+O.pad.l+O.pad.r,U=N.totalHeight+O.pad.t+O.pad.b,W=R._fullLayout._size;N.lx=W.l+W.w*O.x,N.ly=W.t+W.h*(1-O.y);var q="left";t.isRightAnchor(O)&&(N.lx-=F,q="right"),t.isCenterAnchor(O)&&(N.lx-=F/2,q="center");var X="top";t.isBottomAnchor(O)&&(N.ly-=U,X="bottom"),t.isMiddleAnchor(O)&&(N.ly-=U/2,X="middle"),N.totalWidth=Math.ceil(N.totalWidth),N.totalHeight=Math.ceil(N.totalHeight),N.lx=Math.round(N.lx),N.ly=Math.round(N.ly),g.autoMargin(R,p(O),{x:O.x,y:O.y,l:F*({right:1,center:.5}[q]||0),r:F*({left:1,center:.5}[q]||0),b:U*({top:1,middle:.5}[X]||0),t:U*({bottom:1,middle:.5}[X]||0)})}function p(R){return n.autoMarginIdRoot+R._index}function k(R,O,N,V){V=V||{};var H=R.select("."+n.itemRectClassName),F=R.select("."+n.itemTextClassName),U=O.borderwidth,W=N.index,q=O._dims;S.setTranslate(R,U+N.x,U+N.y);var X=["up","down"].indexOf(O.direction)!==-1,lt=V.height||(X?q.heights[W]:q.height1);H.attr({x:0,y:0,width:V.width||(X?q.width1:q.widths[W]),height:lt});var yt=O.font.size*a,pt=e.lineCount(F),st=(pt-1)*yt/2;e.positionText(F,n.textOffsetX,lt/2-st+n.textOffsetY),X?N.y+=q.heights[W]+N.yPad:N.x+=q.widths[W]+N.xPad,N.index++}function w(R,O){R.attr(n.menuIndexAttrName,O||"-1").selectAll("g."+n.dropdownButtonClassName).remove()}}),sF=Ft((Q,$)=>{var c=A6();$.exports={moduleType:"component",name:c.name,layoutAttributes:MM(),supplyLayoutDefaults:iF(),draw:oF()}}),Fw=Ft((Q,$)=>{$.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}}),SM=Ft((Q,$)=>{var c=Ea(),g=Iy(),P=Ta().extendDeepAll,S=Yc().overrideAll,t=El(),e=pu().templatedArray,r=Fw(),a=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}});$.exports=S(e("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:a,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:P(g({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:t.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:c({})},font:c({}),activebgcolor:{valType:"color",dflt:r.gripBgActiveColor},bgcolor:{valType:"color",dflt:r.railBgColor},bordercolor:{valType:"color",dflt:r.railBorderColor},borderwidth:{valType:"number",min:0,dflt:r.railBorderWidth},ticklen:{valType:"number",min:0,dflt:r.tickLength},tickcolor:{valType:"color",dflt:r.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:r.minorTickLength}}),"arraydraw","from-root")}),lF=Ft((Q,$)=>{var c=bn(),g=Md(),P=SM(),S=Fw(),t=S.name,e=P.steps;$.exports=function(n,o){g(n,o,{name:t,handleItemDefaults:r})};function r(n,o,i){function s(_,C){return c.coerce(n,o,P,_,C)}for(var f=g(n,o,{name:"steps",handleItemDefaults:a}),x=0,y=0;y<f.length;y++)f[y].visible&&x++;var v;if(x<2?v=o.visible=!1:v=s("visible"),!!v){o._stepCount=x;var T=o._visibleSteps=c.filterVisible(f),u=s("active");(f[u]||{}).visible||(o.active=T[0]._index),s("x"),s("y"),c.noneOrAll(n,o,["x","y"]),s("xanchor"),s("yanchor"),s("len"),s("lenmode"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),c.coerceFont(s,"font",i.font);var b=s("currentvalue.visible");b&&(s("currentvalue.xanchor"),s("currentvalue.prefix"),s("currentvalue.suffix"),s("currentvalue.offset"),c.coerceFont(s,"currentvalue.font",o.font)),s("transition.duration"),s("transition.easing"),s("bgcolor"),s("activebgcolor"),s("bordercolor"),s("borderwidth"),s("ticklen"),s("tickwidth"),s("tickcolor"),s("minorticklen")}}function a(n,o){function i(x,y){return c.coerce(n,o,e,x,y)}var s;if(n.method!=="skip"&&!Array.isArray(n.args)?s=o.visible=!1:s=i("visible"),s){i("method"),i("args");var f=i("label","step-"+o._index);i("value",f),i("execute")}}}),uF=Ft((Q,$)=>{var c=un(),g=Kc(),P=li(),S=js(),t=bn(),e=t.strTranslate,r=tc(),a=pu().arrayEditor,n=Fw(),o=Af(),i=o.LINE_SPACING,s=o.FROM_TL,f=o.FROM_BR;$.exports=function(H){var F=H._context.staticPlot,U=H._fullLayout,W=y(U,H),q=U._infolayer.selectAll("g."+n.containerClassName).data(W.length>0?[0]:[]);q.enter().append("g").classed(n.containerClassName,!0).style("cursor",F?null:"ew-resize");function X(st){st._commandObserver&&(st._commandObserver.remove(),delete st._commandObserver),g.autoMargin(H,x(st))}if(q.exit().each(function(){c.select(this).selectAll("g."+n.groupClassName).each(X)}).remove(),W.length!==0){var lt=q.selectAll("g."+n.groupClassName).data(W,v);lt.enter().append("g").classed(n.groupClassName,!0),lt.exit().each(X).remove();for(var yt=0;yt<W.length;yt++){var pt=W[yt];T(H,pt)}lt.each(function(st){var tt=c.select(this);k(st),g.manageCommandObserver(H,st,st._visibleSteps,function(dt){var rt=tt.data()[0];rt.active!==dt.index&&(rt._dragging||A(H,tt,rt,dt.index,!1,!0))}),u(H,c.select(this),st)})}};function x(H){return n.autoMarginIdRoot+H._index}function y(H,F){for(var U=H[n.name],W=[],q=0;q<U.length;q++){var X=U[q];X.visible&&(X._gd=F,W.push(X))}return W}function v(H){return H._index}function T(H,F){var U=S.tester.selectAll("g."+n.labelGroupClass).data(F._visibleSteps);U.enter().append("g").classed(n.labelGroupClass,!0);var W=0,q=0;U.each(function(vt){var it=c.select(this),Y=C(it,{step:vt},F),ft=Y.node();if(ft){var ut=S.bBox(ft);q=Math.max(q,ut.height),W=Math.max(W,ut.width)}}),U.remove();var X=F._dims={};X.inputAreaWidth=Math.max(n.railWidth,n.gripHeight);var lt=H._fullLayout._size;X.lx=lt.l+lt.w*F.x,X.ly=lt.t+lt.h*(1-F.y),F.lenmode==="fraction"?X.outerLength=Math.round(lt.w*F.len):X.outerLength=F.len,X.inputAreaStart=0,X.inputAreaLength=Math.round(X.outerLength-F.pad.l-F.pad.r);var yt=X.inputAreaLength-2*n.stepInset,pt=yt/(F._stepCount-1),st=W+n.labelPadding;if(X.labelStride=Math.max(1,Math.ceil(st/pt)),X.labelHeight=q,X.currentValueMaxWidth=0,X.currentValueHeight=0,X.currentValueTotalHeight=0,X.currentValueMaxLines=1,F.currentvalue.visible){var tt=S.tester.append("g");U.each(function(vt){var it=b(tt,F,vt.label),Y=it.node()&&S.bBox(it.node())||{width:0,height:0},ft=r.lineCount(it);X.currentValueMaxWidth=Math.max(X.currentValueMaxWidth,Math.ceil(Y.width)),X.currentValueHeight=Math.max(X.currentValueHeight,Math.ceil(Y.height)),X.currentValueMaxLines=Math.max(X.currentValueMaxLines,ft)}),X.currentValueTotalHeight=X.currentValueHeight+F.currentvalue.offset,tt.remove()}X.height=X.currentValueTotalHeight+n.tickOffset+F.ticklen+n.labelOffset+X.labelHeight+F.pad.t+F.pad.b;var dt="left";t.isRightAnchor(F)&&(X.lx-=X.outerLength,dt="right"),t.isCenterAnchor(F)&&(X.lx-=X.outerLength/2,dt="center");var rt="top";t.isBottomAnchor(F)&&(X.ly-=X.height,rt="bottom"),t.isMiddleAnchor(F)&&(X.ly-=X.height/2,rt="middle"),X.outerLength=Math.ceil(X.outerLength),X.height=Math.ceil(X.height),X.lx=Math.round(X.lx),X.ly=Math.round(X.ly);var at={y:F.y,b:X.height*f[rt],t:X.height*s[rt]};F.lenmode==="fraction"?(at.l=0,at.xl=F.x-F.len*s[dt],at.r=0,at.xr=F.x+F.len*f[dt]):(at.x=F.x,at.l=X.outerLength*s[dt],at.r=X.outerLength*f[dt]),g.autoMargin(H,x(F),at)}function u(H,F,U){(U.steps[U.active]||{}).visible||(U.active=U._visibleSteps[0]._index),F.call(b,U).call(V,U).call(M,U).call(p,U).call(N,H,U).call(_,H,U);var W=U._dims;S.setTranslate(F,W.lx+U.pad.l,W.ly+U.pad.t),F.call(w,U,!1),F.call(b,U)}function b(H,F,U){if(F.currentvalue.visible){var W=F._dims,q,X;switch(F.currentvalue.xanchor){case"right":q=W.inputAreaLength-n.currentValueInset-W.currentValueMaxWidth,X="left";break;case"center":q=W.inputAreaLength*.5,X="middle";break;default:q=n.currentValueInset,X="left"}var lt=t.ensureSingle(H,"text",n.labelClass,function(rt){rt.attr({"text-anchor":X,"data-notex":1})}),yt=F.currentvalue.prefix?F.currentvalue.prefix:"";if(typeof U=="string")yt+=U;else{var pt=F.steps[F.active].label,st=F._gd._fullLayout._meta;st&&(pt=t.templateString(pt,st)),yt+=pt}F.currentvalue.suffix&&(yt+=F.currentvalue.suffix),lt.call(S.font,F.currentvalue.font).text(yt).call(r.convertToTspans,F._gd);var tt=r.lineCount(lt),dt=(W.currentValueMaxLines+1-tt)*F.currentvalue.font.size*i;return r.positionText(lt,q,dt),lt}}function _(H,F,U){var W=t.ensureSingle(H,"rect",n.gripRectClass,function(q){q.call(h,F,H,U).style("pointer-events","all")});W.attr({width:n.gripWidth,height:n.gripHeight,rx:n.gripRadius,ry:n.gripRadius}).call(P.stroke,U.bordercolor).call(P.fill,U.bgcolor).style("stroke-width",U.borderwidth+"px")}function C(H,F,U){var W=t.ensureSingle(H,"text",n.labelClass,function(lt){lt.attr({"text-anchor":"middle","data-notex":1})}),q=F.step.label,X=U._gd._fullLayout._meta;return X&&(q=t.templateString(q,X)),W.call(S.font,U.font).text(q).call(r.convertToTspans,U._gd),W}function M(H,F){var U=t.ensureSingle(H,"g",n.labelsClass),W=F._dims,q=U.selectAll("g."+n.labelGroupClass).data(W.labelSteps);q.enter().append("g").classed(n.labelGroupClass,!0),q.exit().remove(),q.each(function(X){var lt=c.select(this);lt.call(C,X,F),S.setTranslate(lt,R(F,X.fraction),n.tickOffset+F.ticklen+F.font.size*i+n.labelOffset+W.currentValueTotalHeight)})}function E(H,F,U,W,q){var X=Math.round(W*(U._stepCount-1)),lt=U._visibleSteps[X]._index;lt!==U.active&&A(H,F,U,lt,!0,q)}function A(H,F,U,W,q,X){var lt=U.active;U.active=W,a(H.layout,n.name,U).applyUpdate("active",W);var yt=U.steps[U.active];F.call(w,U,X),F.call(b,U),H.emit("plotly_sliderchange",{slider:U,step:U.steps[U.active],interaction:q,previousActive:lt}),yt&&yt.method&&q&&(F._nextMethod?(F._nextMethod.step=yt,F._nextMethod.doCallback=q,F._nextMethod.doTransition=X):(F._nextMethod={step:yt,doCallback:q,doTransition:X},F._nextMethodRaf=window.requestAnimationFrame(function(){var pt=F._nextMethod.step;pt.method&&(pt.execute&&g.executeAPICommand(H,pt.method,pt.args),F._nextMethod=null,F._nextMethodRaf=null)})))}function h(H,F,U){if(F._context.staticPlot)return;var W=U.node(),q=c.select(F);function X(){return U.data()[0]}function lt(){var yt=X();F.emit("plotly_sliderstart",{slider:yt});var pt=U.select("."+n.gripRectClass);c.event.stopPropagation(),c.event.preventDefault(),pt.call(P.fill,yt.activebgcolor);var st=O(yt,c.mouse(W)[0]);E(F,U,yt,st,!0),yt._dragging=!0;function tt(){var rt=X(),at=O(rt,c.mouse(W)[0]);E(F,U,rt,at,!1)}q.on("mousemove",tt),q.on("touchmove",tt);function dt(){var rt=X();rt._dragging=!1,pt.call(P.fill,rt.bgcolor),q.on("mouseup",null),q.on("mousemove",null),q.on("touchend",null),q.on("touchmove",null),F.emit("plotly_sliderend",{slider:rt,step:rt.steps[rt.active]})}q.on("mouseup",dt),q.on("touchend",dt)}H.on("mousedown",lt),H.on("touchstart",lt)}function p(H,F){var U=H.selectAll("rect."+n.tickRectClass).data(F._visibleSteps),W=F._dims;U.enter().append("rect").classed(n.tickRectClass,!0),U.exit().remove(),U.attr({width:F.tickwidth+"px","shape-rendering":"crispEdges"}),U.each(function(q,X){var lt=X%W.labelStride===0,yt=c.select(this);yt.attr({height:lt?F.ticklen:F.minorticklen}).call(P.fill,F.tickcolor),S.setTranslate(yt,R(F,X/(F._stepCount-1))-.5*F.tickwidth,(lt?n.tickOffset:n.minorTickOffset)+W.currentValueTotalHeight)})}function k(H){var F=H._dims;F.labelSteps=[];for(var U=H._stepCount,W=0;W<U;W+=F.labelStride)F.labelSteps.push({fraction:W/(U-1),step:H._visibleSteps[W]})}function w(H,F,U){for(var W=H.select("rect."+n.gripRectClass),q=0,X=0;X<F._stepCount;X++)if(F._visibleSteps[X]._index===F.active){q=X;break}var lt=R(F,q/(F._stepCount-1));if(!F._invokingCommand){var yt=W;U&&F.transition.duration>0&&(yt=yt.transition().duration(F.transition.duration).ease(F.transition.easing)),yt.attr("transform",e(lt-n.gripWidth*.5,F._dims.currentValueTotalHeight))}}function R(H,F){var U=H._dims;return U.inputAreaStart+n.stepInset+(U.inputAreaLength-2*n.stepInset)*Math.min(1,Math.max(0,F))}function O(H,F){var U=H._dims;return Math.min(1,Math.max(0,(F-n.stepInset-U.inputAreaStart)/(U.inputAreaLength-2*n.stepInset-2*U.inputAreaStart)))}function N(H,F,U){var W=U._dims,q=t.ensureSingle(H,"rect",n.railTouchRectClass,function(X){X.call(h,F,H,U).style("pointer-events","all")});q.attr({width:W.inputAreaLength,height:Math.max(W.inputAreaWidth,n.tickOffset+U.ticklen+W.labelHeight)}).call(P.fill,U.bgcolor).attr("opacity",0),S.setTranslate(q,0,W.currentValueTotalHeight)}function V(H,F){var U=F._dims,W=U.inputAreaLength-n.railInset*2,q=t.ensureSingle(H,"rect",n.railRectClass);q.attr({width:W,height:n.railWidth,rx:n.railRadius,ry:n.railRadius,"shape-rendering":"crispEdges"}).call(P.stroke,F.bordercolor).call(P.fill,F.bgcolor).style("stroke-width",F.borderwidth+"px"),S.setTranslate(q,n.railInset,(U.inputAreaWidth-n.railWidth)*.5+U.currentValueTotalHeight)}}),cF=Ft((Q,$)=>{var c=Fw();$.exports={moduleType:"component",name:c.name,layoutAttributes:SM(),supplyLayoutDefaults:lF(),draw:uF()}}),M6=Ft((Q,$)=>{var c=bi();$.exports={bgcolor:{valType:"color",dflt:c.background,editType:"plot"},bordercolor:{valType:"color",dflt:c.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}),EM=Ft((Q,$)=>{$.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"}}),S6=Ft((Q,$)=>{$.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}}),hF=Ft(Q=>{var $=Rc(),c=tc(),g=S6(),P=Af().LINE_SPACING,S=g.name;function t(e){var r=e&&e[S];return r&&r.visible}Q.isVisible=t,Q.makeData=function(e){for(var r=$.list({_fullLayout:e},"x",!0),a=e.margin,n=[],o=0;o<r.length;o++){var i=r[o];if(t(i)){n.push(i);var s=i[S];s._id=S+i._id,s._height=(e.height-a.b-a.t)*s.thickness,s._offsetShift=Math.floor(s.borderwidth/2)}}e._rangeSliderData=n},Q.autoMarginOpts=function(e,r){var a=e._fullLayout,n=r[S],o=r._id.charAt(0),i=0,s=0;if(r.side==="bottom"&&(i=r._depth,r.title.text!==a._dfltTitle[o])){s=1.5*r.title.font.size+10+n._offsetShift;var f=(r.title.text.match(c.BR_TAG_ALL)||[]).length;s+=f*r.title.font.size*P}return{x:0,y:r._counterDomainMin,l:0,r:0,t:0,b:n._height+i+Math.max(a.margin.b,s),pad:g.extraPad+n._offsetShift*2}}}),fF=Ft((Q,$)=>{var c=bn(),g=pu(),P=Rc(),S=M6(),t=EM();$.exports=function(e,r,a){var n=e[a],o=r[a];if(!(n.rangeslider||r._requestRangeslider[o._id]))return;c.isPlainObject(n.rangeslider)||(n.rangeslider={});var i=n.rangeslider,s=g.newContainer(o,"rangeslider");function f(p,k){return c.coerce(i,s,S,p,k)}var x,y;function v(p,k){return c.coerce(x,y,t,p,k)}var T=f("visible");if(T){f("bgcolor",r.plot_bgcolor),f("bordercolor"),f("borderwidth"),f("thickness"),f("autorange",!o.isValidRange(i.range)),f("range");var u=r._subplots;if(u)for(var b=u.cartesian.filter(function(p){return p.substr(0,p.indexOf("y"))===P.name2id(a)}).map(function(p){return p.substr(p.indexOf("y"),p.length)}),_=c.simpleMap(b,P.id2name),C=0;C<_.length;C++){var M=_[C];x=i[M]||{},y=g.newContainer(s,M,"yaxis");var E=r[M],A;x.range&&E.isValidRange(x.range)&&(A="fixed");var h=v("rangemode",A);h!=="match"&&v("range",E.range.slice())}s._input=i}}}),dF=Ft((Q,$)=>{var c=Rc().list,g=Y0().getAutoRange,P=S6();$.exports=function(S){for(var t=c(S,"x",!0),e=0;e<t.length;e++){var r=t[e],a=r[P.name];a&&a.visible&&a.autorange&&(a._input.autorange=!0,a._input.range=a.range=g(S,r))}}}),pF=Ft((Q,$)=>{var c=un(),g=Xo(),P=Kc(),S=bn(),t=S.strTranslate,e=js(),r=li(),a=lp(),n=Mf(),o=Rc(),i=up(),s=P0(),f=S6();$.exports=function(h){for(var p=h._fullLayout,k=p._rangeSliderData,w=0;w<k.length;w++){var R=k[w][f.name];R._clipId=R._id+"-"+p._uid}function O(V){return V._name}var N=p._infolayer.selectAll("g."+f.containerClassName).data(k,O);N.exit().each(function(V){var H=V[f.name];p._topdefs.select("#"+H._clipId).remove()}).remove(),k.length!==0&&(N.enter().append("g").classed(f.containerClassName,!0).attr("pointer-events","all"),N.each(function(V){var H=c.select(this),F=V[f.name],U=p[o.id2name(V.anchor)],W=F[o.id2name(V.anchor)];if(F.range){var q=S.simpleMap(F.range,V.r2l),X=S.simpleMap(V.range,V.r2l),lt;X[0]<X[1]?lt=[Math.min(q[0],X[0]),Math.max(q[1],X[1])]:lt=[Math.max(q[0],X[0]),Math.min(q[1],X[1])],F.range=F._input.range=S.simpleMap(lt,V.l2r)}V.cleanRange("rangeslider.range");var yt=p._size,pt=V.domain;F._width=yt.w*(pt[1]-pt[0]);var st=Math.round(yt.l+yt.w*pt[0]),tt=Math.round(yt.t+yt.h*(1-V._counterDomainMin)+(V.side==="bottom"?V._depth:0)+F._offsetShift+f.extraPad);H.attr("transform",t(st,tt)),F._rl=S.simpleMap(F.range,V.r2l);var dt=F._rl[0],rt=F._rl[1],at=rt-dt;if(F.p2d=function(Ht){return Ht/F._width*at+dt},F.d2p=function(Ht){return(Ht-dt)/at*F._width},V.rangebreaks){var vt=V.locateBreaks(dt,rt);if(vt.length){var it,Y,ft=0;for(it=0;it<vt.length;it++)Y=vt[it],ft+=Y.max-Y.min;var ut=F._width/(rt-dt-ft),wt=[-ut*dt];for(it=0;it<vt.length;it++)Y=vt[it],wt.push(wt[wt.length-1]-ut*(Y.max-Y.min));for(F.d2p=function(Ht){for(var Jt=wt[0],ge=0;ge<vt.length;ge++){var he=vt[ge];if(Ht>=he.max)Jt=wt[ge+1];else if(Ht<he.min)break}return Jt+ut*Ht},it=0;it<vt.length;it++)Y=vt[it],Y.pmin=F.d2p(Y.min),Y.pmax=F.d2p(Y.max);F.p2d=function(Ht){for(var Jt=wt[0],ge=0;ge<vt.length;ge++){var he=vt[ge];if(Ht>=he.pmax)Jt=wt[ge+1];else if(Ht<he.pmin)break}return(Ht-Jt)/ut}}}if(W.rangemode!=="match"){var zt=U.r2l(W.range[0]),Pt=U.r2l(W.range[1]),Wt=Pt-zt;F.d2pOppAxis=function(Ht){return(Ht-zt)/Wt*F._height}}H.call(u,h,V,F).call(b,h,V,F).call(_,h,V,F).call(M,h,V,F,W).call(E,h,V,F).call(A,h,V,F),y(H,h,V,F),T(H,h,V,F,U,W),V.side==="bottom"&&a.draw(h,V._id+"title",{propContainer:V,propName:V._name+".title.text",placeholder:p._dfltTitle.x,attributes:{x:V._offset+V._length/2,y:tt+F._height+F._offsetShift+10+1.5*V.title.font.size,"text-anchor":"middle"}})}))};function x(h){return typeof h.clientX=="number"?h.clientX:h.touches&&h.touches.length>0?h.touches[0].clientX:0}function y(h,p,k,w){if(p._context.staticPlot)return;var R=h.select("rect."+f.slideBoxClassName).node(),O=h.select("rect."+f.grabAreaMinClassName).node(),N=h.select("rect."+f.grabAreaMaxClassName).node();function V(){var H=c.event,F=H.target,U=x(H),W=U-h.node().getBoundingClientRect().left,q=w.d2p(k._rl[0]),X=w.d2p(k._rl[1]),lt=i.coverSlip();this.addEventListener("touchmove",yt),this.addEventListener("touchend",pt),lt.addEventListener("mousemove",yt),lt.addEventListener("mouseup",pt);function yt(st){var tt=x(st),dt=+tt-U,rt,at,vt;switch(F){case R:if(vt="ew-resize",q+dt>k._length||X+dt<0)return;rt=q+dt,at=X+dt;break;case O:if(vt="col-resize",q+dt>k._length)return;rt=q+dt,at=X;break;case N:if(vt="col-resize",X+dt<0)return;rt=q,at=X+dt;break;default:vt="ew-resize",rt=W,at=W+dt;break}if(at<rt){var it=at;at=rt,rt=it}w._pixelMin=rt,w._pixelMax=at,s(c.select(lt),vt),v(h,p,k,w)}function pt(){lt.removeEventListener("mousemove",yt),lt.removeEventListener("mouseup",pt),this.removeEventListener("touchmove",yt),this.removeEventListener("touchend",pt),S.removeElement(lt)}}h.on("mousedown",V),h.on("touchstart",V)}function v(h,p,k,w){function R(V){return k.l2r(S.constrain(V,w._rl[0],w._rl[1]))}var O=R(w.p2d(w._pixelMin)),N=R(w.p2d(w._pixelMax));window.requestAnimationFrame(function(){g.call("_guiRelayout",p,k._name+".range",[O,N])})}function T(h,p,k,w,R,O){var N=f.handleWidth/2;function V(st){return S.constrain(st,0,w._width)}function H(st){return S.constrain(st,0,w._height)}function F(st){return S.constrain(st,-N,w._width+N)}var U=V(w.d2p(k._rl[0])),W=V(w.d2p(k._rl[1]));if(h.select("rect."+f.slideBoxClassName).attr("x",U).attr("width",W-U),h.select("rect."+f.maskMinClassName).attr("width",U),h.select("rect."+f.maskMaxClassName).attr("x",W).attr("width",w._width-W),O.rangemode!=="match"){var q=w._height-H(w.d2pOppAxis(R._rl[1])),X=w._height-H(w.d2pOppAxis(R._rl[0]));h.select("rect."+f.maskMinOppAxisClassName).attr("x",U).attr("height",q).attr("width",W-U),h.select("rect."+f.maskMaxOppAxisClassName).attr("x",U).attr("y",X).attr("height",w._height-X).attr("width",W-U),h.select("rect."+f.slideBoxClassName).attr("y",q).attr("height",X-q)}var lt=.5,yt=Math.round(F(U-N))-lt,pt=Math.round(F(W-N))+lt;h.select("g."+f.grabberMinClassName).attr("transform",t(yt,lt)),h.select("g."+f.grabberMaxClassName).attr("transform",t(pt,lt))}function u(h,p,k,w){var R=S.ensureSingle(h,"rect",f.bgClassName,function(H){H.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),O=w.borderwidth%2===0?w.borderwidth:w.borderwidth-1,N=-w._offsetShift,V=e.crispRound(p,w.borderwidth);R.attr({width:w._width+O,height:w._height+O,transform:t(N,N),"stroke-width":V}).call(r.stroke,w.bordercolor).call(r.fill,w.bgcolor)}function b(h,p,k,w){var R=p._fullLayout,O=S.ensureSingleById(R._topdefs,"clipPath",w._clipId,function(N){N.append("rect").attr({x:0,y:0})});O.select("rect").attr({width:w._width,height:w._height})}function _(h,p,k,w){var R=p.calcdata,O=h.selectAll("g."+f.rangePlotClassName).data(k._subplotsWith,S.identity);O.enter().append("g").attr("class",function(V){return f.rangePlotClassName+" "+V}).call(e.setClipUrl,w._clipId,p),O.order(),O.exit().remove();var N;O.each(function(V,H){var F=c.select(this),U=H===0,W=o.getFromId(p,V,"y"),q=W._name,X=w[q],lt={data:[],layout:{xaxis:{type:k.type,domain:[0,1],range:w.range.slice(),calendar:k.calendar},width:w._width,height:w._height,margin:{t:0,b:0,l:0,r:0}},_context:p._context};k.rangebreaks&&(lt.layout.xaxis.rangebreaks=k.rangebreaks),lt.layout[q]={type:W.type,domain:[0,1],range:X.rangemode!=="match"?X.range.slice():W.range.slice(),calendar:W.calendar},W.rangebreaks&&(lt.layout[q].rangebreaks=W.rangebreaks),P.supplyDefaults(lt);var yt=lt._fullLayout.xaxis,pt=lt._fullLayout[q];yt.clearCalc(),yt.setScale(),pt.clearCalc(),pt.setScale();var st={id:V,plotgroup:F,xaxis:yt,yaxis:pt,isRangePlot:!0};U?N=st:(st.mainplot="xy",st.mainplotinfo=N),n.rangePlot(p,st,C(R,V))})}function C(h,p){for(var k=[],w=0;w<h.length;w++){var R=h[w],O=R[0].trace;O.xaxis+O.yaxis===p&&k.push(R)}return k}function M(h,p,k,w,R){var O=S.ensureSingle(h,"rect",f.maskMinClassName,function(F){F.attr({x:0,y:0,"shape-rendering":"crispEdges"})});O.attr("height",w._height).call(r.fill,f.maskColor);var N=S.ensureSingle(h,"rect",f.maskMaxClassName,function(F){F.attr({y:0,"shape-rendering":"crispEdges"})});if(N.attr("height",w._height).call(r.fill,f.maskColor),R.rangemode!=="match"){var V=S.ensureSingle(h,"rect",f.maskMinOppAxisClassName,function(F){F.attr({y:0,"shape-rendering":"crispEdges"})});V.attr("width",w._width).call(r.fill,f.maskOppAxisColor);var H=S.ensureSingle(h,"rect",f.maskMaxOppAxisClassName,function(F){F.attr({y:0,"shape-rendering":"crispEdges"})});H.attr("width",w._width).style("border-top",f.maskOppBorder).call(r.fill,f.maskOppAxisColor)}}function E(h,p,k,w){if(!p._context.staticPlot){var R=S.ensureSingle(h,"rect",f.slideBoxClassName,function(O){O.attr({y:0,cursor:f.slideBoxCursor,"shape-rendering":"crispEdges"})});R.attr({height:w._height,fill:f.slideBoxFill})}}function A(h,p,k,w){var R=S.ensureSingle(h,"g",f.grabberMinClassName),O=S.ensureSingle(h,"g",f.grabberMaxClassName),N={x:0,width:f.handleWidth,rx:f.handleRadius,fill:r.background,stroke:r.defaultLine,"stroke-width":f.handleStrokeWidth,"shape-rendering":"crispEdges"},V={y:Math.round(w._height/4),height:Math.round(w._height/2)},H=S.ensureSingle(R,"rect",f.handleMinClassName,function(X){X.attr(N)});H.attr(V);var F=S.ensureSingle(O,"rect",f.handleMaxClassName,function(X){X.attr(N)});F.attr(V);var U={width:f.grabAreaWidth,x:0,y:0,fill:f.grabAreaFill,cursor:p._context.staticPlot?void 0:f.grabAreaCursor},W=S.ensureSingle(R,"rect",f.grabAreaMinClassName,function(X){X.attr(U)});W.attr("height",w._height);var q=S.ensureSingle(O,"rect",f.grabAreaMaxClassName,function(X){X.attr(U)});q.attr("height",w._height)}}),mF=Ft((Q,$)=>{var c=bn(),g=M6(),P=EM(),S=hF();$.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:c.extendFlat({},g,{yaxis:P})}}},layoutAttributes:M6(),handleDefaults:fF(),calcAutorange:dF(),draw:pF(),isVisible:S.isVisible,makeData:S.makeData,autoMarginOpts:S.autoMarginOpts}}),E6=Ft((Q,$)=>{var c=Ea(),g=bi(),P=pu().templatedArray,S=P("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"});$.exports={visible:{valType:"boolean",editType:"plot"},buttons:S,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:c({editType:"plot"}),bgcolor:{valType:"color",dflt:g.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:g.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}),CM=Ft((Q,$)=>{$.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}),gF=Ft((Q,$)=>{var c=bn(),g=li(),P=pu(),S=Md(),t=E6(),e=CM();$.exports=function(n,o,i,s,f){var x=n.rangeselector||{},y=P.newContainer(o,"rangeselector");function v(C,M){return c.coerce(x,y,t,C,M)}var T=S(x,y,{name:"buttons",handleItemDefaults:r,calendar:f}),u=v("visible",T.length>0);if(u){var b=a(o,i,s);v("x",b[0]),v("y",b[1]),c.noneOrAll(n,o,["x","y"]),v("xanchor"),v("yanchor"),c.coerceFont(v,"font",i.font);var _=v("bgcolor");v("activecolor",g.contrast(_,e.lightAmount,e.darkAmount)),v("bordercolor"),v("borderwidth")}};function r(n,o,i,s){var f=s.calendar;function x(T,u){return c.coerce(n,o,t.buttons,T,u)}var y=x("visible");if(y){var v=x("step");v!=="all"&&(f&&f!=="gregorian"&&(v==="month"||v==="year")?o.stepmode="backward":x("stepmode"),x("count")),x("label")}}function a(n,o,i){for(var s=i.filter(function(v){return o[v].anchor===n._id}),f=0,x=0;x<s.length;x++){var y=o[s[x]].domain;y&&(f=Math.max(y[1],f))}return[n.domain[0],f+e.yPad]}}),vF=Ft((Q,$)=>{var c=ia(),g=bn().titleCase;$.exports=function(S,t){var e=S._name,r={};if(t.step==="all")r[e+".autorange"]=!0;else{var a=P(S,t);r[e+".range[0]"]=a[0],r[e+".range[1]"]=a[1]}return r};function P(S,t){var e=S.range,r=new Date(S.r2l(e[1])),a=t.step,n=c["utc"+g(a)],o=t.count,i;switch(t.stepmode){case"backward":i=S.l2r(+n.offset(r,-o));break;case"todate":var s=n.offset(r,-o);i=S.l2r(+n.ceil(s));break}var f=e[1];return[i,f]}}),yF=Ft((Q,$)=>{var c=un(),g=Xo(),P=Kc(),S=li(),t=js(),e=bn(),r=e.strTranslate,a=tc(),n=Rc(),o=Af(),i=o.LINE_SPACING,s=o.FROM_TL,f=o.FROM_BR,x=CM(),y=vF();$.exports=function(A){var h=A._fullLayout,p=h._infolayer.selectAll(".rangeselector").data(v(A),T);p.enter().append("g").classed("rangeselector",!0),p.exit().remove(),p.style({cursor:"pointer","pointer-events":"all"}),p.each(function(k){var w=c.select(this),R=k,O=R.rangeselector,N=w.selectAll("g.button").data(e.filterVisible(O.buttons));N.enter().append("g").classed("button",!0),N.exit().remove(),N.each(function(V){var H=c.select(this),F=y(R,V);V._isActive=u(R,V,F),H.call(b,O,V),H.call(C,O,V,A),H.on("click",function(){A._dragged||g.call("_guiRelayout",A,F)}),H.on("mouseover",function(){V._isHovered=!0,H.call(b,O,V)}),H.on("mouseout",function(){V._isHovered=!1,H.call(b,O,V)})}),E(A,N,O,R._name,w)})};function v(A){for(var h=n.list(A,"x",!0),p=[],k=0;k<h.length;k++){var w=h[k];w.rangeselector&&w.rangeselector.visible&&p.push(w)}return p}function T(A){return A._id}function u(A,h,p){if(h.step==="all")return A.autorange===!0;var k=Object.keys(p);return A.range[0]===p[k[0]]&&A.range[1]===p[k[1]]}function b(A,h,p){var k=e.ensureSingle(A,"rect","selector-rect",function(w){w.attr("shape-rendering","crispEdges")});k.attr({rx:x.rx,ry:x.ry}),k.call(S.stroke,h.bordercolor).call(S.fill,_(h,p)).style("stroke-width",h.borderwidth+"px")}function _(A,h){return h._isActive||h._isHovered?A.activecolor:A.bgcolor}function C(A,h,p,k){function w(O){a.convertToTspans(O,k)}var R=e.ensureSingle(A,"text","selector-text",function(O){O.attr("text-anchor","middle")});R.call(t.font,h.font).text(M(p,k._fullLayout._meta)).call(w)}function M(A,h){return A.label?h?e.templateString(A.label,h):A.label:A.step==="all"?"all":A.count+A.step.charAt(0)}function E(A,h,p,k,w){var R=0,O=0,N=p.borderwidth;h.each(function(){var q=c.select(this),X=q.select(".selector-text"),lt=p.font.size*i,yt=Math.max(lt*a.lineCount(X),16)+3;O=Math.max(O,yt)}),h.each(function(){var q=c.select(this),X=q.select(".selector-rect"),lt=q.select(".selector-text"),yt=lt.node()&&t.bBox(lt.node()).width,pt=p.font.size*i,st=a.lineCount(lt),tt=Math.max(yt+10,x.minButtonWidth);q.attr("transform",r(N+R,N)),X.attr({x:0,y:0,width:tt,height:O}),a.positionText(lt,tt/2,O/2-(st-1)*pt/2+3),R+=tt+5});var V=A._fullLayout._size,H=V.l+V.w*p.x,F=V.t+V.h*(1-p.y),U="left";e.isRightAnchor(p)&&(H-=R,U="right"),e.isCenterAnchor(p)&&(H-=R/2,U="center");var W="top";e.isBottomAnchor(p)&&(F-=O,W="bottom"),e.isMiddleAnchor(p)&&(F-=O/2,W="middle"),R=Math.ceil(R),O=Math.ceil(O),H=Math.round(H),F=Math.round(F),P.autoMargin(A,k+"-range-selector",{x:p.x,y:p.y,l:R*s[U],r:R*f[U],b:O*f[W],t:O*s[W]}),w.attr("transform",r(H,F))}}),xF=Ft((Q,$)=>{$.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:E6()}}},layoutAttributes:E6(),handleDefaults:gF(),draw:yF()}}),Nh=Ft(Q=>{var $=Ta().extendFlat;Q.attributes=function(c,g){c=c||{},g=g||{};var P={valType:"info_array",editType:c.editType,items:[{valType:"number",min:0,max:1,editType:c.editType},{valType:"number",min:0,max:1,editType:c.editType}],dflt:[0,1]};c.name&&c.name+"",c.trace,g.description&&""+g.description;var S={x:$({},P,{}),y:$({},P,{}),editType:c.editType};return c.noGridCell||(S.row={valType:"integer",min:0,dflt:0,editType:c.editType},S.column={valType:"integer",min:0,dflt:0,editType:c.editType}),S},Q.defaults=function(c,g,P,S){var t=S&&S.x||[0,1],e=S&&S.y||[0,1],r=g.grid;if(r){var a=P("domain.column");a!==void 0&&(a<r.columns?t=r._domains.x[a]:delete c.domain.column);var n=P("domain.row");n!==void 0&&(n<r.rows?e=r._domains.y[n]:delete c.domain.row)}var o=P("domain.x",t),i=P("domain.y",e);o[0]<o[1]||(c.domain.x=t.slice()),i[0]<i[1]||(c.domain.y=e.slice())}}),LM=Ft((Q,$)=>{var c=bn(),g=vo().counter,P=Nh().attributes,S=ic().idRegex,t=pu(),e={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[g("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[S.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[S.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:P({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,x){var y=f[x+"axes"],v=Object.keys((s._splomAxes||{})[x]||{});if(Array.isArray(y))return y;if(v.length)return v}function a(s,f){var x=s.grid||{},y=r(f,x,"x"),v=r(f,x,"y");if(!s.grid&&!y&&!v)return;var T=Array.isArray(x.subplots)&&Array.isArray(x.subplots[0]),u=Array.isArray(y),b=Array.isArray(v),_=u&&y!==x.xaxes&&b&&v!==x.yaxes,C,M;T?(C=x.subplots.length,M=x.subplots[0].length):(b&&(C=v.length),u&&(M=y.length));var E=t.newContainer(f,"grid");function A(F,U){return c.coerce(x,E,e,F,U)}var h=A("rows",C),p=A("columns",M);if(!(h*p>1)){delete f.grid;return}if(!T&&!u&&!b){var k=A("pattern")==="independent";k&&(T=!0)}E._hasSubplotGrid=T;var w=A("roworder"),R=w==="top to bottom",O=T?.2:.1,N=T?.3:.1,V,H;_&&f._splomGridDflt&&(V=f._splomGridDflt.xside,H=f._splomGridDflt.yside),E._domains={x:n("x",A,O,V,p),y:n("y",A,N,H,h,R)}}function n(s,f,x,y,v,T){var u=f(s+"gap",x),b=f("domain."+s);f(s+"side",y);for(var _=new Array(v),C=b[0],M=(b[1]-C)/(v-u),E=M*(1-u),A=0;A<v;A++){var h=C+M*A;_[T?v-1-A:A]=[h,h+E]}return _}function o(s,f){var x=f.grid;if(!(!x||!x._domains)){var y=s.grid||{},v=f._subplots,T=x._hasSubplotGrid,u=x.rows,b=x.columns,_=x.pattern==="independent",C,M,E,A,h,p,k,w=x._axisMap={};if(T){var R=y.subplots||[];p=x.subplots=new Array(u);var O=1;for(C=0;C<u;C++){var N=p[C]=new Array(b),V=R[C]||[];for(M=0;M<b;M++)if(_?(h=O===1?"xy":"x"+O+"y"+O,O++):h=V[M],N[M]="",v.cartesian.indexOf(h)!==-1){if(k=h.indexOf("y"),E=h.slice(0,k),A=h.slice(k),w[E]!==void 0&&w[E]!==M||w[A]!==void 0&&w[A]!==C)continue;N[M]=h,w[E]=M,w[A]=C}}}else{var H=r(f,y,"x"),F=r(f,y,"y");x.xaxes=i(H,v.xaxis,b,w,"x"),x.yaxes=i(F,v.yaxis,u,w,"y")}var U=x._anchors={},W=x.roworder==="top to bottom";for(var q in w){var X=q.charAt(0),lt=x[X+"side"],yt,pt,st;if(lt.length<8)U[q]="free";else if(X==="x"){if(lt.charAt(0)==="t"===W?(yt=0,pt=1,st=u):(yt=u-1,pt=-1,st=-1),T){var tt=w[q];for(C=yt;C!==st;C+=pt)if(h=p[C][tt],!!h&&(k=h.indexOf("y"),h.slice(0,k)===q)){U[q]=h.slice(k);break}}else for(C=yt;C!==st;C+=pt)if(A=x.yaxes[C],v.cartesian.indexOf(q+A)!==-1){U[q]=A;break}}else if(lt.charAt(0)==="l"?(yt=0,pt=1,st=b):(yt=b-1,pt=-1,st=-1),T){var dt=w[q];for(C=yt;C!==st;C+=pt)if(h=p[dt][C],!!h&&(k=h.indexOf("y"),h.slice(k)===q)){U[q]=h.slice(0,k);break}}else for(C=yt;C!==st;C+=pt)if(E=x.xaxes[C],v.cartesian.indexOf(E+q)!==-1){U[q]=E;break}}}}function i(s,f,x,y,v){var T=new Array(x),u;function b(_,C){f.indexOf(C)!==-1&&y[C]===void 0?(T[_]=C,y[C]=_):T[_]=""}if(Array.isArray(s))for(u=0;u<x;u++)b(u,s[u]);else for(b(0,v),u=1;u<x;u++)b(u,v+(u+1));return T}$.exports={moduleType:"component",name:"grid",schema:{layout:{grid:e}},layoutAttributes:e,sizeDefaults:a,contentDefaults:o}}),PM=Ft((Q,$)=>{$.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"}}),_F=Ft((Q,$)=>{var c=ra(),g=Xo(),P=bn(),S=pu(),t=PM();$.exports=function(e,r,a,n){var o="error_"+n.axis,i=S.newContainer(r,o),s=e[o]||{};function f(_,C){return P.coerce(s,i,t,_,C)}var x=s.array!==void 0||s.value!==void 0||s.type==="sqrt",y=f("visible",x);if(y!==!1){var v=f("type","array"in s?"data":"percent"),T=!0;v!=="sqrt"&&(T=f("symmetric",!((v==="data"?"arrayminus":"valueminus")in s))),v==="data"?(f("array"),f("traceref"),T||(f("arrayminus"),f("tracerefminus"))):(v==="percent"||v==="constant")&&(f("value"),T||f("valueminus"));var u="copy_"+n.inherit+"style";if(n.inherit){var b=r["error_"+n.inherit];(b||{}).visible&&f(u,!(s.color||c(s.thickness)||c(s.width)))}(!n.inherit||!i[u])&&(f("color",a),f("thickness"),f("width",g.traceIs(r,"gl3d")?0:4))}}}),zM=Ft((Q,$)=>{$.exports=function(g){var P=g.type,S=g.symmetric;if(P==="data"){var t=g.array||[];if(S)return function(n,o){var i=+t[o];return[i,i]};var e=g.arrayminus||[];return function(n,o){var i=+t[o],s=+e[o];return!isNaN(i)||!isNaN(s)?[s||0,i||0]:[NaN,NaN]}}else{var r=c(P,g.value),a=c(P,g.valueminus);return S||g.valueminus===void 0?function(n){var o=r(n);return[o,o]}:function(n){return[a(n),r(n)]}}};function c(g,P){if(g==="percent")return function(S){return Math.abs(S*P/100)};if(g==="constant")return function(){return Math.abs(P)};if(g==="sqrt")return function(S){return Math.sqrt(Math.abs(S))}}}),bF=Ft((Q,$)=>{var c=ra(),g=Xo(),P=Es(),S=bn(),t=zM();$.exports=function(r){for(var a=r.calcdata,n=0;n<a.length;n++){var o=a[n],i=o[0].trace;if(i.visible===!0&&g.traceIs(i,"errorBarsOK")){var s=P.getFromId(r,i.xaxis),f=P.getFromId(r,i.yaxis);e(o,i,s,"x"),e(o,i,f,"y")}}};function e(r,a,n,o){var i=a["error_"+o]||{},s=i.visible&&["linear","log"].indexOf(n.type)!==-1,f=[];if(s){for(var x=t(i),y=0;y<r.length;y++){var v=r[y],T=v.i;if(T===void 0)T=y;else if(T===null)continue;var u=v[o];if(c(n.c2l(u))){var b=x(u,T);if(c(b[0])&&c(b[1])){var _=v[o+"s"]=u-b[0],C=v[o+"h"]=u+b[1];f.push(_,C)}}}var M=n._id,E=a._extremes[M],A=P.findExtremes(n,f,S.extendFlat({tozero:E.opts.tozero},{padded:!0}));E.min=E.min.concat(A.min),E.max=E.max.concat(A.max)}}}),wF=Ft((Q,$)=>{var c=un(),g=ra(),P=js(),S=Ac();$.exports=function(e,r,a,n){var o,i=a.xaxis,s=a.yaxis,f=n&&n.duration>0,x=e._context.staticPlot;r.each(function(y){var v=y[0].trace,T=v.error_x||{},u=v.error_y||{},b;v.ids&&(b=function(E){return E.id});var _=S.hasMarkers(v)&&v.marker.maxdisplayed>0;!u.visible&&!T.visible&&(y=[]);var C=c.select(this).selectAll("g.errorbar").data(y,b);if(C.exit().remove(),!!y.length){T.visible||C.selectAll("path.xerror").remove(),u.visible||C.selectAll("path.yerror").remove(),C.style("opacity",1);var M=C.enter().append("g").classed("errorbar",!0);f&&M.style("opacity",0).transition().duration(n.duration).style("opacity",1),P.setClipUrl(C,a.layerClipId,e),C.each(function(E){var A=c.select(this),h=t(E,i,s);if(!(_&&!E.vis)){var p,k=A.select("path.yerror");if(u.visible&&g(h.x)&&g(h.yh)&&g(h.ys)){var w=u.width;p="M"+(h.x-w)+","+h.yh+"h"+2*w+"m-"+w+",0V"+h.ys,h.noYS||(p+="m-"+w+",0h"+2*w),o=!k.size(),o?k=A.append("path").style("vector-effect",x?"none":"non-scaling-stroke").classed("yerror",!0):f&&(k=k.transition().duration(n.duration).ease(n.easing)),k.attr("d",p)}else k.remove();var R=A.select("path.xerror");if(T.visible&&g(h.y)&&g(h.xh)&&g(h.xs)){var O=(T.copy_ystyle?u:T).width;p="M"+h.xh+","+(h.y-O)+"v"+2*O+"m0,-"+O+"H"+h.xs,h.noXS||(p+="m0,-"+O+"v"+2*O),o=!R.size(),o?R=A.append("path").style("vector-effect",x?"none":"non-scaling-stroke").classed("xerror",!0):f&&(R=R.transition().duration(n.duration).ease(n.easing)),R.attr("d",p)}else R.remove()}})}})};function t(e,r,a){var n={x:r.c2p(e.x),y:a.c2p(e.y)};return e.yh!==void 0&&(n.yh=a.c2p(e.yh),n.ys=a.c2p(e.ys),g(n.ys)||(n.noYS=!0,n.ys=a.c2p(e.ys,!0))),e.xh!==void 0&&(n.xh=r.c2p(e.xh),n.xs=r.c2p(e.xs),g(n.xs)||(n.noXS=!0,n.xs=r.c2p(e.xs,!0))),n}}),kF=Ft((Q,$)=>{var c=un(),g=li();$.exports=function(P){P.each(function(S){var t=S[0].trace,e=t.error_y||{},r=t.error_x||{},a=c.select(this);a.selectAll("path.yerror").style("stroke-width",e.thickness+"px").call(g.stroke,e.color),r.copy_ystyle&&(r=e),a.selectAll("path.xerror").style("stroke-width",r.thickness+"px").call(g.stroke,r.color)})}}),TF=Ft((Q,$)=>{var c=bn(),g=Yc().overrideAll,P=PM(),S={error_x:c.extendFlat({},P),error_y:c.extendFlat({},P)};delete S.error_x.copy_zstyle,delete S.error_y.copy_zstyle,delete S.error_y.copy_ystyle;var t={error_x:c.extendFlat({},P),error_y:c.extendFlat({},P),error_z:c.extendFlat({},P)};delete t.error_x.copy_ystyle,delete t.error_y.copy_ystyle,delete t.error_z.copy_ystyle,delete t.error_z.copy_zstyle,$.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:S,bar:S,histogram:S,scatter3d:g(t,"calc","nested"),scattergl:g(S,"calc","nested")}},supplyDefaults:_F(),calc:bF(),makeComputeError:zM(),plot:wF(),style:kF(),hoverInfo:e};function e(r,a,n){(a.error_y||{}).visible&&(n.yerr=r.yh-r.y,a.error_y.symmetric||(n.yerrneg=r.y-r.ys)),(a.error_x||{}).visible&&(n.xerr=r.xh-r.x,a.error_x.symmetric||(n.xerrneg=r.x-r.xs))}}),AF=Ft((Q,$)=>{$.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"}}}),MF=Ft((Q,$)=>{var c=un(),g=fo(),P=Kc(),S=Xo(),t=Es(),e=up(),r=bn(),a=r.strTranslate,n=Ta().extendFlat,o=P0(),i=js(),s=li(),f=lp(),x=tc(),y=Hd().flipScale,v=Ky(),T=Z_(),u=Ad(),b=Af(),_=b.LINE_SPACING,C=b.FROM_TL,M=b.FROM_BR,E=AF().cn;function A(O){var N=O._fullLayout,V=N._infolayer.selectAll("g."+E.colorbar).data(h(O),function(H){return H._id});V.enter().append("g").attr("class",function(H){return H._id}).classed(E.colorbar,!0),V.each(function(H){var F=c.select(this);r.ensureSingle(F,"rect",E.cbbg),r.ensureSingle(F,"g",E.cbfills),r.ensureSingle(F,"g",E.cblines),r.ensureSingle(F,"g",E.cbaxis,function(W){W.classed(E.crisp,!0)}),r.ensureSingle(F,"g",E.cbtitleunshift,function(W){W.append("g").classed(E.cbtitle,!0)}),r.ensureSingle(F,"rect",E.cboutline);var U=p(F,H,O);U&&U.then&&(O._promises||[]).push(U),O._context.edits.colorbarPosition&&k(F,H,O)}),V.exit().each(function(H){P.autoMargin(O,H._id)}).remove(),V.order()}function h(O){var N=O._fullLayout,V=O.calcdata,H=[],F,U,W,q;function X(Y){return n(Y,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function lt(){typeof q.calc=="function"?q.calc(O,W,F):(F._fillgradient=U.reversescale?y(U.colorscale):U.colorscale,F._zrange=[U[q.min],U[q.max]])}for(var yt=0;yt<V.length;yt++){var pt=V[yt];if(W=pt[0].trace,!!W._module){var st=W._module.colorbar;if(W.visible===!0&&st)for(var tt=Array.isArray(st),dt=tt?st:[st],rt=0;rt<dt.length;rt++){q=dt[rt];var at=q.container;U=at?W[at]:W,U&&U.showscale&&(F=X(U.colorbar),F._id="cb"+W.uid+(tt&&at?"-"+at:""),F._traceIndex=W.index,F._propPrefix=(at?at+".":"")+"colorbar.",F._meta=W._meta,lt(),H.push(F))}}}for(var vt in N._colorAxes)if(U=N[vt],U.showscale){var it=N._colorAxes[vt];F=X(U.colorbar),F._id="cb"+vt,F._propPrefix=vt+".colorbar.",F._meta=N._meta,q={min:"cmin",max:"cmax"},it[0]!=="heatmap"&&(W=it[1],q.calc=W._module.colorbar.calc),lt(),H.push(F)}return H}function p(O,N,V){var H=N.orientation==="v",F=N.len,U=N.lenmode,W=N.thickness,q=N.thicknessmode,X=N.outlinewidth,lt=N.borderwidth,yt=N.bgcolor,pt=N.xanchor,st=N.yanchor,tt=N.xpad,dt=N.ypad,rt=N.x,at=H?N.y:1-N.y,vt=N.yref==="paper",it=N.xref==="paper",Y=V._fullLayout,ft=Y._size,ut=N._fillcolor,wt=N._line,zt=N.title,Pt=zt.side,Wt=N._zrange||c.extent((typeof ut=="function"?ut:wt.color).domain()),Ht=typeof wt.color=="function"?wt.color:function(){return wt.color},Jt=typeof ut=="function"?ut:function(){return ut},ge=N._levels,he=w(V,N,Wt),de=he.fill,se=he.line,Tt=Math.round(W*(q==="fraction"?H?ft.w:ft.h:1)),Lt=Tt/(H?ft.w:ft.h),Mt=Math.round(F*(U==="fraction"?H?ft.h:ft.w:1)),te=Mt/(H?ft.h:ft.w),ve=it?ft.w:V._fullLayout.width,oe=vt?ft.h:V._fullLayout.height,Te=Math.round(H?rt*ve+tt:at*oe+dt),He={center:.5,right:1}[pt]||0,Ge={top:1,middle:.5}[st]||0,cr=H?rt-He*Lt:at-Ge*Lt,ur=H?at-Ge*te:rt-He*te,jr=Math.round(H?oe*(1-ur):ve*ur);N._lenFrac=te,N._thickFrac=Lt,N._uFrac=cr,N._vFrac=ur;var Hr=N._axis=R(V,N,Wt);Hr.position=Lt+(H?rt+tt/ft.w:at+dt/ft.h);var br=["top","bottom"].indexOf(Pt)!==-1;if(H&&br&&(Hr.title.side=Pt,Hr.titlex=rt+tt/ft.w,Hr.titley=ur+(zt.side==="top"?te-dt/ft.h:dt/ft.h)),!H&&!br&&(Hr.title.side=Pt,Hr.titley=at+dt/ft.h,Hr.titlex=ur+tt/ft.w),wt.color&&N.tickmode==="auto"){Hr.tickmode="linear",Hr.tick0=ge.start;var Kr=ge.size,rn=r.constrain(Mt/50,4,15)+1,Ce=(Wt[1]-Wt[0])/((N.nticks||rn)*Kr);if(Ce>1){var $t=Math.pow(10,Math.floor(Math.log(Ce)/Math.LN10));Kr*=$t*r.roundUp(Ce/$t,[2,5,10]),(Math.abs(ge.start)/ge.size+1e-6)%1<2e-6&&(Hr.tick0=0)}Hr.dtick=Kr}Hr.domain=H?[ur+dt/ft.h,ur+te-dt/ft.h]:[ur+tt/ft.w,ur+te-tt/ft.w],Hr.setScale(),O.attr("transform",a(Math.round(ft.l),Math.round(ft.t)));var ne=O.select("."+E.cbtitleunshift).attr("transform",a(-Math.round(ft.l),-Math.round(ft.t))),Ct=Hr.ticklabelposition,gt=Hr.title.font.size,St=O.select("."+E.cbaxis),Nt,ee=0,le=0;function we(Tr,pr){var Jr={propContainer:Hr,propName:N._propPrefix+"title.text",traceIndex:N._traceIndex,_meta:N._meta,placeholder:Y._dfltTitle.colorbar,containerGroup:O.select("."+E.cbtitle)},Vn=Tr.charAt(0)==="h"?Tr.substr(1):"h"+Tr;O.selectAll("."+Vn+",."+Vn+"-math-group").remove(),f.draw(V,Tr,n(Jr,pr||{}))}function Ue(){if(H&&br||!H&&!br){var Tr,pr;Pt==="top"&&(Tr=tt+ft.l+ve*rt,pr=dt+ft.t+oe*(1-ur-te)+3+gt*.75),Pt==="bottom"&&(Tr=tt+ft.l+ve*rt,pr=dt+ft.t+oe*(1-ur)-3-gt*.25),Pt==="right"&&(pr=dt+ft.t+oe*at+3+gt*.75,Tr=tt+ft.l+ve*ur),we(Hr._id+"title",{attributes:{x:Tr,y:pr,"text-anchor":H?"start":"middle"}})}}function qe(){if(H&&!br||!H&&br){var Tr=Hr.position||0,pr=Hr._offset+Hr._length/2,Jr,Vn;if(Pt==="right")Vn=pr,Jr=ft.l+ve*Tr+10+gt*(Hr.showticklabels?1:.5);else if(Jr=pr,Pt==="bottom"&&(Vn=ft.t+oe*Tr+10+(Ct.indexOf("inside")===-1?Hr.tickfont.size:0)+(Hr.ticks!=="inside"&&N.ticklen||0)),Pt==="top"){var Hn=zt.text.split("<br>").length;Vn=ft.t+oe*Tr+10-Tt-_*gt*Hn}we((H?"h":"v")+Hr._id+"title",{avoid:{selection:c.select(V).selectAll("g."+Hr._id+"tick"),side:Pt,offsetTop:H?0:ft.t,offsetLeft:H?ft.l:0,maxShift:H?Y.width:Y.height},attributes:{x:Jr,y:Vn,"text-anchor":"middle"},transform:{rotate:H?-90:0,offset:0}})}}function ar(){if(!H&&!br||H&&br){var Tr=O.select("."+E.cbtitle),pr=Tr.select("text"),Jr=[-X/2,X/2],Vn=Tr.select(".h"+Hr._id+"title-math-group").node(),Hn=15.6;pr.node()&&(Hn=parseInt(pr.node().style.fontSize,10)*_);var Kn;if(Vn?(Kn=i.bBox(Vn),le=Kn.width,ee=Kn.height,ee>Hn&&(Jr[1]-=(ee-Hn)/2)):pr.node()&&!pr.classed(E.jsPlaceholder)&&(Kn=i.bBox(pr.node()),le=Kn.width,ee=Kn.height),H){if(ee){if(ee+=5,Pt==="top")Hr.domain[1]-=ee/ft.h,Jr[1]*=-1;else{Hr.domain[0]+=ee/ft.h;var Ci=x.lineCount(pr);Jr[1]+=(1-Ci)*Hn}Tr.attr("transform",a(Jr[0],Jr[1])),Hr.setScale()}}else le&&(Pt==="right"&&(Hr.domain[0]+=(le+gt/2)/ft.w),Tr.attr("transform",a(Jr[0],Jr[1])),Hr.setScale())}O.selectAll("."+E.cbfills+",."+E.cblines).attr("transform",H?a(0,Math.round(ft.h*(1-Hr.domain[1]))):a(Math.round(ft.w*Hr.domain[0]),0)),St.attr("transform",H?a(0,Math.round(-ft.t)):a(Math.round(-ft.l),0));var ii=O.select("."+E.cbfills).selectAll("rect."+E.cbfill).attr("style","").data(de);ii.enter().append("rect").classed(E.cbfill,!0).attr("style",""),ii.exit().remove();var qn=Wt.map(Hr.c2p).map(Math.round).sort(function(fr,xr){return fr-xr});ii.each(function(fr,xr){var Qr=[xr===0?Wt[0]:(de[xr]+de[xr-1])/2,xr===de.length-1?Wt[1]:(de[xr]+de[xr+1])/2].map(Hr.c2p).map(Math.round);H&&(Qr[1]=r.constrain(Qr[1]+(Qr[1]>Qr[0])?1:-1,qn[0],qn[1]));var Cn=c.select(this).attr(H?"x":"y",Te).attr(H?"y":"x",c.min(Qr)).attr(H?"width":"height",Math.max(Tt,2)).attr(H?"height":"width",Math.max(c.max(Qr)-c.min(Qr),2));if(N._fillgradient)i.gradient(Cn,V,N._id,H?"vertical":"horizontalreversed",N._fillgradient,"fill");else{var wn=Jt(fr).replace("e-","");Cn.attr("fill",g(wn).toHexString())}});var oa=O.select("."+E.cblines).selectAll("path."+E.cbline).data(wt.color&&wt.width?se:[]);oa.enter().append("path").classed(E.cbline,!0),oa.exit().remove(),oa.each(function(fr){var xr=Te,Qr=Math.round(Hr.c2p(fr))+wt.width/2%1;c.select(this).attr("d","M"+(H?xr+","+Qr:Qr+","+xr)+(H?"h":"v")+Tt).call(i.lineGroupStyle,wt.width,Ht(fr),wt.dash)}),St.selectAll("g."+Hr._id+"tick,path").remove();var Hi=Te+Tt+(X||0)/2-(N.ticks==="outside"?1:0),We=t.calcTicks(Hr),rr=t.getTickSigns(Hr)[2];return t.drawTicks(V,Hr,{vals:Hr.ticks==="inside"?t.clipEnds(Hr,We):We,layer:St,path:t.makeTickPath(Hr,Hi,rr),transFn:t.makeTransTickFn(Hr)}),t.drawLabels(V,Hr,{vals:We,layer:St,transFn:t.makeTransTickLabelFn(Hr),labelFns:t.makeLabelFns(Hr,Hi)})}function Ar(){var Tr,pr=Tt+X/2;Ct.indexOf("inside")===-1&&(Tr=i.bBox(St.node()),pr+=H?Tr.width:Tr.height),Nt=ne.select("text");var Jr=0,Vn=H&&Pt==="top",Hn=!H&&Pt==="right",Kn=0;if(Nt.node()&&!Nt.classed(E.jsPlaceholder)){var Ci,ii=ne.select(".h"+Hr._id+"title-math-group").node();ii&&(H&&br||!H&&!br)?(Tr=i.bBox(ii),Jr=Tr.width,Ci=Tr.height):(Tr=i.bBox(ne.node()),Jr=Tr.right-ft.l-(H?Te:jr),Ci=Tr.bottom-ft.t-(H?jr:Te),!H&&Pt==="top"&&(pr+=Tr.height,Kn=Tr.height)),Hn&&(Nt.attr("transform",a(Jr/2+gt/2,0)),Jr*=2),pr=Math.max(pr,H?Jr:Ci)}var qn=(H?tt:dt)*2+pr+lt+X/2,oa=0;!H&&zt.text&&st==="bottom"&&at<=0&&(oa=qn/2,qn+=oa,Kn+=oa),Y._hColorbarMoveTitle=oa,Y._hColorbarMoveCBTitle=Kn;var Hi=lt+X,We=(H?Te:jr)-Hi/2-(H?tt:0),rr=(H?jr:Te)-(H?Mt:dt+Kn-oa);O.select("."+E.cbbg).attr("x",We).attr("y",rr).attr(H?"width":"height",Math.max(qn-oa,2)).attr(H?"height":"width",Math.max(Mt+Hi,2)).call(s.fill,yt).call(s.stroke,N.bordercolor).style("stroke-width",lt);var fr=Hn?Math.max(Jr-10,0):0;O.selectAll("."+E.cboutline).attr("x",(H?Te:jr+tt)+fr).attr("y",(H?jr+dt-Mt:Te)+(Vn?ee:0)).attr(H?"width":"height",Math.max(Tt,2)).attr(H?"height":"width",Math.max(Mt-(H?2*dt+ee:2*tt+fr),2)).call(s.stroke,N.outlinecolor).style({fill:"none","stroke-width":X});var xr=H?He*qn:0,Qr=H?0:(1-Ge)*qn-Kn;if(xr=it?ft.l-xr:-xr,Qr=vt?ft.t-Qr:-Qr,O.attr("transform",a(xr,Qr)),!H&&(lt||g(yt).getAlpha()&&!g.equals(Y.paper_bgcolor,yt))){var Cn=St.selectAll("text"),wn=Cn[0].length,Mn=O.select("."+E.cbbg).node(),ci=i.bBox(Mn),xi=i.getTranslate(O),Pi=2;Cn.each(function($r,Br){var Gr=0,dn=wn-1;if(Br===Gr||Br===dn){var an=i.bBox(this),Ee=i.getTranslate(this),dr;if(Br===dn){var Vr=an.right+Ee.x,yn=ci.right+xi.x+jr-lt-Pi+rt;dr=yn-Vr,dr>0&&(dr=0)}else if(Br===Gr){var Fn=an.left+Ee.x,Xn=ci.left+xi.x+jr+lt+Pi;dr=Xn-Fn,dr<0&&(dr=0)}dr&&(wn<3?this.setAttribute("transform","translate("+dr+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var Di={},Zi=C[pt],ui=M[pt],Pa=C[st],Wa=M[st],ze=qn-Tt;H?(U==="pixels"?(Di.y=at,Di.t=Mt*Pa,Di.b=Mt*Wa):(Di.t=Di.b=0,Di.yt=at+F*Pa,Di.yb=at-F*Wa),q==="pixels"?(Di.x=rt,Di.l=qn*Zi,Di.r=qn*ui):(Di.l=ze*Zi,Di.r=ze*ui,Di.xl=rt-W*Zi,Di.xr=rt+W*ui)):(U==="pixels"?(Di.x=rt,Di.l=Mt*Zi,Di.r=Mt*ui):(Di.l=Di.r=0,Di.xl=rt+F*Zi,Di.xr=rt-F*ui),q==="pixels"?(Di.y=1-at,Di.t=qn*Pa,Di.b=qn*Wa):(Di.t=ze*Pa,Di.b=ze*Wa,Di.yt=at-W*Pa,Di.yb=at+W*Wa));var Pe=N.y<.5?"b":"t",Rr=N.x<.5?"l":"r";V._fullLayout._reservedMargin[N._id]={};var qr={r:Y.width-We-xr,l:We+Di.r,b:Y.height-rr-Qr,t:rr+Di.b};it&&vt?P.autoMargin(V,N._id,Di):it?V._fullLayout._reservedMargin[N._id][Pe]=qr[Pe]:vt||H?V._fullLayout._reservedMargin[N._id][Rr]=qr[Rr]:V._fullLayout._reservedMargin[N._id][Pe]=qr[Pe]}return r.syncOrAsync([P.previousPromises,Ue,ar,qe,P.previousPromises,Ar],V)}function k(O,N,V){var H=N.orientation==="v",F=V._fullLayout,U=F._size,W,q,X;e.init({element:O.node(),gd:V,prepFn:function(){W=O.attr("transform"),o(O)},moveFn:function(lt,yt){O.attr("transform",W+a(lt,yt)),q=e.align((H?N._uFrac:N._vFrac)+lt/U.w,H?N._thickFrac:N._lenFrac,0,1,N.xanchor),X=e.align((H?N._vFrac:1-N._uFrac)-yt/U.h,H?N._lenFrac:N._thickFrac,0,1,N.yanchor);var pt=e.getCursor(q,X,N.xanchor,N.yanchor);o(O,pt)},doneFn:function(){if(o(O),q!==void 0&&X!==void 0){var lt={};lt[N._propPrefix+"x"]=q,lt[N._propPrefix+"y"]=X,N._traceIndex!==void 0?S.call("_guiRestyle",V,lt,N._traceIndex):S.call("_guiRelayout",V,lt)}}})}function w(O,N,V){var H=N._levels,F=[],U=[],W,q,X=H.end+H.size/100,lt=H.size,yt=1.001*V[0]-.001*V[1],pt=1.001*V[1]-.001*V[0];for(q=0;q<1e5&&(W=H.start+q*lt,!(lt>0?W>=X:W<=X));q++)W>yt&&W<pt&&F.push(W);if(N._fillgradient)U=[0];else if(typeof N._fillcolor=="function"){var st=N._filllevels;if(st)for(X=st.end+st.size/100,lt=st.size,q=0;q<1e5&&(W=st.start+q*lt,!(lt>0?W>=X:W<=X));q++)W>V[0]&&W<V[1]&&U.push(W);else U=F.map(function(tt){return tt-H.size/2}),U.push(U[U.length-1]+H.size)}else N._fillcolor&&typeof N._fillcolor=="string"&&(U=[0]);return H.size<0&&(F.reverse(),U.reverse()),{line:F,fill:U}}function R(O,N,V){var H=O._fullLayout,F=N.orientation==="v",U={type:"linear",range:V,tickmode:N.tickmode,nticks:N.nticks,tick0:N.tick0,dtick:N.dtick,tickvals:N.tickvals,ticktext:N.ticktext,ticks:N.ticks,ticklen:N.ticklen,tickwidth:N.tickwidth,tickcolor:N.tickcolor,showticklabels:N.showticklabels,labelalias:N.labelalias,ticklabelposition:N.ticklabelposition,ticklabeloverflow:N.ticklabeloverflow,ticklabelstep:N.ticklabelstep,tickfont:N.tickfont,tickangle:N.tickangle,tickformat:N.tickformat,exponentformat:N.exponentformat,minexponent:N.minexponent,separatethousands:N.separatethousands,showexponent:N.showexponent,showtickprefix:N.showtickprefix,tickprefix:N.tickprefix,showticksuffix:N.showticksuffix,ticksuffix:N.ticksuffix,title:N.title,showline:!0,anchor:"free",side:F?"right":"bottom",position:1},W=F?"y":"x",q={type:"linear",_id:W+N._id},X={letter:W,font:H.font,noAutotickangles:W==="y",noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:H.calendar};function lt(yt,pt){return r.coerce(U,q,u,yt,pt)}return v(U,q,lt,X,H),T(U,q,lt,X),q}$.exports={draw:A}}),SF=Ft((Q,$)=>{$.exports={moduleType:"component",name:"colorbar",attributes:T1(),supplyDefaults:fv(),draw:MF().draw,hasColorbar:L0()}}),EF=Ft((Q,$)=>{$.exports={moduleType:"component",name:"legend",layoutAttributes:P_(),supplyLayoutDefaults:Ry(),draw:I_(),style:yw()}}),CF=Ft((Q,$)=>{$.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"}}}),LF=Ft((Q,$)=>{$.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}),IM=Ft((Q,$)=>{var c=Xo(),g=bn(),P=g.extendFlat,S=g.extendDeep;function t(r){var a;switch(r){case"themes__thumb":a={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":a={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:a={}}return a}function e(r){var a=["xaxis","yaxis","zaxis"];return a.indexOf(r.slice(0,5))>-1}$.exports=function(r,a){var n,o=r.data,i=r.layout,s=S([],o),f=S({},i,t(a.tileClass)),x=r._context||{};if(a.width&&(f.width=a.width),a.height&&(f.height=a.height),a.tileClass==="thumbnail"||a.tileClass==="themes__thumb"){f.annotations=[];var y=Object.keys(f);for(n=0;n<y.length;n++)e(y[n])&&(f[y[n]].title={text:""});for(n=0;n<s.length;n++){var v=s[n];v.showscale=!1,v.marker&&(v.marker.showscale=!1),c.traceIs(v,"pie-like")&&(v.textposition="none")}}if(Array.isArray(a.annotations))for(n=0;n<a.annotations.length;n++)f.annotations.push(a.annotations[n]);var T=Object.keys(f).filter(function(M){return M.match(/^scene\d*$/)});if(T.length){var u={};for(a.tileClass==="thumbnail"&&(u={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),n=0;n<T.length;n++){var b=f[T[n]];b.xaxis||(b.xaxis={}),b.yaxis||(b.yaxis={}),b.zaxis||(b.zaxis={}),P(b.xaxis,u),P(b.yaxis,u),P(b.zaxis,u),b._scene=null}}var _=document.createElement("div");a.tileClass&&(_.className=a.tileClass);var C={gd:_,td:_,layout:f,data:s,config:{staticPlot:a.staticPlot===void 0?!0:a.staticPlot,plotGlPixelRatio:a.plotGlPixelRatio===void 0?2:a.plotGlPixelRatio,displaylogo:a.displaylogo||!1,showLink:a.showLink||!1,showTips:a.showTips||!1,mapboxAccessToken:x.mapboxAccessToken}};return a.setBackground!=="transparent"&&(C.config.setBackground=a.setBackground||"opaque"),C.gd.defaultLayout=t(a.tileClass),C}}),PF=Ft((Q,$)=>{var c=Im().EventEmitter,g=Xo(),P=bn(),S=o0(),t=IM(),e=$y(),r=Gy();function a(n,o){var i=new c,s=t(n,{format:"png"}),f=s.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);function x(){var v=S.getDelay(f._fullLayout);setTimeout(function(){var T=e(f),u=document.createElement("canvas");u.id=P.randstr(),i=r({format:o.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:u,emitter:i,svg:T}),i.clean=function(){f&&document.body.removeChild(f)}},v)}var y=S.getRedrawFunc(f);return g.call("_doPlot",f,s.data,s.layout,s.config).then(y).then(x).catch(function(v){i.emit("error",v)}),i}$.exports=a}),zF=Ft((Q,$)=>{var c=o0(),g={getDelay:c.getDelay,getRedrawFunc:c.getRedrawFunc,clone:IM(),toSVG:$y(),svgToImg:Gy(),toImage:PF(),downloadImage:q_()};$.exports=g}),IF=Ft(Q=>{Q.version=Qi().version,Gi(),S_();var $=Xo(),c=Q.register=$.register,g=_6(),P=Object.keys(g);for(t=0;t<P.length;t++)S=P[t],S.charAt(0)!=="_"&&(Q[S]=g[S]),c({moduleType:"apiMethod",name:S,fn:g[S]});var S,t;c(cd()),c([qD(),YD(),vf(),QD(),nF(),sF(),cF(),mF(),xF(),LM(),TF(),Xc(),SF(),EF(),Qh(),ww()]),c([CF(),LF()]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(c(window.PlotlyLocales),delete window.PlotlyLocales),Q.Icons=D_();var e=Qh(),r=Kc();Q.Plots={resize:r.resize,graphJson:r.graphJson,sendDataToCloud:r.sendDataToCloud},Q.Fx={hover:e.hover,unhover:e.unhover,loneHover:e.loneHover,loneUnhover:e.loneUnhover},Q.Snapshot=zF(),Q.PlotSchema=Dm()}),OF=Ft((Q,$)=>{$.exports=IF()}),Jy=Ft((Q,$)=>{$.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}),Sg=Ft((Q,$)=>{var c=tf(),g=fh().axisHoverFormat,{hovertemplateAttrs:P,texttemplateAttrs:S,templatefallbackAttrs:t}=$u(),e=Tc(),r=Ea(),a=Jy(),n=Td().pattern,o=Ta().extendFlat,i=r({editType:"calc",arrayOk:!0,colorEditType:"style"}),s=c.marker,f=s.line,x=o({},f.width,{dflt:0}),y=o({width:x,editType:"calc"},e("marker.line")),v=o({line:y,editType:"calc"},e("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:n,cornerradius:{valType:"any",editType:"calc"}});$.exports={x:c.x,x0:c.x0,dx:c.dx,y:c.y,y0:c.y0,dy:c.dy,xperiod:c.xperiod,yperiod:c.yperiod,xperiod0:c.xperiod0,yperiod0:c.yperiod0,xperiodalignment:c.xperiodalignment,yperiodalignment:c.yperiodalignment,xhoverformat:g("x"),yhoverformat:g("y"),text:c.text,texttemplate:S({editType:"plot"},{keys:a.eventDataKeys}),texttemplatefallback:t({editType:"plot"}),hovertext:c.hovertext,hovertemplate:P({},{keys:a.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({},i,{}),insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:o({},c.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:v,offsetgroup:c.offsetgroup,alignmentgroup:c.alignmentgroup,selected:{marker:{opacity:c.selected.marker.opacity,color:c.selected.marker.color,editType:"style"},textfont:c.selected.textfont,editType:"style"},unselected:{marker:{opacity:c.unselected.marker.opacity,color:c.unselected.marker.color,editType:"style"},textfont:c.unselected.textfont,editType:"style"},zorder:c.zorder}}),C6=Ft((Q,$)=>{$.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"}}}),L6=Ft((Q,$)=>{var c=li(),g=Hd().hasColorscale,P=mc(),S=bn().coercePattern;$.exports=function(t,e,r,a,n){var o=r("marker.color",a),i=g(t,"marker");i&&P(t,e,n,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",c.defaultLine),g(t,"marker.line")&&P(t,e,n,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),S(r,"marker.pattern",o,i),r("selected.marker.color"),r("unselected.marker.color")}}),J0=Ft((Q,$)=>{var c=ra(),g=bn(),P=li(),S=Xo(),t=Nm(),e=Fp(),r=L6(),a=Mg(),n=Sg(),o=g.coerceFont;function i(y,v,T,u){function b(A,h){return g.coerce(y,v,n,A,h)}var _=t(y,v,u,b);if(!_){v.visible=!1;return}e(y,v,u,b),b("xhoverformat"),b("yhoverformat"),b("zorder"),b("orientation",v.x&&!v.y?"h":"v"),b("base"),b("offset"),b("width"),b("text"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback");var C=b("textposition");x(y,v,u,b,C,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),r(y,v,b,T,u);var M=(v.marker.line||{}).color,E=S.getComponentMethod("errorbars","supplyDefaults");E(y,v,M||P.defaultLine,{axis:"y"}),E(y,v,M||P.defaultLine,{axis:"x",inherit:"y"}),g.coerceSelectionMarkerOpacity(v,b)}function s(y,v){var T,u;function b(M,E){return g.coerce(u._input,u,n,M,E)}for(var _=0;_<y.length;_++)if(u=y[_],u.type==="bar"){T=u._input;var C=b("marker.cornerradius",v.barcornerradius);u.marker&&(u.marker.cornerradius=f(C)),a(T,u,v,b,v.barmode)}}function f(y){if(c(y)){if(y=+y,y>=0)return y}else if(typeof y=="string"&&(y=y.trim(),y.slice(-1)==="%"&&c(y.slice(0,-1))&&(y=+y.slice(0,-1),y>=0)))return y+"%"}function x(y,v,T,u,b,_){_=_||{};var C=_.moduleHasSelected!==!1,M=_.moduleHasUnselected!==!1,E=_.moduleHasConstrain!==!1,A=_.moduleHasCliponaxis!==!1,h=_.moduleHasTextangle!==!1,p=_.moduleHasInsideanchor!==!1,k=!!_.hasPathbar,w=Array.isArray(b)||b==="auto",R=w||b==="inside",O=w||b==="outside";if(R||O){var N=o(u,"textfont",T.font),V=g.extendFlat({},N),H=y.textfont&&y.textfont.color,F=!H;if(F&&delete V.color,o(u,"insidetextfont",V),k){var U=g.extendFlat({},N);F&&delete U.color,o(u,"pathbar.textfont",U)}O&&o(u,"outsidetextfont",N),C&&u("selected.textfont.color"),M&&u("unselected.textfont.color"),E&&u("constraintext"),A&&u("cliponaxis"),h&&u("textangle"),u("texttemplate"),u("texttemplatefallback")}R&&p&&u("insidetextanchor")}$.exports={supplyDefaults:i,crossTraceDefaults:s,handleText:x,validateCornerradius:f}}),OM=Ft((Q,$)=>{var c=Xo(),g=Es(),P=bn(),S=C6(),t=J0().validateCornerradius;$.exports=function(e,r,a){function n(C,M){return P.coerce(e,r,S,C,M)}for(var o=!1,i=!1,s=!1,f={},x=n("barmode"),y=x==="group",v=0;v<a.length;v++){var T=a[v];if(c.traceIs(T,"bar")&&T.visible)o=!0;else continue;var u=T.xaxis+T.yaxis;if(y?(f[u]&&(s=!0),f[u]=!0):(u+=T._input.offsetgroup,f.length>0&&!f[u]&&(s=!0),f[u]=!0),T.visible&&T.type==="histogram"){var b=g.getFromId({_fullLayout:r},T[T.orientation==="v"?"xaxis":"yaxis"]);b.type!=="category"&&(i=!0)}}if(!o){delete r.barmode;return}x!=="overlay"&&n("barnorm"),n("bargap",i&&!s?0:.2),n("bargroupgap");var _=n("barcornerradius");r.barcornerradius=t(_)}}),Rw=Ft((Q,$)=>{var c=bn();$.exports=function(g,P){for(var S=0;S<g.length;S++)g[S].i=S;c.mergeArray(P.text,g,"tx"),c.mergeArray(P.hovertext,g,"htx");var t=P.marker;if(t){c.mergeArray(t.opacity,g,"mo",!0),c.mergeArray(t.color,g,"mc");var e=t.line;e&&(c.mergeArray(e.color,g,"mlc"),c.mergeArrayCastPositive(e.width,g,"mlw"))}}}),DF=Ft((Q,$)=>{var c=Es(),g=D0(),P=Hd().hasColorscale,S=Jd(),t=Rw(),e=Bt();$.exports=function(r,a){var n=c.getFromId(r,a.xaxis||"x"),o=c.getFromId(r,a.yaxis||"y"),i,s,f,x,y,v,T={msUTC:!!(a.base||a.base===0)};a.orientation==="h"?(i=n.makeCalcdata(a,"x",T),f=o.makeCalcdata(a,"y"),x=g(a,o,"y",f),y=!!a.yperiodalignment,v="y"):(i=o.makeCalcdata(a,"y",T),f=n.makeCalcdata(a,"x"),x=g(a,n,"x",f),y=!!a.xperiodalignment,v="x"),s=x.vals;for(var u=Math.min(s.length,i.length),b=new Array(u),_=0;_<u;_++)b[_]={p:s[_],s:i[_]},y&&(b[_].orig_p=f[_],b[_][v+"End"]=x.ends[_],b[_][v+"Start"]=x.starts[_]),a.ids&&(b[_].id=String(a.ids[_]));return P(a,"marker")&&S(r,a,{vals:a.marker.color,containerStr:"marker",cLetter:"c"}),P(a,"marker.line")&&S(r,a,{vals:a.marker.line.color,containerStr:"marker.line",cLetter:"c"}),t(b,a),e(b,a),b}}),Rp=Ft((Q,$)=>{var c=un(),g=bn();function P(r,a,n){var o=r._fullLayout,i=o["_"+n+"Text_minsize"];if(i){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"}a.selectAll(f).each(function(x){var y=x.transform;if(y){y.scale=s&&y.hide?0:i/y.fontSize;var v=c.select(this).select("text");g.setTransormAndDisplay(v,y)}})}}function S(r,a,n){if(n.uniformtext.mode){var o=e(r),i=n.uniformtext.minsize,s=a.scale*a.fontSize;a.hide=s<i,n[o]=n[o]||1/0,a.hide||(n[o]=Math.min(n[o],Math.max(s,i)))}}function t(r,a){var n=e(r);a[n]=void 0}function e(r){return"_"+r+"Text_minsize"}$.exports={recordMinTextSize:S,clearMinTextSize:t,resizeText:P}}),P6=Ft(Q=>{var $=ra(),c=fo(),g=bn().isArrayOrTypedArray;Q.coerceString=function(P,S,t){if(typeof S=="string"){if(S||!P.noBlank)return S}else if((typeof S=="number"||S===!0)&&!P.strict)return String(S);return t!==void 0?t:P.dflt},Q.coerceNumber=function(P,S,t){if($(S)){S=+S;var e=P.min,r=P.max,a=e!==void 0&&S<e||r!==void 0&&S>r;if(!a)return S}return t!==void 0?t:P.dflt},Q.coerceColor=function(P,S,t){return c(S).isValid()?S:t!==void 0?t:P.dflt},Q.coerceEnumerated=function(P,S,t){return P.coerceNumber&&(S=+S),P.values.indexOf(S)!==-1?S:t!==void 0?t:P.dflt},Q.getValue=function(P,S){var t;return g(P)?S<P.length&&(t=P[S]):t=P,t},Q.getLineWidth=function(P,S){var t=0<S.mlw?S.mlw:g(P.marker.line.width)?0:P.marker.line.width;return t}}),xm=Ft((Q,$)=>{var c=un(),g=li(),P=js(),S=bn(),t=Xo(),e=Rp().resizeText,r=Sg(),a=r.textfont,n=r.insidetextfont,o=r.outsidetextfont,i=P6();function s(A){var h=c.select(A).selectAll('g[class^="barlayer"]').selectAll("g.trace");e(A,h,"bar");var p=h.size(),k=A._fullLayout;h.style("opacity",function(w){return w[0].trace.opacity}).each(function(w){(k.barmode==="stack"&&p>1||k.bargap===0&&k.bargroupgap===0&&!w[0].trace.marker.line.width)&&c.select(this).attr("shape-rendering","crispEdges")}),h.selectAll("g.points").each(function(w){var R=c.select(this),O=w[0].trace;f(R,O,A)}),t.getComponentMethod("errorbars","style")(h)}function f(A,h,p){P.pointStyle(A.selectAll("path"),h,p),x(A,h,p)}function x(A,h,p){A.selectAll("text").each(function(k){var w=c.select(this),R=S.ensureUniformFontSize(p,u(w,k,h,p));P.font(w,R)})}function y(A,h,p){var k=h[0].trace;k.selectedpoints?v(p,k,A):(f(p,k,A),t.getComponentMethod("errorbars","style")(p))}function v(A,h,p){P.selectedPointStyle(A.selectAll("path"),h),T(A.selectAll("text"),h,p)}function T(A,h,p){A.each(function(k){var w=c.select(this),R;if(k.selected){R=S.ensureUniformFontSize(p,u(w,k,h,p));var O=h.selected.textfont&&h.selected.textfont.color;O&&(R.color=O),P.font(w,R)}else P.selectedTextStyle(w,h)})}function u(A,h,p,k){var w=k._fullLayout.font,R=p.textfont;if(A.classed("bartext-inside")){var O=E(h,p);R=_(p,h.i,w,O)}else A.classed("bartext-outside")&&(R=C(p,h.i,w));return R}function b(A,h,p){return M(a,A.textfont,h,p)}function _(A,h,p,k){var w=b(A,h,p),R=A._input.textfont===void 0||A._input.textfont.color===void 0||Array.isArray(A.textfont.color)&&A.textfont.color[h]===void 0;return R&&(w={color:g.contrast(k),family:w.family,size:w.size,weight:w.weight,style:w.style,variant:w.variant,textcase:w.textcase,lineposition:w.lineposition,shadow:w.shadow}),M(n,A.insidetextfont,h,w)}function C(A,h,p){var k=b(A,h,p);return M(o,A.outsidetextfont,h,k)}function M(A,h,p,k){h=h||{};var w=i.getValue(h.family,p),R=i.getValue(h.size,p),O=i.getValue(h.color,p),N=i.getValue(h.weight,p),V=i.getValue(h.style,p),H=i.getValue(h.variant,p),F=i.getValue(h.textcase,p),U=i.getValue(h.lineposition,p),W=i.getValue(h.shadow,p);return{family:i.coerceString(A.family,w,k.family),size:i.coerceNumber(A.size,R,k.size),color:i.coerceColor(A.color,O,k.color),weight:i.coerceString(A.weight,N,k.weight),style:i.coerceString(A.style,V,k.style),variant:i.coerceString(A.variant,H,k.variant),textcase:i.coerceString(A.variant,F,k.textcase),lineposition:i.coerceString(A.variant,U,k.lineposition),shadow:i.coerceString(A.variant,W,k.shadow)}}function E(A,h){return h.type==="waterfall"?h[A.dir].marker.color:A.mcc||A.mc||h.marker.color}$.exports={style:s,styleTextPoints:x,styleOnSelect:y,getInsideTextFont:_,getOutsideTextFont:C,getBarColor:E,resizeText:e}}),Qy=Ft((Q,$)=>{var c=un(),g=ra(),P=bn(),S=tc(),t=li(),e=js(),r=Xo(),a=Es().tickText,n=Rp(),o=n.recordMinTextSize,i=n.clearMinTextSize,s=xm(),f=P6(),x=Jy(),y=Sg(),v=y.text,T=y.textposition,u=Dp().appendArrayPointValue,b=x.TEXTPAD;function _(lt){return lt.id}function C(lt){if(lt.ids)return _}function M(lt){return(lt>0)-(lt<0)}function E(lt,yt){return lt<yt?1:-1}function A(lt,yt,pt,st){var tt=[],dt=[],rt=st?yt:pt,at=st?pt:yt;return tt[0]=rt.c2p(lt.s0,!0),dt[0]=at.c2p(lt.p0,!0),tt[1]=rt.c2p(lt.s1,!0),dt[1]=at.c2p(lt.p1,!0),st?[tt,dt]:[dt,tt]}function h(lt,yt,pt,st){if(!yt.uniformtext.mode&&p(pt)){var tt;return st&&(tt=st()),lt.transition().duration(pt.duration).ease(pt.easing).each("end",function(){tt&&tt()}).each("interrupt",function(){tt&&tt()})}else return lt}function p(lt){return lt&&lt.duration>0}function k(lt,yt,pt,st,tt,dt){var rt=yt.xaxis,at=yt.yaxis,vt=lt._fullLayout,it=lt._context.staticPlot;tt||(tt={mode:vt.barmode,norm:vt.barmode,gap:vt.bargap,groupgap:vt.bargroupgap},i("bar",vt));var Y=P.makeTraceGroups(st,pt,"trace bars").each(function(ft){var ut=c.select(this),wt=ft[0].trace,zt=ft[0].t,Pt=wt.type==="waterfall",Wt=wt.type==="funnel",Ht=wt.type==="histogram",Jt=wt.type==="bar",ge=Jt||Wt,he=0;Pt&&wt.connector.visible&&wt.connector.mode==="between"&&(he=wt.connector.line.width/2);var de=wt.orientation==="h",se=p(tt),Tt=P.ensureSingle(ut,"g","points"),Lt=C(wt),Mt=Tt.selectAll("g.point").data(P.identity,Lt);Mt.enter().append("g").classed("point",!0),Mt.exit().remove(),Mt.each(function(ve,oe){var Te=c.select(this),He=A(ve,rt,at,de),Ge=He[0][0],cr=He[0][1],ur=He[1][0],jr=He[1][1],Hr=(de?cr-Ge:jr-ur)===0;Hr&&ge&&f.getLineWidth(wt,ve)&&(Hr=!1),Hr||(Hr=!g(Ge)||!g(cr)||!g(ur)||!g(jr)),ve.isBlank=Hr,Hr&&(de?cr=Ge:jr=ur),he&&!Hr&&(de?(Ge-=E(Ge,cr)*he,cr+=E(Ge,cr)*he):(ur-=E(ur,jr)*he,jr+=E(ur,jr)*he));var br,Kr;if(wt.type==="waterfall"){if(!Hr){var rn=wt[ve.dir].marker;br=rn.line.width,Kr=rn.color}}else br=f.getLineWidth(wt,ve),Kr=ve.mc||wt.marker.color;function Ce(Hi){var We=c.round(br/2%1,2);return tt.gap===0&&tt.groupgap===0?c.round(Math.round(Hi)-We,2):Hi}function $t(Hi,We,rr){return rr&&Hi===We?Hi:Math.abs(Hi-We)>=2?Ce(Hi):Hi>We?Math.ceil(Hi):Math.floor(Hi)}var ne=t.opacity(Kr),Ct=ne<1||br>.01?Ce:$t;lt._context.staticPlot||(Ge=Ct(Ge,cr,de),cr=Ct(cr,Ge,de),ur=Ct(ur,jr,!de),jr=Ct(jr,ur,!de));var gt=de?rt.c2p:at.c2p,St;ve.s0>0?St=ve._sMax:ve.s0<0?St=ve._sMin:St=ve.s1>0?ve._sMax:ve._sMin;function Nt(Hi,We){if(!Hi)return 0;var rr=Math.abs(de?jr-ur:cr-Ge),fr=Math.abs(de?cr-Ge:jr-ur),xr=Ct(Math.abs(gt(St,!0)-gt(0,!0))),Qr=ve.hasB?Math.min(rr/2,fr/2):Math.min(rr/2,xr),Cn;if(We==="%"){var wn=Math.min(50,Hi);Cn=rr*(wn/100)}else Cn=Hi;return Ct(Math.max(Math.min(Cn,Qr),0))}var ee=Jt||Ht?Nt(zt.cornerradiusvalue,zt.cornerradiusform):0,le,we,Ue="M"+Ge+","+ur+"V"+jr+"H"+cr+"V"+ur+"Z",qe=0;if(ee&&ve.s){var ar=M(ve.s0)===0||M(ve.s)===M(ve.s0)?ve.s1:ve.s0;if(qe=Ct(ve.hasB?0:Math.abs(gt(St,!0)-gt(ar,!0))),qe<ee){var Ar=E(Ge,cr),Tr=E(ur,jr),pr=Ar===-Tr?1:0;if(de)if(ve.hasB)le="M"+(Ge+ee*Ar)+","+ur+"A "+ee+","+ee+" 0 0 "+pr+" "+Ge+","+(ur+ee*Tr)+"V"+(jr-ee*Tr)+"A "+ee+","+ee+" 0 0 "+pr+" "+(Ge+ee*Ar)+","+jr+"H"+(cr-ee*Ar)+"A "+ee+","+ee+" 0 0 "+pr+" "+cr+","+(jr-ee*Tr)+"V"+(ur+ee*Tr)+"A "+ee+","+ee+" 0 0 "+pr+" "+(cr-ee*Ar)+","+ur+"Z";else{we=Math.abs(cr-Ge)+qe;var Jr=we<ee?ee-Math.sqrt(we*(2*ee-we)):0,Vn=qe>0?Math.sqrt(qe*(2*ee-qe)):0,Hn=Ar>0?Math.max:Math.min;le="M"+Ge+","+ur+"V"+(jr-Jr*Tr)+"H"+Hn(cr-(ee-qe)*Ar,Ge)+"A "+ee+","+ee+" 0 0 "+pr+" "+cr+","+(jr-ee*Tr-Vn)+"V"+(ur+ee*Tr+Vn)+"A "+ee+","+ee+" 0 0 "+pr+" "+Hn(cr-(ee-qe)*Ar,Ge)+","+(ur+Jr*Tr)+"Z"}else if(ve.hasB)le="M"+(Ge+ee*Ar)+","+ur+"A "+ee+","+ee+" 0 0 "+pr+" "+Ge+","+(ur+ee*Tr)+"V"+(jr-ee*Tr)+"A "+ee+","+ee+" 0 0 "+pr+" "+(Ge+ee*Ar)+","+jr+"H"+(cr-ee*Ar)+"A "+ee+","+ee+" 0 0 "+pr+" "+cr+","+(jr-ee*Tr)+"V"+(ur+ee*Tr)+"A "+ee+","+ee+" 0 0 "+pr+" "+(cr-ee*Ar)+","+ur+"Z";else{we=Math.abs(jr-ur)+qe;var Kn=we<ee?ee-Math.sqrt(we*(2*ee-we)):0,Ci=qe>0?Math.sqrt(qe*(2*ee-qe)):0,ii=Tr>0?Math.max:Math.min;le="M"+(Ge+Kn*Ar)+","+ur+"V"+ii(jr-(ee-qe)*Tr,ur)+"A "+ee+","+ee+" 0 0 "+pr+" "+(Ge+ee*Ar-Ci)+","+jr+"H"+(cr-ee*Ar+Ci)+"A "+ee+","+ee+" 0 0 "+pr+" "+(cr-Kn*Ar)+","+ii(jr-(ee-qe)*Tr,ur)+"V"+ur+"Z"}}else le=Ue}else le=Ue;var qn=h(P.ensureSingle(Te,"path"),vt,tt,dt);if(qn.style("vector-effect",it?"none":"non-scaling-stroke").attr("d",isNaN((cr-Ge)*(jr-ur))||Hr&&lt._context.staticPlot?"M0,0Z":le).call(e.setClipUrl,yt.layerClipId,lt),!vt.uniformtext.mode&&se){var oa=e.makePointStyleFns(wt);e.singlePointStyle(ve,qn,wt,oa,lt)}w(lt,yt,Te,ft,oe,Ge,cr,ur,jr,ee,qe,tt,dt),yt.layerClipId&&e.hideOutsideRangePoint(ve,Te.select("text"),rt,at,wt.xcalendar,wt.ycalendar)});var te=wt.cliponaxis===!1;e.setClipUrl(ut,te?null:yt.layerClipId,lt)});r.getComponentMethod("errorbars","plot")(lt,Y,yt,tt)}function w(lt,yt,pt,st,tt,dt,rt,at,vt,it,Y,ft,ut){var wt=yt.xaxis,zt=yt.yaxis,Pt=lt._fullLayout,Wt;function Ht(we,Ue,qe){var ar=P.ensureSingle(we,"text").text(Ue).attr({class:"bartext bartext-"+Wt,"text-anchor":"middle","data-notex":1}).call(e.font,qe).call(S.convertToTspans,lt);return ar}var Jt=st[0].trace,ge=Jt.orientation==="h",he=U(Pt,st,tt,wt,zt);Wt=W(Jt,tt);var de=ft.mode==="stack"||ft.mode==="relative",se=st[tt],Tt=!de||se._outmost,Lt=se.hasB,Mt=it&&it-Y>b;if(!he||Wt==="none"||(se.isBlank||dt===rt||at===vt)&&(Wt==="auto"||Wt==="inside")){pt.select("text").remove();return}var te=Pt.font,ve=s.getBarColor(st[tt],Jt),oe=s.getInsideTextFont(Jt,tt,te,ve),Te=s.getOutsideTextFont(Jt,tt,te),He=Jt.insidetextanchor||"end",Ge=pt.datum();ge?wt.type==="log"&&Ge.s0<=0&&(wt.range[0]<wt.range[1]?dt=0:dt=wt._length):zt.type==="log"&&Ge.s0<=0&&(zt.range[0]<zt.range[1]?at=zt._length:at=0);var cr=Math.abs(rt-dt),ur=Math.abs(vt-at),jr=cr-2*b,Hr=ur-2*b,br,Kr,rn,Ce,$t;if(Wt==="outside"&&!Tt&&!se.hasB&&(Wt="inside"),Wt==="auto")if(Tt){Wt="inside",$t=P.ensureUniformFontSize(lt,oe),br=Ht(pt,he,$t),Kr=e.bBox(br.node()),rn=Kr.width,Ce=Kr.height;var ne=rn>0&&Ce>0,Ct;Mt?Lt?Ct=R(jr-2*it,Hr,rn,Ce,ge)||R(jr,Hr-2*it,rn,Ce,ge):ge?Ct=R(jr-(it-Y),Hr,rn,Ce,ge)||R(jr,Hr-2*(it-Y),rn,Ce,ge):Ct=R(jr,Hr-(it-Y),rn,Ce,ge)||R(jr-2*(it-Y),Hr,rn,Ce,ge):Ct=R(jr,Hr,rn,Ce,ge),ne&&Ct?Wt="inside":(Wt="outside",br.remove(),br=null)}else Wt="inside";if(!br){$t=P.ensureUniformFontSize(lt,Wt==="outside"?Te:oe),br=Ht(pt,he,$t);var gt=br.attr("transform");if(br.attr("transform",""),Kr=e.bBox(br.node()),rn=Kr.width,Ce=Kr.height,br.attr("transform",gt),rn<=0||Ce<=0){br.remove();return}}var St=Jt.textangle,Nt,ee;Wt==="outside"?(ee=Jt.constraintext==="both"||Jt.constraintext==="outside",Nt=F(dt,rt,at,vt,Kr,{isHorizontal:ge,constrained:ee,angle:St})):(ee=Jt.constraintext==="both"||Jt.constraintext==="inside",Nt=V(dt,rt,at,vt,Kr,{isHorizontal:ge,constrained:ee,angle:St,anchor:He,hasB:Lt,r:it,overhead:Y})),Nt.fontSize=$t.size,o(Jt.type==="histogram"?"bar":Jt.type,Nt,Pt),se.transform=Nt;var le=h(br,Pt,ft,ut);P.setTransormAndDisplay(le,Nt)}function R(lt,yt,pt,st,tt){if(lt<0||yt<0)return!1;var dt=pt<=lt&&st<=yt,rt=pt<=yt&&st<=lt,at=tt?lt>=pt*(yt/st):yt>=st*(lt/pt);return dt||rt||at}function O(lt){return lt==="auto"?0:lt}function N(lt,yt){var pt=Math.PI/180*yt,st=Math.abs(Math.sin(pt)),tt=Math.abs(Math.cos(pt));return{x:lt.width*tt+lt.height*st,y:lt.width*st+lt.height*tt}}function V(lt,yt,pt,st,tt,dt){var rt=!!dt.isHorizontal,at=!!dt.constrained,vt=dt.angle||0,it=dt.anchor,Y=it==="end",ft=it==="start",ut=dt.leftToRight||0,wt=(ut+1)/2,zt=1-wt,Pt=dt.hasB,Wt=dt.r,Ht=dt.overhead,Jt=tt.width,ge=tt.height,he=Math.abs(yt-lt),de=Math.abs(st-pt),se=he>2*b&&de>2*b?b:0;he-=2*se,de-=2*se;var Tt=O(vt);vt==="auto"&&!(Jt<=he&&ge<=de)&&(Jt>he||ge>de)&&(!(Jt>de||ge>he)||Jt<ge!=he<de)&&(Tt+=90);var Lt=N(tt,Tt),Mt,te;if(Wt&&Wt-Ht>b){var ve=H(lt,yt,pt,st,Lt,Wt,Ht,rt,Pt);Mt=ve.scale,te=ve.pad}else Mt=1,at&&(Mt=Math.min(1,he/Lt.x,de/Lt.y)),te=0;var oe=tt.left*zt+tt.right*wt,Te=(tt.top+tt.bottom)/2,He=(lt+b)*zt+(yt-b)*wt,Ge=(pt+st)/2,cr=0,ur=0;if(ft||Y){var jr=(rt?Lt.x:Lt.y)/2;Wt&&(Y||Pt)&&(se+=te);var Hr=rt?E(lt,yt):E(pt,st);rt?ft?(He=lt+Hr*se,cr=-Hr*jr):(He=yt-Hr*se,cr=Hr*jr):ft?(Ge=pt+Hr*se,ur=-Hr*jr):(Ge=st-Hr*se,ur=Hr*jr)}return{textX:oe,textY:Te,targetX:He,targetY:Ge,anchorX:cr,anchorY:ur,scale:Mt,rotate:Tt}}function H(lt,yt,pt,st,tt,dt,rt,at,vt){var it=Math.max(0,Math.abs(yt-lt)-2*b),Y=Math.max(0,Math.abs(st-pt)-2*b),ft=dt-b,ut=rt?ft-Math.sqrt(ft*ft-(ft-rt)*(ft-rt)):ft,wt=vt?ft*2:at?ft-rt:2*ut,zt=vt?ft*2:at?2*ut:ft-rt,Pt,Wt,Ht,Jt,ge;return tt.y/tt.x>=Y/(it-wt)?Jt=Y/tt.y:tt.y/tt.x<=(Y-zt)/it?Jt=it/tt.x:!vt&&at?(Pt=tt.x*tt.x+tt.y*tt.y/4,Wt=-2*tt.x*(it-ft)-tt.y*(Y/2-ft),Ht=(it-ft)*(it-ft)+(Y/2-ft)*(Y/2-ft)-ft*ft,Jt=(-Wt+Math.sqrt(Wt*Wt-4*Pt*Ht))/(2*Pt)):vt?(Pt=(tt.x*tt.x+tt.y*tt.y)/4,Wt=-tt.x*(it/2-ft)-tt.y*(Y/2-ft),Ht=(it/2-ft)*(it/2-ft)+(Y/2-ft)*(Y/2-ft)-ft*ft,Jt=(-Wt+Math.sqrt(Wt*Wt-4*Pt*Ht))/(2*Pt)):(Pt=tt.x*tt.x/4+tt.y*tt.y,Wt=-tt.x*(it/2-ft)-2*tt.y*(Y-ft),Ht=(it/2-ft)*(it/2-ft)+(Y-ft)*(Y-ft)-ft*ft,Jt=(-Wt+Math.sqrt(Wt*Wt-4*Pt*Ht))/(2*Pt)),Jt=Math.min(1,Jt),at?ge=Math.max(0,ft-Math.sqrt(Math.max(0,ft*ft-(ft-(Y-tt.y*Jt)/2)*(ft-(Y-tt.y*Jt)/2)))-rt):ge=Math.max(0,ft-Math.sqrt(Math.max(0,ft*ft-(ft-(it-tt.x*Jt)/2)*(ft-(it-tt.x*Jt)/2)))-rt),{scale:Jt,pad:ge}}function F(lt,yt,pt,st,tt,dt){var rt=!!dt.isHorizontal,at=!!dt.constrained,vt=dt.angle||0,it=tt.width,Y=tt.height,ft=Math.abs(yt-lt),ut=Math.abs(st-pt),wt;rt?wt=ut>2*b?b:0:wt=ft>2*b?b:0;var zt=1;at&&(zt=rt?Math.min(1,ut/Y):Math.min(1,ft/it));var Pt=O(vt),Wt=N(tt,Pt),Ht=(rt?Wt.x:Wt.y)/2,Jt=(tt.left+tt.right)/2,ge=(tt.top+tt.bottom)/2,he=(lt+yt)/2,de=(pt+st)/2,se=0,Tt=0,Lt=rt?E(yt,lt):E(pt,st);return rt?(he=yt-Lt*wt,se=Lt*Ht):(de=st+Lt*wt,Tt=-Lt*Ht),{textX:Jt,textY:ge,targetX:he,targetY:de,anchorX:se,anchorY:Tt,scale:zt,rotate:Pt}}function U(lt,yt,pt,st,tt){var dt=yt[0].trace,rt=dt.texttemplate,at;return rt?at=q(lt,yt,pt,st,tt):dt.textinfo?at=X(yt,pt,st,tt):at=f.getValue(dt.text,pt),f.coerceString(v,at)}function W(lt,yt){var pt=f.getValue(lt.textposition,yt);return f.coerceEnumerated(T,pt)}function q(lt,yt,pt,st,tt){var dt=yt[0].trace,rt=P.castOption(dt,pt,"texttemplate");if(!rt)return"";var at=dt.type==="histogram",vt=dt.type==="waterfall",it=dt.type==="funnel",Y=dt.orientation==="h",ft,ut,wt,zt;Y?(ft="y",ut=tt,wt="x",zt=st):(ft="x",ut=st,wt="y",zt=tt);function Pt(se){return a(ut,ut.c2l(se),!0).text}function Wt(se){return a(zt,zt.c2l(se),!0).text}var Ht=yt[pt],Jt={};Jt.label=Ht.p,Jt.labelLabel=Jt[ft+"Label"]=Pt(Ht.p);var ge=P.castOption(dt,Ht.i,"text");(ge===0||ge)&&(Jt.text=ge),Jt.value=Ht.s,Jt.valueLabel=Jt[wt+"Label"]=Wt(Ht.s);var he={};u(he,dt,Ht.i),(at||he.x===void 0)&&(he.x=Y?Jt.value:Jt.label),(at||he.y===void 0)&&(he.y=Y?Jt.label:Jt.value),(at||he.xLabel===void 0)&&(he.xLabel=Y?Jt.valueLabel:Jt.labelLabel),(at||he.yLabel===void 0)&&(he.yLabel=Y?Jt.labelLabel:Jt.valueLabel),vt&&(Jt.delta=+Ht.rawS||Ht.s,Jt.deltaLabel=Wt(Jt.delta),Jt.final=Ht.v,Jt.finalLabel=Wt(Jt.final),Jt.initial=Jt.final-Jt.delta,Jt.initialLabel=Wt(Jt.initial)),it&&(Jt.value=Ht.s,Jt.valueLabel=Wt(Jt.value),Jt.percentInitial=Ht.begR,Jt.percentInitialLabel=P.formatPercent(Ht.begR),Jt.percentPrevious=Ht.difR,Jt.percentPreviousLabel=P.formatPercent(Ht.difR),Jt.percentTotal=Ht.sumR,Jt.percenTotalLabel=P.formatPercent(Ht.sumR));var de=P.castOption(dt,Ht.i,"customdata");return de&&(Jt.customdata=de),P.texttemplateString({data:[he,Jt,dt._meta],fallback:dt.texttemplatefallback,labels:Jt,locale:lt._d3locale,template:rt})}function X(lt,yt,pt,st){var tt=lt[0].trace,dt=tt.orientation==="h",rt=tt.type==="waterfall",at=tt.type==="funnel";function vt(de){var se=dt?st:pt;return a(se,de,!0).text}function it(de){var se=dt?pt:st;return a(se,+de,!0).text}var Y=tt.textinfo,ft=lt[yt],ut=Y.split("+"),wt=[],zt,Pt=function(de){return ut.indexOf(de)!==-1};if(Pt("label")&&wt.push(vt(lt[yt].p)),Pt("text")&&(zt=P.castOption(tt,ft.i,"text"),(zt===0||zt)&&wt.push(zt)),rt){var Wt=+ft.rawS||ft.s,Ht=ft.v,Jt=Ht-Wt;Pt("initial")&&wt.push(it(Jt)),Pt("delta")&&wt.push(it(Wt)),Pt("final")&&wt.push(it(Ht))}if(at){Pt("value")&&wt.push(it(ft.s));var ge=0;Pt("percent initial")&&ge++,Pt("percent previous")&&ge++,Pt("percent total")&&ge++;var he=ge>1;Pt("percent initial")&&(zt=P.formatPercent(ft.begR),he&&(zt+=" of initial"),wt.push(zt)),Pt("percent previous")&&(zt=P.formatPercent(ft.difR),he&&(zt+=" of previous"),wt.push(zt)),Pt("percent total")&&(zt=P.formatPercent(ft.sumR),he&&(zt+=" of total"),wt.push(zt))}return wt.join("<br>")}$.exports={plot:k,toMoveInsideBar:V}}),Y_=Ft((Q,$)=>{var c=Qh(),g=Xo(),P=li(),S=bn().fillText,t=P6().getLineWidth,e=Es().hoverLabelText,r=Da().BADNUM;function a(i,s,f,x,y){var v=n(i,s,f,x,y);if(v){var T=v.cd,u=T[0].trace,b=T[v.index];return v.color=o(u,b),g.getComponentMethod("errorbars","hoverInfo")(b,u,v),[v]}}function n(i,s,f,x,y){var v=i.cd,T=v[0].trace,u=v[0].t,b=x==="closest",_=T.type==="waterfall",C=i.maxHoverDistance,M=i.maxSpikeDistance,E,A,h,p,k,w,R;T.orientation==="h"?(E=f,A=s,h="y",p="x",k=st,w=lt):(E=s,A=f,h="x",p="y",w=st,k=lt);var O=T[h+"period"],N=b||O;function V(zt){return F(zt,-1)}function H(zt){return F(zt,1)}function F(zt,Pt){var Wt=zt.w;return zt[h]+Pt*Wt/2}function U(zt){return zt[h+"End"]-zt[h+"Start"]}var W=b?V:O?function(zt){return zt.p-U(zt)/2}:function(zt){return Math.min(V(zt),zt.p-u.bardelta/2)},q=b?H:O?function(zt){return zt.p+U(zt)/2}:function(zt){return Math.max(H(zt),zt.p+u.bardelta/2)};function X(zt,Pt,Wt){return y.finiteRange&&(Wt=0),c.inbox(zt-E,Pt-E,Wt+Math.min(1,Math.abs(Pt-zt)/R)-1)}function lt(zt){return X(W(zt),q(zt),C)}function yt(zt){return X(V(zt),H(zt),M)}function pt(zt){var Pt=zt[p];if(_){var Wt=Math.abs(zt.rawS)||0;A>0?Pt+=Wt:A<0&&(Pt-=Wt)}return Pt}function st(zt){var Pt=A,Wt=zt.b,Ht=pt(zt);return c.inbox(Wt-Pt,Ht-Pt,C+(Ht-Pt)/(Ht-Wt)-1)}function tt(zt){var Pt=A,Wt=zt.b,Ht=pt(zt);return c.inbox(Wt-Pt,Ht-Pt,M+(Ht-Pt)/(Ht-Wt)-1)}var dt=i[h+"a"],rt=i[p+"a"];R=Math.abs(dt.r2c(dt.range[1])-dt.r2c(dt.range[0]));function at(zt){return(k(zt)+w(zt))/2}var vt=c.getDistanceFunction(x,k,w,at);if(c.getClosest(v,vt,i),i.index!==!1&&v[i.index].p!==r){N||(W=function(zt){return Math.min(V(zt),zt.p-u.bargroupwidth/2)},q=function(zt){return Math.max(H(zt),zt.p+u.bargroupwidth/2)});var it=i.index,Y=v[it],ft=T.base?Y.b+Y.s:Y.s;i[p+"0"]=i[p+"1"]=rt.c2p(Y[p],!0),i[p+"LabelVal"]=ft;var ut=u.extents[u.extents.round(Y.p)];i[h+"0"]=dt.c2p(b?W(Y):ut[0],!0),i[h+"1"]=dt.c2p(b?q(Y):ut[1],!0);var wt=Y.orig_p!==void 0;return i[h+"LabelVal"]=wt?Y.orig_p:Y.p,i.labelLabel=e(dt,i[h+"LabelVal"],T[h+"hoverformat"]),i.valueLabel=e(rt,i[p+"LabelVal"],T[p+"hoverformat"]),i.baseLabel=e(rt,Y.b,T[p+"hoverformat"]),i.spikeDistance=(tt(Y)+yt(Y))/2,i[h+"Spike"]=dt.c2p(Y.p,!0),S(Y,T,i),i.hovertemplate=T.hovertemplate,i}}function o(i,s){var f=s.mcc||i.marker.color,x=s.mlcc||i.marker.line.color,y=t(i,s);if(P.opacity(f))return f;if(P.opacity(x)&&y)return x}$.exports={hoverPoints:a,hoverOnBars:n,getTraceColor:o}}),FF=Ft((Q,$)=>{$.exports=function(c,g,P){return c.x="xVal"in g?g.xVal:g.x,c.y="yVal"in g?g.yVal:g.y,g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),P.orientation==="h"?(c.label=c.y,c.value=c.x):(c.label=c.x,c.value=c.y),c}}),K_=Ft((Q,$)=>{$.exports=function(g,P){var S=g.cd,t=g.xaxis,e=g.yaxis,r=S[0].trace,a=r.type==="funnel",n=r.orientation==="h",o=[],i;if(P===!1)for(i=0;i<S.length;i++)S[i].selected=0;else for(i=0;i<S.length;i++){var s=S[i],f="ct"in s?s.ct:c(s,t,e,n,a);P.contains(f,!1,i,g)?(o.push({pointNumber:i,x:t.c2d(s.x),y:e.c2d(s.y)}),s.selected=1):s.selected=0}return o};function c(g,P,S,t,e){var r=P.c2p(t?g.s0:g.p0,!0),a=P.c2p(t?g.s1:g.p1,!0),n=S.c2p(t?g.p0:g.s0,!0),o=S.c2p(t?g.p1:g.s1,!0);return e?[(r+a)/2,(n+o)/2]:t?[a,(n+o)/2]:[(r+a)/2,o]}}),RF=Ft((Q,$)=>{$.exports={attributes:Sg(),layoutAttributes:C6(),supplyDefaults:J0().supplyDefaults,crossTraceDefaults:J0().crossTraceDefaults,supplyLayoutDefaults:OM(),calc:DF(),crossTraceCalc:Pr().crossTraceCalc,colorbar:xo(),arraysToCalcdata:Rw(),plot:Qy().plot,style:xm().style,styleOnSelect:xm().styleOnSelect,hoverPoints:Y_().hoverPoints,eventData:FF(),selectPoints:K_(),moduleType:"trace",name:"bar",basePlotModule:Mf(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}),BF=Ft((Q,$)=>{$.exports=RF()}),Bw=Ft((Q,$)=>{var c=z0(),g=tf(),P=Sg(),S=bi(),t=fh().axisHoverFormat,{hovertemplateAttrs:e,templatefallbackAttrs:r}=$u(),a=Ta().extendFlat,n=g.marker,o=n.line;$.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:g.xperiod,yperiod:g.yperiod,xperiod0:g.xperiod0,yperiod0:g.yperiod0,xperiodalignment:g.xperiodalignment,yperiodalignment:g.yperiodalignment,xhoverformat:t("x"),yhoverformat:t("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},n.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},n.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:a({},n.angle,{arrayOk:!1,editType:"calc"}),size:a({},n.size,{arrayOk:!1,editType:"calc"}),color:a({},n.color,{arrayOk:!1,editType:"style"}),line:{color:a({},o.color,{arrayOk:!1,dflt:S.defaultLine,editType:"style"}),width:a({},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:c(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:P.offsetgroup,alignmentgroup:P.alignmentgroup,selected:{marker:g.selected.marker,editType:"style"},unselected:{marker:g.unselected.marker,editType:"style"},text:a({},g.text,{}),hovertext:a({},g.hovertext,{}),hovertemplate:e({}),hovertemplatefallback:r(),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:g.zorder}}),Nw=Ft((Q,$)=>{$.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"}}}),jw=Ft((Q,$)=>{var c=bn(),g=Xo(),P=li(),S=Fp(),t=Mg(),e=dv(),r=Bw();function a(s,f,x,y){function v(p,k){return c.coerce(s,f,r,p,k)}if(n(s,f,v,y),f.visible!==!1){S(s,f,y,v),v("xhoverformat"),v("yhoverformat");var T=f._hasPreCompStats;T&&(v("lowerfence"),v("upperfence")),v("line.color",(s.marker||{}).color||x),v("line.width"),v("fillcolor",P.addOpacity(f.line.color,.5));var u=!1;if(T){var b=v("mean"),_=v("sd");b&&b.length&&(u=!0,_&&_.length&&(u="sd"))}v("whiskerwidth");var C=v("sizemode"),M;C==="quartiles"&&(M=v("boxmean",u)),v("showwhiskers",C==="quartiles"),(C==="sd"||M==="sd")&&v("sdmultiple"),v("width"),v("quartilemethod");var E=!1;if(T){var A=v("notchspan");A&&A.length&&(E=!0)}else c.validate(s.notchwidth,r.notchwidth)&&(E=!0);var h=v("notched",E);h&&v("notchwidth"),o(s,f,v,{prefix:"box"}),v("zorder")}}function n(s,f,x,y){function v(X){var lt=0;return X&&X.length&&(lt+=1,c.isArrayOrTypedArray(X[0])&&X[0].length&&(lt+=1)),lt}function T(X){return c.validate(s[X],r[X])}var u=x("y"),b=x("x"),_;if(f.type==="box"){var C=x("q1"),M=x("median"),E=x("q3");f._hasPreCompStats=C&&C.length&&M&&M.length&&E&&E.length,_=Math.min(c.minRowLength(C),c.minRowLength(M),c.minRowLength(E))}var A=v(u),h=v(b),p=A&&c.minRowLength(u),k=h&&c.minRowLength(b),w=y.calendar,R={autotypenumbers:y.autotypenumbers},O,N;if(f._hasPreCompStats)switch(String(h)+String(A)){case"00":var V=T("x0")||T("dx"),H=T("y0")||T("dy");H&&!V?O="h":O="v",N=_;break;case"10":O="v",N=Math.min(_,k);break;case"20":O="h",N=Math.min(_,b.length);break;case"01":O="h",N=Math.min(_,p);break;case"02":O="v",N=Math.min(_,u.length);break;case"12":O="v",N=Math.min(_,k,u.length);break;case"21":O="h",N=Math.min(_,b.length,p);break;case"11":N=0;break;case"22":var F=!1,U;for(U=0;U<b.length;U++)if(e(b[U],w,R)==="category"){F=!0;break}if(F)O="v",N=Math.min(_,k,u.length);else{for(U=0;U<u.length;U++)if(e(u[U],w,R)==="category"){F=!0;break}F?(O="h",N=Math.min(_,b.length,p)):(O="v",N=Math.min(_,k,u.length))}break}else A>0?(O="v",h>0?N=Math.min(k,p):N=Math.min(p)):h>0?(O="h",N=Math.min(k)):N=0;if(!N){f.visible=!1;return}f._length=N;var W=x("orientation",O);f._hasPreCompStats?W==="v"&&h===0?(x("x0",0),x("dx",1)):W==="h"&&A===0&&(x("y0",0),x("dy",1)):W==="v"&&h===0?x("x0"):W==="h"&&A===0&&x("y0");var q=g.getComponentMethod("calendars","handleTraceDefaults");q(s,f,["x","y"],y)}function o(s,f,x,y){var v=y.prefix,T=c.coerce2(s,f,r,"marker.outliercolor"),u=x("marker.line.outliercolor"),b="outliers";f._hasPreCompStats?b="all":(T||u)&&(b="suspectedoutliers");var _=x(v+"points",b);_?(x("jitter",_==="all"?.3:0),x("pointpos",_==="all"?-1.5:0),x("marker.symbol"),x("marker.opacity"),x("marker.size"),x("marker.angle"),x("marker.color",f.line.color),x("marker.line.color"),x("marker.line.width"),_==="suspectedoutliers"&&(x("marker.line.outliercolor",f.marker.color),x("marker.line.outlierwidth")),x("selected.marker.color"),x("unselected.marker.color"),x("selected.marker.size"),x("unselected.marker.size"),x("text"),x("hovertext")):delete f.marker;var C=x("hoveron");(C==="all"||C.indexOf("points")!==-1)&&(x("hovertemplate"),x("hovertemplatefallback")),c.coerceSelectionMarkerOpacity(f,x)}function i(s,f){var x,y;function v(_){return c.coerce(y._input,y,r,_)}for(var T=0;T<s.length;T++){y=s[T];var u=y.type;if(u==="box"||u==="violin"){x=y._input;var b=f[u+"mode"];b==="group"&&t(x,y,f,v,b)}}}$.exports={supplyDefaults:a,crossTraceDefaults:i,handleSampleDefaults:n,handlePointsDefaults:o}}),z6=Ft((Q,$)=>{var c=Xo(),g=bn(),P=Nw();function S(e,r,a,n,o){for(var i=o+"Layout",s=!1,f=0;f<a.length;f++){var x=a[f];if(c.traceIs(x,i)){s=!0;break}}s&&(n(o+"mode"),n(o+"gap"),n(o+"groupgap"))}function t(e,r,a){function n(o,i){return g.coerce(e,r,P,o,i)}S(e,r,a,n,"box")}$.exports={supplyLayoutDefaults:t,_supply:S}}),DM=Ft((Q,$)=>{var c=ra(),g=Es(),P=D0(),S=bn(),t=Da().BADNUM,e=S._;$.exports=function(_,C){var M=_._fullLayout,E=g.getFromId(_,C.xaxis||"x"),A=g.getFromId(_,C.yaxis||"y"),h=[],p=C.type==="violin"?"_numViolins":"_numBoxes",k,w,R,O,N,V,H;C.orientation==="h"?(R=E,O="x",N=A,V="y",H=!!C.yperiodalignment):(R=A,O="y",N=E,V="x",H=!!C.xperiodalignment);var F=r(C,V,N,M[p]),U=F[0],W=F[1],q=S.distinctVals(U,N),X=q.vals,lt=q.minDiff/2,yt,pt,st,tt,dt,rt,at=(C.boxpoints||C.points)==="all"?S.identity:function(jr){return jr.v<yt.lf||jr.v>yt.uf};if(C._hasPreCompStats){var vt=C[O],it=function(jr){return R.d2c((C[jr]||[])[k])},Y=1/0,ft=-1/0;for(k=0;k<C._length;k++){var ut=U[k];if(c(ut)){if(yt={},yt.pos=yt[V]=ut,H&&W&&(yt.orig_p=W[k]),yt.q1=it("q1"),yt.med=it("median"),yt.q3=it("q3"),pt=[],vt&&S.isArrayOrTypedArray(vt[k]))for(w=0;w<vt[k].length;w++)rt=R.d2c(vt[k][w]),rt!==t&&(dt={v:rt,i:[k,w]},i(dt,C,[k,w]),pt.push(dt));if(yt.pts=pt.sort(f),st=yt[O]=pt.map(x),tt=st.length,yt.med!==t&&yt.q1!==t&&yt.q3!==t&&yt.med>=yt.q1&&yt.q3>=yt.med){var wt=it("lowerfence");yt.lf=wt!==t&&wt<=yt.q1?wt:y(yt,st,tt);var zt=it("upperfence");yt.uf=zt!==t&&zt>=yt.q3?zt:v(yt,st,tt);var Pt=it("mean");yt.mean=Pt!==t?Pt:tt?S.mean(st,tt):(yt.q1+yt.q3)/2;var Wt=it("sd");yt.sd=Pt!==t&&Wt>=0?Wt:tt?S.stdev(st,tt,yt.mean):yt.q3-yt.q1,yt.lo=T(yt),yt.uo=u(yt);var Ht=it("notchspan");Ht=Ht!==t&&Ht>0?Ht:b(yt,tt),yt.ln=yt.med-Ht,yt.un=yt.med+Ht;var Jt=yt.lf,ge=yt.uf;C.boxpoints&&st.length&&(Jt=Math.min(Jt,st[0]),ge=Math.max(ge,st[tt-1])),C.notched&&(Jt=Math.min(Jt,yt.ln),ge=Math.max(ge,yt.un)),yt.min=Jt,yt.max=ge}else{S.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+yt.q1,"median = "+yt.med,"q3 = "+yt.q3].join(`
`));var he;yt.med!==t?he=yt.med:yt.q1!==t?yt.q3!==t?he=(yt.q1+yt.q3)/2:he=yt.q1:yt.q3!==t?he=yt.q3:he=0,yt.med=he,yt.q1=yt.q3=he,yt.lf=yt.uf=he,yt.mean=yt.sd=he,yt.ln=yt.un=he,yt.min=yt.max=he}Y=Math.min(Y,yt.min),ft=Math.max(ft,yt.max),yt.pts2=pt.filter(at),h.push(yt)}}C._extremes[R._id]=g.findExtremes(R,[Y,ft],{padded:!0})}else{var de=R.makeCalcdata(C,O),se=a(X,lt),Tt=X.length,Lt=n(Tt);for(k=0;k<C._length;k++)if(rt=de[k],!!c(rt)){var Mt=S.findBin(U[k],se);Mt>=0&&Mt<Tt&&(dt={v:rt,i:k},i(dt,C,k),Lt[Mt].push(dt))}var te=1/0,ve=-1/0,oe=C.quartilemethod,Te=oe==="exclusive",He=oe==="inclusive";for(k=0;k<Tt;k++)if(Lt[k].length>0){if(yt={},yt.pos=yt[V]=X[k],pt=yt.pts=Lt[k].sort(f),st=yt[O]=pt.map(x),tt=st.length,yt.min=st[0],yt.max=st[tt-1],yt.mean=S.mean(st,tt),yt.sd=S.stdev(st,tt,yt.mean)*C.sdmultiple,yt.med=S.interp(st,.5),tt%2&&(Te||He)){var Ge,cr;Te?(Ge=st.slice(0,tt/2),cr=st.slice(tt/2+1)):He&&(Ge=st.slice(0,tt/2+1),cr=st.slice(tt/2)),yt.q1=S.interp(Ge,.5),yt.q3=S.interp(cr,.5)}else yt.q1=S.interp(st,.25),yt.q3=S.interp(st,.75);yt.lf=y(yt,st,tt),yt.uf=v(yt,st,tt),yt.lo=T(yt),yt.uo=u(yt);var ur=b(yt,tt);yt.ln=yt.med-ur,yt.un=yt.med+ur,te=Math.min(te,yt.ln),ve=Math.max(ve,yt.un),yt.pts2=pt.filter(at),h.push(yt)}C.notched&&S.isTypedArray(de)&&(de=Array.from(de)),C._extremes[R._id]=g.findExtremes(R,C.notched?de.concat([te,ve]):de,{padded:!0})}return s(h,C),h.length>0?(h[0].t={num:M[p],dPos:lt,posLetter:V,valLetter:O,labels:{med:e(_,"median:"),min:e(_,"min:"),q1:e(_,"q1:"),q3:e(_,"q3:"),max:e(_,"max:"),mean:C.boxmean==="sd"||C.sizemode==="sd"?e(_,"mean ± σ:").replace("σ",C.sdmultiple===1?"σ":C.sdmultiple+"σ"):e(_,"mean:"),lf:e(_,"lower fence:"),uf:e(_,"upper fence:")}},M[p]++,h):[{t:{empty:!0}}]};function r(_,C,M,E){var A=C in _,h=C+"0"in _,p="d"+C in _;if(A||h&&p){var k=M.makeCalcdata(_,C),w=P(_,M,C,k).vals;return[w,k]}var R;h?R=_[C+"0"]:"name"in _&&(M.type==="category"||c(_.name)&&["linear","log"].indexOf(M.type)!==-1||S.isDateTime(_.name)&&M.type==="date")?R=_.name:R=E;for(var O=M.type==="multicategory"?M.r2c_just_indices(R):M.d2c(R,0,_[C+"calendar"]),N=_._length,V=new Array(N),H=0;H<N;H++)V[H]=O;return[V]}function a(_,C){for(var M=_.length,E=new Array(M+1),A=0;A<M;A++)E[A]=_[A]-C;return E[M]=_[M-1]+C,E}function n(_){for(var C=new Array(_),M=0;M<_;M++)C[M]=[];return C}var o={text:"tx",hovertext:"htx"};function i(_,C,M){for(var E in o)S.isArrayOrTypedArray(C[E])&&(Array.isArray(M)?S.isArrayOrTypedArray(C[E][M[0]])&&(_[o[E]]=C[E][M[0]][M[1]]):_[o[E]]=C[E][M])}function s(_,C){if(S.isArrayOrTypedArray(C.selectedpoints))for(var M=0;M<_.length;M++){for(var E=_[M].pts||[],A={},h=0;h<E.length;h++)A[E[h].i]=h;S.tagSelected(E,C,A)}}function f(_,C){return _.v-C.v}function x(_){return _.v}function y(_,C,M){return M===0?_.q1:Math.min(_.q1,C[Math.min(S.findBin(2.5*_.q1-1.5*_.q3,C,!0)+1,M-1)])}function v(_,C,M){return M===0?_.q3:Math.max(_.q3,C[Math.max(S.findBin(2.5*_.q3-1.5*_.q1,C),0)])}function T(_){return 4*_.q1-3*_.q3}function u(_){return 4*_.q3-3*_.q1}function b(_,C){return C===0?0:1.57*(_.q3-_.q1)/Math.sqrt(C)}}),I6=Ft((Q,$)=>{var c=Es(),g=bn(),P=vv().getAxisGroup,S=["v","h"];function t(r,a){for(var n=r.calcdata,o=a.xaxis,i=a.yaxis,s=0;s<S.length;s++){for(var f=S[s],x=f==="h"?i:o,y=[],v=0;v<n.length;v++){var T=n[v],u=T[0].t,b=T[0].trace;b.visible===!0&&(b.type==="box"||b.type==="candlestick")&&!u.empty&&(b.orientation||"v")===f&&b.xaxis===o._id&&b.yaxis===i._id&&y.push(v)}e("box",r,y,x)}}function e(r,a,n,o){var i=a.calcdata,s=a._fullLayout,f=o._id,x=f.charAt(0),y,v,T,u=[],b=0;for(y=0;y<n.length;y++)for(T=i[n[y]],v=0;v<T.length;v++)u.push(o.c2l(T[v].pos,!0)),b+=(T[v].pts2||[]).length;if(u.length){var _=g.distinctVals(u);(o.type==="category"||o.type==="multicategory")&&(_.minDiff=1);var C=_.minDiff/2;c.minDtick(o,_.minDiff,_.vals[0],!0);var M=r==="violin"?"_numViolins":"_numBoxes",E=s[M],A=s[r+"mode"]==="group"&&E>1,h=1-s[r+"gap"],p=1-s[r+"groupgap"];for(y=0;y<n.length;y++){T=i[n[y]];var k=T[0].trace,w=T[0].t,R=k.width,O=k.side,N,V,H,F;if(R)N=V=F=R/2,H=0;else if(N=C,A){var U=P(s,o._id)+k.orientation,W=s._alignmentOpts[U]||{},q=W[k.alignmentgroup]||{},X=Object.keys(q.offsetGroups||{}).length,lt=X||E,yt=X?k._offsetIndex:w.num;V=N*h*p/lt,H=2*N*(-.5+(yt+.5)/lt)*h,F=N*h/lt}else V=N*h*p,H=0,F=N;w.dPos=N,w.bPos=H,w.bdPos=V,w.wHover=F;var pt,st,tt=H+V,dt,rt,at,vt,it,Y,ft=!!R,ut=(k.boxpoints||k.points)&&b>0;if(O==="positive"?(pt=N*(R?1:.5),dt=tt,st=dt=H):O==="negative"?(pt=dt=H,st=N*(R?1:.5),rt=tt):(pt=st=N,dt=rt=tt),ut){var wt=k.pointpos,zt=k.jitter,Pt=k.marker.size/2,Wt=0;wt+zt>=0&&(Wt=tt*(wt+zt),Wt>pt?(ft=!0,it=Pt,at=Wt):Wt>dt&&(it=Pt,at=pt)),Wt<=pt&&(at=pt);var Ht=0;wt-zt<=0&&(Ht=-tt*(wt-zt),Ht>st?(ft=!0,Y=Pt,vt=Ht):Ht>rt&&(Y=Pt,vt=st)),Ht<=st&&(vt=st)}else at=pt,vt=st;var Jt=new Array(T.length);for(v=0;v<T.length;v++)Jt[v]=T[v].pos;k._extremes[f]=c.findExtremes(o,Jt,{padded:ft,vpadminus:vt,vpadplus:at,vpadLinearized:!0,ppadminus:{x:Y,y:it}[x],ppadplus:{x:it,y:Y}[x]})}}}$.exports={crossTraceCalc:t,setPositionOffset:e}}),O6=Ft((Q,$)=>{var c=un(),g=bn(),P=js(),S=5,t=.01;function e(o,i,s,f){var x=o._context.staticPlot,y=i.xaxis,v=i.yaxis;g.makeTraceGroups(f,s,"trace boxes").each(function(T){var u=c.select(this),b=T[0],_=b.t,C=b.trace;if(_.wdPos=_.bdPos*C.whiskerwidth,C.visible!==!0||_.empty){u.remove();return}var M,E;C.orientation==="h"?(M=v,E=y):(M=y,E=v),r(u,{pos:M,val:E},C,_,x),a(u,{x:y,y:v},C,_),n(u,{pos:M,val:E},C,_)})}function r(o,i,s,f,x){var y=s.orientation==="h",v=i.val,T=i.pos,u=!!T.rangebreaks,b=f.bPos,_=f.wdPos||0,C=f.bPosPxOffset||0,M=s.whiskerwidth||0,E=s.showwhiskers!==!1,A=s.notched||!1,h=A?1-2*s.notchwidth:1,p,k;Array.isArray(f.bdPos)?(p=f.bdPos[0],k=f.bdPos[1]):(p=f.bdPos,k=f.bdPos);var w=o.selectAll("path.box").data(s.type!=="violin"||s.box.visible?g.identity:[]);w.enter().append("path").style("vector-effect",x?"none":"non-scaling-stroke").attr("class","box"),w.exit().remove(),w.each(function(R){if(R.empty)return c.select(this).attr("d","M0,0Z");var O=T.c2l(R.pos+b,!0),N=T.l2p(O-p)+C,V=T.l2p(O+k)+C,H=u?(N+V)/2:T.l2p(O)+C,F=s.whiskerwidth,U=u?N*F+(1-F)*H:T.l2p(O-_)+C,W=u?V*F+(1-F)*H:T.l2p(O+_)+C,q=T.l2p(O-p*h)+C,X=T.l2p(O+k*h)+C,lt=s.sizemode==="sd",yt=v.c2p(lt?R.mean-R.sd:R.q1,!0),pt=lt?v.c2p(R.mean+R.sd,!0):v.c2p(R.q3,!0),st=g.constrain(lt?v.c2p(R.mean,!0):v.c2p(R.med,!0),Math.min(yt,pt)+1,Math.max(yt,pt)-1),tt=R.lf===void 0||s.boxpoints===!1||lt,dt=v.c2p(tt?R.min:R.lf,!0),rt=v.c2p(tt?R.max:R.uf,!0),at=v.c2p(R.ln,!0),vt=v.c2p(R.un,!0);y?c.select(this).attr("d","M"+st+","+q+"V"+X+"M"+yt+","+N+"V"+V+(A?"H"+at+"L"+st+","+X+"L"+vt+","+V:"")+"H"+pt+"V"+N+(A?"H"+vt+"L"+st+","+q+"L"+at+","+N:"")+"Z"+(E?"M"+yt+","+H+"H"+dt+"M"+pt+","+H+"H"+rt+(M===0?"":"M"+dt+","+U+"V"+W+"M"+rt+","+U+"V"+W):"")):c.select(this).attr("d","M"+q+","+st+"H"+X+"M"+N+","+yt+"H"+V+(A?"V"+at+"L"+X+","+st+"L"+V+","+vt:"")+"V"+pt+"H"+N+(A?"V"+vt+"L"+q+","+st+"L"+N+","+at:"")+"Z"+(E?"M"+H+","+yt+"V"+dt+"M"+H+","+pt+"V"+rt+(M===0?"":"M"+U+","+dt+"H"+W+"M"+U+","+rt+"H"+W):""))})}function a(o,i,s,f){var x=i.x,y=i.y,v=f.bdPos,T=f.bPos,u=s.boxpoints||s.points;g.seedPseudoRandom();var b=function(M){return M.forEach(function(E){E.t=f,E.trace=s}),M},_=o.selectAll("g.points").data(u?b:[]);_.enter().append("g").attr("class","points"),_.exit().remove();var C=_.selectAll("path").data(function(M){var E,A=M.pts2,h=Math.max((M.max-M.min)/10,M.q3-M.q1),p=h*1e-9,k=h*t,w=[],R=0,O;if(s.jitter){if(h===0)for(R=1,w=new Array(A.length),E=0;E<A.length;E++)w[E]=1;else for(E=0;E<A.length;E++){var N=Math.max(0,E-S),V=A[N].v,H=Math.min(A.length-1,E+S),F=A[H].v;u!=="all"&&(A[E].v<M.lf?F=Math.min(F,M.lf):V=Math.max(V,M.uf));var U=Math.sqrt(k*(H-N)/(F-V+p))||0;U=g.constrain(Math.abs(U),0,1),w.push(U),R=Math.max(U,R)}O=s.jitter*2/(R||1)}for(E=0;E<A.length;E++){var W=A[E],q=W.v,X=s.jitter?O*w[E]*(g.pseudoRandom()-.5):0,lt=M.pos+T+v*(s.pointpos+X);s.orientation==="h"?(W.y=lt,W.x=q):(W.x=lt,W.y=q),u==="suspectedoutliers"&&q<M.uo&&q>M.lo&&(W.so=!0)}return A});C.enter().append("path").classed("point",!0),C.exit().remove(),C.call(P.translatePoints,x,y)}function n(o,i,s,f){var x=i.val,y=i.pos,v=!!y.rangebreaks,T=f.bPos,u=f.bPosPxOffset||0,b=s.boxmean||(s.meanline||{}).visible,_,C;Array.isArray(f.bdPos)?(_=f.bdPos[0],C=f.bdPos[1]):(_=f.bdPos,C=f.bdPos);var M=o.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?g.identity:[]);M.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),M.exit().remove(),M.each(function(E){var A=y.c2l(E.pos+T,!0),h=y.l2p(A-_)+u,p=y.l2p(A+C)+u,k=v?(h+p)/2:y.l2p(A)+u,w=x.c2p(E.mean,!0),R=x.c2p(E.mean-E.sd,!0),O=x.c2p(E.mean+E.sd,!0);s.orientation==="h"?c.select(this).attr("d","M"+w+","+h+"V"+p+(b==="sd"?"m0,0L"+R+","+k+"L"+w+","+h+"L"+O+","+k+"Z":"")):c.select(this).attr("d","M"+h+","+w+"H"+p+(b==="sd"?"m0,0L"+k+","+R+"L"+h+","+w+"L"+k+","+O+"Z":""))})}$.exports={plot:e,plotBoxAndWhiskers:r,plotPoints:a,plotBoxMean:n}}),D6=Ft((Q,$)=>{var c=un(),g=li(),P=js();function S(e,r,a){var n=a||c.select(e).selectAll("g.trace.boxes");n.style("opacity",function(o){return o[0].trace.opacity}),n.each(function(o){var i=c.select(this),s=o[0].trace,f=s.line.width;function x(T,u,b,_){T.style("stroke-width",u+"px").call(g.stroke,b).call(g.fill,_)}var y=i.selectAll("path.box");if(s.type==="candlestick")y.each(function(T){if(!T.empty){var u=c.select(this),b=s[T.dir];x(u,b.line.width,b.line.color,b.fillcolor),u.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{x(y,f,s.line.color,s.fillcolor),i.selectAll("path.mean").style({"stroke-width":f,"stroke-dasharray":2*f+"px,"+f+"px"}).call(g.stroke,s.line.color);var v=i.selectAll("path.point");P.pointStyle(v,s,e)}})}function t(e,r,a){var n=r[0].trace,o=a.selectAll("path.point");n.selectedpoints?P.selectedPointStyle(o,n):P.pointStyle(o,n,e)}$.exports={style:S,styleOnSelect:t}}),FM=Ft((Q,$)=>{var c=Es(),g=bn(),P=Qh(),S=li(),t=g.fillText;function e(n,o,i,s){var f=n.cd,x=f[0].trace,y=x.hoveron,v=[],T;return y.indexOf("boxes")!==-1&&(v=v.concat(r(n,o,i,s))),y.indexOf("points")!==-1&&(T=a(n,o,i)),s==="closest"?T?[T]:v:(T&&v.push(T),v)}function r(n,o,i,s){var f=n.cd,x=n.xa,y=n.ya,v=f[0].trace,T=f[0].t,u=v.type==="violin",b,_,C,M,E,A,h,p,k,w,R,O=T.bdPos,N,V,H=T.wHover,F=function(Ht){return C.c2l(Ht.pos)+T.bPos-C.c2l(A)};u&&v.side!=="both"?(v.side==="positive"&&(k=function(Ht){var Jt=F(Ht);return P.inbox(Jt,Jt+H,w)},N=O,V=0),v.side==="negative"&&(k=function(Ht){var Jt=F(Ht);return P.inbox(Jt-H,Jt,w)},N=0,V=O)):(k=function(Ht){var Jt=F(Ht);return P.inbox(Jt-H,Jt+H,w)},N=V=O);var U;u?U=function(Ht){return P.inbox(Ht.span[0]-E,Ht.span[1]-E,w)}:U=function(Ht){return P.inbox(Ht.min-E,Ht.max-E,w)},v.orientation==="h"?(E=o,A=i,h=U,p=k,b="y",C=y,_="x",M=x):(E=i,A=o,h=k,p=U,b="x",C=x,_="y",M=y);var W=Math.min(1,O/Math.abs(C.r2c(C.range[1])-C.r2c(C.range[0])));w=n.maxHoverDistance-W,R=n.maxSpikeDistance-W;function q(Ht){return(h(Ht)+p(Ht))/2}var X=P.getDistanceFunction(s,h,p,q);if(P.getClosest(f,X,n),n.index===!1)return[];var lt=f[n.index],yt=v.line.color,pt=(v.marker||{}).color;S.opacity(yt)&&v.line.width?n.color=yt:S.opacity(pt)&&v.boxpoints?n.color=pt:n.color=v.fillcolor,n[b+"0"]=C.c2p(lt.pos+T.bPos-V,!0),n[b+"1"]=C.c2p(lt.pos+T.bPos+N,!0),n[b+"LabelVal"]=lt.orig_p!==void 0?lt.orig_p:lt.pos;var st=b+"Spike";n.spikeDistance=q(lt)*R/w,n[st]=C.c2p(lt.pos,!0);var tt=v.boxmean||v.sizemode==="sd"||(v.meanline||{}).visible,dt=v.boxpoints||v.points,rt=dt&&tt?["max","uf","q3","med","mean","q1","lf","min"]:dt&&!tt?["max","uf","q3","med","q1","lf","min"]:!dt&&tt?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],at=M.range[1]<M.range[0];v.orientation===(at?"v":"h")&&rt.reverse();for(var vt=n.spikeDistance,it=n[st],Y=[],ft=0;ft<rt.length;ft++){var ut=rt[ft];if(ut in lt){var wt=lt[ut],zt=M.c2p(wt,!0),Pt=g.extendFlat({},n);Pt.attr=ut,Pt[_+"0"]=Pt[_+"1"]=zt,Pt[_+"LabelVal"]=wt,Pt[_+"Label"]=(T.labels?T.labels[ut]+" ":"")+c.hoverLabelText(M,wt,v[_+"hoverformat"]),Pt.hoverOnBox=!0,ut==="mean"&&"sd"in lt&&(v.boxmean==="sd"||v.sizemode==="sd")&&(Pt[_+"err"]=lt.sd),Pt.hovertemplate=!1,Y.push(Pt)}}n.name="",n.spikeDistance=void 0,n[st]=void 0;for(var Wt=0;Wt<Y.length;Wt++)Y[Wt].attr!=="med"?(Y[Wt].name="",Y[Wt].spikeDistance=void 0,Y[Wt][st]=void 0):(Y[Wt].spikeDistance=vt,Y[Wt][st]=it);return Y}function a(n,o,i){for(var s=n.cd,f=n.xa,x=n.ya,y=s[0].trace,v=f.c2p(o),T=x.c2p(i),u,b=function(U){var W=Math.max(3,U.mrc||0);return Math.max(Math.abs(f.c2p(U.x)-v)-W,1-3/W)},_=function(U){var W=Math.max(3,U.mrc||0);return Math.max(Math.abs(x.c2p(U.y)-T)-W,1-3/W)},C=P.quadrature(b,_),M=!1,E,A,h=0;h<s.length;h++){E=s[h];for(var p=0;p<(E.pts||[]).length;p++){A=E.pts[p];var k=C(A);k<=n.distance&&(n.distance=k,M=[h,p])}}if(!M)return!1;E=s[M[0]],A=E.pts[M[1]];var w=f.c2p(A.x,!0),R=x.c2p(A.y,!0),O=A.mrc||1;u=g.extendFlat({},n,{index:A.i,color:(y.marker||{}).color,name:y.name,x0:w-O,x1:w+O,y0:R-O,y1:R+O,spikeDistance:n.distance,hovertemplate:y.hovertemplate});var N=E.orig_p,V=N!==void 0?N:E.pos,H;y.orientation==="h"?(H=x,u.xLabelVal=A.x,u.yLabelVal=V):(H=f,u.xLabelVal=V,u.yLabelVal=A.y);var F=H._id.charAt(0);return u[F+"Spike"]=H.c2p(E.pos,!0),t(A,y,u),u}$.exports={hoverPoints:e,hoverOnBoxes:r,hoverOnPoints:a}}),NF=Ft((Q,$)=>{$.exports=function(c,g){return g.hoverOnBox&&(c.hoverOnBox=g.hoverOnBox),"xVal"in g&&(c.x=g.xVal),"yVal"in g&&(c.y=g.yVal),g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),c}}),RM=Ft((Q,$)=>{$.exports=function(c,g){var P=c.cd,S=c.xaxis,t=c.yaxis,e=[],r,a;if(g===!1)for(r=0;r<P.length;r++)for(a=0;a<(P[r].pts||[]).length;a++)P[r].pts[a].selected=0;else for(r=0;r<P.length;r++)for(a=0;a<(P[r].pts||[]).length;a++){var n=P[r].pts[a],o=S.c2p(n.x),i=t.c2p(n.y);g.contains([o,i],null,n.i,c)?(e.push({pointNumber:n.i,x:S.c2d(n.x),y:t.c2d(n.y)}),n.selected=1):n.selected=0}return e}}),jF=Ft((Q,$)=>{$.exports={attributes:Bw(),layoutAttributes:Nw(),supplyDefaults:jw().supplyDefaults,crossTraceDefaults:jw().crossTraceDefaults,supplyLayoutDefaults:z6().supplyLayoutDefaults,calc:DM(),crossTraceCalc:I6().crossTraceCalc,plot:O6().plot,style:D6().style,styleOnSelect:D6().styleOnSelect,hoverPoints:FM().hoverPoints,eventData:NF(),selectPoints:RM(),moduleType:"trace",name:"box",basePlotModule:Mf(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}),UF=Ft((Q,$)=>{$.exports=jF()}),X_=Ft((Q,$)=>{var c=Tc(),{extendFlat:g}=Ta(),P=$o(),{axisHoverFormat:S}=fh(),t=Ea(),{hovertemplateAttrs:e,templatefallbackAttrs:r,texttemplateAttrs:a}=$u(),n=tf();$.exports=g({z:{valType:"data_array",editType:"calc"},x:g({},n.x,{impliedEdits:{xtype:"array"}}),x0:g({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:g({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:g({},n.y,{impliedEdits:{ytype:"array"}}),y0:g({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:g({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:g({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:g({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:g({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:g({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:g({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:g({},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:S("x"),yhoverformat:S("y"),zhoverformat:S("z",1),hovertemplate:e(),hovertemplatefallback:r(),texttemplate:a({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),texttemplatefallback:r({editType:"plot"}),textfont:t({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:g({},P.showlegend,{dflt:!1}),zorder:n.zorder},c("",{cLetter:"z",autoColorDflt:!1}))}),F6=Ft((Q,$)=>{var c=ra(),g=bn(),P=Xo();$.exports=function(e,r,a,n,o,i){var s=a("z");o=o||"x",i=i||"y";var f,x;if(s===void 0||!s.length)return 0;if(g.isArray1D(s)){f=a(o),x=a(i);var y=g.minRowLength(f),v=g.minRowLength(x);if(y===0||v===0)return 0;r._length=Math.min(y,v,s.length)}else{if(f=S(o,a),x=S(i,a),!t(s))return 0;a("transpose"),r._length=null}var T=P.getComponentMethod("calendars","handleTraceDefaults");return T(e,r,[o,i],n),!0};function S(e,r){var a=r(e),n=a?r(e+"type","array"):"scaled";return n==="scaled"&&(r(e+"0"),r("d"+e)),a}function t(e){for(var r=!0,a=!1,n=!1,o,i=0;i<e.length;i++){if(o=e[i],!g.isArrayOrTypedArray(o)){r=!1;break}o.length>0&&(a=!0);for(var s=0;s<o.length;s++)if(c(o[s])){n=!0;break}}return r&&a&&n}}),Uw=Ft((Q,$)=>{var c=bn();$.exports=function(g,P){g("texttemplate"),g("texttemplatefallback");var S=c.extendFlat({},P.font,{color:"auto",size:"auto"});c.coerceFont(g,"textfont",S)}}),BM=Ft((Q,$)=>{$.exports=function(c,g,P){var S=P("zsmooth");S===!1&&(P("xgap"),P("ygap")),P("zhoverformat")}}),VF=Ft((Q,$)=>{var c=bn(),g=F6(),P=Uw(),S=Fp(),t=BM(),e=mc(),r=X_();$.exports=function(a,n,o,i){function s(x,y){return c.coerce(a,n,r,x,y)}var f=g(a,n,s,i);if(!f){n.visible=!1;return}S(a,n,i,s),s("xhoverformat"),s("yhoverformat"),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),P(s,i),t(a,n,s,i),s("hoverongaps"),s("connectgaps",c.isArray1D(n.z)&&n.zsmooth!==!1),e(a,n,i,s,{prefix:"",cLetter:"z"}),s("zorder")}}),NM=Ft((Q,$)=>{var c=ra();$.exports={count:function(g,P,S){return S[g]++,1},sum:function(g,P,S,t){var e=t[P];return c(e)?(e=Number(e),S[g]+=e,e):0},avg:function(g,P,S,t,e){var r=t[P];return c(r)&&(r=Number(r),S[g]+=r,e[g]++),0},min:function(g,P,S,t){var e=t[P];if(c(e))if(e=Number(e),c(S[g])){if(S[g]>e){var r=e-S[g];return S[g]=e,r}}else return S[g]=e,e;return 0},max:function(g,P,S,t){var e=t[P];if(c(e))if(e=Number(e),c(S[g])){if(S[g]<e){var r=e-S[g];return S[g]=e,r}}else return S[g]=e,e;return 0}}}),jM=Ft((Q,$)=>{$.exports={percent:function(c,g){for(var P=c.length,S=100/g,t=0;t<P;t++)c[t]*=S},probability:function(c,g){for(var P=c.length,S=0;S<P;S++)c[S]/=g},density:function(c,g,P,S){var t=c.length;S=S||1;for(var e=0;e<t;e++)c[e]*=P[e]*S},"probability density":function(c,g,P,S){var t=c.length;S&&(g/=S);for(var e=0;e<t;e++)c[e]*=P[e]/g}}}),UM=Ft((Q,$)=>{$.exports=function(c,g){for(var P=c.length,S=0,t=0;t<P;t++)g[t]?(c[t]/=g[t],S+=c[t]):c[t]=null;return S}}),VM=Ft((Q,$)=>{var c=Da(),g=c.ONEAVGYEAR,P=c.ONEAVGMONTH,S=c.ONEDAY,t=c.ONEHOUR,e=c.ONEMIN,r=c.ONESEC,a=Es().tickIncrement;$.exports=function(f,x,y,v,T){var u=-1.1*x,b=-.1*x,_=f-b,C=y[0],M=y[1],E=Math.min(n(C+b,C+_,v,T),n(M+b,M+_,v,T)),A=Math.min(n(C+u,C+b,v,T),n(M+u,M+b,v,T)),h,p;if(E>A&&A<Math.abs(M-C)/4e3?(h=E,p=!1):(h=Math.min(E,A),p=!0),v.type==="date"&&h>S){var k=h===g?1:6,w=h===g?"M12":"M1";return function(R,O){var N=v.c2d(R,g,T),V=N.indexOf("-",k);V>0&&(N=N.substr(0,V));var H=v.d2c(N,0,T);if(H<R){var F=a(H,w,!1,T);(H+F)/2<R+f&&(H=F)}return O&&p?a(H,w,!0,T):H}}return function(R,O){var N=h*Math.round(R/h);return N+h/10<R&&N+h*.9<R+f&&(N+=h),O&&p&&(N-=h),N}};function n(f,x,y,v){if(f*x<=0)return 1/0;for(var T=Math.abs(x-f),u=y.type==="date",b=o(T,u),_=0;_<10;_++){var C=o(b*80,u);if(b===C)break;if(i(C,f,x,u,y,v))b=C;else break}return b}function o(f,x){return x&&f>r?f>S?f>g*1.1?g:f>P*1.1?P:S:f>t?t:f>e?e:r:Math.pow(10,Math.floor(Math.log(f)/Math.LN10))}function i(f,x,y,v,T,u){if(v&&f>S){var b=s(x,T,u),_=s(y,T,u),C=f===g?0:1;return b[C]!==_[C]}return Math.floor(y/f)-Math.floor(x/f)>.1}function s(f,x,y){var v=x.c2d(f,g,y).split("-");return v[0]===""&&(v.unshift(),v[0]="-"+v[0]),v}}),HM=Ft((Q,$)=>{var c=ra(),g=bn(),P=Xo(),S=Es(),{hasColorscale:t}=Hd(),e=Jd(),r=Rw(),a=NM(),n=jM(),o=UM(),i=VM();function s(T,u){var b=[],_=[],C=u.orientation==="h",M=S.getFromId(T,C?u.yaxis:u.xaxis),E=C?"y":"x",A={x:"y",y:"x"}[E],h=u[E+"calendar"],p=u.cumulative,k,w=f(T,u,M,E),R=w[0],O=w[1],N=typeof R.size=="string",V=[],H=N?V:R,F=[],U=[],W=[],q=0,X=u.histnorm,lt=u.histfunc,yt=X.indexOf("density")!==-1,pt,st,tt;p.enabled&&yt&&(X=X.replace(/ ?density$/,""),yt=!1);var dt=lt==="max"||lt==="min",rt=dt?null:0,at=a.count,vt=n[X],it=!1,Y=function(te){return M.r2c(te,0,h)},ft;for(g.isArrayOrTypedArray(u[A])&&lt!=="count"&&(ft=u[A],it=lt==="avg",at=a[lt]),k=Y(R.start),st=Y(R.end)+(k-S.tickIncrement(k,R.size,!1,h))/1e6;k<st&&b.length<1e6&&(pt=S.tickIncrement(k,R.size,!1,h),b.push((k+pt)/2),_.push(rt),W.push([]),V.push(k),yt&&F.push(1/(pt-k)),it&&U.push(0),!(pt<=k));)k=pt;V.push(k),!N&&M.type==="date"&&(H={start:Y(H.start),end:Y(H.end),size:H.size}),T._fullLayout._roundFnOpts||(T._fullLayout._roundFnOpts={});var ut=u["_"+E+"bingroup"],wt={leftGap:1/0,rightGap:1/0};ut&&(T._fullLayout._roundFnOpts[ut]||(T._fullLayout._roundFnOpts[ut]=wt),wt=T._fullLayout._roundFnOpts[ut]);var zt=_.length,Pt=!0,Wt=wt.leftGap,Ht=wt.rightGap,Jt={};for(k=0;k<O.length;k++){var ge=O[k];tt=g.findBin(ge,H),tt>=0&&tt<zt&&(q+=at(tt,k,_,ft,U),Pt&&W[tt].length&&ge!==O[W[tt][0]]&&(Pt=!1),W[tt].push(k),Jt[k]=tt,Wt=Math.min(Wt,ge-V[tt]),Ht=Math.min(Ht,V[tt+1]-ge))}wt.leftGap=Wt,wt.rightGap=Ht;var he;Pt||(he=function(te,ve){return function(){var oe=T._fullLayout._roundFnOpts[ut];return i(oe.leftGap,oe.rightGap,V,M,h)(te,ve)}}),it&&(q=o(_,U)),vt&&vt(_,q,F),p.enabled&&v(_,p.direction,p.currentbin);var de=Math.min(b.length,_.length),se=[],Tt=0,Lt=de-1;for(k=0;k<de;k++)if(_[k]){Tt=k;break}for(k=de-1;k>=Tt;k--)if(_[k]){Lt=k;break}for(k=Tt;k<=Lt;k++)if(c(b[k])&&c(_[k])){var Mt={p:b[k],s:_[k],b:0};p.enabled||(Mt.pts=W[k],Pt?Mt.ph0=Mt.ph1=W[k].length?O[W[k][0]]:b[k]:(u._computePh=!0,Mt.ph0=he(V[k]),Mt.ph1=he(V[k+1],!0))),se.push(Mt)}return se.length===1&&(se[0].width1=S.tickIncrement(se[0].p,R.size,!1,h)-se[0].p),t(u,"marker")&&e(T,u,{vals:u.marker.color,containerStr:"marker",cLetter:"c"}),t(u,"marker.line")&&e(T,u,{vals:u.marker.line.color,containerStr:"marker.line",cLetter:"c"}),r(se,u),g.isArrayOrTypedArray(u.selectedpoints)&&g.tagSelected(se,u,Jt),se}function f(T,u,b,_,C){var M=_+"bins",E=T._fullLayout,A=u["_"+_+"bingroup"],h=E._histogramBinOpts[A],p=E.barmode==="overlay",k,w,R,O,N,V,H,F=function(ge){return b.r2c(ge,0,O)},U=function(ge){return b.c2r(ge,0,O)},W=b.type==="date"?function(ge){return ge||ge===0?g.cleanDate(ge,null,O):null}:function(ge){return c(ge)?Number(ge):null};function q(ge,he,de){he[ge+"Found"]?(he[ge]=W(he[ge]),he[ge]===null&&(he[ge]=de[ge])):(V[ge]=he[ge]=de[ge],g.nestedProperty(w[0],M+"."+ge).set(de[ge]))}if(u["_"+_+"autoBinFinished"])delete u["_"+_+"autoBinFinished"];else{w=h.traces;var X=[],lt=!0,yt=!1,pt=!1;for(k=0;k<w.length;k++)if(R=w[k],R.visible){var st=h.dirs[k];N=R["_"+st+"pos0"]=b.makeCalcdata(R,st),X=g.concat(X,N),delete R["_"+_+"autoBinFinished"],u.visible===!0&&(lt?lt=!1:(delete R._autoBin,R["_"+_+"autoBinFinished"]=1),P.traceIs(R,"2dMap")&&(yt=!0),R.type==="histogram2dcontour"&&(pt=!0))}O=w[0][_+"calendar"];var tt=S.autoBin(X,b,h.nbins,yt,O,h.sizeFound&&h.size),dt=w[0]._autoBin={};if(V=dt[h.dirs[0]]={},pt&&(h.size||(tt.start=U(S.tickIncrement(F(tt.start),tt.size,!0,O))),h.end===void 0&&(tt.end=U(S.tickIncrement(F(tt.end),tt.size,!1,O)))),p&&!P.traceIs(u,"2dMap")&&tt._dataSpan===0&&b.type!=="category"&&b.type!=="multicategory"&&u.bingroup===""&&typeof u.xbins>"u"){if(C)return[tt,N,!0];tt=x(T,u,b,_,M)}H=R.cumulative||{},H.enabled&&H.currentbin!=="include"&&(H.direction==="decreasing"?tt.start=U(S.tickIncrement(F(tt.start),tt.size,!0,O)):tt.end=U(S.tickIncrement(F(tt.end),tt.size,!1,O))),h.size=tt.size,h.sizeFound||(V.size=tt.size,g.nestedProperty(w[0],M+".size").set(tt.size)),q("start",h,tt),q("end",h,tt)}N=u["_"+_+"pos0"],delete u["_"+_+"pos0"];var rt=u._input[M]||{},at=g.extendFlat({},h),vt=h.start,it=b.r2l(rt.start),Y=it!==void 0;if((h.startFound||Y)&&it!==b.r2l(vt)){var ft=Y?it:g.aggNums(Math.min,null,N),ut={type:b.type==="category"||b.type==="multicategory"?"linear":b.type,r2l:b.r2l,dtick:h.size,tick0:vt,calendar:O,range:[ft,S.tickIncrement(ft,h.size,!1,O)].map(b.l2r)},wt=S.tickFirst(ut);wt>b.r2l(ft)&&(wt=S.tickIncrement(wt,h.size,!0,O)),at.start=b.l2r(wt),Y||g.nestedProperty(u,M+".start").set(at.start)}var zt=h.end,Pt=b.r2l(rt.end),Wt=Pt!==void 0;if((h.endFound||Wt)&&Pt!==b.r2l(zt)){var Ht=Wt?Pt:g.aggNums(Math.max,null,N);at.end=b.l2r(Ht),Wt||g.nestedProperty(u,M+".start").set(at.end)}var Jt="autobin"+_;return u._input[Jt]===!1&&(u._input[M]=g.extendFlat({},u[M]||{}),delete u._input[Jt],delete u[Jt]),[at,N]}function x(T,u,b,_,C){var M=T._fullLayout,E=y(T,u),A=!1,h=1/0,p=[u],k,w,R;for(k=0;k<E.length;k++)if(w=E[k],w===u)A=!0;else if(!A)R=M._histogramBinOpts[w["_"+_+"bingroup"]],h=Math.min(h,R.size||w[C].size);else{var O=f(T,w,b,_,!0),N=O[0],V=O[2];w["_"+_+"autoBinFinished"]=1,w["_"+_+"pos0"]=O[1],V?p.push(w):h=Math.min(h,N.size)}var H=new Array(p.length);for(k=0;k<p.length;k++)for(var F=p[k]["_"+_+"pos0"],U=0;U<F.length;U++)if(F[U]!==void 0){H[k]=F[U];break}for(isFinite(h)||(h=g.distinctVals(H).minDiff),k=0;k<p.length;k++){w=p[k];var W=w[_+"calendar"],q={start:b.c2r(H[k]-h/2,0,W),end:b.c2r(H[k]+h/2,0,W),size:h};w._input[C]=w[C]=q,R=M._histogramBinOpts[w["_"+_+"bingroup"]],R&&g.extendFlat(R,q)}return u[C]}function y(T,u){for(var b=u.xaxis,_=u.yaxis,C=u.orientation,M=[],E=T._fullData,A=0;A<E.length;A++){var h=E[A];h.type==="histogram"&&h.visible===!0&&h.orientation===C&&h.xaxis===b&&h.yaxis===_&&M.push(h)}return M}function v(T,u,b){var _,C,M;function E(h){M=T[h],T[h]/=2}function A(h){C=T[h],T[h]=M+C/2,M+=C}if(b==="half")if(u==="increasing")for(E(0),_=1;_<T.length;_++)A(_);else for(E(T.length-1),_=T.length-2;_>=0;_--)A(_);else if(u==="increasing"){for(_=1;_<T.length;_++)T[_]+=T[_-1];b==="exclude"&&(T.unshift(0),T.pop())}else{for(_=T.length-2;_>=0;_--)T[_]+=T[_+1];b==="exclude"&&(T.push(0),T.shift())}}$.exports={calc:s,calcAllAutoBins:f}}),HF=Ft((Q,$)=>{var c=bn(),g=Es(),P=NM(),S=jM(),t=UM(),e=VM(),r=HM().calcAllAutoBins;$.exports=function(i,s){var f=g.getFromId(i,s.xaxis),x=g.getFromId(i,s.yaxis),y=s.xcalendar,v=s.ycalendar,T=function(Ce){return f.r2c(Ce,0,y)},u=function(Ce){return x.r2c(Ce,0,v)},b=function(Ce){return f.c2r(Ce,0,y)},_=function(Ce){return x.c2r(Ce,0,v)},C,M,E,A,h=r(i,s,f,"x"),p=h[0],k=h[1],w=r(i,s,x,"y"),R=w[0],O=w[1],N=s._length;k.length>N&&k.splice(N,k.length-N),O.length>N&&O.splice(N,O.length-N);var V=[],H=[],F=[],U=typeof p.size=="string",W=typeof R.size=="string",q=[],X=[],lt=U?q:p,yt=W?X:R,pt=0,st=[],tt=[],dt=s.histnorm,rt=s.histfunc,at=dt.indexOf("density")!==-1,vt=rt==="max"||rt==="min",it=vt?null:0,Y=P.count,ft=S[dt],ut=!1,wt=[],zt=[],Pt="z"in s?s.z:"marker"in s&&Array.isArray(s.marker.color)?s.marker.color:"";Pt&&rt!=="count"&&(ut=rt==="avg",Y=P[rt]);var Wt=p.size,Ht=T(p.start),Jt=T(p.end)+(Ht-g.tickIncrement(Ht,Wt,!1,y))/1e6;for(C=Ht;C<Jt;C=g.tickIncrement(C,Wt,!1,y))H.push(it),q.push(C),ut&&F.push(0);q.push(C);var ge=H.length,he=(C-Ht)/ge,de=b(Ht+he/2),se=R.size,Tt=u(R.start),Lt=u(R.end)+(Tt-g.tickIncrement(Tt,se,!1,v))/1e6;for(C=Tt;C<Lt;C=g.tickIncrement(C,se,!1,v)){V.push(H.slice()),X.push(C);var Mt=new Array(ge);for(M=0;M<ge;M++)Mt[M]=[];tt.push(Mt),ut&&st.push(F.slice())}X.push(C);var te=V.length,ve=(C-Tt)/te,oe=_(Tt+ve/2);at&&(wt=a(H.length,lt,he,U),zt=a(V.length,yt,ve,W)),!U&&f.type==="date"&&(lt=n(T,lt)),!W&&x.type==="date"&&(yt=n(u,yt));var Te=!0,He=!0,Ge=new Array(ge),cr=new Array(te),ur=1/0,jr=1/0,Hr=1/0,br=1/0;for(C=0;C<N;C++){var Kr=k[C],rn=O[C];E=c.findBin(Kr,lt),A=c.findBin(rn,yt),E>=0&&E<ge&&A>=0&&A<te&&(pt+=Y(E,C,V[A],Pt,st[A]),tt[A][E].push(C),Te&&(Ge[E]===void 0?Ge[E]=Kr:Ge[E]!==Kr&&(Te=!1)),He&&(cr[A]===void 0?cr[A]=rn:cr[A]!==rn&&(He=!1)),ur=Math.min(ur,Kr-q[E]),jr=Math.min(jr,q[E+1]-Kr),Hr=Math.min(Hr,rn-X[A]),br=Math.min(br,X[A+1]-rn))}if(ut)for(A=0;A<te;A++)pt+=t(V[A],st[A]);if(ft)for(A=0;A<te;A++)ft(V[A],pt,wt,zt[A]);return{x:k,xRanges:o(q,Te&&Ge,ur,jr,f,y),x0:de,dx:he,y:O,yRanges:o(X,He&&cr,Hr,br,x,v),y0:oe,dy:ve,z:V,pts:tt}};function a(i,s,f,x){var y=new Array(i),v;if(x)for(v=0;v<i;v++)y[v]=1/(s[v+1]-s[v]);else{var T=1/f;for(v=0;v<i;v++)y[v]=T}return y}function n(i,s){return{start:i(s.start),end:i(s.end),size:s.size}}function o(i,s,f,x,y,v){var T,u=i.length-1,b=new Array(u),_=e(f,x,i,y,v);for(T=0;T<u;T++){var C=(s||[])[T];b[T]=C===void 0?[_(i[T]),_(i[T+1],!0)]:[C,C]}return b}}),R6=Ft((Q,$)=>{var c=bn(),g=Da().BADNUM,P=D0();$.exports=function(S,t,e,r,a,n){var o=S._length,i=t.makeCalcdata(S,r),s=e.makeCalcdata(S,a);i=P(S,t,r,i).vals,s=P(S,e,a,s).vals;var f=S.text,x=f!==void 0&&c.isArray1D(f),y=S.hovertext,v=y!==void 0&&c.isArray1D(y),T,u,b=c.distinctVals(i),_=b.vals,C=c.distinctVals(s),M=C.vals,E=[],A,h,p=M.length,k=_.length;for(T=0;T<n.length;T++)E[T]=c.init2dArray(p,k);x&&(A=c.init2dArray(p,k)),v&&(h=c.init2dArray(p,k));var w=c.init2dArray(p,k);for(T=0;T<o;T++)if(i[T]!==g&&s[T]!==g){var R=c.findBin(i[T]+b.minDiff/2,_),O=c.findBin(s[T]+C.minDiff/2,M);for(u=0;u<n.length;u++){var N=n[u],V=S[N],H=E[u];H[O][R]=V[T],w[O][R]=T}x&&(A[O][R]=f[T]),v&&(h[O][R]=y[T])}for(S["_"+r]=_,S["_"+a]=M,u=0;u<n.length;u++)S["_"+n[u]]=E[u];x&&(S._text=A),v&&(S._hovertext=h),t&&t.type==="category"&&(S["_"+r+"CategoryMap"]=_.map(function(F){return t._categories[F]})),e&&e.type==="category"&&(S["_"+a+"CategoryMap"]=M.map(function(F){return e._categories[F]})),S._after2before=w}}),B6=Ft((Q,$)=>{var c=ra(),g=bn(),P=Da().BADNUM;$.exports=function(S,t,e,r){var a,n,o,i,s,f;function x(_){if(c(_))return+_}if(t&&t.transpose){for(a=0,s=0;s<S.length;s++)a=Math.max(a,S[s].length);if(a===0)return!1;o=function(_){return _.length},i=function(_,C,M){return(_[M]||[])[C]}}else a=S.length,o=function(_,C){return _[C].length},i=function(_,C,M){return(_[C]||[])[M]};var y=function(_,C,M){return C===P||M===P?P:i(_,C,M)};function v(_){if(t&&t.type!=="carpet"&&t.type!=="contourcarpet"&&_&&_.type==="category"&&t["_"+_._id.charAt(0)].length){var C=_._id.charAt(0),M={},E=t["_"+C+"CategoryMap"]||t[C];for(s=0;s<E.length;s++)M[E[s]]=s;return function(A){var h=M[_._categories[A]];return h+1?h:P}}else return g.identity}var T=v(e),u=v(r);r&&r.type==="category"&&(a=r._categories.length);var b=new Array(a);for(s=0;s<a;s++)for(e&&e.type==="category"?n=e._categories.length:n=o(S,s),b[s]=new Array(n),f=0;f<n;f++)b[s][f]=x(y(S,u(s),T(f)));return b}}),N6=Ft((Q,$)=>{var c=bn(),g=.01,P=[[-1,0],[1,0],[0,-1],[0,1]];function S(e){return .5-.25*Math.min(1,e*.5)}$.exports=function(e,r){var a=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&&a>g;n++)a=t(e,r,S(a));return a>g&&c.log("interp2d didn't converge quickly",a),e};function t(e,r,a){var n=0,o,i,s,f,x,y,v,T,u,b,_,C,M;for(f=0;f<r.length;f++){for(o=r[f],i=o[0],s=o[1],_=e[i][s],b=0,u=0,x=0;x<4;x++)y=P[x],v=e[i+y[0]],v&&(T=v[s+y[1]],T!==void 0&&(b===0?C=M=T:(C=Math.min(C,T),M=Math.max(M,T)),u++,b+=T));if(u===0)throw"iterateInterp2d order is wrong: no defined neighbors";e[i][s]=b/u,_===void 0?u<4&&(n=1):(e[i][s]=(1+a)*e[i][s]-a*_,M>C&&(n=Math.max(n,Math.abs(e[i][s]-_)/(M-C))))}return n}}),j6=Ft((Q,$)=>{var c=bn().maxRowLength;$.exports=function(g){var P=[],S={},t=[],e=g[0],r=[],a=[0,0,0],n=c(g),o,i,s,f,x,y,v,T;for(i=0;i<g.length;i++)for(o=r,r=e,e=g[i+1]||[],s=0;s<n;s++)r[s]===void 0&&(y=(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),y?(i===0&&y++,s===0&&y++,i===g.length-1&&y++,s===r.length-1&&y++,y<4&&(S[[i,s]]=[i,s,y]),P.push([i,s,y])):t.push([i,s]));for(;t.length;){for(v={},T=!1,x=t.length-1;x>=0;x--)f=t[x],i=f[0],s=f[1],y=((S[[i-1,s]]||a)[2]+(S[[i+1,s]]||a)[2]+(S[[i,s-1]]||a)[2]+(S[[i,s+1]]||a)[2])/20,y&&(v[f]=[i,s,y],t.splice(x,1),T=!0);if(!T)throw"findEmpties iterated with no new neighbors";for(f in v)S[f]=v[f],P.push(v[f])}return P.sort(function(u,b){return b[2]-u[2]})}}),WM=Ft((Q,$)=>{var c=Xo(),g=bn().isArrayOrTypedArray;$.exports=function(P,S,t,e,r,a){var n=[],o=c.traceIs(P,"contour"),i=c.traceIs(P,"histogram"),s,f,x,y=g(S)&&S.length>1;if(y&&!i&&a.type!=="category"){var v=S.length;if(v<=r){if(o)n=Array.from(S).slice(0,r);else if(r===1)a.type==="log"?n=[.5*S[0],2*S[0]]:n=[S[0]-.5,S[0]+.5];else if(a.type==="log"){for(n=[Math.pow(S[0],1.5)/Math.pow(S[1],.5)],x=1;x<v;x++)n.push(Math.sqrt(S[x-1]*S[x]));n.push(Math.pow(S[v-1],1.5)/Math.pow(S[v-2],.5))}else{for(n=[1.5*S[0]-.5*S[1]],x=1;x<v;x++)n.push((S[x-1]+S[x])*.5);n.push(1.5*S[v-1]-.5*S[v-2])}if(v<r){var T=n[n.length-1],u;if(a.type==="log")for(u=T/n[n.length-2],x=v;x<r;x++)T*=u,n.push(T);else for(u=T-n[n.length-2],x=v;x<r;x++)T+=u,n.push(T)}}else return o?S.slice(0,r):S.slice(0,r+1)}else{var b=P[a._id.charAt(0)+"calendar"];if(i)s=a.r2c(t,0,b);else if(g(S)&&S.length===1)s=S[0];else if(t===void 0)s=0;else{var _=a.type==="log"?a.d2c:a.r2c;s=_(t,0,b)}for(f=e||1,x=o?0:-.5;x<r;x++)n.push(s+f*x)}return n}}),U6=Ft((Q,$)=>{var c=Xo(),g=bn(),P=Es(),S=D0(),t=HF(),e=Jd(),r=R6(),a=B6(),n=N6(),o=j6(),i=WM(),s=Da().BADNUM;$.exports=function(y,v){var T=P.getFromId(y,v.xaxis||"x"),u=P.getFromId(y,v.yaxis||"y"),b=c.traceIs(v,"contour"),_=c.traceIs(v,"histogram"),C=b?"best":v.zsmooth,M,E,A,h,p,k,w,R,O,N,V;if(T._minDtick=0,u._minDtick=0,_)V=t(y,v),h=V.orig_x,M=V.x,E=V.x0,A=V.dx,R=V.orig_y,p=V.y,k=V.y0,w=V.dy,O=V.z;else{var H=v.z;g.isArray1D(H)?(r(v,T,u,"x","y",["z"]),M=v._x,p=v._y,H=v._z):(h=v.x?T.makeCalcdata(v,"x"):[],R=v.y?u.makeCalcdata(v,"y"):[],M=S(v,T,"x",h).vals,p=S(v,u,"y",R).vals,v._x=M,v._y=p),E=v.x0,A=v.dx,k=v.y0,w=v.dy,O=a(H,v,T,u)}(T.rangebreaks||u.rangebreaks)&&(O=x(M,p,O),_||(M=f(M),p=f(p),v._x=M,v._y=p)),!_&&(b||v.connectgaps)&&(v._emptypoints=o(O),n(O,v._emptypoints));function F(tt){C=v._input.zsmooth=v.zsmooth=!1,g.warn('cannot use zsmooth: "fast": '+tt)}function U(tt){if(tt.length>1){var dt=(tt[tt.length-1]-tt[0])/(tt.length-1),rt=Math.abs(dt/100);for(N=0;N<tt.length-1;N++)if(Math.abs(tt[N+1]-tt[N]-dt)>rt)return!1}return!0}v._islinear=!1,T.type==="log"||u.type==="log"?C==="fast"&&F("log axis found"):U(M)?U(p)?v._islinear=!0:C==="fast"&&F("y scale is not linear"):C==="fast"&&F("x scale is not linear");var W=g.maxRowLength(O),q=v.xtype==="scaled"?"":M,X=i(v,q,E,A,W,T),lt=v.ytype==="scaled"?"":p,yt=i(v,lt,k,w,O.length,u);v._extremes[T._id]=P.findExtremes(T,X),v._extremes[u._id]=P.findExtremes(u,yt);var pt={x:X,y:yt,z:O,text:v._text||v.text,hovertext:v._hovertext||v.hovertext};if(v.xperiodalignment&&h&&(pt.orig_x=h),v.yperiodalignment&&R&&(pt.orig_y=R),q&&q.length===X.length-1&&(pt.xCenter=q),lt&&lt.length===yt.length-1&&(pt.yCenter=lt),_&&(pt.xRanges=V.xRanges,pt.yRanges=V.yRanges,pt.pts=V.pts),b||e(y,v,{vals:O,cLetter:"z"}),b&&v.contours&&v.contours.coloring==="heatmap"){var st={type:v.type==="contour"?"heatmap":"histogram2d",xcalendar:v.xcalendar,ycalendar:v.ycalendar};pt.xfill=i(st,q,E,A,W,T),pt.yfill=i(st,lt,k,w,O.length,u)}return[pt]};function f(y){for(var v=[],T=y.length,u=0;u<T;u++){var b=y[u];b!==s&&v.push(b)}return v}function x(y,v,T){for(var u=[],b=-1,_=0;_<T.length;_++)if(v[_]!==s){b++,u[b]=[];for(var C=0;C<T[_].length;C++)y[C]!==s&&u[b].push(T[_][C])}return u}}),V6=Ft(Q=>{Q.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"]],Q.STYLE=Q.CSS_DECLARATIONS.map(function($){return $.join(": ")+"; "}).join("")}),qM=Ft((Q,$)=>{var c=V6(),g=js(),P=bn(),S=null;function t(){if(S!==null)return S;S=!1;var e=P.isSafari()||P.isMacWKWebView()||P.isIOS();if(window.navigator.userAgent&&!e){var r=Array.from(c.CSS_DECLARATIONS).reverse(),a=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof a=="function")S=r.some(function(s){return a.apply(null,s)});else{var n=g.tester.append("image").attr("style",c.STYLE),o=window.getComputedStyle(n.node()),i=o.imageRendering;S=r.some(function(s){var f=s[1];return i===f||i===f.toLowerCase()}),n.remove()}}return S}$.exports=t}),H6=Ft((Q,$)=>{var c=un(),g=fo(),P=Xo(),S=js(),t=Es(),e=bn(),r=tc(),a=Vs(),n=li(),o=Xc().extractOpts,i=Xc().makeColorScaleFuncFromTrace,s=Op(),f=Af(),x=f.LINE_SPACING,y=qM(),v=V6().STYLE,T="heatmap-label";function u(E){return E.selectAll("g."+T)}function b(E){u(E).remove()}$.exports=function(E,A,h,p){var k=A.xaxis,w=A.yaxis;e.makeTraceGroups(p,h,"hm").each(function(R){var O=c.select(this),N=R[0],V=N.trace,H=V.xgap||0,F=V.ygap||0,U=N.z,W=N.x,q=N.y,X=N.xCenter,lt=N.yCenter,yt=P.traceIs(V,"contour"),pt=yt?"best":V.zsmooth,st=U.length,tt=e.maxRowLength(U),dt=!1,rt=!1,at,vt,it,Y,ft,ut,wt,zt;for(ut=0;at===void 0&&ut<W.length-1;)at=k.c2p(W[ut]),ut++;for(ut=W.length-1;vt===void 0&&ut>0;)vt=k.c2p(W[ut]),ut--;for(vt<at&&(it=vt,vt=at,at=it,dt=!0),ut=0;Y===void 0&&ut<q.length-1;)Y=w.c2p(q[ut]),ut++;for(ut=q.length-1;ft===void 0&&ut>0;)ft=w.c2p(q[ut]),ut--;ft<Y&&(it=Y,Y=ft,ft=it,rt=!0),yt&&(X=W,lt=q,W=N.xfill,q=N.yfill);var Pt="default";if(pt?Pt=pt==="best"?"smooth":"fast":V._islinear&&H===0&&F===0&&y()&&(Pt="fast"),Pt!=="fast"){var Wt=pt==="best"?0:.5;at=Math.max(-Wt*k._length,at),vt=Math.min((1+Wt)*k._length,vt),Y=Math.max(-Wt*w._length,Y),ft=Math.min((1+Wt)*w._length,ft)}var Ht=Math.round(vt-at),Jt=Math.round(ft-Y),ge=at>=k._length||vt<=0||Y>=w._length||ft<=0;if(ge){var he=O.selectAll("image").data([]);he.exit().remove(),b(O);return}var de,se;Pt==="fast"?(de=tt,se=st):(de=Ht,se=Jt);var Tt=document.createElement("canvas");Tt.width=de,Tt.height=se;var Lt=Tt.getContext("2d",{willReadFrequently:!0}),Mt=i(V,{noNumericCheck:!0,returnArray:!0}),te,ve;Pt==="fast"?(te=dt?function(Zn){return tt-1-Zn}:e.identity,ve=rt?function(Zn){return st-1-Zn}:e.identity):(te=function(Zn){return e.constrain(Math.round(k.c2p(W[Zn])-at),0,Ht)},ve=function(Zn){return e.constrain(Math.round(w.c2p(q[Zn])-Y),0,Jt)});var oe=ve(0),Te=[oe,oe],He=dt?0:1,Ge=rt?0:1,cr=0,ur=0,jr=0,Hr=0,br,Kr,rn,Ce,$t;function ne(Zn,Ca){if(Zn!==void 0){var Ri=Mt(Zn);return Ri[0]=Math.round(Ri[0]),Ri[1]=Math.round(Ri[1]),Ri[2]=Math.round(Ri[2]),cr+=Ca,ur+=Ri[0]*Ca,jr+=Ri[1]*Ca,Hr+=Ri[2]*Ca,Ri}return[0,0,0,0]}function Ct(Zn,Ca,Ri,Ja){var Xa=Zn[Ri.bin0];if(Xa===void 0)return ne(void 0,1);var Io=Zn[Ri.bin1],po=Ca[Ri.bin0],Do=Ca[Ri.bin1],Ia=Io-Xa||0,gs=po-Xa||0,is;return Io===void 0?Do===void 0?is=0:po===void 0?is=2*(Do-Xa):is=(2*Do-po-Xa)*2/3:Do===void 0?po===void 0?is=0:is=(2*Xa-Io-po)*2/3:po===void 0?is=(2*Do-Io-Xa)*2/3:is=Do+Xa-Io-po,ne(Xa+Ri.frac*Ia+Ja.frac*(gs+Ri.frac*is))}if(Pt!=="default"){var gt=0,St;try{St=new Uint8Array(de*se*4)}catch{St=new Array(de*se*4)}if(Pt==="smooth"){var Nt=X||W,ee=lt||q,le=new Array(Nt.length),we=new Array(ee.length),Ue=new Array(Ht),qe=X?C:_,ar=lt?C:_,Ar,Tr,pr;for(ut=0;ut<Nt.length;ut++)le[ut]=Math.round(k.c2p(Nt[ut])-at);for(ut=0;ut<ee.length;ut++)we[ut]=Math.round(w.c2p(ee[ut])-Y);for(ut=0;ut<Ht;ut++)Ue[ut]=qe(ut,le);for(wt=0;wt<Jt;wt++)for(Ar=ar(wt,we),Tr=U[Ar.bin0],pr=U[Ar.bin1],ut=0;ut<Ht;ut++,gt+=4)$t=Ct(Tr,pr,Ue[ut],Ar),M(St,gt,$t)}else for(wt=0;wt<st;wt++)for(Ce=U[wt],Te=ve(wt),ut=0;ut<tt;ut++)$t=ne(Ce[ut],1),gt=(Te*tt+te(ut))*4,M(St,gt,$t);var Jr=Lt.createImageData(de,se);try{Jr.data.set(St)}catch{var Vn=Jr.data,Hn=Vn.length;for(wt=0;wt<Hn;wt++)Vn[wt]=St[wt]}Lt.putImageData(Jr,0,0)}else{var Kn=Math.floor(H/2),Ci=Math.floor(F/2);for(wt=0;wt<st;wt++)if(Ce=U[wt],Te.reverse(),Te[Ge]=ve(wt+1),!(Te[0]===Te[1]||Te[0]===void 0||Te[1]===void 0))for(Kr=te(0),br=[Kr,Kr],ut=0;ut<tt;ut++)br.reverse(),br[He]=te(ut+1),!(br[0]===br[1]||br[0]===void 0||br[1]===void 0)&&(rn=Ce[ut],$t=ne(rn,(br[1]-br[0])*(Te[1]-Te[0])),Lt.fillStyle="rgba("+$t.join(",")+")",Lt.fillRect(br[0]+Kn,Te[0]+Ci,br[1]-br[0]-H,Te[1]-Te[0]-F))}ur=Math.round(ur/cr),jr=Math.round(jr/cr),Hr=Math.round(Hr/cr);var ii=g("rgb("+ur+","+jr+","+Hr+")");E._hmpixcount=(E._hmpixcount||0)+cr,E._hmlumcount=(E._hmlumcount||0)+cr*ii.getLuminance();var qn=O.selectAll("image").data(R);qn.enter().append("svg:image").attr({xmlns:s.svg,preserveAspectRatio:"none"}),qn.attr({height:Jt,width:Ht,x:at,y:Y,"xlink:href":Tt.toDataURL("image/png")}),Pt==="fast"&&!pt&&qn.attr("style",v),b(O);var oa=V.texttemplate;if(oa){var Hi=o(V),We={type:"linear",range:[Hi.min,Hi.max],_separators:k._separators,_numFormat:k._numFormat},rr=V.type==="histogram2dcontour",fr=V.type==="contour",xr=fr?1:0,Qr=fr?st-1:st,Cn=fr?1:0,wn=fr?tt-1:tt,Mn=[];for(ut=xr;ut<Qr;ut++){var ci;if(fr)ci=N.y[ut];else if(rr){if(ut===0||ut===st-1)continue;ci=N.y[ut]}else if(N.yCenter)ci=N.yCenter[ut];else{if(ut+1===st&&N.y[ut+1]===void 0)continue;ci=(N.y[ut]+N.y[ut+1])/2}var xi=Math.round(w.c2p(ci));if(!(0>xi||xi>w._length))for(wt=Cn;wt<wn;wt++){var Pi;if(fr)Pi=N.x[wt];else if(rr){if(wt===0||wt===tt-1)continue;Pi=N.x[wt]}else if(N.xCenter)Pi=N.xCenter[wt];else{if(wt+1===tt&&N.x[wt+1]===void 0)continue;Pi=(N.x[wt]+N.x[wt+1])/2}var Di=Math.round(k.c2p(Pi));if(!(0>Di||Di>k._length)){var Zi=a({x:Pi,y:ci},V,E._fullLayout);Zi.x=Pi,Zi.y=ci;var ui=N.z[ut][wt];ui===void 0?(Zi.z="",Zi.zLabel=""):(Zi.z=ui,Zi.zLabel=t.tickText(We,ui,"hover").text);var Pa=N.text&&N.text[ut]&&N.text[ut][wt];(Pa===void 0||Pa===!1)&&(Pa=""),Zi.text=Pa;var Wa=e.texttemplateString({data:[Zi,V._meta],fallback:V.texttemplatefallback,labels:Zi,locale:E._fullLayout._d3locale,template:oa});if(Wa){var ze=Wa.split("<br>"),Pe=ze.length,Rr=0;for(zt=0;zt<Pe;zt++)Rr=Math.max(Rr,ze[zt].length);Mn.push({l:Pe,c:Rr,t:Wa,x:Di,y:xi,z:ui})}}}}var qr=V.textfont,$r=qr.size,Br=E._fullLayout.font.size;if(!$r||$r==="auto"){var Gr=1/0,dn=1/0,an=0,Ee=0;for(zt=0;zt<Mn.length;zt++){var dr=Mn[zt];if(an=Math.max(an,dr.l),Ee=Math.max(Ee,dr.c),zt<Mn.length-1){var Vr=Mn[zt+1],yn=Math.abs(Vr.x-dr.x),Fn=Math.abs(Vr.y-dr.y);yn&&(Gr=Math.min(Gr,yn)),Fn&&(dn=Math.min(dn,Fn))}}!isFinite(Gr)||!isFinite(dn)?$r=Br:(Gr-=H,dn-=F,Gr/=Ee,dn/=an,Gr/=x/2,dn/=x,$r=Math.min(Math.floor(Gr),Math.floor(dn),Br))}if($r<=0||!isFinite($r))return;var Xn=function(Zn){return Zn.x},Pn=function(Zn){return Zn.y-$r*(Zn.l*x/2-1)},En=u(O).data(Mn);En.enter().append("g").classed(T,1).append("text").attr("text-anchor","middle").each(function(Zn){var Ca=c.select(this),Ri=qr.color;(!Ri||Ri==="auto")&&(Ri=n.contrast(Zn.z===void 0?E._fullLayout.plot_bgcolor:"rgba("+Mt(Zn.z).join()+")")),Ca.attr("data-notex",1).call(r.positionText,Xn(Zn),Pn(Zn)).call(S.font,{family:qr.family,size:$r,color:Ri,weight:qr.weight,style:qr.style,variant:qr.variant,textcase:qr.textcase,lineposition:qr.lineposition,shadow:qr.shadow}).text(Zn.t).call(r.convertToTspans,E)})}})};function _(E,A){var h=A.length-2,p=e.constrain(e.findBin(E,A),0,h),k=A[p],w=A[p+1],R=e.constrain(p+(E-k)/(w-k)-.5,0,h),O=Math.round(R),N=Math.abs(R-O);return!R||R===h||!N?{bin0:O,bin1:O,frac:0}:{bin0:O,frac:N,bin1:Math.round(O+N/(R-O))}}function C(E,A){var h=A.length-1,p=e.constrain(e.findBin(E,A),0,h),k=A[p],w=A[p+1],R=(E-k)/(w-k)||0;return R<=0?{bin0:p,bin1:p,frac:0}:R<.5?{bin0:p,bin1:p+1,frac:R}:{bin0:p+1,bin1:p,frac:1-R}}function M(E,A,h){E[A]=h[0],E[A+1]=h[1],E[A+2]=h[2],E[A+3]=Math.round(h[3]*255)}}),L1=Ft((Q,$)=>{$.exports={min:"zmin",max:"zmax"}}),W6=Ft((Q,$)=>{var c=un();$.exports=function(g){c.select(g).selectAll(".hm image").style("opacity",function(P){return P.trace.opacity})}}),q6=Ft((Q,$)=>{var c=Qh(),g=bn(),P=g.isArrayOrTypedArray,S=Es(),t=Xc().extractOpts;$.exports=function(e,r,a,n,o){o||(o={});var i=o.isContour,s=e.cd[0],f=s.trace,x=e.xa,y=e.ya,v=s.x,T=s.y,u=s.z,b=s.xCenter,_=s.yCenter,C=s.zmask,M=f.zhoverformat,E=v,A=T,h,p,k,w;if(e.index!==!1){try{k=Math.round(e.index[1]),w=Math.round(e.index[0])}catch{g.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index);return}if(k<0||k>=u[0].length||w<0||w>u.length)return}else{if(c.inbox(r-v[0],r-v[v.length-1],0)>0||c.inbox(a-T[0],a-T[T.length-1],0)>0)return;if(i){var R;for(E=[2*v[0]-v[1]],R=1;R<v.length;R++)E.push((v[R]+v[R-1])/2);for(E.push([2*v[v.length-1]-v[v.length-2]]),A=[2*T[0]-T[1]],R=1;R<T.length;R++)A.push((T[R]+T[R-1])/2);A.push([2*T[T.length-1]-T[T.length-2]])}k=Math.max(0,Math.min(E.length-2,g.findBin(r,E))),w=Math.max(0,Math.min(A.length-2,g.findBin(a,A)))}var O=x.c2p(v[k]),N=x.c2p(v[k+1]),V=y.c2p(T[w]),H=y.c2p(T[w+1]),F,U;i?(F=s.orig_x||v,U=s.orig_y||T,N=O,h=F[k],H=V,p=U[w]):(F=s.orig_x||b||v,U=s.orig_y||_||T,h=b?F[k]:(F[k]+F[k+1])/2,p=_?U[w]:(U[w]+U[w+1])/2,x&&x.type==="category"&&(h=v[k]),y&&y.type==="category"&&(p=T[w]),f.zsmooth&&(O=N=x.c2p(h),V=H=y.c2p(p)));var W=u[w][k];if(C&&!C[w][k]&&(W=void 0),!(W===void 0&&!f.hoverongaps)){var q;P(s.hovertext)&&P(s.hovertext[w])?q=s.hovertext[w][k]:P(s.text)&&P(s.text[w])&&(q=s.text[w][k]);var X=t(f),lt={type:"linear",range:[X.min,X.max],hoverformat:M,_separators:x._separators,_numFormat:x._numFormat},yt=S.tickText(lt,W,"hover").text;return[g.extendFlat(e,{index:f._after2before?f._after2before[w][k]:[w,k],distance:e.maxHoverDistance,spikeDistance:e.maxSpikeDistance,x0:O,x1:N,y0:V,y1:H,xLabelVal:h,yLabelVal:p,zLabelVal:W,zLabel:yt,text:q})]}}}),WF=Ft((Q,$)=>{$.exports={attributes:X_(),supplyDefaults:VF(),calc:U6(),plot:H6(),colorbar:L1(),style:W6(),hoverPoints:q6(),moduleType:"trace",name:"heatmap",basePlotModule:Mf(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}),qF=Ft((Q,$)=>{$.exports=WF()}),ZM=Ft((Q,$)=>{$.exports=function(c,g){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}),ZF=Ft((Q,$)=>{$.exports={eventDataKeys:["binNumber"]}}),Z6=Ft((Q,$)=>{var c=Sg(),g=fh().axisHoverFormat,{hovertemplateAttrs:P,texttemplateAttrs:S,templatefallbackAttrs:t}=$u(),e=Ea(),r=ZM(),a=ZF(),n=Ta().extendFlat;$.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:g("x"),yhoverformat:g("y"),text:n({},c.text,{}),hovertext:n({},c.hovertext,{}),orientation:c.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins: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:P({},{keys:a.eventDataKeys}),hovertemplatefallback:t(),texttemplate:S({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),texttemplatefallback:t({editType:"plot"}),textposition:n({},c.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:c.insidetextanchor,textangle:c.textangle,cliponaxis:c.cliponaxis,constraintext:c.constraintext,marker:c.marker,offsetgroup:c.offsetgroup,alignmentgroup:c.alignmentgroup,selected:c.selected,unselected:c.unselected,zorder:c.zorder}}),$F=Ft((Q,$)=>{var c=Xo(),g=bn(),P=li(),S=J0().handleText,t=L6(),e=Z6();$.exports=function(r,a,n,o){function i(A,h){return g.coerce(r,a,e,A,h)}var s=i("x"),f=i("y"),x=i("cumulative.enabled");x&&(i("cumulative.direction"),i("cumulative.currentbin")),i("text");var y=i("textposition");S(r,a,o,i,y,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("xhoverformat"),i("yhoverformat");var v=i("orientation",f&&!s?"h":"v"),T=v==="v"?"x":"y",u=v==="v"?"y":"x",b=s&&f?Math.min(g.minRowLength(s)&&g.minRowLength(f)):g.minRowLength(a[T]||[]);if(!b){a.visible=!1;return}a._length=b;var _=c.getComponentMethod("calendars","handleTraceDefaults");_(r,a,["x","y"],o);var C=a[u];C&&i("histfunc"),i("histnorm"),i("autobin"+T),t(r,a,i,n,o),g.coerceSelectionMarkerOpacity(a,i);var M=(a.marker.line||{}).color,E=c.getComponentMethod("errorbars","supplyDefaults");E(r,a,M||P.defaultLine,{axis:"y"}),E(r,a,M||P.defaultLine,{axis:"x",inherit:"y"}),i("zorder")}}),$6=Ft((Q,$)=>{var c=bn(),g=Rc(),P=Xo().traceIs,S=Mg(),t=J0().validateCornerradius,e=c.nestedProperty,r=vv().getAxisGroup,a=[{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"];$.exports=function(o,i){var s=i._histogramBinOpts={},f=[],x={},y=[],v,T,u,b,_,C,M;function E(yt,pt){return c.coerce(v._input,v,v._module.attributes,yt,pt)}function A(yt){return yt.orientation==="v"?"x":"y"}function h(yt,pt){var st=g.getFromTrace({_fullLayout:i},yt,pt);return st.type}function p(yt,pt,st){var tt=yt.uid+"__"+st;pt||(pt=tt);var dt=h(yt,st),rt=yt[st+"calendar"]||"",at=s[pt],vt=!0;at&&(dt===at.axType&&rt===at.calendar?(vt=!1,at.traces.push(yt),at.dirs.push(st)):(pt=tt,dt!==at.axType&&c.warn(["Attempted to group the bins of trace",yt.index,"set on a","type:"+dt,"axis","with bins on","type:"+at.axType,"axis."].join(" ")),rt!==at.calendar&&c.warn(["Attempted to group the bins of trace",yt.index,"set with a",rt,"calendar","with bins",at.calendar?"on a "+at.calendar+" calendar":"w/o a set calendar"].join(" ")))),vt&&(s[pt]={traces:[yt],dirs:[st],axType:dt,calendar:yt[st+"calendar"]||""}),yt["_"+st+"bingroup"]=pt}for(_=0;_<o.length;_++)if(v=o[_],P(v,"histogram")){if(f.push(v),delete v._xautoBinFinished,delete v._yautoBinFinished,v.type==="histogram"){var k=E("marker.cornerradius",i.barcornerradius);v.marker&&(v.marker.cornerradius=t(k))}P(v,"2dMap")||S(v._input,v,i,E,i.barmode)}var w=i._alignmentOpts||{};for(_=0;_<f.length;_++){if(v=f[_],u="",!P(v,"2dMap")){if(b=A(v),i.barmode==="group"&&v.alignmentgroup){var R=v[b+"axis"],O=r(i,R)+v.orientation;(w[O]||{})[v.alignmentgroup]&&(u=O)}!u&&i.barmode!=="overlay"&&(u=r(i,v.xaxis)+r(i,v.yaxis)+A(v))}u?(x[u]||(x[u]=[]),x[u].push(v)):y.push(v)}for(u in x){if(T=x[u],T.length===1){y.push(T[0]);continue}var N=!1;for(T.length&&(v=T[0],N=E("bingroup")),u=N||u,_=0;_<T.length;_++){v=T[_];var V=v._input.bingroup;V&&V!==u&&c.warn(["Trace",v.index,"must match","within bingroup",u+".","Ignoring its bingroup:",V,"setting."].join(" ")),v.bingroup=u,p(v,u,A(v))}}for(_=0;_<y.length;_++){v=y[_];var H=E("bingroup");if(P(v,"2dMap"))for(M=0;M<2;M++){b=n[M];var F=E(b+"bingroup",H?H+"__"+b:null);p(v,F,b)}else p(v,H,A(v))}for(u in s){var U=s[u];for(T=U.traces,C=0;C<a.length;C++){var W=a[C],q=W.name,X,lt;if(!(q==="nbins"&&U.sizeFound)){for(_=0;_<T.length;_++){if(v=T[_],b=U.dirs[_],X=W.aStr[b],e(v._input,X).get()!==void 0){U[q]=E(X),U[q+"Found"]=!0;break}lt=(v._autoBin||{})[b]||{},lt[q]&&e(v,X).set(lt[q])}if(q==="start"||q==="end")for(;_<T.length;_++)v=T[_],v["_"+b+"bingroup"]&&(lt=(v._autoBin||{})[b]||{},E(X,lt[q]));q==="nbins"&&!U.sizeFound&&!U.nbinsFound&&(v=T[0],U[q]=E(X))}}}}}),GF=Ft((Q,$)=>{var c=Y_().hoverPoints,g=Es().hoverLabelText;$.exports=function(P,S,t,e,r){var a=c(P,S,t,e,r);if(a){P=a[0];var n=P.cd[P.index],o=P.cd[0].trace;if(!o.cumulative.enabled){var i=o.orientation==="h"?"y":"x";P[i+"Label"]=g(P[i+"a"],[n.ph0,n.ph1],o[i+"hoverformat"])}return a}}}),$M=Ft((Q,$)=>{$.exports=function(c,g,P,S,t){if(c.x="xVal"in g?g.xVal:g.x,c.y="yVal"in g?g.yVal:g.y,"zLabelVal"in g&&(c.z=g.zLabelVal),g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),!(P.cumulative||{}).enabled){var e=Array.isArray(t)?S[0].pts[t[0]][t[1]]:S[t].pts;c.pointNumbers=e,c.binNumber=c.pointNumber,delete c.pointNumber,delete c.pointIndex;var r;if(P._indexToPoints){r=[];for(var a=0;a<e.length;a++)r=r.concat(P._indexToPoints[e[a]])}else r=e;c.pointIndices=r}return c}}),YF=Ft((Q,$)=>{$.exports={attributes:Z6(),layoutAttributes:C6(),supplyDefaults:$F(),crossTraceDefaults:$6(),supplyLayoutDefaults:OM(),calc:HM().calc,crossTraceCalc:Pr().crossTraceCalc,plot:Qy().plot,layerName:"barlayer",style:xm().style,styleOnSelect:xm().styleOnSelect,colorbar:xo(),hoverPoints:GF(),selectPoints:K_(),eventData:$M(),moduleType:"trace",name:"histogram",basePlotModule:Mf(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}),KF=Ft((Q,$)=>{$.exports=YF()}),G6=Ft((Q,$)=>{var c=Z6(),g=ZM(),P=X_(),S=$o(),t=fh().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:r,templatefallbackAttrs:a}=$u(),n=Tc(),o=Ta().extendFlat;$.exports=o({x:c.x,y:c.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:c.histnorm,histfunc:c.histfunc,nbinsx:c.nbinsx,xbins:g("x"),nbinsy:c.nbinsy,ybins:g("y"),autobinx:c.autobinx,autobiny:c.autobiny,bingroup:o({},c.bingroup,{}),xbingroup:o({},c.bingroup,{}),ybingroup:o({},c.bingroup,{}),xgap:P.xgap,ygap:P.ygap,zsmooth:P.zsmooth,xhoverformat:t("x"),yhoverformat:t("y"),zhoverformat:t("z",1),hovertemplate:e({},{keys:["z"]}),hovertemplatefallback:a(),texttemplate:r({arrayOk:!1,editType:"plot"},{keys:["z"]}),texttemplatefallback:a({editType:"plot"}),textfont:P.textfont,showlegend:o({},S.showlegend,{dflt:!1})},n("",{cLetter:"z",autoColorDflt:!1}))}),GM=Ft((Q,$)=>{var c=Xo(),g=bn();$.exports=function(P,S,t,e){var r=t("x"),a=t("y"),n=g.minRowLength(r),o=g.minRowLength(a);if(!n||!o){S.visible=!1;return}S._length=Math.min(n,o);var i=c.getComponentMethod("calendars","handleTraceDefaults");i(P,S,["x","y"],e);var s=t("z")||t("marker.color");s&&t("histfunc"),t("histnorm"),t("autobinx"),t("autobiny")}}),XF=Ft((Q,$)=>{var c=bn(),g=GM(),P=BM(),S=mc(),t=Uw(),e=G6();$.exports=function(r,a,n,o){function i(s,f){return c.coerce(r,a,e,s,f)}g(r,a,i,o),a.visible!==!1&&(P(r,a,i,o),S(r,a,o,i,{prefix:"",cLetter:"z"}),i("hovertemplate"),i("hovertemplatefallback"),t(i,o),i("xhoverformat"),i("yhoverformat"))}}),JF=Ft((Q,$)=>{var c=q6(),g=Es().hoverLabelText;$.exports=function(P,S,t,e,r){var a=c(P,S,t,e,r);if(a){P=a[0];var n=P.index,o=n[0],i=n[1],s=P.cd[0],f=s.trace,x=s.xRanges[i],y=s.yRanges[o];return P.xLabel=g(P.xa,[x[0],x[1]],f.xhoverformat),P.yLabel=g(P.ya,[y[0],y[1]],f.yhoverformat),a}}}),QF=Ft((Q,$)=>{$.exports={attributes:G6(),supplyDefaults:XF(),crossTraceDefaults:$6(),calc:U6(),plot:H6(),layerName:"heatmaplayer",colorbar:L1(),style:W6(),hoverPoints:JF(),eventData:$M(),moduleType:"trace",name:"histogram2d",basePlotModule:Mf(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}),tR=Ft((Q,$)=>{$.exports=QF()}),Y6=Ft((Q,$)=>{$.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}),Vw=Ft((Q,$)=>{var c=X_(),g=tf(),P=fh(),S=P.axisHoverFormat,t=P.descriptionOnlyNumbers,e=Tc(),r=Td().dash,a=Ea(),n=Ta().extendFlat,o=Y6(),i=o.COMPARISON_OPS2,s=o.INTERVAL_OPS,f=g.line;$.exports=n({z:c.z,x:c.x,x0:c.x0,dx:c.dx,y:c.y,y0:c.y0,dy:c.dy,xperiod:c.xperiod,yperiod:c.yperiod,xperiod0:g.xperiod0,yperiod0:g.yperiod0,xperiodalignment:c.xperiodalignment,yperiodalignment:c.yperiodalignment,text:c.text,hovertext:c.hovertext,transpose:c.transpose,xtype:c.xtype,ytype:c.ytype,xhoverformat:S("x"),yhoverformat:S("y"),zhoverformat:S("z",1),hovertemplate:c.hovertemplate,hovertemplatefallback:c.hovertemplatefallback,texttemplate:n({},c.texttemplate,{}),texttemplatefallback:c.texttemplatefallback,textfont:n({},c.textfont,{}),hoverongaps:c.hoverongaps,connectgaps:n({},c.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:a({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:t("contour label")},operation:{valType:"enumerated",values:[].concat(i).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:g.zorder},e("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}),YM=Ft((Q,$)=>{var c=G6(),g=Vw(),P=Tc(),S=fh().axisHoverFormat,t=Ta().extendFlat;$.exports=t({x:c.x,y:c.y,z:c.z,marker:c.marker,histnorm:c.histnorm,histfunc:c.histfunc,nbinsx:c.nbinsx,xbins:c.xbins,nbinsy:c.nbinsy,ybins:c.ybins,autobinx:c.autobinx,autobiny:c.autobiny,bingroup:c.bingroup,xbingroup:c.xbingroup,ybingroup:c.ybingroup,autocontour:g.autocontour,ncontours:g.ncontours,contours:g.contours,line:{color:g.line.color,width:t({},g.line.width,{dflt:.5}),dash:g.line.dash,smoothing:g.line.smoothing,editType:"plot"},xhoverformat:S("x"),yhoverformat:S("y"),zhoverformat:S("z",1),hovertemplate:c.hovertemplate,hovertemplatefallback:c.hovertemplatefallback,texttemplate:g.texttemplate,texttemplatefallback:g.texttemplatefallback,textfont:g.textfont},P("",{cLetter:"z",editTypeOverride:"calc"}))}),K6=Ft((Q,$)=>{$.exports=function(c,g,P,S){var t=S("contours.start"),e=S("contours.end"),r=t===!1||e===!1,a=P("contours.size"),n;r?n=g.autocontour=!0:n=P("autocontour",!1),(n||!a)&&P("ncontours")}}),KM=Ft((Q,$)=>{var c=bn();$.exports=function(g,P,S,t){t||(t={});var e=g("contours.showlabels");if(e){var r=P.font;c.coerceFont(g,"contours.labelfont",r,{overrideDflt:{color:S}}),g("contours.labelformat")}t.hasHover!==!1&&g("zhoverformat")}}),X6=Ft((Q,$)=>{var c=mc(),g=KM();$.exports=function(P,S,t,e,r){var a=t("contours.coloring"),n,o="";a==="fill"&&(n=t("contours.showlines")),n!==!1&&(a!=="lines"&&(o=t("line.color","#000")),t("line.width",.5),t("line.dash")),a!=="none"&&(P.showlegend!==!0&&(S.showlegend=!1),S._dfltShowLegend=!1,c(P,S,e,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),g(t,e,o,r)}}),eR=Ft((Q,$)=>{var c=bn(),g=GM(),P=K6(),S=X6(),t=Uw(),e=YM();$.exports=function(r,a,n,o){function i(f,x){return c.coerce(r,a,e,f,x)}function s(f){return c.coerce2(r,a,e,f)}g(r,a,i,o),a.visible!==!1&&(P(r,a,i,s),S(r,a,i,o),i("xhoverformat"),i("yhoverformat"),i("hovertemplate"),i("hovertemplatefallback"),a.contours&&a.contours.coloring==="heatmap"&&t(i,o))}}),XM=Ft((Q,$)=>{var c=Es(),g=bn();$.exports=function(S,t){var e=S.contours;if(S.autocontour){var r=S.zmin,a=S.zmax;(S.zauto||r===void 0)&&(r=g.aggNums(Math.min,null,t)),(S.zauto||a===void 0)&&(a=g.aggNums(Math.max,null,t));var n=P(r,a,S.ncontours);e.size=n.dtick,e.start=c.tickFirst(n),n.range.reverse(),e.end=c.tickFirst(n),e.start===r&&(e.start+=e.size),e.end===a&&(e.end-=e.size),e.start>e.end&&(e.start=e.end=(e.start+e.end)/2),S._input.contours||(S._input.contours={}),g.extendFlat(S._input.contours,{start:e.start,end:e.end,size:e.size}),S._input.autocontour=!0}else if(e.type!=="constraint"){var o=e.start,i=e.end,s=S._input.contours;if(o>i&&(e.start=s.start=i,i=e.end=s.end=o,o=e.start),!(e.size>0)){var f;o===i?f=1:f=P(o,i,S.ncontours).dtick,s.size=e.size=f}}};function P(S,t,e){var r={type:"linear",range:[S,t]};return c.autoTicks(r,(t-S)/(e||15)),r}}),Hw=Ft((Q,$)=>{$.exports=function(c){return c.end+c.size/1e6}}),JM=Ft((Q,$)=>{var c=Xc(),g=U6(),P=XM(),S=Hw();$.exports=function(t,e){var r=g(t,e),a=r[0].z;P(e,a);var n=e.contours,o=c.extractOpts(e),i;if(n.coloring==="heatmap"&&o.auto&&e.autocontour===!1){var s=n.start,f=S(n),x=n.size||1,y=Math.floor((f-s)/x)+1;isFinite(x)||(x=1,y=1);var v=s-x/2,T=v+y*x;i=[v,T]}else i=a;return c.calc(t,e,{vals:i,cLetter:"z"}),r}}),Ww=Ft((Q,$)=>{$.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}}}),QM=Ft((Q,$)=>{var c=Ww();$.exports=function(P){var S=P[0].z,t=S.length,e=S[0].length,r=t===2||e===2,a,n,o,i,s,f,x,y,v;for(n=0;n<t-1;n++)for(i=[],n===0&&(i=i.concat(c.BOTTOMSTART)),n===t-2&&(i=i.concat(c.TOPSTART)),a=0;a<e-1;a++)for(o=i.slice(),a===0&&(o=o.concat(c.LEFTSTART)),a===e-2&&(o=o.concat(c.RIGHTSTART)),s=a+","+n,f=[[S[n][a],S[n][a+1]],[S[n+1][a],S[n+1][a+1]]],v=0;v<P.length;v++)y=P[v],x=g(y.level,f),x&&(y.crossings[s]=x,o.indexOf(x)!==-1&&(y.starts.push([a,n]),r&&o.indexOf(x,o.indexOf(x)+1)!==-1&&y.starts.push([a,n])))};function g(P,S){var t=(S[0][0]>P?0:1)+(S[0][1]>P?0:2)+(S[1][1]>P?0:4)+(S[1][0]>P?0:8);if(t===5||t===10){var e=(S[0][0]+S[0][1]+S[1][0]+S[1][1])/4;return P>e?t===5?713:1114:t===5?104:208}return t===15?0:t}}),t7=Ft((Q,$)=>{var c=bn(),g=Ww();$.exports=function(a,n,o){var i,s,f,x,y;for(n=n||.01,o=o||.01,f=0;f<a.length;f++){for(x=a[f],y=0;y<x.starts.length;y++)s=x.starts[y],t(x,s,"edge",n,o);for(i=0;Object.keys(x.crossings).length&&i<1e4;)i++,s=Object.keys(x.crossings)[0].split(",").map(Number),t(x,s,void 0,n,o);i===1e4&&c.log("Infinite loop in contour?")}};function P(a,n,o,i){return Math.abs(a[0]-n[0])<o&&Math.abs(a[1]-n[1])<i}function S(a,n){var o=a[2]-n[2],i=a[3]-n[3];return Math.sqrt(o*o+i*i)}function t(a,n,o,i,s){var f=n.join(","),x=a.crossings[f],y=e(x,o,n),v=[r(a,n,[-y[0],-y[1]])],T=a.z.length,u=a.z[0].length,b=n.slice(),_=y.slice(),C;for(C=0;C<1e4;C++){if(x>20?(x=g.CHOOSESADDLE[x][(y[0]||y[1])<0?0:1],a.crossings[f]=g.SADDLEREMAINDER[x]):delete a.crossings[f],y=g.NEWDELTA[x],!y){c.log("Found bad marching index:",x,n,a.level);break}v.push(r(a,n,y)),n[0]+=y[0],n[1]+=y[1],f=n.join(","),P(v[v.length-1],v[v.length-2],i,s)&&v.pop();var M=y[0]&&(n[0]<0||n[0]>u-2)||y[1]&&(n[1]<0||n[1]>T-2),E=n[0]===b[0]&&n[1]===b[1]&&y[0]===_[0]&&y[1]===_[1];if(E||o&&M)break;x=a.crossings[f]}C===1e4&&c.log("Infinite loop in contour?");var A=P(v[0],v[v.length-1],i,s),h=0,p=.2*a.smoothing,k=[],w=0,R,O,N,V,H,F,U,W,q,X,lt;for(C=1;C<v.length;C++)U=S(v[C],v[C-1]),h+=U,k.push(U);var yt=h/k.length*p;function pt(dt){return v[dt%v.length]}for(C=v.length-2;C>=w;C--)if(R=k[C],R<yt){for(N=0,O=C-1;O>=w&&R+k[O]<yt;O--)R+=k[O];if(A&&C===v.length-2)for(N=0;N<O&&R+k[N]<yt;N++)R+=k[N];H=C-O+N+1,F=Math.floor((C+O+N+2)/2),!A&&C===v.length-2?V=v[v.length-1]:!A&&O===-1?V=v[0]:H%2?V=pt(F):V=[(pt(F)[0]+pt(F+1)[0])/2,(pt(F)[1]+pt(F+1)[1])/2],v.splice(O+1,C-O+1,V),C=O+1,N&&(w=N),A&&(C===v.length-2?v[N]=v[v.length-1]:C===0&&(v[v.length-1]=v[0]))}for(v.splice(0,w),C=0;C<v.length;C++)v[C].length=2;if(!(v.length<2))if(A)v.pop(),a.paths.push(v);else{o||c.log("Unclosed interior contour?",a.level,b.join(","),v.join("L"));var st=!1;for(W=0;W<a.edgepaths.length;W++)if(X=a.edgepaths[W],!st&&P(X[0],v[v.length-1],i,s)){v.pop(),st=!0;var tt=!1;for(q=0;q<a.edgepaths.length;q++)if(lt=a.edgepaths[q],P(lt[lt.length-1],v[0],i,s)){tt=!0,v.shift(),a.edgepaths.splice(W,1),q===W?a.paths.push(v.concat(lt)):(q>W&&q--,a.edgepaths[q]=lt.concat(v,X));break}tt||(a.edgepaths[W]=v.concat(X))}for(W=0;W<a.edgepaths.length&&!st;W++)X=a.edgepaths[W],P(X[X.length-1],v[0],i,s)&&(v.shift(),a.edgepaths[W]=X.concat(v),st=!0);st||a.edgepaths.push(v)}}function e(a,n,o){var i=0,s=0;return a>20&&n?a===208||a===1114?i=o[0]===0?1:-1:s=o[1]===0?1:-1:g.BOTTOMSTART.indexOf(a)!==-1?s=1:g.LEFTSTART.indexOf(a)!==-1?i=1:g.TOPSTART.indexOf(a)!==-1?s=-1:i=-1,[i,s]}function r(a,n,o){var i=n[0]+Math.max(o[0],0),s=n[1]+Math.max(o[1],0),f=a.z[s][i],x=a.xaxis,y=a.yaxis;if(o[1]){var v=(a.level-f)/(a.z[s][i+1]-f),T=(v!==1?(1-v)*x.c2l(a.x[i]):0)+(v!==0?v*x.c2l(a.x[i+1]):0);return[x.c2p(x.l2c(T),!0),y.c2p(a.y[s],!0),i+v,s]}else{var u=(a.level-f)/(a.z[s+1][i]-f),b=(u!==1?(1-u)*y.c2l(a.y[s]):0)+(u!==0?u*y.c2l(a.y[s+1]):0);return[x.c2p(a.x[i],!0),y.c2p(y.l2c(b),!0),i,s+u]}}}),rR=Ft((Q,$)=>{var c=Y6(),g=ra();$.exports={"[]":S("[]"),"][":S("]["),">":t(">"),"<":t("<"),"=":t("=")};function P(e,r){var a=Array.isArray(r),n;function o(i){return g(i)?+i:null}return c.COMPARISON_OPS2.indexOf(e)!==-1?n=o(a?r[0]:r):c.INTERVAL_OPS.indexOf(e)!==-1?n=a?[o(r[0]),o(r[1])]:[o(r),o(r)]:c.SET_OPS.indexOf(e)!==-1&&(n=a?r.map(o):[o(r)]),n}function S(e){return function(r){r=P(e,r);var a=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]);return{start:a,end:n,size:n-a}}}function t(e){return function(r){return r=P(e,r),{start:r,end:1/0,size:1/0}}}}),e7=Ft((Q,$)=>{var c=bn(),g=rR(),P=Hw();$.exports=function(S,t,e){for(var r=S.type==="constraint"?g[S._operation](S.value):S,a=r.size,n=[],o=P(r),i=e.trace._carpetTrace,s=i?{xaxis:i.aaxis,yaxis:i.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+=a)if(n.push(c.extendFlat({level:f,crossings:{},starts:[],edgepaths:[],paths:[],z:e.z,smoothing:e.trace.line.smoothing},s)),n.length>1e3){c.warn("Too many contours, clipping at 1000",S);break}return n}}),r7=Ft((Q,$)=>{var c=bn();$.exports=function(P,S){var t,e,r,a=function(i){return i.reverse()},n=function(i){return i};switch(S){case"=":case"<":return P;case">":for(P.length!==1&&c.warn("Contour data invalid for the specified inequality operation."),e=P[0],t=0;t<e.edgepaths.length;t++)e.edgepaths[t]=a(e.edgepaths[t]);for(t=0;t<e.paths.length;t++)e.paths[t]=a(e.paths[t]);for(t=0;t<e.starts.length;t++)e.starts[t]=a(e.starts[t]);return P;case"][":var o=a;a=n,n=o;case"[]":for(P.length!==2&&c.warn("Contour data invalid for the specified inequality range operation."),e=g(P[0]),r=g(P[1]),t=0;t<e.edgepaths.length;t++)e.edgepaths[t]=a(e.edgepaths[t]);for(t=0;t<e.paths.length;t++)e.paths[t]=a(e.paths[t]);for(t=0;t<e.starts.length;t++)e.starts[t]=a(e.starts[t]);for(;r.edgepaths.length;)e.edgepaths.push(n(r.edgepaths.shift()));for(;r.paths.length;)e.paths.push(n(r.paths.shift()));for(;r.starts.length;)e.starts.push(n(r.starts.shift()));return[e]}};function g(P){return c.extendFlat({},P,{edgepaths:c.extendDeep([],P.edgepaths),paths:c.extendDeep([],P.paths),starts:c.extendDeep([],P.starts)})}}),n7=Ft((Q,$)=>{$.exports=function(c,g){var P=c[0],S=P.z,t;switch(g.type){case"levels":var e=Math.min(S[0][0],S[0][1]);for(t=0;t<c.length;t++){var r=c[t];r.prefixBoundary=!r.edgepaths.length&&(e>r.level||r.starts.length&&e===r.level)}break;case"constraint":if(P.prefixBoundary=!1,P.edgepaths.length)return;var a=P.x.length,n=P.y.length,o=-1/0,i=1/0;for(t=0;t<n;t++)i=Math.min(i,S[t][0]),i=Math.min(i,S[t][a-1]),o=Math.max(o,S[t][0]),o=Math.max(o,S[t][a-1]);for(t=1;t<a-1;t++)i=Math.min(i,S[0][t]),i=Math.min(i,S[n-1][t]),o=Math.max(o,S[0][t]),o=Math.max(o,S[n-1][t]);var s=g.value,f,x;switch(g._operation){case">":s>o&&(P.prefixBoundary=!0);break;case"<":(s<i||P.starts.length&&s===i)&&(P.prefixBoundary=!0);break;case"[]":f=Math.min(s[0],s[1]),x=Math.max(s[0],s[1]),(x<i||f>o||P.starts.length&&x===i)&&(P.prefixBoundary=!0);break;case"][":f=Math.min(s[0],s[1]),x=Math.max(s[0],s[1]),f<i&&x>o&&(P.prefixBoundary=!0);break}break}}}),J6=Ft(Q=>{var $=un(),c=bn(),g=js(),P=Xc(),S=tc(),t=Es(),e=i0(),r=H6(),a=QM(),n=t7(),o=e7(),i=r7(),s=n7(),f=Ww(),x=f.LABELOPTIMIZER;Q.plot=function(M,E,A,h){var p=E.xaxis,k=E.yaxis;c.makeTraceGroups(h,A,"contour").each(function(w){var R=$.select(this),O=w[0],N=O.trace,V=O.x,H=O.y,F=N.contours,U=o(F,E,O),W=c.ensureSingle(R,"g","heatmapcoloring"),q=[];F.coloring==="heatmap"&&(q=[w]),r(M,E,q,W),a(U),n(U);var X=p.c2p(V[0],!0),lt=p.c2p(V[V.length-1],!0),yt=k.c2p(H[0],!0),pt=k.c2p(H[H.length-1],!0),st=[[X,pt],[lt,pt],[lt,yt],[X,yt]],tt=U;F.type==="constraint"&&(tt=i(U,F._operation)),y(R,st,F),v(R,tt,st,F),u(R,U,M,O,F),_(R,E,M,O,st)})};function y(M,E,A){var h=c.ensureSingle(M,"g","contourbg"),p=h.selectAll("path").data(A.coloring==="fill"?[0]:[]);p.enter().append("path"),p.exit().remove(),p.attr("d","M"+E.join("L")+"Z").style("stroke","none")}function v(M,E,A,h){var p=h.coloring==="fill"||h.type==="constraint"&&h._operation!=="=",k="M"+A.join("L")+"Z";p&&s(E,h);var w=c.ensureSingle(M,"g","contourfill"),R=w.selectAll("path").data(p?E:[]);R.enter().append("path"),R.exit().remove(),R.each(function(O){var N=(O.prefixBoundary?k:"")+T(O,A);N?$.select(this).attr("d",N).style("stroke","none"):$.select(this).remove()})}function T(M,E){var A="",h=0,p=M.edgepaths.map(function(lt,yt){return yt}),k=!0,w,R,O,N,V,H;function F(lt){return Math.abs(lt[1]-E[0][1])<.01}function U(lt){return Math.abs(lt[1]-E[2][1])<.01}function W(lt){return Math.abs(lt[0]-E[0][0])<.01}function q(lt){return Math.abs(lt[0]-E[2][0])<.01}for(;p.length;){for(H=g.smoothopen(M.edgepaths[h],M.smoothing),A+=k?H:H.replace(/^M/,"L"),p.splice(p.indexOf(h),1),w=M.edgepaths[h][M.edgepaths[h].length-1],N=-1,O=0;O<4;O++){if(!w){c.log("Missing end?",h,M);break}for(F(w)&&!q(w)?R=E[1]:W(w)?R=E[0]:U(w)?R=E[3]:q(w)&&(R=E[2]),V=0;V<M.edgepaths.length;V++){var X=M.edgepaths[V][0];Math.abs(w[0]-R[0])<.01?Math.abs(w[0]-X[0])<.01&&(X[1]-w[1])*(R[1]-X[1])>=0&&(R=X,N=V):Math.abs(w[1]-R[1])<.01?Math.abs(w[1]-X[1])<.01&&(X[0]-w[0])*(R[0]-X[0])>=0&&(R=X,N=V):c.log("endpt to newendpt is not vert. or horz.",w,R,X)}if(w=R,N>=0)break;A+="L"+R}if(N===M.edgepaths.length){c.log("unclosed perimeter path");break}h=N,k=p.indexOf(h)===-1,k&&(h=p[0],A+="Z")}for(h=0;h<M.paths.length;h++)A+=g.smoothclosed(M.paths[h],M.smoothing);return A}function u(M,E,A,h,p){var k=A._context.staticPlot,w=c.ensureSingle(M,"g","contourlines"),R=p.showlines!==!1,O=p.showlabels,N=R&&O,V=Q.createLines(w,R||O,E,k),H=Q.createLineClip(w,N,A,h.trace.uid),F=M.selectAll("g.contourlabels").data(O?[0]:[]);if(F.exit().remove(),F.enter().append("g").classed("contourlabels",!0),O){var U=[],W=[];c.clearLocationCache();var q=Q.labelFormatter(A,h),X=g.tester.append("text").attr("data-notex",1).call(g.font,p.labelfont),lt=E[0].xaxis,yt=E[0].yaxis,pt=lt._length,st=yt._length,tt=lt.range,dt=yt.range,rt=c.aggNums(Math.min,null,h.x),at=c.aggNums(Math.max,null,h.x),vt=c.aggNums(Math.min,null,h.y),it=c.aggNums(Math.max,null,h.y),Y=Math.max(lt.c2p(rt,!0),0),ft=Math.min(lt.c2p(at,!0),pt),ut=Math.max(yt.c2p(it,!0),0),wt=Math.min(yt.c2p(vt,!0),st),zt={};tt[0]<tt[1]?(zt.left=Y,zt.right=ft):(zt.left=ft,zt.right=Y),dt[0]<dt[1]?(zt.top=ut,zt.bottom=wt):(zt.top=wt,zt.bottom=ut),zt.middle=(zt.top+zt.bottom)/2,zt.center=(zt.left+zt.right)/2,U.push([[zt.left,zt.top],[zt.right,zt.top],[zt.right,zt.bottom],[zt.left,zt.bottom]]);var Pt=Math.sqrt(pt*pt+st*st),Wt=f.LABELDISTANCE*Pt/Math.max(1,E.length/f.LABELINCREASE);V.each(function(Ht){var Jt=Q.calcTextOpts(Ht.level,q,X,A);$.select(this).selectAll("path").each(function(){var ge=this,he=c.getVisibleSegment(ge,zt,Jt.height/2);if(he&&!(he.len<(Jt.width+Jt.height)*f.LABELMIN))for(var de=Math.min(Math.ceil(he.len/Wt),f.LABELMAX),se=0;se<de;se++){var Tt=Q.findBestTextLocation(ge,he,Jt,W,zt);if(!Tt)break;Q.addLabelData(Tt,Jt,W,U)}})}),X.remove(),Q.drawLabels(F,W,A,H,N?U:null)}O&&!R&&V.remove()}Q.createLines=function(M,E,A,h){var p=A[0].smoothing,k=M.selectAll("g.contourlevel").data(E?A:[]);if(k.exit().remove(),k.enter().append("g").classed("contourlevel",!0),E){var w=k.selectAll("path.openline").data(function(O){return O.pedgepaths||O.edgepaths});w.exit().remove(),w.enter().append("path").classed("openline",!0),w.attr("d",function(O){return g.smoothopen(O,p)}).style("stroke-miterlimit",1).style("vector-effect",h?"none":"non-scaling-stroke");var R=k.selectAll("path.closedline").data(function(O){return O.ppaths||O.paths});R.exit().remove(),R.enter().append("path").classed("closedline",!0),R.attr("d",function(O){return g.smoothclosed(O,p)}).style("stroke-miterlimit",1).style("vector-effect",h?"none":"non-scaling-stroke")}return k},Q.createLineClip=function(M,E,A,h){var p=A._fullLayout._clips,k=E?"clipline"+h:null,w=p.selectAll("#"+k).data(E?[0]:[]);return w.exit().remove(),w.enter().append("clipPath").classed("contourlineclip",!0).attr("id",k),g.setClipUrl(M,k,A),w},Q.labelFormatter=function(M,E){var A=M._fullLayout,h=E.trace,p=h.contours,k={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(p.labelformat)k.tickformat=p.labelformat,e(k,A);else{var w=P.extractOpts(h);if(w&&w.colorbar&&w.colorbar._axis)k=w.colorbar._axis;else{if(p.type==="constraint"){var R=p.value;c.isArrayOrTypedArray(R)?k.range=[R[0],R[R.length-1]]:k.range=[R,R]}else k.range=[p.start,p.end],k.nticks=(p.end-p.start)/p.size;k.range[0]===k.range[1]&&(k.range[1]+=k.range[0]||1),k.nticks||(k.nticks=1e3),e(k,A),t.prepTicks(k),k._tmin=null,k._tmax=null}}return function(O){return t.tickText(k,O).text}},Q.calcTextOpts=function(M,E,A,h){var p=E(M);A.text(p).call(S.convertToTspans,h);var k=A.node(),w=g.bBox(k,!0);return{text:p,width:w.width,height:w.height,fontSize:+k.style["font-size"].replace("px",""),level:M,dy:(w.top+w.bottom)/2}},Q.findBestTextLocation=function(M,E,A,h,p){var k=A.width,w,R,O,N,V;E.isClosed?(R=E.len/x.INITIALSEARCHPOINTS,w=E.min+R/2,O=E.max):(R=(E.len-k)/(x.INITIALSEARCHPOINTS+1),w=E.min+R+k/2,O=E.max-(R+k)/2);for(var H=1/0,F=0;F<x.ITERATIONS;F++){for(var U=w;U<O;U+=R){var W=c.getTextLocation(M,E.total,U,k),q=b(W,A,h,p);q<H&&(H=q,V=W,N=U)}if(H>x.MAXCOST*2)break;F&&(R/=2),w=N-R/2,O=w+R*1.5}if(H<=x.MAXCOST)return V};function b(M,E,A,h){var p=E.width/2,k=E.height/2,w=M.x,R=M.y,O=M.theta,N=Math.cos(O)*p,V=Math.sin(O)*p,H=(w>h.center?h.right-w:w-h.left)/(N+Math.abs(Math.sin(O)*k)),F=(R>h.middle?h.bottom-R:R-h.top)/(Math.abs(V)+Math.cos(O)*k);if(H<1||F<1)return 1/0;var U=x.EDGECOST*(1/(H-1)+1/(F-1));U+=x.ANGLECOST*O*O;for(var W=w-N,q=R-V,X=w+N,lt=R+V,yt=0;yt<A.length;yt++){var pt=A[yt],st=Math.cos(pt.theta)*pt.width/2,tt=Math.sin(pt.theta)*pt.width/2,dt=c.segmentDistance(W,q,X,lt,pt.x-st,pt.y-tt,pt.x+st,pt.y+tt)*2/(E.height+pt.height),rt=pt.level===E.level,at=rt?x.SAMELEVELDISTANCE:1;if(dt<=at)return 1/0;var vt=x.NEIGHBORCOST*(rt?x.SAMELEVELFACTOR:1);U+=vt/(dt-at)}return U}Q.addLabelData=function(M,E,A,h){var p=E.fontSize,k=E.width+p/3,w=Math.max(0,E.height-p/3),R=M.x,O=M.y,N=M.theta,V=Math.sin(N),H=Math.cos(N),F=function(W,q){return[R+W*H-q*V,O+W*V+q*H]},U=[F(-k/2,-w/2),F(-k/2,w/2),F(k/2,w/2),F(k/2,-w/2)];A.push({text:E.text,x:R,y:O,dy:E.dy,theta:N,level:E.level,width:k,height:w}),h.push(U)},Q.drawLabels=function(M,E,A,h,p){var k=M.selectAll("text").data(E,function(N){return N.text+","+N.x+","+N.y+","+N.theta});if(k.exit().remove(),k.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(N){var V=N.x+Math.sin(N.theta)*N.dy,H=N.y-Math.cos(N.theta)*N.dy;$.select(this).text(N.text).attr({x:V,y:H,transform:"rotate("+180*N.theta/Math.PI+" "+V+" "+H+")"}).call(S.convertToTspans,A)}),p){for(var w="",R=0;R<p.length;R++)w+="M"+p[R].join("L")+"Z";var O=c.ensureSingle(h,"path","");O.attr("d",w)}};function _(M,E,A,h,p){var k=h.trace,w=A._fullLayout._clips,R="clip"+k.uid,O=w.selectAll("#"+R).data(k.connectgaps?[]:[0]);if(O.enter().append("clipPath").classed("contourclip",!0).attr("id",R),O.exit().remove(),k.connectgaps===!1){var N={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:E.xaxis,yaxis:E.yaxis,x:h.x,y:h.y,z:C(h),smoothing:0};a([N]),n([N]),s([N],{type:"levels"});var V=c.ensureSingle(O,"path","");V.attr("d",(N.prefixBoundary?"M"+p.join("L")+"Z":"")+T(N,p))}else R=null;g.setClipUrl(M,R,A)}function C(M){var E=M.trace._emptypoints,A=[],h=M.z.length,p=M.z[0].length,k,w=[],R;for(k=0;k<p;k++)w.push(1);for(k=0;k<h;k++)A.push(w.slice());for(k=0;k<E.length;k++)R=E[k],A[R[0]][R[1]]=0;return M.zmask=A,A}}),i7=Ft((Q,$)=>{var c=un(),g=Xc(),P=Hw();$.exports=function(S){var t=S.contours,e=t.start,r=P(t),a=t.size||1,n=Math.floor((r-e)/a)+1,o=t.coloring==="lines"?0:1,i=g.extractOpts(S);isFinite(a)||(a=1,n=1);var s=i.reversescale?g.flipScale(i.colorscale):i.colorscale,f=s.length,x=new Array(f),y=new Array(f),v,T,u=i.min,b=i.max;if(t.coloring==="heatmap"){for(T=0;T<f;T++)v=s[T],x[T]=v[0]*(b-u)+u,y[T]=v[1];var _=c.extent([u,b,t.start,t.start+a*(n-1)]),C=_[u<b?0:1],M=_[u<b?1:0];C!==u&&(x.splice(0,0,C),y.splice(0,0,y[0])),M!==b&&(x.push(M),y.push(y[y.length-1]))}else{var E=S._input&&typeof S._input.zmin=="number"&&typeof S._input.zmax=="number";for(E&&(e<=u||r>=b)&&(e<=u&&(e=u),r>=b&&(r=b),n=Math.floor((r-e)/a)+1,o=0),T=0;T<f;T++)v=s[T],x[T]=(v[0]*(n+o-1)-o/2)*a+e,y[T]=v[1];(E||S.autocontour)&&(x[0]>u&&(x.unshift(u),y.unshift(y[0])),x[x.length-1]<b&&(x.push(b),y.push(y[y.length-1])))}return g.makeColorScaleFunc({domain:x,range:y},{noNumericCheck:!0})}}),Q6=Ft((Q,$)=>{var c=un(),g=js(),P=W6(),S=i7();$.exports=function(t){var e=c.select(t).selectAll("g.contour");e.style("opacity",function(r){return r[0].trace.opacity}),e.each(function(r){var a=c.select(this),n=r[0].trace,o=n.contours,i=n.line,s=o.size||1,f=o.start,x=o.type==="constraint",y=!x&&o.coloring==="lines",v=!x&&o.coloring==="fill",T=y||v?S(n):null;a.selectAll("g.contourlevel").each(function(_){c.select(this).selectAll("path").call(g.lineGroupStyle,i.width,y?T(_.level):i.color,i.dash)});var u=o.labelfont;if(a.selectAll("g.contourlabels text").each(function(_){g.font(c.select(this),{weight:u.weight,style:u.style,variant:u.variant,textcase:u.textcase,lineposition:u.lineposition,shadow:u.shadow,family:u.family,size:u.size,color:u.color||(y?T(_.level):i.color)})}),x)a.selectAll("g.contourfill path").style("fill",n.fillcolor);else if(v){var b;a.selectAll("g.contourfill path").style("fill",function(_){return b===void 0&&(b=_.level),T(_.level+.5*s)}),b===void 0&&(b=f),a.selectAll("g.contourbg path").style("fill",T(b-.5*s))}}),P(t)}}),tk=Ft((Q,$)=>{var c=Xc(),g=i7(),P=Hw();function S(t,e,r){var a=e.contours,n=e.line,o=a.size||1,i=a.coloring,s=g(e,{isColorbar:!0});if(i==="heatmap"){var f=c.extractOpts(e);r._fillgradient=f.reversescale?c.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else i==="fill"&&(r._fillcolor=s);r._line={color:i==="lines"?s:n.color,width:a.showlines!==!1?n.width:0,dash:n.dash},r._levels={start:a.start,end:P(a),size:o}}$.exports={min:"zmin",max:"zmax",calc:S}}),a7=Ft((Q,$)=>{var c=li(),g=q6();$.exports=function(P,S,t,e,r){r||(r={}),r.isContour=!0;var a=g(P,S,t,e,r);return a&&a.forEach(function(n){var o=n.trace;o.contours.type==="constraint"&&(o.fillcolor&&c.opacity(o.fillcolor)?n.color=c.addOpacity(o.fillcolor,1):o.contours.showlines&&c.opacity(o.line.color)&&(n.color=c.addOpacity(o.line.color,1)))}),a}}),nR=Ft((Q,$)=>{$.exports={attributes:YM(),supplyDefaults:eR(),crossTraceDefaults:$6(),calc:JM(),plot:J6().plot,layerName:"contourlayer",style:Q6(),colorbar:tk(),hoverPoints:a7(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Mf(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}),iR=Ft((Q,$)=>{$.exports=nR()}),o7=Ft((Q,$)=>{var c=ra(),g=KM(),P=li(),S=P.addOpacity,t=P.opacity,e=Y6(),r=bn().isArrayOrTypedArray,a=e.CONSTRAINT_REDUCTION,n=e.COMPARISON_OPS2;$.exports=function(i,s,f,x,y,v){var T=s.contours,u,b,_,C=f("contours.operation");if(T._operation=a[C],o(f,T),C==="="?u=T.showlines=!0:(u=f("contours.showlines"),_=f("fillcolor",S((i.line||{}).color||y,.5))),u){var M=_&&t(_)?S(s.fillcolor,1):y;b=f("line.color",M),f("line.width",2),f("line.dash")}f("line.smoothing"),g(f,x,b,v)};function o(i,s){var f;n.indexOf(s.operation)===-1?(i("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])]:c(s.value)&&(f=parseFloat(s.value),s.value=[f,f+1])):(i("contours.value",0),c(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}),aR=Ft((Q,$)=>{var c=bn(),g=F6(),P=Fp(),S=o7(),t=K6(),e=X6(),r=Uw(),a=Vw();$.exports=function(n,o,i,s){function f(T,u){return c.coerce(n,o,a,T,u)}function x(T){return c.coerce2(n,o,a,T)}var y=g(n,o,f,s);if(!y){o.visible=!1;return}P(n,o,s,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate"),f("hovertemplatefallback");var v=f("contours.type")==="constraint";f("connectgaps",c.isArray1D(o.z)),v?S(n,o,f,s,i):(t(n,o,f,x),e(n,o,f,s)),o.contours&&o.contours.coloring==="heatmap"&&r(f,s),f("zorder")}}),oR=Ft((Q,$)=>{$.exports={attributes:Vw(),supplyDefaults:aR(),calc:JM(),plot:J6().plot,style:Q6(),colorbar:tk(),hoverPoints:a7(),moduleType:"trace",name:"contour",basePlotModule:Mf(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}),sR=Ft((Q,$)=>{$.exports=oR()}),s7=Ft((Q,$)=>{var{hovertemplateAttrs:c,texttemplateAttrs:g,templatefallbackAttrs:P}=$u(),S=z0(),t=tf(),e=$o(),r=Tc(),a=Td().dash,n=Ta().extendFlat,o=t.marker,i=t.line,s=o.line;$.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:g({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:P({editType:"plot"}),hovertext:n({},t.hovertext,{}),line:{color:i.color,width:i.width,dash:a,backoff:i.backoff,shape:n({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:t.connectgaps,cliponaxis:t.cliponaxis,fill:n({},t.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:S(),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:c(),hovertemplatefallback:P()}}),lR=Ft((Q,$)=>{var c=bn(),g=vm(),P=Ac(),S=s0(),t=I0(),e=xv(),r=x0(),a=O0(),n=s7();$.exports=function(o,i,s,f){function x(C,M){return c.coerce(o,i,n,C,M)}var y=x("a"),v=x("b"),T=x("c"),u;if(y?(u=y.length,v?(u=Math.min(u,v.length),T&&(u=Math.min(u,T.length))):T?u=Math.min(u,T.length):u=0):v&&T&&(u=Math.min(v.length,T.length)),!u){i.visible=!1;return}i._length=u,x("sum"),x("text"),x("hovertext"),i.hoveron!=="fills"&&(x("hovertemplate"),x("hovertemplatefallback"));var b=u<g.PTS_LINESONLY?"lines+markers":"lines";x("mode",b),P.hasMarkers(i)&&S(o,i,s,f,x,{gradient:!0}),P.hasLines(i)&&(t(o,i,s,f,x,{backoff:!0}),e(o,i,x),x("connectgaps")),P.hasText(i)&&(x("texttemplate"),x("texttemplatefallback"),r(o,i,f,x));var _=[];(P.hasMarkers(i)||P.hasText(i))&&(x("cliponaxis"),x("marker.maxdisplayed"),_.push("points")),x("fill"),i.fill!=="none"&&(a(o,i,s,x),P.hasLines(i)||e(o,i,x)),(i.fill==="tonext"||i.fill==="toself")&&_.push("fills"),x("hoveron",_.join("+")||"points"),c.coerceSelectionMarkerOpacity(i,x)}}),uR=Ft((Q,$)=>{var c=Es();$.exports=function(g,P,S){var t={},e=S[P.subplot]._subplot;return t.aLabel=c.tickText(e.aaxis,g.a,!0).text,t.bLabel=c.tickText(e.baxis,g.b,!0).text,t.cLabel=c.tickText(e.caxis,g.c,!0).text,t}}),cR=Ft((Q,$)=>{var c=ra(),g=F0(),P=ct(),S=Bt(),t=me().calcMarkerSize,e=["a","b","c"],r={a:["b","c"],b:["a","c"],c:["a","b"]};$.exports=function(a,n){var o=a._fullLayout[n.subplot],i=o.sum,s=n.sum||i,f={a:n.a,b:n.b,c:n.c},x=n.ids,y,v,T,u,b,_;for(y=0;y<e.length;y++)if(T=e[y],!f[T]){for(b=f[r[T][0]],_=f[r[T][1]],u=new Array(b.length),v=0;v<b.length;v++)u[v]=s-b[v]-_[v];f[T]=u}var C=n._length,M=new Array(C),E,A,h,p,k,w;for(y=0;y<C;y++)E=f.a[y],A=f.b[y],h=f.c[y],c(E)&&c(A)&&c(h)?(E=+E,A=+A,h=+h,p=i/(E+A+h),p!==1&&(E*=p,A*=p,h*=p),w=E,k=h-A,M[y]={x:k,y:w,a:E,b:A,c:h},x&&(M[y].id=x[y])):M[y]={x:!1,y:!1};return t(n,C),g(a,n),P(M,n),S(M,n),M}}),hR=Ft((Q,$)=>{var c=Ya();$.exports=function(g,P,S){var t=P.plotContainer;t.select(".scatterlayer").selectAll("*").remove();for(var e=P.xaxis,r=P.yaxis,a={xaxis:e,yaxis:r,plot:t,layerClipId:P._hasClipOnAxisFalse?P.clipIdRelative:null},n=P.layers.frontplot.select("g.scatterlayer"),o=0;o<S.length;o++){var i=S[o];i.length&&(i[0].trace._xA=e,i[0].trace._yA=r)}c(g,a,S,n)}}),fR=Ft((Q,$)=>{var c=Sd();$.exports=function(g,P,S,t){var e=c(g,P,S,t);if(!e||e[0].index===!1)return;var r=e[0];if(r.index===void 0){var a=1-r.y0/g.ya._length,n=g.xa._length,o=n*a/2,i=n-o;return r.x0=Math.max(Math.min(r.x0,i),o),r.x1=Math.max(Math.min(r.x1,i),o),e}var s=r.cd[r.index],f=r.trace,x=r.subplot;r.a=s.a,r.b=s.b,r.c=s.c,r.xLabelVal=void 0,r.yLabelVal=void 0;var y={};y[f.subplot]={_subplot:x};var v=f._module.formatLabels(s,f,y);r.aLabel=v.aLabel,r.bLabel=v.bLabel,r.cLabel=v.cLabel;var T=s.hi||f.hoverinfo,u=[];function b(C,M){u.push(C._hovertitle+": "+M)}if(!f.hovertemplate){var _=T.split("+");_.indexOf("all")!==-1&&(_=["a","b","c"]),_.indexOf("a")!==-1&&b(x.aaxis,r.aLabel),_.indexOf("b")!==-1&&b(x.baxis,r.bLabel),_.indexOf("c")!==-1&&b(x.caxis,r.cLabel)}return r.extraText=u.join("<br>"),r.hovertemplate=f.hovertemplate,e}}),dR=Ft((Q,$)=>{$.exports=function(c,g,P,S,t){if(g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),S[t]){var e=S[t];c.a=e.a,c.b=e.b,c.c=e.c}else c.a=g.a,c.b=g.b,c.c=g.c;return c}}),pR=Ft((Q,$)=>{var c=un(),g=fo(),P=Xo(),S=bn(),t=S.strTranslate,e=S._,r=li(),a=js(),n=i0(),o=Ta().extendFlat,i=Kc(),s=Es(),f=up(),x=Qh(),y=v0(),v=y.freeMode,T=y.rectMode,u=lp(),b=vf().prepSelect,_=vf().selectOnClick,C=vf().clearOutline,M=vf().clearSelectionsCache,E=ic();function A(U,W){this.id=U.id,this.graphDiv=U.graphDiv,this.init(W),this.makeFramework(W),this.updateFx(W),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}$.exports=A;var h=A.prototype;h.init=function(U){this.container=U._ternarylayer,this.defs=U._defs,this.layoutId=U._uid,this.traceHash={},this.layers={}},h.plot=function(U,W){var q=this,X=W[q.id],lt=W._size;q._hasClipOnAxisFalse=!1;for(var yt=0;yt<U.length;yt++){var pt=U[yt][0].trace;if(pt.cliponaxis===!1){q._hasClipOnAxisFalse=!0;break}}q.updateLayers(X),q.adjustLayout(X,lt),i.generalUpdatePerTraceModule(q.graphDiv,q,U,X),q.layers.plotbg.select("path").call(r.fill,X.bgcolor)},h.makeFramework=function(U){var W=this,q=W.graphDiv,X=U[W.id],lt=W.clipId="clip"+W.layoutId+W.id,yt=W.clipIdRelative="clip-relative"+W.layoutId+W.id;W.clipDef=S.ensureSingleById(U._clips,"clipPath",lt,function(pt){pt.append("path").attr("d","M0,0Z")}),W.clipDefRelative=S.ensureSingleById(U._clips,"clipPath",yt,function(pt){pt.append("path").attr("d","M0,0Z")}),W.plotContainer=S.ensureSingle(W.container,"g",W.id),W.updateLayers(X),a.setClipUrl(W.layers.backplot,lt,q),a.setClipUrl(W.layers.grids,lt,q)},h.updateFx=function(U){U._ternarylayer.selectAll("g.toplevel").style("cursor",U.dragmode==="pan"?"move":"crosshair")},h.updateLayers=function(U){var W=this,q=W.layers,X=["draglayer","plotbg","backplot","grids"];U.aaxis.layer==="below traces"&&X.push("aaxis","aline"),U.baxis.layer==="below traces"&&X.push("baxis","bline"),U.caxis.layer==="below traces"&&X.push("caxis","cline"),X.push("frontplot"),U.aaxis.layer==="above traces"&&X.push("aaxis","aline"),U.baxis.layer==="above traces"&&X.push("baxis","bline"),U.caxis.layer==="above traces"&&X.push("caxis","cline");var lt=W.plotContainer.selectAll("g.toplevel").data(X,String),yt=["agrid","bgrid","cgrid"];lt.enter().append("g").attr("class",function(pt){return"toplevel "+pt}).each(function(pt){var st=c.select(this);q[pt]=st,pt==="frontplot"?st.append("g").classed("scatterlayer",!0):pt==="backplot"?st.append("g").classed("maplayer",!0):pt==="plotbg"?st.append("path").attr("d","M0,0Z"):pt==="aline"||pt==="bline"||pt==="cline"?st.append("path"):pt==="grids"&&yt.forEach(function(tt){q[tt]=st.append("g").classed("grid "+tt,!0)})}),lt.order()};var p=Math.sqrt(4/3);h.adjustLayout=function(U,W){var q=this,X=U.domain,lt=(X.x[0]+X.x[1])/2,yt=(X.y[0]+X.y[1])/2,pt=X.x[1]-X.x[0],st=X.y[1]-X.y[0],tt=pt*W.w,dt=st*W.h,rt=U.sum,at=U.aaxis.min,vt=U.baxis.min,it=U.caxis.min,Y,ft,ut,wt,zt,Pt;tt>p*dt?(wt=dt,ut=wt*p):(ut=tt,wt=ut/p),zt=pt*ut/tt,Pt=st*wt/dt,Y=W.l+W.w*lt-ut/2,ft=W.t+W.h*(1-yt)-wt/2,q.x0=Y,q.y0=ft,q.w=ut,q.h=wt,q.sum=rt,q.xaxis={type:"linear",range:[at+2*it-rt,rt-at-2*vt],domain:[lt-zt/2,lt+zt/2],_id:"x"},n(q.xaxis,q.graphDiv._fullLayout),q.xaxis.setScale(),q.xaxis.isPtWithinRange=function(te){return te.a>=q.aaxis.range[0]&&te.a<=q.aaxis.range[1]&&te.b>=q.baxis.range[1]&&te.b<=q.baxis.range[0]&&te.c>=q.caxis.range[1]&&te.c<=q.caxis.range[0]},q.yaxis={type:"linear",range:[at,rt-vt-it],domain:[yt-Pt/2,yt+Pt/2],_id:"y"},n(q.yaxis,q.graphDiv._fullLayout),q.yaxis.setScale(),q.yaxis.isPtWithinRange=function(){return!0};var Wt=q.yaxis.domain[0],Ht=q.aaxis=o({},U.aaxis,{range:[at,rt-vt-it],side:"left",tickangle:(+U.aaxis.tickangle||0)-30,domain:[Wt,Wt+Pt*p],anchor:"free",position:0,_id:"y",_length:ut});n(Ht,q.graphDiv._fullLayout),Ht.setScale();var Jt=q.baxis=o({},U.baxis,{range:[rt-at-it,vt],side:"bottom",domain:q.xaxis.domain,anchor:"free",position:0,_id:"x",_length:ut});n(Jt,q.graphDiv._fullLayout),Jt.setScale();var ge=q.caxis=o({},U.caxis,{range:[rt-at-vt,it],side:"right",tickangle:(+U.caxis.tickangle||0)+30,domain:[Wt,Wt+Pt*p],anchor:"free",position:0,_id:"y",_length:ut});n(ge,q.graphDiv._fullLayout),ge.setScale();var he="M"+Y+","+(ft+wt)+"h"+ut+"l-"+ut/2+",-"+wt+"Z";q.clipDef.select("path").attr("d",he),q.layers.plotbg.select("path").attr("d",he);var de="M0,"+wt+"h"+ut+"l-"+ut/2+",-"+wt+"Z";q.clipDefRelative.select("path").attr("d",de);var se=t(Y,ft);q.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",se),q.clipDefRelative.select("path").attr("transform",null);var Tt=t(Y-Jt._offset,ft+wt);q.layers.baxis.attr("transform",Tt),q.layers.bgrid.attr("transform",Tt);var Lt=t(Y+ut/2,ft)+"rotate(30)"+t(0,-Ht._offset);q.layers.aaxis.attr("transform",Lt),q.layers.agrid.attr("transform",Lt);var Mt=t(Y+ut/2,ft)+"rotate(-30)"+t(0,-ge._offset);q.layers.caxis.attr("transform",Mt),q.layers.cgrid.attr("transform",Mt),q.drawAxes(!0),q.layers.aline.select("path").attr("d",Ht.showline?"M"+Y+","+(ft+wt)+"l"+ut/2+",-"+wt:"M0,0").call(r.stroke,Ht.linecolor||"#000").style("stroke-width",(Ht.linewidth||0)+"px"),q.layers.bline.select("path").attr("d",Jt.showline?"M"+Y+","+(ft+wt)+"h"+ut:"M0,0").call(r.stroke,Jt.linecolor||"#000").style("stroke-width",(Jt.linewidth||0)+"px"),q.layers.cline.select("path").attr("d",ge.showline?"M"+(Y+ut/2)+","+ft+"l"+ut/2+","+wt:"M0,0").call(r.stroke,ge.linecolor||"#000").style("stroke-width",(ge.linewidth||0)+"px"),q.graphDiv._context.staticPlot||q.initInteractions(),a.setClipUrl(q.layers.frontplot,q._hasClipOnAxisFalse?null:q.clipId,q.graphDiv)},h.drawAxes=function(U){var W=this,q=W.graphDiv,X=W.id.substr(7)+"title",lt=W.layers,yt=W.aaxis,pt=W.baxis,st=W.caxis;if(W.drawAx(yt),W.drawAx(pt),W.drawAx(st),U){var tt=Math.max(yt.showticklabels?yt.tickfont.size/2:0,(st.showticklabels?st.tickfont.size*.75:0)+(st.ticks==="outside"?st.ticklen*.87:0)),dt=(pt.showticklabels?pt.tickfont.size:0)+(pt.ticks==="outside"?pt.ticklen:0)+3;lt["a-title"]=u.draw(q,"a"+X,{propContainer:yt,propName:W.id+".aaxis.title.text",placeholder:e(q,"Click to enter Component A title"),attributes:{x:W.x0+W.w/2,y:W.y0-yt.title.font.size/3-tt,"text-anchor":"middle"}}),lt["b-title"]=u.draw(q,"b"+X,{propContainer:pt,propName:W.id+".baxis.title.text",placeholder:e(q,"Click to enter Component B title"),attributes:{x:W.x0-dt,y:W.y0+W.h+pt.title.font.size*.83+dt,"text-anchor":"middle"}}),lt["c-title"]=u.draw(q,"c"+X,{propContainer:st,propName:W.id+".caxis.title.text",placeholder:e(q,"Click to enter Component C title"),attributes:{x:W.x0+W.w+dt,y:W.y0+W.h+st.title.font.size*.83+dt,"text-anchor":"middle"}})}},h.drawAx=function(U){var W=this,q=W.graphDiv,X=U._name,lt=X.charAt(0),yt=U._id,pt=W.layers[X],st=30,tt=lt+"tickLayout",dt=k(U);W[tt]!==dt&&(pt.selectAll("."+yt+"tick").remove(),W[tt]=dt),U.setScale();var rt=s.calcTicks(U),at=s.clipEnds(U,rt),vt=s.makeTransTickFn(U),it=s.getTickSigns(U)[2],Y=S.deg2rad(st),ft=it*(U.linewidth||1)/2,ut=it*U.ticklen,wt=W.w,zt=W.h,Pt=lt==="b"?"M0,"+ft+"l"+Math.sin(Y)*ut+","+Math.cos(Y)*ut:"M"+ft+",0l"+Math.cos(Y)*ut+","+-Math.sin(Y)*ut,Wt={a:"M0,0l"+zt+",-"+wt/2,b:"M0,0l-"+wt/2+",-"+zt,c:"M0,0l-"+zt+","+wt/2}[lt];s.drawTicks(q,U,{vals:U.ticks==="inside"?at:rt,layer:pt,path:Pt,transFn:vt,crisp:!1}),s.drawGrid(q,U,{vals:at,layer:W.layers[lt+"grid"],path:Wt,transFn:vt,crisp:!1}),s.drawLabels(q,U,{vals:rt,layer:pt,transFn:vt,labelFns:s.makeLabelFns(U,0,st)})};function k(U){return U.ticks+String(U.ticklen)+String(U.showticklabels)}var w=E.MINZOOM/2+.87,R="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(w*.87+4.5)+"l2.6,1.5l-"+w/2+","+w*.87+"Z",O="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(w*.87+4.5)+"l-2.6,1.5l"+w/2+","+w*.87+"Z",N="m0,1l"+w/2+","+w*.87+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(w*.87+4.5)+"l-"+(w/2+2.6)+","+(w*.87+4.5)+"l2.6,1.5l"+w/2+",-"+w*.87+"Z",V="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",H=!0;h.clearOutline=function(){M(this.dragOptions),C(this.dragOptions.gd)},h.initInteractions=function(){var U=this,W=U.layers.plotbg.select("path").node(),q=U.graphDiv,X=q._fullLayout._zoomlayer,lt,yt;this.dragOptions={element:W,gd:q,plotinfo:{id:U.id,domain:q._fullLayout[U.id].domain,xaxis:U.xaxis,yaxis:U.yaxis},subplot:U.id,prepFn:function(Tt,Lt,Mt){U.dragOptions.xaxes=[U.xaxis],U.dragOptions.yaxes=[U.yaxis],lt=q._fullLayout._invScaleX,yt=q._fullLayout._invScaleY;var te=U.dragOptions.dragmode=q._fullLayout.dragmode;v(te)?U.dragOptions.minDrag=1:U.dragOptions.minDrag=void 0,te==="zoom"?(U.dragOptions.moveFn=Jt,U.dragOptions.clickFn=wt,U.dragOptions.doneFn=ge,zt(Tt,Lt,Mt)):te==="pan"?(U.dragOptions.moveFn=de,U.dragOptions.clickFn=wt,U.dragOptions.doneFn=se,he(),U.clearOutline(q)):(T(te)||v(te))&&b(Tt,Lt,Mt,U.dragOptions,te)}};var pt,st,tt,dt,rt,at,vt,it,Y,ft;function ut(Tt){var Lt={};return Lt[U.id+".aaxis.min"]=Tt.a,Lt[U.id+".baxis.min"]=Tt.b,Lt[U.id+".caxis.min"]=Tt.c,Lt}function wt(Tt,Lt){var Mt=q._fullLayout.clickmode;F(q),Tt===2&&(q.emit("plotly_doubleclick",null),P.call("_guiRelayout",q,ut({a:0,b:0,c:0}))),Mt.indexOf("select")>-1&&Tt===1&&_(Lt,q,[U.xaxis],[U.yaxis],U.id,U.dragOptions),Mt.indexOf("event")>-1&&x.click(q,Lt,U.id)}function zt(Tt,Lt,Mt){var te=W.getBoundingClientRect();pt=Lt-te.left,st=Mt-te.top,q._fullLayout._calcInverseTransform(q);var ve=q._fullLayout._invTransform,oe=S.apply3DTransform(ve)(pt,st);pt=oe[0],st=oe[1],tt={a:U.aaxis.range[0],b:U.baxis.range[1],c:U.caxis.range[1]},rt=tt,dt=U.aaxis.range[1]-tt.a,at=g(U.graphDiv._fullLayout[U.id].bgcolor).getLuminance(),vt="M0,"+U.h+"L"+U.w/2+", 0L"+U.w+","+U.h+"Z",it=!1,Y=X.append("path").attr("class","zoombox").attr("transform",t(U.x0,U.y0)).style({fill:at>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",vt),ft=X.append("path").attr("class","zoombox-corners").attr("transform",t(U.x0,U.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),U.clearOutline(q)}function Pt(Tt,Lt){return 1-Lt/U.h}function Wt(Tt,Lt){return 1-(Tt+(U.h-Lt)/Math.sqrt(3))/U.w}function Ht(Tt,Lt){return(Tt-(U.h-Lt)/Math.sqrt(3))/U.w}function Jt(Tt,Lt){var Mt=pt+Tt*lt,te=st+Lt*yt,ve=Math.max(0,Math.min(1,Pt(pt,st),Pt(Mt,te))),oe=Math.max(0,Math.min(1,Wt(pt,st),Wt(Mt,te))),Te=Math.max(0,Math.min(1,Ht(pt,st),Ht(Mt,te))),He=(ve/2+Te)*U.w,Ge=(1-ve/2-oe)*U.w,cr=(He+Ge)/2,ur=Ge-He,jr=(1-ve)*U.h,Hr=jr-ur/p;ur<E.MINZOOM?(rt=tt,Y.attr("d",vt),ft.attr("d","M0,0Z")):(rt={a:tt.a+ve*dt,b:tt.b+oe*dt,c:tt.c+Te*dt},Y.attr("d",vt+"M"+He+","+jr+"H"+Ge+"L"+cr+","+Hr+"L"+He+","+jr+"Z"),ft.attr("d","M"+pt+","+st+V+"M"+He+","+jr+R+"M"+Ge+","+jr+O+"M"+cr+","+Hr+N)),it||(Y.transition().style("fill",at>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ft.transition().style("opacity",1).duration(200),it=!0),q.emit("plotly_relayouting",ut(rt))}function ge(){F(q),rt!==tt&&(P.call("_guiRelayout",q,ut(rt)),H&&q.data&&q._context.showTips&&(S.notifier(e(q,"Double-click to zoom back out"),"long"),H=!1))}function he(){tt={a:U.aaxis.range[0],b:U.baxis.range[1],c:U.caxis.range[1]},rt=tt}function de(Tt,Lt){var Mt=Tt/U.xaxis._m,te=Lt/U.yaxis._m;rt={a:tt.a-te,b:tt.b+(Mt+te)/2,c:tt.c-(Mt-te)/2};var ve=[rt.a,rt.b,rt.c].sort(S.sorterAsc),oe={a:ve.indexOf(rt.a),b:ve.indexOf(rt.b),c:ve.indexOf(rt.c)};ve[0]<0&&(ve[1]+ve[0]/2<0?(ve[2]+=ve[0]+ve[1],ve[0]=ve[1]=0):(ve[2]+=ve[0]/2,ve[1]+=ve[0]/2,ve[0]=0),rt={a:ve[oe.a],b:ve[oe.b],c:ve[oe.c]},Lt=(tt.a-rt.a)*U.yaxis._m,Tt=(tt.c-rt.c-tt.b+rt.b)*U.xaxis._m);var Te=t(U.x0+Tt,U.y0+Lt);U.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Te);var He=t(-Tt,-Lt);U.clipDefRelative.select("path").attr("transform",He),U.aaxis.range=[rt.a,U.sum-rt.b-rt.c],U.baxis.range=[U.sum-rt.a-rt.c,rt.b],U.caxis.range=[U.sum-rt.a-rt.b,rt.c],U.drawAxes(!1),U._hasClipOnAxisFalse&&U.plotContainer.select(".scatterlayer").selectAll(".trace").call(a.hideOutsideRangePoints,U),q.emit("plotly_relayouting",ut(rt))}function se(){P.call("_guiRelayout",q,ut(rt))}W.onmousemove=function(Tt){x.hover(q,Tt,U.id),q._fullLayout._lasthover=W,q._fullLayout._hoversubplot=U.id},W.onmouseout=function(Tt){q._dragging||f.unhover(q,Tt)},f.init(this.dragOptions)};function F(U){c.select(U).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}),l7=Ft((Q,$)=>{var c=bi(),g=Nh().attributes,P=Ad(),S=Yc().overrideAll,t=Ta().extendFlat,e={title:{text:P.title.text,font:P.title.font},color:P.color,tickmode:P.minor.tickmode,nticks:t({},P.nticks,{dflt:6,min:1}),tick0:P.tick0,dtick:P.dtick,tickvals:P.tickvals,ticktext:P.ticktext,ticks:P.ticks,ticklen:P.ticklen,tickwidth:P.tickwidth,tickcolor:P.tickcolor,ticklabelstep:P.ticklabelstep,showticklabels:P.showticklabels,labelalias:P.labelalias,showtickprefix:P.showtickprefix,tickprefix:P.tickprefix,showticksuffix:P.showticksuffix,ticksuffix:P.ticksuffix,showexponent:P.showexponent,exponentformat:P.exponentformat,minexponent:P.minexponent,separatethousands:P.separatethousands,tickfont:P.tickfont,tickangle:P.tickangle,tickformat:P.tickformat,tickformatstops:P.tickformatstops,hoverformat:P.hoverformat,showline:t({},P.showline,{dflt:!0}),linecolor:P.linecolor,linewidth:P.linewidth,showgrid:t({},P.showgrid,{dflt:!0}),gridcolor:P.gridcolor,gridwidth:P.gridwidth,griddash:P.griddash,layer:P.layer,min:{valType:"number",dflt:0,min:0}},r=$.exports=S({domain:g({name:"ternary"}),bgcolor:{valType:"color",dflt:c.background},sum:{valType:"number",dflt:1,min:0},aaxis:e,baxis:e,caxis:e},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}),P1=Ft((Q,$)=>{var c=bn(),g=pu(),P=Nh().defaults;$.exports=function(S,t,e,r){var a=r.type,n=r.attributes,o=r.handleDefaults,i=r.partition||"x",s=t._subplots[a],f=s.length,x=f&&s[0].replace(/\d+$/,""),y,v;function T(C,M){return c.coerce(y,v,n,C,M)}for(var u=0;u<f;u++){var b=s[u];S[b]?y=S[b]:y=S[b]={},v=g.newContainer(t,b,x),r.noUirevision||T("uirevision",t.uirevision);var _={};_[i]=[u/f,(u+1)/f],P(v,t,T,_),r.id=b,o(y,v,T,r)}}}),mR=Ft((Q,$)=>{var c=li(),g=pu(),P=bn(),S=P1(),t=n0(),e=dm(),r=gg(),a=mg(),n=Yy(),o=l7(),i=["aaxis","baxis","caxis"];$.exports=function(x,y,v){S(x,y,v,{type:"ternary",attributes:o,handleDefaults:s,font:y.font,paper_bgcolor:y.paper_bgcolor})};function s(x,y,v,T){var u=v("bgcolor"),b=v("sum");T.bgColor=c.combine(u,T.paper_bgcolor);for(var _,C,M,E=0;E<i.length;E++)_=i[E],C=x[_]||{},M=g.newContainer(y,_),M._name=_,f(C,M,T,y);var A=y.aaxis,h=y.baxis,p=y.caxis;A.min+h.min+p.min>=b&&(A.min=0,h.min=0,p.min=0,x.aaxis&&delete x.aaxis.min,x.baxis&&delete x.baxis.min,x.caxis&&delete x.caxis.min)}function f(x,y,v,T){var u=o[y._name];function b(k,w){return P.coerce(x,y,u,k,w)}b("uirevision",T.uirevision),y.type="linear";var _=b("color"),C=_!==u.color.dflt?_:v.font.color,M=y._name,E=M.charAt(0).toUpperCase(),A="Component "+E,h=b("title.text",A);y._hovertitle=h===A?h:E,P.coerceFont(b,"title.font",v.font,{overrideDflt:{size:P.bigFont(v.font.size),color:C}}),b("min"),a(x,y,b,"linear"),e(x,y,b,"linear"),t(x,y,b,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(x,y,b,{outerTicks:!0});var p=b("showticklabels");p&&(P.coerceFont(b,"tickfont",v.font,{overrideDflt:{color:C}}),b("tickangle"),b("tickformat")),n(x,y,b,{dfltColor:_,bgColor:v.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:u}),b("hoverformat"),b("layer")}}),gR=Ft(Q=>{var $=pR(),c=ud().getSubplotCalcData,g=bn().counterRegex,P="ternary";Q.name=P;var S=Q.attr="subplot";Q.idRoot=P,Q.idRegex=Q.attrRegex=g(P);var t=Q.attributes={};t[S]={valType:"subplotid",dflt:"ternary",editType:"calc"},Q.layoutAttributes=l7(),Q.supplyLayoutDefaults=mR(),Q.plot=function(e){for(var r=e._fullLayout,a=e.calcdata,n=r._subplots[P],o=0;o<n.length;o++){var i=n[o],s=c(a,P,i),f=r[i]._subplot;f||(f=new $({id:i,graphDiv:e,container:r._ternarylayer.node()},r),r[i]._subplot=f),f.plot(s,r,e._promises)}},Q.clean=function(e,r,a,n){for(var o=n._subplots[P]||[],i=0;i<o.length;i++){var s=o[i],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())}},Q.updateFx=function(e){var r=e._fullLayout;r._ternarylayer.selectAll("g.toplevel").style("cursor",r.dragmode==="pan"?"move":"crosshair")}}),vR=Ft((Q,$)=>{$.exports={attributes:s7(),supplyDefaults:lR(),colorbar:xo(),formatLabels:uR(),calc:cR(),plot:hR(),style:xl().style,styleOnSelect:xl().styleOnSelect,hoverPoints:fR(),selectPoints:Bf(),eventData:dR(),moduleType:"trace",name:"scatterternary",basePlotModule:gR(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}),yR=Ft((Q,$)=>{$.exports=vR()}),u7=Ft((Q,$)=>{var c=Bw(),g=Ta().extendFlat,P=fh().axisHoverFormat;$.exports={y:c.y,x:c.x,x0:c.x0,y0:c.y0,xhoverformat:P("x"),yhoverformat:P("y"),name:g({},c.name,{}),orientation:g({},c.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:c.fillcolor,points:g({},c.boxpoints,{}),jitter:g({},c.jitter,{}),pointpos:g({},c.pointpos,{}),width:g({},c.width,{}),marker:c.marker,text:c.text,hovertext:c.hovertext,hovertemplate:c.hovertemplate,hovertemplatefallback:c.hovertemplatefallback,quartilemethod:c.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:c.offsetgroup,alignmentgroup:c.alignmentgroup,selected:c.selected,unselected:c.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:c.zorder}}),c7=Ft((Q,$)=>{var c=Nw(),g=bn().extendFlat;$.exports={violinmode:g({},c.boxmode,{}),violingap:g({},c.boxgap,{}),violingroupgap:g({},c.boxgroupgap,{})}}),xR=Ft((Q,$)=>{var c=bn(),g=li(),P=jw(),S=u7();$.exports=function(t,e,r,a){function n(h,p){return c.coerce(t,e,S,h,p)}function o(h,p){return c.coerce2(t,e,S,h,p)}if(P.handleSampleDefaults(t,e,n,a),e.visible!==!1){n("bandwidth"),n("side");var i=n("width");i||(n("scalegroup",e.name),n("scalemode"));var s=n("span"),f;Array.isArray(s)&&(f="manual"),n("spanmode",f);var x=n("line.color",(t.marker||{}).color||r),y=n("line.width"),v=n("fillcolor",g.addOpacity(e.line.color,.5));P.handlePointsDefaults(t,e,n,{prefix:""});var T=o("box.width"),u=o("box.fillcolor",v),b=o("box.line.color",x),_=o("box.line.width",y),C=n("box.visible",!!(T||u||b||_));C||(e.box={visible:!1});var M=o("meanline.color",x),E=o("meanline.width",y),A=n("meanline.visible",!!(M||E));A||(e.meanline={visible:!1}),n("quartilemethod"),n("zorder")}}}),_R=Ft((Q,$)=>{var c=bn(),g=c7(),P=z6();$.exports=function(S,t,e){function r(a,n){return c.coerce(S,t,g,a,n)}P._supply(S,t,e,r,"violin")}}),ek=Ft(Q=>{var $=bn(),c={gaussian:function(g){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*g*g)}};Q.makeKDE=function(g,P,S){var t=S.length,e=c.gaussian,r=g.bandwidth,a=1/(t*r);return function(n){for(var o=0,i=0;i<t;i++)o+=e((n-S[i])/r);return a*o}},Q.getPositionOnKdePath=function(g,P,S){var t,e;P.orientation==="h"?(t="y",e="x"):(t="x",e="y");var r=$.findPointOnPath(g.path,S,e,{pathLength:g.pathLength}),a=g.posCenterPx,n=r[t],o=P.side==="both"?2*a-n:a;return[n,o]},Q.getKdeValue=function(g,P,S){var t=g.pts.map(Q.extractVal),e=Q.makeKDE(g,P,t);return e(S)/g.posDensityScale},Q.extractVal=function(g){return g.v}}),bR=Ft((Q,$)=>{var c=bn(),g=Es(),P=DM(),S=ek(),t=Da().BADNUM;$.exports=function(n,o){var i=P(n,o);if(i[0].t.empty)return i;for(var s=n._fullLayout,f=g.getFromId(n,o[o.orientation==="h"?"xaxis":"yaxis"]),x=1/0,y=-1/0,v=0,T=0,u=0;u<i.length;u++){var b=i[u],_=b.pts.map(S.extractVal),C=b.bandwidth=r(o,b,_),M=b.span=a(o,b,f,C);if(b.min===b.max&&C===0)M=b.span=[b.min,b.max],b.density=[{v:1,t:M[0]}],b.bandwidth=C,v=Math.max(v,1);else{var E=M[1]-M[0],A=Math.ceil(E/(C/3)),h=E/A;if(!isFinite(h)||!isFinite(A))return c.error("Something went wrong with computing the violin span"),i[0].t.empty=!0,i;var p=S.makeKDE(b,o,_);b.density=new Array(A);for(var k=0,w=M[0];w<M[1]+h/2;k++,w+=h){var R=p(w);b.density[k]={v:R,t:w},v=Math.max(v,R)}}T=Math.max(T,_.length),x=Math.min(x,M[0]),y=Math.max(y,M[1])}var O=g.findExtremes(f,[x,y],{padded:!0});if(o._extremes[f._id]=O,o.width)i[0].t.maxKDE=v;else{var N=s._violinScaleGroupStats,V=o.scalegroup,H=N[V];H?(H.maxKDE=Math.max(H.maxKDE,v),H.maxCount=Math.max(H.maxCount,T)):N[V]={maxKDE:v,maxCount:T}}return i[0].t.labels.kde=c._(n,"kde:"),i};function e(n,o,i){var s=Math.min(o,i/1.349);return 1.059*s*Math.pow(n,-.2)}function r(n,o,i){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=i.length,x=c.stdev(i,f-1,o.mean);return Math.max(e(f,x,o.q3-o.q1),s/100)}function a(n,o,i,s){var f=n.spanmode,x=n.span||[],y=[o.min,o.max],v=[o.min-2*s,o.max+2*s],T;function u(_){var C=x[_],M=i.type==="multicategory"?i.r2c(C):i.d2c(C,0,n[o.valLetter+"calendar"]);return M===t?v[_]:M}f==="soft"?T=v:f==="hard"?T=y:T=[u(0),u(1)];var b={type:"linear",range:T};return g.setConvert(b),b.cleanRange(),T}}),wR=Ft((Q,$)=>{var c=I6().setPositionOffset,g=["v","h"];$.exports=function(P,S){for(var t=P.calcdata,e=S.xaxis,r=S.yaxis,a=0;a<g.length;a++){for(var n=g[a],o=n==="h"?r:e,i=[],s=0;s<t.length;s++){var f=t[s],x=f[0].t,y=f[0].trace;y.visible===!0&&y.type==="violin"&&!x.empty&&y.orientation===n&&y.xaxis===e._id&&y.yaxis===r._id&&i.push(s)}c("violin",P,i,o)}}}),kR=Ft((Q,$)=>{var c=un(),g=bn(),P=js(),S=O6(),t=ji(),e=ek();$.exports=function(r,a,n,o){var i=r._context.staticPlot,s=r._fullLayout,f=a.xaxis,x=a.yaxis;function y(v,T){var u=t(v,{xaxis:f,yaxis:x,trace:T,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return P.smoothopen(u[0],1)}g.makeTraceGroups(o,n,"trace violins").each(function(v){var T=c.select(this),u=v[0],b=u.t,_=u.trace;if(_.visible!==!0||b.empty){T.remove();return}var C=b.bPos,M=b.bdPos,E=a[b.valLetter+"axis"],A=a[b.posLetter+"axis"],h=_.side==="both",p=h||_.side==="positive",k=h||_.side==="negative",w=T.selectAll("path.violin").data(g.identity);w.enter().append("path").style("vector-effect",i?"none":"non-scaling-stroke").attr("class","violin"),w.exit().remove(),w.each(function(W){var q=c.select(this),X=W.density,lt=X.length,yt=A.c2l(W.pos+C,!0),pt=A.l2p(yt),st;if(_.width)st=b.maxKDE/M;else{var tt=s._violinScaleGroupStats[_.scalegroup];st=_.scalemode==="count"?tt.maxKDE/M*(tt.maxCount/W.pts.length):tt.maxKDE/M}var dt,rt,at,vt,it,Y,ft;if(p){for(Y=new Array(lt),vt=0;vt<lt;vt++)ft=Y[vt]={},ft[b.posLetter]=yt+X[vt].v/st,ft[b.valLetter]=E.c2l(X[vt].t,!0);dt=y(Y,_)}if(k){for(Y=new Array(lt),it=0,vt=lt-1;it<lt;it++,vt--)ft=Y[it]={},ft[b.posLetter]=yt-X[vt].v/st,ft[b.valLetter]=E.c2l(X[vt].t,!0);rt=y(Y,_)}if(h)at=dt+"L"+rt.substr(1)+"Z";else{var ut=[pt,E.c2p(X[0].t)],wt=[pt,E.c2p(X[lt-1].t)];_.orientation==="h"&&(ut.reverse(),wt.reverse()),p?at="M"+ut+"L"+dt.substr(1)+"L"+wt:at="M"+wt+"L"+rt.substr(1)+"L"+ut}q.attr("d",at),W.posCenterPx=pt,W.posDensityScale=st*M,W.path=q.node(),W.pathLength=W.path.getTotalLength()/(h?2:1)});var R=_.box,O=R.width,N=(R.line||{}).width,V,H;h?(V=M*O,H=0):p?(V=[0,M*O/2],H=N*{x:1,y:-1}[b.posLetter]):(V=[M*O/2,0],H=N*{x:-1,y:1}[b.posLetter]),S.plotBoxAndWhiskers(T,{pos:A,val:E},_,{bPos:C,bdPos:V,bPosPxOffset:H}),S.plotBoxMean(T,{pos:A,val:E},_,{bPos:C,bdPos:V,bPosPxOffset:H});var F;!_.box.visible&&_.meanline.visible&&(F=g.identity);var U=T.selectAll("path.meanline").data(F||[]);U.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect",i?"none":"non-scaling-stroke"),U.exit().remove(),U.each(function(W){var q=E.c2p(W.mean,!0),X=e.getPositionOnKdePath(W,_,q);c.select(this).attr("d",_.orientation==="h"?"M"+q+","+X[0]+"V"+X[1]:"M"+X[0]+","+q+"H"+X[1])}),S.plotPoints(T,{x:f,y:x},_,b)})}}),TR=Ft((Q,$)=>{var c=un(),g=li(),P=xl().stylePoints;$.exports=function(S){var t=c.select(S).selectAll("g.trace.violins");t.style("opacity",function(e){return e[0].trace.opacity}),t.each(function(e){var r=e[0].trace,a=c.select(this),n=r.box||{},o=n.line||{},i=r.meanline||{},s=i.width;a.selectAll("path.violin").style("stroke-width",r.line.width+"px").call(g.stroke,r.line.color).call(g.fill,r.fillcolor),a.selectAll("path.box").style("stroke-width",o.width+"px").call(g.stroke,o.color).call(g.fill,n.fillcolor);var f={"stroke-width":s+"px","stroke-dasharray":2*s+"px,"+s+"px"};a.selectAll("path.mean").style(f).call(g.stroke,i.color),a.selectAll("path.meanline").style(f).call(g.stroke,i.color),P(a,r,S)})}}),AR=Ft((Q,$)=>{var c=li(),g=bn(),P=Es(),S=FM(),t=ek();$.exports=function(e,r,a,n,o){o||(o={});var i=o.hoverLayer,s=e.cd,f=s[0].trace,x=f.hoveron,y=x.indexOf("violins")!==-1,v=x.indexOf("kde")!==-1,T=[],u,b;if(y||v){var _=S.hoverOnBoxes(e,r,a,n);if(v&&_.length>0){var C=e.xa,M=e.ya,E,A,h,p,k;f.orientation==="h"?(k=r,E="y",h=M,A="x",p=C):(k=a,E="x",h=C,A="y",p=M);var w=s[e.index];if(k>=w.span[0]&&k<=w.span[1]){var R=g.extendFlat({},e),O=p.c2p(k,!0),N=t.getKdeValue(w,f,k),V=t.getPositionOnKdePath(w,f,O),H=h._offset,F=h._length;R[E+"0"]=V[0],R[E+"1"]=V[1],R[A+"0"]=R[A+"1"]=O,R[A+"Label"]=A+": "+P.hoverLabelText(p,k,f[A+"hoverformat"])+", "+s[0].t.labels.kde+" "+N.toFixed(3);for(var U=0,W=0;W<_.length;W++)if(_[W].attr==="med"){U=W;break}R.spikeDistance=_[U].spikeDistance;var q=E+"Spike";R[q]=_[U][q],_[U].spikeDistance=void 0,_[U][q]=void 0,R.hovertemplate=!1,T.push(R),b={},b[E+"1"]=g.constrain(H+V[0],H,H+F),b[E+"2"]=g.constrain(H+V[1],H,H+F),b[A+"1"]=b[A+"2"]=p._offset+O}}y&&(T=T.concat(_))}x.indexOf("points")!==-1&&(u=S.hoverOnPoints(e,r,a));var X=i.selectAll(".violinline-"+f.uid).data(b?[0]:[]);return X.enter().append("line").classed("violinline-"+f.uid,!0).attr("stroke-width",1.5),X.exit().remove(),X.attr(b).call(c.stroke,e.color),n==="closest"?u?[u]:T:(u&&T.push(u),T)}}),MR=Ft((Q,$)=>{$.exports={attributes:u7(),layoutAttributes:c7(),supplyDefaults:xR(),crossTraceDefaults:jw().crossTraceDefaults,supplyLayoutDefaults:_R(),calc:bR(),crossTraceCalc:wR(),plot:kR(),style:TR(),styleOnSelect:xl().styleOnSelect,hoverPoints:AR(),selectPoints:RM(),moduleType:"trace",name:"violin",basePlotModule:Mf(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}),SR=Ft((Q,$)=>{$.exports=MR()}),ER=Ft((Q,$)=>{$.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}),h7=Ft((Q,$)=>{var c=Sg(),g=tf().line,P=$o(),S=fh().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=$u(),a=ER(),n=Ta().extendFlat,o=li();$.exports={x:c.x,x0:c.x0,dx:c.dx,y:c.y,y0:c.y0,dy:c.dy,xperiod:c.xperiod,yperiod:c.yperiod,xperiod0:c.xperiod0,yperiod0:c.yperiod0,xperiodalignment:c.xperiodalignment,yperiodalignment:c.yperiodalignment,xhoverformat:S("x"),yhoverformat:S("y"),hovertext:c.hovertext,hovertemplate:t({},{keys:a.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:n({},P.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:a.eventDataKeys.concat(["label","value"])}),texttemplatefallback:r({editType:"plot"}),text:c.text,textposition:c.textposition,insidetextanchor:n({},c.insidetextanchor,{dflt:"middle"}),textangle:n({},c.textangle,{dflt:0}),textfont:c.textfont,insidetextfont:c.insidetextfont,outsidetextfont:c.outsidetextfont,constraintext:c.constraintext,cliponaxis:c.cliponaxis,orientation:n({},c.orientation,{}),offset:n({},c.offset,{arrayOk:!1}),width:n({},c.width,{arrayOk:!1}),marker:i(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:n({},g.color,{dflt:o.defaultLine}),width:n({},g.width,{dflt:0,editType:"plot"}),dash:g.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:c.offsetgroup,alignmentgroup:c.alignmentgroup,zorder:c.zorder};function i(){var s=n({},c.marker);return delete s.pattern,delete s.cornerradius,s}}),f7=Ft((Q,$)=>{$.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"}}}),d7=Ft((Q,$)=>{var c=bn(),g=Mg(),P=J0().handleText,S=Nm(),t=Fp(),e=h7(),r=li();function a(i,s,f,x){function y(M,E){return c.coerce(i,s,e,M,E)}var v=S(i,s,x,y);if(!v){s.visible=!1;return}t(i,s,x,y),y("xhoverformat"),y("yhoverformat"),y("orientation",s.y&&!s.x?"v":"h"),y("offset"),y("width");var T=y("text");y("hovertext"),y("hovertemplate"),y("hovertemplatefallback");var u=y("textposition");P(i,s,x,y,u,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s.textposition!=="none"&&!s.texttemplate&&y("textinfo",c.isArrayOrTypedArray(T)?"text+value":"value");var b=y("marker.color",f);y("marker.line.color",r.defaultLine),y("marker.line.width");var _=y("connector.visible");if(_){y("connector.fillcolor",n(b));var C=y("connector.line.width");C&&(y("connector.line.color"),y("connector.line.dash"))}y("zorder")}function n(i){var s=c.isArrayOrTypedArray(i)?"#000":i;return r.addOpacity(s,.5*r.opacity(s))}function o(i,s){var f,x;function y(T){return c.coerce(x._input,x,e,T)}for(var v=0;v<i.length;v++)x=i[v],x.type==="funnel"&&(f=x._input,g(f,x,s,y,s.funnelmode))}$.exports={supplyDefaults:a,crossTraceDefaults:o}}),CR=Ft((Q,$)=>{var c=bn(),g=f7();$.exports=function(P,S,t){var e=!1;function r(o,i){return c.coerce(P,S,g,o,i)}for(var a=0;a<t.length;a++){var n=t[a];if(n.visible&&n.type==="funnel"){e=!0;break}}e&&(r("funnelmode"),r("funnelgap",.2),r("funnelgroupgap"))}}),LR=Ft((Q,$)=>{var c=bn();$.exports=function(g,P){for(var S=0;S<g.length;S++)g[S].i=S;c.mergeArray(P.text,g,"tx"),c.mergeArray(P.hovertext,g,"htx");var t=P.marker;if(t){c.mergeArray(t.opacity,g,"mo"),c.mergeArray(t.color,g,"mc");var e=t.line;e&&(c.mergeArray(e.color,g,"mlc"),c.mergeArrayCastPositive(e.width,g,"mlw"))}}}),PR=Ft((Q,$)=>{var c=Es(),g=D0(),P=LR(),S=Bt(),t=Da().BADNUM;$.exports=function(r,a){var n=c.getFromId(r,a.xaxis||"x"),o=c.getFromId(r,a.yaxis||"y"),i,s,f,x,y,v,T,u;a.orientation==="h"?(i=n.makeCalcdata(a,"x"),f=o.makeCalcdata(a,"y"),x=g(a,o,"y",f),y=!!a.yperiodalignment,v="y"):(i=o.makeCalcdata(a,"y"),f=n.makeCalcdata(a,"x"),x=g(a,n,"x",f),y=!!a.xperiodalignment,v="x"),s=x.vals;var b=Math.min(s.length,i.length),_=new Array(b);for(a._base=[],T=0;T<b;T++){i[T]<0&&(i[T]=t);var C=!1;i[T]!==t&&T+1<b&&i[T+1]!==t&&(C=!0),u=_[T]={p:s[T],s:i[T],cNext:C},a._base[T]=-.5*u.s,y&&(_[T].orig_p=f[T],_[T][v+"End"]=x.ends[T],_[T][v+"Start"]=x.starts[T]),a.ids&&(u.id=String(a.ids[T])),T===0&&(_[0].vTotal=0),_[0].vTotal+=e(u.s),u.begR=e(u.s)/e(_[0].s)}var M;for(T=0;T<b;T++)u=_[T],u.s!==t&&(u.sumR=u.s/_[0].vTotal,u.difR=M!==void 0?u.s/M:1,M=u.s);return P(_,a),S(_,a),_};function e(r){return r===t?0:r}}),zR=Ft((Q,$)=>{var c=Pr().setGroupPositions;$.exports=function(g,P){var S=g._fullLayout,t=g._fullData,e=g.calcdata,r=P.xaxis,a=P.yaxis,n=[],o=[],i=[],s,f;for(f=0;f<t.length;f++){var x=t[f],y=x.orientation==="h";x.visible===!0&&x.xaxis===r._id&&x.yaxis===a._id&&x.type==="funnel"&&(s=e[f],y?i.push(s):o.push(s),n.push(s))}var v={mode:S.funnelmode,norm:S.funnelnorm,gap:S.funnelgap,groupgap:S.funnelgroupgap};for(c(g,r,a,o,v),c(g,a,r,i,v),f=0;f<n.length;f++){s=n[f];for(var T=0;T<s.length;T++)T+1<s.length&&(s[T].nextP0=s[T+1].p0,s[T].nextS0=s[T+1].s0,s[T].nextP1=s[T+1].p1,s[T].nextS1=s[T+1].s1)}}}),IR=Ft((Q,$)=>{var c=un(),g=bn(),P=js(),S=Da().BADNUM,t=Qy(),e=Rp().clearMinTextSize;$.exports=function(o,i,s,f){var x=o._fullLayout;e("funnel",x),r(o,i,s,f),a(o,i,s,f),t.plot(o,i,s,f,{mode:x.funnelmode,norm:x.funnelmode,gap:x.funnelgap,groupgap:x.funnelgroupgap})};function r(o,i,s,f){var x=i.xaxis,y=i.yaxis;g.makeTraceGroups(f,s,"trace bars").each(function(v){var T=c.select(this),u=v[0].trace,b=g.ensureSingle(T,"g","regions");if(!u.connector||!u.connector.visible){b.remove();return}var _=u.orientation==="h",C=b.selectAll("g.region").data(g.identity);C.enter().append("g").classed("region",!0),C.exit().remove();var M=C.size();C.each(function(E,A){if(!(A!==M-1&&!E.cNext)){var h=n(E,x,y,_),p=h[0],k=h[1],w="";p[0]!==S&&k[0]!==S&&p[1]!==S&&k[1]!==S&&p[2]!==S&&k[2]!==S&&p[3]!==S&&k[3]!==S&&(_?w+="M"+p[0]+","+k[1]+"L"+p[2]+","+k[2]+"H"+p[3]+"L"+p[1]+","+k[1]+"Z":w+="M"+p[1]+","+k[1]+"L"+p[2]+","+k[3]+"V"+k[2]+"L"+p[1]+","+k[0]+"Z"),w===""&&(w="M0,0Z"),g.ensureSingle(c.select(this),"path").attr("d",w).call(P.setClipUrl,i.layerClipId,o)}})})}function a(o,i,s,f){var x=i.xaxis,y=i.yaxis;g.makeTraceGroups(f,s,"trace bars").each(function(v){var T=c.select(this),u=v[0].trace,b=g.ensureSingle(T,"g","lines");if(!u.connector||!u.connector.visible||!u.connector.line.width){b.remove();return}var _=u.orientation==="h",C=b.selectAll("g.line").data(g.identity);C.enter().append("g").classed("line",!0),C.exit().remove();var M=C.size();C.each(function(E,A){if(!(A!==M-1&&!E.cNext)){var h=n(E,x,y,_),p=h[0],k=h[1],w="";p[3]!==void 0&&k[3]!==void 0&&(_?(w+="M"+p[0]+","+k[1]+"L"+p[2]+","+k[2],w+="M"+p[1]+","+k[1]+"L"+p[3]+","+k[2]):(w+="M"+p[1]+","+k[1]+"L"+p[2]+","+k[3],w+="M"+p[1]+","+k[0]+"L"+p[2]+","+k[2])),w===""&&(w="M0,0Z"),g.ensureSingle(c.select(this),"path").attr("d",w).call(P.setClipUrl,i.layerClipId,o)}})})}function n(o,i,s,f){var x=[],y=[],v=f?i:s,T=f?s:i;return x[0]=v.c2p(o.s0,!0),y[0]=T.c2p(o.p0,!0),x[1]=v.c2p(o.s1,!0),y[1]=T.c2p(o.p1,!0),x[2]=v.c2p(o.nextS0,!0),y[2]=T.c2p(o.nextP0,!0),x[3]=v.c2p(o.nextS1,!0),y[3]=T.c2p(o.nextP1,!0),f?[x,y]:[y,x]}}),OR=Ft((Q,$)=>{var c=un(),g=js(),P=li(),S=co().DESELECTDIM,t=xm(),e=Rp().resizeText,r=t.styleTextPoints;function a(n,o,i){var s=i||c.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 x=c.select(this),y=f[0].trace;x.selectAll(".point > path").each(function(v){if(!v.isBlank){var T=y.marker;c.select(this).call(P.fill,v.mc||T.color).call(P.stroke,v.mlc||T.line.color).call(g.dashLine,T.line.dash,v.mlw||T.line.width).style("opacity",y.selectedpoints&&!v.selected?S:1)}}),r(x,y,n),x.selectAll(".regions").each(function(){c.select(this).selectAll("path").style("stroke-width",0).call(P.fill,y.connector.fillcolor)}),x.selectAll(".lines").each(function(){var v=y.connector.line;g.lineGroupStyle(c.select(this).selectAll("path"),v.width,v.color,v.dash)})})}$.exports={style:a}}),DR=Ft((Q,$)=>{var c=li().opacity,g=Y_().hoverOnBars,P=bn().formatPercent;$.exports=function(t,e,r,a,n){var o=g(t,e,r,a,n);if(o){var i=o.cd,s=i[0].trace,f=s.orientation==="h",x=o.index,y=i[x],v=f?"x":"y";o[v+"LabelVal"]=y.s,o.percentInitial=y.begR,o.percentInitialLabel=P(y.begR,1),o.percentPrevious=y.difR,o.percentPreviousLabel=P(y.difR,1),o.percentTotal=y.sumR,o.percentTotalLabel=P(y.sumR,1);var T=y.hi||s.hoverinfo,u=[];if(T&&T!=="none"&&T!=="skip"){var b=T==="all",_=T.split("+"),C=function(M){return b||_.indexOf(M)!==-1};C("percent initial")&&u.push(o.percentInitialLabel+" of initial"),C("percent previous")&&u.push(o.percentPreviousLabel+" of previous"),C("percent total")&&u.push(o.percentTotalLabel+" of total")}return o.extraText=u.join("<br>"),o.color=S(s,y),[o]}};function S(t,e){var r=t.marker,a=e.mc||r.color,n=e.mlc||r.line.color,o=e.mlw||r.line.width;if(c(a))return a;if(c(n)&&o)return n}}),FR=Ft((Q,$)=>{$.exports=function(c,g){return c.x="xVal"in g?g.xVal:g.x,c.y="yVal"in g?g.yVal:g.y,"percentInitial"in g&&(c.percentInitial=g.percentInitial),"percentPrevious"in g&&(c.percentPrevious=g.percentPrevious),"percentTotal"in g&&(c.percentTotal=g.percentTotal),g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),c}}),RR=Ft((Q,$)=>{$.exports={attributes:h7(),layoutAttributes:f7(),supplyDefaults:d7().supplyDefaults,crossTraceDefaults:d7().crossTraceDefaults,supplyLayoutDefaults:CR(),calc:PR(),crossTraceCalc:zR(),plot:IR(),style:OR().style,hoverPoints:DR(),eventData:FR(),selectPoints:K_(),moduleType:"trace",name:"funnel",basePlotModule:Mf(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),BR=Ft((Q,$)=>{$.exports=RR()}),NR=Ft((Q,$)=>{$.exports={eventDataKeys:["initial","delta","final"]}}),p7=Ft((Q,$)=>{var c=Sg(),g=tf().line,P=$o(),S=fh().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=$u(),a=NR(),n=Ta().extendFlat,o=li();function i(s){return{marker:{color:n({},c.marker.color,{arrayOk:!1,editType:"style"}),line:{color:n({},c.marker.line.color,{arrayOk:!1,editType:"style"}),width:n({},c.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}$.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:c.x,x0:c.x0,dx:c.dx,y:c.y,y0:c.y0,dy:c.dy,xperiod:c.xperiod,yperiod:c.yperiod,xperiod0:c.xperiod0,yperiod0:c.yperiod0,xperiodalignment:c.xperiodalignment,yperiodalignment:c.yperiodalignment,xhoverformat:S("x"),yhoverformat:S("y"),hovertext:c.hovertext,hovertemplate:t({},{keys:a.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:n({},P.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:a.eventDataKeys.concat(["label"])}),texttemplatefallback:r({editType:"plot"}),text:c.text,textposition:c.textposition,insidetextanchor:c.insidetextanchor,textangle:c.textangle,textfont:c.textfont,insidetextfont:c.insidetextfont,outsidetextfont:c.outsidetextfont,constraintext:c.constraintext,cliponaxis:c.cliponaxis,orientation:c.orientation,offset:c.offset,width:c.width,increasing:i(),decreasing:i(),totals:i(),connector:{line:{color:n({},g.color,{dflt:o.defaultLine}),width:n({},g.width,{editType:"plot"}),dash:g.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:c.offsetgroup,alignmentgroup:c.alignmentgroup,zorder:c.zorder}}),m7=Ft((Q,$)=>{$.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"}}}),J_=Ft((Q,$)=>{$.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}),g7=Ft((Q,$)=>{var c=bn(),g=Mg(),P=J0().handleText,S=Nm(),t=Fp(),e=p7(),r=li(),a=J_(),n=a.INCREASING.COLOR,o=a.DECREASING.COLOR,i="#4499FF";function s(y,v,T){y(v+".marker.color",T),y(v+".marker.line.color",r.defaultLine),y(v+".marker.line.width")}function f(y,v,T,u){function b(A,h){return c.coerce(y,v,e,A,h)}var _=S(y,v,u,b);if(!_){v.visible=!1;return}t(y,v,u,b),b("xhoverformat"),b("yhoverformat"),b("measure"),b("orientation",v.x&&!v.y?"h":"v"),b("base"),b("offset"),b("width"),b("text"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback");var C=b("textposition");P(y,v,u,b,C,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),v.textposition!=="none"&&(b("texttemplate"),b("texttemplatefallback"),v.texttemplate||b("textinfo")),s(b,"increasing",n),s(b,"decreasing",o),s(b,"totals",i);var M=b("connector.visible");if(M){b("connector.mode");var E=b("connector.line.width");E&&(b("connector.line.color"),b("connector.line.dash"))}b("zorder")}function x(y,v){var T,u;function b(C){return c.coerce(u._input,u,e,C)}if(v.waterfallmode==="group")for(var _=0;_<y.length;_++)u=y[_],T=u._input,g(T,u,v,b,v.waterfallmode)}$.exports={supplyDefaults:f,crossTraceDefaults:x}}),jR=Ft((Q,$)=>{var c=bn(),g=m7();$.exports=function(P,S,t){var e=!1;function r(o,i){return c.coerce(P,S,g,o,i)}for(var a=0;a<t.length;a++){var n=t[a];if(n.visible&&n.type==="waterfall"){e=!0;break}}e&&(r("waterfallmode"),r("waterfallgap",.2),r("waterfallgroupgap"))}}),UR=Ft((Q,$)=>{var c=Es(),g=D0(),P=bn().mergeArray,S=Bt(),t=Da().BADNUM;function e(a){return a==="a"||a==="absolute"}function r(a){return a==="t"||a==="total"}$.exports=function(a,n){var o=c.getFromId(a,n.xaxis||"x"),i=c.getFromId(a,n.yaxis||"y"),s,f,x,y,v,T;n.orientation==="h"?(s=o.makeCalcdata(n,"x"),x=i.makeCalcdata(n,"y"),y=g(n,i,"y",x),v=!!n.yperiodalignment,T="y"):(s=i.makeCalcdata(n,"y"),x=o.makeCalcdata(n,"x"),y=g(n,o,"x",x),v=!!n.xperiodalignment,T="x"),f=y.vals;for(var u=Math.min(f.length,s.length),b=new Array(u),_=0,C,M=!1,E=0;E<u;E++){var A=s[E]||0,h=!1;(s[E]!==t||r(n.measure[E])||e(n.measure[E]))&&E+1<u&&(s[E+1]!==t||r(n.measure[E+1])||e(n.measure[E+1]))&&(h=!0);var p=b[E]={i:E,p:f[E],s:A,rawS:A,cNext:h};e(n.measure[E])?(_=p.s,p.isSum=!0,p.dir="totals",p.s=_):r(n.measure[E])?(p.isSum=!0,p.dir="totals",p.s=_):(p.isSum=!1,p.dir=p.rawS<0?"decreasing":"increasing",C=p.s,p.s=_+C,_+=C),p.dir==="totals"&&(M=!0),v&&(b[E].orig_p=x[E],b[E][T+"End"]=y.ends[E],b[E][T+"Start"]=y.starts[E]),n.ids&&(p.id=String(n.ids[E])),p.v=(n.base||0)+_}return b.length&&(b[0].hasTotals=M),P(n.text,b,"tx"),P(n.hovertext,b,"htx"),S(b,n),b}}),VR=Ft((Q,$)=>{var c=Pr().setGroupPositions;$.exports=function(g,P){var S=g._fullLayout,t=g._fullData,e=g.calcdata,r=P.xaxis,a=P.yaxis,n=[],o=[],i=[],s,f;for(f=0;f<t.length;f++){var x=t[f];x.visible===!0&&x.xaxis===r._id&&x.yaxis===a._id&&x.type==="waterfall"&&(s=e[f],x.orientation==="h"?i.push(s):o.push(s),n.push(s))}var y={mode:S.waterfallmode,norm:S.waterfallnorm,gap:S.waterfallgap,groupgap:S.waterfallgroupgap};for(c(g,r,a,o,y),c(g,a,r,i,y),f=0;f<n.length;f++){s=n[f];for(var v=0;v<s.length;v++){var T=s[v];T.isSum===!1&&(T.s0+=v===0?0:s[v-1].s),v+1<s.length&&(s[v].nextP0=s[v+1].p0,s[v].nextS0=s[v+1].s0)}}}}),HR=Ft((Q,$)=>{var c=un(),g=bn(),P=js(),S=Da().BADNUM,t=Qy(),e=Rp().clearMinTextSize;$.exports=function(n,o,i,s){var f=n._fullLayout;e("waterfall",f),t.plot(n,o,i,s,{mode:f.waterfallmode,norm:f.waterfallmode,gap:f.waterfallgap,groupgap:f.waterfallgroupgap}),r(n,o,i,s)};function r(n,o,i,s){var f=o.xaxis,x=o.yaxis;g.makeTraceGroups(s,i,"trace bars").each(function(y){var v=c.select(this),T=y[0].trace,u=g.ensureSingle(v,"g","lines");if(!T.connector||!T.connector.visible){u.remove();return}var b=T.orientation==="h",_=T.connector.mode,C=u.selectAll("g.line").data(g.identity);C.enter().append("g").classed("line",!0),C.exit().remove();var M=C.size();C.each(function(E,A){if(!(A!==M-1&&!E.cNext)){var h=a(E,f,x,b),p=h[0],k=h[1],w="";p[0]!==S&&k[0]!==S&&p[1]!==S&&k[1]!==S&&(_==="spanning"&&!E.isSum&&A>0&&(b?w+="M"+p[0]+","+k[1]+"V"+k[0]:w+="M"+p[1]+","+k[0]+"H"+p[0]),_!=="between"&&(E.isSum||A<M-1)&&(b?w+="M"+p[1]+","+k[0]+"V"+k[1]:w+="M"+p[0]+","+k[1]+"H"+p[1]),p[2]!==S&&k[2]!==S&&(b?w+="M"+p[1]+","+k[1]+"V"+k[2]:w+="M"+p[1]+","+k[1]+"H"+p[2])),w===""&&(w="M0,0Z"),g.ensureSingle(c.select(this),"path").attr("d",w).call(P.setClipUrl,o.layerClipId,n)}})})}function a(n,o,i,s){var f=[],x=[],y=s?o:i,v=s?i:o;return f[0]=y.c2p(n.s0,!0),x[0]=v.c2p(n.p0,!0),f[1]=y.c2p(n.s1,!0),x[1]=v.c2p(n.p1,!0),f[2]=y.c2p(n.nextS0,!0),x[2]=v.c2p(n.nextP0,!0),s?[f,x]:[x,f]}}),WR=Ft((Q,$)=>{var c=un(),g=js(),P=li(),S=co().DESELECTDIM,t=xm(),e=Rp().resizeText,r=t.styleTextPoints;function a(n,o,i){var s=i||c.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 x=c.select(this),y=f[0].trace;x.selectAll(".point > path").each(function(v){if(!v.isBlank){var T=y[v.dir].marker;c.select(this).call(P.fill,T.color).call(P.stroke,T.line.color).call(g.dashLine,T.line.dash,T.line.width).style("opacity",y.selectedpoints&&!v.selected?S:1)}}),r(x,y,n),x.selectAll(".lines").each(function(){var v=y.connector.line;g.lineGroupStyle(c.select(this).selectAll("path"),v.width,v.color,v.dash)})})}$.exports={style:a}}),qR=Ft((Q,$)=>{var c=Es().hoverLabelText,g=li().opacity,P=Y_().hoverOnBars,S=J_(),t={increasing:S.INCREASING.SYMBOL,decreasing:S.DECREASING.SYMBOL};$.exports=function(r,a,n,o,i){var s=P(r,a,n,o,i);if(!s)return;var f=s.cd,x=f[0].trace,y=x.orientation==="h",v=y?"x":"y",T=y?r.xa:r.ya;function u(w){return c(T,w,x[v+"hoverformat"])}var b=s.index,_=f[b],C=_.isSum?_.b+_.s:_.rawS;s.initial=_.b+_.s-C,s.delta=C,s.final=s.initial+s.delta;var M=u(Math.abs(s.delta));s.deltaLabel=C<0?"("+M+")":M,s.finalLabel=u(s.final),s.initialLabel=u(s.initial);var E=_.hi||x.hoverinfo,A=[];if(E&&E!=="none"&&E!=="skip"){var h=E==="all",p=E.split("+"),k=function(w){return h||p.indexOf(w)!==-1};_.isSum||(k("final")&&(y?!k("x"):!k("y"))&&A.push(s.finalLabel),k("delta")&&(C<0?A.push(s.deltaLabel+" "+t.decreasing):A.push(s.deltaLabel+" "+t.increasing)),k("initial")&&A.push("Initial: "+s.initialLabel))}return A.length&&(s.extraText=A.join("<br>")),s.color=e(x,_),[s]};function e(r,a){var n=r[a.dir].marker,o=n.color,i=n.line.color,s=n.line.width;if(g(o))return o;if(g(i)&&s)return i}}),ZR=Ft((Q,$)=>{$.exports=function(c,g){return c.x="xVal"in g?g.xVal:g.x,c.y="yVal"in g?g.yVal:g.y,"initial"in g&&(c.initial=g.initial),"delta"in g&&(c.delta=g.delta),"final"in g&&(c.final=g.final),g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),c}}),$R=Ft((Q,$)=>{$.exports={attributes:p7(),layoutAttributes:m7(),supplyDefaults:g7().supplyDefaults,crossTraceDefaults:g7().crossTraceDefaults,supplyLayoutDefaults:jR(),calc:UR(),crossTraceCalc:VR(),plot:HR(),style:WR().style,hoverPoints:qR(),eventData:ZR(),selectPoints:K_(),moduleType:"trace",name:"waterfall",basePlotModule:Mf(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),GR=Ft((Q,$)=>{$.exports=$R()}),Q_=Ft((Q,$)=>{$.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(c){return c.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(c){return c.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(c){return c.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(c){var g=c.slice(0,3);return g[1]=g[1]+"%",g[2]=g[2]+"%",g},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(c){var g=c.slice(0,4);return g[1]=g[1]+"%",g[2]=g[2]+"%",g},suffix:["°","%","%",""]}}}}),v7=Ft((Q,$)=>{var c=$o(),g=tf().zorder,{hovertemplateAttrs:P,templatefallbackAttrs:S}=$u(),t=Ta().extendFlat,e=Q_().colormodel,r=["rgb","rgba","rgba256","hsl","hsla"],a=[],n=[];for(i=0;i<r.length;i++)o=e[r[i]],a.push("For the `"+r[i]+"` colormodel, it is ["+(o.zminDflt||o.min).join(", ")+"]."),n.push("For the `"+r[i]+"` colormodel, it is ["+(o.zmaxDflt||o.max).join(", ")+"].");var o,i;$.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({},c.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:P({},{keys:["z","color","colormodel"]}),hovertemplatefallback:S(),zorder:g})}),YR=Ft((Q,$)=>{var c=bn(),g=v7(),P=Q_(),S=o0().IMAGE_URL_PREFIX;$.exports=function(t,e){function r(o,i){return c.coerce(t,e,g,o,i)}r("source"),e.source&&!e.source.match(S)&&delete e.source,e._hasSource=!!e.source;var a=r("z");if(e._hasZ=!(a===void 0||!a.length||!a[0]||!a[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=P.colormodel[e.colormodel],r("zmin",n.zminDflt||n.min),r("zmax",n.zmaxDflt||n.max)):e._hasSource&&(e.colormodel="rgba256",n=P.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")}}),_v=Ft((Q,$)=>{typeof Object.create=="function"?$.exports=function(c,g){g&&(c.super_=g,c.prototype=Object.create(g.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:$.exports=function(c,g){if(g){c.super_=g;var P=function(){};P.prototype=g.prototype,c.prototype=new P,c.prototype.constructor=c}}}),y7=Ft((Q,$)=>{$.exports=Im().EventEmitter}),KR=Ft(Q=>{Q.byteLength=r,Q.toByteArray=n,Q.fromByteArray=s;var $=[],c=[],g=typeof Uint8Array<"u"?Uint8Array:Array,P="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(S=0,t=P.length;S<t;++S)$[S]=P[S],c[P.charCodeAt(S)]=S;var S,t;c[45]=62,c[95]=63;function e(f){var x=f.length;if(x%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=f.indexOf("=");y===-1&&(y=x);var v=y===x?0:4-y%4;return[y,v]}function r(f){var x=e(f),y=x[0],v=x[1];return(y+v)*3/4-v}function a(f,x,y){return(x+y)*3/4-y}function n(f){var x,y=e(f),v=y[0],T=y[1],u=new g(a(f,v,T)),b=0,_=T>0?v-4:v,C;for(C=0;C<_;C+=4)x=c[f.charCodeAt(C)]<<18|c[f.charCodeAt(C+1)]<<12|c[f.charCodeAt(C+2)]<<6|c[f.charCodeAt(C+3)],u[b++]=x>>16&255,u[b++]=x>>8&255,u[b++]=x&255;return T===2&&(x=c[f.charCodeAt(C)]<<2|c[f.charCodeAt(C+1)]>>4,u[b++]=x&255),T===1&&(x=c[f.charCodeAt(C)]<<10|c[f.charCodeAt(C+1)]<<4|c[f.charCodeAt(C+2)]>>2,u[b++]=x>>8&255,u[b++]=x&255),u}function o(f){return $[f>>18&63]+$[f>>12&63]+$[f>>6&63]+$[f&63]}function i(f,x,y){for(var v,T=[],u=x;u<y;u+=3)v=(f[u]<<16&16711680)+(f[u+1]<<8&65280)+(f[u+2]&255),T.push(o(v));return T.join("")}function s(f){for(var x,y=f.length,v=y%3,T=[],u=16383,b=0,_=y-v;b<_;b+=u)T.push(i(f,b,b+u>_?_:b+u));return v===1?(x=f[y-1],T.push($[x>>2]+$[x<<4&63]+"==")):v===2&&(x=(f[y-2]<<8)+f[y-1],T.push($[x>>10]+$[x>>4&63]+$[x<<2&63]+"=")),T.join("")}}),XR=Ft(Q=>{Q.read=function($,c,g,P,S){var t,e,r=S*8-P-1,a=(1<<r)-1,n=a>>1,o=-7,i=g?S-1:0,s=g?-1:1,f=$[c+i];for(i+=s,t=f&(1<<-o)-1,f>>=-o,o+=r;o>0;t=t*256+$[c+i],i+=s,o-=8);for(e=t&(1<<-o)-1,t>>=-o,o+=P;o>0;e=e*256+$[c+i],i+=s,o-=8);if(t===0)t=1-n;else{if(t===a)return e?NaN:(f?-1:1)*(1/0);e=e+Math.pow(2,P),t=t-n}return(f?-1:1)*e*Math.pow(2,t-P)},Q.write=function($,c,g,P,S,t){var e,r,a,n=t*8-S-1,o=(1<<n)-1,i=o>>1,s=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=P?0:t-1,x=P?1:-1,y=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(r=isNaN(c)?1:0,e=o):(e=Math.floor(Math.log(c)/Math.LN2),c*(a=Math.pow(2,-e))<1&&(e--,a*=2),e+i>=1?c+=s/a:c+=s*Math.pow(2,1-i),c*a>=2&&(e++,a/=2),e+i>=o?(r=0,e=o):e+i>=1?(r=(c*a-1)*Math.pow(2,S),e=e+i):(r=c*Math.pow(2,i-1)*Math.pow(2,S),e=0));S>=8;$[g+f]=r&255,f+=x,r/=256,S-=8);for(e=e<<S|r,n+=S;n>0;$[g+f]=e&255,f+=x,e/=256,n-=8);$[g+f-x]|=y*128}}),tx=Ft(Q=>{var $=KR(),c=XR(),g=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Q.Buffer=e,Q.SlowBuffer=T,Q.INSPECT_MAX_BYTES=50;var P=2147483647;Q.kMaxLength=P,e.TYPED_ARRAY_SUPPORT=S(),!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 S(){try{let Tt=new Uint8Array(1),Lt={foo:function(){return 42}};return Object.setPrototypeOf(Lt,Uint8Array.prototype),Object.setPrototypeOf(Tt,Lt),Tt.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(Tt){if(Tt>P)throw new RangeError('The value "'+Tt+'" is invalid for option "size"');let Lt=new Uint8Array(Tt);return Object.setPrototypeOf(Lt,e.prototype),Lt}function e(Tt,Lt,Mt){if(typeof Tt=="number"){if(typeof Lt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return o(Tt)}return r(Tt,Lt,Mt)}e.poolSize=8192;function r(Tt,Lt,Mt){if(typeof Tt=="string")return i(Tt,Lt);if(ArrayBuffer.isView(Tt))return f(Tt);if(Tt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Tt);if(Jt(Tt,ArrayBuffer)||Tt&&Jt(Tt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Jt(Tt,SharedArrayBuffer)||Tt&&Jt(Tt.buffer,SharedArrayBuffer)))return x(Tt,Lt,Mt);if(typeof Tt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let te=Tt.valueOf&&Tt.valueOf();if(te!=null&&te!==Tt)return e.from(te,Lt,Mt);let ve=y(Tt);if(ve)return ve;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Tt[Symbol.toPrimitive]=="function")return e.from(Tt[Symbol.toPrimitive]("string"),Lt,Mt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Tt)}e.from=function(Tt,Lt,Mt){return r(Tt,Lt,Mt)},Object.setPrototypeOf(e.prototype,Uint8Array.prototype),Object.setPrototypeOf(e,Uint8Array);function a(Tt){if(typeof Tt!="number")throw new TypeError('"size" argument must be of type number');if(Tt<0)throw new RangeError('The value "'+Tt+'" is invalid for option "size"')}function n(Tt,Lt,Mt){return a(Tt),Tt<=0?t(Tt):Lt!==void 0?typeof Mt=="string"?t(Tt).fill(Lt,Mt):t(Tt).fill(Lt):t(Tt)}e.alloc=function(Tt,Lt,Mt){return n(Tt,Lt,Mt)};function o(Tt){return a(Tt),t(Tt<0?0:v(Tt)|0)}e.allocUnsafe=function(Tt){return o(Tt)},e.allocUnsafeSlow=function(Tt){return o(Tt)};function i(Tt,Lt){if((typeof Lt!="string"||Lt==="")&&(Lt="utf8"),!e.isEncoding(Lt))throw new TypeError("Unknown encoding: "+Lt);let Mt=u(Tt,Lt)|0,te=t(Mt),ve=te.write(Tt,Lt);return ve!==Mt&&(te=te.slice(0,ve)),te}function s(Tt){let Lt=Tt.length<0?0:v(Tt.length)|0,Mt=t(Lt);for(let te=0;te<Lt;te+=1)Mt[te]=Tt[te]&255;return Mt}function f(Tt){if(Jt(Tt,Uint8Array)){let Lt=new Uint8Array(Tt);return x(Lt.buffer,Lt.byteOffset,Lt.byteLength)}return s(Tt)}function x(Tt,Lt,Mt){if(Lt<0||Tt.byteLength<Lt)throw new RangeError('"offset" is outside of buffer bounds');if(Tt.byteLength<Lt+(Mt||0))throw new RangeError('"length" is outside of buffer bounds');let te;return Lt===void 0&&Mt===void 0?te=new Uint8Array(Tt):Mt===void 0?te=new Uint8Array(Tt,Lt):te=new Uint8Array(Tt,Lt,Mt),Object.setPrototypeOf(te,e.prototype),te}function y(Tt){if(e.isBuffer(Tt)){let Lt=v(Tt.length)|0,Mt=t(Lt);return Mt.length===0||Tt.copy(Mt,0,0,Lt),Mt}if(Tt.length!==void 0)return typeof Tt.length!="number"||ge(Tt.length)?t(0):s(Tt);if(Tt.type==="Buffer"&&Array.isArray(Tt.data))return s(Tt.data)}function v(Tt){if(Tt>=P)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P.toString(16)+" bytes");return Tt|0}function T(Tt){return+Tt!=Tt&&(Tt=0),e.alloc(+Tt)}e.isBuffer=function(Tt){return Tt!=null&&Tt._isBuffer===!0&&Tt!==e.prototype},e.compare=function(Tt,Lt){if(Jt(Tt,Uint8Array)&&(Tt=e.from(Tt,Tt.offset,Tt.byteLength)),Jt(Lt,Uint8Array)&&(Lt=e.from(Lt,Lt.offset,Lt.byteLength)),!e.isBuffer(Tt)||!e.isBuffer(Lt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Tt===Lt)return 0;let Mt=Tt.length,te=Lt.length;for(let ve=0,oe=Math.min(Mt,te);ve<oe;++ve)if(Tt[ve]!==Lt[ve]){Mt=Tt[ve],te=Lt[ve];break}return Mt<te?-1:te<Mt?1:0},e.isEncoding=function(Tt){switch(String(Tt).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(Tt,Lt){if(!Array.isArray(Tt))throw new TypeError('"list" argument must be an Array of Buffers');if(Tt.length===0)return e.alloc(0);let Mt;if(Lt===void 0)for(Lt=0,Mt=0;Mt<Tt.length;++Mt)Lt+=Tt[Mt].length;let te=e.allocUnsafe(Lt),ve=0;for(Mt=0;Mt<Tt.length;++Mt){let oe=Tt[Mt];if(Jt(oe,Uint8Array))ve+oe.length>te.length?(e.isBuffer(oe)||(oe=e.from(oe)),oe.copy(te,ve)):Uint8Array.prototype.set.call(te,oe,ve);else if(e.isBuffer(oe))oe.copy(te,ve);else throw new TypeError('"list" argument must be an Array of Buffers');ve+=oe.length}return te};function u(Tt,Lt){if(e.isBuffer(Tt))return Tt.length;if(ArrayBuffer.isView(Tt)||Jt(Tt,ArrayBuffer))return Tt.byteLength;if(typeof Tt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Tt);let Mt=Tt.length,te=arguments.length>2&&arguments[2]===!0;if(!te&&Mt===0)return 0;let ve=!1;for(;;)switch(Lt){case"ascii":case"latin1":case"binary":return Mt;case"utf8":case"utf-8":return wt(Tt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mt*2;case"hex":return Mt>>>1;case"base64":return Wt(Tt).length;default:if(ve)return te?-1:wt(Tt).length;Lt=(""+Lt).toLowerCase(),ve=!0}}e.byteLength=u;function b(Tt,Lt,Mt){let te=!1;if((Lt===void 0||Lt<0)&&(Lt=0),Lt>this.length||((Mt===void 0||Mt>this.length)&&(Mt=this.length),Mt<=0)||(Mt>>>=0,Lt>>>=0,Mt<=Lt))return"";for(Tt||(Tt="utf8");;)switch(Tt){case"hex":return F(this,Lt,Mt);case"utf8":case"utf-8":return R(this,Lt,Mt);case"ascii":return V(this,Lt,Mt);case"latin1":case"binary":return H(this,Lt,Mt);case"base64":return w(this,Lt,Mt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,Lt,Mt);default:if(te)throw new TypeError("Unknown encoding: "+Tt);Tt=(Tt+"").toLowerCase(),te=!0}}e.prototype._isBuffer=!0;function _(Tt,Lt,Mt){let te=Tt[Lt];Tt[Lt]=Tt[Mt],Tt[Mt]=te}e.prototype.swap16=function(){let Tt=this.length;if(Tt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Lt=0;Lt<Tt;Lt+=2)_(this,Lt,Lt+1);return this},e.prototype.swap32=function(){let Tt=this.length;if(Tt%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Lt=0;Lt<Tt;Lt+=4)_(this,Lt,Lt+3),_(this,Lt+1,Lt+2);return this},e.prototype.swap64=function(){let Tt=this.length;if(Tt%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Lt=0;Lt<Tt;Lt+=8)_(this,Lt,Lt+7),_(this,Lt+1,Lt+6),_(this,Lt+2,Lt+5),_(this,Lt+3,Lt+4);return this},e.prototype.toString=function(){let Tt=this.length;return Tt===0?"":arguments.length===0?R(this,0,Tt):b.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(Tt){if(!e.isBuffer(Tt))throw new TypeError("Argument must be a Buffer");return this===Tt?!0:e.compare(this,Tt)===0},e.prototype.inspect=function(){let Tt="",Lt=Q.INSPECT_MAX_BYTES;return Tt=this.toString("hex",0,Lt).replace(/(.{2})/g,"$1 ").trim(),this.length>Lt&&(Tt+=" ... "),"<Buffer "+Tt+">"},g&&(e.prototype[g]=e.prototype.inspect),e.prototype.compare=function(Tt,Lt,Mt,te,ve){if(Jt(Tt,Uint8Array)&&(Tt=e.from(Tt,Tt.offset,Tt.byteLength)),!e.isBuffer(Tt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Tt);if(Lt===void 0&&(Lt=0),Mt===void 0&&(Mt=Tt?Tt.length:0),te===void 0&&(te=0),ve===void 0&&(ve=this.length),Lt<0||Mt>Tt.length||te<0||ve>this.length)throw new RangeError("out of range index");if(te>=ve&&Lt>=Mt)return 0;if(te>=ve)return-1;if(Lt>=Mt)return 1;if(Lt>>>=0,Mt>>>=0,te>>>=0,ve>>>=0,this===Tt)return 0;let oe=ve-te,Te=Mt-Lt,He=Math.min(oe,Te),Ge=this.slice(te,ve),cr=Tt.slice(Lt,Mt);for(let ur=0;ur<He;++ur)if(Ge[ur]!==cr[ur]){oe=Ge[ur],Te=cr[ur];break}return oe<Te?-1:Te<oe?1:0};function C(Tt,Lt,Mt,te,ve){if(Tt.length===0)return-1;if(typeof Mt=="string"?(te=Mt,Mt=0):Mt>2147483647?Mt=2147483647:Mt<-2147483648&&(Mt=-2147483648),Mt=+Mt,ge(Mt)&&(Mt=ve?0:Tt.length-1),Mt<0&&(Mt=Tt.length+Mt),Mt>=Tt.length){if(ve)return-1;Mt=Tt.length-1}else if(Mt<0)if(ve)Mt=0;else return-1;if(typeof Lt=="string"&&(Lt=e.from(Lt,te)),e.isBuffer(Lt))return Lt.length===0?-1:M(Tt,Lt,Mt,te,ve);if(typeof Lt=="number")return Lt=Lt&255,typeof Uint8Array.prototype.indexOf=="function"?ve?Uint8Array.prototype.indexOf.call(Tt,Lt,Mt):Uint8Array.prototype.lastIndexOf.call(Tt,Lt,Mt):M(Tt,[Lt],Mt,te,ve);throw new TypeError("val must be string, number or Buffer")}function M(Tt,Lt,Mt,te,ve){let oe=1,Te=Tt.length,He=Lt.length;if(te!==void 0&&(te=String(te).toLowerCase(),te==="ucs2"||te==="ucs-2"||te==="utf16le"||te==="utf-16le")){if(Tt.length<2||Lt.length<2)return-1;oe=2,Te/=2,He/=2,Mt/=2}function Ge(ur,jr){return oe===1?ur[jr]:ur.readUInt16BE(jr*oe)}let cr;if(ve){let ur=-1;for(cr=Mt;cr<Te;cr++)if(Ge(Tt,cr)===Ge(Lt,ur===-1?0:cr-ur)){if(ur===-1&&(ur=cr),cr-ur+1===He)return ur*oe}else ur!==-1&&(cr-=cr-ur),ur=-1}else for(Mt+He>Te&&(Mt=Te-He),cr=Mt;cr>=0;cr--){let ur=!0;for(let jr=0;jr<He;jr++)if(Ge(Tt,cr+jr)!==Ge(Lt,jr)){ur=!1;break}if(ur)return cr}return-1}e.prototype.includes=function(Tt,Lt,Mt){return this.indexOf(Tt,Lt,Mt)!==-1},e.prototype.indexOf=function(Tt,Lt,Mt){return C(this,Tt,Lt,Mt,!0)},e.prototype.lastIndexOf=function(Tt,Lt,Mt){return C(this,Tt,Lt,Mt,!1)};function E(Tt,Lt,Mt,te){Mt=Number(Mt)||0;let ve=Tt.length-Mt;te?(te=Number(te),te>ve&&(te=ve)):te=ve;let oe=Lt.length;te>oe/2&&(te=oe/2);let Te;for(Te=0;Te<te;++Te){let He=parseInt(Lt.substr(Te*2,2),16);if(ge(He))return Te;Tt[Mt+Te]=He}return Te}function A(Tt,Lt,Mt,te){return Ht(wt(Lt,Tt.length-Mt),Tt,Mt,te)}function h(Tt,Lt,Mt,te){return Ht(zt(Lt),Tt,Mt,te)}function p(Tt,Lt,Mt,te){return Ht(Wt(Lt),Tt,Mt,te)}function k(Tt,Lt,Mt,te){return Ht(Pt(Lt,Tt.length-Mt),Tt,Mt,te)}e.prototype.write=function(Tt,Lt,Mt,te){if(Lt===void 0)te="utf8",Mt=this.length,Lt=0;else if(Mt===void 0&&typeof Lt=="string")te=Lt,Mt=this.length,Lt=0;else if(isFinite(Lt))Lt=Lt>>>0,isFinite(Mt)?(Mt=Mt>>>0,te===void 0&&(te="utf8")):(te=Mt,Mt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let ve=this.length-Lt;if((Mt===void 0||Mt>ve)&&(Mt=ve),Tt.length>0&&(Mt<0||Lt<0)||Lt>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let oe=!1;for(;;)switch(te){case"hex":return E(this,Tt,Lt,Mt);case"utf8":case"utf-8":return A(this,Tt,Lt,Mt);case"ascii":case"latin1":case"binary":return h(this,Tt,Lt,Mt);case"base64":return p(this,Tt,Lt,Mt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,Tt,Lt,Mt);default:if(oe)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),oe=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function w(Tt,Lt,Mt){return Lt===0&&Mt===Tt.length?$.fromByteArray(Tt):$.fromByteArray(Tt.slice(Lt,Mt))}function R(Tt,Lt,Mt){Mt=Math.min(Tt.length,Mt);let te=[],ve=Lt;for(;ve<Mt;){let oe=Tt[ve],Te=null,He=oe>239?4:oe>223?3:oe>191?2:1;if(ve+He<=Mt){let Ge,cr,ur,jr;switch(He){case 1:oe<128&&(Te=oe);break;case 2:Ge=Tt[ve+1],(Ge&192)===128&&(jr=(oe&31)<<6|Ge&63,jr>127&&(Te=jr));break;case 3:Ge=Tt[ve+1],cr=Tt[ve+2],(Ge&192)===128&&(cr&192)===128&&(jr=(oe&15)<<12|(Ge&63)<<6|cr&63,jr>2047&&(jr<55296||jr>57343)&&(Te=jr));break;case 4:Ge=Tt[ve+1],cr=Tt[ve+2],ur=Tt[ve+3],(Ge&192)===128&&(cr&192)===128&&(ur&192)===128&&(jr=(oe&15)<<18|(Ge&63)<<12|(cr&63)<<6|ur&63,jr>65535&&jr<1114112&&(Te=jr))}}Te===null?(Te=65533,He=1):Te>65535&&(Te-=65536,te.push(Te>>>10&1023|55296),Te=56320|Te&1023),te.push(Te),ve+=He}return N(te)}var O=4096;function N(Tt){let Lt=Tt.length;if(Lt<=O)return String.fromCharCode.apply(String,Tt);let Mt="",te=0;for(;te<Lt;)Mt+=String.fromCharCode.apply(String,Tt.slice(te,te+=O));return Mt}function V(Tt,Lt,Mt){let te="";Mt=Math.min(Tt.length,Mt);for(let ve=Lt;ve<Mt;++ve)te+=String.fromCharCode(Tt[ve]&127);return te}function H(Tt,Lt,Mt){let te="";Mt=Math.min(Tt.length,Mt);for(let ve=Lt;ve<Mt;++ve)te+=String.fromCharCode(Tt[ve]);return te}function F(Tt,Lt,Mt){let te=Tt.length;(!Lt||Lt<0)&&(Lt=0),(!Mt||Mt<0||Mt>te)&&(Mt=te);let ve="";for(let oe=Lt;oe<Mt;++oe)ve+=he[Tt[oe]];return ve}function U(Tt,Lt,Mt){let te=Tt.slice(Lt,Mt),ve="";for(let oe=0;oe<te.length-1;oe+=2)ve+=String.fromCharCode(te[oe]+te[oe+1]*256);return ve}e.prototype.slice=function(Tt,Lt){let Mt=this.length;Tt=~~Tt,Lt=Lt===void 0?Mt:~~Lt,Tt<0?(Tt+=Mt,Tt<0&&(Tt=0)):Tt>Mt&&(Tt=Mt),Lt<0?(Lt+=Mt,Lt<0&&(Lt=0)):Lt>Mt&&(Lt=Mt),Lt<Tt&&(Lt=Tt);let te=this.subarray(Tt,Lt);return Object.setPrototypeOf(te,e.prototype),te};function W(Tt,Lt,Mt){if(Tt%1!==0||Tt<0)throw new RangeError("offset is not uint");if(Tt+Lt>Mt)throw new RangeError("Trying to access beyond buffer length")}e.prototype.readUintLE=e.prototype.readUIntLE=function(Tt,Lt,Mt){Tt=Tt>>>0,Lt=Lt>>>0,Mt||W(Tt,Lt,this.length);let te=this[Tt],ve=1,oe=0;for(;++oe<Lt&&(ve*=256);)te+=this[Tt+oe]*ve;return te},e.prototype.readUintBE=e.prototype.readUIntBE=function(Tt,Lt,Mt){Tt=Tt>>>0,Lt=Lt>>>0,Mt||W(Tt,Lt,this.length);let te=this[Tt+--Lt],ve=1;for(;Lt>0&&(ve*=256);)te+=this[Tt+--Lt]*ve;return te},e.prototype.readUint8=e.prototype.readUInt8=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,1,this.length),this[Tt]},e.prototype.readUint16LE=e.prototype.readUInt16LE=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,2,this.length),this[Tt]|this[Tt+1]<<8},e.prototype.readUint16BE=e.prototype.readUInt16BE=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,2,this.length),this[Tt]<<8|this[Tt+1]},e.prototype.readUint32LE=e.prototype.readUInt32LE=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,4,this.length),(this[Tt]|this[Tt+1]<<8|this[Tt+2]<<16)+this[Tt+3]*16777216},e.prototype.readUint32BE=e.prototype.readUInt32BE=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,4,this.length),this[Tt]*16777216+(this[Tt+1]<<16|this[Tt+2]<<8|this[Tt+3])},e.prototype.readBigUInt64LE=de(function(Tt){Tt=Tt>>>0,it(Tt,"offset");let Lt=this[Tt],Mt=this[Tt+7];(Lt===void 0||Mt===void 0)&&Y(Tt,this.length-8);let te=Lt+this[++Tt]*2**8+this[++Tt]*2**16+this[++Tt]*2**24,ve=this[++Tt]+this[++Tt]*2**8+this[++Tt]*2**16+Mt*2**24;return BigInt(te)+(BigInt(ve)<<BigInt(32))}),e.prototype.readBigUInt64BE=de(function(Tt){Tt=Tt>>>0,it(Tt,"offset");let Lt=this[Tt],Mt=this[Tt+7];(Lt===void 0||Mt===void 0)&&Y(Tt,this.length-8);let te=Lt*2**24+this[++Tt]*2**16+this[++Tt]*2**8+this[++Tt],ve=this[++Tt]*2**24+this[++Tt]*2**16+this[++Tt]*2**8+Mt;return(BigInt(te)<<BigInt(32))+BigInt(ve)}),e.prototype.readIntLE=function(Tt,Lt,Mt){Tt=Tt>>>0,Lt=Lt>>>0,Mt||W(Tt,Lt,this.length);let te=this[Tt],ve=1,oe=0;for(;++oe<Lt&&(ve*=256);)te+=this[Tt+oe]*ve;return ve*=128,te>=ve&&(te-=Math.pow(2,8*Lt)),te},e.prototype.readIntBE=function(Tt,Lt,Mt){Tt=Tt>>>0,Lt=Lt>>>0,Mt||W(Tt,Lt,this.length);let te=Lt,ve=1,oe=this[Tt+--te];for(;te>0&&(ve*=256);)oe+=this[Tt+--te]*ve;return ve*=128,oe>=ve&&(oe-=Math.pow(2,8*Lt)),oe},e.prototype.readInt8=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,1,this.length),this[Tt]&128?(255-this[Tt]+1)*-1:this[Tt]},e.prototype.readInt16LE=function(Tt,Lt){Tt=Tt>>>0,Lt||W(Tt,2,this.length);let Mt=this[Tt]|this[Tt+1]<<8;return Mt&32768?Mt|4294901760:Mt},e.prototype.readInt16BE=function(Tt,Lt){Tt=Tt>>>0,Lt||W(Tt,2,this.length);let Mt=this[Tt+1]|this[Tt]<<8;return Mt&32768?Mt|4294901760:Mt},e.prototype.readInt32LE=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,4,this.length),this[Tt]|this[Tt+1]<<8|this[Tt+2]<<16|this[Tt+3]<<24},e.prototype.readInt32BE=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,4,this.length),this[Tt]<<24|this[Tt+1]<<16|this[Tt+2]<<8|this[Tt+3]},e.prototype.readBigInt64LE=de(function(Tt){Tt=Tt>>>0,it(Tt,"offset");let Lt=this[Tt],Mt=this[Tt+7];(Lt===void 0||Mt===void 0)&&Y(Tt,this.length-8);let te=this[Tt+4]+this[Tt+5]*2**8+this[Tt+6]*2**16+(Mt<<24);return(BigInt(te)<<BigInt(32))+BigInt(Lt+this[++Tt]*2**8+this[++Tt]*2**16+this[++Tt]*2**24)}),e.prototype.readBigInt64BE=de(function(Tt){Tt=Tt>>>0,it(Tt,"offset");let Lt=this[Tt],Mt=this[Tt+7];(Lt===void 0||Mt===void 0)&&Y(Tt,this.length-8);let te=(Lt<<24)+this[++Tt]*2**16+this[++Tt]*2**8+this[++Tt];return(BigInt(te)<<BigInt(32))+BigInt(this[++Tt]*2**24+this[++Tt]*2**16+this[++Tt]*2**8+Mt)}),e.prototype.readFloatLE=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,4,this.length),c.read(this,Tt,!0,23,4)},e.prototype.readFloatBE=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,4,this.length),c.read(this,Tt,!1,23,4)},e.prototype.readDoubleLE=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,8,this.length),c.read(this,Tt,!0,52,8)},e.prototype.readDoubleBE=function(Tt,Lt){return Tt=Tt>>>0,Lt||W(Tt,8,this.length),c.read(this,Tt,!1,52,8)};function q(Tt,Lt,Mt,te,ve,oe){if(!e.isBuffer(Tt))throw new TypeError('"buffer" argument must be a Buffer instance');if(Lt>ve||Lt<oe)throw new RangeError('"value" argument is out of bounds');if(Mt+te>Tt.length)throw new RangeError("Index out of range")}e.prototype.writeUintLE=e.prototype.writeUIntLE=function(Tt,Lt,Mt,te){if(Tt=+Tt,Lt=Lt>>>0,Mt=Mt>>>0,!te){let Te=Math.pow(2,8*Mt)-1;q(this,Tt,Lt,Mt,Te,0)}let ve=1,oe=0;for(this[Lt]=Tt&255;++oe<Mt&&(ve*=256);)this[Lt+oe]=Tt/ve&255;return Lt+Mt},e.prototype.writeUintBE=e.prototype.writeUIntBE=function(Tt,Lt,Mt,te){if(Tt=+Tt,Lt=Lt>>>0,Mt=Mt>>>0,!te){let Te=Math.pow(2,8*Mt)-1;q(this,Tt,Lt,Mt,Te,0)}let ve=Mt-1,oe=1;for(this[Lt+ve]=Tt&255;--ve>=0&&(oe*=256);)this[Lt+ve]=Tt/oe&255;return Lt+Mt},e.prototype.writeUint8=e.prototype.writeUInt8=function(Tt,Lt,Mt){return Tt=+Tt,Lt=Lt>>>0,Mt||q(this,Tt,Lt,1,255,0),this[Lt]=Tt&255,Lt+1},e.prototype.writeUint16LE=e.prototype.writeUInt16LE=function(Tt,Lt,Mt){return Tt=+Tt,Lt=Lt>>>0,Mt||q(this,Tt,Lt,2,65535,0),this[Lt]=Tt&255,this[Lt+1]=Tt>>>8,Lt+2},e.prototype.writeUint16BE=e.prototype.writeUInt16BE=function(Tt,Lt,Mt){return Tt=+Tt,Lt=Lt>>>0,Mt||q(this,Tt,Lt,2,65535,0),this[Lt]=Tt>>>8,this[Lt+1]=Tt&255,Lt+2},e.prototype.writeUint32LE=e.prototype.writeUInt32LE=function(Tt,Lt,Mt){return Tt=+Tt,Lt=Lt>>>0,Mt||q(this,Tt,Lt,4,4294967295,0),this[Lt+3]=Tt>>>24,this[Lt+2]=Tt>>>16,this[Lt+1]=Tt>>>8,this[Lt]=Tt&255,Lt+4},e.prototype.writeUint32BE=e.prototype.writeUInt32BE=function(Tt,Lt,Mt){return Tt=+Tt,Lt=Lt>>>0,Mt||q(this,Tt,Lt,4,4294967295,0),this[Lt]=Tt>>>24,this[Lt+1]=Tt>>>16,this[Lt+2]=Tt>>>8,this[Lt+3]=Tt&255,Lt+4};function X(Tt,Lt,Mt,te,ve){vt(Lt,te,ve,Tt,Mt,7);let oe=Number(Lt&BigInt(4294967295));Tt[Mt++]=oe,oe=oe>>8,Tt[Mt++]=oe,oe=oe>>8,Tt[Mt++]=oe,oe=oe>>8,Tt[Mt++]=oe;let Te=Number(Lt>>BigInt(32)&BigInt(4294967295));return Tt[Mt++]=Te,Te=Te>>8,Tt[Mt++]=Te,Te=Te>>8,Tt[Mt++]=Te,Te=Te>>8,Tt[Mt++]=Te,Mt}function lt(Tt,Lt,Mt,te,ve){vt(Lt,te,ve,Tt,Mt,7);let oe=Number(Lt&BigInt(4294967295));Tt[Mt+7]=oe,oe=oe>>8,Tt[Mt+6]=oe,oe=oe>>8,Tt[Mt+5]=oe,oe=oe>>8,Tt[Mt+4]=oe;let Te=Number(Lt>>BigInt(32)&BigInt(4294967295));return Tt[Mt+3]=Te,Te=Te>>8,Tt[Mt+2]=Te,Te=Te>>8,Tt[Mt+1]=Te,Te=Te>>8,Tt[Mt]=Te,Mt+8}e.prototype.writeBigUInt64LE=de(function(Tt,Lt=0){return X(this,Tt,Lt,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeBigUInt64BE=de(function(Tt,Lt=0){return lt(this,Tt,Lt,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeIntLE=function(Tt,Lt,Mt,te){if(Tt=+Tt,Lt=Lt>>>0,!te){let He=Math.pow(2,8*Mt-1);q(this,Tt,Lt,Mt,He-1,-He)}let ve=0,oe=1,Te=0;for(this[Lt]=Tt&255;++ve<Mt&&(oe*=256);)Tt<0&&Te===0&&this[Lt+ve-1]!==0&&(Te=1),this[Lt+ve]=(Tt/oe>>0)-Te&255;return Lt+Mt},e.prototype.writeIntBE=function(Tt,Lt,Mt,te){if(Tt=+Tt,Lt=Lt>>>0,!te){let He=Math.pow(2,8*Mt-1);q(this,Tt,Lt,Mt,He-1,-He)}let ve=Mt-1,oe=1,Te=0;for(this[Lt+ve]=Tt&255;--ve>=0&&(oe*=256);)Tt<0&&Te===0&&this[Lt+ve+1]!==0&&(Te=1),this[Lt+ve]=(Tt/oe>>0)-Te&255;return Lt+Mt},e.prototype.writeInt8=function(Tt,Lt,Mt){return Tt=+Tt,Lt=Lt>>>0,Mt||q(this,Tt,Lt,1,127,-128),Tt<0&&(Tt=255+Tt+1),this[Lt]=Tt&255,Lt+1},e.prototype.writeInt16LE=function(Tt,Lt,Mt){return Tt=+Tt,Lt=Lt>>>0,Mt||q(this,Tt,Lt,2,32767,-32768),this[Lt]=Tt&255,this[Lt+1]=Tt>>>8,Lt+2},e.prototype.writeInt16BE=function(Tt,Lt,Mt){return Tt=+Tt,Lt=Lt>>>0,Mt||q(this,Tt,Lt,2,32767,-32768),this[Lt]=Tt>>>8,this[Lt+1]=Tt&255,Lt+2},e.prototype.writeInt32LE=function(Tt,Lt,Mt){return Tt=+Tt,Lt=Lt>>>0,Mt||q(this,Tt,Lt,4,2147483647,-2147483648),this[Lt]=Tt&255,this[Lt+1]=Tt>>>8,this[Lt+2]=Tt>>>16,this[Lt+3]=Tt>>>24,Lt+4},e.prototype.writeInt32BE=function(Tt,Lt,Mt){return Tt=+Tt,Lt=Lt>>>0,Mt||q(this,Tt,Lt,4,2147483647,-2147483648),Tt<0&&(Tt=4294967295+Tt+1),this[Lt]=Tt>>>24,this[Lt+1]=Tt>>>16,this[Lt+2]=Tt>>>8,this[Lt+3]=Tt&255,Lt+4},e.prototype.writeBigInt64LE=de(function(Tt,Lt=0){return X(this,Tt,Lt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeBigInt64BE=de(function(Tt,Lt=0){return lt(this,Tt,Lt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function yt(Tt,Lt,Mt,te,ve,oe){if(Mt+te>Tt.length)throw new RangeError("Index out of range");if(Mt<0)throw new RangeError("Index out of range")}function pt(Tt,Lt,Mt,te,ve){return Lt=+Lt,Mt=Mt>>>0,ve||yt(Tt,Lt,Mt,4),c.write(Tt,Lt,Mt,te,23,4),Mt+4}e.prototype.writeFloatLE=function(Tt,Lt,Mt){return pt(this,Tt,Lt,!0,Mt)},e.prototype.writeFloatBE=function(Tt,Lt,Mt){return pt(this,Tt,Lt,!1,Mt)};function st(Tt,Lt,Mt,te,ve){return Lt=+Lt,Mt=Mt>>>0,ve||yt(Tt,Lt,Mt,8),c.write(Tt,Lt,Mt,te,52,8),Mt+8}e.prototype.writeDoubleLE=function(Tt,Lt,Mt){return st(this,Tt,Lt,!0,Mt)},e.prototype.writeDoubleBE=function(Tt,Lt,Mt){return st(this,Tt,Lt,!1,Mt)},e.prototype.copy=function(Tt,Lt,Mt,te){if(!e.isBuffer(Tt))throw new TypeError("argument should be a Buffer");if(Mt||(Mt=0),!te&&te!==0&&(te=this.length),Lt>=Tt.length&&(Lt=Tt.length),Lt||(Lt=0),te>0&&te<Mt&&(te=Mt),te===Mt||Tt.length===0||this.length===0)return 0;if(Lt<0)throw new RangeError("targetStart out of bounds");if(Mt<0||Mt>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),Tt.length-Lt<te-Mt&&(te=Tt.length-Lt+Mt);let ve=te-Mt;return this===Tt&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Lt,Mt,te):Uint8Array.prototype.set.call(Tt,this.subarray(Mt,te),Lt),ve},e.prototype.fill=function(Tt,Lt,Mt,te){if(typeof Tt=="string"){if(typeof Lt=="string"?(te=Lt,Lt=0,Mt=this.length):typeof Mt=="string"&&(te=Mt,Mt=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!e.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(Tt.length===1){let oe=Tt.charCodeAt(0);(te==="utf8"&&oe<128||te==="latin1")&&(Tt=oe)}}else typeof Tt=="number"?Tt=Tt&255:typeof Tt=="boolean"&&(Tt=Number(Tt));if(Lt<0||this.length<Lt||this.length<Mt)throw new RangeError("Out of range index");if(Mt<=Lt)return this;Lt=Lt>>>0,Mt=Mt===void 0?this.length:Mt>>>0,Tt||(Tt=0);let ve;if(typeof Tt=="number")for(ve=Lt;ve<Mt;++ve)this[ve]=Tt;else{let oe=e.isBuffer(Tt)?Tt:e.from(Tt,te),Te=oe.length;if(Te===0)throw new TypeError('The value "'+Tt+'" is invalid for argument "value"');for(ve=0;ve<Mt-Lt;++ve)this[ve+Lt]=oe[ve%Te]}return this};var tt={};function dt(Tt,Lt,Mt){tt[Tt]=class extends Mt{constructor(){super(),Object.defineProperty(this,"message",{value:Lt.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Tt}]`,this.stack,delete this.name}get code(){return Tt}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${Tt}]: ${this.message}`}}}dt("ERR_BUFFER_OUT_OF_BOUNDS",function(Tt){return Tt?`${Tt} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),dt("ERR_INVALID_ARG_TYPE",function(Tt,Lt){return`The "${Tt}" argument must be of type number. Received type ${typeof Lt}`},TypeError),dt("ERR_OUT_OF_RANGE",function(Tt,Lt,Mt){let te=`The value of "${Tt}" is out of range.`,ve=Mt;return Number.isInteger(Mt)&&Math.abs(Mt)>2**32?ve=rt(String(Mt)):typeof Mt=="bigint"&&(ve=String(Mt),(Mt>BigInt(2)**BigInt(32)||Mt<-(BigInt(2)**BigInt(32)))&&(ve=rt(ve)),ve+="n"),te+=` It must be ${Lt}. Received ${ve}`,te},RangeError);function rt(Tt){let Lt="",Mt=Tt.length,te=Tt[0]==="-"?1:0;for(;Mt>=te+4;Mt-=3)Lt=`_${Tt.slice(Mt-3,Mt)}${Lt}`;return`${Tt.slice(0,Mt)}${Lt}`}function at(Tt,Lt,Mt){it(Lt,"offset"),(Tt[Lt]===void 0||Tt[Lt+Mt]===void 0)&&Y(Lt,Tt.length-(Mt+1))}function vt(Tt,Lt,Mt,te,ve,oe){if(Tt>Mt||Tt<Lt){let Te=typeof Lt=="bigint"?"n":"",He;throw Lt===0||Lt===BigInt(0)?He=`>= 0${Te} and < 2${Te} ** ${(oe+1)*8}${Te}`:He=`>= -(2${Te} ** ${(oe+1)*8-1}${Te}) and < 2 ** ${(oe+1)*8-1}${Te}`,new tt.ERR_OUT_OF_RANGE("value",He,Tt)}at(te,ve,oe)}function it(Tt,Lt){if(typeof Tt!="number")throw new tt.ERR_INVALID_ARG_TYPE(Lt,"number",Tt)}function Y(Tt,Lt,Mt){throw Math.floor(Tt)!==Tt?(it(Tt,Mt),new tt.ERR_OUT_OF_RANGE("offset","an integer",Tt)):Lt<0?new tt.ERR_BUFFER_OUT_OF_BOUNDS:new tt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Lt}`,Tt)}var ft=/[^+/0-9A-Za-z-_]/g;function ut(Tt){if(Tt=Tt.split("=")[0],Tt=Tt.trim().replace(ft,""),Tt.length<2)return"";for(;Tt.length%4!==0;)Tt=Tt+"=";return Tt}function wt(Tt,Lt){Lt=Lt||1/0;let Mt,te=Tt.length,ve=null,oe=[];for(let Te=0;Te<te;++Te){if(Mt=Tt.charCodeAt(Te),Mt>55295&&Mt<57344){if(!ve){if(Mt>56319){(Lt-=3)>-1&&oe.push(239,191,189);continue}else if(Te+1===te){(Lt-=3)>-1&&oe.push(239,191,189);continue}ve=Mt;continue}if(Mt<56320){(Lt-=3)>-1&&oe.push(239,191,189),ve=Mt;continue}Mt=(ve-55296<<10|Mt-56320)+65536}else ve&&(Lt-=3)>-1&&oe.push(239,191,189);if(ve=null,Mt<128){if((Lt-=1)<0)break;oe.push(Mt)}else if(Mt<2048){if((Lt-=2)<0)break;oe.push(Mt>>6|192,Mt&63|128)}else if(Mt<65536){if((Lt-=3)<0)break;oe.push(Mt>>12|224,Mt>>6&63|128,Mt&63|128)}else if(Mt<1114112){if((Lt-=4)<0)break;oe.push(Mt>>18|240,Mt>>12&63|128,Mt>>6&63|128,Mt&63|128)}else throw new Error("Invalid code point")}return oe}function zt(Tt){let Lt=[];for(let Mt=0;Mt<Tt.length;++Mt)Lt.push(Tt.charCodeAt(Mt)&255);return Lt}function Pt(Tt,Lt){let Mt,te,ve,oe=[];for(let Te=0;Te<Tt.length&&!((Lt-=2)<0);++Te)Mt=Tt.charCodeAt(Te),te=Mt>>8,ve=Mt%256,oe.push(ve),oe.push(te);return oe}function Wt(Tt){return $.toByteArray(ut(Tt))}function Ht(Tt,Lt,Mt,te){let ve;for(ve=0;ve<te&&!(ve+Mt>=Lt.length||ve>=Tt.length);++ve)Lt[ve+Mt]=Tt[ve];return ve}function Jt(Tt,Lt){return Tt instanceof Lt||Tt!=null&&Tt.constructor!=null&&Tt.constructor.name!=null&&Tt.constructor.name===Lt.name}function ge(Tt){return Tt!==Tt}var he=function(){let Tt="0123456789abcdef",Lt=new Array(256);for(let Mt=0;Mt<16;++Mt){let te=Mt*16;for(let ve=0;ve<16;++ve)Lt[te+ve]=Tt[Mt]+Tt[ve]}return Lt}();function de(Tt){return typeof BigInt>"u"?se:Tt}function se(){throw new Error("BigInt not supported")}}),rk=Ft((Q,$)=>{$.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var c={},g=Symbol("test"),P=Object(g);if(typeof g=="string"||Object.prototype.toString.call(g)!=="[object Symbol]"||Object.prototype.toString.call(P)!=="[object Symbol]")return!1;var S=42;c[g]=S;for(var t in c)return!1;if(typeof Object.keys=="function"&&Object.keys(c).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(c).length!==0)return!1;var e=Object.getOwnPropertySymbols(c);if(e.length!==1||e[0]!==g||!Object.prototype.propertyIsEnumerable.call(c,g))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(c,g);if(r.value!==S||r.enumerable!==!0)return!1}return!0}}),qw=Ft((Q,$)=>{var c=rk();$.exports=function(){return c()&&!!Symbol.toStringTag}}),x7=Ft((Q,$)=>{$.exports=Object}),JR=Ft((Q,$)=>{$.exports=Error}),QR=Ft((Q,$)=>{$.exports=EvalError}),tB=Ft((Q,$)=>{$.exports=RangeError}),eB=Ft((Q,$)=>{$.exports=ReferenceError}),_7=Ft((Q,$)=>{$.exports=SyntaxError}),tb=Ft((Q,$)=>{$.exports=TypeError}),rB=Ft((Q,$)=>{$.exports=URIError}),nB=Ft((Q,$)=>{$.exports=Math.abs}),iB=Ft((Q,$)=>{$.exports=Math.floor}),aB=Ft((Q,$)=>{$.exports=Math.max}),oB=Ft((Q,$)=>{$.exports=Math.min}),sB=Ft((Q,$)=>{$.exports=Math.pow}),lB=Ft((Q,$)=>{$.exports=Math.round}),uB=Ft((Q,$)=>{$.exports=Number.isNaN||function(c){return c!==c}}),cB=Ft((Q,$)=>{var c=uB();$.exports=function(g){return c(g)||g===0?g:g<0?-1:1}}),hB=Ft((Q,$)=>{$.exports=Object.getOwnPropertyDescriptor}),ex=Ft((Q,$)=>{var c=hB();if(c)try{c([],"length")}catch{c=null}$.exports=c}),Zw=Ft((Q,$)=>{var c=Object.defineProperty||!1;if(c)try{c({},"a",{value:1})}catch{c=!1}$.exports=c}),fB=Ft((Q,$)=>{var c=typeof Symbol<"u"&&Symbol,g=rk();$.exports=function(){return typeof c!="function"||typeof Symbol!="function"||typeof c("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:g()}}),b7=Ft((Q,$)=>{$.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),w7=Ft((Q,$)=>{var c=x7();$.exports=c.getPrototypeOf||null}),dB=Ft((Q,$)=>{var c="Function.prototype.bind called on incompatible ",g=Object.prototype.toString,P=Math.max,S="[object Function]",t=function(a,n){for(var o=[],i=0;i<a.length;i+=1)o[i]=a[i];for(var s=0;s<n.length;s+=1)o[s+a.length]=n[s];return o},e=function(a,n){for(var o=[],i=n,s=0;i<a.length;i+=1,s+=1)o[s]=a[i];return o},r=function(a,n){for(var o="",i=0;i<a.length;i+=1)o+=a[i],i+1<a.length&&(o+=n);return o};$.exports=function(a){var n=this;if(typeof n!="function"||g.apply(n)!==S)throw new TypeError(c+n);for(var o=e(arguments,1),i,s=function(){if(this instanceof i){var T=n.apply(this,t(o,arguments));return Object(T)===T?T:this}return n.apply(a,t(o,arguments))},f=P(0,n.length-o.length),x=[],y=0;y<f;y++)x[y]="$"+y;if(i=Function("binder","return function ("+r(x,",")+"){ return binder.apply(this,arguments); }")(s),n.prototype){var v=function(){};v.prototype=n.prototype,i.prototype=new v,v.prototype=null}return i}}),eb=Ft((Q,$)=>{var c=dB();$.exports=Function.prototype.bind||c}),nk=Ft((Q,$)=>{$.exports=Function.prototype.call}),k7=Ft((Q,$)=>{$.exports=Function.prototype.apply}),pB=Ft((Q,$)=>{$.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),mB=Ft((Q,$)=>{var c=eb(),g=k7(),P=nk(),S=pB();$.exports=S||c.call(P,g)}),gB=Ft((Q,$)=>{var c=eb(),g=tb(),P=nk(),S=mB();$.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new g("a function is required");return S(c,P,t)}}),vB=Ft((Q,$)=>{var c=gB(),g=ex(),P;try{P=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var S=!!P&&g&&g(Object.prototype,"__proto__"),t=Object,e=t.getPrototypeOf;$.exports=S&&typeof S.get=="function"?c([S.get]):typeof e=="function"?function(r){return e(r==null?r:t(r))}:!1}),yB=Ft((Q,$)=>{var c=b7(),g=w7(),P=vB();$.exports=c?function(S){return c(S)}:g?function(S){if(!S||typeof S!="object"&&typeof S!="function")throw new TypeError("getProto: not an object");return g(S)}:P?function(S){return P(S)}:null}),xB=Ft((Q,$)=>{var c=Function.prototype.call,g=Object.prototype.hasOwnProperty,P=eb();$.exports=P.call(c,g)}),ik=Ft((Q,$)=>{var c,g=x7(),P=JR(),S=QR(),t=tB(),e=eB(),r=_7(),a=tb(),n=rB(),o=nB(),i=iB(),s=aB(),f=oB(),x=sB(),y=lB(),v=cB(),T=Function,u=function(at){try{return T('"use strict"; return ('+at+").constructor;")()}catch{}},b=ex(),_=Zw(),C=function(){throw new a},M=b?function(){try{return arguments.callee,C}catch{try{return b(arguments,"callee").get}catch{return C}}}():C,E=fB()(),A=yB(),h=w7(),p=b7(),k=k7(),w=nk(),R={},O=typeof Uint8Array>"u"||!A?c:A(Uint8Array),N={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?c:ArrayBuffer,"%ArrayIteratorPrototype%":E&&A?A([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":typeof Atomics>"u"?c:Atomics,"%BigInt%":typeof BigInt>"u"?c:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?c:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?c:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":P,"%eval%":eval,"%EvalError%":S,"%Float16Array%":typeof Float16Array>"u"?c:Float16Array,"%Float32Array%":typeof Float32Array>"u"?c:Float32Array,"%Float64Array%":typeof Float64Array>"u"?c:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?c:FinalizationRegistry,"%Function%":T,"%GeneratorFunction%":R,"%Int8Array%":typeof Int8Array>"u"?c:Int8Array,"%Int16Array%":typeof Int16Array>"u"?c:Int16Array,"%Int32Array%":typeof Int32Array>"u"?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&A?A(A([][Symbol.iterator]())):c,"%JSON%":typeof JSON=="object"?JSON:c,"%Map%":typeof Map>"u"?c:Map,"%MapIteratorPrototype%":typeof Map>"u"||!E||!A?c:A(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":g,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?c:Promise,"%Proxy%":typeof Proxy>"u"?c:Proxy,"%RangeError%":t,"%ReferenceError%":e,"%Reflect%":typeof Reflect>"u"?c:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?c:Set,"%SetIteratorPrototype%":typeof Set>"u"||!E||!A?c:A(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&A?A(""[Symbol.iterator]()):c,"%Symbol%":E?Symbol:c,"%SyntaxError%":r,"%ThrowTypeError%":M,"%TypedArray%":O,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?c:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?c:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?c:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?c:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?c:WeakMap,"%WeakRef%":typeof WeakRef>"u"?c:WeakRef,"%WeakSet%":typeof WeakSet>"u"?c:WeakSet,"%Function.prototype.call%":w,"%Function.prototype.apply%":k,"%Object.defineProperty%":_,"%Object.getPrototypeOf%":h,"%Math.abs%":o,"%Math.floor%":i,"%Math.max%":s,"%Math.min%":f,"%Math.pow%":x,"%Math.round%":y,"%Math.sign%":v,"%Reflect.getPrototypeOf%":p};if(A)try{null.error}catch(at){V=A(A(at)),N["%Error.prototype%"]=V}var V,H=function at(vt){var it;if(vt==="%AsyncFunction%")it=u("async function () {}");else if(vt==="%GeneratorFunction%")it=u("function* () {}");else if(vt==="%AsyncGeneratorFunction%")it=u("async function* () {}");else if(vt==="%AsyncGenerator%"){var Y=at("%AsyncGeneratorFunction%");Y&&(it=Y.prototype)}else if(vt==="%AsyncIteratorPrototype%"){var ft=at("%AsyncGenerator%");ft&&A&&(it=A(ft.prototype))}return N[vt]=it,it},F={__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"]},U=eb(),W=xB(),q=U.call(w,Array.prototype.concat),X=U.call(k,Array.prototype.splice),lt=U.call(w,String.prototype.replace),yt=U.call(w,String.prototype.slice),pt=U.call(w,RegExp.prototype.exec),st=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,tt=/\\(\\)?/g,dt=function(at){var vt=yt(at,0,1),it=yt(at,-1);if(vt==="%"&&it!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(it==="%"&&vt!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var Y=[];return lt(at,st,function(ft,ut,wt,zt){Y[Y.length]=wt?lt(zt,tt,"$1"):ut||ft}),Y},rt=function(at,vt){var it=at,Y;if(W(F,it)&&(Y=F[it],it="%"+Y[0]+"%"),W(N,it)){var ft=N[it];if(ft===R&&(ft=H(it)),typeof ft>"u"&&!vt)throw new a("intrinsic "+at+" exists, but is not available. Please file an issue!");return{alias:Y,name:it,value:ft}}throw new r("intrinsic "+at+" does not exist!")};$.exports=function(at,vt){if(typeof at!="string"||at.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof vt!="boolean")throw new a('"allowMissing" argument must be a boolean');if(pt(/^%?[^%]*%?$/,at)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var it=dt(at),Y=it.length>0?it[0]:"",ft=rt("%"+Y+"%",vt),ut=ft.name,wt=ft.value,zt=!1,Pt=ft.alias;Pt&&(Y=Pt[0],X(it,q([0,1],Pt)));for(var Wt=1,Ht=!0;Wt<it.length;Wt+=1){var Jt=it[Wt],ge=yt(Jt,0,1),he=yt(Jt,-1);if((ge==='"'||ge==="'"||ge==="`"||he==='"'||he==="'"||he==="`")&&ge!==he)throw new r("property names with quotes must have matching quotes");if((Jt==="constructor"||!Ht)&&(zt=!0),Y+="."+Jt,ut="%"+Y+"%",W(N,ut))wt=N[ut];else if(wt!=null){if(!(Jt in wt)){if(!vt)throw new a("base intrinsic for "+at+" exists, but the property is not available.");return}if(b&&Wt+1>=it.length){var de=b(wt,Jt);Ht=!!de,Ht&&"get"in de&&!("originalValue"in de.get)?wt=de.get:wt=wt[Jt]}else Ht=W(wt,Jt),wt=wt[Jt];Ht&&!zt&&(N[ut]=wt)}}return wt}}),_B=Ft((Q,$)=>{var c=Zw(),g=_7(),P=tb(),S=ex();$.exports=function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new P("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new P("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new P("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new P("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new P("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new P("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,i=arguments.length>6?arguments[6]:!1,s=!!S&&S(t,e);if(c)c(t,e,{configurable:o===null&&s?s.configurable:!o,enumerable:a===null&&s?s.enumerable:!a,value:r,writable:n===null&&s?s.writable:!n});else if(i||!a&&!n&&!o)t[e]=r;else throw new g("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),T7=Ft((Q,$)=>{var c=Zw(),g=function(){return!!c};g.hasArrayLengthDefineBug=function(){if(!c)return null;try{return c([],"length",{value:1}).length!==1}catch{return!0}},$.exports=g}),bB=Ft((Q,$)=>{var c=ik(),g=_B(),P=T7()(),S=ex(),t=tb(),e=c("%Math.floor%");$.exports=function(r,a){if(typeof r!="function")throw new t("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||e(a)!==a)throw new t("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,i=!0;if("length"in r&&S){var s=S(r,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(i=!1)}return(o||i||!n)&&(P?g(r,"length",a,!0,!0):g(r,"length",a)),r}}),$w=Ft((Q,$)=>{var c=eb(),g=ik(),P=bB(),S=tb(),t=g("%Function.prototype.apply%"),e=g("%Function.prototype.call%"),r=g("%Reflect.apply%",!0)||c.call(e,t),a=Zw(),n=g("%Math.max%");$.exports=function(i){if(typeof i!="function")throw new S("a function is required");var s=r(c,e,arguments);return P(s,1+n(0,i.length-(arguments.length-1)),!0)};var o=function(){return r(c,t,arguments)};a?a($.exports,"apply",{value:o}):$.exports.apply=o}),rb=Ft((Q,$)=>{var c=ik(),g=$w(),P=g(c("String.prototype.indexOf"));$.exports=function(S,t){var e=c(S,!!t);return typeof e=="function"&&P(S,".prototype.")>-1?g(e):e}}),wB=Ft((Q,$)=>{var c=qw()(),g=rb(),P=g("Object.prototype.toString"),S=function(r){return c&&r&&typeof r=="object"&&Symbol.toStringTag in r?!1:P(r)==="[object Arguments]"},t=function(r){return S(r)?!0:r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&P(r)!=="[object Array]"&&P(r.callee)==="[object Function]"},e=function(){return S(arguments)}();S.isLegacyArguments=t,$.exports=e?S:t}),kB=Ft((Q,$)=>{var c=Object.prototype.toString,g=Function.prototype.toString,P=/^\s*(?:function)?\*/,S=qw()(),t=Object.getPrototypeOf,e=function(){if(!S)return!1;try{return Function("return function*() {}")()}catch{}},r;$.exports=function(a){if(typeof a!="function")return!1;if(P.test(g.call(a)))return!0;if(!S){var n=c.call(a);return n==="[object GeneratorFunction]"}if(!t)return!1;if(typeof r>"u"){var o=e();r=o?t(o):!1}return t(a)===r}}),TB=Ft((Q,$)=>{var c=Function.prototype.toString,g=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,P,S;if(typeof g=="function"&&typeof Object.defineProperty=="function")try{P=Object.defineProperty({},"length",{get:function(){throw S}}),S={},g(function(){throw 42},null,P)}catch(b){b!==S&&(g=null)}else g=null;var t=/^\s*class\b/,e=function(b){try{var _=c.call(b);return t.test(_)}catch{return!1}},r=function(b){try{return e(b)?!1:(c.call(b),!0)}catch{return!1}},a=Object.prototype.toString,n="[object Object]",o="[object Function]",i="[object GeneratorFunction]",s="[object HTMLAllCollection]",f="[object HTML document.all class]",x="[object HTMLCollection]",y=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(u=document.all,a.call(u)===a.call(document.all)&&(T=function(b){if((v||!b)&&(typeof b>"u"||typeof b=="object"))try{var _=a.call(b);return(_===s||_===f||_===x||_===n)&&b("")==null}catch{}return!1}));var u;$.exports=g?function(b){if(T(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;try{g(b,null,P)}catch(_){if(_!==S)return!1}return!e(b)&&r(b)}:function(b){if(T(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(y)return r(b);if(e(b))return!1;var _=a.call(b);return _!==o&&_!==i&&!/^\[object HTML/.test(_)?!1:r(b)}}),A7=Ft((Q,$)=>{var c=TB(),g=Object.prototype.toString,P=Object.prototype.hasOwnProperty,S=function(a,n,o){for(var i=0,s=a.length;i<s;i++)P.call(a,i)&&(o==null?n(a[i],i,a):n.call(o,a[i],i,a))},t=function(a,n,o){for(var i=0,s=a.length;i<s;i++)o==null?n(a.charAt(i),i,a):n.call(o,a.charAt(i),i,a)},e=function(a,n,o){for(var i in a)P.call(a,i)&&(o==null?n(a[i],i,a):n.call(o,a[i],i,a))},r=function(a,n,o){if(!c(n))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=o),g.call(a)==="[object Array]"?S(a,n,i):typeof a=="string"?t(a,n,i):e(a,n,i)};$.exports=r}),M7=Ft((Q,$)=>{var c=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],g=typeof globalThis>"u"?window:globalThis;$.exports=function(){for(var P=[],S=0;S<c.length;S++)typeof g[c[S]]=="function"&&(P[P.length]=c[S]);return P}}),AB=Ft((Q,$)=>{var c=A7(),g=M7(),P=$w(),S=rb(),t=ex(),e=S("Object.prototype.toString"),r=qw()(),a=typeof globalThis>"u"?window:globalThis,n=g(),o=S("String.prototype.slice"),i=Object.getPrototypeOf,s=S("Array.prototype.indexOf",!0)||function(v,T){for(var u=0;u<v.length;u+=1)if(v[u]===T)return u;return-1},f={__proto__:null};r&&t&&i?c(n,function(v){var T=new a[v];if(Symbol.toStringTag in T){var u=i(T),b=t(u,Symbol.toStringTag);if(!b){var _=i(u);b=t(_,Symbol.toStringTag)}f["$"+v]=P(b.get)}}):c(n,function(v){var T=new a[v],u=T.slice||T.set;u&&(f["$"+v]=P(u))});var x=function(v){var T=!1;return c(f,function(u,b){if(!T)try{"$"+u(v)===b&&(T=o(b,1))}catch{}}),T},y=function(v){var T=!1;return c(f,function(u,b){if(!T)try{u(v),T=o(b,1)}catch{}}),T};$.exports=function(v){if(!v||typeof v!="object")return!1;if(!r){var T=o(e(v),8,-1);return s(n,T)>-1?T:T!=="Object"?!1:y(v)}return t?x(v):null}}),MB=Ft((Q,$)=>{var c=A7(),g=M7(),P=rb(),S=P("Object.prototype.toString"),t=qw()(),e=ex(),r=typeof globalThis>"u"?window:globalThis,a=g(),n=P("Array.prototype.indexOf",!0)||function(x,y){for(var v=0;v<x.length;v+=1)if(x[v]===y)return v;return-1},o=P("String.prototype.slice"),i={},s=Object.getPrototypeOf;t&&e&&s&&c(a,function(x){var y=new r[x];if(Symbol.toStringTag in y){var v=s(y),T=e(v,Symbol.toStringTag);if(!T){var u=s(v);T=e(u,Symbol.toStringTag)}i[x]=T.get}});var f=function(x){var y=!1;return c(i,function(v,T){if(!y)try{y=v.call(x)===T}catch{}}),y};$.exports=function(x){if(!x||typeof x!="object")return!1;if(!t||!(Symbol.toStringTag in x)){var y=o(S(x),8,-1);return n(a,y)>-1}return e?f(x):!1}}),S7=Ft(Q=>{var $=wB(),c=kB(),g=AB(),P=MB();function S(Pt){return Pt.call.bind(Pt)}var t=typeof BigInt<"u",e=typeof Symbol<"u",r=S(Object.prototype.toString),a=S(Number.prototype.valueOf),n=S(String.prototype.valueOf),o=S(Boolean.prototype.valueOf);t&&(i=S(BigInt.prototype.valueOf));var i;e&&(s=S(Symbol.prototype.valueOf));var s;function f(Pt,Wt){if(typeof Pt!="object")return!1;try{return Wt(Pt),!0}catch{return!1}}Q.isArgumentsObject=$,Q.isGeneratorFunction=c,Q.isTypedArray=P;function x(Pt){return typeof Promise<"u"&&Pt instanceof Promise||Pt!==null&&typeof Pt=="object"&&typeof Pt.then=="function"&&typeof Pt.catch=="function"}Q.isPromise=x;function y(Pt){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Pt):P(Pt)||X(Pt)}Q.isArrayBufferView=y;function v(Pt){return g(Pt)==="Uint8Array"}Q.isUint8Array=v;function T(Pt){return g(Pt)==="Uint8ClampedArray"}Q.isUint8ClampedArray=T;function u(Pt){return g(Pt)==="Uint16Array"}Q.isUint16Array=u;function b(Pt){return g(Pt)==="Uint32Array"}Q.isUint32Array=b;function _(Pt){return g(Pt)==="Int8Array"}Q.isInt8Array=_;function C(Pt){return g(Pt)==="Int16Array"}Q.isInt16Array=C;function M(Pt){return g(Pt)==="Int32Array"}Q.isInt32Array=M;function E(Pt){return g(Pt)==="Float32Array"}Q.isFloat32Array=E;function A(Pt){return g(Pt)==="Float64Array"}Q.isFloat64Array=A;function h(Pt){return g(Pt)==="BigInt64Array"}Q.isBigInt64Array=h;function p(Pt){return g(Pt)==="BigUint64Array"}Q.isBigUint64Array=p;function k(Pt){return r(Pt)==="[object Map]"}k.working=typeof Map<"u"&&k(new Map);function w(Pt){return typeof Map>"u"?!1:k.working?k(Pt):Pt instanceof Map}Q.isMap=w;function R(Pt){return r(Pt)==="[object Set]"}R.working=typeof Set<"u"&&R(new Set);function O(Pt){return typeof Set>"u"?!1:R.working?R(Pt):Pt instanceof Set}Q.isSet=O;function N(Pt){return r(Pt)==="[object WeakMap]"}N.working=typeof WeakMap<"u"&&N(new WeakMap);function V(Pt){return typeof WeakMap>"u"?!1:N.working?N(Pt):Pt instanceof WeakMap}Q.isWeakMap=V;function H(Pt){return r(Pt)==="[object WeakSet]"}H.working=typeof WeakSet<"u"&&H(new WeakSet);function F(Pt){return H(Pt)}Q.isWeakSet=F;function U(Pt){return r(Pt)==="[object ArrayBuffer]"}U.working=typeof ArrayBuffer<"u"&&U(new ArrayBuffer);function W(Pt){return typeof ArrayBuffer>"u"?!1:U.working?U(Pt):Pt instanceof ArrayBuffer}Q.isArrayBuffer=W;function q(Pt){return r(Pt)==="[object DataView]"}q.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&q(new DataView(new ArrayBuffer(1),0,1));function X(Pt){return typeof DataView>"u"?!1:q.working?q(Pt):Pt instanceof DataView}Q.isDataView=X;var lt=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function yt(Pt){return r(Pt)==="[object SharedArrayBuffer]"}function pt(Pt){return typeof lt>"u"?!1:(typeof yt.working>"u"&&(yt.working=yt(new lt)),yt.working?yt(Pt):Pt instanceof lt)}Q.isSharedArrayBuffer=pt;function st(Pt){return r(Pt)==="[object AsyncFunction]"}Q.isAsyncFunction=st;function tt(Pt){return r(Pt)==="[object Map Iterator]"}Q.isMapIterator=tt;function dt(Pt){return r(Pt)==="[object Set Iterator]"}Q.isSetIterator=dt;function rt(Pt){return r(Pt)==="[object Generator]"}Q.isGeneratorObject=rt;function at(Pt){return r(Pt)==="[object WebAssembly.Module]"}Q.isWebAssemblyCompiledModule=at;function vt(Pt){return f(Pt,a)}Q.isNumberObject=vt;function it(Pt){return f(Pt,n)}Q.isStringObject=it;function Y(Pt){return f(Pt,o)}Q.isBooleanObject=Y;function ft(Pt){return t&&f(Pt,i)}Q.isBigIntObject=ft;function ut(Pt){return e&&f(Pt,s)}Q.isSymbolObject=ut;function wt(Pt){return vt(Pt)||it(Pt)||Y(Pt)||ft(Pt)||ut(Pt)}Q.isBoxedPrimitive=wt;function zt(Pt){return typeof Uint8Array<"u"&&(W(Pt)||pt(Pt))}Q.isAnyArrayBuffer=zt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Pt){Object.defineProperty(Q,Pt,{enumerable:!1,value:function(){throw new Error(Pt+" is not supported in userland")}})})}),E7=Ft((Q,$)=>{$.exports=function(c){return c&&typeof c=="object"&&typeof c.copy=="function"&&typeof c.fill=="function"&&typeof c.readUInt8=="function"}}),C7=Ft(Q=>{var $=Object.getOwnPropertyDescriptors||function(q){for(var X=Object.keys(q),lt={},yt=0;yt<X.length;yt++)lt[X[yt]]=Object.getOwnPropertyDescriptor(q,X[yt]);return lt},c=/%[sdj%]/g;Q.format=function(q){if(!_(q)){for(var X=[],lt=0;lt<arguments.length;lt++)X.push(t(arguments[lt]));return X.join(" ")}for(var lt=1,yt=arguments,pt=yt.length,st=String(q).replace(c,function(rt){if(rt==="%%")return"%";if(lt>=pt)return rt;switch(rt){case"%s":return String(yt[lt++]);case"%d":return Number(yt[lt++]);case"%j":try{return JSON.stringify(yt[lt++])}catch{return"[Circular]"}default:return rt}}),tt=yt[lt];lt<pt;tt=yt[++lt])T(tt)||!A(tt)?st+=" "+tt:st+=" "+t(tt);return st},Q.deprecate=function(q,X){if(typeof process<"u"&&process.noDeprecation===!0)return q;if(typeof process>"u")return function(){return Q.deprecate(q,X).apply(this,arguments)};var lt=!1;function yt(){if(!lt){if(process.throwDeprecation)throw new Error(X);process.traceDeprecation?console.trace(X):console.error(X),lt=!0}return q.apply(this,arguments)}return yt};var g={},P=/^$/;S="false",S=S.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),P=new RegExp("^"+S+"$","i");var S;Q.debuglog=function(q){if(q=q.toUpperCase(),!g[q])if(P.test(q)){var X=process.pid;g[q]=function(){var lt=Q.format.apply(Q,arguments);console.error("%s %d: %s",q,X,lt)}}else g[q]=function(){};return g[q]};function t(q,X){var lt={seen:[],stylize:r};return arguments.length>=3&&(lt.depth=arguments[2]),arguments.length>=4&&(lt.colors=arguments[3]),v(X)?lt.showHidden=X:X&&Q._extend(lt,X),M(lt.showHidden)&&(lt.showHidden=!1),M(lt.depth)&&(lt.depth=2),M(lt.colors)&&(lt.colors=!1),M(lt.customInspect)&&(lt.customInspect=!0),lt.colors&&(lt.stylize=e),n(lt,q,lt.depth)}Q.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(q,X){var lt=t.styles[X];return lt?"\x1B["+t.colors[lt][0]+"m"+q+"\x1B["+t.colors[lt][1]+"m":q}function r(q,X){return q}function a(q){var X={};return q.forEach(function(lt,yt){X[lt]=!0}),X}function n(q,X,lt){if(q.customInspect&&X&&k(X.inspect)&&X.inspect!==Q.inspect&&!(X.constructor&&X.constructor.prototype===X)){var yt=X.inspect(lt,q);return _(yt)||(yt=n(q,yt,lt)),yt}var pt=o(q,X);if(pt)return pt;var st=Object.keys(X),tt=a(st);if(q.showHidden&&(st=Object.getOwnPropertyNames(X)),p(X)&&(st.indexOf("message")>=0||st.indexOf("description")>=0))return i(X);if(st.length===0){if(k(X)){var dt=X.name?": "+X.name:"";return q.stylize("[Function"+dt+"]","special")}if(E(X))return q.stylize(RegExp.prototype.toString.call(X),"regexp");if(h(X))return q.stylize(Date.prototype.toString.call(X),"date");if(p(X))return i(X)}var rt="",at=!1,vt=["{","}"];if(y(X)&&(at=!0,vt=["[","]"]),k(X)){var it=X.name?": "+X.name:"";rt=" [Function"+it+"]"}if(E(X)&&(rt=" "+RegExp.prototype.toString.call(X)),h(X)&&(rt=" "+Date.prototype.toUTCString.call(X)),p(X)&&(rt=" "+i(X)),st.length===0&&(!at||X.length==0))return vt[0]+rt+vt[1];if(lt<0)return E(X)?q.stylize(RegExp.prototype.toString.call(X),"regexp"):q.stylize("[Object]","special");q.seen.push(X);var Y;return at?Y=s(q,X,lt,tt,st):Y=st.map(function(ft){return f(q,X,lt,tt,ft,at)}),q.seen.pop(),x(Y,rt,vt)}function o(q,X){if(M(X))return q.stylize("undefined","undefined");if(_(X)){var lt="'"+JSON.stringify(X).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return q.stylize(lt,"string")}if(b(X))return q.stylize(""+X,"number");if(v(X))return q.stylize(""+X,"boolean");if(T(X))return q.stylize("null","null")}function i(q){return"["+Error.prototype.toString.call(q)+"]"}function s(q,X,lt,yt,pt){for(var st=[],tt=0,dt=X.length;tt<dt;++tt)H(X,String(tt))?st.push(f(q,X,lt,yt,String(tt),!0)):st.push("");return pt.forEach(function(rt){rt.match(/^\d+$/)||st.push(f(q,X,lt,yt,rt,!0))}),st}function f(q,X,lt,yt,pt,st){var tt,dt,rt;if(rt=Object.getOwnPropertyDescriptor(X,pt)||{value:X[pt]},rt.get?rt.set?dt=q.stylize("[Getter/Setter]","special"):dt=q.stylize("[Getter]","special"):rt.set&&(dt=q.stylize("[Setter]","special")),H(yt,pt)||(tt="["+pt+"]"),dt||(q.seen.indexOf(rt.value)<0?(T(lt)?dt=n(q,rt.value,null):dt=n(q,rt.value,lt-1),dt.indexOf(`
`)>-1&&(st?dt=dt.split(`
`).map(function(at){return" "+at}).join(`
`).slice(2):dt=`
`+dt.split(`
`).map(function(at){return" "+at}).join(`
`))):dt=q.stylize("[Circular]","special")),M(tt)){if(st&&pt.match(/^\d+$/))return dt;tt=JSON.stringify(""+pt),tt.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(tt=tt.slice(1,-1),tt=q.stylize(tt,"name")):(tt=tt.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),tt=q.stylize(tt,"string"))}return tt+": "+dt}function x(q,X,lt){var yt=0,pt=q.reduce(function(st,tt){return yt++,tt.indexOf(`
`)>=0&&yt++,st+tt.replace(/\u001b\[\d\d?m/g,"").length+1},0);return pt>60?lt[0]+(X===""?"":X+`
`)+" "+q.join(`,
`)+" "+lt[1]:lt[0]+X+" "+q.join(", ")+" "+lt[1]}Q.types=S7();function y(q){return Array.isArray(q)}Q.isArray=y;function v(q){return typeof q=="boolean"}Q.isBoolean=v;function T(q){return q===null}Q.isNull=T;function u(q){return q==null}Q.isNullOrUndefined=u;function b(q){return typeof q=="number"}Q.isNumber=b;function _(q){return typeof q=="string"}Q.isString=_;function C(q){return typeof q=="symbol"}Q.isSymbol=C;function M(q){return q===void 0}Q.isUndefined=M;function E(q){return A(q)&&R(q)==="[object RegExp]"}Q.isRegExp=E,Q.types.isRegExp=E;function A(q){return typeof q=="object"&&q!==null}Q.isObject=A;function h(q){return A(q)&&R(q)==="[object Date]"}Q.isDate=h,Q.types.isDate=h;function p(q){return A(q)&&(R(q)==="[object Error]"||q instanceof Error)}Q.isError=p,Q.types.isNativeError=p;function k(q){return typeof q=="function"}Q.isFunction=k;function w(q){return q===null||typeof q=="boolean"||typeof q=="number"||typeof q=="string"||typeof q=="symbol"||typeof q>"u"}Q.isPrimitive=w,Q.isBuffer=E7();function R(q){return Object.prototype.toString.call(q)}function O(q){return q<10?"0"+q.toString(10):q.toString(10)}var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var q=new Date,X=[O(q.getHours()),O(q.getMinutes()),O(q.getSeconds())].join(":");return[q.getDate(),N[q.getMonth()],X].join(" ")}Q.log=function(){console.log("%s - %s",V(),Q.format.apply(Q,arguments))},Q.inherits=_v(),Q._extend=function(q,X){if(!X||!A(X))return q;for(var lt=Object.keys(X),yt=lt.length;yt--;)q[lt[yt]]=X[lt[yt]];return q};function H(q,X){return Object.prototype.hasOwnProperty.call(q,X)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Q.promisify=function(q){if(typeof q!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&q[F]){var X=q[F];if(typeof X!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(X,F,{value:X,enumerable:!1,writable:!1,configurable:!0}),X}function X(){for(var lt,yt,pt=new Promise(function(dt,rt){lt=dt,yt=rt}),st=[],tt=0;tt<arguments.length;tt++)st.push(arguments[tt]);st.push(function(dt,rt){dt?yt(dt):lt(rt)});try{q.apply(this,st)}catch(dt){yt(dt)}return pt}return Object.setPrototypeOf(X,Object.getPrototypeOf(q)),F&&Object.defineProperty(X,F,{value:X,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(X,$(q))},Q.promisify.custom=F;function U(q,X){if(!q){var lt=new Error("Promise was rejected with a falsy value");lt.reason=q,q=lt}return X(q)}function W(q){if(typeof q!="function")throw new TypeError('The "original" argument must be of type Function');function X(){for(var lt=[],yt=0;yt<arguments.length;yt++)lt.push(arguments[yt]);var pt=lt.pop();if(typeof pt!="function")throw new TypeError("The last argument must be of type Function");var st=this,tt=function(){return pt.apply(st,arguments)};q.apply(this,lt).then(function(dt){process.nextTick(tt.bind(null,null,dt))},function(dt){process.nextTick(U.bind(null,dt,tt))})}return Object.setPrototypeOf(X,Object.getPrototypeOf(q)),Object.defineProperties(X,$(q)),X}Q.callbackify=W}),SB=Ft((Q,$)=>{function c(f,x){var y=Object.keys(f);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(f);x&&(v=v.filter(function(T){return Object.getOwnPropertyDescriptor(f,T).enumerable})),y.push.apply(y,v)}return y}function g(f){for(var x=1;x<arguments.length;x++){var y=arguments[x]!=null?arguments[x]:{};x%2?c(Object(y),!0).forEach(function(v){P(f,v,y[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(y)):c(Object(y)).forEach(function(v){Object.defineProperty(f,v,Object.getOwnPropertyDescriptor(y,v))})}return f}function P(f,x,y){return x in f?Object.defineProperty(f,x,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[x]=y,f}function S(f,x){if(!(f instanceof x))throw new TypeError("Cannot call a class as a function")}function t(f,x){for(var y=0;y<x.length;y++){var v=x[y];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}function e(f,x,y){return x&&t(f.prototype,x),f}var r=tx(),a=r.Buffer,n=C7(),o=n.inspect,i=o&&o.custom||"inspect";function s(f,x,y){a.prototype.copy.call(f,x,y)}$.exports=function(){function f(){S(this,f),this.head=null,this.tail=null,this.length=0}return e(f,[{key:"push",value:function(x){var y={data:x,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(x){var y={data:x,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var x=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,x}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(x){if(this.length===0)return"";for(var y=this.head,v=""+y.data;y=y.next;)v+=x+y.data;return v}},{key:"concat",value:function(x){if(this.length===0)return a.alloc(0);for(var y=a.allocUnsafe(x>>>0),v=this.head,T=0;v;)s(v.data,y,T),T+=v.data.length,v=v.next;return y}},{key:"consume",value:function(x,y){var v;return x<this.head.data.length?(v=this.head.data.slice(0,x),this.head.data=this.head.data.slice(x)):x===this.head.data.length?v=this.shift():v=y?this._getString(x):this._getBuffer(x),v}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(x){var y=this.head,v=1,T=y.data;for(x-=T.length;y=y.next;){var u=y.data,b=x>u.length?u.length:x;if(b===u.length?T+=u:T+=u.slice(0,x),x-=b,x===0){b===u.length?(++v,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=u.slice(b));break}++v}return this.length-=v,T}},{key:"_getBuffer",value:function(x){var y=a.allocUnsafe(x),v=this.head,T=1;for(v.data.copy(y),x-=v.data.length;v=v.next;){var u=v.data,b=x>u.length?u.length:x;if(u.copy(y,y.length-x,0,b),x-=b,x===0){b===u.length?(++T,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=u.slice(b));break}++T}return this.length-=T,y}},{key:i,value:function(x,y){return o(this,g({},y,{depth:0,customInspect:!1}))}}]),f}()}),L7=Ft((Q,$)=>{function c(r,a){var n=this,o=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return o||i?(a?a(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){!a&&s?n._writableState?n._writableState.errorEmitted?process.nextTick(P,n):(n._writableState.errorEmitted=!0,process.nextTick(g,n,s)):process.nextTick(g,n,s):a?(process.nextTick(P,n),a(s)):process.nextTick(P,n)}),this)}function g(r,a){t(r,a),P(r)}function P(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function S(){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,a){r.emit("error",a)}function e(r,a){var n=r._readableState,o=r._writableState;n&&n.autoDestroy||o&&o.autoDestroy?r.destroy(a):r.emit("error",a)}$.exports={destroy:c,undestroy:S,errorOrDestroy:e}}),rx=Ft((Q,$)=>{function c(a,n){a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.__proto__=n}var g={};function P(a,n,o){o||(o=Error);function i(f,x,y){return typeof n=="string"?n:n(f,x,y)}var s=function(f){c(x,f);function x(y,v,T){return f.call(this,i(y,v,T))||this}return x}(o);s.prototype.name=o.name,s.prototype.code=a,g[a]=s}function S(a,n){if(Array.isArray(a)){var o=a.length;return a=a.map(function(i){return String(i)}),o>2?"one of ".concat(n," ").concat(a.slice(0,o-1).join(", "),", or ")+a[o-1]:o===2?"one of ".concat(n," ").concat(a[0]," or ").concat(a[1]):"of ".concat(n," ").concat(a[0])}else return"of ".concat(n," ").concat(String(a))}function t(a,n,o){return a.substr(0,n.length)===n}function e(a,n,o){return(o===void 0||o>a.length)&&(o=a.length),a.substring(o-n.length,o)===n}function r(a,n,o){return typeof o!="number"&&(o=0),o+n.length>a.length?!1:a.indexOf(n,o)!==-1}P("ERR_INVALID_OPT_VALUE",function(a,n){return'The value "'+n+'" is invalid for option "'+a+'"'},TypeError),P("ERR_INVALID_ARG_TYPE",function(a,n,o){var i;typeof n=="string"&&t(n,"not ")?(i="must not be",n=n.replace(/^not /,"")):i="must be";var s;if(e(a," argument"))s="The ".concat(a," ").concat(i," ").concat(S(n,"type"));else{var f=r(a,".")?"property":"argument";s='The "'.concat(a,'" ').concat(f," ").concat(i," ").concat(S(n,"type"))}return s+=". Received type ".concat(typeof o),s},TypeError),P("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),P("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),P("ERR_STREAM_PREMATURE_CLOSE","Premature close"),P("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),P("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),P("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),P("ERR_STREAM_WRITE_AFTER_END","write after end"),P("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),P("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),P("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),$.exports.codes=g}),P7=Ft((Q,$)=>{var c=rx().codes.ERR_INVALID_OPT_VALUE;function g(S,t,e){return S.highWaterMark!=null?S.highWaterMark:t?S[e]:null}function P(S,t,e,r){var a=g(t,r,e);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var n=r?e:"highWaterMark";throw new c(n,a)}return Math.floor(a)}return S.objectMode?16:16*1024}$.exports={getHighWaterMark:P}}),EB=Ft((Q,$)=>{$.exports=c;function c(P,S){if(g("noDeprecation"))return P;var t=!1;function e(){if(!t){if(g("throwDeprecation"))throw new Error(S);g("traceDeprecation")?console.trace(S):console.warn(S),t=!0}return P.apply(this,arguments)}return e}function g(P){try{if(!window.localStorage)return!1}catch{return!1}var S=window.localStorage[P];return S==null?!1:String(S).toLowerCase()==="true"}}),z7=Ft((Q,$)=>{$.exports=h;function c(tt){var dt=this;this.next=null,this.entry=null,this.finish=function(){st(dt,tt)}}var g;h.WritableState=E;var P={deprecate:EB()},S=y7(),t=tx().Buffer,e=window.Uint8Array||function(){};function r(tt){return t.from(tt)}function a(tt){return t.isBuffer(tt)||tt instanceof e}var n=L7(),o=P7(),i=o.getHighWaterMark,s=rx().codes,f=s.ERR_INVALID_ARG_TYPE,x=s.ERR_METHOD_NOT_IMPLEMENTED,y=s.ERR_MULTIPLE_CALLBACK,v=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,u=s.ERR_STREAM_NULL_VALUES,b=s.ERR_STREAM_WRITE_AFTER_END,_=s.ERR_UNKNOWN_ENCODING,C=n.errorOrDestroy;_v()(h,S);function M(){}function E(tt,dt,rt){g=g||nx(),tt=tt||{},typeof rt!="boolean"&&(rt=dt instanceof g),this.objectMode=!!tt.objectMode,rt&&(this.objectMode=this.objectMode||!!tt.writableObjectMode),this.highWaterMark=i(this,tt,"writableHighWaterMark",rt),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var at=tt.decodeStrings===!1;this.decodeStrings=!at,this.defaultEncoding=tt.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(vt){H(dt,vt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=tt.emitClose!==!1,this.autoDestroy=!!tt.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}E.prototype.getBuffer=function(){for(var tt=this.bufferedRequest,dt=[];tt;)dt.push(tt),tt=tt.next;return dt},function(){try{Object.defineProperty(E.prototype,"buffer",{get:P.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var A;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(A=Function.prototype[Symbol.hasInstance],Object.defineProperty(h,Symbol.hasInstance,{value:function(tt){return A.call(this,tt)?!0:this!==h?!1:tt&&tt._writableState instanceof E}})):A=function(tt){return tt instanceof this};function h(tt){g=g||nx();var dt=this instanceof g;if(!dt&&!A.call(h,this))return new h(tt);this._writableState=new E(tt,this,dt),this.writable=!0,tt&&(typeof tt.write=="function"&&(this._write=tt.write),typeof tt.writev=="function"&&(this._writev=tt.writev),typeof tt.destroy=="function"&&(this._destroy=tt.destroy),typeof tt.final=="function"&&(this._final=tt.final)),S.call(this)}h.prototype.pipe=function(){C(this,new v)};function p(tt,dt){var rt=new b;C(tt,rt),process.nextTick(dt,rt)}function k(tt,dt,rt,at){var vt;return rt===null?vt=new u:typeof rt!="string"&&!dt.objectMode&&(vt=new f("chunk",["string","Buffer"],rt)),vt?(C(tt,vt),process.nextTick(at,vt),!1):!0}h.prototype.write=function(tt,dt,rt){var at=this._writableState,vt=!1,it=!at.objectMode&&a(tt);return it&&!t.isBuffer(tt)&&(tt=r(tt)),typeof dt=="function"&&(rt=dt,dt=null),it?dt="buffer":dt||(dt=at.defaultEncoding),typeof rt!="function"&&(rt=M),at.ending?p(this,rt):(it||k(this,at,tt,rt))&&(at.pendingcb++,vt=R(this,at,it,tt,dt,rt)),vt},h.prototype.cork=function(){this._writableState.corked++},h.prototype.uncork=function(){var tt=this._writableState;tt.corked&&(tt.corked--,!tt.writing&&!tt.corked&&!tt.bufferProcessing&&tt.bufferedRequest&&W(this,tt))},h.prototype.setDefaultEncoding=function(tt){if(typeof tt=="string"&&(tt=tt.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((tt+"").toLowerCase())>-1))throw new _(tt);return this._writableState.defaultEncoding=tt,this},Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function w(tt,dt,rt){return!tt.objectMode&&tt.decodeStrings!==!1&&typeof dt=="string"&&(dt=t.from(dt,rt)),dt}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function R(tt,dt,rt,at,vt,it){if(!rt){var Y=w(dt,at,vt);at!==Y&&(rt=!0,vt="buffer",at=Y)}var ft=dt.objectMode?1:at.length;dt.length+=ft;var ut=dt.length<dt.highWaterMark;if(ut||(dt.needDrain=!0),dt.writing||dt.corked){var wt=dt.lastBufferedRequest;dt.lastBufferedRequest={chunk:at,encoding:vt,isBuf:rt,callback:it,next:null},wt?wt.next=dt.lastBufferedRequest:dt.bufferedRequest=dt.lastBufferedRequest,dt.bufferedRequestCount+=1}else O(tt,dt,!1,ft,at,vt,it);return ut}function O(tt,dt,rt,at,vt,it,Y){dt.writelen=at,dt.writecb=Y,dt.writing=!0,dt.sync=!0,dt.destroyed?dt.onwrite(new T("write")):rt?tt._writev(vt,dt.onwrite):tt._write(vt,it,dt.onwrite),dt.sync=!1}function N(tt,dt,rt,at,vt){--dt.pendingcb,rt?(process.nextTick(vt,at),process.nextTick(yt,tt,dt),tt._writableState.errorEmitted=!0,C(tt,at)):(vt(at),tt._writableState.errorEmitted=!0,C(tt,at),yt(tt,dt))}function V(tt){tt.writing=!1,tt.writecb=null,tt.length-=tt.writelen,tt.writelen=0}function H(tt,dt){var rt=tt._writableState,at=rt.sync,vt=rt.writecb;if(typeof vt!="function")throw new y;if(V(rt),dt)N(tt,rt,at,dt,vt);else{var it=q(rt)||tt.destroyed;!it&&!rt.corked&&!rt.bufferProcessing&&rt.bufferedRequest&&W(tt,rt),at?process.nextTick(F,tt,rt,it,vt):F(tt,rt,it,vt)}}function F(tt,dt,rt,at){rt||U(tt,dt),dt.pendingcb--,at(),yt(tt,dt)}function U(tt,dt){dt.length===0&&dt.needDrain&&(dt.needDrain=!1,tt.emit("drain"))}function W(tt,dt){dt.bufferProcessing=!0;var rt=dt.bufferedRequest;if(tt._writev&&rt&&rt.next){var at=dt.bufferedRequestCount,vt=new Array(at),it=dt.corkedRequestsFree;it.entry=rt;for(var Y=0,ft=!0;rt;)vt[Y]=rt,rt.isBuf||(ft=!1),rt=rt.next,Y+=1;vt.allBuffers=ft,O(tt,dt,!0,dt.length,vt,"",it.finish),dt.pendingcb++,dt.lastBufferedRequest=null,it.next?(dt.corkedRequestsFree=it.next,it.next=null):dt.corkedRequestsFree=new c(dt),dt.bufferedRequestCount=0}else{for(;rt;){var ut=rt.chunk,wt=rt.encoding,zt=rt.callback,Pt=dt.objectMode?1:ut.length;if(O(tt,dt,!1,Pt,ut,wt,zt),rt=rt.next,dt.bufferedRequestCount--,dt.writing)break}rt===null&&(dt.lastBufferedRequest=null)}dt.bufferedRequest=rt,dt.bufferProcessing=!1}h.prototype._write=function(tt,dt,rt){rt(new x("_write()"))},h.prototype._writev=null,h.prototype.end=function(tt,dt,rt){var at=this._writableState;return typeof tt=="function"?(rt=tt,tt=null,dt=null):typeof dt=="function"&&(rt=dt,dt=null),tt!=null&&this.write(tt,dt),at.corked&&(at.corked=1,this.uncork()),at.ending||pt(this,at,rt),this},Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function q(tt){return tt.ending&&tt.length===0&&tt.bufferedRequest===null&&!tt.finished&&!tt.writing}function X(tt,dt){tt._final(function(rt){dt.pendingcb--,rt&&C(tt,rt),dt.prefinished=!0,tt.emit("prefinish"),yt(tt,dt)})}function lt(tt,dt){!dt.prefinished&&!dt.finalCalled&&(typeof tt._final=="function"&&!dt.destroyed?(dt.pendingcb++,dt.finalCalled=!0,process.nextTick(X,tt,dt)):(dt.prefinished=!0,tt.emit("prefinish")))}function yt(tt,dt){var rt=q(dt);if(rt&&(lt(tt,dt),dt.pendingcb===0&&(dt.finished=!0,tt.emit("finish"),dt.autoDestroy))){var at=tt._readableState;(!at||at.autoDestroy&&at.endEmitted)&&tt.destroy()}return rt}function pt(tt,dt,rt){dt.ending=!0,yt(tt,dt),rt&&(dt.finished?process.nextTick(rt):tt.once("finish",rt)),dt.ended=!0,tt.writable=!1}function st(tt,dt,rt){var at=tt.entry;for(tt.entry=null;at;){var vt=at.callback;dt.pendingcb--,vt(rt),at=at.next}dt.corkedRequestsFree.next=tt}Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(tt){this._writableState&&(this._writableState.destroyed=tt)}}),h.prototype.destroy=n.destroy,h.prototype._undestroy=n.undestroy,h.prototype._destroy=function(tt,dt){dt(tt)}}),nx=Ft((Q,$)=>{var c=Object.keys||function(o){var i=[];for(var s in o)i.push(s);return i};$.exports=r;var g=O7(),P=z7();for(_v()(r,g),S=c(P.prototype),e=0;e<S.length;e++)t=S[e],r.prototype[t]||(r.prototype[t]=P.prototype[t]);var S,t,e;function r(o){if(!(this instanceof r))return new r(o);g.call(this,o),P.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",a)))}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 a(){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)}})}),CB=Ft((Q,$)=>{var c=tx(),g=c.Buffer;function P(t,e){for(var r in t)e[r]=t[r]}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?$.exports=c:(P(c,Q),Q.Buffer=S);function S(t,e,r){return g(t,e,r)}S.prototype=Object.create(g.prototype),P(g,S),S.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return g(t,e,r)},S.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var a=g(t);return e!==void 0?typeof r=="string"?a.fill(e,r):a.fill(e):a.fill(0),a},S.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return g(t)},S.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return c.SlowBuffer(t)}}),I7=Ft(Q=>{var $=CB().Buffer,c=$.isEncoding||function(T){switch(T=""+T,T&&T.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function g(T){if(!T)return"utf8";for(var u;;)switch(T){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 T;default:if(u)return;T=(""+T).toLowerCase(),u=!0}}function P(T){var u=g(T);if(typeof u!="string"&&($.isEncoding===c||!c(T)))throw new Error("Unknown encoding: "+T);return u||T}Q.StringDecoder=S;function S(T){this.encoding=P(T);var u;switch(this.encoding){case"utf16le":this.text=i,this.end=s,u=4;break;case"utf8":this.fillLast=a,u=4;break;case"base64":this.text=f,this.end=x,u=3;break;default:this.write=y,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=$.allocUnsafe(u)}S.prototype.write=function(T){if(T.length===0)return"";var u,b;if(this.lastNeed){if(u=this.fillLast(T),u===void 0)return"";b=this.lastNeed,this.lastNeed=0}else b=0;return b<T.length?u?u+this.text(T,b):this.text(T,b):u||""},S.prototype.end=o,S.prototype.text=n,S.prototype.fillLast=function(T){if(this.lastNeed<=T.length)return T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,T.length),this.lastNeed-=T.length};function t(T){return T<=127?0:T>>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function e(T,u,b){var _=u.length-1;if(_<b)return 0;var C=t(u[_]);return C>=0?(C>0&&(T.lastNeed=C-1),C):--_<b||C===-2?0:(C=t(u[_]),C>=0?(C>0&&(T.lastNeed=C-2),C):--_<b||C===-2?0:(C=t(u[_]),C>=0?(C>0&&(C===2?C=0:T.lastNeed=C-3),C):0))}function r(T,u,b){if((u[0]&192)!==128)return T.lastNeed=0,"";if(T.lastNeed>1&&u.length>1){if((u[1]&192)!==128)return T.lastNeed=1,"";if(T.lastNeed>2&&u.length>2&&(u[2]&192)!==128)return T.lastNeed=2,""}}function a(T){var u=this.lastTotal-this.lastNeed,b=r(this,T);if(b!==void 0)return b;if(this.lastNeed<=T.length)return T.copy(this.lastChar,u,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,u,0,T.length),this.lastNeed-=T.length}function n(T,u){var b=e(this,T,u);if(!this.lastNeed)return T.toString("utf8",u);this.lastTotal=b;var _=T.length-(b-this.lastNeed);return T.copy(this.lastChar,0,_),T.toString("utf8",u,_)}function o(T){var u=T&&T.length?this.write(T):"";return this.lastNeed?u+"":u}function i(T,u){if((T.length-u)%2===0){var b=T.toString("utf16le",u);if(b){var _=b.charCodeAt(b.length-1);if(_>=55296&&_<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],b.slice(0,-1)}return b}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",u,T.length-1)}function s(T){var u=T&&T.length?this.write(T):"";if(this.lastNeed){var b=this.lastTotal-this.lastNeed;return u+this.lastChar.toString("utf16le",0,b)}return u}function f(T,u){var b=(T.length-u)%3;return b===0?T.toString("base64",u):(this.lastNeed=3-b,this.lastTotal=3,b===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",u,T.length-b))}function x(T){var u=T&&T.length?this.write(T):"";return this.lastNeed?u+this.lastChar.toString("base64",0,3-this.lastNeed):u}function y(T){return T.toString(this.encoding)}function v(T){return T&&T.length?this.write(T):""}}),ak=Ft((Q,$)=>{var c=rx().codes.ERR_STREAM_PREMATURE_CLOSE;function g(e){var r=!1;return function(){if(!r){r=!0;for(var a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];e.apply(this,n)}}}function P(){}function S(e){return e.setHeader&&typeof e.abort=="function"}function t(e,r,a){if(typeof r=="function")return t(e,null,r);r||(r={}),a=g(a||P);var n=r.readable||r.readable!==!1&&e.readable,o=r.writable||r.writable!==!1&&e.writable,i=function(){e.writable||f()},s=e._writableState&&e._writableState.finished,f=function(){o=!1,s=!0,n||a.call(e)},x=e._readableState&&e._readableState.endEmitted,y=function(){n=!1,x=!0,o||a.call(e)},v=function(b){a.call(e,b)},T=function(){var b;if(n&&!x)return(!e._readableState||!e._readableState.ended)&&(b=new c),a.call(e,b);if(o&&!s)return(!e._writableState||!e._writableState.ended)&&(b=new c),a.call(e,b)},u=function(){e.req.on("finish",f)};return S(e)?(e.on("complete",f),e.on("abort",T),e.req?u():e.on("request",u)):o&&!e._writableState&&(e.on("end",i),e.on("close",i)),e.on("end",y),e.on("finish",f),r.error!==!1&&e.on("error",v),e.on("close",T),function(){e.removeListener("complete",f),e.removeListener("abort",T),e.removeListener("request",u),e.req&&e.req.removeListener("finish",f),e.removeListener("end",i),e.removeListener("close",i),e.removeListener("finish",f),e.removeListener("end",y),e.removeListener("error",v),e.removeListener("close",T)}}$.exports=t}),LB=Ft((Q,$)=>{var c;function g(u,b,_){return b in u?Object.defineProperty(u,b,{value:_,enumerable:!0,configurable:!0,writable:!0}):u[b]=_,u}var P=ak(),S=Symbol("lastResolve"),t=Symbol("lastReject"),e=Symbol("error"),r=Symbol("ended"),a=Symbol("lastPromise"),n=Symbol("handlePromise"),o=Symbol("stream");function i(u,b){return{value:u,done:b}}function s(u){var b=u[S];if(b!==null){var _=u[o].read();_!==null&&(u[a]=null,u[S]=null,u[t]=null,b(i(_,!1)))}}function f(u){process.nextTick(s,u)}function x(u,b){return function(_,C){u.then(function(){if(b[r]){_(i(void 0,!0));return}b[n](_,C)},C)}}var y=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((c={get stream(){return this[o]},next:function(){var u=this,b=this[e];if(b!==null)return Promise.reject(b);if(this[r])return Promise.resolve(i(void 0,!0));if(this[o].destroyed)return new Promise(function(E,A){process.nextTick(function(){u[e]?A(u[e]):E(i(void 0,!0))})});var _=this[a],C;if(_)C=new Promise(x(_,this));else{var M=this[o].read();if(M!==null)return Promise.resolve(i(M,!1));C=new Promise(this[n])}return this[a]=C,C}},g(c,Symbol.asyncIterator,function(){return this}),g(c,"return",function(){var u=this;return new Promise(function(b,_){u[o].destroy(null,function(C){if(C){_(C);return}b(i(void 0,!0))})})}),c),y),T=function(u){var b,_=Object.create(v,(b={},g(b,o,{value:u,writable:!0}),g(b,S,{value:null,writable:!0}),g(b,t,{value:null,writable:!0}),g(b,e,{value:null,writable:!0}),g(b,r,{value:u._readableState.endEmitted,writable:!0}),g(b,n,{value:function(C,M){var E=_[o].read();E?(_[a]=null,_[S]=null,_[t]=null,C(i(E,!1))):(_[S]=C,_[t]=M)},writable:!0}),b));return _[a]=null,P(u,function(C){if(C&&C.code!=="ERR_STREAM_PREMATURE_CLOSE"){var M=_[t];M!==null&&(_[a]=null,_[S]=null,_[t]=null,M(C)),_[e]=C;return}var E=_[S];E!==null&&(_[a]=null,_[S]=null,_[t]=null,E(i(void 0,!0))),_[r]=!0}),u.on("readable",f.bind(null,_)),_};$.exports=T}),PB=Ft((Q,$)=>{$.exports=function(){throw new Error("Readable.from is not available in the browser")}}),O7=Ft((Q,$)=>{$.exports=p;var c;p.ReadableState=h,Im().EventEmitter;var g=function(it,Y){return it.listeners(Y).length},P=y7(),S=tx().Buffer,t=window.Uint8Array||function(){};function e(it){return S.from(it)}function r(it){return S.isBuffer(it)||it instanceof t}var a=C7(),n;a&&a.debuglog?n=a.debuglog("stream"):n=function(){};var o=SB(),i=L7(),s=P7(),f=s.getHighWaterMark,x=rx().codes,y=x.ERR_INVALID_ARG_TYPE,v=x.ERR_STREAM_PUSH_AFTER_EOF,T=x.ERR_METHOD_NOT_IMPLEMENTED,u=x.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,b,_,C;_v()(p,P);var M=i.errorOrDestroy,E=["error","close","destroy","pause","resume"];function A(it,Y,ft){if(typeof it.prependListener=="function")return it.prependListener(Y,ft);!it._events||!it._events[Y]?it.on(Y,ft):Array.isArray(it._events[Y])?it._events[Y].unshift(ft):it._events[Y]=[ft,it._events[Y]]}function h(it,Y,ft){c=c||nx(),it=it||{},typeof ft!="boolean"&&(ft=Y instanceof c),this.objectMode=!!it.objectMode,ft&&(this.objectMode=this.objectMode||!!it.readableObjectMode),this.highWaterMark=f(this,it,"readableHighWaterMark",ft),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=it.emitClose!==!1,this.autoDestroy=!!it.autoDestroy,this.destroyed=!1,this.defaultEncoding=it.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,it.encoding&&(b||(b=I7().StringDecoder),this.decoder=new b(it.encoding),this.encoding=it.encoding)}function p(it){if(c=c||nx(),!(this instanceof p))return new p(it);var Y=this instanceof c;this._readableState=new h(it,this,Y),this.readable=!0,it&&(typeof it.read=="function"&&(this._read=it.read),typeof it.destroy=="function"&&(this._destroy=it.destroy)),P.call(this)}Object.defineProperty(p.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(it){this._readableState&&(this._readableState.destroyed=it)}}),p.prototype.destroy=i.destroy,p.prototype._undestroy=i.undestroy,p.prototype._destroy=function(it,Y){Y(it)},p.prototype.push=function(it,Y){var ft=this._readableState,ut;return ft.objectMode?ut=!0:typeof it=="string"&&(Y=Y||ft.defaultEncoding,Y!==ft.encoding&&(it=S.from(it,Y),Y=""),ut=!0),k(this,it,Y,!1,ut)},p.prototype.unshift=function(it){return k(this,it,null,!0,!1)};function k(it,Y,ft,ut,wt){n("readableAddChunk",Y);var zt=it._readableState;if(Y===null)zt.reading=!1,H(it,zt);else{var Pt;if(wt||(Pt=R(zt,Y)),Pt)M(it,Pt);else if(zt.objectMode||Y&&Y.length>0)if(typeof Y!="string"&&!zt.objectMode&&Object.getPrototypeOf(Y)!==S.prototype&&(Y=e(Y)),ut)zt.endEmitted?M(it,new u):w(it,zt,Y,!0);else if(zt.ended)M(it,new v);else{if(zt.destroyed)return!1;zt.reading=!1,zt.decoder&&!ft?(Y=zt.decoder.write(Y),zt.objectMode||Y.length!==0?w(it,zt,Y,!1):W(it,zt)):w(it,zt,Y,!1)}else ut||(zt.reading=!1,W(it,zt))}return!zt.ended&&(zt.length<zt.highWaterMark||zt.length===0)}function w(it,Y,ft,ut){Y.flowing&&Y.length===0&&!Y.sync?(Y.awaitDrain=0,it.emit("data",ft)):(Y.length+=Y.objectMode?1:ft.length,ut?Y.buffer.unshift(ft):Y.buffer.push(ft),Y.needReadable&&F(it)),W(it,Y)}function R(it,Y){var ft;return!r(Y)&&typeof Y!="string"&&Y!==void 0&&!it.objectMode&&(ft=new y("chunk",["string","Buffer","Uint8Array"],Y)),ft}p.prototype.isPaused=function(){return this._readableState.flowing===!1},p.prototype.setEncoding=function(it){b||(b=I7().StringDecoder);var Y=new b(it);this._readableState.decoder=Y,this._readableState.encoding=this._readableState.decoder.encoding;for(var ft=this._readableState.buffer.head,ut="";ft!==null;)ut+=Y.write(ft.data),ft=ft.next;return this._readableState.buffer.clear(),ut!==""&&this._readableState.buffer.push(ut),this._readableState.length=ut.length,this};var O=1073741824;function N(it){return it>=O?it=O:(it--,it|=it>>>1,it|=it>>>2,it|=it>>>4,it|=it>>>8,it|=it>>>16,it++),it}function V(it,Y){return it<=0||Y.length===0&&Y.ended?0:Y.objectMode?1:it!==it?Y.flowing&&Y.length?Y.buffer.head.data.length:Y.length:(it>Y.highWaterMark&&(Y.highWaterMark=N(it)),it<=Y.length?it:Y.ended?Y.length:(Y.needReadable=!0,0))}p.prototype.read=function(it){n("read",it),it=parseInt(it,10);var Y=this._readableState,ft=it;if(it!==0&&(Y.emittedReadable=!1),it===0&&Y.needReadable&&((Y.highWaterMark!==0?Y.length>=Y.highWaterMark:Y.length>0)||Y.ended))return n("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended?rt(this):F(this),null;if(it=V(it,Y),it===0&&Y.ended)return Y.length===0&&rt(this),null;var ut=Y.needReadable;n("need readable",ut),(Y.length===0||Y.length-it<Y.highWaterMark)&&(ut=!0,n("length less than watermark",ut)),Y.ended||Y.reading?(ut=!1,n("reading or ended",ut)):ut&&(n("do read"),Y.reading=!0,Y.sync=!0,Y.length===0&&(Y.needReadable=!0),this._read(Y.highWaterMark),Y.sync=!1,Y.reading||(it=V(ft,Y)));var wt;return it>0?wt=dt(it,Y):wt=null,wt===null?(Y.needReadable=Y.length<=Y.highWaterMark,it=0):(Y.length-=it,Y.awaitDrain=0),Y.length===0&&(Y.ended||(Y.needReadable=!0),ft!==it&&Y.ended&&rt(this)),wt!==null&&this.emit("data",wt),wt};function H(it,Y){if(n("onEofChunk"),!Y.ended){if(Y.decoder){var ft=Y.decoder.end();ft&&ft.length&&(Y.buffer.push(ft),Y.length+=Y.objectMode?1:ft.length)}Y.ended=!0,Y.sync?F(it):(Y.needReadable=!1,Y.emittedReadable||(Y.emittedReadable=!0,U(it)))}}function F(it){var Y=it._readableState;n("emitReadable",Y.needReadable,Y.emittedReadable),Y.needReadable=!1,Y.emittedReadable||(n("emitReadable",Y.flowing),Y.emittedReadable=!0,process.nextTick(U,it))}function U(it){var Y=it._readableState;n("emitReadable_",Y.destroyed,Y.length,Y.ended),!Y.destroyed&&(Y.length||Y.ended)&&(it.emit("readable"),Y.emittedReadable=!1),Y.needReadable=!Y.flowing&&!Y.ended&&Y.length<=Y.highWaterMark,tt(it)}function W(it,Y){Y.readingMore||(Y.readingMore=!0,process.nextTick(q,it,Y))}function q(it,Y){for(;!Y.reading&&!Y.ended&&(Y.length<Y.highWaterMark||Y.flowing&&Y.length===0);){var ft=Y.length;if(n("maybeReadMore read 0"),it.read(0),ft===Y.length)break}Y.readingMore=!1}p.prototype._read=function(it){M(this,new T("_read()"))},p.prototype.pipe=function(it,Y){var ft=this,ut=this._readableState;switch(ut.pipesCount){case 0:ut.pipes=it;break;case 1:ut.pipes=[ut.pipes,it];break;default:ut.pipes.push(it);break}ut.pipesCount+=1,n("pipe count=%d opts=%j",ut.pipesCount,Y);var wt=(!Y||Y.end!==!1)&&it!==process.stdout&&it!==process.stderr,zt=wt?Wt:Lt;ut.endEmitted?process.nextTick(zt):ft.once("end",zt),it.on("unpipe",Pt);function Pt(Mt,te){n("onunpipe"),Mt===ft&&te&&te.hasUnpiped===!1&&(te.hasUnpiped=!0,ge())}function Wt(){n("onend"),it.end()}var Ht=X(ft);it.on("drain",Ht);var Jt=!1;function ge(){n("cleanup"),it.removeListener("close",se),it.removeListener("finish",Tt),it.removeListener("drain",Ht),it.removeListener("error",de),it.removeListener("unpipe",Pt),ft.removeListener("end",Wt),ft.removeListener("end",Lt),ft.removeListener("data",he),Jt=!0,ut.awaitDrain&&(!it._writableState||it._writableState.needDrain)&&Ht()}ft.on("data",he);function he(Mt){n("ondata");var te=it.write(Mt);n("dest.write",te),te===!1&&((ut.pipesCount===1&&ut.pipes===it||ut.pipesCount>1&&vt(ut.pipes,it)!==-1)&&!Jt&&(n("false write response, pause",ut.awaitDrain),ut.awaitDrain++),ft.pause())}function de(Mt){n("onerror",Mt),Lt(),it.removeListener("error",de),g(it,"error")===0&&M(it,Mt)}A(it,"error",de);function se(){it.removeListener("finish",Tt),Lt()}it.once("close",se);function Tt(){n("onfinish"),it.removeListener("close",se),Lt()}it.once("finish",Tt);function Lt(){n("unpipe"),ft.unpipe(it)}return it.emit("pipe",ft),ut.flowing||(n("pipe resume"),ft.resume()),it};function X(it){return function(){var Y=it._readableState;n("pipeOnDrain",Y.awaitDrain),Y.awaitDrain&&Y.awaitDrain--,Y.awaitDrain===0&&g(it,"data")&&(Y.flowing=!0,tt(it))}}p.prototype.unpipe=function(it){var Y=this._readableState,ft={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1)return it&&it!==Y.pipes?this:(it||(it=Y.pipes),Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,it&&it.emit("unpipe",this,ft),this);if(!it){var ut=Y.pipes,wt=Y.pipesCount;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var zt=0;zt<wt;zt++)ut[zt].emit("unpipe",this,{hasUnpiped:!1});return this}var Pt=vt(Y.pipes,it);return Pt===-1?this:(Y.pipes.splice(Pt,1),Y.pipesCount-=1,Y.pipesCount===1&&(Y.pipes=Y.pipes[0]),it.emit("unpipe",this,ft),this)},p.prototype.on=function(it,Y){var ft=P.prototype.on.call(this,it,Y),ut=this._readableState;return it==="data"?(ut.readableListening=this.listenerCount("readable")>0,ut.flowing!==!1&&this.resume()):it==="readable"&&!ut.endEmitted&&!ut.readableListening&&(ut.readableListening=ut.needReadable=!0,ut.flowing=!1,ut.emittedReadable=!1,n("on readable",ut.length,ut.reading),ut.length?F(this):ut.reading||process.nextTick(yt,this)),ft},p.prototype.addListener=p.prototype.on,p.prototype.removeListener=function(it,Y){var ft=P.prototype.removeListener.call(this,it,Y);return it==="readable"&&process.nextTick(lt,this),ft},p.prototype.removeAllListeners=function(it){var Y=P.prototype.removeAllListeners.apply(this,arguments);return(it==="readable"||it===void 0)&&process.nextTick(lt,this),Y};function lt(it){var Y=it._readableState;Y.readableListening=it.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused?Y.flowing=!0:it.listenerCount("data")>0&&it.resume()}function yt(it){n("readable nexttick read 0"),it.read(0)}p.prototype.resume=function(){var it=this._readableState;return it.flowing||(n("resume"),it.flowing=!it.readableListening,pt(this,it)),it.paused=!1,this};function pt(it,Y){Y.resumeScheduled||(Y.resumeScheduled=!0,process.nextTick(st,it,Y))}function st(it,Y){n("resume",Y.reading),Y.reading||it.read(0),Y.resumeScheduled=!1,it.emit("resume"),tt(it),Y.flowing&&!Y.reading&&it.read(0)}p.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 tt(it){var Y=it._readableState;for(n("flow",Y.flowing);Y.flowing&&it.read()!==null;);}p.prototype.wrap=function(it){var Y=this,ft=this._readableState,ut=!1;it.on("end",function(){if(n("wrapped end"),ft.decoder&&!ft.ended){var Pt=ft.decoder.end();Pt&&Pt.length&&Y.push(Pt)}Y.push(null)}),it.on("data",function(Pt){if(n("wrapped data"),ft.decoder&&(Pt=ft.decoder.write(Pt)),!(ft.objectMode&&Pt==null)&&!(!ft.objectMode&&(!Pt||!Pt.length))){var Wt=Y.push(Pt);Wt||(ut=!0,it.pause())}});for(var wt in it)this[wt]===void 0&&typeof it[wt]=="function"&&(this[wt]=function(Pt){return function(){return it[Pt].apply(it,arguments)}}(wt));for(var zt=0;zt<E.length;zt++)it.on(E[zt],this.emit.bind(this,E[zt]));return this._read=function(Pt){n("wrapped _read",Pt),ut&&(ut=!1,it.resume())},this},typeof Symbol=="function"&&(p.prototype[Symbol.asyncIterator]=function(){return _===void 0&&(_=LB()),_(this)}),Object.defineProperty(p.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(p.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(p.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(it){this._readableState&&(this._readableState.flowing=it)}}),p._fromList=dt,Object.defineProperty(p.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function dt(it,Y){if(Y.length===0)return null;var ft;return Y.objectMode?ft=Y.buffer.shift():!it||it>=Y.length?(Y.decoder?ft=Y.buffer.join(""):Y.buffer.length===1?ft=Y.buffer.first():ft=Y.buffer.concat(Y.length),Y.buffer.clear()):ft=Y.buffer.consume(it,Y.decoder),ft}function rt(it){var Y=it._readableState;n("endReadable",Y.endEmitted),Y.endEmitted||(Y.ended=!0,process.nextTick(at,Y,it))}function at(it,Y){if(n("endReadableNT",it.endEmitted,it.length),!it.endEmitted&&it.length===0&&(it.endEmitted=!0,Y.readable=!1,Y.emit("end"),it.autoDestroy)){var ft=Y._writableState;(!ft||ft.autoDestroy&&ft.finished)&&Y.destroy()}}typeof Symbol=="function"&&(p.from=function(it,Y){return C===void 0&&(C=PB()),C(p,it,Y)});function vt(it,Y){for(var ft=0,ut=it.length;ft<ut;ft++)if(it[ft]===Y)return ft;return-1}}),D7=Ft((Q,$)=>{$.exports=a;var c=rx().codes,g=c.ERR_METHOD_NOT_IMPLEMENTED,P=c.ERR_MULTIPLE_CALLBACK,S=c.ERR_TRANSFORM_ALREADY_TRANSFORMING,t=c.ERR_TRANSFORM_WITH_LENGTH_0,e=nx();_v()(a,e);function r(i,s){var f=this._transformState;f.transforming=!1;var x=f.writecb;if(x===null)return this.emit("error",new P);f.writechunk=null,f.writecb=null,s!=null&&this.push(s),x(i);var y=this._readableState;y.reading=!1,(y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}function a(i){if(!(this instanceof a))return new a(i);e.call(this,i),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,i&&(typeof i.transform=="function"&&(this._transform=i.transform),typeof i.flush=="function"&&(this._flush=i.flush)),this.on("prefinish",n)}function n(){var i=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,f){o(i,s,f)}):o(this,null,null)}a.prototype.push=function(i,s){return this._transformState.needTransform=!1,e.prototype.push.call(this,i,s)},a.prototype._transform=function(i,s,f){f(new g("_transform()"))},a.prototype._write=function(i,s,f){var x=this._transformState;if(x.writecb=f,x.writechunk=i,x.writeencoding=s,!x.transforming){var y=this._readableState;(x.needTransform||y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}},a.prototype._read=function(i){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},a.prototype._destroy=function(i,s){e.prototype._destroy.call(this,i,function(f){s(f)})};function o(i,s,f){if(s)return i.emit("error",s);if(f!=null&&i.push(f),i._writableState.length)throw new t;if(i._transformState.transforming)throw new S;return i.push(null)}}),zB=Ft((Q,$)=>{$.exports=g;var c=D7();_v()(g,c);function g(P){if(!(this instanceof g))return new g(P);c.call(this,P)}g.prototype._transform=function(P,S,t){t(null,P)}}),IB=Ft((Q,$)=>{var c;function g(f){var x=!1;return function(){x||(x=!0,f.apply(void 0,arguments))}}var P=rx().codes,S=P.ERR_MISSING_ARGS,t=P.ERR_STREAM_DESTROYED;function e(f){if(f)throw f}function r(f){return f.setHeader&&typeof f.abort=="function"}function a(f,x,y,v){v=g(v);var T=!1;f.on("close",function(){T=!0}),c===void 0&&(c=ak()),c(f,{readable:x,writable:y},function(b){if(b)return v(b);T=!0,v()});var u=!1;return function(b){if(!T&&!u){if(u=!0,r(f))return f.abort();if(typeof f.destroy=="function")return f.destroy();v(b||new t("pipe"))}}}function n(f){f()}function o(f,x){return f.pipe(x)}function i(f){return!f.length||typeof f[f.length-1]!="function"?e:f.pop()}function s(){for(var f=arguments.length,x=new Array(f),y=0;y<f;y++)x[y]=arguments[y];var v=i(x);if(Array.isArray(x[0])&&(x=x[0]),x.length<2)throw new S("streams");var T,u=x.map(function(b,_){var C=_<x.length-1,M=_>0;return a(b,C,M,function(E){T||(T=E),E&&u.forEach(n),!C&&(u.forEach(n),v(T))})});return x.reduce(o)}$.exports=s}),OB=Ft((Q,$)=>{$.exports=P;var c=Im().EventEmitter,g=_v();g(P,c),P.Readable=O7(),P.Writable=z7(),P.Duplex=nx(),P.Transform=D7(),P.PassThrough=zB(),P.finished=ak(),P.pipeline=IB(),P.Stream=P;function P(){c.call(this)}P.prototype.pipe=function(S,t){var e=this;function r(x){S.writable&&S.write(x)===!1&&e.pause&&e.pause()}e.on("data",r);function a(){e.readable&&e.resume&&e.resume()}S.on("drain",a),!S._isStdio&&(!t||t.end!==!1)&&(e.on("end",o),e.on("close",i));var n=!1;function o(){n||(n=!0,S.end())}function i(){n||(n=!0,typeof S.destroy=="function"&&S.destroy())}function s(x){if(f(),c.listenerCount(this,"error")===0)throw x}e.on("error",s),S.on("error",s);function f(){e.removeListener("data",r),S.removeListener("drain",a),e.removeListener("end",o),e.removeListener("close",i),e.removeListener("error",s),S.removeListener("error",s),e.removeListener("end",f),e.removeListener("close",f),S.removeListener("close",f)}return e.on("end",f),e.on("close",f),S.on("close",f),S.emit("pipe",e),S}}),nb=Ft(Q=>{var $=Object.getOwnPropertyDescriptors||function(q){for(var X=Object.keys(q),lt={},yt=0;yt<X.length;yt++)lt[X[yt]]=Object.getOwnPropertyDescriptor(q,X[yt]);return lt},c=/%[sdj%]/g;Q.format=function(q){if(!_(q)){for(var X=[],lt=0;lt<arguments.length;lt++)X.push(t(arguments[lt]));return X.join(" ")}for(var lt=1,yt=arguments,pt=yt.length,st=String(q).replace(c,function(rt){if(rt==="%%")return"%";if(lt>=pt)return rt;switch(rt){case"%s":return String(yt[lt++]);case"%d":return Number(yt[lt++]);case"%j":try{return JSON.stringify(yt[lt++])}catch{return"[Circular]"}default:return rt}}),tt=yt[lt];lt<pt;tt=yt[++lt])T(tt)||!A(tt)?st+=" "+tt:st+=" "+t(tt);return st},Q.deprecate=function(q,X){if(typeof process<"u"&&process.noDeprecation===!0)return q;if(typeof process>"u")return function(){return Q.deprecate(q,X).apply(this,arguments)};var lt=!1;function yt(){if(!lt){if(process.throwDeprecation)throw new Error(X);process.traceDeprecation?console.trace(X):console.error(X),lt=!0}return q.apply(this,arguments)}return yt};var g={},P=/^$/;S="false",S=S.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),P=new RegExp("^"+S+"$","i");var S;Q.debuglog=function(q){if(q=q.toUpperCase(),!g[q])if(P.test(q)){var X=process.pid;g[q]=function(){var lt=Q.format.apply(Q,arguments);console.error("%s %d: %s",q,X,lt)}}else g[q]=function(){};return g[q]};function t(q,X){var lt={seen:[],stylize:r};return arguments.length>=3&&(lt.depth=arguments[2]),arguments.length>=4&&(lt.colors=arguments[3]),v(X)?lt.showHidden=X:X&&Q._extend(lt,X),M(lt.showHidden)&&(lt.showHidden=!1),M(lt.depth)&&(lt.depth=2),M(lt.colors)&&(lt.colors=!1),M(lt.customInspect)&&(lt.customInspect=!0),lt.colors&&(lt.stylize=e),n(lt,q,lt.depth)}Q.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(q,X){var lt=t.styles[X];return lt?"\x1B["+t.colors[lt][0]+"m"+q+"\x1B["+t.colors[lt][1]+"m":q}function r(q,X){return q}function a(q){var X={};return q.forEach(function(lt,yt){X[lt]=!0}),X}function n(q,X,lt){if(q.customInspect&&X&&k(X.inspect)&&X.inspect!==Q.inspect&&!(X.constructor&&X.constructor.prototype===X)){var yt=X.inspect(lt,q);return _(yt)||(yt=n(q,yt,lt)),yt}var pt=o(q,X);if(pt)return pt;var st=Object.keys(X),tt=a(st);if(q.showHidden&&(st=Object.getOwnPropertyNames(X)),p(X)&&(st.indexOf("message")>=0||st.indexOf("description")>=0))return i(X);if(st.length===0){if(k(X)){var dt=X.name?": "+X.name:"";return q.stylize("[Function"+dt+"]","special")}if(E(X))return q.stylize(RegExp.prototype.toString.call(X),"regexp");if(h(X))return q.stylize(Date.prototype.toString.call(X),"date");if(p(X))return i(X)}var rt="",at=!1,vt=["{","}"];if(y(X)&&(at=!0,vt=["[","]"]),k(X)){var it=X.name?": "+X.name:"";rt=" [Function"+it+"]"}if(E(X)&&(rt=" "+RegExp.prototype.toString.call(X)),h(X)&&(rt=" "+Date.prototype.toUTCString.call(X)),p(X)&&(rt=" "+i(X)),st.length===0&&(!at||X.length==0))return vt[0]+rt+vt[1];if(lt<0)return E(X)?q.stylize(RegExp.prototype.toString.call(X),"regexp"):q.stylize("[Object]","special");q.seen.push(X);var Y;return at?Y=s(q,X,lt,tt,st):Y=st.map(function(ft){return f(q,X,lt,tt,ft,at)}),q.seen.pop(),x(Y,rt,vt)}function o(q,X){if(M(X))return q.stylize("undefined","undefined");if(_(X)){var lt="'"+JSON.stringify(X).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return q.stylize(lt,"string")}if(b(X))return q.stylize(""+X,"number");if(v(X))return q.stylize(""+X,"boolean");if(T(X))return q.stylize("null","null")}function i(q){return"["+Error.prototype.toString.call(q)+"]"}function s(q,X,lt,yt,pt){for(var st=[],tt=0,dt=X.length;tt<dt;++tt)H(X,String(tt))?st.push(f(q,X,lt,yt,String(tt),!0)):st.push("");return pt.forEach(function(rt){rt.match(/^\d+$/)||st.push(f(q,X,lt,yt,rt,!0))}),st}function f(q,X,lt,yt,pt,st){var tt,dt,rt;if(rt=Object.getOwnPropertyDescriptor(X,pt)||{value:X[pt]},rt.get?rt.set?dt=q.stylize("[Getter/Setter]","special"):dt=q.stylize("[Getter]","special"):rt.set&&(dt=q.stylize("[Setter]","special")),H(yt,pt)||(tt="["+pt+"]"),dt||(q.seen.indexOf(rt.value)<0?(T(lt)?dt=n(q,rt.value,null):dt=n(q,rt.value,lt-1),dt.indexOf(`
`)>-1&&(st?dt=dt.split(`
`).map(function(at){return" "+at}).join(`
`).slice(2):dt=`
`+dt.split(`
`).map(function(at){return" "+at}).join(`
`))):dt=q.stylize("[Circular]","special")),M(tt)){if(st&&pt.match(/^\d+$/))return dt;tt=JSON.stringify(""+pt),tt.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(tt=tt.slice(1,-1),tt=q.stylize(tt,"name")):(tt=tt.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),tt=q.stylize(tt,"string"))}return tt+": "+dt}function x(q,X,lt){var yt=0,pt=q.reduce(function(st,tt){return yt++,tt.indexOf(`
`)>=0&&yt++,st+tt.replace(/\u001b\[\d\d?m/g,"").length+1},0);return pt>60?lt[0]+(X===""?"":X+`
`)+" "+q.join(`,
`)+" "+lt[1]:lt[0]+X+" "+q.join(", ")+" "+lt[1]}Q.types=S7();function y(q){return Array.isArray(q)}Q.isArray=y;function v(q){return typeof q=="boolean"}Q.isBoolean=v;function T(q){return q===null}Q.isNull=T;function u(q){return q==null}Q.isNullOrUndefined=u;function b(q){return typeof q=="number"}Q.isNumber=b;function _(q){return typeof q=="string"}Q.isString=_;function C(q){return typeof q=="symbol"}Q.isSymbol=C;function M(q){return q===void 0}Q.isUndefined=M;function E(q){return A(q)&&R(q)==="[object RegExp]"}Q.isRegExp=E,Q.types.isRegExp=E;function A(q){return typeof q=="object"&&q!==null}Q.isObject=A;function h(q){return A(q)&&R(q)==="[object Date]"}Q.isDate=h,Q.types.isDate=h;function p(q){return A(q)&&(R(q)==="[object Error]"||q instanceof Error)}Q.isError=p,Q.types.isNativeError=p;function k(q){return typeof q=="function"}Q.isFunction=k;function w(q){return q===null||typeof q=="boolean"||typeof q=="number"||typeof q=="string"||typeof q=="symbol"||typeof q>"u"}Q.isPrimitive=w,Q.isBuffer=E7();function R(q){return Object.prototype.toString.call(q)}function O(q){return q<10?"0"+q.toString(10):q.toString(10)}var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var q=new Date,X=[O(q.getHours()),O(q.getMinutes()),O(q.getSeconds())].join(":");return[q.getDate(),N[q.getMonth()],X].join(" ")}Q.log=function(){console.log("%s - %s",V(),Q.format.apply(Q,arguments))},Q.inherits=_v(),Q._extend=function(q,X){if(!X||!A(X))return q;for(var lt=Object.keys(X),yt=lt.length;yt--;)q[lt[yt]]=X[lt[yt]];return q};function H(q,X){return Object.prototype.hasOwnProperty.call(q,X)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Q.promisify=function(q){if(typeof q!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&q[F]){var X=q[F];if(typeof X!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(X,F,{value:X,enumerable:!1,writable:!1,configurable:!0}),X}function X(){for(var lt,yt,pt=new Promise(function(dt,rt){lt=dt,yt=rt}),st=[],tt=0;tt<arguments.length;tt++)st.push(arguments[tt]);st.push(function(dt,rt){dt?yt(dt):lt(rt)});try{q.apply(this,st)}catch(dt){yt(dt)}return pt}return Object.setPrototypeOf(X,Object.getPrototypeOf(q)),F&&Object.defineProperty(X,F,{value:X,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(X,$(q))},Q.promisify.custom=F;function U(q,X){if(!q){var lt=new Error("Promise was rejected with a falsy value");lt.reason=q,q=lt}return X(q)}function W(q){if(typeof q!="function")throw new TypeError('The "original" argument must be of type Function');function X(){for(var lt=[],yt=0;yt<arguments.length;yt++)lt.push(arguments[yt]);var pt=lt.pop();if(typeof pt!="function")throw new TypeError("The last argument must be of type Function");var st=this,tt=function(){return pt.apply(st,arguments)};q.apply(this,lt).then(function(dt){process.nextTick(tt.bind(null,null,dt))},function(dt){process.nextTick(U.bind(null,dt,tt))})}return Object.setPrototypeOf(X,Object.getPrototypeOf(q)),Object.defineProperties(X,$(q)),X}Q.callbackify=W}),F7=Ft((Q,$)=>{function c(b){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},c(b)}function g(b,_,C){return Object.defineProperty(b,"prototype",{writable:!1}),b}function P(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function S(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),Object.defineProperty(b,"prototype",{writable:!1}),_&&t(b,_)}function t(b,_){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,M){return C.__proto__=M,C},t(b,_)}function e(b){var _=n();return function(){var C=o(b),M;if(_){var E=o(this).constructor;M=Reflect.construct(C,arguments,E)}else M=C.apply(this,arguments);return r(this,M)}}function r(b,_){if(_&&(c(_)==="object"||typeof _=="function"))return _;if(_!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a(b)}function a(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}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(b){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(_){return _.__proto__||Object.getPrototypeOf(_)},o(b)}var i={},s,f;function x(b,_,C){C||(C=Error);function M(A,h,p){return typeof _=="string"?_:_(A,h,p)}var E=function(A){S(p,A);var h=e(p);function p(k,w,R){var O;return P(this,p),O=h.call(this,M(k,w,R)),O.code=b,O}return g(p)}(C);i[b]=E}function y(b,_){if(Array.isArray(b)){var C=b.length;return b=b.map(function(M){return String(M)}),C>2?"one of ".concat(_," ").concat(b.slice(0,C-1).join(", "),", or ")+b[C-1]:C===2?"one of ".concat(_," ").concat(b[0]," or ").concat(b[1]):"of ".concat(_," ").concat(b[0])}else return"of ".concat(_," ").concat(String(b))}function v(b,_,C){return b.substr(0,_.length)===_}function T(b,_,C){return(C===void 0||C>b.length)&&(C=b.length),b.substring(C-_.length,C)===_}function u(b,_,C){return typeof C!="number"&&(C=0),C+_.length>b.length?!1:b.indexOf(_,C)!==-1}x("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),x("ERR_INVALID_ARG_TYPE",function(b,_,C){s===void 0&&(s=Yw()),s(typeof b=="string","'name' must be a string");var M;typeof _=="string"&&v(_,"not ")?(M="must not be",_=_.replace(/^not /,"")):M="must be";var E;if(T(b," argument"))E="The ".concat(b," ").concat(M," ").concat(y(_,"type"));else{var A=u(b,".")?"property":"argument";E='The "'.concat(b,'" ').concat(A," ").concat(M," ").concat(y(_,"type"))}return E+=". Received type ".concat(c(C)),E},TypeError),x("ERR_INVALID_ARG_VALUE",function(b,_){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";f===void 0&&(f=nb());var M=f.inspect(_);return M.length>128&&(M="".concat(M.slice(0,128),"...")),"The argument '".concat(b,"' ").concat(C,". Received ").concat(M)},TypeError),x("ERR_INVALID_RETURN_VALUE",function(b,_,C){var M;return C&&C.constructor&&C.constructor.name?M="instance of ".concat(C.constructor.name):M="type ".concat(c(C)),"Expected ".concat(b,' to be returned from the "').concat(_,'"')+" function but got ".concat(M,".")},TypeError),x("ERR_MISSING_ARGS",function(){for(var b=arguments.length,_=new Array(b),C=0;C<b;C++)_[C]=arguments[C];s===void 0&&(s=Yw()),s(_.length>0,"At least one arg needs to be specified");var M="The ",E=_.length;switch(_=_.map(function(A){return'"'.concat(A,'"')}),E){case 1:M+="".concat(_[0]," argument");break;case 2:M+="".concat(_[0]," and ").concat(_[1]," arguments");break;default:M+=_.slice(0,E-1).join(", "),M+=", and ".concat(_[E-1]," arguments");break}return"".concat(M," must be specified")},TypeError),$.exports.codes=i}),DB=Ft((Q,$)=>{function c(W,q){var X=Object.keys(W);if(Object.getOwnPropertySymbols){var lt=Object.getOwnPropertySymbols(W);q&&(lt=lt.filter(function(yt){return Object.getOwnPropertyDescriptor(W,yt).enumerable})),X.push.apply(X,lt)}return X}function g(W){for(var q=1;q<arguments.length;q++){var X=arguments[q]!=null?arguments[q]:{};q%2?c(Object(X),!0).forEach(function(lt){P(W,lt,X[lt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(W,Object.getOwnPropertyDescriptors(X)):c(Object(X)).forEach(function(lt){Object.defineProperty(W,lt,Object.getOwnPropertyDescriptor(X,lt))})}return W}function P(W,q,X){return q=r(q),q in W?Object.defineProperty(W,q,{value:X,enumerable:!0,configurable:!0,writable:!0}):W[q]=X,W}function S(W,q){if(!(W instanceof q))throw new TypeError("Cannot call a class as a function")}function t(W,q){for(var X=0;X<q.length;X++){var lt=q[X];lt.enumerable=lt.enumerable||!1,lt.configurable=!0,"value"in lt&&(lt.writable=!0),Object.defineProperty(W,r(lt.key),lt)}}function e(W,q,X){return q&&t(W.prototype,q),Object.defineProperty(W,"prototype",{writable:!1}),W}function r(W){var q=a(W,"string");return b(q)==="symbol"?q:String(q)}function a(W,q){if(b(W)!=="object"||W===null)return W;var X=W[Symbol.toPrimitive];if(X!==void 0){var lt=X.call(W,q);if(b(lt)!=="object")return lt;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(W)}function n(W,q){if(typeof q!="function"&&q!==null)throw new TypeError("Super expression must either be null or a function");W.prototype=Object.create(q&&q.prototype,{constructor:{value:W,writable:!0,configurable:!0}}),Object.defineProperty(W,"prototype",{writable:!1}),q&&T(W,q)}function o(W){var q=y();return function(){var X=u(W),lt;if(q){var yt=u(this).constructor;lt=Reflect.construct(X,arguments,yt)}else lt=X.apply(this,arguments);return i(this,lt)}}function i(W,q){if(q&&(b(q)==="object"||typeof q=="function"))return q;if(q!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(W)}function s(W){if(W===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W}function f(W){var q=typeof Map=="function"?new Map:void 0;return f=function(X){if(X===null||!v(X))return X;if(typeof X!="function")throw new TypeError("Super expression must either be null or a function");if(typeof q<"u"){if(q.has(X))return q.get(X);q.set(X,lt)}function lt(){return x(X,arguments,u(this).constructor)}return lt.prototype=Object.create(X.prototype,{constructor:{value:lt,enumerable:!1,writable:!0,configurable:!0}}),T(lt,X)},f(W)}function x(W,q,X){return y()?x=Reflect.construct.bind():x=function(lt,yt,pt){var st=[null];st.push.apply(st,yt);var tt=Function.bind.apply(lt,st),dt=new tt;return pt&&T(dt,pt.prototype),dt},x.apply(null,arguments)}function y(){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 v(W){return Function.toString.call(W).indexOf("[native code]")!==-1}function T(W,q){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,lt){return X.__proto__=lt,X},T(W,q)}function u(W){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(q){return q.__proto__||Object.getPrototypeOf(q)},u(W)}function b(W){"@babel/helpers - typeof";return b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},b(W)}var _=nb(),C=_.inspect,M=F7(),E=M.codes.ERR_INVALID_ARG_TYPE;function A(W,q,X){return(X===void 0||X>W.length)&&(X=W.length),W.substring(X-q.length,X)===q}function h(W,q){if(q=Math.floor(q),W.length==0||q==0)return"";var X=W.length*q;for(q=Math.floor(Math.log(q)/Math.log(2));q;)W+=W,q--;return W+=W.substring(0,X-W.length),W}var p="",k="",w="",R="",O={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:"},N=10;function V(W){var q=Object.keys(W),X=Object.create(Object.getPrototypeOf(W));return q.forEach(function(lt){X[lt]=W[lt]}),Object.defineProperty(X,"message",{value:W.message}),X}function H(W){return C(W,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function F(W,q,X){var lt="",yt="",pt=0,st="",tt=!1,dt=H(W),rt=dt.split(`
`),at=H(q).split(`
`),vt=0,it="";if(X==="strictEqual"&&b(W)==="object"&&b(q)==="object"&&W!==null&&q!==null&&(X="strictEqualObject"),rt.length===1&&at.length===1&&rt[0]!==at[0]){var Y=rt[0].length+at[0].length;if(Y<=N){if((b(W)!=="object"||W===null)&&(b(q)!=="object"||q===null)&&(W!==0||q!==0))return"".concat(O[X],`
`)+"".concat(rt[0]," !== ").concat(at[0],`
`)}else if(X!=="strictEqualObject"){var ft=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(Y<ft){for(;rt[0][vt]===at[0][vt];)vt++;vt>2&&(it=`
`.concat(h(" ",vt),"^"),vt=0)}}}for(var ut=rt[rt.length-1],wt=at[at.length-1];ut===wt&&(vt++<2?st=`
`.concat(ut).concat(st):lt=ut,rt.pop(),at.pop(),!(rt.length===0||at.length===0));)ut=rt[rt.length-1],wt=at[at.length-1];var zt=Math.max(rt.length,at.length);if(zt===0){var Pt=dt.split(`
`);if(Pt.length>30)for(Pt[26]="".concat(p,"...").concat(R);Pt.length>27;)Pt.pop();return"".concat(O.notIdentical,`
`).concat(Pt.join(`
`),`
`)}vt>3&&(st=`
`.concat(p,"...").concat(R).concat(st),tt=!0),lt!==""&&(st=`
`.concat(lt).concat(st),lt="");var Wt=0,Ht=O[X]+`
`.concat(k,"+ actual").concat(R," ").concat(w,"- expected").concat(R),Jt=" ".concat(p,"...").concat(R," Lines skipped");for(vt=0;vt<zt;vt++){var ge=vt-pt;if(rt.length<vt+1)ge>1&&vt>2&&(ge>4?(yt+=`
`.concat(p,"...").concat(R),tt=!0):ge>3&&(yt+=`
`.concat(at[vt-2]),Wt++),yt+=`
`.concat(at[vt-1]),Wt++),pt=vt,lt+=`
`.concat(w,"-").concat(R," ").concat(at[vt]),Wt++;else if(at.length<vt+1)ge>1&&vt>2&&(ge>4?(yt+=`
`.concat(p,"...").concat(R),tt=!0):ge>3&&(yt+=`
`.concat(rt[vt-2]),Wt++),yt+=`
`.concat(rt[vt-1]),Wt++),pt=vt,yt+=`
`.concat(k,"+").concat(R," ").concat(rt[vt]),Wt++;else{var he=at[vt],de=rt[vt],se=de!==he&&(!A(de,",")||de.slice(0,-1)!==he);se&&A(he,",")&&he.slice(0,-1)===de&&(se=!1,de+=","),se?(ge>1&&vt>2&&(ge>4?(yt+=`
`.concat(p,"...").concat(R),tt=!0):ge>3&&(yt+=`
`.concat(rt[vt-2]),Wt++),yt+=`
`.concat(rt[vt-1]),Wt++),pt=vt,yt+=`
`.concat(k,"+").concat(R," ").concat(de),lt+=`
`.concat(w,"-").concat(R," ").concat(he),Wt+=2):(yt+=lt,lt="",(ge===1||vt===0)&&(yt+=`
`.concat(de),Wt++))}if(Wt>20&&vt<zt-2)return"".concat(Ht).concat(Jt,`
`).concat(yt,`
`).concat(p,"...").concat(R).concat(lt,`
`)+"".concat(p,"...").concat(R)}return"".concat(Ht).concat(tt?Jt:"",`
`).concat(yt).concat(lt).concat(st).concat(it)}var U=function(W,q){n(lt,W);var X=o(lt);function lt(yt){var pt;if(S(this,lt),b(yt)!=="object"||yt===null)throw new E("options","Object",yt);var st=yt.message,tt=yt.operator,dt=yt.stackStartFn,rt=yt.actual,at=yt.expected,vt=Error.stackTraceLimit;if(Error.stackTraceLimit=0,st!=null)pt=X.call(this,String(st));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(p="\x1B[34m",k="\x1B[32m",R="\x1B[39m",w="\x1B[31m"):(p="",k="",R="",w="")),b(rt)==="object"&&rt!==null&&b(at)==="object"&&at!==null&&"stack"in rt&&rt instanceof Error&&"stack"in at&&at instanceof Error&&(rt=V(rt),at=V(at)),tt==="deepStrictEqual"||tt==="strictEqual")pt=X.call(this,F(rt,at,tt));else if(tt==="notDeepStrictEqual"||tt==="notStrictEqual"){var it=O[tt],Y=H(rt).split(`
`);if(tt==="notStrictEqual"&&b(rt)==="object"&&rt!==null&&(it=O.notStrictEqualObject),Y.length>30)for(Y[26]="".concat(p,"...").concat(R);Y.length>27;)Y.pop();Y.length===1?pt=X.call(this,"".concat(it," ").concat(Y[0])):pt=X.call(this,"".concat(it,`
`).concat(Y.join(`
`),`
`))}else{var ft=H(rt),ut="",wt=O[tt];tt==="notDeepEqual"||tt==="notEqual"?(ft="".concat(O[tt],`
`).concat(ft),ft.length>1024&&(ft="".concat(ft.slice(0,1021),"..."))):(ut="".concat(H(at)),ft.length>512&&(ft="".concat(ft.slice(0,509),"...")),ut.length>512&&(ut="".concat(ut.slice(0,509),"...")),tt==="deepEqual"||tt==="equal"?ft="".concat(wt,`
`).concat(ft,`
should equal
`):ut=" ".concat(tt," ").concat(ut)),pt=X.call(this,"".concat(ft).concat(ut))}return Error.stackTraceLimit=vt,pt.generatedMessage=!st,Object.defineProperty(s(pt),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),pt.code="ERR_ASSERTION",pt.actual=rt,pt.expected=at,pt.operator=tt,Error.captureStackTrace&&Error.captureStackTrace(s(pt),dt),pt.stack,pt.name="AssertionError",i(pt)}return e(lt,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:q,value:function(yt,pt){return C(this,g(g({},pt),{},{customInspect:!1,depth:0}))}}]),lt}(f(Error),C.custom);$.exports=U}),R7=Ft((Q,$)=>{var c=Object.prototype.toString;$.exports=function(g){var P=c.call(g),S=P==="[object Arguments]";return S||(S=P!=="[object Array]"&&g!==null&&typeof g=="object"&&typeof g.length=="number"&&g.length>=0&&c.call(g.callee)==="[object Function]"),S}}),FB=Ft((Q,$)=>{var c;Object.keys||(g=Object.prototype.hasOwnProperty,P=Object.prototype.toString,S=R7(),t=Object.prototype.propertyIsEnumerable,e=!t.call({toString:null},"toString"),r=t.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=function(f){var x=f.constructor;return x&&x.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},i=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!o["$"+f]&&g.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"||!i)return n(f);try{return n(f)}catch{return!1}},c=function(f){var x=f!==null&&typeof f=="object",y=P.call(f)==="[object Function]",v=S(f),T=x&&P.call(f)==="[object String]",u=[];if(!x&&!y&&!v)throw new TypeError("Object.keys called on a non-object");var b=r&&y;if(T&&f.length>0&&!g.call(f,0))for(var _=0;_<f.length;++_)u.push(String(_));if(v&&f.length>0)for(var C=0;C<f.length;++C)u.push(String(C));else for(var M in f)!(b&&M==="prototype")&&g.call(f,M)&&u.push(String(M));if(e)for(var E=s(f),A=0;A<a.length;++A)!(E&&a[A]==="constructor")&&g.call(f,a[A])&&u.push(a[A]);return u});var g,P,S,t,e,r,a,n,o,i,s;$.exports=c}),B7=Ft((Q,$)=>{var c=Array.prototype.slice,g=R7(),P=Object.keys,S=P?function(e){return P(e)}:FB(),t=Object.keys;S.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(r){return g(r)?t(c.call(r)):t(r)})}else Object.keys=S;return Object.keys||S},$.exports=S}),RB=Ft((Q,$)=>{var c=B7(),g=rk()(),P=rb(),S=Object,t=P("Array.prototype.push"),e=P("Object.prototype.propertyIsEnumerable"),r=g?Object.getOwnPropertySymbols:null;$.exports=function(a,n){if(a==null)throw new TypeError("target must be an object");var o=S(a);if(arguments.length===1)return o;for(var i=1;i<arguments.length;++i){var s=S(arguments[i]),f=c(s),x=g&&(Object.getOwnPropertySymbols||r);if(x)for(var y=x(s),v=0;v<y.length;++v){var T=y[v];e(s,T)&&t(f,T)}for(var u=0;u<f.length;++u){var b=f[u];if(e(s,b)){var _=s[b];o[b]=_}}}return o}}),BB=Ft((Q,$)=>{var c=RB(),g=function(){if(!Object.assign)return!1;for(var S="abcdefghijklmnopqrst",t=S.split(""),e={},r=0;r<t.length;++r)e[t[r]]=t[r];var a=Object.assign({},e),n="";for(var o in a)n+=o;return S!==n},P=function(){if(!Object.assign||!Object.preventExtensions)return!1;var S=Object.preventExtensions({1:2});try{Object.assign(S,"xy")}catch{return S[1]==="y"}return!1};$.exports=function(){return!Object.assign||g()||P()?c:Object.assign}}),N7=Ft((Q,$)=>{var c=function(g){return g!==g};$.exports=function(g,P){return g===0&&P===0?1/g===1/P:!!(g===P||c(g)&&c(P))}}),ok=Ft((Q,$)=>{var c=N7();$.exports=function(){return typeof Object.is=="function"?Object.is:c}}),Gw=Ft((Q,$)=>{var c=B7(),g=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",P=Object.prototype.toString,S=Array.prototype.concat,t=Object.defineProperty,e=function(i){return typeof i=="function"&&P.call(i)==="[object Function]"},r=T7()(),a=t&&r,n=function(i,s,f,x){if(s in i){if(x===!0){if(i[s]===f)return}else if(!e(x)||!x())return}a?t(i,s,{configurable:!0,enumerable:!1,value:f,writable:!0}):i[s]=f},o=function(i,s){var f=arguments.length>2?arguments[2]:{},x=c(s);g&&(x=S.call(x,Object.getOwnPropertySymbols(s)));for(var y=0;y<x.length;y+=1)n(i,x[y],s[x[y]],f[x[y]])};o.supportsDescriptors=!!a,$.exports=o}),NB=Ft((Q,$)=>{var c=ok(),g=Gw();$.exports=function(){var P=c();return g(Object,{is:P},{is:function(){return Object.is!==P}}),P}}),jB=Ft((Q,$)=>{var c=Gw(),g=$w(),P=N7(),S=ok(),t=NB(),e=g(S(),Object);c(e,{getPolyfill:S,implementation:P,shim:t}),$.exports=e}),j7=Ft((Q,$)=>{$.exports=function(c){return c!==c}}),U7=Ft((Q,$)=>{var c=j7();$.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:c}}),UB=Ft((Q,$)=>{var c=Gw(),g=U7();$.exports=function(){var P=g();return c(Number,{isNaN:P},{isNaN:function(){return Number.isNaN!==P}}),P}}),VB=Ft((Q,$)=>{var c=$w(),g=Gw(),P=j7(),S=U7(),t=UB(),e=c(S(),Number);g(e,{getPolyfill:S,implementation:P,shim:t}),$.exports=e}),HB=Ft((Q,$)=>{function c(se,Tt){return e(se)||t(se,Tt)||P(se,Tt)||g()}function g(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P(se,Tt){if(se){if(typeof se=="string")return S(se,Tt);var Lt=Object.prototype.toString.call(se).slice(8,-1);if(Lt==="Object"&&se.constructor&&(Lt=se.constructor.name),Lt==="Map"||Lt==="Set")return Array.from(se);if(Lt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Lt))return S(se,Tt)}}function S(se,Tt){(Tt==null||Tt>se.length)&&(Tt=se.length);for(var Lt=0,Mt=new Array(Tt);Lt<Tt;Lt++)Mt[Lt]=se[Lt];return Mt}function t(se,Tt){var Lt=se==null?null:typeof Symbol<"u"&&se[Symbol.iterator]||se["@@iterator"];if(Lt!=null){var Mt,te,ve,oe,Te=[],He=!0,Ge=!1;try{if(ve=(Lt=Lt.call(se)).next,Tt!==0)for(;!(He=(Mt=ve.call(Lt)).done)&&(Te.push(Mt.value),Te.length!==Tt);He=!0);}catch(cr){Ge=!0,te=cr}finally{try{if(!He&&Lt.return!=null&&(oe=Lt.return(),Object(oe)!==oe))return}finally{if(Ge)throw te}}return Te}}function e(se){if(Array.isArray(se))return se}function r(se){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Tt){return typeof Tt}:function(Tt){return Tt&&typeof Symbol=="function"&&Tt.constructor===Symbol&&Tt!==Symbol.prototype?"symbol":typeof Tt},r(se)}var a=/a/g.flags!==void 0,n=function(se){var Tt=[];return se.forEach(function(Lt){return Tt.push(Lt)}),Tt},o=function(se){var Tt=[];return se.forEach(function(Lt,Mt){return Tt.push([Mt,Lt])}),Tt},i=Object.is?Object.is:jB(),s=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:VB();function x(se){return se.call.bind(se)}var y=x(Object.prototype.hasOwnProperty),v=x(Object.prototype.propertyIsEnumerable),T=x(Object.prototype.toString),u=nb().types,b=u.isAnyArrayBuffer,_=u.isArrayBufferView,C=u.isDate,M=u.isMap,E=u.isRegExp,A=u.isSet,h=u.isNativeError,p=u.isBoxedPrimitive,k=u.isNumberObject,w=u.isStringObject,R=u.isBooleanObject,O=u.isBigIntObject,N=u.isSymbolObject,V=u.isFloat32Array,H=u.isFloat64Array;function F(se){if(se.length===0||se.length>10)return!0;for(var Tt=0;Tt<se.length;Tt++){var Lt=se.charCodeAt(Tt);if(Lt<48||Lt>57)return!0}return se.length===10&&se>=Math.pow(2,32)}function U(se){return Object.keys(se).filter(F).concat(s(se).filter(Object.prototype.propertyIsEnumerable.bind(se)))}function W(se,Tt){if(se===Tt)return 0;for(var Lt=se.length,Mt=Tt.length,te=0,ve=Math.min(Lt,Mt);te<ve;++te)if(se[te]!==Tt[te]){Lt=se[te],Mt=Tt[te];break}return Lt<Mt?-1:Mt<Lt?1:0}var q=!0,X=!1,lt=0,yt=1,pt=2,st=3;function tt(se,Tt){return a?se.source===Tt.source&&se.flags===Tt.flags:RegExp.prototype.toString.call(se)===RegExp.prototype.toString.call(Tt)}function dt(se,Tt){if(se.byteLength!==Tt.byteLength)return!1;for(var Lt=0;Lt<se.byteLength;Lt++)if(se[Lt]!==Tt[Lt])return!1;return!0}function rt(se,Tt){return se.byteLength!==Tt.byteLength?!1:W(new Uint8Array(se.buffer,se.byteOffset,se.byteLength),new Uint8Array(Tt.buffer,Tt.byteOffset,Tt.byteLength))===0}function at(se,Tt){return se.byteLength===Tt.byteLength&&W(new Uint8Array(se),new Uint8Array(Tt))===0}function vt(se,Tt){return k(se)?k(Tt)&&i(Number.prototype.valueOf.call(se),Number.prototype.valueOf.call(Tt)):w(se)?w(Tt)&&String.prototype.valueOf.call(se)===String.prototype.valueOf.call(Tt):R(se)?R(Tt)&&Boolean.prototype.valueOf.call(se)===Boolean.prototype.valueOf.call(Tt):O(se)?O(Tt)&&BigInt.prototype.valueOf.call(se)===BigInt.prototype.valueOf.call(Tt):N(Tt)&&Symbol.prototype.valueOf.call(se)===Symbol.prototype.valueOf.call(Tt)}function it(se,Tt,Lt,Mt){if(se===Tt)return se!==0?!0:Lt?i(se,Tt):!0;if(Lt){if(r(se)!=="object")return typeof se=="number"&&f(se)&&f(Tt);if(r(Tt)!=="object"||se===null||Tt===null||Object.getPrototypeOf(se)!==Object.getPrototypeOf(Tt))return!1}else{if(se===null||r(se)!=="object")return Tt===null||r(Tt)!=="object"?se==Tt:!1;if(Tt===null||r(Tt)!=="object")return!1}var te=T(se),ve=T(Tt);if(te!==ve)return!1;if(Array.isArray(se)){if(se.length!==Tt.length)return!1;var oe=U(se),Te=U(Tt);return oe.length!==Te.length?!1:ft(se,Tt,Lt,Mt,yt,oe)}if(te==="[object Object]"&&(!M(se)&&M(Tt)||!A(se)&&A(Tt)))return!1;if(C(se)){if(!C(Tt)||Date.prototype.getTime.call(se)!==Date.prototype.getTime.call(Tt))return!1}else if(E(se)){if(!E(Tt)||!tt(se,Tt))return!1}else if(h(se)||se instanceof Error){if(se.message!==Tt.message||se.name!==Tt.name)return!1}else if(_(se)){if(!Lt&&(V(se)||H(se))){if(!dt(se,Tt))return!1}else if(!rt(se,Tt))return!1;var He=U(se),Ge=U(Tt);return He.length!==Ge.length?!1:ft(se,Tt,Lt,Mt,lt,He)}else{if(A(se))return!A(Tt)||se.size!==Tt.size?!1:ft(se,Tt,Lt,Mt,pt);if(M(se))return!M(Tt)||se.size!==Tt.size?!1:ft(se,Tt,Lt,Mt,st);if(b(se)){if(!at(se,Tt))return!1}else if(p(se)&&!vt(se,Tt))return!1}return ft(se,Tt,Lt,Mt,lt)}function Y(se,Tt){return Tt.filter(function(Lt){return v(se,Lt)})}function ft(se,Tt,Lt,Mt,te,ve){if(arguments.length===5){ve=Object.keys(se);var oe=Object.keys(Tt);if(ve.length!==oe.length)return!1}for(var Te=0;Te<ve.length;Te++)if(!y(Tt,ve[Te]))return!1;if(Lt&&arguments.length===5){var He=s(se);if(He.length!==0){var Ge=0;for(Te=0;Te<He.length;Te++){var cr=He[Te];if(v(se,cr)){if(!v(Tt,cr))return!1;ve.push(cr),Ge++}else if(v(Tt,cr))return!1}var ur=s(Tt);if(He.length!==ur.length&&Y(Tt,ur).length!==Ge)return!1}else{var jr=s(Tt);if(jr.length!==0&&Y(Tt,jr).length!==0)return!1}}if(ve.length===0&&(te===lt||te===yt&&se.length===0||se.size===0))return!0;if(Mt===void 0)Mt={val1:new Map,val2:new Map,position:0};else{var Hr=Mt.val1.get(se);if(Hr!==void 0){var br=Mt.val2.get(Tt);if(br!==void 0)return Hr===br}Mt.position++}Mt.val1.set(se,Mt.position),Mt.val2.set(Tt,Mt.position);var Kr=ge(se,Tt,Lt,ve,Mt,te);return Mt.val1.delete(se),Mt.val2.delete(Tt),Kr}function ut(se,Tt,Lt,Mt){for(var te=n(se),ve=0;ve<te.length;ve++){var oe=te[ve];if(it(Tt,oe,Lt,Mt))return se.delete(oe),!0}return!1}function wt(se){switch(r(se)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":se=+se;case"number":if(f(se))return!1}return!0}function zt(se,Tt,Lt){var Mt=wt(Lt);return Mt??(Tt.has(Mt)&&!se.has(Mt))}function Pt(se,Tt,Lt,Mt,te){var ve=wt(Lt);if(ve!=null)return ve;var oe=Tt.get(ve);return oe===void 0&&!Tt.has(ve)||!it(Mt,oe,!1,te)?!1:!se.has(ve)&&it(Mt,oe,!1,te)}function Wt(se,Tt,Lt,Mt){for(var te=null,ve=n(se),oe=0;oe<ve.length;oe++){var Te=ve[oe];if(r(Te)==="object"&&Te!==null)te===null&&(te=new Set),te.add(Te);else if(!Tt.has(Te)){if(Lt||!zt(se,Tt,Te))return!1;te===null&&(te=new Set),te.add(Te)}}if(te!==null){for(var He=n(Tt),Ge=0;Ge<He.length;Ge++){var cr=He[Ge];if(r(cr)==="object"&&cr!==null){if(!ut(te,cr,Lt,Mt))return!1}else if(!Lt&&!se.has(cr)&&!ut(te,cr,Lt,Mt))return!1}return te.size===0}return!0}function Ht(se,Tt,Lt,Mt,te,ve){for(var oe=n(se),Te=0;Te<oe.length;Te++){var He=oe[Te];if(it(Lt,He,te,ve)&&it(Mt,Tt.get(He),te,ve))return se.delete(He),!0}return!1}function Jt(se,Tt,Lt,Mt){for(var te=null,ve=o(se),oe=0;oe<ve.length;oe++){var Te=c(ve[oe],2),He=Te[0],Ge=Te[1];if(r(He)==="object"&&He!==null)te===null&&(te=new Set),te.add(He);else{var cr=Tt.get(He);if(cr===void 0&&!Tt.has(He)||!it(Ge,cr,Lt,Mt)){if(Lt||!Pt(se,Tt,He,Ge,Mt))return!1;te===null&&(te=new Set),te.add(He)}}}if(te!==null){for(var ur=o(Tt),jr=0;jr<ur.length;jr++){var Hr=c(ur[jr],2),br=Hr[0],Kr=Hr[1];if(r(br)==="object"&&br!==null){if(!Ht(te,se,br,Kr,Lt,Mt))return!1}else if(!Lt&&(!se.has(br)||!it(se.get(br),Kr,!1,Mt))&&!Ht(te,se,br,Kr,!1,Mt))return!1}return te.size===0}return!0}function ge(se,Tt,Lt,Mt,te,ve){var oe=0;if(ve===pt){if(!Wt(se,Tt,Lt,te))return!1}else if(ve===st){if(!Jt(se,Tt,Lt,te))return!1}else if(ve===yt)for(;oe<se.length;oe++)if(y(se,oe)){if(!y(Tt,oe)||!it(se[oe],Tt[oe],Lt,te))return!1}else{if(y(Tt,oe))return!1;for(var Te=Object.keys(se);oe<Te.length;oe++){var He=Te[oe];if(!y(Tt,He)||!it(se[He],Tt[He],Lt,te))return!1}return Te.length===Object.keys(Tt).length}for(oe=0;oe<Mt.length;oe++){var Ge=Mt[oe];if(!it(se[Ge],Tt[Ge],Lt,te))return!1}return!0}function he(se,Tt){return it(se,Tt,X)}function de(se,Tt){return it(se,Tt,q)}$.exports={isDeepEqual:he,isDeepStrictEqual:de}}),Yw=Ft((Q,$)=>{function c(pt){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(st){return typeof st}:function(st){return st&&typeof Symbol=="function"&&st.constructor===Symbol&&st!==Symbol.prototype?"symbol":typeof st},c(pt)}function g(pt,st,tt){return Object.defineProperty(pt,"prototype",{writable:!1}),pt}function P(pt,st){if(!(pt instanceof st))throw new TypeError("Cannot call a class as a function")}var S=F7(),t=S.codes,e=t.ERR_AMBIGUOUS_ARGUMENT,r=t.ERR_INVALID_ARG_TYPE,a=t.ERR_INVALID_ARG_VALUE,n=t.ERR_INVALID_RETURN_VALUE,o=t.ERR_MISSING_ARGS,i=DB(),s=nb(),f=s.inspect,x=nb().types,y=x.isPromise,v=x.isRegExp,T=BB()(),u=ok()(),b=rb()("RegExp.prototype.test"),_,C;function M(){var pt=HB();_=pt.isDeepEqual,C=pt.isDeepStrictEqual}var E=!1,A=$.exports=R,h={};function p(pt){throw pt.message instanceof Error?pt.message:new i(pt)}function k(pt,st,tt,dt,rt){var at=arguments.length,vt;if(at===0)vt="Failed";else if(at===1)tt=pt,pt=void 0;else{if(E===!1){E=!0;var it=process.emitWarning?process.emitWarning:console.warn.bind(console);it("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}at===2&&(dt="!=")}if(tt instanceof Error)throw tt;var Y={actual:pt,expected:st,operator:dt===void 0?"fail":dt,stackStartFn:rt||k};tt!==void 0&&(Y.message=tt);var ft=new i(Y);throw vt&&(ft.message=vt,ft.generatedMessage=!0),ft}A.fail=k,A.AssertionError=i;function w(pt,st,tt,dt){if(!tt){var rt=!1;if(st===0)rt=!0,dt="No value argument passed to `assert.ok()`";else if(dt instanceof Error)throw dt;var at=new i({actual:tt,expected:!0,message:dt,operator:"==",stackStartFn:pt});throw at.generatedMessage=rt,at}}function R(){for(var pt=arguments.length,st=new Array(pt),tt=0;tt<pt;tt++)st[tt]=arguments[tt];w.apply(void 0,[R,st.length].concat(st))}A.ok=R,A.equal=function pt(st,tt,dt){if(arguments.length<2)throw new o("actual","expected");st!=tt&&p({actual:st,expected:tt,message:dt,operator:"==",stackStartFn:pt})},A.notEqual=function pt(st,tt,dt){if(arguments.length<2)throw new o("actual","expected");st==tt&&p({actual:st,expected:tt,message:dt,operator:"!=",stackStartFn:pt})},A.deepEqual=function pt(st,tt,dt){if(arguments.length<2)throw new o("actual","expected");_===void 0&&M(),_(st,tt)||p({actual:st,expected:tt,message:dt,operator:"deepEqual",stackStartFn:pt})},A.notDeepEqual=function pt(st,tt,dt){if(arguments.length<2)throw new o("actual","expected");_===void 0&&M(),_(st,tt)&&p({actual:st,expected:tt,message:dt,operator:"notDeepEqual",stackStartFn:pt})},A.deepStrictEqual=function pt(st,tt,dt){if(arguments.length<2)throw new o("actual","expected");_===void 0&&M(),C(st,tt)||p({actual:st,expected:tt,message:dt,operator:"deepStrictEqual",stackStartFn:pt})},A.notDeepStrictEqual=O;function O(pt,st,tt){if(arguments.length<2)throw new o("actual","expected");_===void 0&&M(),C(pt,st)&&p({actual:pt,expected:st,message:tt,operator:"notDeepStrictEqual",stackStartFn:O})}A.strictEqual=function pt(st,tt,dt){if(arguments.length<2)throw new o("actual","expected");u(st,tt)||p({actual:st,expected:tt,message:dt,operator:"strictEqual",stackStartFn:pt})},A.notStrictEqual=function pt(st,tt,dt){if(arguments.length<2)throw new o("actual","expected");u(st,tt)&&p({actual:st,expected:tt,message:dt,operator:"notStrictEqual",stackStartFn:pt})};var N=g(function pt(st,tt,dt){var rt=this;P(this,pt),tt.forEach(function(at){at in st&&(dt!==void 0&&typeof dt[at]=="string"&&v(st[at])&&b(st[at],dt[at])?rt[at]=dt[at]:rt[at]=st[at])})});function V(pt,st,tt,dt,rt,at){if(!(tt in pt)||!C(pt[tt],st[tt])){if(!dt){var vt=new N(pt,rt),it=new N(st,rt,pt),Y=new i({actual:vt,expected:it,operator:"deepStrictEqual",stackStartFn:at});throw Y.actual=pt,Y.expected=st,Y.operator=at.name,Y}p({actual:pt,expected:st,message:dt,operator:at.name,stackStartFn:at})}}function H(pt,st,tt,dt){if(typeof st!="function"){if(v(st))return b(st,pt);if(arguments.length===2)throw new r("expected",["Function","RegExp"],st);if(c(pt)!=="object"||pt===null){var rt=new i({actual:pt,expected:st,message:tt,operator:"deepStrictEqual",stackStartFn:dt});throw rt.operator=dt.name,rt}var at=Object.keys(st);if(st instanceof Error)at.push("name","message");else if(at.length===0)throw new a("error",st,"may not be an empty object");return _===void 0&&M(),at.forEach(function(vt){typeof pt[vt]=="string"&&v(st[vt])&&b(st[vt],pt[vt])||V(pt,st,vt,tt,at,dt)}),!0}return st.prototype!==void 0&&pt instanceof st?!0:Error.isPrototypeOf(st)?!1:st.call({},pt)===!0}function F(pt){if(typeof pt!="function")throw new r("fn","Function",pt);try{pt()}catch(st){return st}return h}function U(pt){return y(pt)||pt!==null&&c(pt)==="object"&&typeof pt.then=="function"&&typeof pt.catch=="function"}function W(pt){return Promise.resolve().then(function(){var st;if(typeof pt=="function"){if(st=pt(),!U(st))throw new n("instance of Promise","promiseFn",st)}else if(U(pt))st=pt;else throw new r("promiseFn",["Function","Promise"],pt);return Promise.resolve().then(function(){return st}).then(function(){return h}).catch(function(tt){return tt})})}function q(pt,st,tt,dt){if(typeof tt=="string"){if(arguments.length===4)throw new r("error",["Object","Error","Function","RegExp"],tt);if(c(st)==="object"&&st!==null){if(st.message===tt)throw new e("error/message",'The error message "'.concat(st.message,'" is identical to the message.'))}else if(st===tt)throw new e("error/message",'The error "'.concat(st,'" is identical to the message.'));dt=tt,tt=void 0}else if(tt!=null&&c(tt)!=="object"&&typeof tt!="function")throw new r("error",["Object","Error","Function","RegExp"],tt);if(st===h){var rt="";tt&&tt.name&&(rt+=" (".concat(tt.name,")")),rt+=dt?": ".concat(dt):".";var at=pt.name==="rejects"?"rejection":"exception";p({actual:void 0,expected:tt,operator:pt.name,message:"Missing expected ".concat(at).concat(rt),stackStartFn:pt})}if(tt&&!H(st,tt,dt,pt))throw st}function X(pt,st,tt,dt){if(st!==h){if(typeof tt=="string"&&(dt=tt,tt=void 0),!tt||H(st,tt)){var rt=dt?": ".concat(dt):".",at=pt.name==="doesNotReject"?"rejection":"exception";p({actual:st,expected:tt,operator:pt.name,message:"Got unwanted ".concat(at).concat(rt,`
`)+'Actual message: "'.concat(st&&st.message,'"'),stackStartFn:pt})}throw st}}A.throws=function pt(st){for(var tt=arguments.length,dt=new Array(tt>1?tt-1:0),rt=1;rt<tt;rt++)dt[rt-1]=arguments[rt];q.apply(void 0,[pt,F(st)].concat(dt))},A.rejects=function pt(st){for(var tt=arguments.length,dt=new Array(tt>1?tt-1:0),rt=1;rt<tt;rt++)dt[rt-1]=arguments[rt];return W(st).then(function(at){return q.apply(void 0,[pt,at].concat(dt))})},A.doesNotThrow=function pt(st){for(var tt=arguments.length,dt=new Array(tt>1?tt-1:0),rt=1;rt<tt;rt++)dt[rt-1]=arguments[rt];X.apply(void 0,[pt,F(st)].concat(dt))},A.doesNotReject=function pt(st){for(var tt=arguments.length,dt=new Array(tt>1?tt-1:0),rt=1;rt<tt;rt++)dt[rt-1]=arguments[rt];return W(st).then(function(at){return X.apply(void 0,[pt,at].concat(dt))})},A.ifError=function pt(st){if(st!=null){var tt="ifError got unwanted exception: ";c(st)==="object"&&typeof st.message=="string"?st.message.length===0&&st.constructor?tt+=st.constructor.name:tt+=st.message:tt+=f(st);var dt=new i({actual:st,expected:null,operator:"ifError",message:tt,stackStartFn:pt}),rt=st.stack;if(typeof rt=="string"){var at=rt.split(`
`);at.shift();for(var vt=dt.stack.split(`
`),it=0;it<at.length;it++){var Y=vt.indexOf(at[it]);if(Y!==-1){vt=vt.slice(0,Y);break}}dt.stack="".concat(vt.join(`
`),`
`).concat(at.join(`
`))}throw dt}};function lt(pt,st,tt,dt,rt){if(!v(st))throw new r("regexp","RegExp",st);var at=rt==="match";if(typeof pt!="string"||b(st,pt)!==at){if(tt instanceof Error)throw tt;var vt=!tt;tt=tt||(typeof pt!="string"?'The "string" argument must be of type string. Received type '+"".concat(c(pt)," (").concat(f(pt),")"):(at?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(f(st),`. Input:
`).concat(f(pt),`
`));var it=new i({actual:pt,expected:st,message:tt,operator:rt,stackStartFn:dt});throw it.generatedMessage=vt,it}}A.match=function pt(st,tt,dt){lt(st,tt,dt,pt,"match")},A.doesNotMatch=function pt(st,tt,dt){lt(st,tt,dt,pt,"doesNotMatch")};function yt(){for(var pt=arguments.length,st=new Array(pt),tt=0;tt<pt;tt++)st[tt]=arguments[tt];w.apply(void 0,[yt,st.length].concat(st))}A.strict=T(yt,A,{equal:A.strictEqual,deepEqual:A.deepStrictEqual,notEqual:A.notStrictEqual,notDeepEqual:A.notDeepStrictEqual}),A.strict.strict=A.strict}),WB=Ft((Q,$)=>{var c=1e3,g=c*60,P=g*60,S=P*24,t=S*365.25;$.exports=function(o,i){i=i||{};var s=typeof o;if(s==="string"&&o.length>0)return e(o);if(s==="number"&&isNaN(o)===!1)return i.long?a(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 i=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(i){var s=parseFloat(i[1]),f=(i[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*S;case"hours":case"hour":case"hrs":case"hr":case"h":return s*P;case"minutes":case"minute":case"mins":case"min":case"m":return s*g;case"seconds":case"second":case"secs":case"sec":case"s":return s*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(o){return o>=S?Math.round(o/S)+"d":o>=P?Math.round(o/P)+"h":o>=g?Math.round(o/g)+"m":o>=c?Math.round(o/c)+"s":o+"ms"}function a(o){return n(o,S,"day")||n(o,P,"hour")||n(o,g,"minute")||n(o,c,"second")||o+" ms"}function n(o,i,s){if(!(o<i))return o<i*1.5?Math.floor(o/i)+" "+s:Math.ceil(o/i)+" "+s+"s"}}),qB=Ft((Q,$)=>{Q=$.exports=P.debug=P.default=P,Q.coerce=r,Q.disable=t,Q.enable=S,Q.enabled=e,Q.humanize=WB(),Q.names=[],Q.skips=[],Q.formatters={};var c;function g(a){var n=0,o;for(o in a)n=(n<<5)-n+a.charCodeAt(o),n|=0;return Q.colors[Math.abs(n)%Q.colors.length]}function P(a){function n(){if(n.enabled){var o=n,i=+new Date,s=i-(c||i);o.diff=s,o.prev=c,o.curr=i,c=i;for(var f=new Array(arguments.length),x=0;x<f.length;x++)f[x]=arguments[x];f[0]=Q.coerce(f[0]),typeof f[0]!="string"&&f.unshift("%O");var y=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,function(T,u){if(T==="%%")return T;y++;var b=Q.formatters[u];if(typeof b=="function"){var _=f[y];T=b.call(o,_),f.splice(y,1),y--}return T}),Q.formatArgs.call(o,f);var v=n.log||Q.log||console.log.bind(console);v.apply(o,f)}}return n.namespace=a,n.enabled=Q.enabled(a),n.useColors=Q.useColors(),n.color=g(a),typeof Q.init=="function"&&Q.init(n),n}function S(a){Q.save(a),Q.names=[],Q.skips=[];for(var n=(typeof a=="string"?a:"").split(/[\s,]+/),o=n.length,i=0;i<o;i++)n[i]&&(a=n[i].replace(/\*/g,".*?"),a[0]==="-"?Q.skips.push(new RegExp("^"+a.substr(1)+"$")):Q.names.push(new RegExp("^"+a+"$")))}function t(){Q.enable("")}function e(a){var n,o;for(n=0,o=Q.skips.length;n<o;n++)if(Q.skips[n].test(a))return!1;for(n=0,o=Q.names.length;n<o;n++)if(Q.names[n].test(a))return!0;return!1}function r(a){return a instanceof Error?a.stack||a.message:a}}),ZB=Ft((Q,$)=>{Q=$.exports=qB(),Q.log=P,Q.formatArgs=g,Q.save=S,Q.load=t,Q.useColors=c,Q.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:e(),Q.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function c(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}Q.formatters.j=function(r){try{return JSON.stringify(r)}catch(a){return"[UnexpectedJSONParseError]: "+a.message}};function g(r){var a=this.useColors;if(r[0]=(a?"%c":"")+this.namespace+(a?" %c":" ")+r[0]+(a?"%c ":" ")+"+"+Q.humanize(this.diff),!!a){var n="color: "+this.color;r.splice(1,0,n,"color: inherit");var o=0,i=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(o++,s==="%c"&&(i=o))}),r.splice(i,0,n)}}function P(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function S(r){try{r==null?Q.storage.removeItem("debug"):Q.storage.debug=r}catch{}}function t(){var r;try{r=Q.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=l.DEBUG),r}Q.enable(t());function e(){try{return window.localStorage}catch{}}}),$B=Ft((Q,$)=>{var c=Yw(),g=ZB()("stream-parser");$.exports=r;var P=-1,S=0,t=1,e=2;function r(u){var b=u&&typeof u._transform=="function",_=u&&typeof u._write=="function";if(!b&&!_)throw new Error("must pass a Writable or Transform stream in");g("extending Parser into stream"),u._bytes=n,u._skipBytes=o,b&&(u._passthrough=i),b?u._transform=f:u._write=s}function a(u){g("initializing parser stream"),u._parserBytesLeft=0,u._parserBuffers=[],u._parserBuffered=0,u._parserState=P,u._parserCallback=null,typeof u.push=="function"&&(u._parserOutput=u.push.bind(u)),u._parserInit=!0}function n(u,b){c(!this._parserCallback,'there is already a "callback" set!'),c(isFinite(u)&&u>0,'can only buffer a finite number of bytes > 0, got "'+u+'"'),this._parserInit||a(this),g("buffering %o bytes",u),this._parserBytesLeft=u,this._parserCallback=b,this._parserState=S}function o(u,b){c(!this._parserCallback,'there is already a "callback" set!'),c(u>0,'can only skip > 0 bytes, got "'+u+'"'),this._parserInit||a(this),g("skipping %o bytes",u),this._parserBytesLeft=u,this._parserCallback=b,this._parserState=t}function i(u,b){c(!this._parserCallback,'There is already a "callback" set!'),c(u>0,'can only pass through > 0 bytes, got "'+u+'"'),this._parserInit||a(this),g("passing through %o bytes",u),this._parserBytesLeft=u,this._parserCallback=b,this._parserState=e}function s(u,b,_){this._parserInit||a(this),g("write(%o bytes)",u.length),typeof b=="function"&&(_=b),v(this,u,null,_)}function f(u,b,_){this._parserInit||a(this),g("transform(%o bytes)",u.length),typeof b!="function"&&(b=this._parserOutput),v(this,u,b,_)}function x(u,b,_,C){return u._parserBytesLeft<=0?C(new Error("got data but not currently parsing anything")):b.length<=u._parserBytesLeft?function(){return y(u,b,_,C)}:function(){var M=b.slice(0,u._parserBytesLeft);return y(u,M,_,function(E){if(E)return C(E);if(b.length>M.length)return function(){return x(u,b.slice(M.length),_,C)}})}}function y(u,b,_,C){if(u._parserBytesLeft-=b.length,g("%o bytes left for stream piece",u._parserBytesLeft),u._parserState===S?(u._parserBuffers.push(b),u._parserBuffered+=b.length):u._parserState===e&&_(b),u._parserBytesLeft===0){var M=u._parserCallback;if(M&&u._parserState===S&&u._parserBuffers.length>1&&(b=Buffer.concat(u._parserBuffers,u._parserBuffered)),u._parserState!==S&&(b=null),u._parserCallback=null,u._parserBuffered=0,u._parserState=P,u._parserBuffers.splice(0),M){var E=[];b&&E.push(b),_&&E.push(_);var A=M.length>E.length;A&&E.push(T(C));var h=M.apply(u,E);if(!A||C===h)return C}}else return C}var v=T(x);function T(u){return function(){for(var b=u.apply(this,arguments);typeof b=="function";)b=b();return b}}}),dh=Ft(Q=>{var $=OB().Transform,c=$B();function g(){$.call(this,{readableObjectMode:!0})}g.prototype=Object.create($.prototype),g.prototype.constructor=g,c(g.prototype),Q.ParserStream=g,Q.sliceEq=function(S,t,e){for(var r=t,a=0;a<e.length;)if(S[r++]!==e[a++])return!1;return!0},Q.str2arr=function(S,t){var e=[],r=0;if(t&&t==="hex")for(;r<S.length;)e.push(parseInt(S.slice(r,r+2),16)),r+=2;else for(;r<S.length;r++)e.push(S.charCodeAt(r)&255);return e},Q.readUInt16LE=function(S,t){return S[t]|S[t+1]<<8},Q.readUInt16BE=function(S,t){return S[t+1]|S[t]<<8},Q.readUInt32LE=function(S,t){return S[t]|S[t+1]<<8|S[t+2]<<16|S[t+3]*16777216},Q.readUInt32BE=function(S,t){return S[t+3]|S[t+2]<<8|S[t+1]<<16|S[t]*16777216};function P(S,t,e){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||"",this.name=this.constructor.name,this.message=S,t&&(this.code=t),e&&(this.statusCode=e)}P.prototype=Object.create(Error.prototype),P.prototype.constructor=P,Q.ProbeError=P}),GB=Ft((Q,$)=>{var c=dh().readUInt16BE,g=dh().readUInt32BE;function P(i,s){if(i.length<4+s)return null;var f=g(i,s);return i.length<f+s||f<8?null:{boxtype:String.fromCharCode.apply(null,i.slice(s+4,s+8)),data:i.slice(s+8,s+f),end:s+f}}$.exports.unbox=P;function S(i,s){for(var f=0;;){var x=P(i,f);if(!x)break;switch(x.boxtype){case"ispe":s.sizes.push({width:g(x.data,4),height:g(x.data,8)});break;case"irot":s.transforms.push({type:"irot",value:x.data[0]&3});break;case"imir":s.transforms.push({type:"imir",value:x.data[0]&1});break}f=x.end}}function t(i,s,f){for(var x=0,y=0;y<f;y++)x=x*256+(i[s+y]||0);return x}function e(i,s){for(var f=i[4]>>4&15,x=i[4]&15,y=i[5]>>4&15,v=c(i,6),T=8,u=0;u<v;u++){var b=c(i,T);T+=2;var _=c(i,T);T+=2;var C=t(i,T,y);T+=y;var M=c(i,T);if(T+=2,_===0&&M===1){var E=t(i,T,f),A=t(i,T+f,x);s.item_loc[b]={length:A,offset:E+C}}T+=M*(f+x)}}function r(i,s){for(var f=c(i,4),x=6,y=0;y<f;y++){var v=P(i,x);if(!v)break;if(v.boxtype==="infe"){for(var T=c(v.data,4),u="",b=8;b<v.data.length&&v.data[b];b++)u+=String.fromCharCode(v.data[b]);s.item_inf[u]=T}x=v.end}}function a(i,s){for(var f=0;;){var x=P(i,f);if(!x)break;x.boxtype==="ipco"&&S(x.data,s),f=x.end}}function n(i,s){for(var f=4;;){var x=P(i,f);if(!x)break;x.boxtype==="iprp"&&a(x.data,s),x.boxtype==="iloc"&&e(x.data,s),x.boxtype==="iinf"&&r(x.data,s),f=x.end}}function o(i){var s=i.reduce(function(y,v){return y.width>v.width||y.width===v.width&&y.height>v.height?y:v}),f=i.reduce(function(y,v){return y.height>v.height||y.height===v.height&&y.width>v.width?y:v}),x;return s.width>f.height||s.width===f.height&&s.height>f.width?x=s:x=f,x}$.exports.readSizeFromMeta=function(i){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(n(i,s),!!s.sizes.length){var f=o(s.sizes),x=1;s.transforms.forEach(function(v){var T={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},u={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(v.type==="imir"&&(v.value===0?x=u[x]:(x=u[x],x=T[x],x=T[x])),v.type==="irot")for(var b=0;b<v.value;b++)x=T[x]});var y=null;return s.item_inf.Exif&&(y=s.item_loc[s.item_inf.Exif]),{width:f.width,height:f.height,orientation:s.transforms.length?x:null,variants:s.sizes,exif_location:y}}},$.exports.getMimeType=function(i){var s=String.fromCharCode.apply(null,i.slice(0,4)),f={};f[s]=!0;for(var x=8;x<i.length;x+=4)f[String.fromCharCode.apply(null,i.slice(x,x+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"}}}),sk=Ft((Q,$)=>{function c(S,t){var e=new Error(S);return e.code=t,e}function g(S){try{return decodeURIComponent(escape(S))}catch{return S}}function P(S,t,e){this.input=S.subarray(t,e),this.start=t;var r=String.fromCharCode.apply(null,this.input.subarray(0,4));if(r!=="II*\0"&&r!=="MM\0*")throw c("invalid TIFF signature","EBADDATA");this.big_endian=r[0]==="M"}P.prototype.each=function(S){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,S)}},P.prototype.read_uint16=function(S){var t=this.input;if(S+2>t.length)throw c("unexpected EOF","EBADDATA");return this.big_endian?t[S]*256+t[S+1]:t[S]+t[S+1]*256},P.prototype.read_uint32=function(S){var t=this.input;if(S+4>t.length)throw c("unexpected EOF","EBADDATA");return this.big_endian?t[S]*16777216+t[S+1]*65536+t[S+2]*256+t[S+3]:t[S]+t[S+1]*256+t[S+2]*65536+t[S+3]*16777216},P.prototype.is_subifd_link=function(S,t){return S===0&&t===34665||S===0&&t===34853||S===34665&&t===40965},P.prototype.exif_format_length=function(S){switch(S){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}},P.prototype.exif_format_read=function(S,t){var e;switch(S){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}},P.prototype.scan_ifd=function(S,t,e){var r=this.read_uint16(t);t+=2;for(var a=0;a<r;a++){var n=this.read_uint16(t),o=this.read_uint16(t+2),i=this.read_uint32(t+4),s=this.exif_format_length(o),f=i*s,x=f<=4?t+8:this.read_uint32(t+8),y=!1;if(x+f>this.input.length)throw c("unexpected EOF","EBADDATA");for(var v=[],T=x,u=0;u<i;u++,T+=s){var b=this.exif_format_read(o,T);if(b===null){v=null;break}v.push(b)}Array.isArray(v)&&o===2&&(v=g(String.fromCharCode.apply(null,v)),v&&v[v.length-1]==="\0"&&(v=v.slice(0,-1))),this.is_subifd_link(S,n)&&Array.isArray(v)&&Number.isInteger(v[0])&&v[0]>0&&(this.ifds_to_read.push({id:n,offset:v[0]}),y=!0);var _={is_big_endian:this.big_endian,ifd:S,tag:n,format:o,count:i,entry_offset:t+this.start,data_length:f,data_offset:x+this.start,value:v,is_subifd_link:y};if(e(_)===!1){this.aborted=!0;return}t+=12}S===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},$.exports.ExifParser=P,$.exports.get_orientation=function(S){var t=0;try{return new P(S,0,S.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}}}),YB=Ft((Q,$)=>{var c=dh().str2arr,g=dh().sliceEq,P=dh().readUInt32BE,S=GB(),t=sk(),e=c("ftyp");$.exports=function(r){if(g(r,4,e)){var a=S.unbox(r,0);if(a){var n=S.getMimeType(a.data);if(n){for(var o,i=a.end;;){var s=S.unbox(r,i);if(!s)break;if(i=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){o=s.data;break}}if(o){var f=S.readSizeFromMeta(o);if(f){var x={width:f.width,height:f.height,type:n.type,mime:n.mime,wUnits:"px",hUnits:"px"};if(f.variants.length>1&&(x.variants=f.variants),f.orientation&&(x.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=r.length){var y=P(r,f.exif_location.offset),v=r.slice(f.exif_location.offset+y+4,f.exif_location.offset+f.exif_location.length),T=t.get_orientation(v);T>0&&(x.orientation=T)}return x}}}}}}}),KB=Ft((Q,$)=>{var c=dh().str2arr,g=dh().sliceEq,P=dh().readUInt16LE,S=c("BM");$.exports=function(t){if(!(t.length<26)&&g(t,0,S))return{width:P(t,18),height:P(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}),XB=Ft((Q,$)=>{var c=dh().str2arr,g=dh().sliceEq,P=dh().readUInt16LE,S=c("GIF87a"),t=c("GIF89a");$.exports=function(e){if(!(e.length<10)&&!(!g(e,0,S)&&!g(e,0,t)))return{width:P(e,6),height:P(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}),JB=Ft((Q,$)=>{var c=dh().readUInt16LE,g=0,P=1,S=16;$.exports=function(t){var e=c(t,0),r=c(t,2),a=c(t,4);if(!(e!==g||r!==P||!a)){for(var n=[],o={width:0,height:0},i=0;i<a;i++){var s=t[6+S*i]||256,f=t[6+S*i+1]||256,x={width:s,height:f};n.push(x),(s>o.width||f>o.height)&&(o=x)}return{width:o.width,height:o.height,variants:n,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}),QB=Ft((Q,$)=>{var c=dh().readUInt16BE,g=dh().str2arr,P=dh().sliceEq,S=sk(),t=g("Exif\0\0");$.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 a=e[r++],n;a===255;)a=e[r++];if(208<=a&&a<=217||a===1)n=0;else if(192<=a&&a<=254){if(e.length-r<2)return;n=c(e,r)-2,r+=2}else return;if(a===217||a===218)return;var o;if(a===225&&n>=10&&P(e,r,t)&&(o=S.get_orientation(e.slice(r+6,r+n))),n>=5&&192<=a&&a<=207&&a!==196&&a!==200&&a!==204){if(e.length-r<n)return;var i={width:c(e,r+3),height:c(e,r+1),type:"jpg",mime:"image/jpeg",wUnits:"px",hUnits:"px"};return o>0&&(i.orientation=o),i}r+=n}}}),tN=Ft((Q,$)=>{var c=dh().str2arr,g=dh().sliceEq,P=dh().readUInt32BE,S=c(`‰PNG\r

`),t=c("IHDR");$.exports=function(e){if(!(e.length<24)&&g(e,0,S)&&g(e,12,t))return{width:P(e,16),height:P(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}),eN=Ft((Q,$)=>{var c=dh().str2arr,g=dh().sliceEq,P=dh().readUInt32BE,S=c("8BPS\0");$.exports=function(t){if(!(t.length<22)&&g(t,0,S))return{width:P(t,18),height:P(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}),rN=Ft((Q,$)=>{function c(s){return s===32||s===9||s===13||s===10}function g(s){return typeof s=="number"&&isFinite(s)&&s>0}function P(s){var f=0,x=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(f=3);f<x&&c(s[f]);)f++;return f===x?!1:s[f]===60}var S=/<[-_.:a-zA-Z0-9][^>]*>/,t=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,e=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,a=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,n=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function o(s){var f=s.match(e),x=s.match(r),y=s.match(a);return{width:f&&(f[1]||f[2]),height:x&&(x[1]||x[2]),viewbox:y&&(y[1]||y[2])}}function i(s){return n.test(s)?s.match(n)[0]:"px"}$.exports=function(s){if(P(s)){for(var f="",x=0;x<s.length;x++)f+=String.fromCharCode(s[x]);var y=(f.match(S)||[""])[0];if(t.test(y)){var v=o(y),T=parseFloat(v.width),u=parseFloat(v.height);if(v.width&&v.height)return!g(T)||!g(u)?void 0:{width:T,height:u,type:"svg",mime:"image/svg+xml",wUnits:i(v.width),hUnits:i(v.height)};var b=(v.viewbox||"").split(" "),_={width:b[2],height:b[3]},C=parseFloat(_.width),M=parseFloat(_.height);if(!(!g(C)||!g(M))&&i(_.width)===i(_.height)){var E=C/M;return v.width?g(T)?{width:T,height:T/E,type:"svg",mime:"image/svg+xml",wUnits:i(v.width),hUnits:i(v.width)}:void 0:v.height?g(u)?{width:u*E,height:u,type:"svg",mime:"image/svg+xml",wUnits:i(v.height),hUnits:i(v.height)}:void 0:{width:C,height:M,type:"svg",mime:"image/svg+xml",wUnits:i(_.width),hUnits:i(_.height)}}}}}}),nN=Ft((Q,$)=>{var c=dh().str2arr,g=dh().sliceEq,P=dh().readUInt16LE,S=dh().readUInt16BE,t=dh().readUInt32LE,e=dh().readUInt32BE,r=c("II*\0"),a=c("MM\0*");function n(s,f,x){return x?S(s,f):P(s,f)}function o(s,f,x){return x?e(s,f):t(s,f)}function i(s,f,x){var y=n(s,f+2,x),v=o(s,f+4,x);return v!==1||y!==3&&y!==4?null:y===3?n(s,f+8,x):o(s,f+8,x)}$.exports=function(s){if(!(s.length<8)&&!(!g(s,0,r)&&!g(s,0,a))){var f=s[0]===77,x=o(s,4,f)-8;if(!(x<0)){var y=x+8;if(!(s.length-y<2)){var v=n(s,y+0,f)*12;if(!(v<=0)&&(y+=2,!(s.length-y<v))){var T,u,b,_;for(T=0;T<v;T+=12)_=n(s,y+T,f),_===256?u=i(s,y+T,f):_===257&&(b=i(s,y+T,f));if(u&&b)return{width:u,height:b,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}),iN=Ft((Q,$)=>{var c=dh().str2arr,g=dh().sliceEq,P=dh().readUInt16LE,S=dh().readUInt32LE,t=sk(),e=c("RIFF"),r=c("WEBP");function a(i,s){if(!(i[s+3]!==157||i[s+4]!==1||i[s+5]!==42))return{width:P(i,s+6)&16383,height:P(i,s+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function n(i,s){if(i[s]===47){var f=S(i,s+1);return{width:(f&16383)+1,height:(f>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function o(i,s){return{width:(i[s+6]<<16|i[s+5]<<8|i[s+4])+1,height:(i[s+9]<<s|i[s+8]<<8|i[s+7])+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}$.exports=function(i){if(!(i.length<16)&&!(!g(i,0,e)&&!g(i,8,r))){var s=12,f=null,x=0,y=S(i,4)+8;if(!(y>i.length)){for(;s+8<y;){if(i[s]===0){s++;continue}var v=String.fromCharCode.apply(null,i.slice(s,s+4)),T=S(i,s+4);v==="VP8 "&&T>=10?f=f||a(i,s+8):v==="VP8L"&&T>=9?f=f||n(i,s+8):v==="VP8X"&&T>=10?f=f||o(i,s+8):v==="EXIF"&&(x=t.get_orientation(i.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(f)return x>0&&(f.orientation=x),f}}}}),aN=Ft((Q,$)=>{$.exports={avif:YB(),bmp:KB(),gif:XB(),ico:JB(),jpeg:QB(),png:tN(),psd:eN(),svg:rN(),tiff:nN(),webp:iN()}}),oN=Ft((Q,$)=>{var c=aN();function g(P){for(var S=Object.keys(c),t=0;t<S.length;t++){var e=c[S[t]](P);if(e)return e}return null}$.exports=function(P){return g(P)},$.exports.parsers=c}),sN=Ft(Q=>{var $=oN(),c=o0().IMAGE_URL_PREFIX,g=tx().Buffer;Q.getImageSize=function(P){var S=P.replace(c,""),t=new g(S,"base64");return $(t)}}),lN=Ft((Q,$)=>{var c=bn(),g=Q_(),P=ra(),S=Es(),t=bn().maxRowLength,e=sN().getImageSize;$.exports=function(o,i){var s,f;if(i._hasZ)s=i.z.length,f=t(i.z);else if(i._hasSource){var x=e(i.source);s=x.height,f=x.width}var y=S.getFromId(o,i.xaxis||"x"),v=S.getFromId(o,i.yaxis||"y"),T=y.d2c(i.x0)-i.dx/2,u=v.d2c(i.y0)-i.dy/2,b,_=[T,T+f*i.dx],C=[u,u+s*i.dy];if(y&&y.type==="log")for(b=0;b<f;b++)_.push(T+b*i.dx);if(v&&v.type==="log")for(b=0;b<s;b++)C.push(u+b*i.dy);i._extremes[y._id]=S.findExtremes(y,_),i._extremes[v._id]=S.findExtremes(v,C),i._scaler=n(i);var M={x0:T,y0:u,z:i.z,w:f,h:s};return[M]};function r(o,i,s,f){return function(x){return c.constrain((x-o)*i,s,f)}}function a(o,i){return function(s){return c.constrain(s,o,i)}}function n(o){var i=g.colormodel[o.colormodel],s=i.colormodel||o.colormodel,f=s.length;o._sArray=[];for(var x=0;x<f;x++)i.min[x]!==o.zmin[x]||i.max[x]!==o.zmax[x]?o._sArray.push(r(o.zmin[x],(i.max[x]-i.min[x])/(o.zmax[x]-o.zmin[x]),i.min[x],i.max[x])):o._sArray.push(a(i.min[x],i.max[x]));return function(y){for(var v=y.slice(0,f),T=0;T<f;T++){var u=v[T];if(!P(u))return!1;v[T]=o._sArray[T](u)}return v}}}),uN=Ft((Q,$)=>{var c=un(),g=bn(),P=g.strTranslate,S=Op(),t=Q_(),e=qM(),r=V6().STYLE;$.exports=function(a,n,o,i){var s=n.xaxis,f=n.yaxis,x=!a._context._exportedPlot&&e();g.makeTraceGroups(i,o,"im").each(function(y){var v=c.select(this),T=y[0],u=T.trace,b=(u.zsmooth==="fast"||u.zsmooth===!1&&x)&&!u._hasZ&&u._hasSource&&s.type==="linear"&&f.type==="linear";u._realImage=b;var _=T.z,C=T.x0,M=T.y0,E=T.w,A=T.h,h=u.dx,p=u.dy,k,w,R,O,N,V;for(V=0;k===void 0&&V<E;)k=s.c2p(C+V*h),V++;for(V=E;w===void 0&&V>0;)w=s.c2p(C+V*h),V--;for(V=0;O===void 0&&V<A;)O=f.c2p(M+V*p),V++;for(V=A;N===void 0&&V>0;)N=f.c2p(M+V*p),V--;if(w<k&&(R=w,w=k,k=R),N<O&&(R=O,O=N,N=R),!b){var H=.5;k=Math.max(-H*s._length,k),w=Math.min((1+H)*s._length,w),O=Math.max(-H*f._length,O),N=Math.min((1+H)*f._length,N)}var F=Math.round(w-k),U=Math.round(N-O),W=F<=0||U<=0;if(W){var q=v.selectAll("image").data([]);q.exit().remove();return}function X(it){var Y=document.createElement("canvas");Y.width=F,Y.height=U;var ft=Y.getContext("2d",{willReadFrequently:!0}),ut=function(Tt){return g.constrain(Math.round(s.c2p(C+Tt*h)-k),0,F)},wt=function(Tt){return g.constrain(Math.round(f.c2p(M+Tt*p)-O),0,U)},zt=t.colormodel[u.colormodel],Pt=zt.colormodel||u.colormodel,Wt=zt.fmt,Ht;for(V=0;V<T.w;V++){var Jt=ut(V),ge=ut(V+1);if(!(ge===Jt||isNaN(ge)||isNaN(Jt)))for(var he=0;he<T.h;he++){var de=wt(he),se=wt(he+1);se===de||isNaN(se)||isNaN(de)||!it(V,he)||(Ht=u._scaler(it(V,he)),Ht?ft.fillStyle=Pt+"("+Wt(Ht).join(",")+")":ft.fillStyle="rgba(0,0,0,0)",ft.fillRect(Jt,de,ge-Jt,se-de))}}return Y}var lt=v.selectAll("image").data([y]);lt.enter().append("svg:image").attr({xmlns:S.svg,preserveAspectRatio:"none"}),lt.exit().remove();var yt=u.zsmooth===!1?r:"";if(b){var pt=g.simpleMap(s.range,s.r2l),st=g.simpleMap(f.range,f.r2l),tt=pt[1]<pt[0],dt=st[1]>st[0];if(tt||dt){var rt=k+F/2,at=O+U/2;yt+="transform:"+P(rt+"px",at+"px")+"scale("+(tt?-1:1)+","+(dt?-1:1)+")"+P(-rt+"px",-at+"px")+";"}}lt.attr("style",yt);var vt=new Promise(function(it){if(u._hasZ)it();else if(u._hasSource)if(u._canvas&&u._canvas.el.width===E&&u._canvas.el.height===A&&u._canvas.source===u.source)it();else{var Y=document.createElement("canvas");Y.width=E,Y.height=A;var ft=Y.getContext("2d",{willReadFrequently:!0});u._image=u._image||new Image;var ut=u._image;ut.onload=function(){ft.drawImage(ut,0,0),u._canvas={el:Y,source:u.source},it()},ut.setAttribute("src",u.source)}}).then(function(){var it,Y;if(u._hasZ)Y=X(function(wt,zt){var Pt=_[zt][wt];return g.isTypedArray(Pt)&&(Pt=Array.from(Pt)),Pt}),it=Y.toDataURL("image/png");else if(u._hasSource)if(b)it=u.source;else{var ft=u._canvas.el.getContext("2d",{willReadFrequently:!0}),ut=ft.getImageData(0,0,E,A).data;Y=X(function(wt,zt){var Pt=4*(zt*E+wt);return[ut[Pt],ut[Pt+1],ut[Pt+2],ut[Pt+3]]}),it=Y.toDataURL("image/png")}lt.attr({"xlink:href":it,height:U,width:F,x:k,y:O})});a._promises.push(vt)})}}),cN=Ft((Q,$)=>{var c=un();$.exports=function(g){c.select(g).selectAll(".im image").style("opacity",function(P){return P[0].trace.opacity})}}),hN=Ft((Q,$)=>{var c=Qh(),g=bn(),P=g.isArrayOrTypedArray,S=Q_();$.exports=function(t,e,r){var a=t.cd[0],n=a.trace,o=t.xa,i=t.ya;if(!(c.inbox(e-a.x0,e-(a.x0+a.w*n.dx),0)>0||c.inbox(r-a.y0,r-(a.y0+a.h*n.dy),0)>0)){var s=Math.floor((e-a.x0)/n.dx),f=Math.floor(Math.abs(r-a.y0)/n.dy),x;if(n._hasZ?x=a.z[f][s]:n._hasSource&&(x=n._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(s,f,1,1).data),!!x){var y=a.hi||n.hoverinfo,v;if(y){var T=y.split("+");T.indexOf("all")!==-1&&(T=["color"]),T.indexOf("color")!==-1&&(v=!0)}var u=S.colormodel[n.colormodel],b=u.colormodel||n.colormodel,_=b.length,C=n._scaler(x),M=u.suffix,E=[];(n.hovertemplate||v)&&(E.push("["+[C[0]+M[0],C[1]+M[1],C[2]+M[2]].join(", ")),_===4&&E.push(", "+C[3]+M[3]),E.push("]"),E=E.join(""),t.extraText=b.toUpperCase()+": "+E);var A;P(n.hovertext)&&P(n.hovertext[f])?A=n.hovertext[f][s]:P(n.text)&&P(n.text[f])&&(A=n.text[f][s]);var h=i.c2p(a.y0+(f+.5)*n.dy),p=a.x0+(s+.5)*n.dx,k=a.y0+(f+.5)*n.dy,w="["+x.slice(0,n.colormodel.length).join(", ")+"]";return[g.extendFlat(t,{index:[f,s],x0:o.c2p(a.x0+s*n.dx),x1:o.c2p(a.x0+(s+1)*n.dx),y0:h,y1:h,color:C,xVal:p,xLabelVal:p,yVal:k,yLabelVal:k,zLabelVal:w,text:A,hovertemplateLabels:{zLabel:w,colorLabel:E,"color[0]Label":C[0]+M[0],"color[1]Label":C[1]+M[1],"color[2]Label":C[2]+M[2],"color[3]Label":C[3]+M[3]}})]}}}}),fN=Ft((Q,$)=>{$.exports=function(c,g){return"xVal"in g&&(c.x=g.xVal),"yVal"in g&&(c.y=g.yVal),g.xa&&(c.xaxis=g.xa),g.ya&&(c.yaxis=g.ya),c.color=g.color,c.colormodel=g.trace.colormodel,c.z||(c.z=g.color),c}}),dN=Ft((Q,$)=>{$.exports={attributes:v7(),supplyDefaults:YR(),calc:lN(),plot:uN(),style:cN(),hoverPoints:hN(),eventData:fN(),moduleType:"trace",name:"image",basePlotModule:Mf(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}),pN=Ft((Q,$)=>{$.exports=dN()}),ix=Ft((Q,$)=>{var c=$o(),g=Nh().attributes,P=Ea(),S=bi(),{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=$u(),a=Ta().extendFlat,n=Td().pattern,o=P({editType:"plot",arrayOk:!0,colorEditType:"plot"});$.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:S.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:a({},c.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:a({},o,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:a({},o,{}),outsidetextfont:a({},o,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:a({},o,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:g({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}),ax=Ft((Q,$)=>{var c=ra(),g=bn(),P=ix(),S=Nh().defaults,t=J0().handleText,e=bn().coercePattern;function r(o,i){var s=g.isArrayOrTypedArray(o),f=g.isArrayOrTypedArray(i),x=Math.min(s?o.length:1/0,f?i.length:1/0);if(isFinite(x)||(x=0),x&&f){for(var y,v=0;v<x;v++){var T=i[v];if(c(T)&&T>0){y=!0;break}}y||(x=0)}return{hasLabels:s,hasValues:f,len:x}}function a(o,i,s,f,x){var y=f("marker.line.width");y&&f("marker.line.color",x?void 0:s.paper_bgcolor);var v=f("marker.colors");e(f,"marker.pattern",v),o.marker&&!i.marker.pattern.fgcolor&&(i.marker.pattern.fgcolor=o.marker.colors),i.marker.pattern.bgcolor||(i.marker.pattern.bgcolor=s.paper_bgcolor)}function n(o,i,s,f){function x(w,R){return g.coerce(o,i,P,w,R)}var y=x("labels"),v=x("values"),T=r(y,v),u=T.len;if(i._hasLabels=T.hasLabels,i._hasValues=T.hasValues,!i._hasLabels&&i._hasValues&&(x("label0"),x("dlabel")),!u){i.visible=!1;return}i._length=u,a(o,i,f,x,!0),x("scalegroup");var b=x("text"),_=x("texttemplate");x("texttemplatefallback");var C;if(_||(C=x("textinfo",g.isArrayOrTypedArray(b)?"text+percent":"percent")),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback"),_||C&&C!=="none"){var M=x("textposition");t(o,i,f,x,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var E=Array.isArray(M)||M==="auto",A=E||M==="outside";A&&x("automargin"),(M==="inside"||M==="auto"||Array.isArray(M))&&x("insidetextorientation")}else C==="none"&&x("textposition","none");S(i,f,x);var h=x("hole"),p=x("title.text");if(p){var k=x("title.position",h?"middle center":"top center");!h&&k==="middle center"&&(i.title.position="top center"),g.coerceFont(x,"title.font",f.font)}x("sort"),x("direction"),x("rotation"),x("pull")}$.exports={handleLabelsAndValues:r,handleMarkerDefaults:a,supplyDefaults:n}}),lk=Ft((Q,$)=>{$.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),mN=Ft((Q,$)=>{var c=bn(),g=lk();$.exports=function(P,S){function t(e,r){return c.coerce(P,S,g,e,r)}t("hiddenlabels"),t("piecolorway",S.colorway),t("extendpiecolors")}}),ib=Ft((Q,$)=>{var c=ra(),g=fo(),P=li(),S={};function t(n,o){var i=[],s=n._fullLayout,f=s.hiddenlabels||[],x=o.labels,y=o.marker.colors||[],v=o.values,T=o._length,u=o._hasValues&&T,b,_;if(o.dlabel)for(x=new Array(T),b=0;b<T;b++)x[b]=String(o.label0+b*o.dlabel);var C={},M=e(s["_"+o.type+"colormap"]),E=0,A=!1;for(b=0;b<T;b++){var h,p,k;if(u){if(h=v[b],!c(h))continue;h=+h}else h=1;p=x[b],(p===void 0||p==="")&&(p=b),p=String(p);var w=C[p];w===void 0?(C[p]=i.length,k=f.indexOf(p)!==-1,k||(E+=h),i.push({v:h,label:p,color:M(y[b],p),i:b,pts:[b],hidden:k})):(A=!0,_=i[w],_.v+=h,_.pts.push(b),_.hidden||(E+=h),_.color===!1&&y[b]&&(_.color=M(y[b],p)))}i=i.filter(function(O){return O.v>=0});var R=o.type==="funnelarea"?A:o.sort;return R&&i.sort(function(O,N){return N.v-O.v}),i[0]&&(i[0].vTotal=E),i}function e(n){return function(o,i){return!o||(o=g(o),!o.isValid())?!1:(o=P.addOpacity(o,o.getAlpha()),n[i]||(n[i]=o),o)}}function r(n,o){var i=(o||{}).type;i||(i="pie");var s=n._fullLayout,f=n.calcdata,x=s[i+"colorway"],y=s["_"+i+"colormap"];s["extend"+i+"colors"]&&(x=a(x,S));for(var v=0,T=0;T<f.length;T++){var u=f[T],b=u[0].trace.type;if(b===i)for(var _=0;_<u.length;_++){var C=u[_];C.color===!1&&(y[C.label]?C.color=y[C.label]:(y[C.label]=C.color=x[v%x.length],v++))}}}function a(n,o){var i,s=JSON.stringify(n),f=o[s];if(!f){for(f=n.slice(),i=0;i<n.length;i++)f.push(g(n[i]).lighten(20).toHexString());for(i=0;i<n.length;i++)f.push(g(n[i]).darken(20).toHexString());o[s]=f}return f}$.exports={calc:t,crossTraceCalc:r,makePullColorFn:e,generateExtendedColors:a}}),gN=Ft((Q,$)=>{var c=Dp().appendArrayMultiPointValues;$.exports=function(g,P){var S={curveNumber:P.index,pointNumbers:g.pts,data:P._input,fullData:P,label:g.label,color:g.color,value:g.v,percent:g.percent,text:g.text,bbox:g.bbox,v:g.v};return g.pts.length===1&&(S.pointNumber=S.i=g.pts[0]),c(S,P,g.pts),P.type==="funnelarea"&&(delete S.v,delete S.i),S}}),uk=Ft((Q,$)=>{var c=un(),g=Kc(),P=Qh(),S=li(),t=js(),e=bn(),r=e.strScale,a=e.strTranslate,n=tc(),o=Rp(),i=o.recordMinTextSize,s=o.clearMinTextSize,f=Jy().TEXTPAD,x=xg(),y=gN(),v=bn().isValidTextValue;function T(dt,rt){var at=dt._context.staticPlot,vt=dt._fullLayout,it=vt._size;s("pie",vt),M(rt,dt),X(rt,it);var Y=e.makeTraceGroups(vt._pielayer,rt,"trace").each(function(ft){var ut=c.select(this),wt=ft[0],zt=wt.trace;yt(ft),ut.attr("stroke-linejoin","round"),ut.each(function(){var Pt=c.select(this).selectAll("g.slice").data(ft);Pt.enter().append("g").classed("slice",!0),Pt.exit().remove();var Wt=[[[],[]],[[],[]]],Ht=!1;Pt.each(function(Mt,te){if(Mt.hidden){c.select(this).selectAll("path,g").remove();return}Mt.pointNumber=Mt.i,Mt.curveNumber=zt.index,Wt[Mt.pxmid[1]<0?0:1][Mt.pxmid[0]<0?0:1].push(Mt);var ve=wt.cx,oe=wt.cy,Te=c.select(this),He=Te.selectAll("path.surface").data([Mt]);if(He.enter().append("path").classed("surface",!0).style({"pointer-events":at?"none":"all"}),Te.call(b,dt,ft),zt.pull){var Ge=+x.castOption(zt.pull,Mt.pts)||0;Ge>0&&(ve+=Ge*Mt.pxmid[0],oe+=Ge*Mt.pxmid[1])}Mt.cxFinal=ve,Mt.cyFinal=oe;function cr(Ce,$t,ne,Ct){var gt=Ct*($t[0]-Ce[0]),St=Ct*($t[1]-Ce[1]);return"a"+Ct*wt.r+","+Ct*wt.r+" 0 "+Mt.largeArc+(ne?" 1 ":" 0 ")+gt+","+St}var ur=zt.hole;if(Mt.v===wt.vTotal){var jr="M"+(ve+Mt.px0[0])+","+(oe+Mt.px0[1])+cr(Mt.px0,Mt.pxmid,!0,1)+cr(Mt.pxmid,Mt.px0,!0,1)+"Z";ur?He.attr("d","M"+(ve+ur*Mt.px0[0])+","+(oe+ur*Mt.px0[1])+cr(Mt.px0,Mt.pxmid,!1,ur)+cr(Mt.pxmid,Mt.px0,!1,ur)+"Z"+jr):He.attr("d",jr)}else{var Hr=cr(Mt.px0,Mt.px1,!0,1);if(ur){var br=1-ur;He.attr("d","M"+(ve+ur*Mt.px1[0])+","+(oe+ur*Mt.px1[1])+cr(Mt.px1,Mt.px0,!1,ur)+"l"+br*Mt.px0[0]+","+br*Mt.px0[1]+Hr+"Z")}else He.attr("d","M"+ve+","+oe+"l"+Mt.px0[0]+","+Mt.px0[1]+Hr+"Z")}st(dt,Mt,wt);var Kr=x.castOption(zt.textposition,Mt.pts),rn=Te.selectAll("g.slicetext").data(Mt.text&&Kr!=="none"?[0]:[]);rn.enter().append("g").classed("slicetext",!0),rn.exit().remove(),rn.each(function(){var Ce=e.ensureSingle(c.select(this),"text","",function(le){le.attr("data-notex",1)}),$t=e.ensureUniformFontSize(dt,Kr==="outside"?_(zt,Mt,vt.font):C(zt,Mt,vt.font));Ce.text(Mt.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(t.font,$t).call(n.convertToTspans,dt);var ne=t.bBox(Ce.node()),Ct;if(Kr==="outside")Ct=N(ne,Mt);else if(Ct=E(ne,Mt,wt),Kr==="auto"&&Ct.scale<1){var gt=e.ensureUniformFontSize(dt,zt.outsidetextfont);Ce.call(t.font,gt),ne=t.bBox(Ce.node()),Ct=N(ne,Mt)}var St=Ct.textPosAngle,Nt=St===void 0?Mt.pxmid:pt(wt.r,St);if(Ct.targetX=ve+Nt[0]*Ct.rCenter+(Ct.x||0),Ct.targetY=oe+Nt[1]*Ct.rCenter+(Ct.y||0),tt(Ct,ne),Ct.outside){var ee=Ct.targetY;Mt.yLabelMin=ee-ne.height/2,Mt.yLabelMid=ee,Mt.yLabelMax=ee+ne.height/2,Mt.labelExtraX=0,Mt.labelExtraY=0,Ht=!0}Ct.fontSize=$t.size,i(zt.type,Ct,vt),ft[te].transform=Ct,e.setTransormAndDisplay(Ce,Ct)})});var Jt=c.select(this).selectAll("g.titletext").data(zt.title.text?[0]:[]);if(Jt.enter().append("g").classed("titletext",!0),Jt.exit().remove(),Jt.each(function(){var Mt=e.ensureSingle(c.select(this),"text","",function(oe){oe.attr("data-notex",1)}),te=zt.title.text;zt._meta&&(te=e.templateString(te,zt._meta)),Mt.text(te).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(t.font,zt.title.font).call(n.convertToTspans,dt);var ve;zt.title.position==="middle center"?ve=V(wt):ve=H(wt,it),Mt.attr("transform",a(ve.x,ve.y)+r(Math.min(1,ve.scale))+a(ve.tx,ve.ty))}),Ht&&q(Wt,zt),u(Pt,zt),Ht&&zt.automargin){var ge=t.bBox(ut.node()),he=zt.domain,de=it.w*(he.x[1]-he.x[0]),se=it.h*(he.y[1]-he.y[0]),Tt=(.5*de-wt.r)/it.w,Lt=(.5*se-wt.r)/it.h;g.autoMargin(dt,"pie."+zt.uid+".automargin",{xl:he.x[0]-Tt,xr:he.x[1]+Tt,yb:he.y[0]-Lt,yt:he.y[1]+Lt,l:Math.max(wt.cx-wt.r-ge.left,0),r:Math.max(ge.right-(wt.cx+wt.r),0),b:Math.max(ge.bottom-(wt.cy+wt.r),0),t:Math.max(wt.cy-wt.r-ge.top,0),pad:5})}})});setTimeout(function(){Y.selectAll("tspan").each(function(){var ft=c.select(this);ft.attr("dy")&&ft.attr("dy",ft.attr("dy"))})},0)}function u(dt,rt){dt.each(function(at){var vt=c.select(this);if(!at.labelExtraX&&!at.labelExtraY){vt.select("path.textline").remove();return}var it=vt.select("g.slicetext text");at.transform.targetX+=at.labelExtraX,at.transform.targetY+=at.labelExtraY,e.setTransormAndDisplay(it,at.transform);var Y=at.cxFinal+at.pxmid[0],ft=at.cyFinal+at.pxmid[1],ut="M"+Y+","+ft,wt=(at.yLabelMax-at.yLabelMin)*(at.pxmid[0]<0?-1:1)/4;if(at.labelExtraX){var zt=at.labelExtraX*at.pxmid[1]/at.pxmid[0],Pt=at.yLabelMid+at.labelExtraY-(at.cyFinal+at.pxmid[1]);Math.abs(zt)>Math.abs(Pt)?ut+="l"+Pt*at.pxmid[0]/at.pxmid[1]+","+Pt+"H"+(Y+at.labelExtraX+wt):ut+="l"+at.labelExtraX+","+zt+"v"+(Pt-zt)+"h"+wt}else ut+="V"+(at.yLabelMid+at.labelExtraY)+"h"+wt;e.ensureSingle(vt,"path","textline").call(S.stroke,rt.outsidetextfont.color).attr({"stroke-width":Math.min(2,rt.outsidetextfont.size/8),d:ut,fill:"none"})})}function b(dt,rt,at){var vt=at[0],it=vt.cx,Y=vt.cy,ft=vt.trace,ut=ft.type==="funnelarea";"_hasHoverLabel"in ft||(ft._hasHoverLabel=!1),"_hasHoverEvent"in ft||(ft._hasHoverEvent=!1),dt.on("mouseover",function(wt){var zt=rt._fullLayout,Pt=rt._fullData[ft.index];if(!(rt._dragging||zt.hovermode===!1)){var Wt=Pt.hoverinfo;if(Array.isArray(Wt)&&(Wt=P.castHoverinfo({hoverinfo:[x.castOption(Wt,wt.pts)],_module:ft._module},zt,0)),Wt==="all"&&(Wt="label+text+value+percent+name"),Pt.hovertemplate||Wt!=="none"&&Wt!=="skip"&&Wt){var Ht=wt.rInscribed||0,Jt=it+wt.pxmid[0]*(1-Ht),ge=Y+wt.pxmid[1]*(1-Ht),he=zt.separators,de=[];if(Wt&&Wt.indexOf("label")!==-1&&de.push(wt.label),wt.text=x.castOption(Pt.hovertext||Pt.text,wt.pts),Wt&&Wt.indexOf("text")!==-1){var se=wt.text;e.isValidTextValue(se)&&de.push(se)}wt.value=wt.v,wt.valueLabel=x.formatPieValue(wt.v,he),Wt&&Wt.indexOf("value")!==-1&&de.push(wt.valueLabel),wt.percent=wt.v/vt.vTotal,wt.percentLabel=x.formatPiePercent(wt.percent,he),Wt&&Wt.indexOf("percent")!==-1&&de.push(wt.percentLabel);var Tt=Pt.hoverlabel,Lt=Tt.font,Mt=[];P.loneHover({trace:ft,x0:Jt-Ht*vt.r,x1:Jt+Ht*vt.r,y:ge,_x0:ut?it+wt.TL[0]:Jt-Ht*vt.r,_x1:ut?it+wt.TR[0]:Jt+Ht*vt.r,_y0:ut?Y+wt.TL[1]:ge-Ht*vt.r,_y1:ut?Y+wt.BL[1]:ge+Ht*vt.r,text:de.join("<br>"),name:Pt.hovertemplate||Wt.indexOf("name")!==-1?Pt.name:void 0,idealAlign:wt.pxmid[0]<0?"left":"right",color:x.castOption(Tt.bgcolor,wt.pts)||wt.color,borderColor:x.castOption(Tt.bordercolor,wt.pts),fontFamily:x.castOption(Lt.family,wt.pts),fontSize:x.castOption(Lt.size,wt.pts),fontColor:x.castOption(Lt.color,wt.pts),nameLength:x.castOption(Tt.namelength,wt.pts),textAlign:x.castOption(Tt.align,wt.pts),hovertemplate:x.castOption(Pt.hovertemplate,wt.pts),hovertemplateLabels:wt,eventData:[y(wt,Pt)]},{container:zt._hoverlayer.node(),outerContainer:zt._paper.node(),gd:rt,inOut_bbox:Mt}),wt.bbox=Mt[0],ft._hasHoverLabel=!0}ft._hasHoverEvent=!0,rt.emit("plotly_hover",{points:[y(wt,Pt)],event:c.event})}}),dt.on("mouseout",function(wt){var zt=rt._fullLayout,Pt=rt._fullData[ft.index],Wt=c.select(this).datum();ft._hasHoverEvent&&(wt.originalEvent=c.event,rt.emit("plotly_unhover",{points:[y(Wt,Pt)],event:c.event}),ft._hasHoverEvent=!1),ft._hasHoverLabel&&(P.loneUnhover(zt._hoverlayer.node()),ft._hasHoverLabel=!1)}),dt.on("click",function(wt){var zt=rt._fullLayout,Pt=rt._fullData[ft.index];rt._dragging||zt.hovermode===!1||(rt._hoverdata=[y(wt,Pt)],P.click(rt,c.event))})}function _(dt,rt,at){var vt=x.castOption(dt.outsidetextfont.color,rt.pts)||x.castOption(dt.textfont.color,rt.pts)||at.color,it=x.castOption(dt.outsidetextfont.family,rt.pts)||x.castOption(dt.textfont.family,rt.pts)||at.family,Y=x.castOption(dt.outsidetextfont.size,rt.pts)||x.castOption(dt.textfont.size,rt.pts)||at.size,ft=x.castOption(dt.outsidetextfont.weight,rt.pts)||x.castOption(dt.textfont.weight,rt.pts)||at.weight,ut=x.castOption(dt.outsidetextfont.style,rt.pts)||x.castOption(dt.textfont.style,rt.pts)||at.style,wt=x.castOption(dt.outsidetextfont.variant,rt.pts)||x.castOption(dt.textfont.variant,rt.pts)||at.variant,zt=x.castOption(dt.outsidetextfont.textcase,rt.pts)||x.castOption(dt.textfont.textcase,rt.pts)||at.textcase,Pt=x.castOption(dt.outsidetextfont.lineposition,rt.pts)||x.castOption(dt.textfont.lineposition,rt.pts)||at.lineposition,Wt=x.castOption(dt.outsidetextfont.shadow,rt.pts)||x.castOption(dt.textfont.shadow,rt.pts)||at.shadow;return{color:vt,family:it,size:Y,weight:ft,style:ut,variant:wt,textcase:zt,lineposition:Pt,shadow:Wt}}function C(dt,rt,at){var vt=x.castOption(dt.insidetextfont.color,rt.pts);!vt&&dt._input.textfont&&(vt=x.castOption(dt._input.textfont.color,rt.pts));var it=x.castOption(dt.insidetextfont.family,rt.pts)||x.castOption(dt.textfont.family,rt.pts)||at.family,Y=x.castOption(dt.insidetextfont.size,rt.pts)||x.castOption(dt.textfont.size,rt.pts)||at.size,ft=x.castOption(dt.insidetextfont.weight,rt.pts)||x.castOption(dt.textfont.weight,rt.pts)||at.weight,ut=x.castOption(dt.insidetextfont.style,rt.pts)||x.castOption(dt.textfont.style,rt.pts)||at.style,wt=x.castOption(dt.insidetextfont.variant,rt.pts)||x.castOption(dt.textfont.variant,rt.pts)||at.variant,zt=x.castOption(dt.insidetextfont.textcase,rt.pts)||x.castOption(dt.textfont.textcase,rt.pts)||at.textcase,Pt=x.castOption(dt.insidetextfont.lineposition,rt.pts)||x.castOption(dt.textfont.lineposition,rt.pts)||at.lineposition,Wt=x.castOption(dt.insidetextfont.shadow,rt.pts)||x.castOption(dt.textfont.shadow,rt.pts)||at.shadow;return{color:vt||S.contrast(rt.color),family:it,size:Y,weight:ft,style:ut,variant:wt,textcase:zt,lineposition:Pt,shadow:Wt}}function M(dt,rt){for(var at,vt,it=0;it<dt.length;it++)if(at=dt[it][0],vt=at.trace,vt.title.text){var Y=vt.title.text;vt._meta&&(Y=e.templateString(Y,vt._meta));var ft=t.tester.append("text").attr("data-notex",1).text(Y).call(t.font,vt.title.font).call(n.convertToTspans,rt),ut=t.bBox(ft.node(),!0);at.titleBox={width:ut.width,height:ut.height},ft.remove()}}function E(dt,rt,at){var vt=at.r||rt.rpx1,it=rt.rInscribed,Y=rt.startangle===rt.stopangle;if(Y)return{rCenter:1-it,scale:0,rotate:0,textPosAngle:0};var ft=rt.ring,ut=ft===1&&Math.abs(rt.startangle-rt.stopangle)===Math.PI*2,wt=rt.halfangle,zt=rt.midangle,Pt=at.trace.insidetextorientation,Wt=Pt==="horizontal",Ht=Pt==="tangential",Jt=Pt==="radial",ge=Pt==="auto",he=[],de;if(!ge){var se=function(Te,He){if(A(rt,Te)){var Ge=Math.abs(Te-rt.startangle),cr=Math.abs(Te-rt.stopangle),ur=Ge<cr?Ge:cr;He==="tan"?de=p(dt,vt,ft,ur,0):de=h(dt,vt,ft,ur,Math.PI/2),de.textPosAngle=Te,he.push(de)}},Tt;if(Wt||Ht){for(Tt=4;Tt>=-4;Tt-=2)se(Math.PI*Tt,"tan");for(Tt=4;Tt>=-4;Tt-=2)se(Math.PI*(Tt+1),"tan")}if(Wt||Jt){for(Tt=4;Tt>=-4;Tt-=2)se(Math.PI*(Tt+1.5),"rad");for(Tt=4;Tt>=-4;Tt-=2)se(Math.PI*(Tt+.5),"rad")}}if(ut||ge||Wt){var Lt=Math.sqrt(dt.width*dt.width+dt.height*dt.height);if(de={scale:it*vt*2/Lt,rCenter:1-it,rotate:0},de.textPosAngle=(rt.startangle+rt.stopangle)/2,de.scale>=1)return de;he.push(de)}(ge||Jt)&&(de=h(dt,vt,ft,wt,zt),de.textPosAngle=(rt.startangle+rt.stopangle)/2,he.push(de)),(ge||Ht)&&(de=p(dt,vt,ft,wt,zt),de.textPosAngle=(rt.startangle+rt.stopangle)/2,he.push(de));for(var Mt=0,te=0,ve=0;ve<he.length;ve++){var oe=he[ve].scale;if(te<oe&&(te=oe,Mt=ve),!ge&&te>=1)break}return he[Mt]}function A(dt,rt){var at=dt.startangle,vt=dt.stopangle;return at>rt&&rt>vt||at<rt&&rt<vt}function h(dt,rt,at,vt,it){rt=Math.max(0,rt-2*f);var Y=dt.width/dt.height,ft=R(Y,vt,rt,at);return{scale:ft*2/dt.height,rCenter:k(Y,ft/rt),rotate:w(it)}}function p(dt,rt,at,vt,it){rt=Math.max(0,rt-2*f);var Y=dt.height/dt.width,ft=R(Y,vt,rt,at);return{scale:ft*2/dt.width,rCenter:k(Y,ft/rt),rotate:w(it+Math.PI/2)}}function k(dt,rt){return Math.cos(rt)-dt*rt}function w(dt){return(180/Math.PI*dt+720)%180-90}function R(dt,rt,at,vt){var it=dt+1/(2*Math.tan(rt));return at*Math.min(1/(Math.sqrt(it*it+.5)+it),vt/(Math.sqrt(dt*dt+vt/2)+dt))}function O(dt,rt){return dt.v===rt.vTotal&&!rt.trace.hole?1:Math.min(1/(1+1/Math.sin(dt.halfangle)),dt.ring/2)}function N(dt,rt){var at=rt.pxmid[0],vt=rt.pxmid[1],it=dt.width/2,Y=dt.height/2;return at<0&&(it*=-1),vt<0&&(Y*=-1),{scale:1,rCenter:1,rotate:0,x:it+Math.abs(Y)*(it>0?1:-1)/2,y:Y/(1+at*at/(vt*vt)),outside:!0}}function V(dt){var rt=Math.sqrt(dt.titleBox.width*dt.titleBox.width+dt.titleBox.height*dt.titleBox.height);return{x:dt.cx,y:dt.cy,scale:dt.trace.hole*dt.r*2/rt,tx:0,ty:-dt.titleBox.height/2+dt.trace.title.font.size}}function H(dt,rt){var at=1,vt=1,it,Y=dt.trace,ft={x:dt.cx,y:dt.cy},ut={tx:0,ty:0};ut.ty+=Y.title.font.size,it=W(Y),Y.title.position.indexOf("top")!==-1?(ft.y-=(1+it)*dt.r,ut.ty-=dt.titleBox.height):Y.title.position.indexOf("bottom")!==-1&&(ft.y+=(1+it)*dt.r);var wt=F(dt.r,dt.trace.aspectratio),zt=rt.w*(Y.domain.x[1]-Y.domain.x[0])/2;return Y.title.position.indexOf("left")!==-1?(zt=zt+wt,ft.x-=(1+it)*wt,ut.tx+=dt.titleBox.width/2):Y.title.position.indexOf("center")!==-1?zt*=2:Y.title.position.indexOf("right")!==-1&&(zt=zt+wt,ft.x+=(1+it)*wt,ut.tx-=dt.titleBox.width/2),at=zt/dt.titleBox.width,vt=U(dt,rt)/dt.titleBox.height,{x:ft.x,y:ft.y,scale:Math.min(at,vt),tx:ut.tx,ty:ut.ty}}function F(dt,rt){return dt/(rt===void 0?1:rt)}function U(dt,rt){var at=dt.trace,vt=rt.h*(at.domain.y[1]-at.domain.y[0]);return Math.min(dt.titleBox.height,vt/2)}function W(dt){var rt=dt.pull;if(!rt)return 0;var at;if(e.isArrayOrTypedArray(rt))for(rt=0,at=0;at<dt.pull.length;at++)dt.pull[at]>rt&&(rt=dt.pull[at]);return rt}function q(dt,rt){var at,vt,it,Y,ft,ut,wt,zt,Pt,Wt,Ht,Jt,ge;function he(Lt,Mt){return Lt.pxmid[1]-Mt.pxmid[1]}function de(Lt,Mt){return Mt.pxmid[1]-Lt.pxmid[1]}function se(Lt,Mt){Mt||(Mt={});var te=Mt.labelExtraY+(vt?Mt.yLabelMax:Mt.yLabelMin),ve=vt?Lt.yLabelMin:Lt.yLabelMax,oe=vt?Lt.yLabelMax:Lt.yLabelMin,Te=Lt.cyFinal+ft(Lt.px0[1],Lt.px1[1]),He=te-ve,Ge,cr,ur,jr,Hr,br;if(He*wt>0&&(Lt.labelExtraY=He),!!e.isArrayOrTypedArray(rt.pull))for(cr=0;cr<Wt.length;cr++)ur=Wt[cr],!(ur===Lt||(x.castOption(rt.pull,Lt.pts)||0)>=(x.castOption(rt.pull,ur.pts)||0))&&((Lt.pxmid[1]-ur.pxmid[1])*wt>0?(jr=ur.cyFinal+ft(ur.px0[1],ur.px1[1]),He=jr-ve-Lt.labelExtraY,He*wt>0&&(Lt.labelExtraY+=He)):(oe+Lt.labelExtraY-Te)*wt>0&&(Ge=3*ut*Math.abs(cr-Wt.indexOf(Lt)),Hr=ur.cxFinal+Y(ur.px0[0],ur.px1[0]),br=Hr+Ge-(Lt.cxFinal+Lt.pxmid[0])-Lt.labelExtraX,br*ut>0&&(Lt.labelExtraX+=br)))}for(vt=0;vt<2;vt++)for(it=vt?he:de,ft=vt?Math.max:Math.min,wt=vt?1:-1,at=0;at<2;at++){for(Y=at?Math.max:Math.min,ut=at?1:-1,zt=dt[vt][at],zt.sort(it),Pt=dt[1-vt][at],Wt=Pt.concat(zt),Jt=[],Ht=0;Ht<zt.length;Ht++)zt[Ht].yLabelMid!==void 0&&Jt.push(zt[Ht]);for(ge=!1,Ht=0;vt&&Ht<Pt.length;Ht++)if(Pt[Ht].yLabelMid!==void 0){ge=Pt[Ht];break}for(Ht=0;Ht<Jt.length;Ht++){var Tt=Ht&&Jt[Ht-1];ge&&!Ht&&(Tt=ge),se(Jt[Ht],Tt)}}}function X(dt,rt){for(var at=[],vt=0;vt<dt.length;vt++){var it=dt[vt][0],Y=it.trace,ft=Y.domain,ut=rt.w*(ft.x[1]-ft.x[0]),wt=rt.h*(ft.y[1]-ft.y[0]);Y.title.text&&Y.title.position!=="middle center"&&(wt-=U(it,rt));var zt=ut/2,Pt=wt/2;Y.type==="funnelarea"&&!Y.scalegroup&&(Pt/=Y.aspectratio),it.r=Math.min(zt,Pt)/(1+W(Y)),it.cx=rt.l+rt.w*(Y.domain.x[1]+Y.domain.x[0])/2,it.cy=rt.t+rt.h*(1-Y.domain.y[0])-wt/2,Y.title.text&&Y.title.position.indexOf("bottom")!==-1&&(it.cy-=U(it,rt)),Y.scalegroup&&at.indexOf(Y.scalegroup)===-1&&at.push(Y.scalegroup)}lt(dt,at)}function lt(dt,rt){for(var at,vt,it,Y=0;Y<rt.length;Y++){var ft=1/0,ut=rt[Y];for(vt=0;vt<dt.length;vt++)if(at=dt[vt][0],it=at.trace,it.scalegroup===ut){var wt;if(it.type==="pie")wt=at.r*at.r;else if(it.type==="funnelarea"){var zt,Pt;it.aspectratio>1?(zt=at.r,Pt=zt/it.aspectratio):(Pt=at.r,zt=Pt*it.aspectratio),zt*=(1+it.baseratio)/2,wt=zt*Pt}ft=Math.min(ft,wt/at.vTotal)}for(vt=0;vt<dt.length;vt++)if(at=dt[vt][0],it=at.trace,it.scalegroup===ut){var Wt=ft*at.vTotal;it.type==="funnelarea"&&(Wt/=(1+it.baseratio)/2,Wt/=it.aspectratio),at.r=Math.sqrt(Wt)}}}function yt(dt){var rt=dt[0],at=rt.r,vt=rt.trace,it=x.getRotationAngle(vt.rotation),Y=2*Math.PI/rt.vTotal,ft="px0",ut="px1",wt,zt,Pt;if(vt.direction==="counterclockwise"){for(wt=0;wt<dt.length&&dt[wt].hidden;wt++);if(wt===dt.length)return;it+=Y*dt[wt].v,Y*=-1,ft="px1",ut="px0"}for(Pt=pt(at,it),wt=0;wt<dt.length;wt++)zt=dt[wt],!zt.hidden&&(zt[ft]=Pt,zt.startangle=it,it+=Y*zt.v/2,zt.pxmid=pt(at,it),zt.midangle=it,it+=Y*zt.v/2,Pt=pt(at,it),zt.stopangle=it,zt[ut]=Pt,zt.largeArc=zt.v>rt.vTotal/2?1:0,zt.halfangle=Math.PI*Math.min(zt.v/rt.vTotal,.5),zt.ring=1-vt.hole,zt.rInscribed=O(zt,rt))}function pt(dt,rt){return[dt*Math.sin(rt),-dt*Math.cos(rt)]}function st(dt,rt,at){var vt=dt._fullLayout,it=at.trace,Y=it.texttemplate,ft=it.textinfo;if(!Y&&ft&&ft!=="none"){var ut=ft.split("+"),wt=function(Mt){return ut.indexOf(Mt)!==-1},zt=wt("label"),Pt=wt("text"),Wt=wt("value"),Ht=wt("percent"),Jt=vt.separators,ge;if(ge=zt?[rt.label]:[],Pt){var he=x.getFirstFilled(it.text,rt.pts);v(he)&&ge.push(he)}Wt&&ge.push(x.formatPieValue(rt.v,Jt)),Ht&&ge.push(x.formatPiePercent(rt.v/at.vTotal,Jt)),rt.text=ge.join("<br>")}function de(Mt){return{label:Mt.label,value:Mt.v,valueLabel:x.formatPieValue(Mt.v,vt.separators),percent:Mt.v/at.vTotal,percentLabel:x.formatPiePercent(Mt.v/at.vTotal,vt.separators),color:Mt.color,text:Mt.text,customdata:e.castOption(it,Mt.i,"customdata")}}if(Y){var se=e.castOption(it,rt.i,"texttemplate");if(!se)rt.text="";else{var Tt=de(rt),Lt=x.getFirstFilled(it.text,rt.pts);(v(Lt)||Lt==="")&&(Tt.text=Lt),rt.text=e.texttemplateString({data:[Tt,it._meta],fallback:it.texttemplatefallback,labels:Tt,locale:dt._fullLayout._d3locale,template:se})}}}function tt(dt,rt){var at=dt.rotate*Math.PI/180,vt=Math.cos(at),it=Math.sin(at),Y=(rt.left+rt.right)/2,ft=(rt.top+rt.bottom)/2;dt.textX=Y*vt-ft*it,dt.textY=Y*it+ft*vt,dt.noCenter=!0}$.exports={plot:T,formatSliceLabel:st,transformInsideText:E,determineInsideTextFont:C,positionTitleOutside:H,prerenderTitles:M,layoutAreas:X,attachFxHandlers:b,computeTransform:tt}}),vN=Ft((Q,$)=>{var c=un(),g=_g(),P=Rp().resizeText;$.exports=function(S){var t=S._fullLayout._pielayer.selectAll(".trace");P(S,t,"pie"),t.each(function(e){var r=e[0],a=r.trace,n=c.select(this);n.style({opacity:a.opacity}),n.selectAll("path.surface").each(function(o){c.select(this).call(g,o,a,S)})})}}),yN=Ft(Q=>{var $=Kc();Q.name="pie",Q.plot=function(c,g,P,S){$.plotBasePlot(Q.name,c,g,P,S)},Q.clean=function(c,g,P,S){$.cleanBasePlot(Q.name,c,g,P,S)}}),xN=Ft((Q,$)=>{$.exports={attributes:ix(),supplyDefaults:ax().supplyDefaults,supplyLayoutDefaults:mN(),layoutAttributes:lk(),calc:ib().calc,crossTraceCalc:ib().crossTraceCalc,plot:uk().plot,style:vN(),styleOne:_g(),moduleType:"trace",name:"pie",basePlotModule:yN(),categories:["pie-like","pie","showLegend"],meta:{}}}),_N=Ft((Q,$)=>{$.exports=xN()}),bN=Ft(Q=>{var $=Kc();Q.name="sunburst",Q.plot=function(c,g,P,S){$.plotBasePlot(Q.name,c,g,P,S)},Q.clean=function(c,g,P,S){$.cleanBasePlot(Q.name,c,g,P,S)}}),V7=Ft((Q,$)=>{$.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}),Kw=Ft((Q,$)=>{var c=$o(),{hovertemplateAttrs:g,texttemplateAttrs:P,templatefallbackAttrs:S}=$u(),t=Tc(),e=Nh().attributes,r=ix(),a=V7(),n=Ta().extendFlat,o=Td().pattern;$.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:P({editType:"plot"},{keys:a.eventDataKeys.concat(["label","value"])}),texttemplatefallback:S({editType:"plot"}),hovertext:r.hovertext,hoverinfo:n({},c.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:g({},{keys:a.eventDataKeys}),hovertemplatefallback:S(),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"})}}),H7=Ft((Q,$)=>{$.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),wN=Ft((Q,$)=>{var c=bn(),g=Kw(),P=Nh().defaults,S=J0().handleText,t=ax().handleMarkerDefaults,e=Xc(),r=e.hasColorscale,a=e.handleDefaults;$.exports=function(n,o,i,s){function f(_,C){return c.coerce(n,o,g,_,C)}var x=f("labels"),y=f("parents");if(!x||!x.length||!y||!y.length){o.visible=!1;return}var v=f("values");v&&v.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),t(n,o,s,f);var T=o._hasColorscale=r(n,"marker","colors")||(n.marker||{}).coloraxis;T&&a(n,o,s,f,{prefix:"marker.",cLetter:"c"}),f("leaf.opacity",T?1:.7);var u=f("text");f("texttemplate"),f("texttemplatefallback"),o.texttemplate||f("textinfo",c.isArrayOrTypedArray(u)?"text+label":"label"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback");var b="auto";S(n,o,s,f,b,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("insidetextorientation"),f("sort"),f("rotation"),f("root.color"),P(o,s,f),o._length=null}}),kN=Ft((Q,$)=>{var c=bn(),g=H7();$.exports=function(P,S){function t(e,r){return c.coerce(P,S,g,e,r)}t("sunburstcolorway",S.colorway),t("extendsunburstcolors")}}),Xw=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=c||self,g(c.d3=c.d3||{}))})(Q,function(c){function g(Ct,gt){return Ct.parent===gt.parent?1:2}function P(Ct){return Ct.reduce(S,0)/Ct.length}function S(Ct,gt){return Ct+gt.x}function t(Ct){return 1+Ct.reduce(e,0)}function e(Ct,gt){return Math.max(Ct,gt.y)}function r(Ct){for(var gt;gt=Ct.children;)Ct=gt[0];return Ct}function a(Ct){for(var gt;gt=Ct.children;)Ct=gt[gt.length-1];return Ct}function n(){var Ct=g,gt=1,St=1,Nt=!1;function ee(le){var we,Ue=0;le.eachAfter(function(pr){var Jr=pr.children;Jr?(pr.x=P(Jr),pr.y=t(Jr)):(pr.x=we?Ue+=Ct(pr,we):0,pr.y=0,we=pr)});var qe=r(le),ar=a(le),Ar=qe.x-Ct(qe,ar)/2,Tr=ar.x+Ct(ar,qe)/2;return le.eachAfter(Nt?function(pr){pr.x=(pr.x-le.x)*gt,pr.y=(le.y-pr.y)*St}:function(pr){pr.x=(pr.x-Ar)/(Tr-Ar)*gt,pr.y=(1-(le.y?pr.y/le.y:1))*St})}return ee.separation=function(le){return arguments.length?(Ct=le,ee):Ct},ee.size=function(le){return arguments.length?(Nt=!1,gt=+le[0],St=+le[1],ee):Nt?null:[gt,St]},ee.nodeSize=function(le){return arguments.length?(Nt=!0,gt=+le[0],St=+le[1],ee):Nt?[gt,St]:null},ee}function o(Ct){var gt=0,St=Ct.children,Nt=St&&St.length;if(!Nt)gt=1;else for(;--Nt>=0;)gt+=St[Nt].value;Ct.value=gt}function i(){return this.eachAfter(o)}function s(Ct){var gt=this,St,Nt=[gt],ee,le,we;do for(St=Nt.reverse(),Nt=[];gt=St.pop();)if(Ct(gt),ee=gt.children,ee)for(le=0,we=ee.length;le<we;++le)Nt.push(ee[le]);while(Nt.length);return this}function f(Ct){for(var gt=this,St=[gt],Nt,ee;gt=St.pop();)if(Ct(gt),Nt=gt.children,Nt)for(ee=Nt.length-1;ee>=0;--ee)St.push(Nt[ee]);return this}function x(Ct){for(var gt=this,St=[gt],Nt=[],ee,le,we;gt=St.pop();)if(Nt.push(gt),ee=gt.children,ee)for(le=0,we=ee.length;le<we;++le)St.push(ee[le]);for(;gt=Nt.pop();)Ct(gt);return this}function y(Ct){return this.eachAfter(function(gt){for(var St=+Ct(gt.data)||0,Nt=gt.children,ee=Nt&&Nt.length;--ee>=0;)St+=Nt[ee].value;gt.value=St})}function v(Ct){return this.eachBefore(function(gt){gt.children&&gt.children.sort(Ct)})}function T(Ct){for(var gt=this,St=u(gt,Ct),Nt=[gt];gt!==St;)gt=gt.parent,Nt.push(gt);for(var ee=Nt.length;Ct!==St;)Nt.splice(ee,0,Ct),Ct=Ct.parent;return Nt}function u(Ct,gt){if(Ct===gt)return Ct;var St=Ct.ancestors(),Nt=gt.ancestors(),ee=null;for(Ct=St.pop(),gt=Nt.pop();Ct===gt;)ee=Ct,Ct=St.pop(),gt=Nt.pop();return ee}function b(){for(var Ct=this,gt=[Ct];Ct=Ct.parent;)gt.push(Ct);return gt}function _(){var Ct=[];return this.each(function(gt){Ct.push(gt)}),Ct}function C(){var Ct=[];return this.eachBefore(function(gt){gt.children||Ct.push(gt)}),Ct}function M(){var Ct=this,gt=[];return Ct.each(function(St){St!==Ct&&gt.push({source:St.parent,target:St})}),gt}function E(Ct,gt){var St=new w(Ct),Nt=+Ct.value&&(St.value=Ct.value),ee,le=[St],we,Ue,qe,ar;for(gt==null&&(gt=h);ee=le.pop();)if(Nt&&(ee.value=+ee.data.value),(Ue=gt(ee.data))&&(ar=Ue.length))for(ee.children=new Array(ar),qe=ar-1;qe>=0;--qe)le.push(we=ee.children[qe]=new w(Ue[qe])),we.parent=ee,we.depth=ee.depth+1;return St.eachBefore(k)}function A(){return E(this).eachBefore(p)}function h(Ct){return Ct.children}function p(Ct){Ct.data=Ct.data.data}function k(Ct){var gt=0;do Ct.height=gt;while((Ct=Ct.parent)&&Ct.height<++gt)}function w(Ct){this.data=Ct,this.depth=this.height=0,this.parent=null}w.prototype=E.prototype={constructor:w,count:i,each:s,eachAfter:x,eachBefore:f,sum:y,sort:v,path:T,ancestors:b,descendants:_,leaves:C,links:M,copy:A};var R=Array.prototype.slice;function O(Ct){for(var gt=Ct.length,St,Nt;gt;)Nt=Math.random()*gt--|0,St=Ct[gt],Ct[gt]=Ct[Nt],Ct[Nt]=St;return Ct}function N(Ct){for(var gt=0,St=(Ct=O(R.call(Ct))).length,Nt=[],ee,le;gt<St;)ee=Ct[gt],le&&F(le,ee)?++gt:(le=W(Nt=V(Nt,ee)),gt=0);return le}function V(Ct,gt){var St,Nt;if(U(gt,Ct))return[gt];for(St=0;St<Ct.length;++St)if(H(gt,Ct[St])&&U(X(Ct[St],gt),Ct))return[Ct[St],gt];for(St=0;St<Ct.length-1;++St)for(Nt=St+1;Nt<Ct.length;++Nt)if(H(X(Ct[St],Ct[Nt]),gt)&&H(X(Ct[St],gt),Ct[Nt])&&H(X(Ct[Nt],gt),Ct[St])&&U(lt(Ct[St],Ct[Nt],gt),Ct))return[Ct[St],Ct[Nt],gt];throw new Error}function H(Ct,gt){var St=Ct.r-gt.r,Nt=gt.x-Ct.x,ee=gt.y-Ct.y;return St<0||St*St<Nt*Nt+ee*ee}function F(Ct,gt){var St=Ct.r-gt.r+1e-6,Nt=gt.x-Ct.x,ee=gt.y-Ct.y;return St>0&&St*St>Nt*Nt+ee*ee}function U(Ct,gt){for(var St=0;St<gt.length;++St)if(!F(Ct,gt[St]))return!1;return!0}function W(Ct){switch(Ct.length){case 1:return q(Ct[0]);case 2:return X(Ct[0],Ct[1]);case 3:return lt(Ct[0],Ct[1],Ct[2])}}function q(Ct){return{x:Ct.x,y:Ct.y,r:Ct.r}}function X(Ct,gt){var St=Ct.x,Nt=Ct.y,ee=Ct.r,le=gt.x,we=gt.y,Ue=gt.r,qe=le-St,ar=we-Nt,Ar=Ue-ee,Tr=Math.sqrt(qe*qe+ar*ar);return{x:(St+le+qe/Tr*Ar)/2,y:(Nt+we+ar/Tr*Ar)/2,r:(Tr+ee+Ue)/2}}function lt(Ct,gt,St){var Nt=Ct.x,ee=Ct.y,le=Ct.r,we=gt.x,Ue=gt.y,qe=gt.r,ar=St.x,Ar=St.y,Tr=St.r,pr=Nt-we,Jr=Nt-ar,Vn=ee-Ue,Hn=ee-Ar,Kn=qe-le,Ci=Tr-le,ii=Nt*Nt+ee*ee-le*le,qn=ii-we*we-Ue*Ue+qe*qe,oa=ii-ar*ar-Ar*Ar+Tr*Tr,Hi=Jr*Vn-pr*Hn,We=(Vn*oa-Hn*qn)/(Hi*2)-Nt,rr=(Hn*Kn-Vn*Ci)/Hi,fr=(Jr*qn-pr*oa)/(Hi*2)-ee,xr=(pr*Ci-Jr*Kn)/Hi,Qr=rr*rr+xr*xr-1,Cn=2*(le+We*rr+fr*xr),wn=We*We+fr*fr-le*le,Mn=-(Qr?(Cn+Math.sqrt(Cn*Cn-4*Qr*wn))/(2*Qr):wn/Cn);return{x:Nt+We+rr*Mn,y:ee+fr+xr*Mn,r:Mn}}function yt(Ct,gt,St){var Nt=Ct.x-gt.x,ee,le,we=Ct.y-gt.y,Ue,qe,ar=Nt*Nt+we*we;ar?(le=gt.r+St.r,le*=le,qe=Ct.r+St.r,qe*=qe,le>qe?(ee=(ar+qe-le)/(2*ar),Ue=Math.sqrt(Math.max(0,qe/ar-ee*ee)),St.x=Ct.x-ee*Nt-Ue*we,St.y=Ct.y-ee*we+Ue*Nt):(ee=(ar+le-qe)/(2*ar),Ue=Math.sqrt(Math.max(0,le/ar-ee*ee)),St.x=gt.x+ee*Nt-Ue*we,St.y=gt.y+ee*we+Ue*Nt)):(St.x=gt.x+St.r,St.y=gt.y)}function pt(Ct,gt){var St=Ct.r+gt.r-1e-6,Nt=gt.x-Ct.x,ee=gt.y-Ct.y;return St>0&&St*St>Nt*Nt+ee*ee}function st(Ct){var gt=Ct._,St=Ct.next._,Nt=gt.r+St.r,ee=(gt.x*St.r+St.x*gt.r)/Nt,le=(gt.y*St.r+St.y*gt.r)/Nt;return ee*ee+le*le}function tt(Ct){this._=Ct,this.next=null,this.previous=null}function dt(Ct){if(!(ee=Ct.length))return 0;var gt,St,Nt,ee,le,we,Ue,qe,ar,Ar,Tr;if(gt=Ct[0],gt.x=0,gt.y=0,!(ee>1))return gt.r;if(St=Ct[1],gt.x=-St.r,St.x=gt.r,St.y=0,!(ee>2))return gt.r+St.r;yt(St,gt,Nt=Ct[2]),gt=new tt(gt),St=new tt(St),Nt=new tt(Nt),gt.next=Nt.previous=St,St.next=gt.previous=Nt,Nt.next=St.previous=gt;t:for(Ue=3;Ue<ee;++Ue){yt(gt._,St._,Nt=Ct[Ue]),Nt=new tt(Nt),qe=St.next,ar=gt.previous,Ar=St._.r,Tr=gt._.r;do if(Ar<=Tr){if(pt(qe._,Nt._)){St=qe,gt.next=St,St.previous=gt,--Ue;continue t}Ar+=qe._.r,qe=qe.next}else{if(pt(ar._,Nt._)){gt=ar,gt.next=St,St.previous=gt,--Ue;continue t}Tr+=ar._.r,ar=ar.previous}while(qe!==ar.next);for(Nt.previous=gt,Nt.next=St,gt.next=St.previous=St=Nt,le=st(gt);(Nt=Nt.next)!==St;)(we=st(Nt))<le&&(gt=Nt,le=we);St=gt.next}for(gt=[St._],Nt=St;(Nt=Nt.next)!==St;)gt.push(Nt._);for(Nt=N(gt),Ue=0;Ue<ee;++Ue)gt=Ct[Ue],gt.x-=Nt.x,gt.y-=Nt.y;return Nt.r}function rt(Ct){return dt(Ct),Ct}function at(Ct){return Ct==null?null:vt(Ct)}function vt(Ct){if(typeof Ct!="function")throw new Error;return Ct}function it(){return 0}function Y(Ct){return function(){return Ct}}function ft(Ct){return Math.sqrt(Ct.value)}function ut(){var Ct=null,gt=1,St=1,Nt=it;function ee(le){return le.x=gt/2,le.y=St/2,Ct?le.eachBefore(wt(Ct)).eachAfter(zt(Nt,.5)).eachBefore(Pt(1)):le.eachBefore(wt(ft)).eachAfter(zt(it,1)).eachAfter(zt(Nt,le.r/Math.min(gt,St))).eachBefore(Pt(Math.min(gt,St)/(2*le.r))),le}return ee.radius=function(le){return arguments.length?(Ct=at(le),ee):Ct},ee.size=function(le){return arguments.length?(gt=+le[0],St=+le[1],ee):[gt,St]},ee.padding=function(le){return arguments.length?(Nt=typeof le=="function"?le:Y(+le),ee):Nt},ee}function wt(Ct){return function(gt){gt.children||(gt.r=Math.max(0,+Ct(gt)||0))}}function zt(Ct,gt){return function(St){if(Nt=St.children){var Nt,ee,le=Nt.length,we=Ct(St)*gt||0,Ue;if(we)for(ee=0;ee<le;++ee)Nt[ee].r+=we;if(Ue=dt(Nt),we)for(ee=0;ee<le;++ee)Nt[ee].r-=we;St.r=Ue+we}}}function Pt(Ct){return function(gt){var St=gt.parent;gt.r*=Ct,St&&(gt.x=St.x+Ct*gt.x,gt.y=St.y+Ct*gt.y)}}function Wt(Ct){Ct.x0=Math.round(Ct.x0),Ct.y0=Math.round(Ct.y0),Ct.x1=Math.round(Ct.x1),Ct.y1=Math.round(Ct.y1)}function Ht(Ct,gt,St,Nt,ee){for(var le=Ct.children,we,Ue=-1,qe=le.length,ar=Ct.value&&(Nt-gt)/Ct.value;++Ue<qe;)we=le[Ue],we.y0=St,we.y1=ee,we.x0=gt,we.x1=gt+=we.value*ar}function Jt(){var Ct=1,gt=1,St=0,Nt=!1;function ee(we){var Ue=we.height+1;return we.x0=we.y0=St,we.x1=Ct,we.y1=gt/Ue,we.eachBefore(le(gt,Ue)),Nt&&we.eachBefore(Wt),we}function le(we,Ue){return function(qe){qe.children&&Ht(qe,qe.x0,we*(qe.depth+1)/Ue,qe.x1,we*(qe.depth+2)/Ue);var ar=qe.x0,Ar=qe.y0,Tr=qe.x1-St,pr=qe.y1-St;Tr<ar&&(ar=Tr=(ar+Tr)/2),pr<Ar&&(Ar=pr=(Ar+pr)/2),qe.x0=ar,qe.y0=Ar,qe.x1=Tr,qe.y1=pr}}return ee.round=function(we){return arguments.length?(Nt=!!we,ee):Nt},ee.size=function(we){return arguments.length?(Ct=+we[0],gt=+we[1],ee):[Ct,gt]},ee.padding=function(we){return arguments.length?(St=+we,ee):St},ee}var ge="$",he={depth:-1},de={};function se(Ct){return Ct.id}function Tt(Ct){return Ct.parentId}function Lt(){var Ct=se,gt=Tt;function St(Nt){var ee,le,we=Nt.length,Ue,qe,ar,Ar=new Array(we),Tr,pr,Jr={};for(le=0;le<we;++le)ee=Nt[le],ar=Ar[le]=new w(ee),(Tr=Ct(ee,le,Nt))!=null&&(Tr+="")&&(pr=ge+(ar.id=Tr),Jr[pr]=pr in Jr?de:ar);for(le=0;le<we;++le)if(ar=Ar[le],Tr=gt(Nt[le],le,Nt),Tr==null||!(Tr+="")){if(Ue)throw new Error("multiple roots");Ue=ar}else{if(qe=Jr[ge+Tr],!qe)throw new Error("missing: "+Tr);if(qe===de)throw new Error("ambiguous: "+Tr);qe.children?qe.children.push(ar):qe.children=[ar],ar.parent=qe}if(!Ue)throw new Error("no root");if(Ue.parent=he,Ue.eachBefore(function(Vn){Vn.depth=Vn.parent.depth+1,--we}).eachBefore(k),Ue.parent=null,we>0)throw new Error("cycle");return Ue}return St.id=function(Nt){return arguments.length?(Ct=vt(Nt),St):Ct},St.parentId=function(Nt){return arguments.length?(gt=vt(Nt),St):gt},St}function Mt(Ct,gt){return Ct.parent===gt.parent?1:2}function te(Ct){var gt=Ct.children;return gt?gt[0]:Ct.t}function ve(Ct){var gt=Ct.children;return gt?gt[gt.length-1]:Ct.t}function oe(Ct,gt,St){var Nt=St/(gt.i-Ct.i);gt.c-=Nt,gt.s+=St,Ct.c+=Nt,gt.z+=St,gt.m+=St}function Te(Ct){for(var gt=0,St=0,Nt=Ct.children,ee=Nt.length,le;--ee>=0;)le=Nt[ee],le.z+=gt,le.m+=gt,gt+=le.s+(St+=le.c)}function He(Ct,gt,St){return Ct.a.parent===gt.parent?Ct.a:St}function Ge(Ct,gt){this._=Ct,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=gt}Ge.prototype=Object.create(w.prototype);function cr(Ct){for(var gt=new Ge(Ct,0),St,Nt=[gt],ee,le,we,Ue;St=Nt.pop();)if(le=St._.children)for(St.children=new Array(Ue=le.length),we=Ue-1;we>=0;--we)Nt.push(ee=St.children[we]=new Ge(le[we],we)),ee.parent=St;return(gt.parent=new Ge(null,0)).children=[gt],gt}function ur(){var Ct=Mt,gt=1,St=1,Nt=null;function ee(ar){var Ar=cr(ar);if(Ar.eachAfter(le),Ar.parent.m=-Ar.z,Ar.eachBefore(we),Nt)ar.eachBefore(qe);else{var Tr=ar,pr=ar,Jr=ar;ar.eachBefore(function(ii){ii.x<Tr.x&&(Tr=ii),ii.x>pr.x&&(pr=ii),ii.depth>Jr.depth&&(Jr=ii)});var Vn=Tr===pr?1:Ct(Tr,pr)/2,Hn=Vn-Tr.x,Kn=gt/(pr.x+Vn+Hn),Ci=St/(Jr.depth||1);ar.eachBefore(function(ii){ii.x=(ii.x+Hn)*Kn,ii.y=ii.depth*Ci})}return ar}function le(ar){var Ar=ar.children,Tr=ar.parent.children,pr=ar.i?Tr[ar.i-1]:null;if(Ar){Te(ar);var Jr=(Ar[0].z+Ar[Ar.length-1].z)/2;pr?(ar.z=pr.z+Ct(ar._,pr._),ar.m=ar.z-Jr):ar.z=Jr}else pr&&(ar.z=pr.z+Ct(ar._,pr._));ar.parent.A=Ue(ar,pr,ar.parent.A||Tr[0])}function we(ar){ar._.x=ar.z+ar.parent.m,ar.m+=ar.parent.m}function Ue(ar,Ar,Tr){if(Ar){for(var pr=ar,Jr=ar,Vn=Ar,Hn=pr.parent.children[0],Kn=pr.m,Ci=Jr.m,ii=Vn.m,qn=Hn.m,oa;Vn=ve(Vn),pr=te(pr),Vn&&pr;)Hn=te(Hn),Jr=ve(Jr),Jr.a=ar,oa=Vn.z+ii-pr.z-Kn+Ct(Vn._,pr._),oa>0&&(oe(He(Vn,ar,Tr),ar,oa),Kn+=oa,Ci+=oa),ii+=Vn.m,Kn+=pr.m,qn+=Hn.m,Ci+=Jr.m;Vn&&!ve(Jr)&&(Jr.t=Vn,Jr.m+=ii-Ci),pr&&!te(Hn)&&(Hn.t=pr,Hn.m+=Kn-qn,Tr=ar)}return Tr}function qe(ar){ar.x*=gt,ar.y=ar.depth*St}return ee.separation=function(ar){return arguments.length?(Ct=ar,ee):Ct},ee.size=function(ar){return arguments.length?(Nt=!1,gt=+ar[0],St=+ar[1],ee):Nt?null:[gt,St]},ee.nodeSize=function(ar){return arguments.length?(Nt=!0,gt=+ar[0],St=+ar[1],ee):Nt?[gt,St]:null},ee}function jr(Ct,gt,St,Nt,ee){for(var le=Ct.children,we,Ue=-1,qe=le.length,ar=Ct.value&&(ee-St)/Ct.value;++Ue<qe;)we=le[Ue],we.x0=gt,we.x1=Nt,we.y0=St,we.y1=St+=we.value*ar}var Hr=(1+Math.sqrt(5))/2;function br(Ct,gt,St,Nt,ee,le){for(var we=[],Ue=gt.children,qe,ar,Ar=0,Tr=0,pr=Ue.length,Jr,Vn,Hn=gt.value,Kn,Ci,ii,qn,oa,Hi,We;Ar<pr;){Jr=ee-St,Vn=le-Nt;do Kn=Ue[Tr++].value;while(!Kn&&Tr<pr);for(Ci=ii=Kn,Hi=Math.max(Vn/Jr,Jr/Vn)/(Hn*Ct),We=Kn*Kn*Hi,oa=Math.max(ii/We,We/Ci);Tr<pr;++Tr){if(Kn+=ar=Ue[Tr].value,ar<Ci&&(Ci=ar),ar>ii&&(ii=ar),We=Kn*Kn*Hi,qn=Math.max(ii/We,We/Ci),qn>oa){Kn-=ar;break}oa=qn}we.push(qe={value:Kn,dice:Jr<Vn,children:Ue.slice(Ar,Tr)}),qe.dice?Ht(qe,St,Nt,ee,Hn?Nt+=Vn*Kn/Hn:le):jr(qe,St,Nt,Hn?St+=Jr*Kn/Hn:ee,le),Hn-=Kn,Ar=Tr}return we}var Kr=function Ct(gt){function St(Nt,ee,le,we,Ue){br(gt,Nt,ee,le,we,Ue)}return St.ratio=function(Nt){return Ct((Nt=+Nt)>1?Nt:1)},St}(Hr);function rn(){var Ct=Kr,gt=!1,St=1,Nt=1,ee=[0],le=it,we=it,Ue=it,qe=it,ar=it;function Ar(pr){return pr.x0=pr.y0=0,pr.x1=St,pr.y1=Nt,pr.eachBefore(Tr),ee=[0],gt&&pr.eachBefore(Wt),pr}function Tr(pr){var Jr=ee[pr.depth],Vn=pr.x0+Jr,Hn=pr.y0+Jr,Kn=pr.x1-Jr,Ci=pr.y1-Jr;Kn<Vn&&(Vn=Kn=(Vn+Kn)/2),Ci<Hn&&(Hn=Ci=(Hn+Ci)/2),pr.x0=Vn,pr.y0=Hn,pr.x1=Kn,pr.y1=Ci,pr.children&&(Jr=ee[pr.depth+1]=le(pr)/2,Vn+=ar(pr)-Jr,Hn+=we(pr)-Jr,Kn-=Ue(pr)-Jr,Ci-=qe(pr)-Jr,Kn<Vn&&(Vn=Kn=(Vn+Kn)/2),Ci<Hn&&(Hn=Ci=(Hn+Ci)/2),Ct(pr,Vn,Hn,Kn,Ci))}return Ar.round=function(pr){return arguments.length?(gt=!!pr,Ar):gt},Ar.size=function(pr){return arguments.length?(St=+pr[0],Nt=+pr[1],Ar):[St,Nt]},Ar.tile=function(pr){return arguments.length?(Ct=vt(pr),Ar):Ct},Ar.padding=function(pr){return arguments.length?Ar.paddingInner(pr).paddingOuter(pr):Ar.paddingInner()},Ar.paddingInner=function(pr){return arguments.length?(le=typeof pr=="function"?pr:Y(+pr),Ar):le},Ar.paddingOuter=function(pr){return arguments.length?Ar.paddingTop(pr).paddingRight(pr).paddingBottom(pr).paddingLeft(pr):Ar.paddingTop()},Ar.paddingTop=function(pr){return arguments.length?(we=typeof pr=="function"?pr:Y(+pr),Ar):we},Ar.paddingRight=function(pr){return arguments.length?(Ue=typeof pr=="function"?pr:Y(+pr),Ar):Ue},Ar.paddingBottom=function(pr){return arguments.length?(qe=typeof pr=="function"?pr:Y(+pr),Ar):qe},Ar.paddingLeft=function(pr){return arguments.length?(ar=typeof pr=="function"?pr:Y(+pr),Ar):ar},Ar}function Ce(Ct,gt,St,Nt,ee){var le=Ct.children,we,Ue=le.length,qe,ar=new Array(Ue+1);for(ar[0]=qe=we=0;we<Ue;++we)ar[we+1]=qe+=le[we].value;Ar(0,Ue,Ct.value,gt,St,Nt,ee);function Ar(Tr,pr,Jr,Vn,Hn,Kn,Ci){if(Tr>=pr-1){var ii=le[Tr];ii.x0=Vn,ii.y0=Hn,ii.x1=Kn,ii.y1=Ci;return}for(var qn=ar[Tr],oa=Jr/2+qn,Hi=Tr+1,We=pr-1;Hi<We;){var rr=Hi+We>>>1;ar[rr]<oa?Hi=rr+1:We=rr}oa-ar[Hi-1]<ar[Hi]-oa&&Tr+1<Hi&&--Hi;var fr=ar[Hi]-qn,xr=Jr-fr;if(Kn-Vn>Ci-Hn){var Qr=(Vn*xr+Kn*fr)/Jr;Ar(Tr,Hi,fr,Vn,Hn,Qr,Ci),Ar(Hi,pr,xr,Qr,Hn,Kn,Ci)}else{var Cn=(Hn*xr+Ci*fr)/Jr;Ar(Tr,Hi,fr,Vn,Hn,Kn,Cn),Ar(Hi,pr,xr,Vn,Cn,Kn,Ci)}}}function $t(Ct,gt,St,Nt,ee){(Ct.depth&1?jr:Ht)(Ct,gt,St,Nt,ee)}var ne=function Ct(gt){function St(Nt,ee,le,we,Ue){if((qe=Nt._squarify)&&qe.ratio===gt)for(var qe,ar,Ar,Tr,pr=-1,Jr,Vn=qe.length,Hn=Nt.value;++pr<Vn;){for(ar=qe[pr],Ar=ar.children,Tr=ar.value=0,Jr=Ar.length;Tr<Jr;++Tr)ar.value+=Ar[Tr].value;ar.dice?Ht(ar,ee,le,we,le+=(Ue-le)*ar.value/Hn):jr(ar,ee,le,ee+=(we-ee)*ar.value/Hn,Ue),Hn-=ar.value}else Nt._squarify=qe=br(gt,Nt,ee,le,we,Ue),qe.ratio=gt}return St.ratio=function(Nt){return Ct((Nt=+Nt)>1?Nt:1)},St}(Hr);c.cluster=n,c.hierarchy=E,c.pack=ut,c.packEnclose=N,c.packSiblings=rt,c.partition=Jt,c.stratify=Lt,c.tree=ur,c.treemap=rn,c.treemapBinary=Ce,c.treemapDice=Ht,c.treemapResquarify=ne,c.treemapSlice=jr,c.treemapSliceDice=$t,c.treemapSquarify=Kr,Object.defineProperty(c,"__esModule",{value:!0})})}),Jw=Ft(Q=>{var $=Xw(),c=ra(),g=bn(),P=Xc().makeColorScaleFuncFromTrace,S=ib().makePullColorFn,t=ib().generateExtendedColors,e=Xc().calc,r=Da().ALMOST_EQUAL,a={},n={},o={};Q.calc=function(s,f){var x=s._fullLayout,y=f.ids,v=g.isArrayOrTypedArray(y),T=f.labels,u=f.parents,b=f.values,_=g.isArrayOrTypedArray(b),C=[],M={},E={},A=function(rt,at){M[rt]?M[rt].push(at):M[rt]=[at],E[at]=1},h=function(rt){return rt||typeof rt=="number"},p=function(rt){return!_||c(b[rt])&&b[rt]>=0},k,w,R;v?(k=Math.min(y.length,u.length),w=function(rt){return h(y[rt])&&p(rt)},R=function(rt){return String(y[rt])}):(k=Math.min(T.length,u.length),w=function(rt){return h(T[rt])&&p(rt)},R=function(rt){return String(T[rt])}),_&&(k=Math.min(k,b.length));for(var O=0;O<k;O++)if(w(O)){var N=R(O),V=h(u[O])?String(u[O]):"",H={i:O,id:N,pid:V,label:h(T[O])?String(T[O]):""};_&&(H.v=+b[O]),C.push(H),A(V,N)}if(M[""]){if(M[""].length>1){for(var F=g.randstr(),U=0;U<C.length;U++)C[U].pid===""&&(C[U].pid=F);C.unshift({hasMultipleRoots:!0,id:F,pid:"",label:""})}}else{var W=[],q;for(q in M)E[q]||W.push(q);if(W.length===1)q=W[0],C.unshift({hasImpliedRoot:!0,id:q,pid:"",label:q});else return g.warn(["Multiple implied roots, cannot build",f.type,"hierarchy of",f.name+".","These roots include:",W.join(", ")].join(" "))}var X;try{X=$.stratify().id(function(rt){return rt.id}).parentId(function(rt){return rt.pid})(C)}catch(rt){return g.warn(["Failed to build",f.type,"hierarchy of",f.name+".","Error:",rt.message].join(" "))}var lt=$.hierarchy(X),yt=!1;if(_)switch(f.branchvalues){case"remainder":lt.sum(function(rt){return rt.data.v});break;case"total":lt.each(function(rt){var at=rt.data.data,vt=at.v;if(rt.children){var it=rt.children.reduce(function(Y,ft){return Y+ft.data.data.v},0);if((at.hasImpliedRoot||at.hasMultipleRoots)&&(vt=it),vt<it*r)return yt=!0,g.warn(["Total value for node",rt.data.data.id,"of",f.name,"is smaller than the sum of its children.",`
parent value =`,vt,`
children sum =`,it].join(" "))}rt.value=vt});break}else i(lt,f,{branches:f.count.indexOf("branches")!==-1,leaves:f.count.indexOf("leaves")!==-1});if(!yt){f.sort&&lt.sort(function(rt,at){return at.value-rt.value});var pt,st,tt=f.marker.colors||[],dt=!!tt.length;return f._hasColorscale?(dt||(tt=_?f.values:f._values),e(s,f,{vals:tt,containerStr:"marker",cLetter:"c"}),st=P(f.marker)):pt=S(x["_"+f.type+"colormap"]),lt.each(function(rt){var at=rt.data.data;at.color=f._hasColorscale?st(tt[at.i]):pt(tt[at.i],at.id)}),C[0].hierarchy=lt,C}},Q._runCrossTraceCalc=function(s,f){var x=f._fullLayout,y=f.calcdata,v=x[s+"colorway"],T=x["_"+s+"colormap"];x["extend"+s+"colors"]&&(v=t(v,s==="icicle"?o:s==="treemap"?n:a));var u=0,b;function _(A){var h=A.data.data,p=h.id;h.color===!1&&(T[p]?h.color=T[p]:A.parent?A.parent.parent?h.color=A.parent.data.data.color:(T[p]=h.color=v[u%v.length],u++):h.color=b)}for(var C=0;C<y.length;C++){var M=y[C],E=M[0];E.trace.type===s&&E.hierarchy&&(b=E.trace.root.color,E.hierarchy.each(_))}},Q.crossTraceCalc=function(s){return Q._runCrossTraceCalc("sunburst",s)};function i(s,f,x){var y=0,v=s.children;if(v){for(var T=v.length,u=0;u<T;u++)y+=i(v[u],f,x);x.branches&&y++}else x.leaves&&y++;return s.value=s.data.data.value=y,f._values||(f._values=[]),f._values[s.data.data.i]=y,y}});function ox(Q,$,c){Q.prototype=$.prototype=c,c.constructor=Q}function ab(Q,$){var c=Object.create(Q.prototype);for(var g in $)c[g]=$[g];return c}var ck=An(()=>{});function bv(){}function W7(){return this.rgb().formatHex()}function TN(){return this.rgb().formatHex8()}function AN(){return K7(this).formatHsl()}function q7(){return this.rgb().formatRgb()}function ob(Q){var $,c;return Q=(Q+"").trim().toLowerCase(),($=J7.exec(Q))?(c=$[1].length,$=parseInt($[1],16),c===6?Z7($):c===3?new cp($>>8&15|$>>4&240,$>>4&15|$&240,($&15)<<4|$&15,1):c===8?Qw($>>24&255,$>>16&255,$>>8&255,($&255)/255):c===4?Qw($>>12&15|$>>8&240,$>>8&15|$>>4&240,$>>4&15|$&240,(($&15)<<4|$&15)/255):null):($=Q7.exec(Q))?new cp($[1],$[2],$[3],1):($=t9.exec(Q))?new cp($[1]*255/100,$[2]*255/100,$[3]*255/100,1):($=e9.exec(Q))?Qw($[1],$[2],$[3],$[4]):($=r9.exec(Q))?Qw($[1]*255/100,$[2]*255/100,$[3]*255/100,$[4]):($=n9.exec(Q))?Y7($[1],$[2]/100,$[3]/100,1):($=i9.exec(Q))?Y7($[1],$[2]/100,$[3]/100,$[4]):pk.hasOwnProperty(Q)?Z7(pk[Q]):Q==="transparent"?new cp(NaN,NaN,NaN,0):null}function Z7(Q){return new cp(Q>>16&255,Q>>8&255,Q&255,1)}function Qw(Q,$,c,g){return g<=0&&(Q=$=c=NaN),new cp(Q,$,c,g)}function hk(Q){return Q instanceof bv||(Q=ob(Q)),Q?(Q=Q.rgb(),new cp(Q.r,Q.g,Q.b,Q.opacity)):new cp}function t3(Q,$,c,g){return arguments.length===1?hk(Q):new cp(Q,$,c,g??1)}function cp(Q,$,c,g){this.r=+Q,this.g=+$,this.b=+c,this.opacity=+g}function $7(){return`#${I1(this.r)}${I1(this.g)}${I1(this.b)}`}function MN(){return`#${I1(this.r)}${I1(this.g)}${I1(this.b)}${I1((isNaN(this.opacity)?1:this.opacity)*255)}`}function G7(){let Q=e3(this.opacity);return`${Q===1?"rgb(":"rgba("}${z1(this.r)}, ${z1(this.g)}, ${z1(this.b)}${Q===1?")":`, ${Q})`}`}function e3(Q){return isNaN(Q)?1:Math.max(0,Math.min(1,Q))}function z1(Q){return Math.max(0,Math.min(255,Math.round(Q)||0))}function I1(Q){return Q=z1(Q),(Q<16?"0":"")+Q.toString(16)}function Y7(Q,$,c,g){return g<=0?Q=$=c=NaN:c<=0||c>=1?Q=$=NaN:$<=0&&(Q=NaN),new _m(Q,$,c,g)}function K7(Q){if(Q instanceof _m)return new _m(Q.h,Q.s,Q.l,Q.opacity);if(Q instanceof bv||(Q=ob(Q)),!Q)return new _m;if(Q instanceof _m)return Q;Q=Q.rgb();var $=Q.r/255,c=Q.g/255,g=Q.b/255,P=Math.min($,c,g),S=Math.max($,c,g),t=NaN,e=S-P,r=(S+P)/2;return e?($===S?t=(c-g)/e+(c<g)*6:c===S?t=(g-$)/e+2:t=($-c)/e+4,e/=r<.5?S+P:2-S-P,t*=60):e=r>0&&r<1?0:t,new _m(t,e,r,Q.opacity)}function fk(Q,$,c,g){return arguments.length===1?K7(Q):new _m(Q,$,c,g??1)}function _m(Q,$,c,g){this.h=+Q,this.s=+$,this.l=+c,this.opacity=+g}function X7(Q){return Q=(Q||0)%360,Q<0?Q+360:Q}function r3(Q){return Math.max(0,Math.min(1,Q||0))}function dk(Q,$,c){return(Q<60?$+(c-$)*Q/60:Q<180?c:Q<240?$+(c-$)*(240-Q)/60:$)*255}var wv,O1,D1,sx,bm,J7,Q7,t9,e9,r9,n9,i9,pk,mk=An(()=>{ck(),wv=.7,O1=1/wv,D1="\\s*([+-]?\\d+)\\s*",sx="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",J7=/^#([0-9a-f]{3,8})$/,Q7=new RegExp(`^rgb\\(${D1},${D1},${D1}\\)$`),t9=new RegExp(`^rgb\\(${bm},${bm},${bm}\\)$`),e9=new RegExp(`^rgba\\(${D1},${D1},${D1},${sx}\\)$`),r9=new RegExp(`^rgba\\(${bm},${bm},${bm},${sx}\\)$`),n9=new RegExp(`^hsl\\(${sx},${bm},${bm}\\)$`),i9=new RegExp(`^hsla\\(${sx},${bm},${bm},${sx}\\)$`),pk={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},ox(bv,ob,{copy(Q){return Object.assign(new this.constructor,this,Q)},displayable(){return this.rgb().displayable()},hex:W7,formatHex:W7,formatHex8:TN,formatHsl:AN,formatRgb:q7,toString:q7}),ox(cp,t3,ab(bv,{brighter(Q){return Q=Q==null?O1:Math.pow(O1,Q),new cp(this.r*Q,this.g*Q,this.b*Q,this.opacity)},darker(Q){return Q=Q==null?wv:Math.pow(wv,Q),new cp(this.r*Q,this.g*Q,this.b*Q,this.opacity)},rgb(){return this},clamp(){return new cp(z1(this.r),z1(this.g),z1(this.b),e3(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:$7,formatHex:$7,formatHex8:MN,formatRgb:G7,toString:G7})),ox(_m,fk,ab(bv,{brighter(Q){return Q=Q==null?O1:Math.pow(O1,Q),new _m(this.h,this.s,this.l*Q,this.opacity)},darker(Q){return Q=Q==null?wv:Math.pow(wv,Q),new _m(this.h,this.s,this.l*Q,this.opacity)},rgb(){var Q=this.h%360+(this.h<0)*360,$=isNaN(Q)||isNaN(this.s)?0:this.s,c=this.l,g=c+(c<.5?c:1-c)*$,P=2*c-g;return new cp(dk(Q>=240?Q-240:Q+120,P,g),dk(Q,P,g),dk(Q<120?Q+240:Q-120,P,g),this.opacity)},clamp(){return new _m(X7(this.h),r3(this.s),r3(this.l),e3(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 Q=e3(this.opacity);return`${Q===1?"hsl(":"hsla("}${X7(this.h)}, ${r3(this.s)*100}%, ${r3(this.l)*100}%${Q===1?")":`, ${Q})`}`}}))}),gk,vk,a9=An(()=>{gk=Math.PI/180,vk=180/Math.PI});function o9(Q){if(Q instanceof Um)return new Um(Q.l,Q.a,Q.b,Q.opacity);if(Q instanceof Eg)return s9(Q);Q instanceof cp||(Q=hk(Q));var $=wk(Q.r),c=wk(Q.g),g=wk(Q.b),P=xk((.2225045*$+.7168786*c+.0606169*g)/Ak),S,t;return $===c&&c===g?S=t=P:(S=xk((.4360747*$+.3850649*c+.1430804*g)/Tk),t=xk((.0139322*$+.0971045*c+.7141733*g)/Mk)),new Um(116*P-16,500*(S-P),200*(P-t),Q.opacity)}function yk(Q,$,c,g){return arguments.length===1?o9(Q):new Um(Q,$,c,g??1)}function Um(Q,$,c,g){this.l=+Q,this.a=+$,this.b=+c,this.opacity=+g}function xk(Q){return Q>l9?Math.pow(Q,.3333333333333333):Q/Ek+Sk}function _k(Q){return Q>F1?Q*Q*Q:Ek*(Q-Sk)}function bk(Q){return 255*(Q<=.0031308?12.92*Q:1.055*Math.pow(Q,.4166666666666667)-.055)}function wk(Q){return(Q/=255)<=.04045?Q/12.92:Math.pow((Q+.055)/1.055,2.4)}function SN(Q){if(Q instanceof Eg)return new Eg(Q.h,Q.c,Q.l,Q.opacity);if(Q instanceof Um||(Q=o9(Q)),Q.a===0&&Q.b===0)return new Eg(NaN,0<Q.l&&Q.l<100?0:NaN,Q.l,Q.opacity);var $=Math.atan2(Q.b,Q.a)*vk;return new Eg($<0?$+360:$,Math.sqrt(Q.a*Q.a+Q.b*Q.b),Q.l,Q.opacity)}function kk(Q,$,c,g){return arguments.length===1?SN(Q):new Eg(Q,$,c,g??1)}function Eg(Q,$,c,g){this.h=+Q,this.c=+$,this.l=+c,this.opacity=+g}function s9(Q){if(isNaN(Q.h))return new Um(Q.l,0,0,Q.opacity);var $=Q.h*gk;return new Um(Q.l,Math.cos($)*Q.c,Math.sin($)*Q.c,Q.opacity)}var sb,Tk,Ak,Mk,Sk,F1,Ek,l9,EN=An(()=>{ck(),mk(),a9(),sb=18,Tk=.96422,Ak=1,Mk=.82521,Sk=4/29,F1=6/29,Ek=3*F1*F1,l9=F1*F1*F1,ox(Um,yk,ab(bv,{brighter(Q){return new Um(this.l+sb*(Q??1),this.a,this.b,this.opacity)},darker(Q){return new Um(this.l-sb*(Q??1),this.a,this.b,this.opacity)},rgb(){var Q=(this.l+16)/116,$=isNaN(this.a)?Q:Q+this.a/500,c=isNaN(this.b)?Q:Q-this.b/200;return $=Tk*_k($),Q=Ak*_k(Q),c=Mk*_k(c),new cp(bk(3.1338561*$-1.6168667*Q-.4906146*c),bk(-.9787684*$+1.9161415*Q+.033454*c),bk(.0719453*$-.2289914*Q+1.4052427*c),this.opacity)}})),ox(Eg,kk,ab(bv,{brighter(Q){return new Eg(this.h,this.c,this.l+sb*(Q??1),this.opacity)},darker(Q){return new Eg(this.h,this.c,this.l-sb*(Q??1),this.opacity)},rgb(){return s9(this).rgb()}}))});function CN(Q){if(Q instanceof R1)return new R1(Q.h,Q.s,Q.l,Q.opacity);Q instanceof cp||(Q=hk(Q));var $=Q.r/255,c=Q.g/255,g=Q.b/255,P=(Ik*g+Pk*$-zk*c)/(Ik+Pk-zk),S=g-P,t=(lx*(c-P)-i3*S)/lb,e=Math.sqrt(t*t+S*S)/(lx*P*(1-P)),r=e?Math.atan2(t,S)*vk-120:NaN;return new R1(r<0?r+360:r,e,P,Q.opacity)}function Ck(Q,$,c,g){return arguments.length===1?CN(Q):new R1(Q,$,c,g??1)}function R1(Q,$,c,g){this.h=+Q,this.s=+$,this.l=+c,this.opacity=+g}var Lk,n3,i3,lb,lx,Pk,zk,Ik,LN=An(()=>{ck(),mk(),a9(),Lk=-.14861,n3=1.78277,i3=-.29227,lb=-.90649,lx=1.97294,Pk=lx*lb,zk=lx*n3,Ik=n3*i3-lb*Lk,ox(R1,Ck,ab(bv,{brighter(Q){return Q=Q==null?O1:Math.pow(O1,Q),new R1(this.h,this.s,this.l*Q,this.opacity)},darker(Q){return Q=Q==null?wv:Math.pow(wv,Q),new R1(this.h,this.s,this.l*Q,this.opacity)},rgb(){var Q=isNaN(this.h)?0:(this.h+120)*gk,$=+this.l,c=isNaN(this.s)?0:this.s*$*(1-$),g=Math.cos(Q),P=Math.sin(Q);return new cp(255*($+c*(Lk*g+n3*P)),255*($+c*(i3*g+lb*P)),255*($+c*(lx*g)),this.opacity)}}))}),ux=An(()=>{mk(),EN(),LN()});function u9(Q,$,c,g,P){var S=Q*Q,t=S*Q;return((1-3*Q+3*S-t)*$+(4-6*S+3*t)*c+(1+3*Q+3*S-3*t)*g+t*P)/6}function c9(Q){var $=Q.length-1;return function(c){var g=c<=0?c=0:c>=1?(c=1,$-1):Math.floor(c*$),P=Q[g],S=Q[g+1],t=g>0?Q[g-1]:2*P-S,e=g<$-1?Q[g+2]:2*S-P;return u9((c-g/$)*$,t,P,S,e)}}var Ok=An(()=>{});function h9(Q){var $=Q.length;return function(c){var g=Math.floor(((c%=1)<0?++c:c)*$),P=Q[(g+$-1)%$],S=Q[g%$],t=Q[(g+1)%$],e=Q[(g+2)%$];return u9((c-g/$)*$,P,S,t,e)}}var f9=An(()=>{Ok()}),ub,d9=An(()=>{ub=Q=>()=>Q});function p9(Q,$){return function(c){return Q+c*$}}function PN(Q,$,c){return Q=Math.pow(Q,c),$=Math.pow($,c)-Q,c=1/c,function(g){return Math.pow(Q+g*$,c)}}function a3(Q,$){var c=$-Q;return c?p9(Q,c>180||c<-180?c-360*Math.round(c/360):c):ub(isNaN(Q)?$:Q)}function zN(Q){return(Q=+Q)==1?hp:function($,c){return c-$?PN($,c,Q):ub(isNaN($)?c:$)}}function hp(Q,$){var c=$-Q;return c?p9(Q,c):ub(isNaN(Q)?$:Q)}var cx=An(()=>{d9()});function m9(Q){return function($){var c=$.length,g=new Array(c),P=new Array(c),S=new Array(c),t,e;for(t=0;t<c;++t)e=t3($[t]),g[t]=e.r||0,P[t]=e.g||0,S[t]=e.b||0;return g=Q(g),P=Q(P),S=Q(S),e.opacity=1,function(r){return e.r=g(r),e.g=P(r),e.b=S(r),e+""}}}var o3,g9,v9,y9=An(()=>{ux(),Ok(),f9(),cx(),o3=function Q($){var c=zN($);function g(P,S){var t=c((P=t3(P)).r,(S=t3(S)).r),e=c(P.g,S.g),r=c(P.b,S.b),a=hp(P.opacity,S.opacity);return function(n){return P.r=t(n),P.g=e(n),P.b=r(n),P.opacity=a(n),P+""}}return g.gamma=Q,g}(1),g9=m9(c9),v9=m9(h9)});function Dk(Q,$){$||($=[]);var c=Q?Math.min($.length,Q.length):0,g=$.slice(),P;return function(S){for(P=0;P<c;++P)g[P]=Q[P]*(1-S)+$[P]*S;return g}}function x9(Q){return ArrayBuffer.isView(Q)&&!(Q instanceof DataView)}var Fk=An(()=>{});function IN(Q,$){return(x9($)?Dk:_9)(Q,$)}function _9(Q,$){var c=$?$.length:0,g=Q?Math.min(c,Q.length):0,P=new Array(g),S=new Array(c),t;for(t=0;t<g;++t)P[t]=c3(Q[t],$[t]);for(;t<c;++t)S[t]=$[t];return function(e){for(t=0;t<g;++t)S[t]=P[t](e);return S}}var b9=An(()=>{h3(),Fk()});function w9(Q,$){var c=new Date;return Q=+Q,$=+$,function(g){return c.setTime(Q*(1-g)+$*g),c}}var k9=An(()=>{});function Vm(Q,$){return Q=+Q,$=+$,function(c){return Q*(1-c)+$*c}}var s3=An(()=>{});function T9(Q,$){var c={},g={},P;(Q===null||typeof Q!="object")&&(Q={}),($===null||typeof $!="object")&&($={});for(P in $)P in Q?c[P]=c3(Q[P],$[P]):g[P]=$[P];return function(S){for(P in c)g[P]=c[P](S);return g}}var A9=An(()=>{h3()});function ON(Q){return function(){return Q}}function DN(Q){return function($){return Q($)+""}}function M9(Q,$){var c=l3.lastIndex=u3.lastIndex=0,g,P,S,t=-1,e=[],r=[];for(Q=Q+"",$=$+"";(g=l3.exec(Q))&&(P=u3.exec($));)(S=P.index)>c&&(S=$.slice(c,S),e[t]?e[t]+=S:e[++t]=S),(g=g[0])===(P=P[0])?e[t]?e[t]+=P:e[++t]=P:(e[++t]=null,r.push({i:t,x:Vm(g,P)})),c=u3.lastIndex;return c<$.length&&(S=$.slice(c),e[t]?e[t]+=S:e[++t]=S),e.length<2?r[0]?DN(r[0].x):ON($):($=r.length,function(a){for(var n=0,o;n<$;++n)e[(o=r[n]).i]=o.x(a);return e.join("")})}var l3,u3,S9=An(()=>{s3(),l3=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,u3=new RegExp(l3.source,"g")});function c3(Q,$){var c=typeof $,g;return $==null||c==="boolean"?ub($):(c==="number"?Vm:c==="string"?(g=ob($))?($=g,o3):M9:$ instanceof ob?o3:$ instanceof Date?w9:x9($)?Dk:Array.isArray($)?_9:typeof $.valueOf!="function"&&typeof $.toString!="function"||isNaN($)?T9:Vm)(Q,$)}var h3=An(()=>{ux(),y9(),b9(),k9(),s3(),A9(),S9(),d9(),Fk()});function FN(Q){var $=Q.length;return function(c){return Q[Math.max(0,Math.min($-1,Math.floor(c*$)))]}}var RN=An(()=>{});function BN(Q,$){var c=a3(+Q,+$);return function(g){var P=c(g);return P-360*Math.floor(P/360)}}var NN=An(()=>{cx()});function jN(Q,$){return Q=+Q,$=+$,function(c){return Math.round(Q*(1-c)+$*c)}}var UN=An(()=>{});function E9(Q,$,c,g,P,S){var t,e,r;return(t=Math.sqrt(Q*Q+$*$))&&(Q/=t,$/=t),(r=Q*c+$*g)&&(c-=Q*r,g-=$*r),(e=Math.sqrt(c*c+g*g))&&(c/=e,g/=e,r/=e),Q*g<$*c&&(Q=-Q,$=-$,r=-r,t=-t),{translateX:P,translateY:S,rotate:Math.atan2($,Q)*Rk,skewX:Math.atan(r)*Rk,scaleX:t,scaleY:e}}var Rk,f3,VN=An(()=>{Rk=180/Math.PI,f3={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function HN(Q){let $=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(Q+"");return $.isIdentity?f3:E9($.a,$.b,$.c,$.d,$.e,$.f)}function WN(Q){return Q==null?f3:(d3||(d3=document.createElementNS("http://www.w3.org/2000/svg","g")),d3.setAttribute("transform",Q),(Q=d3.transform.baseVal.consolidate())?(Q=Q.matrix,E9(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)):f3)}var d3,qN=An(()=>{VN()});function C9(Q,$,c,g){function P(a){return a.length?a.pop()+" ":""}function S(a,n,o,i,s,f){if(a!==o||n!==i){var x=s.push("translate(",null,$,null,c);f.push({i:x-4,x:Vm(a,o)},{i:x-2,x:Vm(n,i)})}else(o||i)&&s.push("translate("+o+$+i+c)}function t(a,n,o,i){a!==n?(a-n>180?n+=360:n-a>180&&(a+=360),i.push({i:o.push(P(o)+"rotate(",null,g)-2,x:Vm(a,n)})):n&&o.push(P(o)+"rotate("+n+g)}function e(a,n,o,i){a!==n?i.push({i:o.push(P(o)+"skewX(",null,g)-2,x:Vm(a,n)}):n&&o.push(P(o)+"skewX("+n+g)}function r(a,n,o,i,s,f){if(a!==o||n!==i){var x=s.push(P(s)+"scale(",null,",",null,")");f.push({i:x-4,x:Vm(a,o)},{i:x-2,x:Vm(n,i)})}else(o!==1||i!==1)&&s.push(P(s)+"scale("+o+","+i+")")}return function(a,n){var o=[],i=[];return a=Q(a),n=Q(n),S(a.translateX,a.translateY,n.translateX,n.translateY,o,i),t(a.rotate,n.rotate,o,i),e(a.skewX,n.skewX,o,i),r(a.scaleX,a.scaleY,n.scaleX,n.scaleY,o,i),a=n=null,function(s){for(var f=-1,x=i.length,y;++f<x;)o[(y=i[f]).i]=y.x(s);return o.join("")}}}var L9,P9,ZN=An(()=>{s3(),qN(),L9=C9(HN,"px, ","px)","deg)"),P9=C9(WN,", ",")",")")});function z9(Q){return((Q=Math.exp(Q))+1/Q)/2}function $N(Q){return((Q=Math.exp(Q))-1/Q)/2}function GN(Q){return((Q=Math.exp(2*Q))-1)/(Q+1)}var I9,O9,YN=An(()=>{I9=1e-12,O9=function Q($,c,g){function P(S,t){var e=S[0],r=S[1],a=S[2],n=t[0],o=t[1],i=t[2],s=n-e,f=o-r,x=s*s+f*f,y,v;if(x<I9)v=Math.log(i/a)/$,y=function(M){return[e+M*s,r+M*f,a*Math.exp($*M*v)]};else{var T=Math.sqrt(x),u=(i*i-a*a+g*x)/(2*a*c*T),b=(i*i-a*a-g*x)/(2*i*c*T),_=Math.log(Math.sqrt(u*u+1)-u),C=Math.log(Math.sqrt(b*b+1)-b);v=(C-_)/$,y=function(M){var E=M*v,A=z9(_),h=a/(c*T)*(A*GN($*E+_)-$N(_));return[e+h*s,r+h*f,a*A/z9($*E+_)]}}return y.duration=v*1e3*$/Math.SQRT2,y}return P.rho=function(S){var t=Math.max(.001,+S),e=t*t,r=e*e;return Q(t,e,r)},P}(Math.SQRT2,2,4)});function D9(Q){return function($,c){var g=Q(($=fk($)).h,(c=fk(c)).h),P=hp($.s,c.s),S=hp($.l,c.l),t=hp($.opacity,c.opacity);return function(e){return $.h=g(e),$.s=P(e),$.l=S(e),$.opacity=t(e),$+""}}}var F9,R9,KN=An(()=>{ux(),cx(),F9=D9(a3),R9=D9(hp)});function XN(Q,$){var c=hp((Q=yk(Q)).l,($=yk($)).l),g=hp(Q.a,$.a),P=hp(Q.b,$.b),S=hp(Q.opacity,$.opacity);return function(t){return Q.l=c(t),Q.a=g(t),Q.b=P(t),Q.opacity=S(t),Q+""}}var JN=An(()=>{ux(),cx()});function B9(Q){return function($,c){var g=Q(($=kk($)).h,(c=kk(c)).h),P=hp($.c,c.c),S=hp($.l,c.l),t=hp($.opacity,c.opacity);return function(e){return $.h=g(e),$.c=P(e),$.l=S(e),$.opacity=t(e),$+""}}}var N9,j9,QN=An(()=>{ux(),cx(),N9=B9(a3),j9=B9(hp)});function U9(Q){return function $(c){c=+c;function g(P,S){var t=Q((P=Ck(P)).h,(S=Ck(S)).h),e=hp(P.s,S.s),r=hp(P.l,S.l),a=hp(P.opacity,S.opacity);return function(n){return P.h=t(n),P.s=e(n),P.l=r(Math.pow(n,c)),P.opacity=a(n),P+""}}return g.gamma=$,g}(1)}var V9,H9,tj=An(()=>{ux(),cx(),V9=U9(a3),H9=U9(hp)});function ej(Q,$){$===void 0&&($=Q,Q=c3);for(var c=0,g=$.length-1,P=$[0],S=new Array(g<0?0:g);c<g;)S[c]=Q(P,P=$[++c]);return function(t){var e=Math.max(0,Math.min(g-1,Math.floor(t*=g)));return S[e](t-e)}}var rj=An(()=>{h3()});function nj(Q,$){for(var c=new Array($),g=0;g<$;++g)c[g]=Q(g/($-1));return c}var ij=An(()=>{}),B1={};kn(B1,{interpolate:()=>c3,interpolateArray:()=>IN,interpolateBasis:()=>c9,interpolateBasisClosed:()=>h9,interpolateCubehelix:()=>V9,interpolateCubehelixLong:()=>H9,interpolateDate:()=>w9,interpolateDiscrete:()=>FN,interpolateHcl:()=>N9,interpolateHclLong:()=>j9,interpolateHsl:()=>F9,interpolateHslLong:()=>R9,interpolateHue:()=>BN,interpolateLab:()=>XN,interpolateNumber:()=>Vm,interpolateNumberArray:()=>Dk,interpolateObject:()=>T9,interpolateRgb:()=>o3,interpolateRgbBasis:()=>g9,interpolateRgbBasisClosed:()=>v9,interpolateRound:()=>jN,interpolateString:()=>M9,interpolateTransformCss:()=>L9,interpolateTransformSvg:()=>P9,interpolateZoom:()=>O9,piecewise:()=>ej,quantize:()=>nj});var hx=An(()=>{h3(),b9(),Ok(),f9(),k9(),RN(),NN(),s3(),Fk(),A9(),UN(),S9(),ZN(),YN(),y9(),KN(),JN(),QN(),tj(),rj(),ij()}),Bk=Ft((Q,$)=>{var c=js(),g=li();$.exports=function(P,S,t,e,r){var a=S.data.data,n=a.i,o=r||a.color;if(n>=0){S.i=a.i;var i=t.marker;i.pattern?(!i.colors||!i.pattern.shape)&&(i.color=o,S.color=o):(i.color=o,S.color=o),c.pointStyle(P,t,e,S)}else g.fill(P,o)}}),W9=Ft((Q,$)=>{var c=un(),g=li(),P=bn(),S=Rp().resizeText,t=Bk();function e(a){var n=a._fullLayout._sunburstlayer.selectAll(".trace");S(a,n,"sunburst"),n.each(function(o){var i=c.select(this),s=o[0],f=s.trace;i.style("opacity",f.opacity),i.selectAll("path.surface").each(function(x){c.select(this).call(r,x,f,a)})})}function r(a,n,o,i){var s=n.data.data,f=!n.children,x=s.i,y=P.castOption(o,x,"marker.line.color")||g.defaultLine,v=P.castOption(o,x,"marker.line.width")||0;a.call(t,n,o,i).style("stroke-width",v).call(g.stroke,y).style("opacity",f?o.leaf.opacity:null)}$.exports={style:e,styleOne:r}}),kv=Ft(Q=>{var $=bn(),c=li(),g=P0(),P=xg();Q.findEntryWithLevel=function(r,a){var n;return a&&r.eachAfter(function(o){if(Q.getPtId(o)===a)return n=o.copy()}),n||r},Q.findEntryWithChild=function(r,a){var n;return r.eachAfter(function(o){for(var i=o.children||[],s=0;s<i.length;s++){var f=i[s];if(Q.getPtId(f)===a)return n=o.copy()}}),n||r},Q.isEntry=function(r){return!r.parent},Q.isLeaf=function(r){return!r.children},Q.getPtId=function(r){return r.data.data.id},Q.getPtLabel=function(r){return r.data.data.label},Q.getValue=function(r){return r.value},Q.isHierarchyRoot=function(r){return e(r)===""},Q.setSliceCursor=function(r,a,n){var o=n.isTransitioning;if(!o){var i=r.datum();o=n.hideOnRoot&&Q.isHierarchyRoot(i)||n.hideOnLeaves&&Q.isLeaf(i)}g(r,o?null:"pointer")};function S(r,a,n){return{color:Q.getOutsideTextFontKey("color",r,a,n),family:Q.getOutsideTextFontKey("family",r,a,n),size:Q.getOutsideTextFontKey("size",r,a,n),weight:Q.getOutsideTextFontKey("weight",r,a,n),style:Q.getOutsideTextFontKey("style",r,a,n),variant:Q.getOutsideTextFontKey("variant",r,a,n),textcase:Q.getOutsideTextFontKey("textcase",r,a,n),lineposition:Q.getOutsideTextFontKey("lineposition",r,a,n),shadow:Q.getOutsideTextFontKey("shadow",r,a,n)}}function t(r,a,n,o){var i=(o||{}).onPathbar,s=a.data.data,f=s.i,x=$.castOption(r,f,(i?"pathbar.textfont":"insidetextfont")+".color");return!x&&r._input.textfont&&(x=$.castOption(r._input,f,"textfont.color")),{color:x||c.contrast(s.color),family:Q.getInsideTextFontKey("family",r,a,n,o),size:Q.getInsideTextFontKey("size",r,a,n,o),weight:Q.getInsideTextFontKey("weight",r,a,n,o),style:Q.getInsideTextFontKey("style",r,a,n,o),variant:Q.getInsideTextFontKey("variant",r,a,n,o),textcase:Q.getInsideTextFontKey("textcase",r,a,n,o),lineposition:Q.getInsideTextFontKey("lineposition",r,a,n,o),shadow:Q.getInsideTextFontKey("shadow",r,a,n,o)}}Q.getInsideTextFontKey=function(r,a,n,o,i){var s=(i||{}).onPathbar,f=s?"pathbar.textfont":"insidetextfont",x=n.data.data.i;return $.castOption(a,x,f+"."+r)||$.castOption(a,x,"textfont."+r)||o.size},Q.getOutsideTextFontKey=function(r,a,n,o){var i=n.data.data.i;return $.castOption(a,i,"outsidetextfont."+r)||$.castOption(a,i,"textfont."+r)||o.size},Q.isOutsideText=function(r,a){return!r._hasColorscale&&Q.isHierarchyRoot(a)},Q.determineTextFont=function(r,a,n,o){return Q.isOutsideText(r,a)?S(r,a,n):t(r,a,n,o)},Q.hasTransition=function(r){return!!(r&&r.duration>0)},Q.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},Q.isHeader=function(r,a){return!(Q.isLeaf(r)||r.depth===a._maxDepth-1)};function e(r){return r.data.data.pid}Q.getParent=function(r,a){return Q.findEntryWithLevel(r,e(a))},Q.listPath=function(r,a){var n=r.parent;if(!n)return[];var o=a?[n.data[a]]:[n];return Q.listPath(n,a).concat(o)},Q.getPath=function(r){return Q.listPath(r,"label").join("/")+"/"},Q.formatValue=P.formatPieValue,Q.formatPercent=function(r,a){var n=$.formatPercent(r,0);return n==="0%"&&(n=P.formatPiePercent(r,a)),n}}),p3=Ft((Q,$)=>{var c=un(),g=Xo(),P=Dp().appendArrayPointValue,S=Qh(),t=bn(),e=Om(),r=kv(),a=xg(),n=a.formatPieValue;$.exports=function(i,s,f,x,y){var v=x[0],T=v.trace,u=v.hierarchy,b=T.type==="sunburst",_=T.type==="treemap"||T.type==="icicle";"_hasHoverLabel"in T||(T._hasHoverLabel=!1),"_hasHoverEvent"in T||(T._hasHoverEvent=!1);var C=function(A){var h=f._fullLayout;if(!(f._dragging||h.hovermode===!1)){var p=f._fullData[T.index],k=A.data.data,w=k.i,R=r.isHierarchyRoot(A),O=r.getParent(u,A),N=r.getValue(A),V=function(Y){return t.castOption(p,w,Y)},H=V("hovertemplate"),F=S.castHoverinfo(p,h,w),U=h.separators,W;if(H||F&&F!=="none"&&F!=="skip"){var q,X;b&&(q=v.cx+A.pxmid[0]*(1-A.rInscribed),X=v.cy+A.pxmid[1]*(1-A.rInscribed)),_&&(q=A._hoverX,X=A._hoverY);var lt={},yt=[],pt=[],st=function(Y){return yt.indexOf(Y)!==-1};F&&(yt=F==="all"?p._module.attributes.hoverinfo.flags:F.split("+")),lt.label=k.label,st("label")&&lt.label&&pt.push(lt.label),k.hasOwnProperty("v")&&(lt.value=k.v,lt.valueLabel=n(lt.value,U),st("value")&&pt.push(lt.valueLabel)),lt.currentPath=A.currentPath=r.getPath(A.data),st("current path")&&!R&&pt.push(lt.currentPath);var tt,dt=[],rt=function(){dt.indexOf(tt)===-1&&(pt.push(tt),dt.push(tt))};lt.percentParent=A.percentParent=N/r.getValue(O),lt.parent=A.parentString=r.getPtLabel(O),st("percent parent")&&(tt=r.formatPercent(lt.percentParent,U)+" of "+lt.parent,rt()),lt.percentEntry=A.percentEntry=N/r.getValue(s),lt.entry=A.entry=r.getPtLabel(s),st("percent entry")&&!R&&!A.onPathbar&&(tt=r.formatPercent(lt.percentEntry,U)+" of "+lt.entry,rt()),lt.percentRoot=A.percentRoot=N/r.getValue(u),lt.root=A.root=r.getPtLabel(u),st("percent root")&&!R&&(tt=r.formatPercent(lt.percentRoot,U)+" of "+lt.root,rt()),lt.text=V("hovertext")||V("text"),st("text")&&(tt=lt.text,t.isValidTextValue(tt)&&pt.push(tt)),W=[o(A,p,y.eventDataKeys)];var at={trace:p,y:X,_x0:A._x0,_x1:A._x1,_y0:A._y0,_y1:A._y1,text:pt.join("<br>"),name:H||st("name")?p.name:void 0,color:V("hoverlabel.bgcolor")||k.color,borderColor:V("hoverlabel.bordercolor"),fontFamily:V("hoverlabel.font.family"),fontSize:V("hoverlabel.font.size"),fontColor:V("hoverlabel.font.color"),fontWeight:V("hoverlabel.font.weight"),fontStyle:V("hoverlabel.font.style"),fontVariant:V("hoverlabel.font.variant"),nameLength:V("hoverlabel.namelength"),textAlign:V("hoverlabel.align"),hovertemplate:H,hovertemplateLabels:lt,eventData:W};b&&(at.x0=q-A.rInscribed*A.rpx1,at.x1=q+A.rInscribed*A.rpx1,at.idealAlign=A.pxmid[0]<0?"left":"right"),_&&(at.x=q,at.idealAlign=q<0?"left":"right");var vt=[];S.loneHover(at,{container:h._hoverlayer.node(),outerContainer:h._paper.node(),gd:f,inOut_bbox:vt}),W[0].bbox=vt[0],T._hasHoverLabel=!0}if(_){var it=i.select("path.surface");y.styleOne(it,A,p,f,{hovered:!0})}T._hasHoverEvent=!0,f.emit("plotly_hover",{points:W||[o(A,p,y.eventDataKeys)],event:c.event})}},M=function(A){var h=f._fullLayout,p=f._fullData[T.index],k=c.select(this).datum();if(T._hasHoverEvent&&(A.originalEvent=c.event,f.emit("plotly_unhover",{points:[o(k,p,y.eventDataKeys)],event:c.event}),T._hasHoverEvent=!1),T._hasHoverLabel&&(S.loneUnhover(h._hoverlayer.node()),T._hasHoverLabel=!1),_){var w=i.select("path.surface");y.styleOne(w,k,p,f,{hovered:!1})}},E=function(A){var h=f._fullLayout,p=f._fullData[T.index],k=b&&(r.isHierarchyRoot(A)||r.isLeaf(A)),w=r.getPtId(A),R=r.isEntry(A)?r.findEntryWithChild(u,w):r.findEntryWithLevel(u,w),O=r.getPtId(R),N={points:[o(A,p,y.eventDataKeys)],event:c.event};k||(N.nextLevel=O);var V=e.triggerHandler(f,"plotly_"+T.type+"click",N);if(V!==!1&&h.hovermode&&(f._hoverdata=[o(A,p,y.eventDataKeys)],S.click(f,c.event)),!k&&V!==!1&&!f._dragging&&!f._transitioning){g.call("_storeDirectGUIEdit",p,h._tracePreGUI[p.uid],{level:p.level});var H={data:[{level:O}],traces:[T.index]},F={frame:{redraw:!1,duration:y.transitionTime},transition:{duration:y.transitionTime,easing:y.transitionEasing},mode:"immediate",fromcurrent:!0};S.loneUnhover(h._hoverlayer.node()),g.call("animate",f,H,F)}};i.on("mouseover",C),i.on("mouseout",M),i.on("click",E)};function o(i,s,f){for(var x=i.data.data,y={curveNumber:s.index,pointNumber:x.i,data:s._input,fullData:s},v=0;v<f.length;v++){var T=f[v];T in i&&(y[T]=i[T])}return"parentString"in i&&!r.isHierarchyRoot(i)&&(y.parent=i.parentString),P(y,s,x.i),y}}),Nk=Ft(Q=>{var $=un(),c=Xw(),g=(hx(),ai(B1)).interpolate,P=js(),S=bn(),t=tc(),e=Rp(),r=e.recordMinTextSize,a=e.clearMinTextSize,n=uk(),o=xg().getRotationAngle,i=n.computeTransform,s=n.transformInsideText,f=W9().styleOne,x=xm().resizeText,y=p3(),v=V7(),T=kv();Q.plot=function(E,A,h,p){var k=E._fullLayout,w=k._sunburstlayer,R,O,N=!h,V=!k.uniformtext.mode&&T.hasTransition(h);if(a("sunburst",k),R=w.selectAll("g.trace.sunburst").data(A,function(F){return F[0].trace.uid}),R.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),R.order(),V){p&&(O=p());var H=$.transition().duration(h.duration).ease(h.easing).each("end",function(){O&&O()}).each("interrupt",function(){O&&O()});H.each(function(){w.selectAll("g.trace").each(function(F){u(E,F,this,h)})})}else R.each(function(F){u(E,F,this,h)}),k.uniformtext.mode&&x(E,k._sunburstlayer.selectAll(".trace"),"sunburst");N&&R.exit().remove()};function u(E,A,h,p){var k=E._context.staticPlot,w=E._fullLayout,R=!w.uniformtext.mode&&T.hasTransition(p),O=$.select(h),N=O.selectAll("g.slice"),V=A[0],H=V.trace,F=V.hierarchy,U=T.findEntryWithLevel(F,H.level),W=T.getMaxDepth(H),q=w._size,X=H.domain,lt=q.w*(X.x[1]-X.x[0]),yt=q.h*(X.y[1]-X.y[0]),pt=.5*Math.min(lt,yt),st=V.cx=q.l+q.w*(X.x[1]+X.x[0])/2,tt=V.cy=q.t+q.h*(1-X.y[0])-yt/2;if(!U)return N.remove();var dt=null,rt={};R&&N.each(function(Mt){rt[T.getPtId(Mt)]={rpx0:Mt.rpx0,rpx1:Mt.rpx1,x0:Mt.x0,x1:Mt.x1,transform:Mt.transform},!dt&&T.isEntry(Mt)&&(dt=Mt)});var at=b(U).descendants(),vt=U.height+1,it=0,Y=W;V.hasMultipleRoots&&T.isHierarchyRoot(U)&&(at=at.slice(1),vt-=1,it=1,Y+=1),at=at.filter(function(Mt){return Mt.y1<=Y});var ft=o(H.rotation);ft&&at.forEach(function(Mt){Mt.x0+=ft,Mt.x1+=ft});var ut=Math.min(vt,W),wt=function(Mt){return(Mt-it)/ut*pt},zt=function(Mt,te){return[Mt*Math.cos(te),-Mt*Math.sin(te)]},Pt=function(Mt){return S.pathAnnulus(Mt.rpx0,Mt.rpx1,Mt.x0,Mt.x1,st,tt)},Wt=function(Mt){return st+C(Mt)[0]*(Mt.transform.rCenter||0)+(Mt.transform.x||0)},Ht=function(Mt){return tt+C(Mt)[1]*(Mt.transform.rCenter||0)+(Mt.transform.y||0)};N=N.data(at,T.getPtId),N.enter().append("g").classed("slice",!0),R?N.exit().transition().each(function(){var Mt=$.select(this),te=Mt.select("path.surface");te.transition().attrTween("d",function(oe){var Te=de(oe);return function(He){return Pt(Te(He))}});var ve=Mt.select("g.slicetext");ve.attr("opacity",0)}).remove():N.exit().remove(),N.order();var Jt=null;if(R&&dt){var ge=T.getPtId(dt);N.each(function(Mt){Jt===null&&T.getPtId(Mt)===ge&&(Jt=Mt.x1)})}var he=N;R&&(he=he.transition().each("end",function(){var Mt=$.select(this);T.setSliceCursor(Mt,E,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),he.each(function(Mt){var te=$.select(this),ve=S.ensureSingle(te,"path","surface",function(ur){ur.style("pointer-events",k?"none":"all")});Mt.rpx0=wt(Mt.y0),Mt.rpx1=wt(Mt.y1),Mt.xmid=(Mt.x0+Mt.x1)/2,Mt.pxmid=zt(Mt.rpx1,Mt.xmid),Mt.midangle=-(Mt.xmid-Math.PI/2),Mt.startangle=-(Mt.x0-Math.PI/2),Mt.stopangle=-(Mt.x1-Math.PI/2),Mt.halfangle=.5*Math.min(S.angleDelta(Mt.x0,Mt.x1)||Math.PI,Math.PI),Mt.ring=1-Mt.rpx0/Mt.rpx1,Mt.rInscribed=_(Mt),R?ve.transition().attrTween("d",function(ur){var jr=se(ur);return function(Hr){return Pt(jr(Hr))}}):ve.attr("d",Pt),te.call(y,U,E,A,{eventDataKeys:v.eventDataKeys,transitionTime:v.CLICK_TRANSITION_TIME,transitionEasing:v.CLICK_TRANSITION_EASING}).call(T.setSliceCursor,E,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:E._transitioning}),ve.call(f,Mt,H,E);var oe=S.ensureSingle(te,"g","slicetext"),Te=S.ensureSingle(oe,"text","",function(ur){ur.attr("data-notex",1)}),He=S.ensureUniformFontSize(E,T.determineTextFont(H,Mt,w.font));Te.text(Q.formatSliceLabel(Mt,U,H,A,w)).classed("slicetext",!0).attr("text-anchor","middle").call(P.font,He).call(t.convertToTspans,E);var Ge=P.bBox(Te.node());Mt.transform=s(Ge,Mt,V),Mt.transform.targetX=Wt(Mt),Mt.transform.targetY=Ht(Mt);var cr=function(ur,jr){var Hr=ur.transform;return i(Hr,jr),Hr.fontSize=He.size,r(H.type,Hr,w),S.getTextTransform(Hr)};R?Te.transition().attrTween("transform",function(ur){var jr=Tt(ur);return function(Hr){return cr(jr(Hr),Ge)}}):Te.attr("transform",cr(Mt,Ge))});function de(Mt){var te=T.getPtId(Mt),ve=rt[te],oe=rt[T.getPtId(U)],Te;if(oe){var He=(Mt.x1>oe.x1?2*Math.PI:0)+ft;Te=Mt.rpx1<oe.rpx1?{x0:Mt.x0,x1:Mt.x1,rpx0:0,rpx1:0}:{x0:He,x1:He,rpx0:Mt.rpx0,rpx1:Mt.rpx1}}else{var Ge,cr=T.getPtId(Mt.parent);N.each(function(Kr){if(T.getPtId(Kr)===cr)return Ge=Kr});var ur=Ge.children,jr;ur.forEach(function(Kr,rn){if(T.getPtId(Kr)===te)return jr=rn});var Hr=ur.length,br=g(Ge.x0,Ge.x1);Te={rpx0:pt,rpx1:pt,x0:br(jr/Hr),x1:br((jr+1)/Hr)}}return g(ve,Te)}function se(Mt){var te=rt[T.getPtId(Mt)],ve,oe={x0:Mt.x0,x1:Mt.x1,rpx0:Mt.rpx0,rpx1:Mt.rpx1};if(te)ve=te;else if(dt)if(Mt.parent)if(Jt){var Te=(Mt.x1>Jt?2*Math.PI:0)+ft;ve={x0:Te,x1:Te}}else ve={rpx0:pt,rpx1:pt},S.extendFlat(ve,Lt(Mt));else ve={rpx0:0,rpx1:0};else ve={x0:ft,x1:ft};return g(ve,oe)}function Tt(Mt){var te=rt[T.getPtId(Mt)],ve,oe=Mt.transform;if(te)ve=te;else if(ve={rpx1:Mt.rpx1,transform:{textPosAngle:oe.textPosAngle,scale:0,rotate:oe.rotate,rCenter:oe.rCenter,x:oe.x,y:oe.y}},dt)if(Mt.parent)if(Jt){var Te=Mt.x1>Jt?2*Math.PI:0;ve.x0=ve.x1=Te}else S.extendFlat(ve,Lt(Mt));else ve.x0=ve.x1=ft;else ve.x0=ve.x1=ft;var He=g(ve.transform.textPosAngle,Mt.transform.textPosAngle),Ge=g(ve.rpx1,Mt.rpx1),cr=g(ve.x0,Mt.x0),ur=g(ve.x1,Mt.x1),jr=g(ve.transform.scale,oe.scale),Hr=g(ve.transform.rotate,oe.rotate),br=oe.rCenter===0?3:ve.transform.rCenter===0?1/3:1,Kr=g(ve.transform.rCenter,oe.rCenter),rn=function(Ce){return Kr(Math.pow(Ce,br))};return function(Ce){var $t=Ge(Ce);cr(Ce),ur(Ce);var ne=rn(Ce),Ct=He(Ce),gt={rpx1:$t,transform:{textPosAngle:Ct,rCenter:ne,x:oe.x,y:oe.y}};return r(H.type,oe,w),{transform:{targetX:Wt(gt),targetY:Ht(gt),scale:jr(Ce),rotate:Hr(Ce),rCenter:ne}}}}function Lt(Mt){var te=Mt.parent,ve=rt[T.getPtId(te)],oe={};if(ve){var Te=te.children,He=Te.indexOf(Mt),Ge=Te.length,cr=g(ve.x0,ve.x1);oe.x0=cr(He/Ge),oe.x1=cr(He/Ge)}else oe.x0=oe.x1=0;return oe}}function b(E){return c.partition().size([2*Math.PI,E.height+1])(E)}Q.formatSliceLabel=function(E,A,h,p,k){var w=h.texttemplate,R=h.textinfo;if(!w&&(!R||R==="none"))return"";var O=k.separators,N=p[0],V=E.data.data,H=N.hierarchy,F=T.isHierarchyRoot(E),U=T.getParent(H,E),W=T.getValue(E);if(!w){var q=R.split("+"),X=function(it){return q.indexOf(it)!==-1},lt=[],yt;if(X("label")&&V.label&&lt.push(V.label),V.hasOwnProperty("v")&&X("value")&&lt.push(T.formatValue(V.v,O)),!F){X("current path")&&lt.push(T.getPath(E.data));var pt=0;X("percent parent")&&pt++,X("percent entry")&&pt++,X("percent root")&&pt++;var st=pt>1;if(pt){var tt,dt=function(it){yt=T.formatPercent(tt,O),st&&(yt+=" of "+it),lt.push(yt)};X("percent parent")&&!F&&(tt=W/T.getValue(U),dt("parent")),X("percent entry")&&(tt=W/T.getValue(A),dt("entry")),X("percent root")&&(tt=W/T.getValue(H),dt("root"))}}return X("text")&&(yt=S.castOption(h,V.i,"text"),S.isValidTextValue(yt)&&lt.push(yt)),lt.join("<br>")}var rt=S.castOption(h,V.i,"texttemplate");if(!rt)return"";var at={};V.label&&(at.label=V.label),V.hasOwnProperty("v")&&(at.value=V.v,at.valueLabel=T.formatValue(V.v,O)),at.currentPath=T.getPath(E.data),F||(at.percentParent=W/T.getValue(U),at.percentParentLabel=T.formatPercent(at.percentParent,O),at.parent=T.getPtLabel(U)),at.percentEntry=W/T.getValue(A),at.percentEntryLabel=T.formatPercent(at.percentEntry,O),at.entry=T.getPtLabel(A),at.percentRoot=W/T.getValue(H),at.percentRootLabel=T.formatPercent(at.percentRoot,O),at.root=T.getPtLabel(H),V.hasOwnProperty("color")&&(at.color=V.color);var vt=S.castOption(h,V.i,"text");return(S.isValidTextValue(vt)||vt==="")&&(at.text=vt),at.customdata=S.castOption(h,V.i,"customdata"),S.texttemplateString({data:[at,h._meta],fallback:h.texttemplatefallback,labels:at,locale:k._d3locale,template:rt})};function _(E){return E.rpx0===0&&S.isFullCircle([E.x0,E.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(E.halfangle)),E.ring/2))}function C(E){return M(E.rpx1,E.transform.textPosAngle)}function M(E,A){return[E*Math.sin(A),-E*Math.cos(A)]}}),aj=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"sunburst",basePlotModule:bN(),categories:[],animatable:!0,attributes:Kw(),layoutAttributes:H7(),supplyDefaults:wN(),supplyLayoutDefaults:kN(),calc:Jw().calc,crossTraceCalc:Jw().crossTraceCalc,plot:Nk().plot,style:W9().style,colorbar:xo(),meta:{}}}),oj=Ft((Q,$)=>{$.exports=aj()}),sj=Ft(Q=>{var $=Kc();Q.name="treemap",Q.plot=function(c,g,P,S){$.plotBasePlot(Q.name,c,g,P,S)},Q.clean=function(c,g,P,S){$.cleanBasePlot(Q.name,c,g,P,S)}}),fx=Ft((Q,$)=>{$.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}),jk=Ft((Q,$)=>{var{hovertemplateAttrs:c,texttemplateAttrs:g,templatefallbackAttrs:P}=$u(),S=Tc(),t=Nh().attributes,e=ix(),r=Kw(),a=fx(),n=Ta().extendFlat,o=Td().pattern;$.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"},S("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:g({editType:"plot"},{keys:a.eventDataKeys.concat(["label","value"])}),texttemplatefallback:P({editType:"plot"}),hovertext:e.hovertext,hoverinfo:r.hoverinfo,hovertemplate:c({},{keys:a.eventDataKeys}),hovertemplatefallback:P(),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"})}}),q9=Ft((Q,$)=>{$.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),lj=Ft((Q,$)=>{var c=bn(),g=jk(),P=li(),S=Nh().defaults,t=J0().handleText,e=Jy().TEXTPAD,r=ax().handleMarkerDefaults,a=Xc(),n=a.hasColorscale,o=a.handleDefaults;$.exports=function(i,s,f,x){function y(p,k){return c.coerce(i,s,g,p,k)}var v=y("labels"),T=y("parents");if(!v||!v.length||!T||!T.length){s.visible=!1;return}var u=y("values");u&&u.length?y("branchvalues"):y("count"),y("level"),y("maxdepth");var b=y("tiling.packing");b==="squarify"&&y("tiling.squarifyratio"),y("tiling.flip"),y("tiling.pad");var _=y("text");y("texttemplate"),y("texttemplatefallback"),s.texttemplate||y("textinfo",c.isArrayOrTypedArray(_)?"text+label":"label"),y("hovertext"),y("hovertemplate"),y("hovertemplatefallback");var C=y("pathbar.visible"),M="auto";t(i,s,x,y,M,{hasPathbar:C,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),y("textposition");var E=s.textposition.indexOf("bottom")!==-1;r(i,s,x,y);var A=s._hasColorscale=n(i,"marker","colors")||(i.marker||{}).coloraxis;A?o(i,s,x,y,{prefix:"marker.",cLetter:"c"}):y("marker.depthfade",!(s.marker.colors||[]).length);var h=s.textfont.size*2;y("marker.pad.t",E?h/4:h),y("marker.pad.l",h/4),y("marker.pad.r",h/4),y("marker.pad.b",E?h:h/4),y("marker.cornerradius"),s._hovered={marker:{line:{width:2,color:P.contrast(x.paper_bgcolor)}}},C&&(y("pathbar.thickness",s.pathbar.textfont.size+2*e),y("pathbar.side"),y("pathbar.edgeshape")),y("sort"),y("root.color"),S(s,x,y),s._length=null}}),uj=Ft((Q,$)=>{var c=bn(),g=q9();$.exports=function(P,S){function t(e,r){return c.coerce(P,S,g,e,r)}t("treemapcolorway",S.colorway),t("extendtreemapcolors")}}),Z9=Ft(Q=>{var $=Jw();Q.calc=function(c,g){return $.calc(c,g)},Q.crossTraceCalc=function(c){return $._runCrossTraceCalc("treemap",c)}}),$9=Ft((Q,$)=>{$.exports=function c(g,P,S){var t;S.swapXY&&(t=g.x0,g.x0=g.y0,g.y0=t,t=g.x1,g.x1=g.y1,g.y1=t),S.flipX&&(t=g.x0,g.x0=P[0]-g.x1,g.x1=P[0]-t),S.flipY&&(t=g.y0,g.y0=P[1]-g.y1,g.y1=P[1]-t);var e=g.children;if(e)for(var r=0;r<e.length;r++)c(e[r],P,S)}}),G9=Ft((Q,$)=>{var c=Xw(),g=$9();$.exports=function(S,t,e){var r=e.flipX,a=e.flipY,n=e.packing==="dice-slice",o=e.pad[a?"bottom":"top"],i=e.pad[r?"right":"left"],s=e.pad[r?"left":"right"],f=e.pad[a?"top":"bottom"],x;n&&(x=i,i=o,o=x,x=s,s=f,f=x);var y=c.treemap().tile(P(e.packing,e.squarifyratio)).paddingInner(e.pad.inner).paddingLeft(i).paddingRight(s).paddingTop(o).paddingBottom(f).size(n?[t[1],t[0]]:t)(S);return(n||r||a)&&g(y,t,{swapXY:n,flipX:r,flipY:a}),y};function P(S,t){switch(S){case"squarify":return c.treemapSquarify.ratio(t);case"binary":return c.treemapBinary;case"dice":return c.treemapDice;case"slice":return c.treemapSlice;default:return c.treemapSliceDice}}}),Uk=Ft((Q,$)=>{var c=un(),g=li(),P=bn(),S=kv(),t=Rp().resizeText,e=Bk();function r(n){var o=n._fullLayout._treemaplayer.selectAll(".trace");t(n,o,"treemap"),o.each(function(i){var s=c.select(this),f=i[0],x=f.trace;s.style("opacity",x.opacity),s.selectAll("path.surface").each(function(y){c.select(this).call(a,y,x,n,{hovered:!1})})})}function a(n,o,i,s,f){var x=(f||{}).hovered,y=o.data.data,v=y.i,T,u,b=y.color,_=S.isHierarchyRoot(o),C=1;if(x)T=i._hovered.marker.line.color,u=i._hovered.marker.line.width;else if(_&&b===i.root.color)C=100,T="rgba(0,0,0,0)",u=0;else if(T=P.castOption(i,v,"marker.line.color")||g.defaultLine,u=P.castOption(i,v,"marker.line.width")||0,!i._hasColorscale&&!o.onPathbar){var M=i.marker.depthfade;if(M){var E=g.combine(g.addOpacity(i._backgroundColor,.75),b),A;if(M===!0){var h=S.getMaxDepth(i);isFinite(h)?S.isLeaf(o)?A=0:A=i._maxVisibleLayers-(o.data.depth-i._entryDepth):A=o.data.height+1}else A=o.data.depth-i._entryDepth,i._atRootLevel||A++;if(A>0)for(var p=0;p<A;p++){var k=.5*p/A;b=g.combine(g.addOpacity(E,k),b)}}}n.call(e,o,i,s,b).style("stroke-width",u).call(g.stroke,T).style("opacity",C)}$.exports={style:r,styleOne:a}}),cj=Ft((Q,$)=>{var c=un(),g=bn(),P=js(),S=tc(),t=G9(),e=Uk().styleOne,r=fx(),a=kv(),n=p3(),o=!0;$.exports=function(i,s,f,x,y){var v=y.barDifY,T=y.width,u=y.height,b=y.viewX,_=y.viewY,C=y.pathSlice,M=y.toMoveInsideSlice,E=y.strTransform,A=y.hasTransition,h=y.handleSlicesExit,p=y.makeUpdateSliceInterpolator,k=y.makeUpdateTextInterpolator,w={},R=i._context.staticPlot,O=i._fullLayout,N=s[0],V=N.trace,H=N.hierarchy,F=T/V._entryDepth,U=a.listPath(f.data,"id"),W=t(H.copy(),[T,u],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();W=W.filter(function(X){var lt=U.indexOf(X.data.id);return lt===-1?!1:(X.x0=F*lt,X.x1=F*(lt+1),X.y0=v,X.y1=v+u,X.onPathbar=!0,!0)}),W.reverse(),x=x.data(W,a.getPtId),x.enter().append("g").classed("pathbar",!0),h(x,o,w,[T,u],C),x.order();var q=x;A&&(q=q.transition().each("end",function(){var X=c.select(this);a.setSliceCursor(X,i,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),q.each(function(X){X._x0=b(X.x0),X._x1=b(X.x1),X._y0=_(X.y0),X._y1=_(X.y1),X._hoverX=b(X.x1-Math.min(T,u)/2),X._hoverY=_(X.y1-u/2);var lt=c.select(this),yt=g.ensureSingle(lt,"path","surface",function(dt){dt.style("pointer-events",R?"none":"all")});A?yt.transition().attrTween("d",function(dt){var rt=p(dt,o,w,[T,u]);return function(at){return C(rt(at))}}):yt.attr("d",C),lt.call(n,f,i,s,{styleOne:e,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(a.setSliceCursor,i,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:i._transitioning}),yt.call(e,X,V,i,{hovered:!1}),X._text=(a.getPtLabel(X)||"").split("<br>").join(" ")||"";var pt=g.ensureSingle(lt,"g","slicetext"),st=g.ensureSingle(pt,"text","",function(dt){dt.attr("data-notex",1)}),tt=g.ensureUniformFontSize(i,a.determineTextFont(V,X,O.font,{onPathbar:!0}));st.text(X._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(P.font,tt).call(S.convertToTspans,i),X.textBB=P.bBox(st.node()),X.transform=M(X,{fontSize:tt.size,onPathbar:!0}),X.transform.fontSize=tt.size,A?st.transition().attrTween("transform",function(dt){var rt=k(dt,o,w,[T,u]);return function(at){return E(rt(at))}}):st.attr("transform",E(X))})}}),hj=Ft((Q,$)=>{var c=un(),g=(hx(),ai(B1)).interpolate,P=kv(),S=bn(),t=Jy().TEXTPAD,e=Qy(),r=e.toMoveInsideBar,a=Rp(),n=a.recordMinTextSize,o=fx(),i=cj();function s(f){return P.isHierarchyRoot(f)?"":P.getPtId(f)}$.exports=function(f,x,y,v,T){var u=f._fullLayout,b=x[0],_=b.trace,C=_.type,M=C==="icicle",E=b.hierarchy,A=P.findEntryWithLevel(E,_.level),h=c.select(y),p=h.selectAll("g.pathbar"),k=h.selectAll("g.slice");if(!A){p.remove(),k.remove();return}var w=P.isHierarchyRoot(A),R=!u.uniformtext.mode&&P.hasTransition(v),O=P.getMaxDepth(_),N=function(br){return br.data.depth-A.data.depth<O},V=u._size,H=_.domain,F=V.w*(H.x[1]-H.x[0]),U=V.h*(H.y[1]-H.y[0]),W=F,q=_.pathbar.thickness,X=_.marker.line.width+o.gapWithPathbar,lt=_.pathbar.visible?_.pathbar.side.indexOf("bottom")>-1?U+X:-(q+X):0,yt={x0:W,x1:W,y0:lt,y1:lt+q},pt=function(br,Kr,rn){var Ce=_.tiling.pad,$t=function(St){return St-Ce<=Kr.x0},ne=function(St){return St+Ce>=Kr.x1},Ct=function(St){return St-Ce<=Kr.y0},gt=function(St){return St+Ce>=Kr.y1};return br.x0===Kr.x0&&br.x1===Kr.x1&&br.y0===Kr.y0&&br.y1===Kr.y1?{x0:br.x0,x1:br.x1,y0:br.y0,y1:br.y1}:{x0:$t(br.x0-Ce)?0:ne(br.x0-Ce)?rn[0]:br.x0,x1:$t(br.x1+Ce)?0:ne(br.x1+Ce)?rn[0]:br.x1,y0:Ct(br.y0-Ce)?0:gt(br.y0-Ce)?rn[1]:br.y0,y1:Ct(br.y1+Ce)?0:gt(br.y1+Ce)?rn[1]:br.y1}},st=null,tt={},dt={},rt=null,at=function(br,Kr){return Kr?tt[s(br)]:dt[s(br)]},vt=function(br,Kr,rn,Ce){if(Kr)return tt[s(E)]||yt;var $t=dt[_.level]||rn;return N(br)?pt(br,$t,Ce):{}};b.hasMultipleRoots&&w&&O++,_._maxDepth=O,_._backgroundColor=u.paper_bgcolor,_._entryDepth=A.data.depth,_._atRootLevel=w;var it=-F/2+V.l+V.w*(H.x[1]+H.x[0])/2,Y=-U/2+V.t+V.h*(1-(H.y[1]+H.y[0])/2),ft=function(br){return it+br},ut=function(br){return Y+br},wt=ut(0),zt=ft(0),Pt=function(br){return zt+br},Wt=function(br){return wt+br};function Ht(br,Kr){return br+","+Kr}var Jt=Pt(0),ge=function(br){br.x=Math.max(Jt,br.x)},he=_.pathbar.edgeshape,de=function(br){var Kr=Pt(Math.max(Math.min(br.x0,br.x0),0)),rn=Pt(Math.min(Math.max(br.x1,br.x1),W)),Ce=Wt(br.y0),$t=Wt(br.y1),ne=q/2,Ct={},gt={};Ct.x=Kr,gt.x=rn,Ct.y=gt.y=(Ce+$t)/2;var St={x:Kr,y:Ce},Nt={x:rn,y:Ce},ee={x:rn,y:$t},le={x:Kr,y:$t};return he===">"?(St.x-=ne,Nt.x-=ne,ee.x-=ne,le.x-=ne):he==="/"?(ee.x-=ne,le.x-=ne,Ct.x-=ne/2,gt.x-=ne/2):he==="\\"?(St.x-=ne,Nt.x-=ne,Ct.x-=ne/2,gt.x-=ne/2):he==="<"&&(Ct.x-=ne,gt.x-=ne),ge(St),ge(le),ge(Ct),ge(Nt),ge(ee),ge(gt),"M"+Ht(St.x,St.y)+"L"+Ht(Nt.x,Nt.y)+"L"+Ht(gt.x,gt.y)+"L"+Ht(ee.x,ee.y)+"L"+Ht(le.x,le.y)+"L"+Ht(Ct.x,Ct.y)+"Z"},se=_[M?"tiling":"marker"].pad,Tt=function(br){return _.textposition.indexOf(br)!==-1},Lt=Tt("top"),Mt=Tt("left"),te=Tt("right"),ve=Tt("bottom"),oe=function(br){var Kr=ft(br.x0),rn=ft(br.x1),Ce=ut(br.y0),$t=ut(br.y1),ne=rn-Kr,Ct=$t-Ce;if(!ne||!Ct)return"";var gt=_.marker.cornerradius||0,St=Math.min(gt,ne/2,Ct/2);St&&br.data&&br.data.data&&br.data.data.label&&(Lt&&(St=Math.min(St,se.t)),Mt&&(St=Math.min(St,se.l)),te&&(St=Math.min(St,se.r)),ve&&(St=Math.min(St,se.b)));var Nt=function(ee,le){return St?"a"+Ht(St,St)+" 0 0 1 "+Ht(ee,le):""};return"M"+Ht(Kr,Ce+St)+Nt(St,-St)+"L"+Ht(rn-St,Ce)+Nt(St,St)+"L"+Ht(rn,$t-St)+Nt(-St,St)+"L"+Ht(Kr+St,$t)+Nt(-St,-St)+"Z"},Te=function(br,Kr){var rn=br.x0,Ce=br.x1,$t=br.y0,ne=br.y1,Ct=br.textBB,gt=Lt||Kr.isHeader&&!ve,St=gt?"start":ve?"end":"middle",Nt=Tt("right"),ee=Tt("left")||Kr.onPathbar,le=ee?-1:Nt?1:0;if(Kr.isHeader){if(rn+=(M?se:se.l)-t,Ce-=(M?se:se.r)-t,rn>=Ce){var we=(rn+Ce)/2;rn=we,Ce=we}var Ue;ve?(Ue=ne-(M?se:se.b),$t<Ue&&Ue<ne&&($t=Ue)):(Ue=$t+(M?se:se.t),$t<Ue&&Ue<ne&&(ne=Ue))}var qe=r(rn,Ce,$t,ne,Ct,{isHorizontal:!1,constrained:!0,angle:0,anchor:St,leftToRight:le});return qe.fontSize=Kr.fontSize,qe.targetX=ft(qe.targetX),qe.targetY=ut(qe.targetY),isNaN(qe.targetX)||isNaN(qe.targetY)?{}:(rn!==Ce&&$t!==ne&&n(_.type,qe,u),{scale:qe.scale,rotate:qe.rotate,textX:qe.textX,textY:qe.textY,anchorX:qe.anchorX,anchorY:qe.anchorY,targetX:qe.targetX,targetY:qe.targetY})},He=function(br,Kr){for(var rn,Ce=0,$t=br;!rn&&Ce<O;)Ce++,$t=$t.parent,$t?rn=at($t,Kr):Ce=O;return rn||{}},Ge=function(br,Kr,rn,Ce){var $t=at(br,Kr),ne;if(Kr)ne=yt;else{var Ct=at(A,Kr);Ct?ne=pt(br,Ct,Ce):ne={}}return g($t,ne)},cr=function(br,Kr,rn,Ce,$t){var ne=at(br,Kr),Ct;if(ne)Ct=ne;else if(Kr)Ct=yt;else if(st)if(br.parent){var gt=rt||rn;gt&&!Kr?Ct=pt(br,gt,Ce):(Ct={},S.extendFlat(Ct,He(br,Kr)))}else Ct=S.extendFlat({},br),M&&($t.orientation==="h"?$t.flipX?Ct.x0=br.x1:Ct.x1=0:$t.flipY?Ct.y0=br.y1:Ct.y1=0);else Ct={};return g(Ct,{x0:br.x0,x1:br.x1,y0:br.y0,y1:br.y1})},ur=function(br,Kr,rn,Ce){var $t=at(br,Kr),ne={},Ct=vt(br,Kr,rn,Ce);S.extendFlat(ne,{transform:Te({x0:Ct.x0,x1:Ct.x1,y0:Ct.y0,y1:Ct.y1,textBB:br.textBB,_text:br._text},{isHeader:P.isHeader(br,_)})}),$t?ne=$t:br.parent&&S.extendFlat(ne,He(br,Kr));var gt=br.transform;return br.x0!==br.x1&&br.y0!==br.y1&&n(_.type,gt,u),g(ne,{transform:{scale:gt.scale,rotate:gt.rotate,textX:gt.textX,textY:gt.textY,anchorX:gt.anchorX,anchorY:gt.anchorY,targetX:gt.targetX,targetY:gt.targetY}})},jr=function(br,Kr,rn,Ce,$t){var ne=Ce[0],Ct=Ce[1];R?br.exit().transition().each(function(){var gt=c.select(this),St=gt.select("path.surface");St.transition().attrTween("d",function(ee){var le=Ge(ee,Kr,rn,[ne,Ct]);return function(we){return $t(le(we))}});var Nt=gt.select("g.slicetext");Nt.attr("opacity",0)}).remove():br.exit().remove()},Hr=function(br){var Kr=br.transform;return br.x0!==br.x1&&br.y0!==br.y1&&n(_.type,Kr,u),S.getTextTransform({textX:Kr.textX,textY:Kr.textY,anchorX:Kr.anchorX,anchorY:Kr.anchorY,targetX:Kr.targetX,targetY:Kr.targetY,scale:Kr.scale,rotate:Kr.rotate})};R&&(p.each(function(br){tt[s(br)]={x0:br.x0,x1:br.x1,y0:br.y0,y1:br.y1},br.transform&&(tt[s(br)].transform={textX:br.transform.textX,textY:br.transform.textY,anchorX:br.transform.anchorX,anchorY:br.transform.anchorY,targetX:br.transform.targetX,targetY:br.transform.targetY,scale:br.transform.scale,rotate:br.transform.rotate})}),k.each(function(br){dt[s(br)]={x0:br.x0,x1:br.x1,y0:br.y0,y1:br.y1},br.transform&&(dt[s(br)].transform={textX:br.transform.textX,textY:br.transform.textY,anchorX:br.transform.anchorX,anchorY:br.transform.anchorY,targetX:br.transform.targetX,targetY:br.transform.targetY,scale:br.transform.scale,rotate:br.transform.rotate}),!st&&P.isEntry(br)&&(st=br)})),rt=T(f,x,A,k,{width:F,height:U,viewX:ft,viewY:ut,pathSlice:oe,toMoveInsideSlice:Te,prevEntry:st,makeUpdateSliceInterpolator:cr,makeUpdateTextInterpolator:ur,handleSlicesExit:jr,hasTransition:R,strTransform:Hr}),_.pathbar.visible?i(f,x,A,p,{barDifY:lt,width:W,height:q,viewX:Pt,viewY:Wt,pathSlice:de,toMoveInsideSlice:Te,makeUpdateSliceInterpolator:cr,makeUpdateTextInterpolator:ur,handleSlicesExit:jr,hasTransition:R,strTransform:Hr}):p.remove()}}),Y9=Ft((Q,$)=>{var c=un(),g=kv(),P=Rp(),S=P.clearMinTextSize,t=xm().resizeText,e=hj();$.exports=function(r,a,n,o,i){var s=i.type,f=i.drawDescendants,x=r._fullLayout,y=x["_"+s+"layer"],v,T,u=!n;if(S(s,x),v=y.selectAll("g.trace."+s).data(a,function(_){return _[0].trace.uid}),v.enter().append("g").classed("trace",!0).classed(s,!0),v.order(),!x.uniformtext.mode&&g.hasTransition(n)){o&&(T=o());var b=c.transition().duration(n.duration).ease(n.easing).each("end",function(){T&&T()}).each("interrupt",function(){T&&T()});b.each(function(){y.selectAll("g.trace").each(function(_){e(r,_,this,n,f)})})}else v.each(function(_){e(r,_,this,n,f)}),x.uniformtext.mode&&t(r,y.selectAll(".trace"),s);u&&v.exit().remove()}}),fj=Ft((Q,$)=>{var c=un(),g=bn(),P=js(),S=tc(),t=G9(),e=Uk().styleOne,r=fx(),a=kv(),n=p3(),o=Nk().formatSliceLabel,i=!1;$.exports=function(s,f,x,y,v){var T=v.width,u=v.height,b=v.viewX,_=v.viewY,C=v.pathSlice,M=v.toMoveInsideSlice,E=v.strTransform,A=v.hasTransition,h=v.handleSlicesExit,p=v.makeUpdateSliceInterpolator,k=v.makeUpdateTextInterpolator,w=v.prevEntry,R={},O=s._context.staticPlot,N=s._fullLayout,V=f[0],H=V.trace,F=H.textposition.indexOf("left")!==-1,U=H.textposition.indexOf("right")!==-1,W=H.textposition.indexOf("bottom")!==-1,q=!W&&!H.marker.pad.t||W&&!H.marker.pad.b,X=t(x,[T,u],{packing:H.tiling.packing,squarifyratio:H.tiling.squarifyratio,flipX:H.tiling.flip.indexOf("x")>-1,flipY:H.tiling.flip.indexOf("y")>-1,pad:{inner:H.tiling.pad,top:H.marker.pad.t,left:H.marker.pad.l,right:H.marker.pad.r,bottom:H.marker.pad.b}}),lt=X.descendants(),yt=1/0,pt=-1/0;lt.forEach(function(at){var vt=at.depth;vt>=H._maxDepth?(at.x0=at.x1=(at.x0+at.x1)/2,at.y0=at.y1=(at.y0+at.y1)/2):(yt=Math.min(yt,vt),pt=Math.max(pt,vt))}),y=y.data(lt,a.getPtId),H._maxVisibleLayers=isFinite(pt)?pt-yt+1:0,y.enter().append("g").classed("slice",!0),h(y,i,R,[T,u],C),y.order();var st=null;if(A&&w){var tt=a.getPtId(w);y.each(function(at){st===null&&a.getPtId(at)===tt&&(st={x0:at.x0,x1:at.x1,y0:at.y0,y1:at.y1})})}var dt=function(){return st||{x0:0,x1:T,y0:0,y1:u}},rt=y;return A&&(rt=rt.transition().each("end",function(){var at=c.select(this);a.setSliceCursor(at,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),rt.each(function(at){var vt=a.isHeader(at,H);at._x0=b(at.x0),at._x1=b(at.x1),at._y0=_(at.y0),at._y1=_(at.y1),at._hoverX=b(at.x1-H.marker.pad.r),at._hoverY=_(W?at.y1-H.marker.pad.b/2:at.y0+H.marker.pad.t/2);var it=c.select(this),Y=g.ensureSingle(it,"path","surface",function(Wt){Wt.style("pointer-events",O?"none":"all")});A?Y.transition().attrTween("d",function(Wt){var Ht=p(Wt,i,dt(),[T,u]);return function(Jt){return C(Ht(Jt))}}):Y.attr("d",C),it.call(n,x,s,f,{styleOne:e,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(a.setSliceCursor,s,{isTransitioning:s._transitioning}),Y.call(e,at,H,s,{hovered:!1}),at.x0===at.x1||at.y0===at.y1?at._text="":vt?at._text=q?"":a.getPtLabel(at)||"":at._text=o(at,x,H,f,N)||"";var ft=g.ensureSingle(it,"g","slicetext"),ut=g.ensureSingle(ft,"text","",function(Wt){Wt.attr("data-notex",1)}),wt=g.ensureUniformFontSize(s,a.determineTextFont(H,at,N.font)),zt=at._text||" ",Pt=vt&&zt.indexOf("<br>")===-1;ut.text(zt).classed("slicetext",!0).attr("text-anchor",U?"end":F||Pt?"start":"middle").call(P.font,wt).call(S.convertToTspans,s),at.textBB=P.bBox(ut.node()),at.transform=M(at,{fontSize:wt.size,isHeader:vt}),at.transform.fontSize=wt.size,A?ut.transition().attrTween("transform",function(Wt){var Ht=k(Wt,i,dt(),[T,u]);return function(Jt){return E(Ht(Jt))}}):ut.attr("transform",E(at))}),st}}),dj=Ft((Q,$)=>{var c=Y9(),g=fj();$.exports=function(P,S,t,e){return c(P,S,t,e,{type:"treemap",drawDescendants:g})}}),pj=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"treemap",basePlotModule:sj(),categories:[],animatable:!0,attributes:jk(),layoutAttributes:q9(),supplyDefaults:lj(),supplyLayoutDefaults:uj(),calc:Z9().calc,crossTraceCalc:Z9().crossTraceCalc,plot:dj(),style:Uk().style,colorbar:xo(),meta:{}}}),mj=Ft((Q,$)=>{$.exports=pj()}),gj=Ft(Q=>{var $=Kc();Q.name="icicle",Q.plot=function(c,g,P,S){$.plotBasePlot(Q.name,c,g,P,S)},Q.clean=function(c,g,P,S){$.cleanBasePlot(Q.name,c,g,P,S)}}),K9=Ft((Q,$)=>{var{hovertemplateAttrs:c,texttemplateAttrs:g,templatefallbackAttrs:P}=$u(),S=Tc(),t=Nh().attributes,e=ix(),r=Kw(),a=jk(),n=fx(),o=Ta().extendFlat,i=Td().pattern;$.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:a.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:o({colors:r.marker.colors,line:r.marker.line,pattern:i,editType:"calc"},S("marker",{colorAttr:"colors",anim:!1})),leaf:r.leaf,pathbar:a.pathbar,text:e.text,textinfo:r.textinfo,texttemplate:g({editType:"plot"},{keys:n.eventDataKeys.concat(["label","value"])}),texttemplatefallback:P({editType:"plot"}),hovertext:e.hovertext,hoverinfo:r.hoverinfo,hovertemplate:c({},{keys:n.eventDataKeys}),hovertemplatefallback:P(),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:a.outsidetextfont,textposition:a.textposition,sort:e.sort,root:r.root,domain:t({name:"icicle",trace:!0,editType:"calc"})}}),X9=Ft((Q,$)=>{$.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),vj=Ft((Q,$)=>{var c=bn(),g=K9(),P=li(),S=Nh().defaults,t=J0().handleText,e=Jy().TEXTPAD,r=ax().handleMarkerDefaults,a=Xc(),n=a.hasColorscale,o=a.handleDefaults;$.exports=function(i,s,f,x){function y(E,A){return c.coerce(i,s,g,E,A)}var v=y("labels"),T=y("parents");if(!v||!v.length||!T||!T.length){s.visible=!1;return}var u=y("values");u&&u.length?y("branchvalues"):y("count"),y("level"),y("maxdepth"),y("tiling.orientation"),y("tiling.flip"),y("tiling.pad");var b=y("text");y("texttemplate"),y("texttemplatefallback"),s.texttemplate||y("textinfo",c.isArrayOrTypedArray(b)?"text+label":"label"),y("hovertext"),y("hovertemplate"),y("hovertemplatefallback");var _=y("pathbar.visible"),C="auto";t(i,s,x,y,C,{hasPathbar:_,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),y("textposition"),r(i,s,x,y);var M=s._hasColorscale=n(i,"marker","colors")||(i.marker||{}).coloraxis;M&&o(i,s,x,y,{prefix:"marker.",cLetter:"c"}),y("leaf.opacity",M?1:.7),s._hovered={marker:{line:{width:2,color:P.contrast(x.paper_bgcolor)}}},_&&(y("pathbar.thickness",s.pathbar.textfont.size+2*e),y("pathbar.side"),y("pathbar.edgeshape")),y("sort"),y("root.color"),S(s,x,y),s._length=null}}),yj=Ft((Q,$)=>{var c=bn(),g=X9();$.exports=function(P,S){function t(e,r){return c.coerce(P,S,g,e,r)}t("iciclecolorway",S.colorway),t("extendiciclecolors")}}),J9=Ft(Q=>{var $=Jw();Q.calc=function(c,g){return $.calc(c,g)},Q.crossTraceCalc=function(c){return $._runCrossTraceCalc("icicle",c)}}),xj=Ft((Q,$)=>{var c=Xw(),g=$9();$.exports=function(P,S,t){var e=t.flipX,r=t.flipY,a=t.orientation==="h",n=t.maxDepth,o=S[0],i=S[1];n&&(o=(P.height+1)*S[0]/Math.min(P.height+1,n),i=(P.height+1)*S[1]/Math.min(P.height+1,n));var s=c.partition().padding(t.pad.inner).size(a?[S[1],o]:[S[0],i])(P);return(a||e||r)&&g(s,S,{swapXY:a,flipX:e,flipY:r}),s}}),Q9=Ft((Q,$)=>{var c=un(),g=li(),P=bn(),S=Rp().resizeText,t=Bk();function e(a){var n=a._fullLayout._iciclelayer.selectAll(".trace");S(a,n,"icicle"),n.each(function(o){var i=c.select(this),s=o[0],f=s.trace;i.style("opacity",f.opacity),i.selectAll("path.surface").each(function(x){c.select(this).call(r,x,f,a)})})}function r(a,n,o,i){var s=n.data.data,f=!n.children,x=s.i,y=P.castOption(o,x,"marker.line.color")||g.defaultLine,v=P.castOption(o,x,"marker.line.width")||0;a.call(t,n,o,i).style("stroke-width",v).call(g.stroke,y).style("opacity",f?o.leaf.opacity:null)}$.exports={style:e,styleOne:r}}),_j=Ft((Q,$)=>{var c=un(),g=bn(),P=js(),S=tc(),t=xj(),e=Q9().styleOne,r=fx(),a=kv(),n=p3(),o=Nk().formatSliceLabel,i=!1;$.exports=function(s,f,x,y,v){var T=v.width,u=v.height,b=v.viewX,_=v.viewY,C=v.pathSlice,M=v.toMoveInsideSlice,E=v.strTransform,A=v.hasTransition,h=v.handleSlicesExit,p=v.makeUpdateSliceInterpolator,k=v.makeUpdateTextInterpolator,w=v.prevEntry,R={},O=s._context.staticPlot,N=s._fullLayout,V=f[0],H=V.trace,F=H.textposition.indexOf("left")!==-1,U=H.textposition.indexOf("right")!==-1,W=H.textposition.indexOf("bottom")!==-1,q=t(x,[T,u],{flipX:H.tiling.flip.indexOf("x")>-1,flipY:H.tiling.flip.indexOf("y")>-1,orientation:H.tiling.orientation,pad:{inner:H.tiling.pad},maxDepth:H._maxDepth}),X=q.descendants(),lt=1/0,yt=-1/0;X.forEach(function(rt){var at=rt.depth;at>=H._maxDepth?(rt.x0=rt.x1=(rt.x0+rt.x1)/2,rt.y0=rt.y1=(rt.y0+rt.y1)/2):(lt=Math.min(lt,at),yt=Math.max(yt,at))}),y=y.data(X,a.getPtId),H._maxVisibleLayers=isFinite(yt)?yt-lt+1:0,y.enter().append("g").classed("slice",!0),h(y,i,R,[T,u],C),y.order();var pt=null;if(A&&w){var st=a.getPtId(w);y.each(function(rt){pt===null&&a.getPtId(rt)===st&&(pt={x0:rt.x0,x1:rt.x1,y0:rt.y0,y1:rt.y1})})}var tt=function(){return pt||{x0:0,x1:T,y0:0,y1:u}},dt=y;return A&&(dt=dt.transition().each("end",function(){var rt=c.select(this);a.setSliceCursor(rt,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),dt.each(function(rt){rt._x0=b(rt.x0),rt._x1=b(rt.x1),rt._y0=_(rt.y0),rt._y1=_(rt.y1),rt._hoverX=b(rt.x1-H.tiling.pad),rt._hoverY=_(W?rt.y1-H.tiling.pad/2:rt.y0+H.tiling.pad/2);var at=c.select(this),vt=g.ensureSingle(at,"path","surface",function(ut){ut.style("pointer-events",O?"none":"all")});A?vt.transition().attrTween("d",function(ut){var wt=p(ut,i,tt(),[T,u],{orientation:H.tiling.orientation,flipX:H.tiling.flip.indexOf("x")>-1,flipY:H.tiling.flip.indexOf("y")>-1});return function(zt){return C(wt(zt))}}):vt.attr("d",C),at.call(n,x,s,f,{styleOne:e,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(a.setSliceCursor,s,{isTransitioning:s._transitioning}),vt.call(e,rt,H,s,{hovered:!1}),rt.x0===rt.x1||rt.y0===rt.y1?rt._text="":rt._text=o(rt,x,H,f,N)||"";var it=g.ensureSingle(at,"g","slicetext"),Y=g.ensureSingle(it,"text","",function(ut){ut.attr("data-notex",1)}),ft=g.ensureUniformFontSize(s,a.determineTextFont(H,rt,N.font));Y.text(rt._text||" ").classed("slicetext",!0).attr("text-anchor",U?"end":F?"start":"middle").call(P.font,ft).call(S.convertToTspans,s),rt.textBB=P.bBox(Y.node()),rt.transform=M(rt,{fontSize:ft.size}),rt.transform.fontSize=ft.size,A?Y.transition().attrTween("transform",function(ut){var wt=k(ut,i,tt(),[T,u]);return function(zt){return E(wt(zt))}}):Y.attr("transform",E(rt))}),pt}}),bj=Ft((Q,$)=>{var c=Y9(),g=_j();$.exports=function(P,S,t,e){return c(P,S,t,e,{type:"icicle",drawDescendants:g})}}),wj=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"icicle",basePlotModule:gj(),categories:[],animatable:!0,attributes:K9(),layoutAttributes:X9(),supplyDefaults:vj(),supplyLayoutDefaults:yj(),calc:J9().calc,crossTraceCalc:J9().crossTraceCalc,plot:bj(),style:Q9().style,colorbar:xo(),meta:{}}}),kj=Ft((Q,$)=>{$.exports=wj()}),Tj=Ft(Q=>{var $=Kc();Q.name="funnelarea",Q.plot=function(c,g,P,S){$.plotBasePlot(Q.name,c,g,P,S)},Q.clean=function(c,g,P,S){$.cleanBasePlot(Q.name,c,g,P,S)}}),tS=Ft((Q,$)=>{var c=ix(),g=$o(),P=Nh().attributes,{hovertemplateAttrs:S,texttemplateAttrs:t,templatefallbackAttrs:e}=$u(),r=Ta().extendFlat;$.exports={labels:c.labels,label0:c.label0,dlabel:c.dlabel,values:c.values,marker:{colors:c.marker.colors,line:{color:r({},c.marker.line.color,{dflt:null}),width:r({},c.marker.line.width,{dflt:1}),editType:"calc"},pattern:c.marker.pattern,editType:"calc"},text:c.text,hovertext:c.hovertext,scalegroup:r({},c.scalegroup,{}),textinfo:r({},c.textinfo,{flags:["label","text","value","percent"]}),texttemplate:t({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:e({editType:"plot"}),hoverinfo:r({},g.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:S({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:e(),textposition:r({},c.textposition,{values:["inside","none"],dflt:"inside"}),textfont:c.textfont,insidetextfont:c.insidetextfont,title:{text:c.title.text,font:c.title.font,position:r({},c.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:P({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"}}}),eS=Ft((Q,$)=>{var c=lk().hiddenlabels;$.exports={hiddenlabels:c,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),Aj=Ft((Q,$)=>{var c=bn(),g=tS(),P=Nh().defaults,S=J0().handleText,t=ax().handleLabelsAndValues,e=ax().handleMarkerDefaults;$.exports=function(r,a,n,o){function i(C,M){return c.coerce(r,a,g,C,M)}var s=i("labels"),f=i("values"),x=t(s,f),y=x.len;if(a._hasLabels=x.hasLabels,a._hasValues=x.hasValues,!a._hasLabels&&a._hasValues&&(i("label0"),i("dlabel")),!y){a.visible=!1;return}a._length=y,e(r,a,o,i),i("scalegroup");var v=i("text"),T=i("texttemplate");i("texttemplatefallback");var u;if(T||(u=i("textinfo",Array.isArray(v)?"text+percent":"percent")),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),T||u&&u!=="none"){var b=i("textposition");S(r,a,o,i,b,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else u==="none"&&i("textposition","none");P(a,o,i);var _=i("title.text");_&&(i("title.position"),c.coerceFont(i,"title.font",o.font)),i("aspectratio"),i("baseratio")}}),Mj=Ft((Q,$)=>{var c=bn(),g=eS();$.exports=function(P,S){function t(e,r){return c.coerce(P,S,g,e,r)}t("hiddenlabels"),t("funnelareacolorway",S.colorway),t("extendfunnelareacolors")}}),rS=Ft((Q,$)=>{var c=ib();function g(S,t){return c.calc(S,t)}function P(S){c.crossTraceCalc(S,{type:"funnelarea"})}$.exports={calc:g,crossTraceCalc:P}}),Sj=Ft((Q,$)=>{var c=un(),g=js(),P=bn(),S=P.strScale,t=P.strTranslate,e=tc(),r=Qy(),a=r.toMoveInsideBar,n=Rp(),o=n.recordMinTextSize,i=n.clearMinTextSize,s=xg(),f=uk(),x=f.attachFxHandlers,y=f.determineInsideTextFont,v=f.layoutAreas,T=f.prerenderTitles,u=f.positionTitleOutside,b=f.formatSliceLabel;$.exports=function(E,A){var h=E._context.staticPlot,p=E._fullLayout;i("funnelarea",p),T(A,E),v(A,p._size),P.makeTraceGroups(p._funnelarealayer,A,"trace").each(function(k){var w=c.select(this),R=k[0],O=R.trace;M(k),w.each(function(){var N=c.select(this).selectAll("g.slice").data(k);N.enter().append("g").classed("slice",!0),N.exit().remove(),N.each(function(H,F){if(H.hidden){c.select(this).selectAll("path,g").remove();return}H.pointNumber=H.i,H.curveNumber=O.index;var U=R.cx,W=R.cy,q=c.select(this),X=q.selectAll("path.surface").data([H]);X.enter().append("path").classed("surface",!0).style({"pointer-events":h?"none":"all"}),q.call(x,E,k);var lt="M"+(U+H.TR[0])+","+(W+H.TR[1])+_(H.TR,H.BR)+_(H.BR,H.BL)+_(H.BL,H.TL)+"Z";X.attr("d",lt),b(E,H,R);var yt=s.castOption(O.textposition,H.pts),pt=q.selectAll("g.slicetext").data(H.text&&yt!=="none"?[0]:[]);pt.enter().append("g").classed("slicetext",!0),pt.exit().remove(),pt.each(function(){var st=P.ensureSingle(c.select(this),"text","",function(ft){ft.attr("data-notex",1)}),tt=P.ensureUniformFontSize(E,y(O,H,p.font));st.text(H.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(g.font,tt).call(e.convertToTspans,E);var dt=g.bBox(st.node()),rt,at,vt,it=Math.min(H.BL[1],H.BR[1])+W,Y=Math.max(H.TL[1],H.TR[1])+W;at=Math.max(H.TL[0],H.BL[0])+U,vt=Math.min(H.TR[0],H.BR[0])+U,rt=a(at,vt,it,Y,dt,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),rt.fontSize=tt.size,o(O.type,rt,p),k[F].transform=rt,P.setTransormAndDisplay(st,rt)})});var V=c.select(this).selectAll("g.titletext").data(O.title.text?[0]:[]);V.enter().append("g").classed("titletext",!0),V.exit().remove(),V.each(function(){var H=P.ensureSingle(c.select(this),"text","",function(W){W.attr("data-notex",1)}),F=O.title.text;O._meta&&(F=P.templateString(F,O._meta)),H.text(F).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(g.font,O.title.font).call(e.convertToTspans,E);var U=u(R,p._size);H.attr("transform",t(U.x,U.y)+S(Math.min(1,U.scale))+t(U.tx,U.ty))})})})};function _(E,A){var h=A[0]-E[0],p=A[1]-E[1];return"l"+h+","+p}function C(E,A){return[.5*(E[0]+A[0]),.5*(E[1]+A[1])]}function M(E){if(!E.length)return;var A=E[0],h=A.trace,p=h.aspectratio,k=h.baseratio;k>.999&&(k=.999);var w=Math.pow(k,2),R=A.vTotal,O=R*w/(1-w),N=R,V=O/R;function H(){var wt=Math.sqrt(V);return{x:wt,y:-wt}}function F(){var wt=H();return[wt.x,wt.y]}var U,W=[];W.push(F());var q,X;for(q=E.length-1;q>-1;q--)if(X=E[q],!X.hidden){var lt=X.v/N;V+=lt,W.push(F())}var yt=1/0,pt=-1/0;for(q=0;q<W.length;q++)U=W[q],yt=Math.min(yt,U[1]),pt=Math.max(pt,U[1]);for(q=0;q<W.length;q++)W[q][1]-=(pt+yt)/2;var st=W[W.length-1][0],tt=A.r,dt=(pt-yt)/2,rt=tt/st,at=tt/dt*p;for(A.r=at*dt,q=0;q<W.length;q++)W[q][0]*=rt,W[q][1]*=at;U=W[0];var vt=[-U[0],U[1]],it=[U[0],U[1]],Y=0;for(q=E.length-1;q>-1;q--)if(X=E[q],!X.hidden){Y+=1;var ft=W[Y][0],ut=W[Y][1];X.TL=[-ft,ut],X.TR=[ft,ut],X.BL=vt,X.BR=it,X.pxmid=C(X.TR,X.BR),vt=X.TL,it=X.TR}}}),Ej=Ft((Q,$)=>{var c=un(),g=_g(),P=Rp().resizeText;$.exports=function(S){var t=S._fullLayout._funnelarealayer.selectAll(".trace");P(S,t,"funnelarea"),t.each(function(e){var r=e[0],a=r.trace,n=c.select(this);n.style({opacity:a.opacity}),n.selectAll("path.surface").each(function(o){c.select(this).call(g,o,a,S)})})}}),Cj=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"funnelarea",basePlotModule:Tj(),categories:["pie-like","funnelarea","showLegend"],attributes:tS(),layoutAttributes:eS(),supplyDefaults:Aj(),supplyLayoutDefaults:Mj(),calc:rS().calc,crossTraceCalc:rS().crossTraceCalc,plot:Sj(),style:Ej(),styleOne:_g(),meta:{}}}),Lj=Ft((Q,$)=>{$.exports=Cj()}),fp=Ft((Q,$)=>{(function(){var c={24:function(t){var e={left:0,top:0};t.exports=r;function r(n,o,i){o=o||n.currentTarget||n.srcElement,Array.isArray(i)||(i=[0,0]);var s=n.clientX||0,f=n.clientY||0,x=a(o);return i[0]=s-x.left,i[1]=f-x.top,i}function a(n){return n===window||n===document||n===document.body?e:n.getBoundingClientRect()}},109:function(t){t.exports=e;function e(r,a,n,o){var i=n[0],s=n[2],f=a[0]-i,x=a[2]-s,y=Math.sin(o),v=Math.cos(o);return r[0]=i+x*y+f*v,r[1]=a[1],r[2]=s+x*v-f*y,r}},160:function(t){t.exports=e;function e(r,a,n){return r[0]=Math.max(a[0],n[0]),r[1]=Math.max(a[1],n[1]),r[2]=Math.max(a[2],n[2]),r[3]=Math.max(a[3],n[3]),r}},216:function(t){t.exports=e;function e(r,a){for(var n={},o=0;o<r.length;++o)for(var i=r[o].name,s=i.split("."),f=n,x=0;x<s.length;++x){var y=s[x].split("[");if(y.length>1){y[0]in f||(f[y[0]]=[]),f=f[y[0]];for(var v=1;v<y.length;++v){var T=parseInt(y[v]);v<y.length-1||x<s.length-1?(T in f||(v<y.length-1?f[T]=[]:f[T]={}),f=f[T]):a?f[T]=o:f[T]=r[o].type}}else x<s.length-1?(y[0]in f||(f[y[0]]={}),f=f[y[0]]):a?f[y[0]]=o:f[y[0]]=r[o].type}return n}},236:function(t,e,r){var a=r(8284);t.exports=n;function n(){var o={};return function(i){if((typeof i!="object"||i===null)&&typeof i!="function")throw new Error("Weakmap-shim: Key must be object");var s=i.valueOf(o);return s&&s.identity===o?s:a(i,o)}}},244:function(t){t.exports=e;function e(r,a){return r[0]*a[0]+r[1]*a[1]+r[2]*a[2]}},264:function(t){t.exports=e;function e(r,a,n){var o=a[0],i=a[1],s=a[2],f=n[0],x=n[1],y=n[2],v=n[3],T=v*o+x*s-y*i,u=v*i+y*o-f*s,b=v*s+f*i-x*o,_=-f*o-x*i-y*s;return r[0]=T*v+_*-f+u*-y-b*-x,r[1]=u*v+_*-x+b*-f-T*-y,r[2]=b*v+_*-y+T*-x-u*-f,r}},332:function(t,e,r){t.exports=R;var a=r(1755),n=r(6867),o=r(1125),i=r(7842),s=r(1318),f=r(946),x=r(5838),y=r(1278),v=r(3637);function T(O){var N=f(O);return[y(N,-1/0),y(N,1/0)]}function u(O,N){for(var V=new Array(N.length),H=0;H<N.length;++H){var F=N[H],U=O[F[0]],W=O[F[1]];V[H]=[y(Math.min(U[0],W[0]),-1/0),y(Math.min(U[1],W[1]),-1/0),y(Math.max(U[0],W[0]),1/0),y(Math.max(U[1],W[1]),1/0)]}return V}function b(O){for(var N=new Array(O.length),V=0;V<O.length;++V){var H=O[V];N[V]=[y(H[0],-1/0),y(H[1],-1/0),y(H[0],1/0),y(H[1],1/0)]}return N}function _(O,N,V){var H=[];return n(V,function(F,U){var W=N[F],q=N[U];if(!(W[0]===q[0]||W[0]===q[1]||W[1]===q[0]||W[1]===q[1])){var X=O[W[0]],lt=O[W[1]],yt=O[q[0]],pt=O[q[1]];o(X,lt,yt,pt)&&H.push([F,U])}}),H}function C(O,N,V,H){var F=[];return n(V,H,function(U,W){var q=N[U];if(!(q[0]===W||q[1]===W)){var X=O[W],lt=O[q[0]],yt=O[q[1]];o(lt,yt,X,X)&&F.push([U,W])}}),F}function M(O,N,V,H,F){var U,W,q=O.map(function(Pt){return[i(Pt[0]),i(Pt[1])]});for(U=0;U<V.length;++U){var X=V[U];W=X[0];var lt=X[1],yt=N[W],pt=N[lt],st=v(x(O[yt[0]]),x(O[yt[1]]),x(O[pt[0]]),x(O[pt[1]]));if(st){var tt=O.length;O.push([f(st[0]),f(st[1])]),q.push(st),H.push([W,tt],[lt,tt])}}for(H.sort(function(Pt,Wt){if(Pt[0]!==Wt[0])return Pt[0]-Wt[0];var Ht=q[Pt[1]],Jt=q[Wt[1]];return s(Ht[0],Jt[0])||s(Ht[1],Jt[1])}),U=H.length-1;U>=0;--U){var dt=H[U];W=dt[0];var rt=N[W],at=rt[0],vt=rt[1],it=O[at],Y=O[vt];if((it[0]-Y[0]||it[1]-Y[1])<0){var ft=at;at=vt,vt=ft}rt[0]=at;var ut=rt[1]=dt[1],wt;for(F&&(wt=rt[2]);U>0&&H[U-1][0]===W;){var dt=H[--U],zt=dt[1];F?N.push([ut,zt,wt]):N.push([ut,zt]),ut=zt}F?N.push([ut,vt,wt]):N.push([ut,vt])}return q}function E(O,N,V){for(var H=N.length,F=new a(H),U=[],W=0;W<N.length;++W){var q=N[W],X=T(q[0]),lt=T(q[1]);U.push([y(X[0],-1/0),y(lt[0],-1/0),y(X[1],1/0),y(lt[1],1/0)])}n(U,function(dt,rt){F.link(dt,rt)});for(var yt=!0,pt=new Array(H),W=0;W<H;++W){var st=F.find(W);st!==W&&(yt=!1,O[st]=[Math.min(O[W][0],O[st][0]),Math.min(O[W][1],O[st][1])])}if(yt)return null;for(var tt=0,W=0;W<H;++W){var st=F.find(W);st===W?(pt[W]=tt,O[tt++]=O[W]):pt[W]=-1}O.length=tt;for(var W=0;W<H;++W)pt[W]<0&&(pt[W]=pt[F.find(W)]);return pt}function A(O,N){return O[0]-N[0]||O[1]-N[1]}function h(O,N){var V=O[0]-N[0]||O[1]-N[1];return V||(O[2]<N[2]?-1:O[2]>N[2]?1:0)}function p(O,N,V){if(O.length!==0){if(N)for(var H=0;H<O.length;++H){var F=O[H],U=N[F[0]],W=N[F[1]];F[0]=Math.min(U,W),F[1]=Math.max(U,W)}else for(var H=0;H<O.length;++H){var F=O[H],U=F[0],W=F[1];F[0]=Math.min(U,W),F[1]=Math.max(U,W)}V?O.sort(h):O.sort(A);for(var q=1,H=1;H<O.length;++H){var X=O[H-1],lt=O[H];lt[0]===X[0]&&lt[1]===X[1]&&(!V||lt[2]===X[2])||(O[q++]=lt)}O.length=q}}function k(O,N,V){var H=E(O,[],b(O));return p(N,H,V),!!H}function w(O,N,V){var H=u(O,N),F=_(O,N,H),U=b(O),W=C(O,N,H,U),q=M(O,N,F,W,V),X=E(O,q);return p(N,X,V),X?!0:F.length>0||W.length>0}function R(O,N,V){var H;if(V){H=N;for(var F=new Array(N.length),U=0;U<N.length;++U){var W=N[U];F[U]=[W[0],W[1],V[U]]}N=F}for(var q=k(O,N,!!V);w(O,N,!!V);)q=!0;if(V&&q){H.length=0,V.length=0;for(var U=0;U<N.length;++U){var W=N[U];H.push([W[0],W[1]]),V.push(W[2])}}return q}},351:function(t,e,r){t.exports=n;var a=r(4687);function n(o,i){i||(i=o,o=window);var s=0,f=0,x=0,y={shift:!1,alt:!1,control:!1,meta:!1},v=!1;function T(w){var R=!1;return"altKey"in w&&(R=R||w.altKey!==y.alt,y.alt=!!w.altKey),"shiftKey"in w&&(R=R||w.shiftKey!==y.shift,y.shift=!!w.shiftKey),"ctrlKey"in w&&(R=R||w.ctrlKey!==y.control,y.control=!!w.ctrlKey),"metaKey"in w&&(R=R||w.metaKey!==y.meta,y.meta=!!w.metaKey),R}function u(w,R){var O=a.x(R),N=a.y(R);"buttons"in R&&(w=R.buttons|0),(w!==s||O!==f||N!==x||T(R))&&(s=w|0,f=O||0,x=N||0,i&&i(s,f,x,y))}function b(w){u(0,w)}function _(){(s||f||x||y.shift||y.alt||y.meta||y.control)&&(f=x=0,s=0,y.shift=y.alt=y.control=y.meta=!1,i&&i(0,0,0,y))}function C(w){T(w)&&i&&i(s,f,x,y)}function M(w){a.buttons(w)===0?u(0,w):u(s,w)}function E(w){u(s|a.buttons(w),w)}function A(w){u(s&~a.buttons(w),w)}function h(){v||(v=!0,o.addEventListener("mousemove",M),o.addEventListener("mousedown",E),o.addEventListener("mouseup",A),o.addEventListener("mouseleave",b),o.addEventListener("mouseenter",b),o.addEventListener("mouseout",b),o.addEventListener("mouseover",b),o.addEventListener("blur",_),o.addEventListener("keyup",C),o.addEventListener("keydown",C),o.addEventListener("keypress",C),o!==window&&(window.addEventListener("blur",_),window.addEventListener("keyup",C),window.addEventListener("keydown",C),window.addEventListener("keypress",C)))}function p(){v&&(v=!1,o.removeEventListener("mousemove",M),o.removeEventListener("mousedown",E),o.removeEventListener("mouseup",A),o.removeEventListener("mouseleave",b),o.removeEventListener("mouseenter",b),o.removeEventListener("mouseout",b),o.removeEventListener("mouseover",b),o.removeEventListener("blur",_),o.removeEventListener("keyup",C),o.removeEventListener("keydown",C),o.removeEventListener("keypress",C),o!==window&&(window.removeEventListener("blur",_),window.removeEventListener("keyup",C),window.removeEventListener("keydown",C),window.removeEventListener("keypress",C)))}h();var k={element:o};return Object.defineProperties(k,{enabled:{get:function(){return v},set:function(w){w?h():p()},enumerable:!0},buttons:{get:function(){return s},enumerable:!0},x:{get:function(){return f},enumerable:!0},y:{get:function(){return x},enumerable:!0},mods:{get:function(){return y},enumerable:!0}}),k}},395:function(t){function e(r,a,n){return r*(1-n)+a*n}t.exports=e},446:function(t,e,r){var a=r(7640),n={};function o(i){var s=i.order,f=i.dtype,x=[s,f],y=x.join(":"),v=n[y];return v||(n[y]=v=a(s,f)),v(i),i}t.exports=o},483:function(t){t.exports=e;function e(r){var a=r[0],n=r[1],o=r[2],i=r[3];return a*a+n*n+o*o+i*i}},492:function(t){t.exports=e;function e(r,a,n){var o=a[0],i=a[1],s=a[2];return r[0]=o*n[0]+i*n[3]+s*n[6],r[1]=o*n[1]+i*n[4]+s*n[7],r[2]=o*n[2]+i*n[5]+s*n[8],r}},501:function(t,e,r){t.exports=_;var a=r(2762),n=r(8116),o=r(1879).n,i=[0,0,0],s=[0,0,0],f=[0,0,0],x=[0,0,0],y=[1,1];function v(C){return C[0]=C[1]=C[2]=0,C}function T(C,M){return C[0]=M[0],C[1]=M[1],C[2]=M[2],C}function u(C,M,E,A,h,p,k,w){this.gl=C,this.vertBuffer=M,this.vao=E,this.shader=A,this.tickCount=h,this.tickOffset=p,this.gridCount=k,this.gridOffset=w}var b=u.prototype;b.bind=function(C,M,E){this.shader.bind(),this.shader.uniforms.model=C,this.shader.uniforms.view=M,this.shader.uniforms.projection=E,y[0]=this.gl.drawingBufferWidth,y[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=y,this.vao.bind()},b.unbind=function(){this.vao.unbind()},b.drawAxisLine=function(C,M,E,A,h){var p=v(s);this.shader.uniforms.majorAxis=s,p[C]=M[1][C]-M[0][C],this.shader.uniforms.minorAxis=p;var k=T(x,E);k[C]+=M[0][C],this.shader.uniforms.offset=k,this.shader.uniforms.lineWidth=h,this.shader.uniforms.color=A;var w=v(f);w[(C+2)%3]=1,this.shader.uniforms.screenAxis=w,this.vao.draw(this.gl.TRIANGLES,6);var w=v(f);w[(C+1)%3]=1,this.shader.uniforms.screenAxis=w,this.vao.draw(this.gl.TRIANGLES,6)},b.drawAxisTicks=function(C,M,E,A,h){if(this.tickCount[C]){var p=v(i);p[C]=1,this.shader.uniforms.majorAxis=p,this.shader.uniforms.offset=M,this.shader.uniforms.minorAxis=E,this.shader.uniforms.color=A,this.shader.uniforms.lineWidth=h;var k=v(f);k[C]=1,this.shader.uniforms.screenAxis=k,this.vao.draw(this.gl.TRIANGLES,this.tickCount[C],this.tickOffset[C])}},b.drawGrid=function(C,M,E,A,h,p){if(this.gridCount[C]){var k=v(s);k[M]=E[1][M]-E[0][M],this.shader.uniforms.minorAxis=k;var w=T(x,A);w[M]+=E[0][M],this.shader.uniforms.offset=w;var R=v(i);R[C]=1,this.shader.uniforms.majorAxis=R;var O=v(f);O[C]=1,this.shader.uniforms.screenAxis=O,this.shader.uniforms.lineWidth=p,this.shader.uniforms.color=h,this.vao.draw(this.gl.TRIANGLES,this.gridCount[C],this.gridOffset[C])}},b.drawZero=function(C,M,E,A,h,p){var k=v(s);this.shader.uniforms.majorAxis=k,k[C]=E[1][C]-E[0][C],this.shader.uniforms.minorAxis=k;var w=T(x,A);w[C]+=E[0][C],this.shader.uniforms.offset=w;var R=v(f);R[M]=1,this.shader.uniforms.screenAxis=R,this.shader.uniforms.lineWidth=p,this.shader.uniforms.color=h,this.vao.draw(this.gl.TRIANGLES,6)},b.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()};function _(C,M,E){var A=[],h=[0,0,0],p=[0,0,0],k=[0,0,0],w=[0,0,0];A.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var R=0;R<3;++R){for(var O=A.length/3|0,N=0;N<E[R].length;++N){var V=+E[R][N].x;A.push(V,0,1,V,1,1,V,0,-1,V,0,-1,V,1,1,V,1,-1)}var F=A.length/3|0;h[R]=O,p[R]=F-O;for(var O=A.length/3|0,H=0;H<E[R].length;++H){var V=+E[R][H].x;A.push(V,0,1,V,1,1,V,0,-1,V,0,-1,V,1,1,V,1,-1)}var F=A.length/3|0;k[R]=O,w[R]=F-O}var U=a(C,new Float32Array(A)),W=n(C,[{buffer:U,type:C.FLOAT,size:3,stride:0,offset:0}]),q=o(C);return q.attributes.position.location=0,new u(C,U,W,q,p,h,w,k)}},544:function(t,e,r){var a=r(5572);t.exports=n;function n(o,i){for(var s=o.length,f=new Array(s),x=0;x<s;++x)f[x]=a(o[x],i[x]);return f}},606:function(t,e,r){var a=r(236);t.exports=n;function n(){var o=a();return{get:function(i,s){var f=o(i);return f.hasOwnProperty("value")?f.value:s},set:function(i,s){return o(i).value=s,this},has:function(i){return"value"in o(i)},delete:function(i){return delete o(i).value}}}},614:function(t,e,r){var a=r(3236),n=a([`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=a([`#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;
}
`]),i=a([`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=a([`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:i,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 a=r(3202);t.exports=s;var n=96;function o(f,x){var y=a(getComputedStyle(f).getPropertyValue(x));return y[0]*s(y[1],f)}function i(f,x){var y=document.createElement("div");y.style["font-size"]="128"+f,x.appendChild(y);var v=o(y,"font-size")/128;return x.removeChild(y),v}function s(f,x){switch(x=x||document.body,f=(f||"px").trim().toLowerCase(),(x===window||x===document)&&(x=document.body),f){case"%":return x.clientHeight/100;case"ch":case"ex":return i(f,x);case"em":return o(x,"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 a=r(2962),n=6;function o(C){var M=C===2?f:C===3?x:C===4?y:C===5?v:T;return C<6?M(a[C]):M(a)}function i(){return[[0]]}function s(C,M){return[[M[0]],[C[0][0]]]}function f(C){return function(M,E){return[C([[+E[0],+M[0][1]],[+E[1],+M[1][1]]]),C([[+M[0][0],+E[0]],[+M[1][0],+E[1]]]),C(M)]}}function x(C){return function(M,E){return[C([[+E[0],+M[0][1],+M[0][2]],[+E[1],+M[1][1],+M[1][2]],[+E[2],+M[2][1],+M[2][2]]]),C([[+M[0][0],+E[0],+M[0][2]],[+M[1][0],+E[1],+M[1][2]],[+M[2][0],+E[2],+M[2][2]]]),C([[+M[0][0],+M[0][1],+E[0]],[+M[1][0],+M[1][1],+E[1]],[+M[2][0],+M[2][1],+E[2]]]),C(M)]}}function y(C){return function(M,E){return[C([[+E[0],+M[0][1],+M[0][2],+M[0][3]],[+E[1],+M[1][1],+M[1][2],+M[1][3]],[+E[2],+M[2][1],+M[2][2],+M[2][3]],[+E[3],+M[3][1],+M[3][2],+M[3][3]]]),C([[+M[0][0],+E[0],+M[0][2],+M[0][3]],[+M[1][0],+E[1],+M[1][2],+M[1][3]],[+M[2][0],+E[2],+M[2][2],+M[2][3]],[+M[3][0],+E[3],+M[3][2],+M[3][3]]]),C([[+M[0][0],+M[0][1],+E[0],+M[0][3]],[+M[1][0],+M[1][1],+E[1],+M[1][3]],[+M[2][0],+M[2][1],+E[2],+M[2][3]],[+M[3][0],+M[3][1],+E[3],+M[3][3]]]),C([[+M[0][0],+M[0][1],+M[0][2],+E[0]],[+M[1][0],+M[1][1],+M[1][2],+E[1]],[+M[2][0],+M[2][1],+M[2][2],+E[2]],[+M[3][0],+M[3][1],+M[3][2],+E[3]]]),C(M)]}}function v(C){return function(M,E){return[C([[+E[0],+M[0][1],+M[0][2],+M[0][3],+M[0][4]],[+E[1],+M[1][1],+M[1][2],+M[1][3],+M[1][4]],[+E[2],+M[2][1],+M[2][2],+M[2][3],+M[2][4]],[+E[3],+M[3][1],+M[3][2],+M[3][3],+M[3][4]],[+E[4],+M[4][1],+M[4][2],+M[4][3],+M[4][4]]]),C([[+M[0][0],+E[0],+M[0][2],+M[0][3],+M[0][4]],[+M[1][0],+E[1],+M[1][2],+M[1][3],+M[1][4]],[+M[2][0],+E[2],+M[2][2],+M[2][3],+M[2][4]],[+M[3][0],+E[3],+M[3][2],+M[3][3],+M[3][4]],[+M[4][0],+E[4],+M[4][2],+M[4][3],+M[4][4]]]),C([[+M[0][0],+M[0][1],+E[0],+M[0][3],+M[0][4]],[+M[1][0],+M[1][1],+E[1],+M[1][3],+M[1][4]],[+M[2][0],+M[2][1],+E[2],+M[2][3],+M[2][4]],[+M[3][0],+M[3][1],+E[3],+M[3][3],+M[3][4]],[+M[4][0],+M[4][1],+E[4],+M[4][3],+M[4][4]]]),C([[+M[0][0],+M[0][1],+M[0][2],+E[0],+M[0][4]],[+M[1][0],+M[1][1],+M[1][2],+E[1],+M[1][4]],[+M[2][0],+M[2][1],+M[2][2],+E[2],+M[2][4]],[+M[3][0],+M[3][1],+M[3][2],+E[3],+M[3][4]],[+M[4][0],+M[4][1],+M[4][2],+E[4],+M[4][4]]]),C([[+M[0][0],+M[0][1],+M[0][2],+M[0][3],+E[0]],[+M[1][0],+M[1][1],+M[1][2],+M[1][3],+E[1]],[+M[2][0],+M[2][1],+M[2][2],+M[2][3],+E[2]],[+M[3][0],+M[3][1],+M[3][2],+M[3][3],+E[3]],[+M[4][0],+M[4][1],+M[4][2],+M[4][3],+E[4]]]),C(M)]}}function T(C){return function(M,E){return[C([[+E[0],+M[0][1],+M[0][2],+M[0][3],+M[0][4],+M[0][5]],[+E[1],+M[1][1],+M[1][2],+M[1][3],+M[1][4],+M[1][5]],[+E[2],+M[2][1],+M[2][2],+M[2][3],+M[2][4],+M[2][5]],[+E[3],+M[3][1],+M[3][2],+M[3][3],+M[3][4],+M[3][5]],[+E[4],+M[4][1],+M[4][2],+M[4][3],+M[4][4],+M[4][5]],[+E[5],+M[5][1],+M[5][2],+M[5][3],+M[5][4],+M[5][5]]]),C([[+M[0][0],+E[0],+M[0][2],+M[0][3],+M[0][4],+M[0][5]],[+M[1][0],+E[1],+M[1][2],+M[1][3],+M[1][4],+M[1][5]],[+M[2][0],+E[2],+M[2][2],+M[2][3],+M[2][4],+M[2][5]],[+M[3][0],+E[3],+M[3][2],+M[3][3],+M[3][4],+M[3][5]],[+M[4][0],+E[4],+M[4][2],+M[4][3],+M[4][4],+M[4][5]],[+M[5][0],+E[5],+M[5][2],+M[5][3],+M[5][4],+M[5][5]]]),C([[+M[0][0],+M[0][1],+E[0],+M[0][3],+M[0][4],+M[0][5]],[+M[1][0],+M[1][1],+E[1],+M[1][3],+M[1][4],+M[1][5]],[+M[2][0],+M[2][1],+E[2],+M[2][3],+M[2][4],+M[2][5]],[+M[3][0],+M[3][1],+E[3],+M[3][3],+M[3][4],+M[3][5]],[+M[4][0],+M[4][1],+E[4],+M[4][3],+M[4][4],+M[4][5]],[+M[5][0],+M[5][1],+E[5],+M[5][3],+M[5][4],+M[5][5]]]),C([[+M[0][0],+M[0][1],+M[0][2],+E[0],+M[0][4],+M[0][5]],[+M[1][0],+M[1][1],+M[1][2],+E[1],+M[1][4],+M[1][5]],[+M[2][0],+M[2][1],+M[2][2],+E[2],+M[2][4],+M[2][5]],[+M[3][0],+M[3][1],+M[3][2],+E[3],+M[3][4],+M[3][5]],[+M[4][0],+M[4][1],+M[4][2],+E[4],+M[4][4],+M[4][5]],[+M[5][0],+M[5][1],+M[5][2],+E[5],+M[5][4],+M[5][5]]]),C([[+M[0][0],+M[0][1],+M[0][2],+M[0][3],+E[0],+M[0][5]],[+M[1][0],+M[1][1],+M[1][2],+M[1][3],+E[1],+M[1][5]],[+M[2][0],+M[2][1],+M[2][2],+M[2][3],+E[2],+M[2][5]],[+M[3][0],+M[3][1],+M[3][2],+M[3][3],+E[3],+M[3][5]],[+M[4][0],+M[4][1],+M[4][2],+M[4][3],+E[4],+M[4][5]],[+M[5][0],+M[5][1],+M[5][2],+M[5][3],+E[5],+M[5][5]]]),C([[+M[0][0],+M[0][1],+M[0][2],+M[0][3],+M[0][4],+E[0]],[+M[1][0],+M[1][1],+M[1][2],+M[1][3],+M[1][4],+E[1]],[+M[2][0],+M[2][1],+M[2][2],+M[2][3],+M[2][4],+E[2]],[+M[3][0],+M[3][1],+M[3][2],+M[3][3],+M[3][4],+E[3]],[+M[4][0],+M[4][1],+M[4][2],+M[4][3],+M[4][4],+E[4]],[+M[5][0],+M[5][1],+M[5][2],+M[5][3],+M[5][4],+E[5]]]),C(M)]}}var u=[i,s];function b(C,M,E,A,h,p,k,w){return function(R,O){switch(R.length){case 0:return C(R,O);case 1:return M(R,O);case 2:return E(R,O);case 3:return A(R,O);case 4:return h(R,O);case 5:return p(R,O)}var N=k[R.length];return N||(N=k[R.length]=w(R.length)),N(R,O)}}function _(){for(;u.length<n;)u.push(o(u.length));t.exports=b.apply(void 0,u.concat([u,o]));for(var C=0;C<n;++C)t.exports[C]=u[C]}_()},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 a=r(3349);function n(o,i){var s=[];return i=+i||0,a(o.hi(o.shape[0]-1),s,i),s}},783:function(t){t.exports=e;function e(r,a,n,o){var i=a[0],s=a[1],f=a[2],x=a[3],y=n[0],v=n[1],T=n[2],u=n[3],b,_,C,M,E;return _=i*y+s*v+f*T+x*u,_<0&&(_=-_,y=-y,v=-v,T=-T,u=-u),1-_>1e-6?(b=Math.acos(_),C=Math.sin(b),M=Math.sin((1-o)*b)/C,E=Math.sin(o*b)/C):(M=1-o,E=o),r[0]=M*i+E*y,r[1]=M*s+E*v,r[2]=M*f+E*T,r[3]=M*x+E*u,r}},799:function(t,e,r){var a=r(3236),n=r(9405),o=a([`precision mediump float;
#define GLSLIFY 1
attribute vec2 position;
varying vec2 uv;
void main() {
uv = position;
gl_Position = vec4(position, 0, 1);
}`]),i=a([`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,i,null,[{name:"position",type:"vec2"}])}},811:function(t){t.exports=e;function e(r,a){return r[0]=1/a[0],r[1]=1/a[1],r[2]=1/a[2],r}},840:function(t,e,r){var a=r(3236),n=a([`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=a([`#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;
}
`]),i=a([`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=a([`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=a([`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;
}`]),x=a([`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;
}`]),y=a([`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;
}`]),v=a([`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);
}`]),T=a([`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;
}`]),u=a([`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)));
}`]),b=a([`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:i,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:f,fragment:x,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:y,fragment:v,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:T,fragment:v,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:u,fragment:b,attributes:[{name:"position",type:"vec3"}]}},855:function(t,e,r){t.exports={init:_,sweepBipartite:E,sweepComplete:A,scanBipartite:h,scanComplete:p};var a=r(1888),n=r(8828),o=r(4192),i=1<<28,s=1024,f=a.mallocInt32(s),x=a.mallocInt32(s),y=a.mallocInt32(s),v=a.mallocInt32(s),T=a.mallocInt32(s),u=a.mallocInt32(s),b=a.mallocDouble(s*8);function _(k){var w=n.nextPow2(k);f.length<w&&(a.free(f),f=a.mallocInt32(w)),x.length<w&&(a.free(x),x=a.mallocInt32(w)),y.length<w&&(a.free(y),y=a.mallocInt32(w)),v.length<w&&(a.free(v),v=a.mallocInt32(w)),T.length<w&&(a.free(T),T=a.mallocInt32(w)),u.length<w&&(a.free(u),u=a.mallocInt32(w));var R=8*w;b.length<R&&(a.free(b),b=a.mallocDouble(R))}function C(k,w,R,O){var N=w[O],V=k[R-1];k[N]=V,w[V]=N}function M(k,w,R,O){k[R]=O,w[O]=R}function E(k,w,R,O,N,V,H,F,U,W){for(var q=0,X=2*k,lt=k-1,yt=X-1,pt=R;pt<O;++pt){var st=V[pt],tt=X*pt;b[q++]=N[tt+lt],b[q++]=-(st+1),b[q++]=N[tt+yt],b[q++]=st}for(var pt=H;pt<F;++pt){var st=W[pt]+i,dt=X*pt;b[q++]=U[dt+lt],b[q++]=-st,b[q++]=U[dt+yt],b[q++]=st}var rt=q>>>1;o(b,rt);for(var at=0,vt=0,pt=0;pt<rt;++pt){var it=b[2*pt+1]|0;if(it>=i)it=it-i|0,C(y,v,vt--,it);else if(it>=0)C(f,x,at--,it);else if(it<=-i){it=-it-i|0;for(var Y=0;Y<at;++Y){var ft=w(f[Y],it);if(ft!==void 0)return ft}M(y,v,vt++,it)}else{it=-it-1|0;for(var Y=0;Y<vt;++Y){var ft=w(it,y[Y]);if(ft!==void 0)return ft}M(f,x,at++,it)}}}function A(k,w,R,O,N,V,H,F,U,W){for(var q=0,X=2*k,lt=k-1,yt=X-1,pt=R;pt<O;++pt){var st=V[pt]+1<<1,tt=X*pt;b[q++]=N[tt+lt],b[q++]=-st,b[q++]=N[tt+yt],b[q++]=st}for(var pt=H;pt<F;++pt){var st=W[pt]+1<<1,dt=X*pt;b[q++]=U[dt+lt],b[q++]=-st|1,b[q++]=U[dt+yt],b[q++]=st|1}var rt=q>>>1;o(b,rt);for(var at=0,vt=0,it=0,pt=0;pt<rt;++pt){var Y=b[2*pt+1]|0,ft=Y&1;if(pt<rt-1&&Y>>1===b[2*pt+3]>>1&&(ft=2,pt+=1),Y<0){for(var ut=-(Y>>1)-1,wt=0;wt<it;++wt){var zt=w(T[wt],ut);if(zt!==void 0)return zt}if(ft!==0)for(var wt=0;wt<at;++wt){var zt=w(f[wt],ut);if(zt!==void 0)return zt}if(ft!==1)for(var wt=0;wt<vt;++wt){var zt=w(y[wt],ut);if(zt!==void 0)return zt}ft===0?M(f,x,at++,ut):ft===1?M(y,v,vt++,ut):ft===2&&M(T,u,it++,ut)}else{var ut=(Y>>1)-1;ft===0?C(f,x,at--,ut):ft===1?C(y,v,vt--,ut):ft===2&&C(T,u,it--,ut)}}}function h(k,w,R,O,N,V,H,F,U,W,q,X){var lt=0,yt=2*k,pt=w,st=w+k,tt=1,dt=1;O?dt=i:tt=i;for(var rt=N;rt<V;++rt){var at=rt+tt,vt=yt*rt;b[lt++]=H[vt+pt],b[lt++]=-at,b[lt++]=H[vt+st],b[lt++]=at}for(var rt=U;rt<W;++rt){var at=rt+dt,it=yt*rt;b[lt++]=q[it+pt],b[lt++]=-at}var Y=lt>>>1;o(b,Y);for(var ft=0,rt=0;rt<Y;++rt){var ut=b[2*rt+1]|0;if(ut<0){var at=-ut,wt=!1;if(at>=i?(wt=!O,at-=i):(wt=!!O,at-=1),wt)M(f,x,ft++,at);else{var zt=X[at],Pt=yt*at,Wt=q[Pt+w+1],Ht=q[Pt+w+1+k];t:for(var Jt=0;Jt<ft;++Jt){var ge=f[Jt],he=yt*ge;if(!(Ht<H[he+w+1]||H[he+w+1+k]<Wt)){for(var de=w+2;de<k;++de)if(q[Pt+de+k]<H[he+de]||H[he+de+k]<q[Pt+de])continue t;var se=F[ge],Tt;if(O?Tt=R(zt,se):Tt=R(se,zt),Tt!==void 0)return Tt}}}}else C(f,x,ft--,ut-tt)}}function p(k,w,R,O,N,V,H,F,U,W,q){for(var X=0,lt=2*k,yt=w,pt=w+k,st=O;st<N;++st){var tt=st+i,dt=lt*st;b[X++]=V[dt+yt],b[X++]=-tt,b[X++]=V[dt+pt],b[X++]=tt}for(var st=F;st<U;++st){var tt=st+1,rt=lt*st;b[X++]=W[rt+yt],b[X++]=-tt}var at=X>>>1;o(b,at);for(var vt=0,st=0;st<at;++st){var it=b[2*st+1]|0;if(it<0){var tt=-it;if(tt>=i)f[vt++]=tt-i;else{tt-=1;var Y=q[tt],ft=lt*tt,ut=W[ft+w+1],wt=W[ft+w+1+k];t:for(var zt=0;zt<vt;++zt){var Pt=f[zt],Wt=H[Pt];if(Wt===Y)break;var Ht=lt*Pt;if(!(wt<V[Ht+w+1]||V[Ht+w+1+k]<ut)){for(var Jt=w+2;Jt<k;++Jt)if(W[ft+Jt+k]<V[Ht+Jt]||V[Ht+Jt+k]<W[ft+Jt])continue t;var ge=R(Wt,Y);if(ge!==void 0)return ge}}}}else{for(var tt=it-i,zt=vt-1;zt>=0;--zt)if(f[zt]===tt){for(var Jt=zt+1;Jt<vt;++Jt)f[Jt-1]=f[Jt];break}--vt}}}},868:function(t,e,r){t.exports=r(1387)},869:function(t,e,r){var a=r(2651),n=r(5716);t.exports=o;function o(i,s){var f=n(i),x=n(s);if(f===0)return[a(0),a(1)];if(x===0)return[a(0),a(0)];x<0&&(i=i.neg(),s=s.neg());var y=i.gcd(s);return y.cmpn(1)?[i.div(y),s.div(y)]:[i,s]}},870:function(t,e,r){var a=r(1433);function n(i){this.gl=i,this._elements=null,this._attributes=null,this._elementsType=i.UNSIGNED_SHORT}n.prototype.bind=function(){a(this.gl,this._elements,this._attributes)},n.prototype.update=function(i,s,f){this._elements=s,this._attributes=i,this._elementsType=f||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(i,s,f){f=f||0;var x=this.gl;this._elements?x.drawElements(i,s,this._elementsType,f):x.drawArrays(i,f,s)};function o(i){return new n(i)}t.exports=o},946:function(t,e,r){var a=r(1369),n=r(4025);t.exports=o;function o(i){var s=i[0],f=i[1];if(s.cmpn(0)===0)return 0;var x=s.abs().divmod(f.abs()),y=x.div,v=a(y),T=x.mod,u=s.negative!==f.negative?-1:1;if(T.cmpn(0)===0)return u*v;if(v){var b=n(v)+4,_=a(T.ushln(b).divRound(f));return u*(v+_*Math.pow(2,-b))}else{var C=f.bitLength()-T.bitLength()+53,_=a(T.ushln(C).divRound(f));return C<1023?u*_*Math.pow(2,-C):(_*=Math.pow(2,-1023),u*_*Math.pow(2,1023-C))}}},990:function(t,e,r){var a=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);
}
`]),i=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(x){var y=a(x,o,i,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return y.attributes.uv.location=0,y.attributes.f.location=1,y.attributes.normal.location=2,y},e.createPickShader=function(x){var y=a(x,o,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return y.attributes.uv.location=0,y.attributes.f.location=1,y.attributes.normal.location=2,y},e.createContourShader=function(x){var y=a(x,s,i,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return y.attributes.uv.location=0,y.attributes.f.location=1,y},e.createPickContourShader=function(x){var y=a(x,s,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return y.attributes.uv.location=0,y.attributes.f.location=1,y}},1085:function(t,e,r){var a=r(1371);t.exports=n;function n(o,i,s){i=typeof i=="number"?i:1,s=s||": ";var f=o.split(/\r?\n/),x=String(f.length+i-1).length;return f.map(function(y,v){var T=v+i,u=String(T).length,b=a(T,x-u);return b+s+y}).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 a=r(3250)[3];function n(i,s,f,x){for(var y=0;y<2;++y){var v=i[y],T=s[y],u=Math.min(v,T),b=Math.max(v,T),_=f[y],C=x[y],M=Math.min(_,C),E=Math.max(_,C);if(E<u||b<M)return!1}return!0}function o(i,s,f,x){var y=a(i,f,x),v=a(s,f,x);if(y>0&&v>0||y<0&&v<0)return!1;var T=a(f,i,s),u=a(x,i,s);return T>0&&u>0||T<0&&u<0?!1:y===0&&v===0&&T===0&&u===0?n(i,s,f,x):!0}},1278:function(t,e,r){var a=r(2361),n=Math.pow(2,-1074),o=-1>>>0;t.exports=i;function i(s,f){if(isNaN(s)||isNaN(f))return NaN;if(s===f)return s;if(s===0)return f<0?-n:n;var x=a.hi(s),y=a.lo(s);return f>s==s>0?y===o?(x+=1,y=0):y+=1:y===0?(y=o,x-=1):y-=1,a.pack(y,x)}},1283:function(t,e,r){var a=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;
}
}`]),i=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;
}
`]),x=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);
}`]),y=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],v={vertex:o,fragment:f,attributes:y},T={vertex:i,fragment:f,attributes:y},u={vertex:s,fragment:f,attributes:y},b={vertex:o,fragment:x,attributes:y},_={vertex:i,fragment:x,attributes:y},C={vertex:s,fragment:x,attributes:y};function M(E,A){var h=a(E,A),p=h.attributes;return p.position.location=0,p.color.location=1,p.glyph.location=2,p.id.location=3,h}e.createPerspective=function(E){return M(E,v)},e.createOrtho=function(E){return M(E,T)},e.createProject=function(E){return M(E,u)},e.createPickPerspective=function(E){return M(E,b)},e.createPickOrtho=function(E){return M(E,_)},e.createPickProject=function(E){return M(E,C)}},1303:function(t,e,r){t.exports=o;var a=r(3250);function n(i,s){var f,x;if(s[0][0]<s[1][0])f=s[0],x=s[1];else if(s[0][0]>s[1][0])f=s[1],x=s[0];else{var y=Math.min(i[0][1],i[1][1]),v=Math.max(i[0][1],i[1][1]),T=Math.min(s[0][1],s[1][1]),u=Math.max(s[0][1],s[1][1]);return v<T?v-T:y>u?y-u:v-u}var b,_;i[0][1]<i[1][1]?(b=i[0],_=i[1]):(b=i[1],_=i[0]);var C=a(x,f,b);return C||(C=a(x,f,_),C)?C:_-x}function o(i,s){var f,x;if(s[0][0]<s[1][0])f=s[0],x=s[1];else if(s[0][0]>s[1][0])f=s[1],x=s[0];else return n(s,i);var y,v;if(i[0][0]<i[1][0])y=i[0],v=i[1];else if(i[0][0]>i[1][0])y=i[1],v=i[0];else return-n(i,s);var T=a(f,x,v),u=a(f,x,y);if(T<0){if(u<=0)return T}else if(T>0){if(u>=0)return T}else if(u)return u;if(T=a(v,y,x),u=a(v,y,f),T<0){if(u<=0)return T}else if(T>0){if(u>=0)return T}else if(u)return u;return x[0]-v[0]}},1318:function(t){t.exports=e;function e(r,a){return r[0].mul(a[1]).cmp(a[0].mul(r[1]))}},1338:function(t){function e(n,o,i){var s=n[i]|0;if(s<=0)return[];var f=new Array(s),x;if(i===n.length-1)for(x=0;x<s;++x)f[x]=o;else for(x=0;x<s;++x)f[x]=e(n,o,i+1);return f}function r(n,o){var i,s;for(i=new Array(n),s=0;s<n;++s)i[s]=o;return i}function a(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=a},1369:function(t,e,r){var a=r(5716);t.exports=n;function n(o){var i=o.length,s=o.words,f=0;if(i===1)f=s[0];else if(i===2)f=s[0]+s[1]*67108864;else for(var x=0;x<i;x++){var y=s[x];f+=y*Math.pow(67108864,x)}return a(o)*f}},1371:function(t,e,r){var a=r(3233);t.exports=function(n,o,i){return i=typeof i<"u"?i+"":" ",a(i,o)+n}},1373:function(t){t.exports=e;function e(r,a,n){return r[0]=a[0]/n[0],r[1]=a[1]/n[1],r[2]=a[2]/n[2],r[3]=a[3]/n[3],r}},1387:function(t){t.exports=e;function e(r){var a=r[0],n=r[1],o=r[2];return Math.sqrt(a*a+n*n+o*o)}},1433:function(t){function e(r,a,n){a?a.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 i=0;i<n.length;++i){var s=n[i];if(s.buffer){var f=s.buffer,x=s.size||4,y=s.type||r.FLOAT,v=!!s.normalized,T=s.stride||0,u=s.offset||0;f.bind(),r.enableVertexAttribArray(i),r.vertexAttribPointer(i,x,y,v,T,u)}else{if(typeof s=="number")r.vertexAttrib1f(i,s);else if(s.length===1)r.vertexAttrib1f(i,s[0]);else if(s.length===2)r.vertexAttrib2f(i,s[0],s[1]);else if(s.length===3)r.vertexAttrib3f(i,s[0],s[1],s[2]);else if(s.length===4)r.vertexAttrib4f(i,s[0],s[1],s[2],s[3]);else throw new Error("gl-vao: Invalid vertex attribute");r.disableVertexAttribArray(i)}}for(;i<o;++i)r.disableVertexAttribArray(i)}else{r.bindBuffer(r.ARRAY_BUFFER,null);for(var i=0;i<o;++i)r.disableVertexAttribArray(i)}}t.exports=e},1463:function(t){t.exports=e;function e(r,a,n,o){return r[0]=a,r[1]=n,r[2]=o,r}},1493:function(t,e,r){var a=r(3236),n=r(9405),o=a([`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];
}
`]),i=a([`precision mediump float;
#define GLSLIFY 1
varying vec4 fragColor;
void main() {
gl_FragColor = fragColor;
}`]);t.exports=function(s){return n(s,o,i,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},1498:function(t){t.exports=e;function e(r,a){return r[0]=-a[0],r[1]=-a[1],r[2]=-a[2],r[3]=-a[3],r}},1533:function(t,e,r){r(6859),t.exports=a;function a(n){return n&&typeof n=="object"&&!!n.words}},1538:function(t){(function(){if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function e(p){p.permitHostObjects___&&p.permitHostObjects___(e)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=e);var r=!1;if(typeof WeakMap=="function"){var a=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var n=new a,o=Object.freeze({});if(n.set(o,1),n.get(o)!==1)r=!0;else{t.exports=WeakMap;return}}}var i=Object.getOwnPropertyNames,s=Object.defineProperty,f=Object.isExtensible,x="weakmap:",y=x+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var v=new ArrayBuffer(25),T=new Uint8Array(v);crypto.getRandomValues(T),y=x+"rand:"+Array.prototype.map.call(T,function(p){return(p%36).toString(36)}).join("")+"___"}function u(p){return!(p.substr(0,x.length)==x&&p.substr(p.length-3)==="___")}if(s(Object,"getOwnPropertyNames",{value:function(p){return i(p).filter(u)}}),"getPropertyNames"in Object){var b=Object.getPropertyNames;s(Object,"getPropertyNames",{value:function(p){return b(p).filter(u)}})}function _(p){if(p!==Object(p))throw new TypeError("Not an object: "+p);var k=p[y];if(k&&k.key===p)return k;if(f(p)){k={key:p};try{return s(p,y,{value:k,writable:!1,enumerable:!1,configurable:!1}),k}catch{return}}}(function(){var p=Object.freeze;s(Object,"freeze",{value:function(R){return _(R),p(R)}});var k=Object.seal;s(Object,"seal",{value:function(R){return _(R),k(R)}});var w=Object.preventExtensions;s(Object,"preventExtensions",{value:function(R){return _(R),w(R)}})})();function C(p){return p.prototype=null,Object.freeze(p)}var M=!1;function E(){!M&&typeof console<"u"&&(M=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var A=0,h=function(){this instanceof h||E();var p=[],k=[],w=A++;function R(H,F){var U,W=_(H);return W?w in W?W[w]:F:(U=p.indexOf(H),U>=0?k[U]:F)}function O(H){var F=_(H);return F?w in F:p.indexOf(H)>=0}function N(H,F){var U,W=_(H);return W?W[w]=F:(U=p.indexOf(H),U>=0?k[U]=F:(U=p.length,k[U]=F,p[U]=H)),this}function V(H){var F=_(H),U,W;return F?w in F&&delete F[w]:(U=p.indexOf(H),U<0?!1:(W=p.length-1,p[U]=void 0,k[U]=k[W],p[U]=p[W],p.length=W,k.length=W,!0))}return Object.create(h.prototype,{get___:{value:C(R)},has___:{value:C(O)},set___:{value:C(N)},delete___:{value:C(V)}})};h.prototype=Object.create(Object.prototype,{get:{value:function(p,k){return this.get___(p,k)},writable:!0,configurable:!0},has:{value:function(p){return this.has___(p)},writable:!0,configurable:!0},set:{value:function(p,k){return this.set___(p,k)},writable:!0,configurable:!0},delete:{value:function(p){return this.delete___(p)},writable:!0,configurable:!0}}),typeof a=="function"?function(){r&&typeof Proxy<"u"&&(Proxy=void 0);function p(){this instanceof h||E();var k=new a,w=void 0,R=!1;function O(F,U){return w?k.has(F)?k.get(F):w.get___(F,U):k.get(F,U)}function N(F){return k.has(F)||(w?w.has___(F):!1)}var V;r?V=function(F,U){return k.set(F,U),k.has(F)||(w||(w=new h),w.set(F,U)),this}:V=function(F,U){if(R)try{k.set(F,U)}catch{w||(w=new h),w.set___(F,U)}else k.set(F,U);return this};function H(F){var U=!!k.delete(F);return w&&w.delete___(F)||U}return Object.create(h.prototype,{get___:{value:C(O)},has___:{value:C(N)},set___:{value:C(V)},delete___:{value:C(H)},permitHostObjects___:{value:C(function(F){if(F===e)R=!0;else throw new Error("bogus call to permitHostObjects___")})}})}p.prototype=h.prototype,t.exports=p,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),t.exports=h)})()},1570:function(t){t.exports=r;var e=[function(){function a(n,o,i,s){for(var f=n.length,x=[],y=0;y<f;++y)var v=n[y],T=v.length;return x}return a},function(){function a(o,i,s,f){for(var x=Math.min(s,f)|0,y=Math.max(s,f)|0,v=o[2*x],T=o[2*x+1];v<T;){var u=v+T>>1,b=i[2*u+1];if(b===y)return u;y<b?T=u:v=u+1}return v}function n(o,i,s,f){for(var x=o.length,y=[],v=0;v<x;++v){var T=o[v],u=T.length;if(u===2){var b=(f[T[0]]<<0)+(f[T[1]]<<1);if(b===0||b===3)continue;switch(b){case 0:break;case 1:y.push([a(s,i,T[0],T[1])]);break;case 2:y.push([a(s,i,T[1],T[0])]);break}}}return y}return n},function(){function a(o,i,s,f){for(var x=Math.min(s,f)|0,y=Math.max(s,f)|0,v=o[2*x],T=o[2*x+1];v<T;){var u=v+T>>1,b=i[2*u+1];if(b===y)return u;y<b?T=u:v=u+1}return v}function n(o,i,s,f){for(var x=o.length,y=[],v=0;v<x;++v){var T=o[v],u=T.length;if(u===3){var b=(f[T[0]]<<0)+(f[T[1]]<<1)+(f[T[2]]<<2);if(b===0||b===7)continue;switch(b){case 0:break;case 1:y.push([a(s,i,T[0],T[2]),a(s,i,T[0],T[1])]);break;case 2:y.push([a(s,i,T[1],T[0]),a(s,i,T[1],T[2])]);break;case 3:y.push([a(s,i,T[0],T[2]),a(s,i,T[1],T[2])]);break;case 4:y.push([a(s,i,T[2],T[1]),a(s,i,T[2],T[0])]);break;case 5:y.push([a(s,i,T[2],T[1]),a(s,i,T[0],T[1])]);break;case 6:y.push([a(s,i,T[1],T[0]),a(s,i,T[2],T[0])]);break}}else if(u===2){var b=(f[T[0]]<<0)+(f[T[1]]<<1);if(b===0||b===3)continue;switch(b){case 0:break;case 1:y.push([a(s,i,T[0],T[1])]);break;case 2:y.push([a(s,i,T[1],T[0])]);break}}}return y}return n},function(){function a(o,i,s,f){for(var x=Math.min(s,f)|0,y=Math.max(s,f)|0,v=o[2*x],T=o[2*x+1];v<T;){var u=v+T>>1,b=i[2*u+1];if(b===y)return u;y<b?T=u:v=u+1}return v}function n(o,i,s,f){for(var x=o.length,y=[],v=0;v<x;++v){var T=o[v],u=T.length;if(u===4){var b=(f[T[0]]<<0)+(f[T[1]]<<1)+(f[T[2]]<<2)+(f[T[3]]<<3);if(b===0||b===15)continue;switch(b){case 0:break;case 1:y.push([a(s,i,T[0],T[1]),a(s,i,T[0],T[2]),a(s,i,T[0],T[3])]);break;case 2:y.push([a(s,i,T[1],T[2]),a(s,i,T[1],T[0]),a(s,i,T[1],T[3])]);break;case 3:y.push([a(s,i,T[1],T[2]),a(s,i,T[0],T[2]),a(s,i,T[0],T[3])],[a(s,i,T[1],T[3]),a(s,i,T[1],T[2]),a(s,i,T[0],T[3])]);break;case 4:y.push([a(s,i,T[2],T[0]),a(s,i,T[2],T[1]),a(s,i,T[2],T[3])]);break;case 5:y.push([a(s,i,T[0],T[1]),a(s,i,T[2],T[1]),a(s,i,T[0],T[3])],[a(s,i,T[2],T[1]),a(s,i,T[2],T[3]),a(s,i,T[0],T[3])]);break;case 6:y.push([a(s,i,T[2],T[0]),a(s,i,T[1],T[0]),a(s,i,T[1],T[3])],[a(s,i,T[2],T[3]),a(s,i,T[2],T[0]),a(s,i,T[1],T[3])]);break;case 7:y.push([a(s,i,T[0],T[3]),a(s,i,T[1],T[3]),a(s,i,T[2],T[3])]);break;case 8:y.push([a(s,i,T[3],T[1]),a(s,i,T[3],T[0]),a(s,i,T[3],T[2])]);break;case 9:y.push([a(s,i,T[3],T[1]),a(s,i,T[0],T[1]),a(s,i,T[0],T[2])],[a(s,i,T[3],T[2]),a(s,i,T[3],T[1]),a(s,i,T[0],T[2])]);break;case 10:y.push([a(s,i,T[1],T[0]),a(s,i,T[3],T[0]),a(s,i,T[1],T[2])],[a(s,i,T[3],T[0]),a(s,i,T[3],T[2]),a(s,i,T[1],T[2])]);break;case 11:y.push([a(s,i,T[1],T[2]),a(s,i,T[0],T[2]),a(s,i,T[3],T[2])]);break;case 12:y.push([a(s,i,T[3],T[0]),a(s,i,T[2],T[0]),a(s,i,T[2],T[1])],[a(s,i,T[3],T[1]),a(s,i,T[3],T[0]),a(s,i,T[2],T[1])]);break;case 13:y.push([a(s,i,T[0],T[1]),a(s,i,T[2],T[1]),a(s,i,T[3],T[1])]);break;case 14:y.push([a(s,i,T[2],T[0]),a(s,i,T[1],T[0]),a(s,i,T[3],T[0])]);break}}else if(u===3){var b=(f[T[0]]<<0)+(f[T[1]]<<1)+(f[T[2]]<<2);if(b===0||b===7)continue;switch(b){case 0:break;case 1:y.push([a(s,i,T[0],T[2]),a(s,i,T[0],T[1])]);break;case 2:y.push([a(s,i,T[1],T[0]),a(s,i,T[1],T[2])]);break;case 3:y.push([a(s,i,T[0],T[2]),a(s,i,T[1],T[2])]);break;case 4:y.push([a(s,i,T[2],T[1]),a(s,i,T[2],T[0])]);break;case 5:y.push([a(s,i,T[2],T[1]),a(s,i,T[0],T[1])]);break;case 6:y.push([a(s,i,T[1],T[0]),a(s,i,T[2],T[0])]);break}}else if(u===2){var b=(f[T[0]]<<0)+(f[T[1]]<<1);if(b===0||b===3)continue;switch(b){case 0:break;case 1:y.push([a(s,i,T[0],T[1])]);break;case 2:y.push([a(s,i,T[1],T[0])]);break}}}return y}return n}];function r(a){return e[a]()}},1682:function(t){function e(n,o){for(var i=1,s=n.length,f=n[0],x=n[0],y=1;y<s;++y)if(x=f,f=n[y],o(f,x)){if(y===i){i++;continue}n[i++]=f}return n.length=i,n}function r(n){for(var o=1,i=n.length,s=n[0],f=n[0],x=1;x<i;++x,f=s)if(f=s,s=n[x],s!==f){if(x===o){o++;continue}n[o++]=s}return n.length=o,n}function a(n,o,i){return n.length===0?n:o?(i||n.sort(o),e(n,o)):(i||n.sort(),r(n))}t.exports=a},1755:function(t){"use restrict";t.exports=e;function e(a){this.roots=new Array(a),this.ranks=new Array(a);for(var n=0;n<a;++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 a=this.roots.length;return this.roots.push(a),this.ranks.push(0),a},r.find=function(a){for(var n=a,o=this.roots;o[a]!==a;)a=o[a];for(;o[n]!==a;){var i=o[n];o[n]=a,n=i}return a},r.link=function(a,n){var o=this.find(a),i=this.find(n);if(o!==i){var s=this.ranks,f=this.roots,x=s[o],y=s[i];x<y?f[o]=i:y<x?f[i]=o:(f[i]=o,++s[o])}}},1811:function(t,e,r){var a=r(2478),n=r(7442),o=r(7608),i=r(5567),s=r(2408),f=r(7089),x=r(6582),y=r(7656);r(2504);var v=r(3536),T=[0,0,0];t.exports=C;function u(M){this._components=M.slice(),this._time=[0],this.prevMatrix=M.slice(),this.nextMatrix=M.slice(),this.computedMatrix=M.slice(),this.computedInverse=M.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 b=u.prototype;b.recalcMatrix=function(M){var E=this._time,A=a.le(E,M),h=this.computedMatrix;if(!(A<0)){var p=this._components;if(A===E.length-1)for(var k=16*A,w=0;w<16;++w)h[w]=p[k++];else{for(var R=E[A+1]-E[A],k=16*A,O=this.prevMatrix,N=!0,w=0;w<16;++w)O[w]=p[k++];for(var V=this.nextMatrix,w=0;w<16;++w)V[w]=p[k++],N=N&&O[w]===V[w];if(R<1e-6||N)for(var w=0;w<16;++w)h[w]=O[w];else n(h,O,V,(M-E[A])/R)}var H=this.computedUp;H[0]=h[1],H[1]=h[5],H[2]=h[9],v(H,H);var F=this.computedInverse;o(F,h);var U=this.computedEye,W=F[15];U[0]=F[12]/W,U[1]=F[13]/W,U[2]=F[14]/W;for(var q=this.computedCenter,X=Math.exp(this.computedRadius[0]),w=0;w<3;++w)q[w]=U[w]-h[2+4*w]*X}},b.idle=function(M){if(!(M<this.lastT())){for(var E=this._components,A=E.length-16,h=0;h<16;++h)E.push(E[A++]);this._time.push(M)}},b.flush=function(M){var E=a.gt(this._time,M)-2;E<0||(this._time.splice(0,E),this._components.splice(0,16*E))},b.lastT=function(){return this._time[this._time.length-1]},b.lookAt=function(M,E,A,h){this.recalcMatrix(M),E=E||this.computedEye,A=A||T,h=h||this.computedUp,this.setMatrix(M,x(this.computedMatrix,E,A,h));for(var p=0,k=0;k<3;++k)p+=Math.pow(A[k]-E[k],2);p=Math.log(Math.sqrt(p)),this.computedRadius[0]=p},b.rotate=function(M,E,A,h){this.recalcMatrix(M);var p=this.computedInverse;E&&s(p,p,E),A&&i(p,p,A),h&&f(p,p,h),this.setMatrix(M,o(this.computedMatrix,p))};var _=[0,0,0];b.pan=function(M,E,A,h){_[0]=-(E||0),_[1]=-(A||0),_[2]=-(h||0),this.recalcMatrix(M);var p=this.computedInverse;y(p,p,_),this.setMatrix(M,o(p,p))},b.translate=function(M,E,A,h){_[0]=E||0,_[1]=A||0,_[2]=h||0,this.recalcMatrix(M);var p=this.computedMatrix;y(p,p,_),this.setMatrix(M,p)},b.setMatrix=function(M,E){if(!(M<this.lastT())){this._time.push(M);for(var A=0;A<16;++A)this._components.push(E[A])}},b.setDistance=function(M,E){this.computedRadius[0]=E},b.setDistanceLimits=function(M,E){var A=this._limits;A[0]=M,A[1]=E},b.getDistanceLimits=function(M){var E=this._limits;return M?(M[0]=E[0],M[1]=E[1],M):E};function C(M){M=M||{};var E=M.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new u(E)}},1848:function(t,e,r){var a=r(4905),n=r(6468);t.exports=o;function o(i){for(var s=Array.isArray(i)?i:a(i),f=0;f<s.length;f++){var x=s[f];if(x.type==="preprocessor"){var y=x.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(y&&y[2]){var v=y[1],T=y[2];return(v?n(T):T).trim()}}}}},1879:function(t,e,r){var a=r(3236),n=r(9405),o=a([`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);
}
`]),i=a([`precision highp float;
#define GLSLIFY 1
uniform vec4 color;
void main() {
gl_FragColor = color;
}`]);e.n=function(v){return n(v,o,i,null,[{name:"position",type:"vec3"}])};var s=a([`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=a([`precision highp float;
#define GLSLIFY 1
uniform vec4 color;
void main() {
gl_FragColor = color;
}`]);e.Q=function(v){return n(v,s,f,null,[{name:"position",type:"vec3"}])};var x=a([`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);
}
`]),y=a([`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(v){return n(v,x,y,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},1888:function(t,e,r){var a=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 i=typeof Uint8ClampedArray<"u",s=typeof BigUint64Array<"u",f=typeof BigInt64Array<"u",x=r.g.__TYPEDARRAY_POOL;x.UINT8C||(x.UINT8C=n([32,0])),x.BIGUINT64||(x.BIGUINT64=n([32,0])),x.BIGINT64||(x.BIGINT64=n([32,0])),x.BUFFER||(x.BUFFER=n([32,0]));var y=x.DATA,v=x.BUFFER;e.free=function(H){if(o.isBuffer(H))v[a.log2(H.length)].push(H);else{if(Object.prototype.toString.call(H)!=="[object ArrayBuffer]"&&(H=H.buffer),!H)return;var F=H.length||H.byteLength,U=a.log2(F)|0;y[U].push(H)}};function T(H){if(H){var F=H.length||H.byteLength,U=a.log2(F);y[U].push(H)}}function u(H){T(H.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=u,e.freeArrayBuffer=T,e.freeBuffer=function(H){v[a.log2(H.length)].push(H)},e.malloc=function(H,F){if(F===void 0||F==="arraybuffer")return b(H);switch(F){case"uint8":return _(H);case"uint16":return C(H);case"uint32":return M(H);case"int8":return E(H);case"int16":return A(H);case"int32":return h(H);case"float":case"float32":return p(H);case"double":case"float64":return k(H);case"uint8_clamped":return w(H);case"bigint64":return O(H);case"biguint64":return R(H);case"buffer":return V(H);case"data":case"dataview":return N(H);default:return null}return null};function b(F){var F=a.nextPow2(F),U=a.log2(F),W=y[U];return W.length>0?W.pop():new ArrayBuffer(F)}e.mallocArrayBuffer=b;function _(H){return new Uint8Array(b(H),0,H)}e.mallocUint8=_;function C(H){return new Uint16Array(b(2*H),0,H)}e.mallocUint16=C;function M(H){return new Uint32Array(b(4*H),0,H)}e.mallocUint32=M;function E(H){return new Int8Array(b(H),0,H)}e.mallocInt8=E;function A(H){return new Int16Array(b(2*H),0,H)}e.mallocInt16=A;function h(H){return new Int32Array(b(4*H),0,H)}e.mallocInt32=h;function p(H){return new Float32Array(b(4*H),0,H)}e.mallocFloat32=e.mallocFloat=p;function k(H){return new Float64Array(b(8*H),0,H)}e.mallocFloat64=e.mallocDouble=k;function w(H){return i?new Uint8ClampedArray(b(H),0,H):_(H)}e.mallocUint8Clamped=w;function R(H){return s?new BigUint64Array(b(8*H),0,H):null}e.mallocBigUint64=R;function O(H){return f?new BigInt64Array(b(8*H),0,H):null}e.mallocBigInt64=O;function N(H){return new DataView(b(H),0,H)}e.mallocDataView=N;function V(H){H=a.nextPow2(H);var F=a.log2(H),U=v[F];return U.length>0?U.pop():new o(H)}e.mallocBuffer=V,e.clearCache=function(){for(var H=0;H<32;++H)x.UINT8[H].length=0,x.UINT16[H].length=0,x.UINT32[H].length=0,x.INT8[H].length=0,x.INT16[H].length=0,x.INT32[H].length=0,x.FLOAT[H].length=0,x.DOUBLE[H].length=0,x.BIGUINT64[H].length=0,x.BIGINT64[H].length=0,x.UINT8C[H].length=0,y[H].length=0,v[H].length=0}},1903:function(t){t.exports=e;function e(r){var a=new Float32Array(16);return a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5],a[6]=r[6],a[7]=r[7],a[8]=r[8],a[9]=r[9],a[10]=r[10],a[11]=r[11],a[12]=r[12],a[13]=r[13],a[14]=r[14],a[15]=r[15],a}},1944:function(t,e,r){var a=r(5250),n=r(8210);t.exports=o;function o(i,s){for(var f=a(i[0],s[0]),x=1;x<i.length;++x)f=n(f,a(i[x],s[x]));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 a=r(3105),n=r(4623);function o(p){for(var k=0,w=Math.max,R=0,O=p.length;R<O;++R)k=w(k,p[R].length);return k-1}e.dimension=o;function i(p){for(var k=-1,w=Math.max,R=0,O=p.length;R<O;++R)for(var N=p[R],V=0,H=N.length;V<H;++V)k=w(k,N[V]);return k+1}e.countVertices=i;function s(p){for(var k=new Array(p.length),w=0,R=p.length;w<R;++w)k[w]=p[w].slice(0);return k}e.cloneCells=s;function f(p,k){var w=p.length,R=p.length-k.length,O=Math.min;if(R)return R;switch(w){case 0:return 0;case 1:return p[0]-k[0];case 2:var U=p[0]+p[1]-k[0]-k[1];return U||O(p[0],p[1])-O(k[0],k[1]);case 3:var N=p[0]+p[1],V=k[0]+k[1];if(U=N+p[2]-(V+k[2]),U)return U;var H=O(p[0],p[1]),F=O(k[0],k[1]),U=O(H,p[2])-O(F,k[2]);return U||O(H+p[2],N)-O(F+k[2],V);default:var W=p.slice(0);W.sort();var q=k.slice(0);q.sort();for(var X=0;X<w;++X)if(R=W[X]-q[X],R)return R;return 0}}e.compareCells=f;function x(p,k){return f(p[0],k[0])}function y(p,k){if(k){for(var w=p.length,R=new Array(w),O=0;O<w;++O)R[O]=[p[O],k[O]];R.sort(x);for(var O=0;O<w;++O)p[O]=R[O][0],k[O]=R[O][1];return p}else return p.sort(f),p}e.normalize=y;function v(p){if(p.length===0)return[];for(var k=1,w=p.length,R=1;R<w;++R){var O=p[R];if(f(O,p[R-1])){if(R===k){k++;continue}p[k++]=O}}return p.length=k,p}e.unique=v;function T(p,k){for(var w=0,R=p.length-1,O=-1;w<=R;){var N=w+R>>1,V=f(p[N],k);V<=0?(V===0&&(O=N),w=N+1):V>0&&(R=N-1)}return O}e.findCell=T;function u(p,k){for(var w=new Array(p.length),R=0,O=w.length;R<O;++R)w[R]=[];for(var N=[],R=0,V=k.length;R<V;++R)for(var H=k[R],F=H.length,U=1,W=1<<F;U<W;++U){N.length=a.popCount(U);for(var q=0,X=0;X<F;++X)U&1<<X&&(N[q++]=H[X]);var lt=T(p,N);if(!(lt<0))for(;w[lt++].push(R),!(lt>=p.length||f(p[lt],N)!==0););}return w}e.incidence=u;function b(p,k){if(!k)return u(v(C(p,0)),p);for(var w=new Array(k),R=0;R<k;++R)w[R]=[];for(var R=0,O=p.length;R<O;++R)for(var N=p[R],V=0,H=N.length;V<H;++V)w[N[V]].push(R);return w}e.dual=b;function _(p){for(var k=[],w=0,R=p.length;w<R;++w)for(var O=p[w],N=O.length|0,V=1,H=1<<N;V<H;++V){for(var F=[],U=0;U<N;++U)V>>>U&1&&F.push(O[U]);k.push(F)}return y(k)}e.explode=_;function C(p,k){if(k<0)return[];for(var w=[],R=(1<<k+1)-1,O=0;O<p.length;++O)for(var N=p[O],V=R;V<1<<N.length;V=a.nextCombination(V)){for(var H=new Array(k+1),F=0,U=0;U<N.length;++U)V&1<<U&&(H[F++]=N[U]);w.push(H)}return y(w)}e.skeleton=C;function M(p){for(var k=[],w=0,R=p.length;w<R;++w)for(var O=p[w],N=0,V=O.length;N<V;++N){for(var H=new Array(O.length-1),F=0,U=0;F<V;++F)F!==N&&(H[U++]=O[F]);k.push(H)}return y(k)}e.boundary=M;function E(p,k){for(var w=new n(k),R=0;R<p.length;++R)for(var O=p[R],N=0;N<O.length;++N)for(var V=N+1;V<O.length;++V)w.link(O[N],O[V]);for(var H=[],F=w.ranks,R=0;R<F.length;++R)F[R]=-1;for(var R=0;R<p.length;++R){var U=w.find(p[R][0]);F[U]<0?(F[U]=H.length,H.push([p[R].slice(0)])):H[F[U]].push(p[R].slice(0))}return H}function A(p){for(var k=v(y(C(p,0))),w=new n(k.length),R=0;R<p.length;++R)for(var O=p[R],N=0;N<O.length;++N)for(var V=T(k,[O[N]]),H=N+1;H<O.length;++H)w.link(V,T(k,[O[H]]));for(var F=[],U=w.ranks,R=0;R<U.length;++R)U[R]=-1;for(var R=0;R<p.length;++R){var W=w.find(T(k,[p[R][0]]));U[W]<0?(U[W]=F.length,F.push([p[R].slice(0)])):F[U[W]].push(p[R].slice(0))}return F}function h(p,k){return k?E(p,k):A(p)}e.connectedComponents=h},2095:function(t,e,r){t.exports=T;var a=r(3134),n=r(3088),o=r(5085),i=r(5250),s=r(8210),f=r(1682),x=r(5609);function y(u,b){for(var _=new Array(u),C=0;C<u;++C)_[C]=b;return _}function v(u){for(var b=new Array(u),_=0;_<u;++_)b[_]=[];return b}function T(u,b){var _=x(u,b);u=_[0],b=_[1];for(var C=b.length,M=u.length,E=a(u,b.length),A=0;A<C;++A)if(E[A].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var h=n(u,b);function p(Jt){for(var ge=Jt.length,he=[0],de=0;de<ge;++de){var se=b[Jt[de]],Tt=b[Jt[(de+1)%ge]],Lt=i(-se[0],se[1]),Mt=i(-se[0],Tt[1]),te=i(Tt[0],se[1]),ve=i(Tt[0],Tt[1]);he=s(he,s(s(Lt,Mt),s(te,ve)))}return he[he.length-1]>0}h=h.filter(p);for(var k=h.length,w=new Array(k),R=new Array(k),A=0;A<k;++A){w[A]=A;var O=new Array(k),N=h[A].map(function(ge){return b[ge]}),V=o([N]),H=0;t:for(var F=0;F<k;++F)if(O[F]=0,A!==F){for(var U=h[F],W=U.length,q=0;q<W;++q){var X=V(b[U[q]]);if(X!==0){X<0&&(O[F]=1,H+=1);continue t}}O[F]=1,H+=1}R[A]=[H,A,O]}R.sort(function(Jt,ge){return ge[0]-Jt[0]});for(var A=0;A<k;++A)for(var O=R[A],lt=O[1],yt=O[2],F=0;F<k;++F)yt[F]&&(w[F]=lt);for(var pt=v(k),A=0;A<k;++A)pt[A].push(w[A]),pt[w[A]].push(A);for(var st={},tt=y(C,!1),A=0;A<k;++A)for(var U=h[A],W=U.length,F=0;F<W;++F){var dt=U[F],rt=U[(F+1)%W],at=Math.min(dt,rt)+":"+Math.max(dt,rt);if(at in st){var vt=st[at];pt[vt].push(A),pt[A].push(vt),tt[dt]=tt[rt]=!0}else st[at]=A}function it(Jt){for(var ge=Jt.length,he=0;he<ge;++he)if(!tt[Jt[he]])return!1;return!0}for(var Y=[],ft=y(k,-1),A=0;A<k;++A)w[A]===A&&!it(h[A])?(Y.push(A),ft[A]=0):ft[A]=-1;for(var _=[];Y.length>0;){var ut=Y.pop(),wt=pt[ut];f(wt,function(ge,he){return ge-he});var zt=wt.length,Pt=ft[ut],Wt;if(Pt===0){var U=h[ut];Wt=[U]}for(var A=0;A<zt;++A){var Ht=wt[A];if(!(ft[Ht]>=0)&&(ft[Ht]=Pt^1,Y.push(Ht),Pt===0)){var U=h[Ht];it(U)||(U.reverse(),Wt.push(U))}}Pt===0&&_.push(Wt)}return _}},2145:function(t,e){e.uniforms=o,e.attributes=i;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"},a=null;function n(s,f){if(!a){var x=Object.keys(r);a={};for(var y=0;y<x.length;++y){var v=x[y];a[s[v]]=r[v]}}return a[f]}function o(s,f){for(var x=s.getProgramParameter(f,s.ACTIVE_UNIFORMS),y=[],v=0;v<x;++v){var T=s.getActiveUniform(f,v);if(T){var u=n(s,T.type);if(T.size>1)for(var b=0;b<T.size;++b)y.push({name:T.name.replace("[0]","["+b+"]"),type:u});else y.push({name:T.name,type:u})}}return y}function i(s,f){for(var x=s.getProgramParameter(f,s.ACTIVE_ATTRIBUTES),y=[],v=0;v<x;++v){var T=s.getActiveAttrib(f,v);T&&y.push({name:T.name,type:n(s,T.type)})}return y}},2229:function(t,e,r){t.exports=r(6843)},2260:function(t,e,r){var a=r(7766);t.exports=A;var n=null,o,i,s,f;function x(h){var p=h.getParameter(h.FRAMEBUFFER_BINDING),k=h.getParameter(h.RENDERBUFFER_BINDING),w=h.getParameter(h.TEXTURE_BINDING_2D);return[p,k,w]}function y(h,p){h.bindFramebuffer(h.FRAMEBUFFER,p[0]),h.bindRenderbuffer(h.RENDERBUFFER,p[1]),h.bindTexture(h.TEXTURE_2D,p[2])}function v(h,p){var k=h.getParameter(p.MAX_COLOR_ATTACHMENTS_WEBGL);n=new Array(k+1);for(var w=0;w<=k;++w){for(var R=new Array(k),O=0;O<w;++O)R[O]=h.COLOR_ATTACHMENT0+O;for(var O=w;O<k;++O)R[O]=h.NONE;n[w]=R}}function T(h){switch(h){case o:throw new Error("gl-fbo: Framebuffer unsupported");case i: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 u(h,p,k,w,R,O){if(!w)return null;var N=a(h,p,k,R,w);return N.magFilter=h.NEAREST,N.minFilter=h.NEAREST,N.mipSamples=1,N.bind(),h.framebufferTexture2D(h.FRAMEBUFFER,O,h.TEXTURE_2D,N.handle,0),N}function b(h,p,k,w,R){var O=h.createRenderbuffer();return h.bindRenderbuffer(h.RENDERBUFFER,O),h.renderbufferStorage(h.RENDERBUFFER,w,p,k),h.framebufferRenderbuffer(h.FRAMEBUFFER,R,h.RENDERBUFFER,O),O}function _(h){var p=x(h.gl),k=h.gl,w=h.handle=k.createFramebuffer(),R=h._shape[0],O=h._shape[1],N=h.color.length,V=h._ext,H=h._useStencil,F=h._useDepth,U=h._colorType;k.bindFramebuffer(k.FRAMEBUFFER,w);for(var W=0;W<N;++W)h.color[W]=u(k,R,O,U,k.RGBA,k.COLOR_ATTACHMENT0+W);N===0?(h._color_rb=b(k,R,O,k.RGBA4,k.COLOR_ATTACHMENT0),V&&V.drawBuffersWEBGL(n[0])):N>1&&V.drawBuffersWEBGL(n[N]);var q=k.getExtension("WEBGL_depth_texture");q?H?h.depth=u(k,R,O,q.UNSIGNED_INT_24_8_WEBGL,k.DEPTH_STENCIL,k.DEPTH_STENCIL_ATTACHMENT):F&&(h.depth=u(k,R,O,k.UNSIGNED_SHORT,k.DEPTH_COMPONENT,k.DEPTH_ATTACHMENT)):F&&H?h._depth_rb=b(k,R,O,k.DEPTH_STENCIL,k.DEPTH_STENCIL_ATTACHMENT):F?h._depth_rb=b(k,R,O,k.DEPTH_COMPONENT16,k.DEPTH_ATTACHMENT):H&&(h._depth_rb=b(k,R,O,k.STENCIL_INDEX,k.STENCIL_ATTACHMENT));var X=k.checkFramebufferStatus(k.FRAMEBUFFER);if(X!==k.FRAMEBUFFER_COMPLETE){h._destroyed=!0,k.bindFramebuffer(k.FRAMEBUFFER,null),k.deleteFramebuffer(h.handle),h.handle=null,h.depth&&(h.depth.dispose(),h.depth=null),h._depth_rb&&(k.deleteRenderbuffer(h._depth_rb),h._depth_rb=null);for(var W=0;W<h.color.length;++W)h.color[W].dispose(),h.color[W]=null;h._color_rb&&(k.deleteRenderbuffer(h._color_rb),h._color_rb=null),y(k,p),T(X)}y(k,p)}function C(h,p,k,w,R,O,N,V){this.gl=h,this._shape=[p|0,k|0],this._destroyed=!1,this._ext=V,this.color=new Array(R);for(var H=0;H<R;++H)this.color[H]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=w,this._useDepth=O,this._useStencil=N;var F=this,U=[p|0,k|0];Object.defineProperties(U,{0:{get:function(){return F._shape[0]},set:function(W){return F.width=W}},1:{get:function(){return F._shape[1]},set:function(W){return F.height=W}}}),this._shapeVector=U,_(this)}var M=C.prototype;function E(h,p,k){if(h._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(!(h._shape[0]===p&&h._shape[1]===k)){var w=h.gl,R=w.getParameter(w.MAX_RENDERBUFFER_SIZE);if(p<0||p>R||k<0||k>R)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");h._shape[0]=p,h._shape[1]=k;for(var O=x(w),N=0;N<h.color.length;++N)h.color[N].shape=h._shape;h._color_rb&&(w.bindRenderbuffer(w.RENDERBUFFER,h._color_rb),w.renderbufferStorage(w.RENDERBUFFER,w.RGBA4,h._shape[0],h._shape[1])),h.depth&&(h.depth.shape=h._shape),h._depth_rb&&(w.bindRenderbuffer(w.RENDERBUFFER,h._depth_rb),h._useDepth&&h._useStencil?w.renderbufferStorage(w.RENDERBUFFER,w.DEPTH_STENCIL,h._shape[0],h._shape[1]):h._useDepth?w.renderbufferStorage(w.RENDERBUFFER,w.DEPTH_COMPONENT16,h._shape[0],h._shape[1]):h._useStencil&&w.renderbufferStorage(w.RENDERBUFFER,w.STENCIL_INDEX,h._shape[0],h._shape[1])),w.bindFramebuffer(w.FRAMEBUFFER,h.handle);var V=w.checkFramebufferStatus(w.FRAMEBUFFER);V!==w.FRAMEBUFFER_COMPLETE&&(h.dispose(),y(w,O),T(V)),y(w,O)}}Object.defineProperties(M,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(h){if(Array.isArray(h)||(h=[h|0,h|0]),h.length!==2)throw new Error("gl-fbo: Shape vector must be length 2");var p=h[0]|0,k=h[1]|0;return E(this,p,k),[p,k]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(h){return h=h|0,E(this,h,this._shape[1]),h},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(h){return h=h|0,E(this,this._shape[0],h),h},enumerable:!1}}),M.bind=function(){if(!this._destroyed){var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,this.handle),h.viewport(0,0,this._shape[0],this._shape[1])}},M.dispose=function(){if(!this._destroyed){this._destroyed=!0;var h=this.gl;h.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(h.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var p=0;p<this.color.length;++p)this.color[p].dispose(),this.color[p]=null;this._color_rb&&(h.deleteRenderbuffer(this._color_rb),this._color_rb=null)}};function A(h,p,k,w){o||(o=h.FRAMEBUFFER_UNSUPPORTED,i=h.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,s=h.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,f=h.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var R=h.getExtension("WEBGL_draw_buffers");if(!n&&R&&v(h,R),Array.isArray(p)&&(w=k,k=p[1]|0,p=p[0]|0),typeof p!="number")throw new Error("gl-fbo: Missing shape parameter");var O=h.getParameter(h.MAX_RENDERBUFFER_SIZE);if(p<0||p>O||k<0||k>O)throw new Error("gl-fbo: Parameters are too large for FBO");w=w||{};var N=1;if("color"in w){if(N=Math.max(w.color|0,0),N<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(N>1)if(R){if(N>h.getParameter(R.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+N+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var V=h.UNSIGNED_BYTE,H=h.getExtension("OES_texture_float");if(w.float&&N>0){if(!H)throw new Error("gl-fbo: Context does not support floating point textures");V=h.FLOAT}else w.preferFloat&&N>0&&H&&(V=h.FLOAT);var F=!0;"depth"in w&&(F=!!w.depth);var U=!1;return"stencil"in w&&(U=!!w.stencil),new C(h,p,k,V,N,F,U,R)}},2272:function(t,e,r){var a=r(2646)[4];r(2478),t.exports=o;function n(i,s,f,x,y,v){var T=s.opposite(x,y);if(!(T<0)){if(y<x){var u=x;x=y,y=u,u=v,v=T,T=u}s.isConstraint(x,y)||a(i[x],i[y],i[v],i[T])<0&&f.push(x,y)}}function o(i,s){for(var f=[],x=i.length,y=s.stars,v=0;v<x;++v)for(var T=y[v],u=1;u<T.length;u+=2){var b=T[u];if(!(b<v)&&!s.isConstraint(v,b)){for(var _=T[u-1],C=-1,M=1;M<T.length;M+=2)if(T[M-1]===b){C=T[M];break}C<0||a(i[v],i[b],i[_],i[C])<0&&f.push(v,b)}}for(;f.length>0;){for(var b=f.pop(),v=f.pop(),_=-1,C=-1,T=y[v],E=1;E<T.length;E+=2){var A=T[E-1],h=T[E];A===b?C=h:h===b&&(_=A)}_<0||C<0||a(i[v],i[b],i[_],i[C])>=0||(s.flip(v,b),n(i,s,f,_,v,C),n(i,s,f,v,C,_),n(i,s,f,C,b,_),n(i,s,f,b,_,C))}}},2334:function(t){t.exports=e;function e(r,a,n){return r[0]=Math.min(a[0],n[0]),r[1]=Math.min(a[1],n[1]),r[2]=Math.min(a[2],n[2]),r[3]=Math.min(a[3],n[3]),r}},2335:function(t){t.exports=e;function e(r){var a=new Float32Array(4);return a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a}},2361:function(t){var e=!1;if(typeof Float64Array<"u"){var r=new Float64Array(1),a=new Uint32Array(r.buffer);if(r[0]=1,e=!0,a[1]===1072693248){let o=function(f,x){return a[0]=f,a[1]=x,r[0]},i=function(f){return r[0]=f,a[0]},s=function(f){return r[0]=f,a[1]};t.exports=function(f){return r[0]=f,[a[0],a[1]]},t.exports.pack=o,t.exports.lo=i,t.exports.hi=s}else if(a[0]===1072693248){let o=function(f,x){return a[1]=f,a[0]=x,r[0]},i=function(f){return r[0]=f,a[1]},s=function(f){return r[0]=f,a[0]};t.exports=function(f){return r[0]=f,[a[1],a[0]]},t.exports.pack=o,t.exports.lo=i,t.exports.hi=s}else e=!1}if(!e){let o=function(f,x){return n.writeUInt32LE(f,0,!0),n.writeUInt32LE(x,4,!0),n.readDoubleLE(0,!0)},i=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=i,t.exports.hi=s}t.exports.sign=function(o){return t.exports.hi(o)>>>31},t.exports.exponent=function(o){var i=t.exports.hi(o);return(i<<1>>>21)-1023},t.exports.fraction=function(o){var i=t.exports.lo(o),s=t.exports.hi(o),f=s&(1<<20)-1;return s&2146435072&&(f+=1048576),[i,f]},t.exports.denormalized=function(o){var i=t.exports.hi(o);return!(i&2146435072)}},2408:function(t){t.exports=e;function e(r,a,n){var o=Math.sin(n),i=Math.cos(n),s=a[0],f=a[1],x=a[2],y=a[3],v=a[8],T=a[9],u=a[10],b=a[11];return a!==r&&(r[4]=a[4],r[5]=a[5],r[6]=a[6],r[7]=a[7],r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15]),r[0]=s*i-v*o,r[1]=f*i-T*o,r[2]=x*i-u*o,r[3]=y*i-b*o,r[8]=s*o+v*i,r[9]=f*o+T*i,r[10]=x*o+u*i,r[11]=y*o+b*i,r}},2419:function(t){t.exports=e;function e(r){for(var a=1,n=1;n<r.length;++n)for(var o=0;o<n;++o)if(r[n]<r[o])a=-a;else if(r[o]===r[n])return 0;return a}},2447:function(t){t.exports=e;function e(r,a){return r[0]=Math.round(a[0]),r[1]=Math.round(a[1]),r[2]=Math.round(a[2]),r}},2455:function(t,e){function r(){function o(f,x,y,v,T,u,b,_,C,M,E){for(var A=2*f,h=v,p=A*v;h<T;++h,p+=A){var k=u[x+p],w=u[x+p+f],R=b[h];t:for(var O=_,N=A*_;O<C;++O,N+=A){var V=M[x+N],H=M[x+N+f],F=E[O];if(!(H<k||w<V)){for(var U=x+1;U<f;++U){var W=u[U+p],q=u[U+f+p],X=M[U+N],lt=M[U+f+N];if(q<X||lt<W)continue t}var yt=y(R,F);if(yt!==void 0)return yt}}}}function i(f,x,y,v,T,u,b,_,C,M,E){for(var A=2*f,h=_,p=A*_;h<C;++h,p+=A){var k=M[x+p],w=M[x+p+f],R=E[h];t:for(var O=v,N=A*v;O<T;++O,N+=A){var V=u[x+N],H=u[x+N+f],F=b[O];if(!(w<V||H<k)){for(var U=x+1;U<f;++U){var W=u[U+N],q=u[U+f+N],X=M[U+p],lt=M[U+f+p];if(q<X||lt<W)continue t}var yt=y(F,R);if(yt!==void 0)return yt}}}}function s(f,x,y,v,T,u,b,_,C,M,E){return T-v>C-_?o(f,x,y,v,T,u,b,_,C,M,E):i(f,x,y,v,T,u,b,_,C,M,E)}return s}function a(){function o(y,v,T,u,b,_,C,M,E,A,h){for(var p=2*y,k=u,w=p*u;k<b;++k,w+=p){var R=_[v+w],O=_[v+w+y],N=C[k];t:for(var V=M,H=p*M;V<E;++V,H+=p){var F=A[v+H],U=h[V];if(!(F<=R||O<F)){for(var W=v+1;W<y;++W){var q=_[W+w],X=_[W+y+w],lt=A[W+H],yt=A[W+y+H];if(X<lt||yt<q)continue t}var pt=T(U,N);if(pt!==void 0)return pt}}}}function i(y,v,T,u,b,_,C,M,E,A,h){for(var p=2*y,k=u,w=p*u;k<b;++k,w+=p){var R=_[v+w],O=_[v+w+y],N=C[k];t:for(var V=M,H=p*M;V<E;++V,H+=p){var F=A[v+H],U=h[V];if(!(F<R||O<F)){for(var W=v+1;W<y;++W){var q=_[W+w],X=_[W+y+w],lt=A[W+H],yt=A[W+y+H];if(X<lt||yt<q)continue t}var pt=T(N,U);if(pt!==void 0)return pt}}}}function s(y,v,T,u,b,_,C,M,E,A,h){for(var p=2*y,k=M,w=p*M;k<E;++k,w+=p){var R=A[v+w],O=h[k];t:for(var N=u,V=p*u;N<b;++N,V+=p){var H=_[v+V],F=_[v+V+y],U=C[N];if(!(R<=H||F<R)){for(var W=v+1;W<y;++W){var q=_[W+V],X=_[W+y+V],lt=A[W+w],yt=A[W+y+w];if(X<lt||yt<q)continue t}var pt=T(O,U);if(pt!==void 0)return pt}}}}function f(y,v,T,u,b,_,C,M,E,A,h){for(var p=2*y,k=M,w=p*M;k<E;++k,w+=p){var R=A[v+w],O=h[k];t:for(var N=u,V=p*u;N<b;++N,V+=p){var H=_[v+V],F=_[v+V+y],U=C[N];if(!(R<H||F<R)){for(var W=v+1;W<y;++W){var q=_[W+V],X=_[W+y+V],lt=A[W+w],yt=A[W+y+w];if(X<lt||yt<q)continue t}var pt=T(U,O);if(pt!==void 0)return pt}}}}function x(y,v,T,u,b,_,C,M,E,A,h,p){return _-b>A-E?u?o(y,v,T,b,_,C,M,E,A,h,p):i(y,v,T,b,_,C,M,E,A,h,p):u?s(y,v,T,b,_,C,M,E,A,h,p):f(y,v,T,b,_,C,M,E,A,h,p)}return x}function n(o){return o?r():a()}e.partial=n(!1),e.full=n(!0)},2478:function(t){function e(s,f,x,y,v){for(var T=v+1;y<=v;){var u=y+v>>>1,b=s[u],_=x!==void 0?x(b,f):b-f;_>=0?(T=u,v=u-1):y=u+1}return T}function r(s,f,x,y,v){for(var T=v+1;y<=v;){var u=y+v>>>1,b=s[u],_=x!==void 0?x(b,f):b-f;_>0?(T=u,v=u-1):y=u+1}return T}function a(s,f,x,y,v){for(var T=y-1;y<=v;){var u=y+v>>>1,b=s[u],_=x!==void 0?x(b,f):b-f;_<0?(T=u,y=u+1):v=u-1}return T}function n(s,f,x,y,v){for(var T=y-1;y<=v;){var u=y+v>>>1,b=s[u],_=x!==void 0?x(b,f):b-f;_<=0?(T=u,y=u+1):v=u-1}return T}function o(s,f,x,y,v){for(;y<=v;){var T=y+v>>>1,u=s[T],b=x!==void 0?x(u,f):u-f;if(b===0)return T;b<=0?y=T+1:v=T-1}return-1}function i(s,f,x,y,v,T){return typeof x=="function"?T(s,f,x,y===void 0?0:y|0,v===void 0?s.length-1:v|0):T(s,f,void 0,x===void 0?0:x|0,y===void 0?s.length-1:y|0)}t.exports={ge:function(s,f,x,y,v){return i(s,f,x,y,v,e)},gt:function(s,f,x,y,v){return i(s,f,x,y,v,r)},lt:function(s,f,x,y,v){return i(s,f,x,y,v,a)},le:function(s,f,x,y,v){return i(s,f,x,y,v,n)},eq:function(s,f,x,y,v){return i(s,f,x,y,v,o)}}},2504:function(t){t.exports=e;function e(r,a,n){var o=n[0],i=n[1],s=n[2];return r[0]=a[0]*o,r[1]=a[1]*o,r[2]=a[2]*o,r[3]=a[3]*o,r[4]=a[4]*i,r[5]=a[5]*i,r[6]=a[6]*i,r[7]=a[7]*i,r[8]=a[8]*s,r[9]=a[9]*s,r[10]=a[10]*s,r[11]=a[11]*s,r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15],r}},2538:function(t,e,r){var a=r(8902),n=r(5542),o=r(2272),i=r(5023);t.exports=v;function s(T){return[Math.min(T[0],T[1]),Math.max(T[0],T[1])]}function f(T,u){return T[0]-u[0]||T[1]-u[1]}function x(T){return T.map(s).sort(f)}function y(T,u,b){return u in T?T[u]:b}function v(T,u,b){Array.isArray(u)?(b=b||{},u=u||[]):(b=u||{},u=[]);var _=!!y(b,"delaunay",!0),C=!!y(b,"interior",!0),M=!!y(b,"exterior",!0),E=!!y(b,"infinity",!1);if(!C&&!M||T.length===0)return[];var A=a(T,u);if(_||C!==M||E){for(var h=n(T.length,x(u)),p=0;p<A.length;++p){var k=A[p];h.addTriangle(k[0],k[1],k[2])}return _&&o(T,h),M?C?E?i(h,0,E):h.cells():i(h,1,E):i(h,-1)}else return A}},2573:function(t){t.exports=e;function e(r,a,n,o){var i=a[0],s=a[1],f=a[2],x=a[3];return r[0]=i+o*(n[0]-i),r[1]=s+o*(n[1]-s),r[2]=f+o*(n[2]-f),r[3]=x+o*(n[3]-x),r}},2613:function(t){t.exports=1e-6},2640:function(t,e,r){var a=r(1888);t.exports=i;var n={"false,0,1":function(s,f,x,y,v){return function(T,u,b,_){var C=T.shape[0]|0,M=T.shape[1]|0,E=T.data,A=T.offset|0,h=T.stride[0]|0,p=T.stride[1]|0,k=A,w,R=-h|0,O=0,N=-p|0,V=0,H=-h-p|0,F=0,U=h|0,W=p-h*C|0,q=0,X=0,lt=0,yt=2*C|0,pt=y(yt),st=y(yt),tt=0,dt=0,rt=-1,at=-1,vt=0,it=-C|0,Y=C|0,ft=0,ut=-C-1|0,wt=C-1|0,zt=0,Pt=0,Wt=0;for(q=0;q<C;++q)pt[tt++]=x(E[k],u,b,_),k+=U;if(k+=W,M>0){if(X=1,pt[tt++]=x(E[k],u,b,_),k+=U,C>0)for(q=1,w=E[k],dt=pt[tt]=x(w,u,b,_),vt=pt[tt+rt],ft=pt[tt+it],zt=pt[tt+ut],(dt!==vt||dt!==ft||dt!==zt)&&(O=E[k+R],V=E[k+N],F=E[k+H],s(q,X,w,O,V,F,dt,vt,ft,zt,u,b,_),Pt=st[tt]=lt++),tt+=1,k+=U,q=2;q<C;++q)w=E[k],dt=pt[tt]=x(w,u,b,_),vt=pt[tt+rt],ft=pt[tt+it],zt=pt[tt+ut],(dt!==vt||dt!==ft||dt!==zt)&&(O=E[k+R],V=E[k+N],F=E[k+H],s(q,X,w,O,V,F,dt,vt,ft,zt,u,b,_),Pt=st[tt]=lt++,zt!==vt&&f(st[tt+rt],Pt,F,O,zt,vt,u,b,_)),tt+=1,k+=U;for(k+=W,tt=0,Wt=rt,rt=at,at=Wt,Wt=it,it=Y,Y=Wt,Wt=ut,ut=wt,wt=Wt,X=2;X<M;++X){if(pt[tt++]=x(E[k],u,b,_),k+=U,C>0)for(q=1,w=E[k],dt=pt[tt]=x(w,u,b,_),vt=pt[tt+rt],ft=pt[tt+it],zt=pt[tt+ut],(dt!==vt||dt!==ft||dt!==zt)&&(O=E[k+R],V=E[k+N],F=E[k+H],s(q,X,w,O,V,F,dt,vt,ft,zt,u,b,_),Pt=st[tt]=lt++,zt!==ft&&f(st[tt+it],Pt,V,F,ft,zt,u,b,_)),tt+=1,k+=U,q=2;q<C;++q)w=E[k],dt=pt[tt]=x(w,u,b,_),vt=pt[tt+rt],ft=pt[tt+it],zt=pt[tt+ut],(dt!==vt||dt!==ft||dt!==zt)&&(O=E[k+R],V=E[k+N],F=E[k+H],s(q,X,w,O,V,F,dt,vt,ft,zt,u,b,_),Pt=st[tt]=lt++,zt!==ft&&f(st[tt+it],Pt,V,F,ft,zt,u,b,_),zt!==vt&&f(st[tt+rt],Pt,F,O,zt,vt,u,b,_)),tt+=1,k+=U;X&1&&(tt=0),Wt=rt,rt=at,at=Wt,Wt=it,it=Y,Y=Wt,Wt=ut,ut=wt,wt=Wt,k+=W}}v(st),v(pt)}},"false,1,0":function(s,f,x,y,v){return function(T,u,b,_){var C=T.shape[0]|0,M=T.shape[1]|0,E=T.data,A=T.offset|0,h=T.stride[0]|0,p=T.stride[1]|0,k=A,w,R=-h|0,O=0,N=-p|0,V=0,H=-h-p|0,F=0,U=p|0,W=h-p*M|0,q=0,X=0,lt=0,yt=2*M|0,pt=y(yt),st=y(yt),tt=0,dt=0,rt=-1,at=-1,vt=0,it=-M|0,Y=M|0,ft=0,ut=-M-1|0,wt=M-1|0,zt=0,Pt=0,Wt=0;for(X=0;X<M;++X)pt[tt++]=x(E[k],u,b,_),k+=U;if(k+=W,C>0){if(q=1,pt[tt++]=x(E[k],u,b,_),k+=U,M>0)for(X=1,w=E[k],dt=pt[tt]=x(w,u,b,_),ft=pt[tt+it],vt=pt[tt+rt],zt=pt[tt+ut],(dt!==ft||dt!==vt||dt!==zt)&&(O=E[k+R],V=E[k+N],F=E[k+H],s(q,X,w,O,V,F,dt,ft,vt,zt,u,b,_),Pt=st[tt]=lt++),tt+=1,k+=U,X=2;X<M;++X)w=E[k],dt=pt[tt]=x(w,u,b,_),ft=pt[tt+it],vt=pt[tt+rt],zt=pt[tt+ut],(dt!==ft||dt!==vt||dt!==zt)&&(O=E[k+R],V=E[k+N],F=E[k+H],s(q,X,w,O,V,F,dt,ft,vt,zt,u,b,_),Pt=st[tt]=lt++,zt!==vt&&f(st[tt+rt],Pt,V,F,vt,zt,u,b,_)),tt+=1,k+=U;for(k+=W,tt=0,Wt=it,it=Y,Y=Wt,Wt=rt,rt=at,at=Wt,Wt=ut,ut=wt,wt=Wt,q=2;q<C;++q){if(pt[tt++]=x(E[k],u,b,_),k+=U,M>0)for(X=1,w=E[k],dt=pt[tt]=x(w,u,b,_),ft=pt[tt+it],vt=pt[tt+rt],zt=pt[tt+ut],(dt!==ft||dt!==vt||dt!==zt)&&(O=E[k+R],V=E[k+N],F=E[k+H],s(q,X,w,O,V,F,dt,ft,vt,zt,u,b,_),Pt=st[tt]=lt++,zt!==ft&&f(st[tt+it],Pt,F,O,zt,ft,u,b,_)),tt+=1,k+=U,X=2;X<M;++X)w=E[k],dt=pt[tt]=x(w,u,b,_),ft=pt[tt+it],vt=pt[tt+rt],zt=pt[tt+ut],(dt!==ft||dt!==vt||dt!==zt)&&(O=E[k+R],V=E[k+N],F=E[k+H],s(q,X,w,O,V,F,dt,ft,vt,zt,u,b,_),Pt=st[tt]=lt++,zt!==vt&&f(st[tt+rt],Pt,V,F,vt,zt,u,b,_),zt!==ft&&f(st[tt+it],Pt,F,O,zt,ft,u,b,_)),tt+=1,k+=U;q&1&&(tt=0),Wt=it,it=Y,Y=Wt,Wt=rt,rt=at,at=Wt,Wt=ut,ut=wt,wt=Wt,k+=W}}v(st),v(pt)}}};function o(s,f,x,y,v,T){var u=[T,v].join(","),b=n[u];return b(s,f,x,a.mallocUint32,a.freeUint32)}function i(s){function f(_){throw new Error("ndarray-extract-contour: "+_)}typeof s!="object"&&f("Must specify arguments");var x=s.order;Array.isArray(x)||f("Must specify order");var y=s.arrayArguments||1;y<1&&f("Must have at least one array argument");var v=s.scalarArguments||0;v<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 T=s.getters||[],u=new Array(y),b=0;b<y;++b)T.indexOf(b)>=0?u[b]=!0:u[b]=!1;return o(s.vertex,s.cell,s.phase,v,x,u)}},2642:function(t,e,r){t.exports=o;var a=r(727);function n(i){for(var s=0,f=0;f<i.length;++f)s+=i[f];return s}function o(i,s){for(var f=s.length,x=new Array(f+1),y=0;y<f;++y){for(var v=new Array(f+1),T=0;T<=f;++T)v[T]=i[T][y];x[y]=v}x[f]=new Array(f+1);for(var y=0;y<=f;++y)x[f][y]=1;for(var u=new Array(f+1),y=0;y<f;++y)u[y]=s[y];u[f]=1;var b=a(x,u),_=n(b[f+1]);_===0&&(_=1);for(var C=new Array(f+1),y=0;y<=f;++y)C[y]=n(b[y])/_;return C}},2646:function(t,e,r){var a=r(5250),n=r(8210),o=r(8545),i=r(3012),s=6;function f(h){var p=h===3?T:h===4?u:h===5?b:_;return p(n,o,a,i)}function x(){return 0}function y(){return 0}function v(){return 0}function T(h,p,k,w){function R(O,N,V){var H=k(O[0],O[0]),F=w(H,N[0]),U=w(H,V[0]),W=k(N[0],N[0]),q=w(W,O[0]),X=w(W,V[0]),lt=k(V[0],V[0]),yt=w(lt,O[0]),pt=w(lt,N[0]),st=h(p(pt,X),p(q,F)),tt=p(yt,U),dt=p(st,tt);return dt[dt.length-1]}return R}function u(h,p,k,w){function R(O,N,V,H){var F=h(k(O[0],O[0]),k(O[1],O[1])),U=w(F,N[0]),W=w(F,V[0]),q=w(F,H[0]),X=h(k(N[0],N[0]),k(N[1],N[1])),lt=w(X,O[0]),yt=w(X,V[0]),pt=w(X,H[0]),st=h(k(V[0],V[0]),k(V[1],V[1])),tt=w(st,O[0]),dt=w(st,N[0]),rt=w(st,H[0]),at=h(k(H[0],H[0]),k(H[1],H[1])),vt=w(at,O[0]),it=w(at,N[0]),Y=w(at,V[0]),ft=h(h(w(p(Y,rt),N[1]),h(w(p(it,pt),-V[1]),w(p(dt,yt),H[1]))),h(w(p(it,pt),O[1]),h(w(p(vt,q),-N[1]),w(p(lt,U),H[1])))),ut=h(h(w(p(Y,rt),O[1]),h(w(p(vt,q),-V[1]),w(p(tt,W),H[1]))),h(w(p(dt,yt),O[1]),h(w(p(tt,W),-N[1]),w(p(lt,U),V[1])))),wt=p(ft,ut);return wt[wt.length-1]}return R}function b(h,p,k,w){function R(O,N,V,H,F){var U=h(k(O[0],O[0]),h(k(O[1],O[1]),k(O[2],O[2]))),W=w(U,N[0]),q=w(U,V[0]),X=w(U,H[0]),lt=w(U,F[0]),yt=h(k(N[0],N[0]),h(k(N[1],N[1]),k(N[2],N[2]))),pt=w(yt,O[0]),st=w(yt,V[0]),tt=w(yt,H[0]),dt=w(yt,F[0]),rt=h(k(V[0],V[0]),h(k(V[1],V[1]),k(V[2],V[2]))),at=w(rt,O[0]),vt=w(rt,N[0]),it=w(rt,H[0]),Y=w(rt,F[0]),ft=h(k(H[0],H[0]),h(k(H[1],H[1]),k(H[2],H[2]))),ut=w(ft,O[0]),wt=w(ft,N[0]),zt=w(ft,V[0]),Pt=w(ft,F[0]),Wt=h(k(F[0],F[0]),h(k(F[1],F[1]),k(F[2],F[2]))),Ht=w(Wt,O[0]),Jt=w(Wt,N[0]),ge=w(Wt,V[0]),he=w(Wt,H[0]),de=h(h(h(w(h(w(p(he,Pt),V[1]),h(w(p(ge,Y),-H[1]),w(p(zt,it),F[1]))),N[2]),h(w(h(w(p(he,Pt),N[1]),h(w(p(Jt,dt),-H[1]),w(p(wt,tt),F[1]))),-V[2]),w(h(w(p(ge,Y),N[1]),h(w(p(Jt,dt),-V[1]),w(p(vt,st),F[1]))),H[2]))),h(w(h(w(p(zt,it),N[1]),h(w(p(wt,tt),-V[1]),w(p(vt,st),H[1]))),-F[2]),h(w(h(w(p(he,Pt),N[1]),h(w(p(Jt,dt),-H[1]),w(p(wt,tt),F[1]))),O[2]),w(h(w(p(he,Pt),O[1]),h(w(p(Ht,lt),-H[1]),w(p(ut,X),F[1]))),-N[2])))),h(h(w(h(w(p(Jt,dt),O[1]),h(w(p(Ht,lt),-N[1]),w(p(pt,W),F[1]))),H[2]),h(w(h(w(p(wt,tt),O[1]),h(w(p(ut,X),-N[1]),w(p(pt,W),H[1]))),-F[2]),w(h(w(p(zt,it),N[1]),h(w(p(wt,tt),-V[1]),w(p(vt,st),H[1]))),O[2]))),h(w(h(w(p(zt,it),O[1]),h(w(p(ut,X),-V[1]),w(p(at,q),H[1]))),-N[2]),h(w(h(w(p(wt,tt),O[1]),h(w(p(ut,X),-N[1]),w(p(pt,W),H[1]))),V[2]),w(h(w(p(vt,st),O[1]),h(w(p(at,q),-N[1]),w(p(pt,W),V[1]))),-H[2]))))),se=h(h(h(w(h(w(p(he,Pt),V[1]),h(w(p(ge,Y),-H[1]),w(p(zt,it),F[1]))),O[2]),w(h(w(p(he,Pt),O[1]),h(w(p(Ht,lt),-H[1]),w(p(ut,X),F[1]))),-V[2])),h(w(h(w(p(ge,Y),O[1]),h(w(p(Ht,lt),-V[1]),w(p(at,q),F[1]))),H[2]),w(h(w(p(zt,it),O[1]),h(w(p(ut,X),-V[1]),w(p(at,q),H[1]))),-F[2]))),h(h(w(h(w(p(ge,Y),N[1]),h(w(p(Jt,dt),-V[1]),w(p(vt,st),F[1]))),O[2]),w(h(w(p(ge,Y),O[1]),h(w(p(Ht,lt),-V[1]),w(p(at,q),F[1]))),-N[2])),h(w(h(w(p(Jt,dt),O[1]),h(w(p(Ht,lt),-N[1]),w(p(pt,W),F[1]))),V[2]),w(h(w(p(vt,st),O[1]),h(w(p(at,q),-N[1]),w(p(pt,W),V[1]))),-F[2])))),Tt=p(de,se);return Tt[Tt.length-1]}return R}function _(h,p,k,w){function R(O,N,V,H,F,U){var W=h(h(k(O[0],O[0]),k(O[1],O[1])),h(k(O[2],O[2]),k(O[3],O[3]))),q=w(W,N[0]),X=w(W,V[0]),lt=w(W,H[0]),yt=w(W,F[0]),pt=w(W,U[0]),st=h(h(k(N[0],N[0]),k(N[1],N[1])),h(k(N[2],N[2]),k(N[3],N[3]))),tt=w(st,O[0]),dt=w(st,V[0]),rt=w(st,H[0]),at=w(st,F[0]),vt=w(st,U[0]),it=h(h(k(V[0],V[0]),k(V[1],V[1])),h(k(V[2],V[2]),k(V[3],V[3]))),Y=w(it,O[0]),ft=w(it,N[0]),ut=w(it,H[0]),wt=w(it,F[0]),zt=w(it,U[0]),Pt=h(h(k(H[0],H[0]),k(H[1],H[1])),h(k(H[2],H[2]),k(H[3],H[3]))),Wt=w(Pt,O[0]),Ht=w(Pt,N[0]),Jt=w(Pt,V[0]),ge=w(Pt,F[0]),he=w(Pt,U[0]),de=h(h(k(F[0],F[0]),k(F[1],F[1])),h(k(F[2],F[2]),k(F[3],F[3]))),se=w(de,O[0]),Tt=w(de,N[0]),Lt=w(de,V[0]),Mt=w(de,H[0]),te=w(de,U[0]),ve=h(h(k(U[0],U[0]),k(U[1],U[1])),h(k(U[2],U[2]),k(U[3],U[3]))),oe=w(ve,O[0]),Te=w(ve,N[0]),He=w(ve,V[0]),Ge=w(ve,H[0]),cr=w(ve,F[0]),ur=h(h(h(w(h(h(w(h(w(p(cr,te),H[1]),h(w(p(Ge,he),-F[1]),w(p(Mt,ge),U[1]))),V[2]),w(h(w(p(cr,te),V[1]),h(w(p(He,zt),-F[1]),w(p(Lt,wt),U[1]))),-H[2])),h(w(h(w(p(Ge,he),V[1]),h(w(p(He,zt),-H[1]),w(p(Jt,ut),U[1]))),F[2]),w(h(w(p(Mt,ge),V[1]),h(w(p(Lt,wt),-H[1]),w(p(Jt,ut),F[1]))),-U[2]))),N[3]),h(w(h(h(w(h(w(p(cr,te),H[1]),h(w(p(Ge,he),-F[1]),w(p(Mt,ge),U[1]))),N[2]),w(h(w(p(cr,te),N[1]),h(w(p(Te,vt),-F[1]),w(p(Tt,at),U[1]))),-H[2])),h(w(h(w(p(Ge,he),N[1]),h(w(p(Te,vt),-H[1]),w(p(Ht,rt),U[1]))),F[2]),w(h(w(p(Mt,ge),N[1]),h(w(p(Tt,at),-H[1]),w(p(Ht,rt),F[1]))),-U[2]))),-V[3]),w(h(h(w(h(w(p(cr,te),V[1]),h(w(p(He,zt),-F[1]),w(p(Lt,wt),U[1]))),N[2]),w(h(w(p(cr,te),N[1]),h(w(p(Te,vt),-F[1]),w(p(Tt,at),U[1]))),-V[2])),h(w(h(w(p(He,zt),N[1]),h(w(p(Te,vt),-V[1]),w(p(ft,dt),U[1]))),F[2]),w(h(w(p(Lt,wt),N[1]),h(w(p(Tt,at),-V[1]),w(p(ft,dt),F[1]))),-U[2]))),H[3]))),h(h(w(h(h(w(h(w(p(Ge,he),V[1]),h(w(p(He,zt),-H[1]),w(p(Jt,ut),U[1]))),N[2]),w(h(w(p(Ge,he),N[1]),h(w(p(Te,vt),-H[1]),w(p(Ht,rt),U[1]))),-V[2])),h(w(h(w(p(He,zt),N[1]),h(w(p(Te,vt),-V[1]),w(p(ft,dt),U[1]))),H[2]),w(h(w(p(Jt,ut),N[1]),h(w(p(Ht,rt),-V[1]),w(p(ft,dt),H[1]))),-U[2]))),-F[3]),w(h(h(w(h(w(p(Mt,ge),V[1]),h(w(p(Lt,wt),-H[1]),w(p(Jt,ut),F[1]))),N[2]),w(h(w(p(Mt,ge),N[1]),h(w(p(Tt,at),-H[1]),w(p(Ht,rt),F[1]))),-V[2])),h(w(h(w(p(Lt,wt),N[1]),h(w(p(Tt,at),-V[1]),w(p(ft,dt),F[1]))),H[2]),w(h(w(p(Jt,ut),N[1]),h(w(p(Ht,rt),-V[1]),w(p(ft,dt),H[1]))),-F[2]))),U[3])),h(w(h(h(w(h(w(p(cr,te),H[1]),h(w(p(Ge,he),-F[1]),w(p(Mt,ge),U[1]))),N[2]),w(h(w(p(cr,te),N[1]),h(w(p(Te,vt),-F[1]),w(p(Tt,at),U[1]))),-H[2])),h(w(h(w(p(Ge,he),N[1]),h(w(p(Te,vt),-H[1]),w(p(Ht,rt),U[1]))),F[2]),w(h(w(p(Mt,ge),N[1]),h(w(p(Tt,at),-H[1]),w(p(Ht,rt),F[1]))),-U[2]))),O[3]),w(h(h(w(h(w(p(cr,te),H[1]),h(w(p(Ge,he),-F[1]),w(p(Mt,ge),U[1]))),O[2]),w(h(w(p(cr,te),O[1]),h(w(p(oe,pt),-F[1]),w(p(se,yt),U[1]))),-H[2])),h(w(h(w(p(Ge,he),O[1]),h(w(p(oe,pt),-H[1]),w(p(Wt,lt),U[1]))),F[2]),w(h(w(p(Mt,ge),O[1]),h(w(p(se,yt),-H[1]),w(p(Wt,lt),F[1]))),-U[2]))),-N[3])))),h(h(h(w(h(h(w(h(w(p(cr,te),N[1]),h(w(p(Te,vt),-F[1]),w(p(Tt,at),U[1]))),O[2]),w(h(w(p(cr,te),O[1]),h(w(p(oe,pt),-F[1]),w(p(se,yt),U[1]))),-N[2])),h(w(h(w(p(Te,vt),O[1]),h(w(p(oe,pt),-N[1]),w(p(tt,q),U[1]))),F[2]),w(h(w(p(Tt,at),O[1]),h(w(p(se,yt),-N[1]),w(p(tt,q),F[1]))),-U[2]))),H[3]),w(h(h(w(h(w(p(Ge,he),N[1]),h(w(p(Te,vt),-H[1]),w(p(Ht,rt),U[1]))),O[2]),w(h(w(p(Ge,he),O[1]),h(w(p(oe,pt),-H[1]),w(p(Wt,lt),U[1]))),-N[2])),h(w(h(w(p(Te,vt),O[1]),h(w(p(oe,pt),-N[1]),w(p(tt,q),U[1]))),H[2]),w(h(w(p(Ht,rt),O[1]),h(w(p(Wt,lt),-N[1]),w(p(tt,q),H[1]))),-U[2]))),-F[3])),h(w(h(h(w(h(w(p(Mt,ge),N[1]),h(w(p(Tt,at),-H[1]),w(p(Ht,rt),F[1]))),O[2]),w(h(w(p(Mt,ge),O[1]),h(w(p(se,yt),-H[1]),w(p(Wt,lt),F[1]))),-N[2])),h(w(h(w(p(Tt,at),O[1]),h(w(p(se,yt),-N[1]),w(p(tt,q),F[1]))),H[2]),w(h(w(p(Ht,rt),O[1]),h(w(p(Wt,lt),-N[1]),w(p(tt,q),H[1]))),-F[2]))),U[3]),w(h(h(w(h(w(p(Ge,he),V[1]),h(w(p(He,zt),-H[1]),w(p(Jt,ut),U[1]))),N[2]),w(h(w(p(Ge,he),N[1]),h(w(p(Te,vt),-H[1]),w(p(Ht,rt),U[1]))),-V[2])),h(w(h(w(p(He,zt),N[1]),h(w(p(Te,vt),-V[1]),w(p(ft,dt),U[1]))),H[2]),w(h(w(p(Jt,ut),N[1]),h(w(p(Ht,rt),-V[1]),w(p(ft,dt),H[1]))),-U[2]))),O[3]))),h(h(w(h(h(w(h(w(p(Ge,he),V[1]),h(w(p(He,zt),-H[1]),w(p(Jt,ut),U[1]))),O[2]),w(h(w(p(Ge,he),O[1]),h(w(p(oe,pt),-H[1]),w(p(Wt,lt),U[1]))),-V[2])),h(w(h(w(p(He,zt),O[1]),h(w(p(oe,pt),-V[1]),w(p(Y,X),U[1]))),H[2]),w(h(w(p(Jt,ut),O[1]),h(w(p(Wt,lt),-V[1]),w(p(Y,X),H[1]))),-U[2]))),-N[3]),w(h(h(w(h(w(p(Ge,he),N[1]),h(w(p(Te,vt),-H[1]),w(p(Ht,rt),U[1]))),O[2]),w(h(w(p(Ge,he),O[1]),h(w(p(oe,pt),-H[1]),w(p(Wt,lt),U[1]))),-N[2])),h(w(h(w(p(Te,vt),O[1]),h(w(p(oe,pt),-N[1]),w(p(tt,q),U[1]))),H[2]),w(h(w(p(Ht,rt),O[1]),h(w(p(Wt,lt),-N[1]),w(p(tt,q),H[1]))),-U[2]))),V[3])),h(w(h(h(w(h(w(p(He,zt),N[1]),h(w(p(Te,vt),-V[1]),w(p(ft,dt),U[1]))),O[2]),w(h(w(p(He,zt),O[1]),h(w(p(oe,pt),-V[1]),w(p(Y,X),U[1]))),-N[2])),h(w(h(w(p(Te,vt),O[1]),h(w(p(oe,pt),-N[1]),w(p(tt,q),U[1]))),V[2]),w(h(w(p(ft,dt),O[1]),h(w(p(Y,X),-N[1]),w(p(tt,q),V[1]))),-U[2]))),-H[3]),w(h(h(w(h(w(p(Jt,ut),N[1]),h(w(p(Ht,rt),-V[1]),w(p(ft,dt),H[1]))),O[2]),w(h(w(p(Jt,ut),O[1]),h(w(p(Wt,lt),-V[1]),w(p(Y,X),H[1]))),-N[2])),h(w(h(w(p(Ht,rt),O[1]),h(w(p(Wt,lt),-N[1]),w(p(tt,q),H[1]))),V[2]),w(h(w(p(ft,dt),O[1]),h(w(p(Y,X),-N[1]),w(p(tt,q),V[1]))),-H[2]))),U[3]))))),jr=h(h(h(w(h(h(w(h(w(p(cr,te),H[1]),h(w(p(Ge,he),-F[1]),w(p(Mt,ge),U[1]))),V[2]),w(h(w(p(cr,te),V[1]),h(w(p(He,zt),-F[1]),w(p(Lt,wt),U[1]))),-H[2])),h(w(h(w(p(Ge,he),V[1]),h(w(p(He,zt),-H[1]),w(p(Jt,ut),U[1]))),F[2]),w(h(w(p(Mt,ge),V[1]),h(w(p(Lt,wt),-H[1]),w(p(Jt,ut),F[1]))),-U[2]))),O[3]),h(w(h(h(w(h(w(p(cr,te),H[1]),h(w(p(Ge,he),-F[1]),w(p(Mt,ge),U[1]))),O[2]),w(h(w(p(cr,te),O[1]),h(w(p(oe,pt),-F[1]),w(p(se,yt),U[1]))),-H[2])),h(w(h(w(p(Ge,he),O[1]),h(w(p(oe,pt),-H[1]),w(p(Wt,lt),U[1]))),F[2]),w(h(w(p(Mt,ge),O[1]),h(w(p(se,yt),-H[1]),w(p(Wt,lt),F[1]))),-U[2]))),-V[3]),w(h(h(w(h(w(p(cr,te),V[1]),h(w(p(He,zt),-F[1]),w(p(Lt,wt),U[1]))),O[2]),w(h(w(p(cr,te),O[1]),h(w(p(oe,pt),-F[1]),w(p(se,yt),U[1]))),-V[2])),h(w(h(w(p(He,zt),O[1]),h(w(p(oe,pt),-V[1]),w(p(Y,X),U[1]))),F[2]),w(h(w(p(Lt,wt),O[1]),h(w(p(se,yt),-V[1]),w(p(Y,X),F[1]))),-U[2]))),H[3]))),h(h(w(h(h(w(h(w(p(Ge,he),V[1]),h(w(p(He,zt),-H[1]),w(p(Jt,ut),U[1]))),O[2]),w(h(w(p(Ge,he),O[1]),h(w(p(oe,pt),-H[1]),w(p(Wt,lt),U[1]))),-V[2])),h(w(h(w(p(He,zt),O[1]),h(w(p(oe,pt),-V[1]),w(p(Y,X),U[1]))),H[2]),w(h(w(p(Jt,ut),O[1]),h(w(p(Wt,lt),-V[1]),w(p(Y,X),H[1]))),-U[2]))),-F[3]),w(h(h(w(h(w(p(Mt,ge),V[1]),h(w(p(Lt,wt),-H[1]),w(p(Jt,ut),F[1]))),O[2]),w(h(w(p(Mt,ge),O[1]),h(w(p(se,yt),-H[1]),w(p(Wt,lt),F[1]))),-V[2])),h(w(h(w(p(Lt,wt),O[1]),h(w(p(se,yt),-V[1]),w(p(Y,X),F[1]))),H[2]),w(h(w(p(Jt,ut),O[1]),h(w(p(Wt,lt),-V[1]),w(p(Y,X),H[1]))),-F[2]))),U[3])),h(w(h(h(w(h(w(p(cr,te),V[1]),h(w(p(He,zt),-F[1]),w(p(Lt,wt),U[1]))),N[2]),w(h(w(p(cr,te),N[1]),h(w(p(Te,vt),-F[1]),w(p(Tt,at),U[1]))),-V[2])),h(w(h(w(p(He,zt),N[1]),h(w(p(Te,vt),-V[1]),w(p(ft,dt),U[1]))),F[2]),w(h(w(p(Lt,wt),N[1]),h(w(p(Tt,at),-V[1]),w(p(ft,dt),F[1]))),-U[2]))),O[3]),w(h(h(w(h(w(p(cr,te),V[1]),h(w(p(He,zt),-F[1]),w(p(Lt,wt),U[1]))),O[2]),w(h(w(p(cr,te),O[1]),h(w(p(oe,pt),-F[1]),w(p(se,yt),U[1]))),-V[2])),h(w(h(w(p(He,zt),O[1]),h(w(p(oe,pt),-V[1]),w(p(Y,X),U[1]))),F[2]),w(h(w(p(Lt,wt),O[1]),h(w(p(se,yt),-V[1]),w(p(Y,X),F[1]))),-U[2]))),-N[3])))),h(h(h(w(h(h(w(h(w(p(cr,te),N[1]),h(w(p(Te,vt),-F[1]),w(p(Tt,at),U[1]))),O[2]),w(h(w(p(cr,te),O[1]),h(w(p(oe,pt),-F[1]),w(p(se,yt),U[1]))),-N[2])),h(w(h(w(p(Te,vt),O[1]),h(w(p(oe,pt),-N[1]),w(p(tt,q),U[1]))),F[2]),w(h(w(p(Tt,at),O[1]),h(w(p(se,yt),-N[1]),w(p(tt,q),F[1]))),-U[2]))),V[3]),w(h(h(w(h(w(p(He,zt),N[1]),h(w(p(Te,vt),-V[1]),w(p(ft,dt),U[1]))),O[2]),w(h(w(p(He,zt),O[1]),h(w(p(oe,pt),-V[1]),w(p(Y,X),U[1]))),-N[2])),h(w(h(w(p(Te,vt),O[1]),h(w(p(oe,pt),-N[1]),w(p(tt,q),U[1]))),V[2]),w(h(w(p(ft,dt),O[1]),h(w(p(Y,X),-N[1]),w(p(tt,q),V[1]))),-U[2]))),-F[3])),h(w(h(h(w(h(w(p(Lt,wt),N[1]),h(w(p(Tt,at),-V[1]),w(p(ft,dt),F[1]))),O[2]),w(h(w(p(Lt,wt),O[1]),h(w(p(se,yt),-V[1]),w(p(Y,X),F[1]))),-N[2])),h(w(h(w(p(Tt,at),O[1]),h(w(p(se,yt),-N[1]),w(p(tt,q),F[1]))),V[2]),w(h(w(p(ft,dt),O[1]),h(w(p(Y,X),-N[1]),w(p(tt,q),V[1]))),-F[2]))),U[3]),w(h(h(w(h(w(p(Mt,ge),V[1]),h(w(p(Lt,wt),-H[1]),w(p(Jt,ut),F[1]))),N[2]),w(h(w(p(Mt,ge),N[1]),h(w(p(Tt,at),-H[1]),w(p(Ht,rt),F[1]))),-V[2])),h(w(h(w(p(Lt,wt),N[1]),h(w(p(Tt,at),-V[1]),w(p(ft,dt),F[1]))),H[2]),w(h(w(p(Jt,ut),N[1]),h(w(p(Ht,rt),-V[1]),w(p(ft,dt),H[1]))),-F[2]))),O[3]))),h(h(w(h(h(w(h(w(p(Mt,ge),V[1]),h(w(p(Lt,wt),-H[1]),w(p(Jt,ut),F[1]))),O[2]),w(h(w(p(Mt,ge),O[1]),h(w(p(se,yt),-H[1]),w(p(Wt,lt),F[1]))),-V[2])),h(w(h(w(p(Lt,wt),O[1]),h(w(p(se,yt),-V[1]),w(p(Y,X),F[1]))),H[2]),w(h(w(p(Jt,ut),O[1]),h(w(p(Wt,lt),-V[1]),w(p(Y,X),H[1]))),-F[2]))),-N[3]),w(h(h(w(h(w(p(Mt,ge),N[1]),h(w(p(Tt,at),-H[1]),w(p(Ht,rt),F[1]))),O[2]),w(h(w(p(Mt,ge),O[1]),h(w(p(se,yt),-H[1]),w(p(Wt,lt),F[1]))),-N[2])),h(w(h(w(p(Tt,at),O[1]),h(w(p(se,yt),-N[1]),w(p(tt,q),F[1]))),H[2]),w(h(w(p(Ht,rt),O[1]),h(w(p(Wt,lt),-N[1]),w(p(tt,q),H[1]))),-F[2]))),V[3])),h(w(h(h(w(h(w(p(Lt,wt),N[1]),h(w(p(Tt,at),-V[1]),w(p(ft,dt),F[1]))),O[2]),w(h(w(p(Lt,wt),O[1]),h(w(p(se,yt),-V[1]),w(p(Y,X),F[1]))),-N[2])),h(w(h(w(p(Tt,at),O[1]),h(w(p(se,yt),-N[1]),w(p(tt,q),F[1]))),V[2]),w(h(w(p(ft,dt),O[1]),h(w(p(Y,X),-N[1]),w(p(tt,q),V[1]))),-F[2]))),-H[3]),w(h(h(w(h(w(p(Jt,ut),N[1]),h(w(p(Ht,rt),-V[1]),w(p(ft,dt),H[1]))),O[2]),w(h(w(p(Jt,ut),O[1]),h(w(p(Wt,lt),-V[1]),w(p(Y,X),H[1]))),-N[2])),h(w(h(w(p(Ht,rt),O[1]),h(w(p(Wt,lt),-N[1]),w(p(tt,q),H[1]))),V[2]),w(h(w(p(ft,dt),O[1]),h(w(p(Y,X),-N[1]),w(p(tt,q),V[1]))),-H[2]))),F[3]))))),Hr=p(ur,jr);return Hr[Hr.length-1]}return R}var C=[x,y,v];function M(h){var p=C[h.length];return p||(p=C[h.length]=f(h.length)),p.apply(void 0,h)}function E(h,p,k,w,R,O,N,V){function H(F,U,W,q,X,lt){switch(arguments.length){case 0:case 1:return 0;case 2:return w(F,U);case 3:return R(F,U,W);case 4:return O(F,U,W,q);case 5:return N(F,U,W,q,X);case 6:return V(F,U,W,q,X,lt)}for(var yt=new Array(arguments.length),pt=0;pt<arguments.length;++pt)yt[pt]=arguments[pt];return h(yt)}return H}function A(){for(;C.length<=s;)C.push(f(C.length));t.exports=E.apply(void 0,[M].concat(C));for(var h=0;h<=s;++h)t.exports[h]=C[h]}A()},2651:function(t,e,r){var a=r(6859),n=r(2361);t.exports=o;function o(i){var s=n.exponent(i);return s<52?new a(i):new a(i*Math.pow(2,52-s)).ushln(s-52)}},2652:function(t,e,r){var a=r(4335),n=r(6864),o=r(1903),i=r(9921),s=r(7608),f=r(5665),x={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},y=n(),v=n(),T=[0,0,0,0],u=[[0,0,0],[0,0,0],[0,0,0]],b=[0,0,0];t.exports=function(E,A,h,p,k,w){if(A||(A=[0,0,0]),h||(h=[0,0,0]),p||(p=[0,0,0]),k||(k=[0,0,0,1]),w||(w=[0,0,0,1]),!a(y,E)||(o(v,y),v[3]=0,v[7]=0,v[11]=0,v[15]=1,Math.abs(i(v)<1e-8)))return!1;var R=y[3],O=y[7],N=y[11],V=y[12],H=y[13],F=y[14],U=y[15];if(R!==0||O!==0||N!==0){T[0]=R,T[1]=O,T[2]=N,T[3]=U;var W=s(v,v);if(!W)return!1;f(v,v),_(k,T,v)}else k[0]=k[1]=k[2]=0,k[3]=1;if(A[0]=V,A[1]=H,A[2]=F,C(u,y),h[0]=x.length(u[0]),x.normalize(u[0],u[0]),p[0]=x.dot(u[0],u[1]),M(u[1],u[1],u[0],1,-p[0]),h[1]=x.length(u[1]),x.normalize(u[1],u[1]),p[0]/=h[1],p[1]=x.dot(u[0],u[2]),M(u[2],u[2],u[0],1,-p[1]),p[2]=x.dot(u[1],u[2]),M(u[2],u[2],u[1],1,-p[2]),h[2]=x.length(u[2]),x.normalize(u[2],u[2]),p[1]/=h[2],p[2]/=h[2],x.cross(b,u[1],u[2]),x.dot(u[0],b)<0)for(var q=0;q<3;q++)h[q]*=-1,u[q][0]*=-1,u[q][1]*=-1,u[q][2]*=-1;return w[0]=.5*Math.sqrt(Math.max(1+u[0][0]-u[1][1]-u[2][2],0)),w[1]=.5*Math.sqrt(Math.max(1-u[0][0]+u[1][1]-u[2][2],0)),w[2]=.5*Math.sqrt(Math.max(1-u[0][0]-u[1][1]+u[2][2],0)),w[3]=.5*Math.sqrt(Math.max(1+u[0][0]+u[1][1]+u[2][2],0)),u[2][1]>u[1][2]&&(w[0]=-w[0]),u[0][2]>u[2][0]&&(w[1]=-w[1]),u[1][0]>u[0][1]&&(w[2]=-w[2]),!0};function _(E,A,h){var p=A[0],k=A[1],w=A[2],R=A[3];return E[0]=h[0]*p+h[4]*k+h[8]*w+h[12]*R,E[1]=h[1]*p+h[5]*k+h[9]*w+h[13]*R,E[2]=h[2]*p+h[6]*k+h[10]*w+h[14]*R,E[3]=h[3]*p+h[7]*k+h[11]*w+h[15]*R,E}function C(E,A){E[0][0]=A[0],E[0][1]=A[1],E[0][2]=A[2],E[1][0]=A[4],E[1][1]=A[5],E[1][2]=A[6],E[2][0]=A[8],E[2][1]=A[9],E[2][2]=A[10]}function M(E,A,h,p,k){E[0]=A[0]*p+h[0]*k,E[1]=A[1]*p+h[1]*k,E[2]=A[2]*p+h[2]*k}},2653:function(t,e,r){var a=r(3865);t.exports=n;function n(o,i){for(var s=o.length,f=new Array(s),x=0;x<s;++x)f[x]=a(o[x],i[x]);return f}},2681:function(t){t.exports=e;function e(r,a){return r[0]=Math.floor(a[0]),r[1]=Math.floor(a[1]),r[2]=Math.floor(a[2]),r}},2690:function(t,e,r){t.exports=s;var a=r(8954),n=r(3952);function o(f,x){for(var y=f.length,v=new Array(y),T=0;T<x.length;++T)v[T]=f[x[T]];for(var u=x.length,T=0;T<y;++T)x.indexOf(T)<0&&(v[u++]=f[T]);return v}function i(f,x){for(var y=f.length,v=x.length,T=0;T<y;++T)for(var u=f[T],b=0;b<u.length;++b){var _=u[b];if(_<v)u[b]=x[_];else{_=_-v;for(var C=0;C<v;++C)_>=x[C]&&(_+=1);u[b]=_}}return f}function s(f,x){try{return a(f,!0)}catch{var y=n(f);if(y.length<=x)return[];var v=o(f,y),T=a(v,!0);return i(T,y)}}},2762:function(t,e,r){var a=r(1888),n=r(5298),o=r(9618),i=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(u,b,_,C,M){this.gl=u,this.type=b,this.handle=_,this.length=C,this.usage=M}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 x(u,b,_,C,M,E){var A=M.length*M.BYTES_PER_ELEMENT;if(E<0)return u.bufferData(b,M,C),A;if(A+E>_)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return u.bufferSubData(b,E,M),_}function y(u,b){for(var _=a.malloc(u.length,b),C=u.length,M=0;M<C;++M)_[M]=u[M];return _}function v(u,b){for(var _=1,C=b.length-1;C>=0;--C){if(b[C]!==_)return!1;_*=u[C]}return!0}f.update=function(u,b){if(typeof b!="number"&&(b=-1),this.bind(),typeof u=="object"&&typeof u.shape<"u"){var _=u.dtype;if(i.indexOf(_)<0&&(_="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var C=gl.getExtension("OES_element_index_uint");C&&_!=="uint16"?_="uint32":_="uint16"}if(_===u.dtype&&v(u.shape,u.stride))u.offset===0&&u.data.length===u.shape[0]?this.length=x(this.gl,this.type,this.length,this.usage,u.data,b):this.length=x(this.gl,this.type,this.length,this.usage,u.data.subarray(u.offset,u.shape[0]),b);else{var M=a.malloc(u.size,_),E=o(M,u.shape);n.assign(E,u),b<0?this.length=x(this.gl,this.type,this.length,this.usage,M,b):this.length=x(this.gl,this.type,this.length,this.usage,M.subarray(0,u.size),b),a.free(M)}}else if(Array.isArray(u)){var A;this.type===this.gl.ELEMENT_ARRAY_BUFFER?A=y(u,"uint16"):A=y(u,"float32"),b<0?this.length=x(this.gl,this.type,this.length,this.usage,A,b):this.length=x(this.gl,this.type,this.length,this.usage,A.subarray(0,u.length),b),a.free(A)}else if(typeof u=="object"&&typeof u.length=="number")this.length=x(this.gl,this.type,this.length,this.usage,u,b);else if(typeof u=="number"||u===void 0){if(b>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");u=u|0,u<=0&&(u=1),this.gl.bufferData(this.type,u|0,this.usage),this.length=u}else throw new Error("gl-buffer: Invalid data type")};function T(u,b,_,C){if(_=_||u.ARRAY_BUFFER,C=C||u.DYNAMIC_DRAW,_!==u.ARRAY_BUFFER&&_!==u.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(C!==u.DYNAMIC_DRAW&&C!==u.STATIC_DRAW&&C!==u.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 M=u.createBuffer(),E=new s(u,_,M,0,C);return E.update(b),E}t.exports=T},2825:function(t){t.exports=e;function e(r,a,n){var o=new Float32Array(3);return o[0]=r,o[1]=a,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,a){return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r}},2953:function(t){t.exports=e;function e(r,a){var n=a[0]-r[0],o=a[1]-r[1],i=a[2]-r[2];return n*n+o*o+i*i}},2962:function(t,e,r){var a=r(5250),n=r(8210),o=r(3012),i=r(7004),s=6;function f(C,M,E,A){return function(h){return A(C(E(h[0][0],h[1][1]),E(-h[0][1],h[1][0])))}}function x(C,M,E,A){return function(h){return A(C(M(C(E(h[1][1],h[2][2]),E(-h[1][2],h[2][1])),h[0][0]),C(M(C(E(h[1][0],h[2][2]),E(-h[1][2],h[2][0])),-h[0][1]),M(C(E(h[1][0],h[2][1]),E(-h[1][1],h[2][0])),h[0][2]))))}}function y(C,M,E,A){return function(h){return A(C(C(M(C(M(C(E(h[2][2],h[3][3]),E(-h[2][3],h[3][2])),h[1][1]),C(M(C(E(h[2][1],h[3][3]),E(-h[2][3],h[3][1])),-h[1][2]),M(C(E(h[2][1],h[3][2]),E(-h[2][2],h[3][1])),h[1][3]))),h[0][0]),M(C(M(C(E(h[2][2],h[3][3]),E(-h[2][3],h[3][2])),h[1][0]),C(M(C(E(h[2][0],h[3][3]),E(-h[2][3],h[3][0])),-h[1][2]),M(C(E(h[2][0],h[3][2]),E(-h[2][2],h[3][0])),h[1][3]))),-h[0][1])),C(M(C(M(C(E(h[2][1],h[3][3]),E(-h[2][3],h[3][1])),h[1][0]),C(M(C(E(h[2][0],h[3][3]),E(-h[2][3],h[3][0])),-h[1][1]),M(C(E(h[2][0],h[3][1]),E(-h[2][1],h[3][0])),h[1][3]))),h[0][2]),M(C(M(C(E(h[2][1],h[3][2]),E(-h[2][2],h[3][1])),h[1][0]),C(M(C(E(h[2][0],h[3][2]),E(-h[2][2],h[3][0])),-h[1][1]),M(C(E(h[2][0],h[3][1]),E(-h[2][1],h[3][0])),h[1][2]))),-h[0][3]))))}}function v(C,M,E,A){return function(h){return A(C(C(M(C(C(M(C(M(C(E(h[3][3],h[4][4]),E(-h[3][4],h[4][3])),h[2][2]),C(M(C(E(h[3][2],h[4][4]),E(-h[3][4],h[4][2])),-h[2][3]),M(C(E(h[3][2],h[4][3]),E(-h[3][3],h[4][2])),h[2][4]))),h[1][1]),M(C(M(C(E(h[3][3],h[4][4]),E(-h[3][4],h[4][3])),h[2][1]),C(M(C(E(h[3][1],h[4][4]),E(-h[3][4],h[4][1])),-h[2][3]),M(C(E(h[3][1],h[4][3]),E(-h[3][3],h[4][1])),h[2][4]))),-h[1][2])),C(M(C(M(C(E(h[3][2],h[4][4]),E(-h[3][4],h[4][2])),h[2][1]),C(M(C(E(h[3][1],h[4][4]),E(-h[3][4],h[4][1])),-h[2][2]),M(C(E(h[3][1],h[4][2]),E(-h[3][2],h[4][1])),h[2][4]))),h[1][3]),M(C(M(C(E(h[3][2],h[4][3]),E(-h[3][3],h[4][2])),h[2][1]),C(M(C(E(h[3][1],h[4][3]),E(-h[3][3],h[4][1])),-h[2][2]),M(C(E(h[3][1],h[4][2]),E(-h[3][2],h[4][1])),h[2][3]))),-h[1][4]))),h[0][0]),M(C(C(M(C(M(C(E(h[3][3],h[4][4]),E(-h[3][4],h[4][3])),h[2][2]),C(M(C(E(h[3][2],h[4][4]),E(-h[3][4],h[4][2])),-h[2][3]),M(C(E(h[3][2],h[4][3]),E(-h[3][3],h[4][2])),h[2][4]))),h[1][0]),M(C(M(C(E(h[3][3],h[4][4]),E(-h[3][4],h[4][3])),h[2][0]),C(M(C(E(h[3][0],h[4][4]),E(-h[3][4],h[4][0])),-h[2][3]),M(C(E(h[3][0],h[4][3]),E(-h[3][3],h[4][0])),h[2][4]))),-h[1][2])),C(M(C(M(C(E(h[3][2],h[4][4]),E(-h[3][4],h[4][2])),h[2][0]),C(M(C(E(h[3][0],h[4][4]),E(-h[3][4],h[4][0])),-h[2][2]),M(C(E(h[3][0],h[4][2]),E(-h[3][2],h[4][0])),h[2][4]))),h[1][3]),M(C(M(C(E(h[3][2],h[4][3]),E(-h[3][3],h[4][2])),h[2][0]),C(M(C(E(h[3][0],h[4][3]),E(-h[3][3],h[4][0])),-h[2][2]),M(C(E(h[3][0],h[4][2]),E(-h[3][2],h[4][0])),h[2][3]))),-h[1][4]))),-h[0][1])),C(M(C(C(M(C(M(C(E(h[3][3],h[4][4]),E(-h[3][4],h[4][3])),h[2][1]),C(M(C(E(h[3][1],h[4][4]),E(-h[3][4],h[4][1])),-h[2][3]),M(C(E(h[3][1],h[4][3]),E(-h[3][3],h[4][1])),h[2][4]))),h[1][0]),M(C(M(C(E(h[3][3],h[4][4]),E(-h[3][4],h[4][3])),h[2][0]),C(M(C(E(h[3][0],h[4][4]),E(-h[3][4],h[4][0])),-h[2][3]),M(C(E(h[3][0],h[4][3]),E(-h[3][3],h[4][0])),h[2][4]))),-h[1][1])),C(M(C(M(C(E(h[3][1],h[4][4]),E(-h[3][4],h[4][1])),h[2][0]),C(M(C(E(h[3][0],h[4][4]),E(-h[3][4],h[4][0])),-h[2][1]),M(C(E(h[3][0],h[4][1]),E(-h[3][1],h[4][0])),h[2][4]))),h[1][3]),M(C(M(C(E(h[3][1],h[4][3]),E(-h[3][3],h[4][1])),h[2][0]),C(M(C(E(h[3][0],h[4][3]),E(-h[3][3],h[4][0])),-h[2][1]),M(C(E(h[3][0],h[4][1]),E(-h[3][1],h[4][0])),h[2][3]))),-h[1][4]))),h[0][2]),C(M(C(C(M(C(M(C(E(h[3][2],h[4][4]),E(-h[3][4],h[4][2])),h[2][1]),C(M(C(E(h[3][1],h[4][4]),E(-h[3][4],h[4][1])),-h[2][2]),M(C(E(h[3][1],h[4][2]),E(-h[3][2],h[4][1])),h[2][4]))),h[1][0]),M(C(M(C(E(h[3][2],h[4][4]),E(-h[3][4],h[4][2])),h[2][0]),C(M(C(E(h[3][0],h[4][4]),E(-h[3][4],h[4][0])),-h[2][2]),M(C(E(h[3][0],h[4][2]),E(-h[3][2],h[4][0])),h[2][4]))),-h[1][1])),C(M(C(M(C(E(h[3][1],h[4][4]),E(-h[3][4],h[4][1])),h[2][0]),C(M(C(E(h[3][0],h[4][4]),E(-h[3][4],h[4][0])),-h[2][1]),M(C(E(h[3][0],h[4][1]),E(-h[3][1],h[4][0])),h[2][4]))),h[1][2]),M(C(M(C(E(h[3][1],h[4][2]),E(-h[3][2],h[4][1])),h[2][0]),C(M(C(E(h[3][0],h[4][2]),E(-h[3][2],h[4][0])),-h[2][1]),M(C(E(h[3][0],h[4][1]),E(-h[3][1],h[4][0])),h[2][2]))),-h[1][4]))),-h[0][3]),M(C(C(M(C(M(C(E(h[3][2],h[4][3]),E(-h[3][3],h[4][2])),h[2][1]),C(M(C(E(h[3][1],h[4][3]),E(-h[3][3],h[4][1])),-h[2][2]),M(C(E(h[3][1],h[4][2]),E(-h[3][2],h[4][1])),h[2][3]))),h[1][0]),M(C(M(C(E(h[3][2],h[4][3]),E(-h[3][3],h[4][2])),h[2][0]),C(M(C(E(h[3][0],h[4][3]),E(-h[3][3],h[4][0])),-h[2][2]),M(C(E(h[3][0],h[4][2]),E(-h[3][2],h[4][0])),h[2][3]))),-h[1][1])),C(M(C(M(C(E(h[3][1],h[4][3]),E(-h[3][3],h[4][1])),h[2][0]),C(M(C(E(h[3][0],h[4][3]),E(-h[3][3],h[4][0])),-h[2][1]),M(C(E(h[3][0],h[4][1]),E(-h[3][1],h[4][0])),h[2][3]))),h[1][2]),M(C(M(C(E(h[3][1],h[4][2]),E(-h[3][2],h[4][1])),h[2][0]),C(M(C(E(h[3][0],h[4][2]),E(-h[3][2],h[4][0])),-h[2][1]),M(C(E(h[3][0],h[4][1]),E(-h[3][1],h[4][0])),h[2][2]))),-h[1][3]))),h[0][4])))))}}function T(C){var M=C===2?f:C===3?x:C===4?y:C===5?v:void 0;return M(n,o,a,i)}var u=[function(){return[0]},function(C){return[C[0][0]]}];function b(C,M,E,A,h,p,k,w){return function(R){switch(R.length){case 0:return C(R);case 1:return M(R);case 2:return E(R);case 3:return A(R);case 4:return h(R);case 5:return p(R)}var O=k[R.length];return O||(O=k[R.length]=w(R.length)),O(R)}}function _(){for(;u.length<s;)u.push(T(u.length));t.exports=b.apply(void 0,u.concat([u,T]));for(var C=0;C<u.length;++C)t.exports[C]=u[C]}_()},2992:function(t,e,r){var a=r(3387).sprintf,n=r(5171),o=r(1848),i=r(1085);t.exports=s;function s(f,x,y){var v=o(x)||"of unknown name (see npm glsl-shader-name)",T="unknown type";y!==void 0&&(T=y===n.FRAGMENT_SHADER?"fragment":"vertex");for(var u=a(`Error compiling %s shader %s:
`,T,v),b=a("%s%s",u,f),_=f.split(`
`),C={},M=0;M<_.length;M++){var E=_[M];if(!(E===""||E==="\0")){var A=parseInt(E.split(":")[2]);if(isNaN(A))throw new Error(a("Could not parse error: %s",E));C[A]=E}}for(var h=i(x).split(`
`),M=0;M<h.length;M++)if(!(!C[M+3]&&!C[M+2]&&!C[M+1])){var p=h[M];if(u+=p+`
`,C[M+1]){var k=C[M+1];k=k.substr(k.split(":",3).join(":").length+1).trim(),u+=a(`^^^ %s
`,k)}}return{long:u.trim(),short:b.trim()}}},3012:function(t,e,r){var a=r(5250),n=r(9362);t.exports=o;function o(i,s){var f=i.length;if(f===1){var x=a(i[0],s);return x[0]?x:[x[1]]}var y=new Array(2*f),v=[.1,.1],T=[.1,.1],u=0;a(i[0],s,v),v[0]&&(y[u++]=v[0]);for(var b=1;b<f;++b){a(i[b],s,T);var _=v[1];n(_,T[0],v),v[0]&&(y[u++]=v[0]);var C=T[1],M=v[1],E=C+M,A=E-C,h=M-A;v[1]=E,h&&(y[u++]=h)}return v[1]&&(y[u++]=v[1]),u===0&&(y[u++]=0),y.length=u,y}},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 a=r[0],n=r[1],o=r[2];return a*a+n*n+o*o}},3088:function(t,e,r){t.exports=n;var a=r(3140);function n(o,i){for(var s=i.length|0,f=o.length,x=[new Array(s),new Array(s)],y=0;y<s;++y)x[0][y]=[],x[1][y]=[];for(var y=0;y<f;++y){var v=o[y];x[0][v[0]].push(v),x[1][v[1]].push(v)}for(var T=[],y=0;y<s;++y)x[0][y].length+x[1][y].length===0&&T.push([y]);function u(h,p){var k=x[p][h[p]];k.splice(k.indexOf(h),1)}function b(h,p,k){for(var w,R,O,N=0;N<2;++N)if(x[N][p].length>0){w=x[N][p][0],O=N;break}R=w[O^1];for(var V=0;V<2;++V)for(var H=x[V][p],F=0;F<H.length;++F){var U=H[F],W=U[V^1],q=a(i[h],i[p],i[R],i[W]);q>0&&(w=U,R=W,O=V)}return k||w&&u(w,O),R}function _(h,p){var k=x[p][h][0],w=[h];u(k,p);for(var R=k[p^1],O=p;;){for(;R!==h;)w.push(R),R=b(w[w.length-2],R,!1);if(x[0][h].length+x[1][h].length===0)break;var N=w[w.length-1],V=h,H=w[1],F=b(N,V,!0);if(a(i[N],i[V],i[H],i[F])<0)break;w.push(h),R=b(N,V)}return w}function C(h,p){return p[1]===p[p.length-1]}for(var y=0;y<s;++y)for(var M=0;M<2;++M){for(var E=[];x[M][y].length>0;){x[0][y].length;var A=_(y,M);C(E,A)?E.push.apply(E,A):(E.length>0&&T.push(E),E=A)}E.length>0&&T.push(E)}return T}},3090:function(t,e,r){t.exports=n;var a=r(3250)[3];function n(o){var i=o.length;if(i<3){for(var s=new Array(i),f=0;f<i;++f)s[f]=f;return i===2&&o[0][0]===o[1][0]&&o[0][1]===o[1][1]?[0]:s}for(var x=new Array(i),f=0;f<i;++f)x[f]=f;x.sort(function(E,A){var h=o[E][0]-o[A][0];return h||o[E][1]-o[A][1]});for(var y=[x[0],x[1]],v=[x[0],x[1]],f=2;f<i;++f){for(var T=x[f],u=o[T],b=y.length;b>1&&a(o[y[b-2]],o[y[b-1]],u)<=0;)b-=1,y.pop();for(y.push(T),b=v.length;b>1&&a(o[v[b-2]],o[v[b-1]],u)>=0;)b-=1,v.pop();v.push(T)}for(var s=new Array(v.length+y.length-2),_=0,f=0,C=y.length;f<C;++f)s[_++]=y[f];for(var M=v.length-2;M>0;--M)s[_++]=v[M];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 i=o>>r-1;return(o^i)-i},e.min=function(o,i){return i^(o^i)&-(o<i)},e.max=function(o,i){return o^(o^i)&-(o<i)},e.isPow2=function(o){return!(o&o-1)&&!!o},e.log2=function(o){var i,s;return i=(o>65535)<<4,o>>>=i,s=(o>255)<<3,o>>>=s,i|=s,s=(o>15)<<2,o>>>=s,i|=s,s=(o>3)<<1,o>>>=s,i|=s,i|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 a(o){var i=32;return o&=-o,o&&i--,o&65535&&(i-=16),o&16711935&&(i-=8),o&252645135&&(i-=4),o&858993459&&(i-=2),o&1431655765&&(i-=1),i}e.countTrailingZeros=a,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 i=0;i<256;++i){var s=i,f=i,x=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--x;o[i]=f<<x&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,i){return o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,o|i<<1},e.deinterleave2=function(o,i){return o=o>>>i&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,i,s){return o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,o|=i<<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,i){return o=o>>>i&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 i=o|o-1;return i+1|(~i&-~i)-1>>>a(o)+1}},3126:function(t){t.exports=e;function e(r){var a=new Float32Array(3);return a[0]=r[0],a[1]=r[1],a[2]=r[2],a}},3134:function(t,e,r){t.exports=n;var a=r(1682);function n(o,i){var s=o.length;if(typeof i!="number"){i=0;for(var f=0;f<s;++f){var x=o[f];i=Math.max(i,x[0],x[1])}i=(i|0)+1}i=i|0;for(var y=new Array(i),f=0;f<i;++f)y[f]=[];for(var f=0;f<s;++f){var x=o[f];y[x[0]].push(x[1]),y[x[1]].push(x[0])}for(var v=0;v<i;++v)a(y[v],function(T,u){return T-u});return y}},3140:function(t,e,r){t.exports=x;var a=r(3250),n=r(8572),o=r(9362),i=r(5382),s=r(8210);function f(y,v,T){var u=o(y[0],-v[0]),b=o(y[1],-v[1]),_=o(T[0],-v[0]),C=o(T[1],-v[1]),M=s(i(u,_),i(b,C));return M[M.length-1]>=0}function x(y,v,T,u){var b=a(v,T,u);if(b===0){var _=n(a(y,v,T)),C=n(a(y,v,u));if(_===C){if(_===0){var M=f(y,v,T),E=f(y,v,u);return M===E?0:M?1:-1}return 0}else{if(C===0)return _>0||f(y,v,u)?-1:1;if(_===0)return C>0||f(y,v,T)?1:-1}return n(C-_)}var A=a(y,v,T);if(A>0)return b>0&&a(y,v,u)>0?1:-1;if(A<0)return b>0||a(y,v,u)>0?1:-1;var h=a(y,v,u);return h>0||f(y,v,T)?1:-1}},3202:function(t){t.exports=function(e,r){r||(r=[0,""]),e=String(e);var a=parseFloat(e,10);return r[0]=a,r[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",r}},3233:function(t){var e="",r;t.exports=a;function a(n,o){if(typeof n!="string")throw new TypeError("expected a string");if(o===1)return n;if(o===2)return n+n;var i=n.length*o;if(r!==n||typeof r>"u")r=n,e="";else if(e.length>=i)return e.substr(0,i);for(;i>e.length&&o>1;)o&1&&(e+=n),o>>=1,n+=n;return e+=n,e=e.substr(0,i),e}},3236:function(t){t.exports=function(e){typeof e=="string"&&(e=[e]);for(var r=[].slice.call(arguments,1),a=[],n=0;n<e.length-1;n++)a.push(e[n],r[n]||"");return a.push(e[n]),a.join("")}},3250:function(t,e,r){var a=r(5250),n=r(8210),o=r(3012),i=r(8545),s=5,f=11102230246251565e-32,x=(3+16*f)*f,y=(7+56*f)*f;function v(p,k,w,R){return function(O,N,V){var H=p(p(k(N[1],V[0]),k(-V[1],N[0])),p(k(O[1],N[0]),k(-N[1],O[0]))),F=p(k(O[1],V[0]),k(-V[1],O[0])),U=R(H,F);return U[U.length-1]}}function T(p,k,w,R){return function(O,N,V,H){var F=p(p(w(p(k(V[1],H[0]),k(-H[1],V[0])),N[2]),p(w(p(k(N[1],H[0]),k(-H[1],N[0])),-V[2]),w(p(k(N[1],V[0]),k(-V[1],N[0])),H[2]))),p(w(p(k(N[1],H[0]),k(-H[1],N[0])),O[2]),p(w(p(k(O[1],H[0]),k(-H[1],O[0])),-N[2]),w(p(k(O[1],N[0]),k(-N[1],O[0])),H[2])))),U=p(p(w(p(k(V[1],H[0]),k(-H[1],V[0])),O[2]),p(w(p(k(O[1],H[0]),k(-H[1],O[0])),-V[2]),w(p(k(O[1],V[0]),k(-V[1],O[0])),H[2]))),p(w(p(k(N[1],V[0]),k(-V[1],N[0])),O[2]),p(w(p(k(O[1],V[0]),k(-V[1],O[0])),-N[2]),w(p(k(O[1],N[0]),k(-N[1],O[0])),V[2])))),W=R(F,U);return W[W.length-1]}}function u(p,k,w,R){return function(O,N,V,H,F){var U=p(p(p(w(p(w(p(k(H[1],F[0]),k(-F[1],H[0])),V[2]),p(w(p(k(V[1],F[0]),k(-F[1],V[0])),-H[2]),w(p(k(V[1],H[0]),k(-H[1],V[0])),F[2]))),N[3]),p(w(p(w(p(k(H[1],F[0]),k(-F[1],H[0])),N[2]),p(w(p(k(N[1],F[0]),k(-F[1],N[0])),-H[2]),w(p(k(N[1],H[0]),k(-H[1],N[0])),F[2]))),-V[3]),w(p(w(p(k(V[1],F[0]),k(-F[1],V[0])),N[2]),p(w(p(k(N[1],F[0]),k(-F[1],N[0])),-V[2]),w(p(k(N[1],V[0]),k(-V[1],N[0])),F[2]))),H[3]))),p(w(p(w(p(k(V[1],H[0]),k(-H[1],V[0])),N[2]),p(w(p(k(N[1],H[0]),k(-H[1],N[0])),-V[2]),w(p(k(N[1],V[0]),k(-V[1],N[0])),H[2]))),-F[3]),p(w(p(w(p(k(H[1],F[0]),k(-F[1],H[0])),N[2]),p(w(p(k(N[1],F[0]),k(-F[1],N[0])),-H[2]),w(p(k(N[1],H[0]),k(-H[1],N[0])),F[2]))),O[3]),w(p(w(p(k(H[1],F[0]),k(-F[1],H[0])),O[2]),p(w(p(k(O[1],F[0]),k(-F[1],O[0])),-H[2]),w(p(k(O[1],H[0]),k(-H[1],O[0])),F[2]))),-N[3])))),p(p(w(p(w(p(k(N[1],F[0]),k(-F[1],N[0])),O[2]),p(w(p(k(O[1],F[0]),k(-F[1],O[0])),-N[2]),w(p(k(O[1],N[0]),k(-N[1],O[0])),F[2]))),H[3]),p(w(p(w(p(k(N[1],H[0]),k(-H[1],N[0])),O[2]),p(w(p(k(O[1],H[0]),k(-H[1],O[0])),-N[2]),w(p(k(O[1],N[0]),k(-N[1],O[0])),H[2]))),-F[3]),w(p(w(p(k(V[1],H[0]),k(-H[1],V[0])),N[2]),p(w(p(k(N[1],H[0]),k(-H[1],N[0])),-V[2]),w(p(k(N[1],V[0]),k(-V[1],N[0])),H[2]))),O[3]))),p(w(p(w(p(k(V[1],H[0]),k(-H[1],V[0])),O[2]),p(w(p(k(O[1],H[0]),k(-H[1],O[0])),-V[2]),w(p(k(O[1],V[0]),k(-V[1],O[0])),H[2]))),-N[3]),p(w(p(w(p(k(N[1],H[0]),k(-H[1],N[0])),O[2]),p(w(p(k(O[1],H[0]),k(-H[1],O[0])),-N[2]),w(p(k(O[1],N[0]),k(-N[1],O[0])),H[2]))),V[3]),w(p(w(p(k(N[1],V[0]),k(-V[1],N[0])),O[2]),p(w(p(k(O[1],V[0]),k(-V[1],O[0])),-N[2]),w(p(k(O[1],N[0]),k(-N[1],O[0])),V[2]))),-H[3]))))),W=p(p(p(w(p(w(p(k(H[1],F[0]),k(-F[1],H[0])),V[2]),p(w(p(k(V[1],F[0]),k(-F[1],V[0])),-H[2]),w(p(k(V[1],H[0]),k(-H[1],V[0])),F[2]))),O[3]),w(p(w(p(k(H[1],F[0]),k(-F[1],H[0])),O[2]),p(w(p(k(O[1],F[0]),k(-F[1],O[0])),-H[2]),w(p(k(O[1],H[0]),k(-H[1],O[0])),F[2]))),-V[3])),p(w(p(w(p(k(V[1],F[0]),k(-F[1],V[0])),O[2]),p(w(p(k(O[1],F[0]),k(-F[1],O[0])),-V[2]),w(p(k(O[1],V[0]),k(-V[1],O[0])),F[2]))),H[3]),w(p(w(p(k(V[1],H[0]),k(-H[1],V[0])),O[2]),p(w(p(k(O[1],H[0]),k(-H[1],O[0])),-V[2]),w(p(k(O[1],V[0]),k(-V[1],O[0])),H[2]))),-F[3]))),p(p(w(p(w(p(k(V[1],F[0]),k(-F[1],V[0])),N[2]),p(w(p(k(N[1],F[0]),k(-F[1],N[0])),-V[2]),w(p(k(N[1],V[0]),k(-V[1],N[0])),F[2]))),O[3]),w(p(w(p(k(V[1],F[0]),k(-F[1],V[0])),O[2]),p(w(p(k(O[1],F[0]),k(-F[1],O[0])),-V[2]),w(p(k(O[1],V[0]),k(-V[1],O[0])),F[2]))),-N[3])),p(w(p(w(p(k(N[1],F[0]),k(-F[1],N[0])),O[2]),p(w(p(k(O[1],F[0]),k(-F[1],O[0])),-N[2]),w(p(k(O[1],N[0]),k(-N[1],O[0])),F[2]))),V[3]),w(p(w(p(k(N[1],V[0]),k(-V[1],N[0])),O[2]),p(w(p(k(O[1],V[0]),k(-V[1],O[0])),-N[2]),w(p(k(O[1],N[0]),k(-N[1],O[0])),V[2]))),-F[3])))),q=R(U,W);return q[q.length-1]}}function b(p){var k=p===3?v:p===4?T:u;return k(n,a,o,i)}var _=b(3),C=b(4),M=[function(){return 0},function(){return 0},function(p,k){return k[0]-p[0]},function(p,k,w){var R=(p[1]-w[1])*(k[0]-w[0]),O=(p[0]-w[0])*(k[1]-w[1]),N=R-O,V;if(R>0){if(O<=0)return N;V=R+O}else if(R<0){if(O>=0)return N;V=-(R+O)}else return N;var H=x*V;return N>=H||N<=-H?N:_(p,k,w)},function(p,k,w,R){var O=p[0]-R[0],N=k[0]-R[0],V=w[0]-R[0],H=p[1]-R[1],F=k[1]-R[1],U=w[1]-R[1],W=p[2]-R[2],q=k[2]-R[2],X=w[2]-R[2],lt=N*U,yt=V*F,pt=V*H,st=O*U,tt=O*F,dt=N*H,rt=W*(lt-yt)+q*(pt-st)+X*(tt-dt),at=(Math.abs(lt)+Math.abs(yt))*Math.abs(W)+(Math.abs(pt)+Math.abs(st))*Math.abs(q)+(Math.abs(tt)+Math.abs(dt))*Math.abs(X),vt=y*at;return rt>vt||-rt>vt?rt:C(p,k,w,R)}];function E(p){var k=M[p.length];return k||(k=M[p.length]=b(p.length)),k.apply(void 0,p)}function A(p,k,w,R,O,N,V){return function(H,F,U,W,q){switch(arguments.length){case 0:case 1:return 0;case 2:return R(H,F);case 3:return O(H,F,U);case 4:return N(H,F,U,W);case 5:return V(H,F,U,W,q)}for(var X=new Array(arguments.length),lt=0;lt<arguments.length;++lt)X[lt]=arguments[lt];return p(X)}}function h(){for(;M.length<=s;)M.push(b(M.length));t.exports=A.apply(void 0,[E].concat(M));for(var p=0;p<=s;++p)t.exports[p]=M[p]}h()},3327:function(t,e,r){var a=r(216),n=r(8866);t.exports=s;function o(f){return function(){return f}}function i(f,x){for(var y=new Array(f),v=0;v<f;++v)y[v]=x;return y}function s(f,x,y,v){function T(A){return function(h,p,k){return h.getUniform(p.program,k[A])}}function u(A){return function(h){for(var p=b("",A),k=0;k<p.length;++k){var w=p[k],R=w[0],O=w[1];if(v[O]){var N=h;if(typeof R=="string"&&(R.indexOf(".")===0||R.indexOf("[")===0)){var V=R;if(R.indexOf(".")===0&&(V=R.slice(1)),V.indexOf("]")===V.length-1){var H=V.indexOf("["),F=V.slice(0,H),U=V.slice(H+1,V.length-1);N=F?h[F][U]:h[U]}else N=h[V]}var W=y[O].type,q;switch(W){case"bool":case"int":case"sampler2D":case"samplerCube":f.uniform1i(v[O],N);break;case"float":f.uniform1f(v[O],N);break;default:var X=W.indexOf("vec");if(0<=X&&X<=1&&W.length===4+X){if(q=W.charCodeAt(W.length-1)-48,q<2||q>4)throw new n("","Invalid data type");switch(W.charAt(0)){case"b":case"i":f["uniform"+q+"iv"](v[O],N);break;case"v":f["uniform"+q+"fv"](v[O],N);break;default:throw new n("","Unrecognized data type for vector "+name+": "+W)}}else if(W.indexOf("mat")===0&&W.length===4){if(q=W.charCodeAt(W.length-1)-48,q<2||q>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+W);f["uniformMatrix"+q+"fv"](v[O],!1,N);break}else throw new n("","Unknown uniform data type for "+name+": "+W)}}}}}function b(A,h){if(typeof h!="object")return[[A,h]];var p=[];for(var k in h){var w=h[k],R=A;parseInt(k)+""===k?R+="["+k+"]":R+="."+k,typeof w=="object"?p.push.apply(p,b(R,w)):p.push([R,w])}return p}function _(A){switch(A){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var h=A.indexOf("vec");if(0<=h&&h<=1&&A.length===4+h){var p=A.charCodeAt(A.length-1)-48;if(p<2||p>4)throw new n("","Invalid data type");return A.charAt(0)==="b"?i(p,!1):i(p,0)}else if(A.indexOf("mat")===0&&A.length===4){var p=A.charCodeAt(A.length-1)-48;if(p<2||p>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+A);return i(p*p,0)}else throw new n("","Unknown uniform data type for "+name+": "+A)}}function C(A,h,p){if(typeof p=="object"){var k=M(p);Object.defineProperty(A,h,{get:o(k),set:u(p),enumerable:!0,configurable:!1})}else v[p]?Object.defineProperty(A,h,{get:T(p),set:u(p),enumerable:!0,configurable:!1}):A[h]=_(y[p].type)}function M(A){var h;if(Array.isArray(A)){h=new Array(A.length);for(var p=0;p<A.length;++p)C(h,p,A[p])}else{h={};for(var k in A)C(h,k,A[k])}return h}var E=a(y,!0);return{get:o(M(E)),set:u(E),enumerable:!0,configurable:!0}}},3349:function(t){function e(){return function(s,f,x,y,v,T){var u=s[0],b=x[0],_=[0],C=b;y|=0;var M=0,E=b;for(M=0;M<u;++M){{var A=f[y]-T,h=f[y+C]-T;A>=0!=h>=0&&v.push(_[0]+.5+.5*(A+h)/(A-h))}y+=E,++_[0]}}}function r(){return e()}var a=r;function n(s){var f={};return function(x,y,v){var T=x.dtype,u=x.order,b=[T,u.join()].join(),_=f[b];return _||(f[b]=_=s([T,u])),_(x.shape.slice(0),x.data,x.stride,x.offset|0,y,v)}}function o(s){return n(a.bind(void 0,s))}function i(s){return o({funcName:s.funcName})}t.exports=i({funcName:"zeroCrossings"})},3352:function(t,e,r){var a=r(2478),n=0,o=1,i=2;t.exports=k;function s(w,R,O,N,V){this.mid=w,this.left=R,this.right=O,this.leftPoints=N,this.rightPoints=V,this.count=(R?R.count:0)+(O?O.count:0)+N.length}var f=s.prototype;function x(w,R){w.mid=R.mid,w.left=R.left,w.right=R.right,w.leftPoints=R.leftPoints,w.rightPoints=R.rightPoints,w.count=R.count}function y(w,R){var O=A(R);w.mid=O.mid,w.left=O.left,w.right=O.right,w.leftPoints=O.leftPoints,w.rightPoints=O.rightPoints,w.count=O.count}function v(w,R){var O=w.intervals([]);O.push(R),y(w,O)}function T(w,R){var O=w.intervals([]),N=O.indexOf(R);return N<0?n:(O.splice(N,1),y(w,O),o)}f.intervals=function(w){return w.push.apply(w,this.leftPoints),this.left&&this.left.intervals(w),this.right&&this.right.intervals(w),w},f.insert=function(w){var R=this.count-this.leftPoints.length;if(this.count+=1,w[1]<this.mid)this.left?4*(this.left.count+1)>3*(R+1)?v(this,w):this.left.insert(w):this.left=A([w]);else if(w[0]>this.mid)this.right?4*(this.right.count+1)>3*(R+1)?v(this,w):this.right.insert(w):this.right=A([w]);else{var O=a.ge(this.leftPoints,w,M),N=a.ge(this.rightPoints,w,E);this.leftPoints.splice(O,0,w),this.rightPoints.splice(N,0,w)}},f.remove=function(w){var R=this.count-this.leftPoints;if(w[1]<this.mid){if(!this.left)return n;var O=this.right?this.right.count:0;if(4*O>3*(R-1))return T(this,w);var N=this.left.remove(w);return N===i?(this.left=null,this.count-=1,o):(N===o&&(this.count-=1),N)}else if(w[0]>this.mid){if(!this.right)return n;var V=this.left?this.left.count:0;if(4*V>3*(R-1))return T(this,w);var N=this.right.remove(w);return N===i?(this.right=null,this.count-=1,o):(N===o&&(this.count-=1),N)}else{if(this.count===1)return this.leftPoints[0]===w?i:n;if(this.leftPoints.length===1&&this.leftPoints[0]===w){if(this.left&&this.right){for(var H=this,F=this.left;F.right;)H=F,F=F.right;if(H===this)F.right=this.right;else{var U=this.left,N=this.right;H.count-=F.count,H.right=F.left,F.left=U,F.right=N}x(this,F),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?x(this,this.left):x(this,this.right);return o}for(var U=a.ge(this.leftPoints,w,M);U<this.leftPoints.length&&this.leftPoints[U][0]===w[0];++U)if(this.leftPoints[U]===w){this.count-=1,this.leftPoints.splice(U,1);for(var N=a.ge(this.rightPoints,w,E);N<this.rightPoints.length&&this.rightPoints[N][1]===w[1];++N)if(this.rightPoints[N]===w)return this.rightPoints.splice(N,1),o}return n}};function u(w,R,O){for(var N=0;N<w.length&&w[N][0]<=R;++N){var V=O(w[N]);if(V)return V}}function b(w,R,O){for(var N=w.length-1;N>=0&&w[N][1]>=R;--N){var V=O(w[N]);if(V)return V}}function _(w,R){for(var O=0;O<w.length;++O){var N=R(w[O]);if(N)return N}}f.queryPoint=function(w,R){if(w<this.mid){if(this.left){var O=this.left.queryPoint(w,R);if(O)return O}return u(this.leftPoints,w,R)}else if(w>this.mid){if(this.right){var O=this.right.queryPoint(w,R);if(O)return O}return b(this.rightPoints,w,R)}else return _(this.leftPoints,R)},f.queryInterval=function(w,R,O){if(w<this.mid&&this.left){var N=this.left.queryInterval(w,R,O);if(N)return N}if(R>this.mid&&this.right){var N=this.right.queryInterval(w,R,O);if(N)return N}return R<this.mid?u(this.leftPoints,R,O):w>this.mid?b(this.rightPoints,w,O):_(this.leftPoints,O)};function C(w,R){return w-R}function M(w,R){var O=w[0]-R[0];return O||w[1]-R[1]}function E(w,R){var O=w[1]-R[1];return O||w[0]-R[0]}function A(w){if(w.length===0)return null;for(var R=[],O=0;O<w.length;++O)R.push(w[O][0],w[O][1]);R.sort(C);for(var N=R[R.length>>1],V=[],H=[],F=[],O=0;O<w.length;++O){var U=w[O];U[1]<N?V.push(U):N<U[0]?H.push(U):F.push(U)}var W=F,q=F.slice();return W.sort(M),q.sort(E),new s(N,A(V),A(H),W,q)}function h(w){this.root=w}var p=h.prototype;p.insert=function(w){this.root?this.root.insert(w):this.root=new s(w[0],null,null,[w],[w])},p.remove=function(w){if(this.root){var R=this.root.remove(w);return R===i&&(this.root=null),R!==n}return!1},p.queryPoint=function(w,R){if(this.root)return this.root.queryPoint(w,R)},p.queryInterval=function(w,R,O){if(w<=R&&this.root)return this.root.queryInterval(w,R,O)},Object.defineProperty(p,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(p,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function k(w){return!w||w.length===0?new h(null):new h(A(w))}},3387:function(t,e,r){var a;(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(y){return s(x(y),arguments)}function i(y,v){return o.apply(null,[y].concat(v||[]))}function s(y,v){var T=1,u=y.length,b,_="",C,M,E,A,h,p,k,w;for(C=0;C<u;C++)if(typeof y[C]=="string")_+=y[C];else if(typeof y[C]=="object"){if(E=y[C],E.keys)for(b=v[T],M=0;M<E.keys.length;M++){if(b==null)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',E.keys[M],E.keys[M-1]));b=b[E.keys[M]]}else E.param_no?b=v[E.param_no]:b=v[T++];if(n.not_type.test(E.type)&&n.not_primitive.test(E.type)&&b instanceof Function&&(b=b()),n.numeric_arg.test(E.type)&&typeof b!="number"&&isNaN(b))throw new TypeError(o("[sprintf] expecting number but found %T",b));switch(n.number.test(E.type)&&(k=b>=0),E.type){case"b":b=parseInt(b,10).toString(2);break;case"c":b=String.fromCharCode(parseInt(b,10));break;case"d":case"i":b=parseInt(b,10);break;case"j":b=JSON.stringify(b,null,E.width?parseInt(E.width):0);break;case"e":b=E.precision?parseFloat(b).toExponential(E.precision):parseFloat(b).toExponential();break;case"f":b=E.precision?parseFloat(b).toFixed(E.precision):parseFloat(b);break;case"g":b=E.precision?String(Number(b.toPrecision(E.precision))):parseFloat(b);break;case"o":b=(parseInt(b,10)>>>0).toString(8);break;case"s":b=String(b),b=E.precision?b.substring(0,E.precision):b;break;case"t":b=String(!!b),b=E.precision?b.substring(0,E.precision):b;break;case"T":b=Object.prototype.toString.call(b).slice(8,-1).toLowerCase(),b=E.precision?b.substring(0,E.precision):b;break;case"u":b=parseInt(b,10)>>>0;break;case"v":b=b.valueOf(),b=E.precision?b.substring(0,E.precision):b;break;case"x":b=(parseInt(b,10)>>>0).toString(16);break;case"X":b=(parseInt(b,10)>>>0).toString(16).toUpperCase();break}n.json.test(E.type)?_+=b:(n.number.test(E.type)&&(!k||E.sign)?(w=k?"+":"-",b=b.toString().replace(n.sign,"")):w="",h=E.pad_char?E.pad_char==="0"?"0":E.pad_char.charAt(1):" ",p=E.width-(w+b).length,A=E.width&&p>0?h.repeat(p):"",_+=E.align?w+b+A:h==="0"?w+A+b:A+w+b)}return _}var f=Object.create(null);function x(y){if(f[y])return f[y];for(var v=y,T,u=[],b=0;v;){if((T=n.text.exec(v))!==null)u.push(T[0]);else if((T=n.modulo.exec(v))!==null)u.push("%");else if((T=n.placeholder.exec(v))!==null){if(T[2]){b|=1;var _=[],C=T[2],M=[];if((M=n.key.exec(C))!==null)for(_.push(M[1]);(C=C.substring(M[0].length))!=="";)if((M=n.key_access.exec(C))!==null)_.push(M[1]);else if((M=n.index_access.exec(C))!==null)_.push(M[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");T[2]=_}else b|=2;if(b===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");u.push({placeholder:T[0],param_no:T[1],keys:T[2],sign:T[3],pad_char:T[4],align:T[5],width:T[6],precision:T[7],type:T[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");v=v.substring(T[0].length)}return f[y]=u}e.sprintf=o,e.vsprintf=i,typeof window<"u"&&(window.sprintf=o,window.vsprintf=i,a=(function(){return{sprintf:o,vsprintf:i}}).call(e,r,e,t),a!==void 0&&(t.exports=a))})()},3390:function(t){t.exports=e;function e(r,a,n,o){var i=new Float32Array(4);return i[0]=r,i[1]=a,i[2]=n,i[3]=o,i}},3436:function(t,e,r){var a=r(3236),n=r(9405),o=a([`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;
}`]),i=a([`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,i,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},3502:function(t,e,r){t.exports=o;var a=r(5995),n=r(9127);function o(i,s){return n(a(i,s))}},3508:function(t,e,r){var a=r(6852);a=a.slice().filter(function(n){return!/^(gl\_|texture)/.test(n)}),t.exports=a.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,a){var n=a[0],o=a[1],i=a[2],s=n*n+o*o+i*i;return s>0&&(s=1/Math.sqrt(s),r[0]=a[0]*s,r[1]=a[1]*s,r[2]=a[2]*s),r}},3545:function(t,e,r){t.exports=s;var a=r(8105),n=a("lo<p0"),o=8;function i(f,x,y,v,T,u){for(var b=2*f,_=b*(y+1)+x,C=y+1;C<v;++C,_+=b)for(var M=T[_],E=C,A=b*(C-1);E>y&&T[A+x]>M;--E,A-=b){for(var h=A,p=A+b,k=0;k<b;++k,++h,++p){var w=T[h];T[h]=T[p],T[p]=w}var R=u[E];u[E]=u[E-1],u[E-1]=R}}function s(f,x,y,v,T,u){if(v<=y+1)return y;for(var b=y,_=v,C=v+y>>>1,M=2*f,E=C,A=T[M*C+x];b<_;){if(_-b<o){i(f,x,b,_,T,u),A=T[M*C+x];break}var h=_-b,p=Math.random()*h+b|0,k=T[M*p+x],w=Math.random()*h+b|0,R=T[M*w+x],O=Math.random()*h+b|0,N=T[M*O+x];k<=R?N>=R?(E=w,A=R):k>=N?(E=p,A=k):(E=O,A=N):R>=N?(E=w,A=R):N>=k?(E=p,A=k):(E=O,A=N);for(var V=M*(_-1),H=M*E,F=0;F<M;++F,++V,++H){var U=T[V];T[V]=T[H],T[H]=U}var W=u[_-1];u[_-1]=u[E],u[E]=W,E=n(f,x,b,_-1,T,u,A);for(var V=M*(_-1),H=M*E,F=0;F<M;++F,++V,++H){var U=T[V];T[V]=T[H],T[H]=U}var W=u[_-1];if(u[_-1]=u[E],u[E]=W,C<E){for(_=E-1;b<_&&T[M*(_-1)+x]===A;)_-=1;_+=1}else if(E<C)for(b=E+1;b<_&&T[M*b+x]===A;)b+=1;else break}return n(f,x,y,C,T,u,T[M*C+x])}},3576:function(t){t.exports=e;function e(r,a,n){return r[0]=a[0]*n[0],r[1]=a[1]*n[1],r[2]=a[2]*n[2],r[3]=a[3]*n[3],r}},3589:function(t,e,r){t.exports=v;var a=r(2260),n=r(1888),o=r(9618),i=r(8828).nextPow2,s=function(T,u,b){for(var _=1e8,C=-1,M=-1,E=T.shape[0],A=T.shape[1],h=0;h<E;h++)for(var p=0;p<A;p++){var k=T.get(h,p,0),w=T.get(h,p,1),R=T.get(h,p,2),O=T.get(h,p,3);if(k<255||w<255||R<255||O<255){var N=u-h,V=b-p,H=N*N+V*V;H<_&&(_=H,C=h,M=p)}}return[C,M,_]};function f(T,u,b,_,C){this.coord=[T,u],this.id=b,this.value=_,this.distance=C}function x(T,u,b){this.gl=T,this.fbo=u,this.buffer=b,this._readTimeout=null;var _=this;this._readCallback=function(){_.gl&&(u.bind(),T.readPixels(0,0,u.shape[0],u.shape[1],T.RGBA,T.UNSIGNED_BYTE,_.buffer),_._readTimeout=null)}}var y=x.prototype;Object.defineProperty(y,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(T){if(this.gl){this.fbo.shape=T;var u=this.fbo.shape[0],b=this.fbo.shape[1];if(b*u*4>this.buffer.length){n.free(this.buffer);for(var _=this.buffer=n.mallocUint8(i(b*u*4)),C=0;C<b*u*4;++C)_[C]=255}return T}}}),y.begin=function(){var T=this.gl;this.shape,T&&(this.fbo.bind(),T.clearColor(1,1,1,1),T.clear(T.COLOR_BUFFER_BIT|T.DEPTH_BUFFER_BIT))},y.end=function(){var T=this.gl;T&&(T.bindFramebuffer(T.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},y.query=function(T,u,b){if(!this.gl)return null;var _=this.fbo.shape.slice();T=T|0,u=u|0,typeof b!="number"&&(b=1);var C=Math.min(Math.max(T-b,0),_[0])|0,M=Math.min(Math.max(T+b,0),_[0])|0,E=Math.min(Math.max(u-b,0),_[1])|0,A=Math.min(Math.max(u+b,0),_[1])|0;if(M<=C||A<=E)return null;var h=[M-C,A-E],p=o(this.buffer,[h[0],h[1],4],[4,_[0]*4,1],4*(C+_[0]*E)),k=s(p.hi(h[0],h[1],1),b,b),w=k[0],R=k[1];if(w<0||Math.pow(this.radius,2)<k[2])return null;var O=p.get(w,R,0),N=p.get(w,R,1),V=p.get(w,R,2),H=p.get(w,R,3);return new f(w+C|0,R+E|0,O,[N,V,H],Math.sqrt(k[2]))},y.dispose=function(){this.gl&&(this.fbo.dispose(),n.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))};function v(T,u){var b=u[0],_=u[1],C={},M=a(T,b,_,C),E=n.mallocUint8(b*_*4);return new x(T,M,E)}},3628:function(t,e,r){var a=r(1338),n=r(727);function o(f,x){for(var y=0,v=f.length,T=0;T<v;++T)y+=f[T]*x[T];return y}function i(f){var x=f.length;if(x===0)return[];f[0].length;var y=a([f.length+1,f.length+1],1),v=a([f.length+1],1);y[x][x]=0;for(var T=0;T<x;++T){for(var u=0;u<=T;++u)y[u][T]=y[T][u]=2*o(f[T],f[u]);v[T]=o(f[T],f[T])}for(var b=n(y,v),_=0,C=b[x+1],T=0;T<C.length;++T)_+=C[T];for(var M=new Array(x),T=0;T<x;++T){for(var C=b[T],E=0,u=0;u<C.length;++u)E+=C[u];M[T]=E/_}return M}function s(f){if(f.length===0)return[];for(var x=f[0].length,y=a([x]),v=i(f),T=0;T<f.length;++T)for(var u=0;u<x;++u)y[u]+=f[T][u]*v[T];return y}s.barycenetric=i,t.exports=s},3637:function(t,e,r){t.exports=v;var a=r(6504),n=r(8697),o=r(5572),i=r(7721),s=r(544),f=r(2653),x=r(8987);function y(T,u){return o(a(T[0],u[1]),a(T[1],u[0]))}function v(T,u,b,_){var C=s(u,T),M=s(_,b),E=y(C,M);if(i(E)===0)return null;var A=s(T,b),h=y(M,A),p=n(h,E),k=x(C,p),w=f(T,k);return w}},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=x;var a=r(2640),n=r(781),o={"2d":function(y,v,T){var u=y({order:v,scalarArguments:3,getters:T==="generic"?[0]:void 0,phase:function(b,_,C,M){return b>M|0},vertex:function(b,_,C,M,E,A,h,p,k,w,R,O,N){var V=(h<<0)+(p<<1)+(k<<2)+(w<<3)|0;if(!(V===0||V===15))switch(V){case 0:R.push([b-.5,_-.5]);break;case 1:R.push([b-.25-.25*(M+C-2*N)/(C-M),_-.25-.25*(E+C-2*N)/(C-E)]);break;case 2:R.push([b-.75-.25*(-M-C+2*N)/(M-C),_-.25-.25*(A+M-2*N)/(M-A)]);break;case 3:R.push([b-.5,_-.5-.5*(E+C+A+M-4*N)/(C-E+M-A)]);break;case 4:R.push([b-.25-.25*(A+E-2*N)/(E-A),_-.75-.25*(-E-C+2*N)/(E-C)]);break;case 5:R.push([b-.5-.5*(M+C+A+E-4*N)/(C-M+E-A),_-.5]);break;case 6:R.push([b-.5-.25*(-M-C+A+E)/(M-C+E-A),_-.5-.25*(-E-C+A+M)/(E-C+M-A)]);break;case 7:R.push([b-.75-.25*(A+E-2*N)/(E-A),_-.75-.25*(A+M-2*N)/(M-A)]);break;case 8:R.push([b-.75-.25*(-A-E+2*N)/(A-E),_-.75-.25*(-A-M+2*N)/(A-M)]);break;case 9:R.push([b-.5-.25*(M+C+-A-E)/(C-M+A-E),_-.5-.25*(E+C+-A-M)/(C-E+A-M)]);break;case 10:R.push([b-.5-.5*(-M-C+-A-E+4*N)/(M-C+A-E),_-.5]);break;case 11:R.push([b-.25-.25*(-A-E+2*N)/(A-E),_-.75-.25*(E+C-2*N)/(C-E)]);break;case 12:R.push([b-.5,_-.5-.5*(-E-C+-A-M+4*N)/(E-C+A-M)]);break;case 13:R.push([b-.75-.25*(M+C-2*N)/(C-M),_-.25-.25*(-A-M+2*N)/(A-M)]);break;case 14:R.push([b-.25-.25*(-M-C+2*N)/(M-C),_-.25-.25*(-E-C+2*N)/(E-C)]);break;case 15:R.push([b-.5,_-.5]);break}},cell:function(b,_,C,M,E,A,h,p,k){E?p.push([b,_]):p.push([_,b])}});return function(b,_){var C=[],M=[];return u(b,C,M,_),{positions:C,cells:M}}}};function i(y,v){var T=y.length+"d",u=o[T];if(u)return u(a,y,v)}function s(y,v){for(var T=n(y,v),u=T.length,b=new Array(u),_=new Array(u),C=0;C<u;++C)b[C]=[T[C]],_[C]=[C];return{positions:b,cells:_}}var f={};function x(y,b){if(y.dimension<=0)return{positions:[],cells:[]};if(y.dimension===1)return s(y,b);var T=y.order.join()+"-"+y.dtype,u=f[T],b=+b||0;return u||(u=f[T]=i(y.order,y.dtype)),u(y,b)}},3750:function(t){t.exports=e;function e(r,a){return r[0]*a[0]+r[1]*a[1]+r[2]*a[2]+r[3]*a[3]}},3778:function(t,e){e.read=function(r,a,n,o,i){var s,f,x=i*8-o-1,y=(1<<x)-1,v=y>>1,T=-7,u=n?i-1:0,b=n?-1:1,_=r[a+u];for(u+=b,s=_&(1<<-T)-1,_>>=-T,T+=x;T>0;s=s*256+r[a+u],u+=b,T-=8);for(f=s&(1<<-T)-1,s>>=-T,T+=o;T>0;f=f*256+r[a+u],u+=b,T-=8);if(s===0)s=1-v;else{if(s===y)return f?NaN:(_?-1:1)*(1/0);f=f+Math.pow(2,o),s=s-v}return(_?-1:1)*f*Math.pow(2,s-o)},e.write=function(r,a,n,o,i,s){var f,x,y,v=s*8-i-1,T=(1<<v)-1,u=T>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=o?0:s-1,C=o?1:-1,M=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(x=isNaN(a)?1:0,f=T):(f=Math.floor(Math.log(a)/Math.LN2),a*(y=Math.pow(2,-f))<1&&(f--,y*=2),f+u>=1?a+=b/y:a+=b*Math.pow(2,1-u),a*y>=2&&(f++,y/=2),f+u>=T?(x=0,f=T):f+u>=1?(x=(a*y-1)*Math.pow(2,i),f=f+u):(x=a*Math.pow(2,u-1)*Math.pow(2,i),f=0));i>=8;r[n+_]=x&255,_+=C,x/=256,i-=8);for(f=f<<i|x,v+=i;v>0;r[n+_]=f&255,_+=C,f/=256,v-=8);r[n+_-C]|=M*128}},3788:function(t,e,r){var a=r(8507),n=r(2419);t.exports=o;function o(i,s){return a(i,s)||n(i)-n(s)}},3837:function(t,e,r){t.exports=O;var a=r(4935),n=r(501),o=r(5304),i=r(6429),s=r(6444),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),x=ArrayBuffer,y=DataView;function v(N){return x.isView(N)&&!(N instanceof y)}function T(N){return Array.isArray(N)||v(N)}function u(N,V){return N[0]=V[0],N[1]=V[1],N[2]=V[2],N}function b(N){this.gl=N,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(N)}var _=b.prototype;_.update=function(N){N=N||{};function V(at,vt,it){if(it in N){var Y=N[it],ft=this[it],ut;(at?T(Y)&&T(Y[0]):T(Y))?this[it]=ut=[vt(Y[0]),vt(Y[1]),vt(Y[2])]:this[it]=ut=[vt(Y),vt(Y),vt(Y)];for(var wt=0;wt<3;++wt)if(ut[wt]!==ft[wt])return!0}return!1}var H=V.bind(this,!1,Number),F=V.bind(this,!1,Boolean),U=V.bind(this,!1,String),W=V.bind(this,!0,function(at){if(T(at)){if(at.length===3)return[+at[0],+at[1],+at[2],1];if(at.length===4)return[+at[0],+at[1],+at[2],+at[3]]}return[0,0,0,1]}),q,X=!1,lt=!1;if("bounds"in N)for(var yt=N.bounds,pt=0;pt<2;++pt)for(var st=0;st<3;++st)yt[pt][st]!==this.bounds[pt][st]&&(lt=!0),this.bounds[pt][st]=yt[pt][st];if("ticks"in N){q=N.ticks,X=!0,this.autoTicks=!1;for(var pt=0;pt<3;++pt)this.tickSpacing[pt]=0}else H("tickSpacing")&&(this.autoTicks=!0,lt=!0);if(this._firstInit&&("ticks"in N||"tickSpacing"in N||(this.autoTicks=!0),lt=!0,X=!0,this._firstInit=!1),lt&&this.autoTicks&&(q=s.create(this.bounds,this.tickSpacing),X=!0),X){for(var pt=0;pt<3;++pt)q[pt].sort(function(vt,it){return vt.x-it.x});s.equal(q,this.ticks)?X=!1:this.ticks=q}F("tickEnable"),U("tickFont")&&(X=!0),U("tickFontStyle")&&(X=!0),U("tickFontWeight")&&(X=!0),U("tickFontVariant")&&(X=!0),H("tickSize"),H("tickAngle"),H("tickPad"),W("tickColor");var tt=U("labels");U("labelFont")&&(tt=!0),U("labelFontStyle")&&(tt=!0),U("labelFontWeight")&&(tt=!0),U("labelFontVariant")&&(tt=!0),F("labelEnable"),H("labelSize"),H("labelPad"),W("labelColor"),F("lineEnable"),F("lineMirror"),H("lineWidth"),W("lineColor"),F("lineTickEnable"),F("lineTickMirror"),H("lineTickLength"),H("lineTickWidth"),W("lineTickColor"),F("gridEnable"),H("gridWidth"),W("gridColor"),F("zeroEnable"),W("zeroLineColor"),H("zeroLineWidth"),F("backgroundEnable"),W("backgroundColor");var dt=[{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]}],rt=[{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&&(tt||X)&&this._text.update(this.bounds,this.labels,dt,this.ticks,rt):this._text=a(this.gl,this.bounds,this.labels,dt,this.ticks,rt),this._lines&&X&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=n(this.gl,this.bounds,this.ticks))};function C(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var M=[new C,new C,new C];function E(N,V,H,F,U){for(var W=N.primalOffset,q=N.primalMinor,X=N.mirrorOffset,lt=N.mirrorMinor,yt=F[V],pt=0;pt<3;++pt)if(V!==pt){var st=W,tt=X,dt=q,rt=lt;yt&1<<pt&&(st=X,tt=W,dt=lt,rt=q),st[pt]=H[0][pt],tt[pt]=H[1][pt],U[pt]>0?(dt[pt]=-1,rt[pt]=0):(dt[pt]=0,rt[pt]=1)}}var A=[0,0,0],h={model:f,view:f,projection:f,_ortho:!1};_.isOpaque=function(){return!0},_.isTransparent=function(){return!1},_.drawTransparent=function(N){};var p=0,k=[0,0,0],w=[0,0,0],R=[0,0,0];_.draw=function(N){N=N||h;for(var V=this.gl,H=N.model||f,F=N.view||f,U=N.projection||f,W=this.bounds,q=N._ortho||!1,X=i(H,F,U,W,q),lt=X.cubeEdges,yt=X.axis,pt=F[12],st=F[13],tt=F[14],dt=F[15],rt=q?2:1,at=rt*this.pixelRatio*(U[3]*pt+U[7]*st+U[11]*tt+U[15]*dt)/V.drawingBufferHeight,vt=0;vt<3;++vt)this.lastCubeProps.cubeEdges[vt]=lt[vt],this.lastCubeProps.axis[vt]=yt[vt];for(var it=M,vt=0;vt<3;++vt)E(M[vt],vt,this.bounds,lt,yt);for(var V=this.gl,Y=A,vt=0;vt<3;++vt)this.backgroundEnable[vt]?Y[vt]=yt[vt]:Y[vt]=0;this._background.draw(H,F,U,W,Y,this.backgroundColor),this._lines.bind(H,F,U,this);for(var vt=0;vt<3;++vt){var ft=[0,0,0];yt[vt]>0?ft[vt]=W[1][vt]:ft[vt]=W[0][vt];for(var ut=0;ut<2;++ut){var wt=(vt+1+ut)%3,zt=(vt+1+(ut^1))%3;this.gridEnable[wt]&&this._lines.drawGrid(wt,zt,this.bounds,ft,this.gridColor[wt],this.gridWidth[wt]*this.pixelRatio)}for(var ut=0;ut<2;++ut){var wt=(vt+1+ut)%3,zt=(vt+1+(ut^1))%3;this.zeroEnable[zt]&&Math.min(W[0][zt],W[1][zt])<=0&&Math.max(W[0][zt],W[1][zt])>=0&&this._lines.drawZero(wt,zt,this.bounds,ft,this.zeroLineColor[zt],this.zeroLineWidth[zt]*this.pixelRatio)}}for(var vt=0;vt<3;++vt){this.lineEnable[vt]&&this._lines.drawAxisLine(vt,this.bounds,it[vt].primalOffset,this.lineColor[vt],this.lineWidth[vt]*this.pixelRatio),this.lineMirror[vt]&&this._lines.drawAxisLine(vt,this.bounds,it[vt].mirrorOffset,this.lineColor[vt],this.lineWidth[vt]*this.pixelRatio);for(var Pt=u(k,it[vt].primalMinor),Wt=u(w,it[vt].mirrorMinor),Ht=this.lineTickLength,ut=0;ut<3;++ut){var Jt=at/H[5*ut];Pt[ut]*=Ht[ut]*Jt,Wt[ut]*=Ht[ut]*Jt}this.lineTickEnable[vt]&&this._lines.drawAxisTicks(vt,it[vt].primalOffset,Pt,this.lineTickColor[vt],this.lineTickWidth[vt]*this.pixelRatio),this.lineTickMirror[vt]&&this._lines.drawAxisTicks(vt,it[vt].mirrorOffset,Wt,this.lineTickColor[vt],this.lineTickWidth[vt]*this.pixelRatio)}this._lines.unbind(),this._text.bind(H,F,U,this.pixelRatio);var ge,he=.5,de,se;function Tt(Te){se=[0,0,0],se[Te]=1}function Lt(Te,He,Ge){var cr=(Te+1)%3,ur=(Te+2)%3,jr=He[cr],Hr=He[ur],br=Ge[cr],Kr=Ge[ur];if(jr>0&&Kr>0){Tt(cr);return}else if(jr>0&&Kr<0){Tt(cr);return}else if(jr<0&&Kr>0){Tt(cr);return}else if(jr<0&&Kr<0){Tt(cr);return}else if(Hr>0&&br>0){Tt(ur);return}else if(Hr>0&&br<0){Tt(ur);return}else if(Hr<0&&br>0){Tt(ur);return}else if(Hr<0&&br<0){Tt(ur);return}}for(var vt=0;vt<3;++vt){for(var Mt=it[vt].primalMinor,te=it[vt].mirrorMinor,ve=u(R,it[vt].primalOffset),ut=0;ut<3;++ut)this.lineTickEnable[vt]&&(ve[ut]+=at*Mt[ut]*Math.max(this.lineTickLength[ut],0)/H[5*ut]);var oe=[0,0,0];if(oe[vt]=1,this.tickEnable[vt]){this.tickAngle[vt]===-3600?(this.tickAngle[vt]=0,this.tickAlign[vt]="auto"):this.tickAlign[vt]=-1,de=1,ge=[this.tickAlign[vt],he,de],ge[0]==="auto"?ge[0]=p:ge[0]=parseInt(""+ge[0]),se=[0,0,0],Lt(vt,Mt,te);for(var ut=0;ut<3;++ut)ve[ut]+=at*Mt[ut]*this.tickPad[ut]/H[5*ut];this._text.drawTicks(vt,this.tickSize[vt],this.tickAngle[vt],ve,this.tickColor[vt],oe,se,ge)}if(this.labelEnable[vt]){de=0,se=[0,0,0],this.labels[vt].length>4&&(Tt(vt),de=1),ge=[this.labelAlign[vt],he,de],ge[0]==="auto"?ge[0]=p:ge[0]=parseInt(""+ge[0]);for(var ut=0;ut<3;++ut)ve[ut]+=at*Mt[ut]*this.labelPad[ut]/H[5*ut];ve[vt]+=.5*(W[0][vt]+W[1][vt]),this._text.drawLabel(vt,this.labelSize[vt],this.labelAngle[vt],ve,this.labelColor[vt],[0,0,0],se,ge)}}this._text.unbind()},_.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function O(N,V){var H=new b(N);return H.update(V),H}},3840:function(t){t.exports=M;var e=0,r=1;function a(E,A,h,p,k,w){this._color=E,this.key=A,this.value=h,this.left=p,this.right=k,this._count=w}function n(E){return new a(E._color,E.key,E.value,E.left,E.right,E._count)}function o(E,A){return new a(E,A.key,A.value,A.left,A.right,A._count)}function i(E){E._count=1+(E.left?E.left._count:0)+(E.right?E.right._count:0)}function s(E,A){this._compare=E,this.root=A}var f=s.prototype;Object.defineProperty(f,"keys",{get:function(){var E=[];return this.forEach(function(A,h){E.push(A)}),E}}),Object.defineProperty(f,"values",{get:function(){var E=[];return this.forEach(function(A,h){E.push(h)}),E}}),Object.defineProperty(f,"length",{get:function(){return this.root?this.root._count:0}}),f.insert=function(E,A){for(var h=this._compare,p=this.root,k=[],w=[];p;){var R=h(E,p.key);k.push(p),w.push(R),R<=0?p=p.left:p=p.right}k.push(new a(e,E,A,null,null,1));for(var O=k.length-2;O>=0;--O){var p=k[O];w[O]<=0?k[O]=new a(p._color,p.key,p.value,k[O+1],p.right,p._count+1):k[O]=new a(p._color,p.key,p.value,p.left,k[O+1],p._count+1)}for(var O=k.length-1;O>1;--O){var N=k[O-1],p=k[O];if(N._color===r||p._color===r)break;var V=k[O-2];if(V.left===N)if(N.left===p){var H=V.right;if(H&&H._color===e)N._color=r,V.right=o(r,H),V._color=e,O-=1;else{if(V._color=e,V.left=N.right,N._color=r,N.right=V,k[O-2]=N,k[O-1]=p,i(V),i(N),O>=3){var F=k[O-3];F.left===V?F.left=N:F.right=N}break}}else{var H=V.right;if(H&&H._color===e)N._color=r,V.right=o(r,H),V._color=e,O-=1;else{if(N.right=p.left,V._color=e,V.left=p.right,p._color=r,p.left=N,p.right=V,k[O-2]=p,k[O-1]=N,i(V),i(N),i(p),O>=3){var F=k[O-3];F.left===V?F.left=p:F.right=p}break}}else if(N.right===p){var H=V.left;if(H&&H._color===e)N._color=r,V.left=o(r,H),V._color=e,O-=1;else{if(V._color=e,V.right=N.left,N._color=r,N.left=V,k[O-2]=N,k[O-1]=p,i(V),i(N),O>=3){var F=k[O-3];F.right===V?F.right=N:F.left=N}break}}else{var H=V.left;if(H&&H._color===e)N._color=r,V.left=o(r,H),V._color=e,O-=1;else{if(N.left=p.right,V._color=e,V.right=p.left,p._color=r,p.right=N,p.left=V,k[O-2]=p,k[O-1]=N,i(V),i(N),i(p),O>=3){var F=k[O-3];F.right===V?F.right=p:F.left=p}break}}}return k[0]._color=r,new s(h,k[0])};function x(E,A){if(A.left){var h=x(E,A.left);if(h)return h}var h=E(A.key,A.value);if(h)return h;if(A.right)return x(E,A.right)}function y(E,A,h,p){var k=A(E,p.key);if(k<=0){if(p.left){var w=y(E,A,h,p.left);if(w)return w}var w=h(p.key,p.value);if(w)return w}if(p.right)return y(E,A,h,p.right)}function v(E,A,h,p,k){var w=h(E,k.key),R=h(A,k.key),O;if(w<=0&&(k.left&&(O=v(E,A,h,p,k.left),O)||R>0&&(O=p(k.key,k.value),O)))return O;if(R>0&&k.right)return v(E,A,h,p,k.right)}f.forEach=function(E,A,h){if(this.root)switch(arguments.length){case 1:return x(E,this.root);case 2:return y(A,this._compare,E,this.root);case 3:return this._compare(A,h)>=0?void 0:v(A,h,this._compare,E,this.root)}},Object.defineProperty(f,"begin",{get:function(){for(var E=[],A=this.root;A;)E.push(A),A=A.left;return new T(this,E)}}),Object.defineProperty(f,"end",{get:function(){for(var E=[],A=this.root;A;)E.push(A),A=A.right;return new T(this,E)}}),f.at=function(E){if(E<0)return new T(this,[]);for(var A=this.root,h=[];;){if(h.push(A),A.left){if(E<A.left._count){A=A.left;continue}E-=A.left._count}if(!E)return new T(this,h);if(E-=1,A.right){if(E>=A.right._count)break;A=A.right}else break}return new T(this,[])},f.ge=function(E){for(var A=this._compare,h=this.root,p=[],k=0;h;){var w=A(E,h.key);p.push(h),w<=0&&(k=p.length),w<=0?h=h.left:h=h.right}return p.length=k,new T(this,p)},f.gt=function(E){for(var A=this._compare,h=this.root,p=[],k=0;h;){var w=A(E,h.key);p.push(h),w<0&&(k=p.length),w<0?h=h.left:h=h.right}return p.length=k,new T(this,p)},f.lt=function(E){for(var A=this._compare,h=this.root,p=[],k=0;h;){var w=A(E,h.key);p.push(h),w>0&&(k=p.length),w<=0?h=h.left:h=h.right}return p.length=k,new T(this,p)},f.le=function(E){for(var A=this._compare,h=this.root,p=[],k=0;h;){var w=A(E,h.key);p.push(h),w>=0&&(k=p.length),w<0?h=h.left:h=h.right}return p.length=k,new T(this,p)},f.find=function(E){for(var A=this._compare,h=this.root,p=[];h;){var k=A(E,h.key);if(p.push(h),k===0)return new T(this,p);k<=0?h=h.left:h=h.right}return new T(this,[])},f.remove=function(E){var A=this.find(E);return A?A.remove():this},f.get=function(E){for(var A=this._compare,h=this.root;h;){var p=A(E,h.key);if(p===0)return h.value;p<=0?h=h.left:h=h.right}};function T(E,A){this.tree=E,this._stack=A}var u=T.prototype;Object.defineProperty(u,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(u,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),u.clone=function(){return new T(this.tree,this._stack.slice())};function b(E,A){E.key=A.key,E.value=A.value,E.left=A.left,E.right=A.right,E._color=A._color,E._count=A._count}function _(E){for(var A,h,p,k,w=E.length-1;w>=0;--w){if(A=E[w],w===0){A._color=r;return}if(h=E[w-1],h.left===A){if(p=h.right,p.right&&p.right._color===e){if(p=h.right=n(p),k=p.right=n(p.right),h.right=p.left,p.left=h,p.right=k,p._color=h._color,A._color=r,h._color=r,k._color=r,i(h),i(p),w>1){var R=E[w-2];R.left===h?R.left=p:R.right=p}E[w-1]=p;return}else if(p.left&&p.left._color===e){if(p=h.right=n(p),k=p.left=n(p.left),h.right=k.left,p.left=k.right,k.left=h,k.right=p,k._color=h._color,h._color=r,p._color=r,A._color=r,i(h),i(p),i(k),w>1){var R=E[w-2];R.left===h?R.left=k:R.right=k}E[w-1]=k;return}if(p._color===r)if(h._color===e){h._color=r,h.right=o(e,p);return}else{h.right=o(e,p);continue}else{if(p=n(p),h.right=p.left,p.left=h,p._color=h._color,h._color=e,i(h),i(p),w>1){var R=E[w-2];R.left===h?R.left=p:R.right=p}E[w-1]=p,E[w]=h,w+1<E.length?E[w+1]=A:E.push(A),w=w+2}}else{if(p=h.left,p.left&&p.left._color===e){if(p=h.left=n(p),k=p.left=n(p.left),h.left=p.right,p.right=h,p.left=k,p._color=h._color,A._color=r,h._color=r,k._color=r,i(h),i(p),w>1){var R=E[w-2];R.right===h?R.right=p:R.left=p}E[w-1]=p;return}else if(p.right&&p.right._color===e){if(p=h.left=n(p),k=p.right=n(p.right),h.left=k.right,p.right=k.left,k.right=h,k.left=p,k._color=h._color,h._color=r,p._color=r,A._color=r,i(h),i(p),i(k),w>1){var R=E[w-2];R.right===h?R.right=k:R.left=k}E[w-1]=k;return}if(p._color===r)if(h._color===e){h._color=r,h.left=o(e,p);return}else{h.left=o(e,p);continue}else{if(p=n(p),h.left=p.right,p.right=h,p._color=h._color,h._color=e,i(h),i(p),w>1){var R=E[w-2];R.right===h?R.right=p:R.left=p}E[w-1]=p,E[w]=h,w+1<E.length?E[w+1]=A:E.push(A),w=w+2}}}}u.remove=function(){var E=this._stack;if(E.length===0)return this.tree;var A=new Array(E.length),h=E[E.length-1];A[A.length-1]=new a(h._color,h.key,h.value,h.left,h.right,h._count);for(var p=E.length-2;p>=0;--p){var h=E[p];h.left===E[p+1]?A[p]=new a(h._color,h.key,h.value,A[p+1],h.right,h._count):A[p]=new a(h._color,h.key,h.value,h.left,A[p+1],h._count)}if(h=A[A.length-1],h.left&&h.right){var k=A.length;for(h=h.left;h.right;)A.push(h),h=h.right;var w=A[k-1];A.push(new a(h._color,w.key,w.value,h.left,h.right,h._count)),A[k-1].key=h.key,A[k-1].value=h.value;for(var p=A.length-2;p>=k;--p)h=A[p],A[p]=new a(h._color,h.key,h.value,h.left,A[p+1],h._count);A[k-1].left=A[k]}if(h=A[A.length-1],h._color===e){var R=A[A.length-2];R.left===h?R.left=null:R.right===h&&(R.right=null),A.pop();for(var p=0;p<A.length;++p)A[p]._count--;return new s(this.tree._compare,A[0])}else if(h.left||h.right){h.left?b(h,h.left):h.right&&b(h,h.right),h._color=r;for(var p=0;p<A.length-1;++p)A[p]._count--;return new s(this.tree._compare,A[0])}else{if(A.length===1)return new s(this.tree._compare,null);for(var p=0;p<A.length;++p)A[p]._count--;var O=A[A.length-2];_(A),O.left===h?O.left=null:O.right=null}return new s(this.tree._compare,A[0])},Object.defineProperty(u,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(u,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(u,"index",{get:function(){var E=0,A=this._stack;if(A.length===0){var h=this.tree.root;return h?h._count:0}else A[A.length-1].left&&(E=A[A.length-1].left._count);for(var p=A.length-2;p>=0;--p)A[p+1]===A[p].right&&(++E,A[p].left&&(E+=A[p].left._count));return E},enumerable:!0}),u.next=function(){var E=this._stack;if(E.length!==0){var A=E[E.length-1];if(A.right)for(A=A.right;A;)E.push(A),A=A.left;else for(E.pop();E.length>0&&E[E.length-1].right===A;)A=E[E.length-1],E.pop()}},Object.defineProperty(u,"hasNext",{get:function(){var E=this._stack;if(E.length===0)return!1;if(E[E.length-1].right)return!0;for(var A=E.length-1;A>0;--A)if(E[A-1].left===E[A])return!0;return!1}}),u.update=function(E){var A=this._stack;if(A.length===0)throw new Error("Can't update empty node!");var h=new Array(A.length),p=A[A.length-1];h[h.length-1]=new a(p._color,p.key,E,p.left,p.right,p._count);for(var k=A.length-2;k>=0;--k)p=A[k],p.left===A[k+1]?h[k]=new a(p._color,p.key,p.value,h[k+1],p.right,p._count):h[k]=new a(p._color,p.key,p.value,p.left,h[k+1],p._count);return new s(this.tree._compare,h[0])},u.prev=function(){var E=this._stack;if(E.length!==0){var A=E[E.length-1];if(A.left)for(A=A.left;A;)E.push(A),A=A.right;else for(E.pop();E.length>0&&E[E.length-1].left===A;)A=E[E.length-1],E.pop()}},Object.defineProperty(u,"hasPrev",{get:function(){var E=this._stack;if(E.length===0)return!1;if(E[E.length-1].left)return!0;for(var A=E.length-1;A>0;--A)if(E[A-1].right===E[A])return!0;return!1}});function C(E,A){return E<A?-1:E>A?1:0}function M(E){return new s(E||C,null)}},3865:function(t,e,r){var a=r(869);t.exports=n;function n(o,i){return a(o[0].mul(i[1]).add(i[0].mul(o[1])),o[1].mul(i[1]))}},3952:function(t,e,r){t.exports=o;var a=r(3250);function n(i,s){for(var f=new Array(s+1),x=0;x<i.length;++x)f[x]=i[x];for(var x=0;x<=i.length;++x){for(var y=i.length;y<=s;++y){for(var v=new Array(s),T=0;T<s;++T)v[T]=Math.pow(y+1-x,T);f[y]=v}var u=a.apply(void 0,f);if(u)return!0}return!1}function o(i){var s=i.length;if(s===0)return[];if(s===1)return[0];for(var f=i[0].length,x=[i[0]],y=[0],v=1;v<s;++v){if(x.push(i[v]),!n(x,f)){x.pop();continue}if(y.push(v),y.length===f+1)return y}return y}},3990:function(t){t.exports=e;function e(r,a){return r[0]=a[0],r[1]=a[1],r[2]=a[2],r}},4008:function(t,e,r){t.exports=r(6690)},4025:function(t,e,r){var a=r(2361),n=r(8828).countTrailingZeros;t.exports=o;function o(i){var s=n(a.lo(i));if(s<32)return s;var f=n(a.hi(i));return f>20?52:f+32}},4040:function(t){t.exports=e;function e(r,a,n,o,i,s,f){var x=1/(a-n),y=1/(o-i),v=1/(s-f);return r[0]=-2*x,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*y,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*v,r[11]=0,r[12]=(a+n)*x,r[13]=(i+o)*y,r[14]=(f+s)*v,r[15]=1,r}},4041:function(t){t.exports=e;function e(r,a,n){var o=a[0],i=a[1],s=a[2],f=n[0],x=n[1],y=n[2],v=n[3],T=v*o+x*s-y*i,u=v*i+y*o-f*s,b=v*s+f*i-x*o,_=-f*o-x*i-y*s;return r[0]=T*v+_*-f+u*-y-b*-x,r[1]=u*v+_*-x+b*-f-T*-y,r[2]=b*v+_*-y+T*-x-u*-f,r[3]=a[3],r}},4081:function(t){t.exports=e;function e(r,a,n,o,i,s,f,x,y,v){var T=a+s+v;if(u>0){var u=Math.sqrt(T+1);r[0]=.5*(f-y)/u,r[1]=.5*(x-o)/u,r[2]=.5*(n-s)/u,r[3]=.5*u}else{var b=Math.max(a,s,v),u=Math.sqrt(2*b-T+1);a>=b?(r[0]=.5*u,r[1]=.5*(i+n)/u,r[2]=.5*(x+o)/u,r[3]=.5*(f-y)/u):s>=b?(r[0]=.5*(n+i)/u,r[1]=.5*u,r[2]=.5*(y+f)/u,r[3]=.5*(x-o)/u):(r[0]=.5*(o+x)/u,r[1]=.5*(f+y)/u,r[2]=.5*u,r[3]=.5*(n-i)/u)}return r}},4100:function(t,e,r){var a=r(4437),n=r(3837),o=r(5445),i=r(4449),s=r(3589),f=r(2260),x=r(7169),y=r(351),v=r(4772),T=r(4040),u=r(799),b=r(9216)({tablet:!0,featureDetect:!0});t.exports={createScene:A,createCamera:a};function _(){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 C(p,k){var w=null;try{w=p.getContext("webgl",k),w||(w=p.getContext("experimental-webgl",k))}catch{return null}return w}function M(p){var k=Math.round(Math.log(Math.abs(p))/Math.log(10));if(k<0){var w=Math.round(Math.pow(10,-k));return Math.ceil(p*w)/w}else if(k>0){var w=Math.round(Math.pow(10,k));return Math.ceil(p/w)*w}return Math.ceil(p)}function E(p){return typeof p=="boolean"?p:!0}function A(p){p=p||{},p.camera=p.camera||{};var k=p.canvas;if(!k)if(k=document.createElement("canvas"),p.container){var w=p.container;w.appendChild(k)}else document.body.appendChild(k);var R=p.gl;if(R||(p.glOptions&&(b=!!p.glOptions.preserveDrawingBuffer),R=C(k,p.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:b})),!R)throw new Error("webgl not supported");var O=p.bounds||[[-10,-10,-10],[10,10,10]],N=new _,V=f(R,R.drawingBufferWidth,R.drawingBufferHeight,{preferFloat:!b}),H=u(R),F=p.cameraObject&&p.cameraObject._ortho===!0||p.camera.projection&&p.camera.projection.type==="orthographic"||!1,U={eye:p.camera.eye||[2,0,0],center:p.camera.center||[0,0,0],up:p.camera.up||[0,1,0],zoomMin:p.camera.zoomMax||.1,zoomMax:p.camera.zoomMin||100,mode:p.camera.mode||"turntable",_ortho:F},W=p.axes||{},q=n(R,W);q.enable=!W.disable;var X=p.spikes||{},lt=i(R,X),yt=[],pt=[],st=[],tt=[],dt=!0,it=!0,rt=new Array(16),at=new Array(16),vt={view:null,projection:rt,model:at,_ortho:!1},it=!0,Y=[R.drawingBufferWidth,R.drawingBufferHeight],ft=p.cameraObject||a(k,U),ut={gl:R,contextLost:!1,pixelRatio:p.pixelRatio||1,canvas:k,selection:N,camera:ft,axes:q,axesPixels:null,spikes:lt,bounds:O,objects:yt,shape:Y,aspect:p.aspectRatio||[1,1,1],pickRadius:p.pickRadius||10,zNear:p.zNear||.01,zFar:p.zFar||1e3,fovy:p.fovy||Math.PI/4,clearColor:p.clearColor||[0,0,0,0],autoResize:E(p.autoResize),autoBounds:E(p.autoBounds),autoScale:!!p.autoScale,autoCenter:E(p.autoCenter),clipToBounds:E(p.clipToBounds),snapToData:!!p.snapToData,onselect:p.onselect||null,onrender:p.onrender||null,onclick:p.onclick||null,cameraParams:vt,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(se){this.aspect[0]=se.x,this.aspect[1]=se.y,this.aspect[2]=se.z,it=!0},setBounds:function(se,Tt){this.bounds[0][se]=Tt.min,this.bounds[1][se]=Tt.max},setClearColor:function(se){this.clearColor=se},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)}},wt=[R.drawingBufferWidth/ut.pixelRatio|0,R.drawingBufferHeight/ut.pixelRatio|0];function zt(){if(!ut._stopped&&ut.autoResize){var se=k.parentNode,Tt=1,Lt=1;se&&se!==document.body?(Tt=se.clientWidth,Lt=se.clientHeight):(Tt=window.innerWidth,Lt=window.innerHeight);var Mt=Math.ceil(Tt*ut.pixelRatio)|0,te=Math.ceil(Lt*ut.pixelRatio)|0;if(Mt!==k.width||te!==k.height){k.width=Mt,k.height=te;var ve=k.style;ve.position=ve.position||"absolute",ve.left="0px",ve.top="0px",ve.width=Tt+"px",ve.height=Lt+"px",dt=!0}}}ut.autoResize&&zt(),window.addEventListener("resize",zt);function Pt(){for(var se=yt.length,Tt=tt.length,Lt=0;Lt<Tt;++Lt)st[Lt]=0;t:for(var Lt=0;Lt<se;++Lt){var Mt=yt[Lt],te=Mt.pickSlots;if(!te){pt[Lt]=-1;continue}for(var ve=0;ve<Tt;++ve)if(st[ve]+te<255){pt[Lt]=ve,Mt.setPickBase(st[ve]+1),st[ve]+=te;continue t}var oe=s(R,Y);pt[Lt]=Tt,tt.push(oe),st.push(te),Mt.setPickBase(1),Tt+=1}for(;Tt>0&&st[Tt-1]===0;)st.pop(),tt.pop().dispose()}ut.update=function(se){ut._stopped||(dt=!0,it=!0)},ut.add=function(se){ut._stopped||(se.axes=q,yt.push(se),pt.push(-1),dt=!0,it=!0,Pt())},ut.remove=function(se){if(!ut._stopped){var Tt=yt.indexOf(se);Tt<0||(yt.splice(Tt,1),pt.pop(),dt=!0,it=!0,Pt())}},ut.dispose=function(){if(!ut._stopped&&(ut._stopped=!0,window.removeEventListener("resize",zt),k.removeEventListener("webglcontextlost",Wt),ut.mouseListener.enabled=!1,!ut.contextLost)){q.dispose(),lt.dispose();for(var se=0;se<yt.length;++se)yt[se].dispose();V.dispose();for(var se=0;se<tt.length;++se)tt[se].dispose();H.dispose(),R=null,q=null,lt=null,yt=[]}},ut._mouseRotating=!1,ut._prevButtons=0,ut.enableMouseListeners=function(){ut.mouseListener=y(k,function(se,Tt,Lt){if(!ut._stopped){var Mt=tt.length,te=yt.length,ve=N.object;N.distance=1/0,N.mouse[0]=Tt,N.mouse[1]=Lt,N.object=null,N.screen=null,N.dataCoordinate=N.dataPosition=null;var oe=!1;if(se&&ut._prevButtons)ut._mouseRotating=!0;else{ut._mouseRotating&&(it=!0),ut._mouseRotating=!1;for(var Te=0;Te<Mt;++Te){var He=tt[Te].query(Tt,wt[1]-Lt-1,ut.pickRadius);if(He){if(He.distance>N.distance)continue;for(var Ge=0;Ge<te;++Ge){var cr=yt[Ge];if(pt[Ge]===Te){var ur=cr.pick(He);ur&&(N.buttons=se,N.screen=He.coord,N.distance=He.distance,N.object=cr,N.index=ur.distance,N.dataPosition=ur.position,N.dataCoordinate=ur.dataCoordinate,N.data=ur,oe=!0)}}}}}ve&&ve!==N.object&&(ve.highlight&&ve.highlight(null),dt=!0),N.object&&(N.object.highlight&&N.object.highlight(N.data),dt=!0),oe=oe||N.object!==ve,oe&&ut.onselect&&ut.onselect(N),se&1&&!(ut._prevButtons&1)&&ut.onclick&&ut.onclick(N),ut._prevButtons=se}})};function Wt(){if(ut.contextLost)return!0;R.isContextLost()&&(ut.contextLost=!0,ut.mouseListener.enabled=!1,ut.selection.object=null,ut.oncontextloss&&ut.oncontextloss())}k.addEventListener("webglcontextlost",Wt);function Ht(){if(!Wt()){R.colorMask(!0,!0,!0,!0),R.depthMask(!0),R.disable(R.BLEND),R.enable(R.DEPTH_TEST),R.depthFunc(R.LEQUAL);for(var se=yt.length,Tt=tt.length,Lt=0;Lt<Tt;++Lt){var Mt=tt[Lt];Mt.shape=wt,Mt.begin();for(var te=0;te<se;++te)if(pt[te]===Lt){var ve=yt[te];ve.drawPick&&(ve.pixelRatio=1,ve.drawPick(vt))}Mt.end()}}}var Jt=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],ge=[Jt[0].slice(),Jt[1].slice()];function he(){if(!Wt()){zt();var se=ut.camera.tick();vt.view=ut.camera.matrix,dt=dt||se,it=it||se,q.pixelRatio=ut.pixelRatio,lt.pixelRatio=ut.pixelRatio;var Tt=yt.length,Lt=Jt[0],Mt=Jt[1];Lt[0]=Lt[1]=Lt[2]=1/0,Mt[0]=Mt[1]=Mt[2]=-1/0;for(var te=0;te<Tt;++te){var ve=yt[te];ve.pixelRatio=ut.pixelRatio,ve.axes=ut.axes,dt=dt||!!ve.dirty,it=it||!!ve.dirty;var oe=ve.bounds;if(oe)for(var Te=oe[0],He=oe[1],Ge=0;Ge<3;++Ge)Lt[Ge]=Math.min(Lt[Ge],Te[Ge]),Mt[Ge]=Math.max(Mt[Ge],He[Ge])}var cr=ut.bounds;if(ut.autoBounds)for(var Ge=0;Ge<3;++Ge){if(Mt[Ge]<Lt[Ge])Lt[Ge]=-1,Mt[Ge]=1;else{Lt[Ge]===Mt[Ge]&&(Lt[Ge]-=1,Mt[Ge]+=1);var ur=.05*(Mt[Ge]-Lt[Ge]);Lt[Ge]=Lt[Ge]-ur,Mt[Ge]=Mt[Ge]+ur}cr[0][Ge]=Lt[Ge],cr[1][Ge]=Mt[Ge]}for(var jr=!1,Ge=0;Ge<3;++Ge)jr=jr||ge[0][Ge]!==cr[0][Ge]||ge[1][Ge]!==cr[1][Ge],ge[0][Ge]=cr[0][Ge],ge[1][Ge]=cr[1][Ge];if(it=it||jr,dt=dt||jr,!!dt){if(jr){for(var Hr=[0,0,0],te=0;te<3;++te)Hr[te]=M((cr[1][te]-cr[0][te])/10);q.autoTicks?q.update({bounds:cr,tickSpacing:Hr}):q.update({bounds:cr})}var br=R.drawingBufferWidth,Kr=R.drawingBufferHeight;Y[0]=br,Y[1]=Kr,wt[0]=Math.max(br/ut.pixelRatio,1)|0,wt[1]=Math.max(Kr/ut.pixelRatio,1)|0,h(ut,F);for(var te=0;te<Tt;++te){var ve=yt[te];ve.axesBounds=cr,ut.clipToBounds&&(ve.clipBounds=cr)}N.object&&(ut.snapToData?lt.position=N.dataCoordinate:lt.position=N.dataPosition,lt.bounds=cr),it&&(it=!1,Ht()),ut.axesPixels=o(ut.axes,vt,br,Kr),ut.onrender&&ut.onrender(),R.bindFramebuffer(R.FRAMEBUFFER,null),R.viewport(0,0,br,Kr),ut.clearRGBA(),R.depthMask(!0),R.colorMask(!0,!0,!0,!0),R.enable(R.DEPTH_TEST),R.depthFunc(R.LEQUAL),R.disable(R.BLEND),R.disable(R.CULL_FACE);var rn=!1;q.enable&&(rn=rn||q.isTransparent(),q.draw(vt)),lt.axes=q,N.object&&lt.draw(vt),R.disable(R.CULL_FACE);for(var te=0;te<Tt;++te){var ve=yt[te];ve.axes=q,ve.pixelRatio=ut.pixelRatio,ve.isOpaque&&ve.isOpaque()&&ve.draw(vt),ve.isTransparent&&ve.isTransparent()&&(rn=!0)}if(rn){V.shape=Y,V.bind(),R.clear(R.DEPTH_BUFFER_BIT),R.colorMask(!1,!1,!1,!1),R.depthMask(!0),R.depthFunc(R.LESS),q.enable&&q.isTransparent()&&q.drawTransparent(vt);for(var te=0;te<Tt;++te){var ve=yt[te];ve.isOpaque&&ve.isOpaque()&&ve.draw(vt)}R.enable(R.BLEND),R.blendEquation(R.FUNC_ADD),R.blendFunc(R.ONE,R.ONE_MINUS_SRC_ALPHA),R.colorMask(!0,!0,!0,!0),R.depthMask(!1),R.clearColor(0,0,0,0),R.clear(R.COLOR_BUFFER_BIT),q.isTransparent()&&q.drawTransparent(vt);for(var te=0;te<Tt;++te){var ve=yt[te];ve.isTransparent&&ve.isTransparent()&&ve.drawTransparent(vt)}R.bindFramebuffer(R.FRAMEBUFFER,null),R.blendFunc(R.ONE,R.ONE_MINUS_SRC_ALPHA),R.disable(R.DEPTH_TEST),H.bind(),V.color[0].bind(0),H.uniforms.accumBuffer=0,x(R),R.disable(R.BLEND)}dt=!1;for(var te=0;te<Tt;++te)yt[te].dirty=!1}}}function de(){ut._stopped||ut.contextLost||(he(),requestAnimationFrame(de))}return ut.enableMouseListeners(),de(),ut.redraw=function(){ut._stopped||(dt=!0,he())},ut}function h(p,k){var w=p.bounds,R=p.cameraParams,O=R.projection,N=R.model,V=p.gl.drawingBufferWidth,H=p.gl.drawingBufferHeight,F=p.zNear,U=p.zFar,W=p.fovy,q=V/H;k?(T(O,-q,q,-1,1,F,U),R._ortho=!0):(v(O,W,q,F,U),R._ortho=!1);for(var X=0;X<16;++X)N[X]=0;N[15]=1;for(var lt=0,X=0;X<3;++X)lt=Math.max(lt,w[1][X]-w[0][X]);for(var X=0;X<3;++X)p.autoScale?N[5*X]=p.aspect[X]/(w[1][X]-w[0][X]):N[5*X]=1/lt,p.autoCenter&&(N[12+X]=-N[5*X]*.5*(w[0][X]+w[1][X]))}},4192:function(t){t.exports=r;var e=32;function r(v,T){T<=4*e?a(0,T-1,v):y(0,T-1,v)}function a(v,T,u){for(var b=2*(v+1),_=v+1;_<=T;++_){for(var C=u[b++],M=u[b++],E=_,A=b-2;E-- >v;){var h=u[A-2],p=u[A-1];if(h<C||h===C&&p<M)break;u[A]=h,u[A+1]=p,A-=2}u[A]=C,u[A+1]=M}}function n(v,T,u){v*=2,T*=2;var b=u[v],_=u[v+1];u[v]=u[T],u[v+1]=u[T+1],u[T]=b,u[T+1]=_}function o(v,T,u){v*=2,T*=2,u[v]=u[T],u[v+1]=u[T+1]}function i(v,T,u,b){v*=2,T*=2,u*=2;var _=b[v],C=b[v+1];b[v]=b[T],b[v+1]=b[T+1],b[T]=b[u],b[T+1]=b[u+1],b[u]=_,b[u+1]=C}function s(v,T,u,b,_){v*=2,T*=2,_[v]=_[T],_[T]=u,_[v+1]=_[T+1],_[T+1]=b}function f(v,T,u){v*=2,T*=2;var b=u[v],_=u[T];return b<_?!1:b===_?u[v+1]>u[T+1]:!0}function x(v,T,u,b){v*=2;var _=b[v];return _<T?!0:_===T?b[v+1]<u:!1}function y(v,T,u){var b=(T-v+1)/6|0,_=v+b,C=T-b,M=v+T>>1,E=M-b,A=M+b,h=_,p=E,k=M,w=A,R=C,O=v+1,N=T-1,V=0;f(h,p,u)&&(V=h,h=p,p=V),f(w,R,u)&&(V=w,w=R,R=V),f(h,k,u)&&(V=h,h=k,k=V),f(p,k,u)&&(V=p,p=k,k=V),f(h,w,u)&&(V=h,h=w,w=V),f(k,w,u)&&(V=k,k=w,w=V),f(p,R,u)&&(V=p,p=R,R=V),f(p,k,u)&&(V=p,p=k,k=V),f(w,R,u)&&(V=w,w=R,R=V);for(var H=u[2*p],F=u[2*p+1],U=u[2*w],W=u[2*w+1],q=2*h,X=2*k,lt=2*R,yt=2*_,pt=2*M,st=2*C,tt=0;tt<2;++tt){var dt=u[q+tt],rt=u[X+tt],at=u[lt+tt];u[yt+tt]=dt,u[pt+tt]=rt,u[st+tt]=at}o(E,v,u),o(A,T,u);for(var vt=O;vt<=N;++vt)if(x(vt,H,F,u))vt!==O&&n(vt,O,u),++O;else if(!x(vt,U,W,u))for(;;)if(x(N,U,W,u)){x(N,H,F,u)?(i(vt,O,N,u),++O,--N):(n(vt,N,u),--N);break}else{if(--N<vt)break;continue}s(v,O-1,H,F,u),s(T,N+1,U,W,u),O-2-v<=e?a(v,O-2,u):y(v,O-2,u),T-(N+2)<=e?a(N+2,T,u):y(N+2,T,u),N-O<=e?a(O,N,u):y(O,N,u)}},4209:function(t,e,r){t.exports=u;var a=r(2478),n=r(3840),o=r(3250),i=r(1303);function s(b,_,C){this.slabs=b,this.coordinates=_,this.horizontal=C}var f=s.prototype;function x(b,_){return b.y-_}function y(b,_){for(var C=null;b;){var M=b.key,E,A;M[0][0]<M[1][0]?(E=M[0],A=M[1]):(E=M[1],A=M[0]);var h=o(E,A,_);if(h<0)b=b.left;else if(h>0)if(_[0]!==M[1][0])C=b,b=b.right;else{var p=y(b.right,_);if(p)return p;b=b.left}else{if(_[0]!==M[1][0])return b;var p=y(b.right,_);if(p)return p;b=b.left}}return C}f.castUp=function(b){var _=a.le(this.coordinates,b[0]);if(_<0)return-1;this.slabs[_];var C=y(this.slabs[_],b),M=-1;if(C&&(M=C.value),this.coordinates[_]===b[0]){var E=null;if(C&&(E=C.key),_>0){var A=y(this.slabs[_-1],b);A&&(E?i(A.key,E)>0&&(E=A.key,M=A.value):(M=A.value,E=A.key))}var h=this.horizontal[_];if(h.length>0){var p=a.ge(h,b[1],x);if(p<h.length){var k=h[p];if(b[1]===k.y){if(k.closed)return k.index;for(;p<h.length-1&&h[p+1].y===b[1];)if(p=p+1,k=h[p],k.closed)return k.index;if(k.y===b[1]&&!k.start){if(p=p+1,p>=h.length)return M;k=h[p]}}if(k.start)if(E){var w=o(E[0],E[1],[b[0],k.y]);E[0][0]>E[1][0]&&(w=-w),w>0&&(M=k.index)}else M=k.index;else k.y!==b[1]&&(M=k.index)}}}return M};function v(b,_,C,M){this.y=b,this.index=_,this.start=C,this.closed=M}function T(b,_,C,M){this.x=b,this.segment=_,this.create=C,this.index=M}function u(b){for(var _=b.length,C=2*_,M=new Array(C),E=0;E<_;++E){var A=b[E],h=A[0][0]<A[1][0];M[2*E]=new T(A[0][0],A,h,E),M[2*E+1]=new T(A[1][0],A,!h,E)}M.sort(function(F,U){var W=F.x-U.x;return W||(W=F.create-U.create,W)?W:Math.min(F.segment[0][1],F.segment[1][1])-Math.min(U.segment[0][1],U.segment[1][1])});for(var p=n(i),k=[],w=[],R=[],O=-1/0,E=0;E<C;){for(var N=M[E].x,V=[];E<C;){var H=M[E];if(H.x!==N)break;E+=1,H.segment[0][0]===H.x&&H.segment[1][0]===H.x?H.create&&(H.segment[0][1]<H.segment[1][1]?(V.push(new v(H.segment[0][1],H.index,!0,!0)),V.push(new v(H.segment[1][1],H.index,!1,!1))):(V.push(new v(H.segment[1][1],H.index,!0,!1)),V.push(new v(H.segment[0][1],H.index,!1,!0)))):H.create?p=p.insert(H.segment,H.index):p=p.remove(H.segment)}k.push(p.root),w.push(N),R.push(V)}return new s(k,w,R)}},4317:function(t){function e(i,s){var f=Math.floor(s),x=s-f,y=0<=f&&f<i.shape[0],v=0<=f+1&&f+1<i.shape[0],T=y?+i.get(f):0,u=v?+i.get(f+1):0;return(1-x)*T+x*u}function r(i,s,f){var x=Math.floor(s),y=s-x,v=0<=x&&x<i.shape[0],T=0<=x+1&&x+1<i.shape[0],u=Math.floor(f),b=f-u,_=0<=u&&u<i.shape[1],C=0<=u+1&&u+1<i.shape[1],M=v&&_?i.get(x,u):0,E=v&&C?i.get(x,u+1):0,A=T&&_?i.get(x+1,u):0,h=T&&C?i.get(x+1,u+1):0;return(1-b)*((1-y)*M+y*A)+b*((1-y)*E+y*h)}function a(i,s,f,x){var y=Math.floor(s),v=s-y,T=0<=y&&y<i.shape[0],u=0<=y+1&&y+1<i.shape[0],b=Math.floor(f),_=f-b,C=0<=b&&b<i.shape[1],M=0<=b+1&&b+1<i.shape[1],E=Math.floor(x),A=x-E,h=0<=E&&E<i.shape[2],p=0<=E+1&&E+1<i.shape[2],k=T&&C&&h?i.get(y,b,E):0,w=T&&M&&h?i.get(y,b+1,E):0,R=u&&C&&h?i.get(y+1,b,E):0,O=u&&M&&h?i.get(y+1,b+1,E):0,N=T&&C&&p?i.get(y,b,E+1):0,V=T&&M&&p?i.get(y,b+1,E+1):0,H=u&&C&&p?i.get(y+1,b,E+1):0,F=u&&M&&p?i.get(y+1,b+1,E+1):0;return(1-A)*((1-_)*((1-v)*k+v*R)+_*((1-v)*w+v*O))+A*((1-_)*((1-v)*N+v*H)+_*((1-v)*V+v*F))}function n(i){var s=i.shape.length|0,f=new Array(s),x=new Array(s),y=new Array(s),v=new Array(s),T,u;for(T=0;T<s;++T)u=+arguments[T+1],f[T]=Math.floor(u),x[T]=u-f[T],y[T]=0<=f[T]&&f[T]<i.shape[T],v[T]=0<=f[T]+1&&f[T]+1<i.shape[T];var b=0,_,C,M;t:for(T=0;T<1<<s;++T){for(C=1,M=i.offset,_=0;_<s;++_)if(T&1<<_){if(!v[_])continue t;C*=x[_],M+=i.stride[_]*(f[_]+1)}else{if(!y[_])continue t;C*=1-x[_],M+=i.stride[_]*f[_]}b+=C*i.data[M]}return b}function o(i,s,f,x){switch(i.shape.length){case 0:return 0;case 1:return e(i,s);case 2:return r(i,s,f);case 3:return a(i,s,f,x);default:return n.apply(void 0,arguments)}}t.exports=o,t.exports.d1=e,t.exports.d2=r,t.exports.d3=a},4335:function(t){t.exports=function(e,r){var a=r[15];if(a===0)return!1;for(var n=1/a,o=0;o<16;o++)e[o]=r[o]*n;return!0}},4359:function(t,e,r){t.exports=i;var a=r(7718),n=null,o=null;typeof document<"u"&&(n=document.createElement("canvas"),n.width=8192,n.height=1024,o=n.getContext("2d"));function i(s,f){return(typeof f!="object"||f===null)&&(f={}),a(s,f.canvas||n,f.context||o,f)}},4361:function(t){t.exports=e;function e(r,a,n){return r[0]=a[0]+n[0],r[1]=a[1]+n[1],r[2]=a[2]+n[2],r[3]=a[3]+n[3],r}},4437:function(t,e,r){t.exports=x;var a=r(3025),n=r(6296),o=r(351),i=r(8512),s=r(24),f=r(7520);function x(y,v){y=y||document.body,v=v||{};var T=[.01,1/0];"distanceLimits"in v&&(T[0]=v.distanceLimits[0],T[1]=v.distanceLimits[1]),"zoomMin"in v&&(T[0]=v.zoomMin),"zoomMax"in v&&(T[1]=v.zoomMax);var u=n({center:v.center||[0,0,0],up:v.up||[0,1,0],eye:v.eye||[0,0,10],mode:v.mode||"orbit",distanceLimits:T}),b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_=0,C=y.clientWidth,M=y.clientHeight,E={keyBindingMode:"rotate",enableWheel:!0,view:u,element:y,delay:v.delay||16,rotateSpeed:v.rotateSpeed||1,zoomSpeed:v.zoomSpeed||1,translateSpeed:v.translateSpeed||1,flipX:!!v.flipX,flipY:!!v.flipY,modes:u.modes,_ortho:v._ortho||v.projection&&v.projection.type==="orthographic"||!1,tick:function(){var A=a(),h=this.delay,p=A-2*h;u.idle(A-h),u.recalcMatrix(p),u.flush(A-(100+h*2));for(var k=!0,w=u.computedMatrix,R=0;R<16;++R)k=k&&b[R]===w[R],b[R]=w[R];var O=y.clientWidth===C&&y.clientHeight===M;return C=y.clientWidth,M=y.clientHeight,k?!O:(_=Math.exp(u.computedRadius[0]),!0)},lookAt:function(A,h,p){u.lookAt(u.lastT(),A,h,p)},rotate:function(A,h,p){u.rotate(u.lastT(),A,h,p)},pan:function(A,h,p){u.pan(u.lastT(),A,h,p)},translate:function(A,h,p){u.translate(u.lastT(),A,h,p)}};return Object.defineProperties(E,{matrix:{get:function(){return u.computedMatrix},set:function(A){return u.setMatrix(u.lastT(),A),u.computedMatrix},enumerable:!0},mode:{get:function(){return u.getMode()},set:function(A){var h=u.computedUp.slice(),p=u.computedEye.slice(),k=u.computedCenter.slice();if(u.setMode(A),A==="turntable"){var w=a();u._active.lookAt(w,p,k,h),u._active.lookAt(w+500,p,k,[0,0,1]),u._active.flush(w)}return u.getMode()},enumerable:!0},center:{get:function(){return u.computedCenter},set:function(A){return u.lookAt(u.lastT(),null,A),u.computedCenter},enumerable:!0},eye:{get:function(){return u.computedEye},set:function(A){return u.lookAt(u.lastT(),A),u.computedEye},enumerable:!0},up:{get:function(){return u.computedUp},set:function(A){return u.lookAt(u.lastT(),null,null,A),u.computedUp},enumerable:!0},distance:{get:function(){return _},set:function(A){return u.setDistance(u.lastT(),A),A},enumerable:!0},distanceLimits:{get:function(){return u.getDistanceLimits(T)},set:function(A){return u.setDistanceLimits(A),A},enumerable:!0}}),y.addEventListener("contextmenu",function(A){return A.preventDefault(),!1}),E._lastX=-1,E._lastY=-1,E._lastMods={shift:!1,control:!1,alt:!1,meta:!1},E.enableMouseListeners=function(){E.mouseListener=o(y,A),y.addEventListener("touchstart",function(h){var p=s(h.changedTouches[0],y);A(0,p[0],p[1],E._lastMods),A(1,p[0],p[1],E._lastMods)},f?{passive:!0}:!1),y.addEventListener("touchmove",function(h){var p=s(h.changedTouches[0],y);A(1,p[0],p[1],E._lastMods),h.preventDefault()},f?{passive:!1}:!1),y.addEventListener("touchend",function(h){A(0,E._lastX,E._lastY,E._lastMods)},f?{passive:!0}:!1);function A(h,p,k,w){var R=E.keyBindingMode;if(R!==!1){var O=R==="rotate",N=R==="pan",V=R==="zoom",H=!!w.control,F=!!w.alt,U=!!w.shift,W=!!(h&1),q=!!(h&2),X=!!(h&4),lt=1/y.clientHeight,yt=lt*(p-E._lastX),pt=lt*(k-E._lastY),st=E.flipX?1:-1,tt=E.flipY?1:-1,dt=Math.PI*E.rotateSpeed,rt=a();if(E._lastX!==-1&&E._lastY!==-1&&((O&&W&&!H&&!F&&!U||W&&!H&&!F&&U)&&u.rotate(rt,st*dt*yt,-tt*dt*pt,0),(N&&W&&!H&&!F&&!U||q||W&&H&&!F&&!U)&&u.pan(rt,-E.translateSpeed*yt*_,E.translateSpeed*pt*_,0),V&&W&&!H&&!F&&!U||X||W&&!H&&F&&!U)){var at=-E.zoomSpeed*pt/window.innerHeight*(rt-u.lastT())*100;u.pan(rt,0,0,_*(Math.exp(at)-1))}return E._lastX=p,E._lastY=k,E._lastMods=w,!0}}E.wheelListener=i(y,function(h,p){if(E.keyBindingMode!==!1&&E.enableWheel){var k=E.flipX?1:-1,w=E.flipY?1:-1,R=a();if(Math.abs(h)>Math.abs(p))u.rotate(R,0,0,-h*k*Math.PI*E.rotateSpeed/window.innerWidth);else if(!E._ortho){var O=-E.zoomSpeed*w*p/window.innerHeight*(R-u.lastT())/20;u.pan(R,0,0,_*(Math.exp(O)-1))}}},!0)},E.enableMouseListeners(),E}},4449:function(t,e,r){var a=r(2762),n=r(8116),o=r(1493);t.exports=T;var i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(u,b,_,C){this.gl=u,this.buffer=b,this.vao=_,this.shader=C,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,x=[0,0,0],y=[0,0,0],v=[0,0];f.isTransparent=function(){return!1},f.drawTransparent=function(u){},f.draw=function(u){var b=this.gl,_=this.vao,C=this.shader;_.bind(),C.bind();var M=u.model||i,E=u.view||i,A=u.projection||i,h;this.axes&&(h=this.axes.lastCubeProps.axis);for(var p=x,k=y,w=0;w<3;++w)h&&h[w]<0?(p[w]=this.bounds[0][w],k[w]=this.bounds[1][w]):(p[w]=this.bounds[1][w],k[w]=this.bounds[0][w]);v[0]=b.drawingBufferWidth,v[1]=b.drawingBufferHeight,C.uniforms.model=M,C.uniforms.view=E,C.uniforms.projection=A,C.uniforms.coordinates=[this.position,p,k],C.uniforms.colors=this.colors,C.uniforms.screenShape=v;for(var w=0;w<3;++w)C.uniforms.lineWidth=this.lineWidth[w]*this.pixelRatio,this.enabled[w]&&(_.draw(b.TRIANGLES,6,6*w),this.drawSides[w]&&_.draw(b.TRIANGLES,12,18+12*w));_.unbind()},f.update=function(u){u&&("bounds"in u&&(this.bounds=u.bounds),"position"in u&&(this.position=u.position),"lineWidth"in u&&(this.lineWidth=u.lineWidth),"colors"in u&&(this.colors=u.colors),"enabled"in u&&(this.enabled=u.enabled),"drawSides"in u&&(this.drawSides=u.drawSides))},f.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function T(u,b){var _=[];function C(p,k,w,R,O,N){var V=[p,k,w,0,0,0,1];V[R+3]=1,V[R]=O,_.push.apply(_,V),V[6]=-1,_.push.apply(_,V),V[R]=N,_.push.apply(_,V),_.push.apply(_,V),V[6]=1,_.push.apply(_,V),V[R]=O,_.push.apply(_,V)}C(0,0,0,0,0,1),C(0,0,0,1,0,1),C(0,0,0,2,0,1),C(1,0,0,1,-1,1),C(1,0,0,2,-1,1),C(0,1,0,0,-1,1),C(0,1,0,2,-1,1),C(0,0,1,0,-1,1),C(0,0,1,1,-1,1);var M=a(u,_),E=n(u,[{type:u.FLOAT,buffer:M,size:3,offset:0,stride:28},{type:u.FLOAT,buffer:M,size:3,offset:12,stride:28},{type:u.FLOAT,buffer:M,size:1,offset:24,stride:28}]),A=o(u);A.attributes.position.location=0,A.attributes.color.location=1,A.attributes.weight.location=2;var h=new s(u,M,E,A);return h.update(b),h}},4494:function(t){t.exports=e;function e(r,a){return r[0]=1/a[0],r[1]=1/a[1],r[2]=1/a[2],r[3]=1/a[3],r}},4505:function(t,e,r){t.exports=r(5847)},4578:function(t){t.exports=e;function e(r,a,n,o,i){return r[0]=a,r[1]=n,r[2]=o,r[3]=i,r}},4623:function(t){"use restrict";t.exports=e;function e(r){this.roots=new Array(r),this.ranks=new Array(r);for(var a=0;a<r;++a)this.roots[a]=a,this.ranks[a]=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 a=this.roots;a[r]!==r;){var n=a[r];a[r]=a[n],r=n}return r},e.prototype.link=function(r,a){var n=this.find(r),o=this.find(a);if(n!==o){var i=this.ranks,s=this.roots,f=i[n],x=i[o];f<x?s[n]=o:x<f?s[o]=n:(s[o]=n,++i[n])}}},4687:function(t,e){function r(i){if(typeof i=="object"){if("buttons"in i)return i.buttons;if("which"in i){var s=i.which;if(s===2)return 4;if(s===3)return 2;if(s>0)return 1<<s-1}else if("button"in i){var s=i.button;if(s===1)return 4;if(s===2)return 2;if(s>=0)return 1<<s}}return 0}e.buttons=r;function a(i){return i.target||i.srcElement||window}e.element=a;function n(i){if(typeof i=="object"){if("offsetX"in i)return i.offsetX;var s=a(i),f=s.getBoundingClientRect();return i.clientX-f.left}return 0}e.x=n;function o(i){if(typeof i=="object"){if("offsetY"in i)return i.offsetY;var s=a(i),f=s.getBoundingClientRect();return i.clientY-f.top}return 0}e.y=o},4691:function(t){t.exports=e;function e(r,a){var n=a[0]-r[0],o=a[1]-r[1],i=a[2]-r[2],s=a[3]-r[3];return Math.sqrt(n*n+o*o+i*i+s*s)}},4750:function(t,e,r){t.exports=n;var a=r(3090);function n(o){var i=a(o),s=i.length;if(s<=2)return[];for(var f=new Array(s),x=i[s-1],y=0;y<s;++y){var v=i[y];f[y]=[x,v],x=v}return f}},4769:function(t){function e(a,n,o,i,s,f){var x=6*s*s-6*s,y=3*s*s-4*s+1,v=-6*s*s+6*s,T=3*s*s-2*s;if(a.length){f||(f=new Array(a.length));for(var u=a.length-1;u>=0;--u)f[u]=x*a[u]+y*n[u]+v*o[u]+T*i[u];return f}return x*a+y*n+v*o[u]+T*i}function r(a,n,o,i,s,f){var x=s-1,y=s*s,v=x*x,T=(1+2*s)*v,u=s*v,b=y*(3-2*s),_=y*x;if(a.length){f||(f=new Array(a.length));for(var C=a.length-1;C>=0;--C)f[C]=T*a[C]+u*n[C]+b*o[C]+_*i[C];return f}return T*a+u*n+b*o+_*i}t.exports=r,t.exports.derivative=e},4772:function(t){t.exports=e;function e(r,a,n,o,i){var s=1/Math.tan(a/2),f=1/(o-i);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]=(i+o)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*i*o*f,r[15]=0,r}},4793:function(t,e,r){function a(gt,St){if(!(gt instanceof St))throw new TypeError("Cannot call a class as a function")}function n(gt,St){for(var Nt=0;Nt<St.length;Nt++){var ee=St[Nt];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(gt,i(ee.key),ee)}}function o(gt,St,Nt){return St&&n(gt.prototype,St),Object.defineProperty(gt,"prototype",{writable:!1}),gt}function i(gt){var St=s(gt,"string");return _(St)=="symbol"?St:St+""}function s(gt,St){if(_(gt)!="object"||!gt)return gt;var Nt=gt[Symbol.toPrimitive];if(Nt!==void 0){var ee=Nt.call(gt,St);if(_(ee)!="object")return ee;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(gt)}function f(gt,St,Nt){return St=T(St),x(gt,v()?Reflect.construct(St,[],T(gt).constructor):St.apply(gt,Nt))}function x(gt,St){if(St&&(_(St)=="object"||typeof St=="function"))return St;if(St!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(gt)}function y(gt){if(gt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return gt}function v(){try{var gt=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v=function(){return!!gt})()}function T(gt){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(St){return St.__proto__||Object.getPrototypeOf(St)},T(gt)}function u(gt,St){if(typeof St!="function"&&St!==null)throw new TypeError("Super expression must either be null or a function");gt.prototype=Object.create(St&&St.prototype,{constructor:{value:gt,writable:!0,configurable:!0}}),Object.defineProperty(gt,"prototype",{writable:!1}),St&&b(gt,St)}function b(gt,St){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Nt,ee){return Nt.__proto__=ee,Nt},b(gt,St)}function _(gt){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(St){return typeof St}:function(St){return St&&typeof Symbol=="function"&&St.constructor===Symbol&&St!==Symbol.prototype?"symbol":typeof St},_(gt)}var C=r(7507),M=r(3778),E=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=k,e.IS=50;var A=2147483647;k.TYPED_ARRAY_SUPPORT=h(),!k.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{var gt=new Uint8Array(1),St={foo:function(){return 42}};return Object.setPrototypeOf(St,Uint8Array.prototype),Object.setPrototypeOf(gt,St),gt.foo()===42}catch{return!1}}Object.defineProperty(k.prototype,"parent",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.buffer}}),Object.defineProperty(k.prototype,"offset",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.byteOffset}});function p(gt){if(gt>A)throw new RangeError('The value "'+gt+'" is invalid for option "size"');var St=new Uint8Array(gt);return Object.setPrototypeOf(St,k.prototype),St}function k(gt,St,Nt){if(typeof gt=="number"){if(typeof St=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return N(gt)}return w(gt,St,Nt)}k.poolSize=8192;function w(gt,St,Nt){if(typeof gt=="string")return V(gt,St);if(ArrayBuffer.isView(gt))return F(gt);if(gt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+_(gt));if(rn(gt,ArrayBuffer)||gt&&rn(gt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(rn(gt,SharedArrayBuffer)||gt&&rn(gt.buffer,SharedArrayBuffer)))return U(gt,St,Nt);if(typeof gt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var ee=gt.valueOf&&gt.valueOf();if(ee!=null&&ee!==gt)return k.from(ee,St,Nt);var le=W(gt);if(le)return le;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof gt[Symbol.toPrimitive]=="function")return k.from(gt[Symbol.toPrimitive]("string"),St,Nt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+_(gt))}k.from=function(gt,St,Nt){return w(gt,St,Nt)},Object.setPrototypeOf(k.prototype,Uint8Array.prototype),Object.setPrototypeOf(k,Uint8Array);function R(gt){if(typeof gt!="number")throw new TypeError('"size" argument must be of type number');if(gt<0)throw new RangeError('The value "'+gt+'" is invalid for option "size"')}function O(gt,St,Nt){return R(gt),gt<=0?p(gt):St!==void 0?typeof Nt=="string"?p(gt).fill(St,Nt):p(gt).fill(St):p(gt)}k.alloc=function(gt,St,Nt){return O(gt,St,Nt)};function N(gt){return R(gt),p(gt<0?0:q(gt)|0)}k.allocUnsafe=function(gt){return N(gt)},k.allocUnsafeSlow=function(gt){return N(gt)};function V(gt,St){if((typeof St!="string"||St==="")&&(St="utf8"),!k.isEncoding(St))throw new TypeError("Unknown encoding: "+St);var Nt=X(gt,St)|0,ee=p(Nt),le=ee.write(gt,St);return le!==Nt&&(ee=ee.slice(0,le)),ee}function H(gt){for(var St=gt.length<0?0:q(gt.length)|0,Nt=p(St),ee=0;ee<St;ee+=1)Nt[ee]=gt[ee]&255;return Nt}function F(gt){if(rn(gt,Uint8Array)){var St=new Uint8Array(gt);return U(St.buffer,St.byteOffset,St.byteLength)}return H(gt)}function U(gt,St,Nt){if(St<0||gt.byteLength<St)throw new RangeError('"offset" is outside of buffer bounds');if(gt.byteLength<St+(Nt||0))throw new RangeError('"length" is outside of buffer bounds');var ee;return St===void 0&&Nt===void 0?ee=new Uint8Array(gt):Nt===void 0?ee=new Uint8Array(gt,St):ee=new Uint8Array(gt,St,Nt),Object.setPrototypeOf(ee,k.prototype),ee}function W(gt){if(k.isBuffer(gt)){var St=q(gt.length)|0,Nt=p(St);return Nt.length===0||gt.copy(Nt,0,0,St),Nt}if(gt.length!==void 0)return typeof gt.length!="number"||Ce(gt.length)?p(0):H(gt);if(gt.type==="Buffer"&&Array.isArray(gt.data))return H(gt.data)}function q(gt){if(gt>=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return gt|0}k.isBuffer=function(gt){return gt!=null&&gt._isBuffer===!0&&gt!==k.prototype},k.compare=function(gt,St){if(rn(gt,Uint8Array)&&(gt=k.from(gt,gt.offset,gt.byteLength)),rn(St,Uint8Array)&&(St=k.from(St,St.offset,St.byteLength)),!k.isBuffer(gt)||!k.isBuffer(St))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(gt===St)return 0;for(var Nt=gt.length,ee=St.length,le=0,we=Math.min(Nt,ee);le<we;++le)if(gt[le]!==St[le]){Nt=gt[le],ee=St[le];break}return Nt<ee?-1:ee<Nt?1:0},k.isEncoding=function(gt){switch(String(gt).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},k.concat=function(gt,St){if(!Array.isArray(gt))throw new TypeError('"list" argument must be an Array of Buffers');if(gt.length===0)return k.alloc(0);var Nt;if(St===void 0)for(St=0,Nt=0;Nt<gt.length;++Nt)St+=gt[Nt].length;var ee=k.allocUnsafe(St),le=0;for(Nt=0;Nt<gt.length;++Nt){var we=gt[Nt];if(rn(we,Uint8Array))le+we.length>ee.length?(k.isBuffer(we)||(we=k.from(we)),we.copy(ee,le)):Uint8Array.prototype.set.call(ee,we,le);else if(k.isBuffer(we))we.copy(ee,le);else throw new TypeError('"list" argument must be an Array of Buffers');le+=we.length}return ee};function X(gt,St){if(k.isBuffer(gt))return gt.length;if(ArrayBuffer.isView(gt)||rn(gt,ArrayBuffer))return gt.byteLength;if(typeof gt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+_(gt));var Nt=gt.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&Nt===0)return 0;for(var le=!1;;)switch(St){case"ascii":case"latin1":case"binary":return Nt;case"utf8":case"utf-8":return ur(gt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt*2;case"hex":return Nt>>>1;case"base64":return br(gt).length;default:if(le)return ee?-1:ur(gt).length;St=(""+St).toLowerCase(),le=!0}}k.byteLength=X;function lt(gt,St,Nt){var ee=!1;if((St===void 0||St<0)&&(St=0),St>this.length||((Nt===void 0||Nt>this.length)&&(Nt=this.length),Nt<=0)||(Nt>>>=0,St>>>=0,Nt<=St))return"";for(gt||(gt="utf8");;)switch(gt){case"hex":return Pt(this,St,Nt);case"utf8":case"utf-8":return Y(this,St,Nt);case"ascii":return wt(this,St,Nt);case"latin1":case"binary":return zt(this,St,Nt);case"base64":return it(this,St,Nt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wt(this,St,Nt);default:if(ee)throw new TypeError("Unknown encoding: "+gt);gt=(gt+"").toLowerCase(),ee=!0}}k.prototype._isBuffer=!0;function yt(gt,St,Nt){var ee=gt[St];gt[St]=gt[Nt],gt[Nt]=ee}k.prototype.swap16=function(){var gt=this.length;if(gt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var St=0;St<gt;St+=2)yt(this,St,St+1);return this},k.prototype.swap32=function(){var gt=this.length;if(gt%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var St=0;St<gt;St+=4)yt(this,St,St+3),yt(this,St+1,St+2);return this},k.prototype.swap64=function(){var gt=this.length;if(gt%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var St=0;St<gt;St+=8)yt(this,St,St+7),yt(this,St+1,St+6),yt(this,St+2,St+5),yt(this,St+3,St+4);return this},k.prototype.toString=function(){var gt=this.length;return gt===0?"":arguments.length===0?Y(this,0,gt):lt.apply(this,arguments)},k.prototype.toLocaleString=k.prototype.toString,k.prototype.equals=function(gt){if(!k.isBuffer(gt))throw new TypeError("Argument must be a Buffer");return this===gt?!0:k.compare(this,gt)===0},k.prototype.inspect=function(){var gt="",St=e.IS;return gt=this.toString("hex",0,St).replace(/(.{2})/g,"$1 ").trim(),this.length>St&&(gt+=" ... "),"<Buffer "+gt+">"},E&&(k.prototype[E]=k.prototype.inspect),k.prototype.compare=function(gt,St,Nt,ee,le){if(rn(gt,Uint8Array)&&(gt=k.from(gt,gt.offset,gt.byteLength)),!k.isBuffer(gt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+_(gt));if(St===void 0&&(St=0),Nt===void 0&&(Nt=gt?gt.length:0),ee===void 0&&(ee=0),le===void 0&&(le=this.length),St<0||Nt>gt.length||ee<0||le>this.length)throw new RangeError("out of range index");if(ee>=le&&St>=Nt)return 0;if(ee>=le)return-1;if(St>=Nt)return 1;if(St>>>=0,Nt>>>=0,ee>>>=0,le>>>=0,this===gt)return 0;for(var we=le-ee,Ue=Nt-St,qe=Math.min(we,Ue),ar=this.slice(ee,le),Ar=gt.slice(St,Nt),Tr=0;Tr<qe;++Tr)if(ar[Tr]!==Ar[Tr]){we=ar[Tr],Ue=Ar[Tr];break}return we<Ue?-1:Ue<we?1:0};function pt(gt,St,Nt,ee,le){if(gt.length===0)return-1;if(typeof Nt=="string"?(ee=Nt,Nt=0):Nt>2147483647?Nt=2147483647:Nt<-2147483648&&(Nt=-2147483648),Nt=+Nt,Ce(Nt)&&(Nt=le?0:gt.length-1),Nt<0&&(Nt=gt.length+Nt),Nt>=gt.length){if(le)return-1;Nt=gt.length-1}else if(Nt<0)if(le)Nt=0;else return-1;if(typeof St=="string"&&(St=k.from(St,ee)),k.isBuffer(St))return St.length===0?-1:st(gt,St,Nt,ee,le);if(typeof St=="number")return St=St&255,typeof Uint8Array.prototype.indexOf=="function"?le?Uint8Array.prototype.indexOf.call(gt,St,Nt):Uint8Array.prototype.lastIndexOf.call(gt,St,Nt):st(gt,[St],Nt,ee,le);throw new TypeError("val must be string, number or Buffer")}function st(gt,St,Nt,ee,le){var we=1,Ue=gt.length,qe=St.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(gt.length<2||St.length<2)return-1;we=2,Ue/=2,qe/=2,Nt/=2}function ar(Vn,Hn){return we===1?Vn[Hn]:Vn.readUInt16BE(Hn*we)}var Ar;if(le){var Tr=-1;for(Ar=Nt;Ar<Ue;Ar++)if(ar(gt,Ar)===ar(St,Tr===-1?0:Ar-Tr)){if(Tr===-1&&(Tr=Ar),Ar-Tr+1===qe)return Tr*we}else Tr!==-1&&(Ar-=Ar-Tr),Tr=-1}else for(Nt+qe>Ue&&(Nt=Ue-qe),Ar=Nt;Ar>=0;Ar--){for(var pr=!0,Jr=0;Jr<qe;Jr++)if(ar(gt,Ar+Jr)!==ar(St,Jr)){pr=!1;break}if(pr)return Ar}return-1}k.prototype.includes=function(gt,St,Nt){return this.indexOf(gt,St,Nt)!==-1},k.prototype.indexOf=function(gt,St,Nt){return pt(this,gt,St,Nt,!0)},k.prototype.lastIndexOf=function(gt,St,Nt){return pt(this,gt,St,Nt,!1)};function tt(gt,St,Nt,ee){Nt=Number(Nt)||0;var le=gt.length-Nt;ee?(ee=Number(ee),ee>le&&(ee=le)):ee=le;var we=St.length;ee>we/2&&(ee=we/2);var Ue;for(Ue=0;Ue<ee;++Ue){var qe=parseInt(St.substr(Ue*2,2),16);if(Ce(qe))return Ue;gt[Nt+Ue]=qe}return Ue}function dt(gt,St,Nt,ee){return Kr(ur(St,gt.length-Nt),gt,Nt,ee)}function rt(gt,St,Nt,ee){return Kr(jr(St),gt,Nt,ee)}function at(gt,St,Nt,ee){return Kr(br(St),gt,Nt,ee)}function vt(gt,St,Nt,ee){return Kr(Hr(St,gt.length-Nt),gt,Nt,ee)}k.prototype.write=function(gt,St,Nt,ee){if(St===void 0)ee="utf8",Nt=this.length,St=0;else if(Nt===void 0&&typeof St=="string")ee=St,Nt=this.length,St=0;else if(isFinite(St))St=St>>>0,isFinite(Nt)?(Nt=Nt>>>0,ee===void 0&&(ee="utf8")):(ee=Nt,Nt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var le=this.length-St;if((Nt===void 0||Nt>le)&&(Nt=le),gt.length>0&&(Nt<0||St<0)||St>this.length)throw new RangeError("Attempt to write outside buffer bounds");ee||(ee="utf8");for(var we=!1;;)switch(ee){case"hex":return tt(this,gt,St,Nt);case"utf8":case"utf-8":return dt(this,gt,St,Nt);case"ascii":case"latin1":case"binary":return rt(this,gt,St,Nt);case"base64":return at(this,gt,St,Nt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vt(this,gt,St,Nt);default:if(we)throw new TypeError("Unknown encoding: "+ee);ee=(""+ee).toLowerCase(),we=!0}},k.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function it(gt,St,Nt){return St===0&&Nt===gt.length?C.fromByteArray(gt):C.fromByteArray(gt.slice(St,Nt))}function Y(gt,St,Nt){Nt=Math.min(gt.length,Nt);for(var ee=[],le=St;le<Nt;){var we=gt[le],Ue=null,qe=we>239?4:we>223?3:we>191?2:1;if(le+qe<=Nt){var ar=void 0,Ar=void 0,Tr=void 0,pr=void 0;switch(qe){case 1:we<128&&(Ue=we);break;case 2:ar=gt[le+1],(ar&192)===128&&(pr=(we&31)<<6|ar&63,pr>127&&(Ue=pr));break;case 3:ar=gt[le+1],Ar=gt[le+2],(ar&192)===128&&(Ar&192)===128&&(pr=(we&15)<<12|(ar&63)<<6|Ar&63,pr>2047&&(pr<55296||pr>57343)&&(Ue=pr));break;case 4:ar=gt[le+1],Ar=gt[le+2],Tr=gt[le+3],(ar&192)===128&&(Ar&192)===128&&(Tr&192)===128&&(pr=(we&15)<<18|(ar&63)<<12|(Ar&63)<<6|Tr&63,pr>65535&&pr<1114112&&(Ue=pr))}}Ue===null?(Ue=65533,qe=1):Ue>65535&&(Ue-=65536,ee.push(Ue>>>10&1023|55296),Ue=56320|Ue&1023),ee.push(Ue),le+=qe}return ut(ee)}var ft=4096;function ut(gt){var St=gt.length;if(St<=ft)return String.fromCharCode.apply(String,gt);for(var Nt="",ee=0;ee<St;)Nt+=String.fromCharCode.apply(String,gt.slice(ee,ee+=ft));return Nt}function wt(gt,St,Nt){var ee="";Nt=Math.min(gt.length,Nt);for(var le=St;le<Nt;++le)ee+=String.fromCharCode(gt[le]&127);return ee}function zt(gt,St,Nt){var ee="";Nt=Math.min(gt.length,Nt);for(var le=St;le<Nt;++le)ee+=String.fromCharCode(gt[le]);return ee}function Pt(gt,St,Nt){var ee=gt.length;(!St||St<0)&&(St=0),(!Nt||Nt<0||Nt>ee)&&(Nt=ee);for(var le="",we=St;we<Nt;++we)le+=$t[gt[we]];return le}function Wt(gt,St,Nt){for(var ee=gt.slice(St,Nt),le="",we=0;we<ee.length-1;we+=2)le+=String.fromCharCode(ee[we]+ee[we+1]*256);return le}k.prototype.slice=function(gt,St){var Nt=this.length;gt=~~gt,St=St===void 0?Nt:~~St,gt<0?(gt+=Nt,gt<0&&(gt=0)):gt>Nt&&(gt=Nt),St<0?(St+=Nt,St<0&&(St=0)):St>Nt&&(St=Nt),St<gt&&(St=gt);var ee=this.subarray(gt,St);return Object.setPrototypeOf(ee,k.prototype),ee};function Ht(gt,St,Nt){if(gt%1!==0||gt<0)throw new RangeError("offset is not uint");if(gt+St>Nt)throw new RangeError("Trying to access beyond buffer length")}k.prototype.readUintLE=k.prototype.readUIntLE=function(gt,St,Nt){gt=gt>>>0,St=St>>>0,Nt||Ht(gt,St,this.length);for(var ee=this[gt],le=1,we=0;++we<St&&(le*=256);)ee+=this[gt+we]*le;return ee},k.prototype.readUintBE=k.prototype.readUIntBE=function(gt,St,Nt){gt=gt>>>0,St=St>>>0,Nt||Ht(gt,St,this.length);for(var ee=this[gt+--St],le=1;St>0&&(le*=256);)ee+=this[gt+--St]*le;return ee},k.prototype.readUint8=k.prototype.readUInt8=function(gt,St){return gt=gt>>>0,St||Ht(gt,1,this.length),this[gt]},k.prototype.readUint16LE=k.prototype.readUInt16LE=function(gt,St){return gt=gt>>>0,St||Ht(gt,2,this.length),this[gt]|this[gt+1]<<8},k.prototype.readUint16BE=k.prototype.readUInt16BE=function(gt,St){return gt=gt>>>0,St||Ht(gt,2,this.length),this[gt]<<8|this[gt+1]},k.prototype.readUint32LE=k.prototype.readUInt32LE=function(gt,St){return gt=gt>>>0,St||Ht(gt,4,this.length),(this[gt]|this[gt+1]<<8|this[gt+2]<<16)+this[gt+3]*16777216},k.prototype.readUint32BE=k.prototype.readUInt32BE=function(gt,St){return gt=gt>>>0,St||Ht(gt,4,this.length),this[gt]*16777216+(this[gt+1]<<16|this[gt+2]<<8|this[gt+3])},k.prototype.readBigUInt64LE=ne(function(gt){gt=gt>>>0,Te(gt,"offset");var St=this[gt],Nt=this[gt+7];(St===void 0||Nt===void 0)&&He(gt,this.length-8);var ee=St+this[++gt]*Math.pow(2,8)+this[++gt]*Math.pow(2,16)+this[++gt]*Math.pow(2,24),le=this[++gt]+this[++gt]*Math.pow(2,8)+this[++gt]*Math.pow(2,16)+Nt*Math.pow(2,24);return BigInt(ee)+(BigInt(le)<<BigInt(32))}),k.prototype.readBigUInt64BE=ne(function(gt){gt=gt>>>0,Te(gt,"offset");var St=this[gt],Nt=this[gt+7];(St===void 0||Nt===void 0)&&He(gt,this.length-8);var ee=St*Math.pow(2,24)+this[++gt]*Math.pow(2,16)+this[++gt]*Math.pow(2,8)+this[++gt],le=this[++gt]*Math.pow(2,24)+this[++gt]*Math.pow(2,16)+this[++gt]*Math.pow(2,8)+Nt;return(BigInt(ee)<<BigInt(32))+BigInt(le)}),k.prototype.readIntLE=function(gt,St,Nt){gt=gt>>>0,St=St>>>0,Nt||Ht(gt,St,this.length);for(var ee=this[gt],le=1,we=0;++we<St&&(le*=256);)ee+=this[gt+we]*le;return le*=128,ee>=le&&(ee-=Math.pow(2,8*St)),ee},k.prototype.readIntBE=function(gt,St,Nt){gt=gt>>>0,St=St>>>0,Nt||Ht(gt,St,this.length);for(var ee=St,le=1,we=this[gt+--ee];ee>0&&(le*=256);)we+=this[gt+--ee]*le;return le*=128,we>=le&&(we-=Math.pow(2,8*St)),we},k.prototype.readInt8=function(gt,St){return gt=gt>>>0,St||Ht(gt,1,this.length),this[gt]&128?(255-this[gt]+1)*-1:this[gt]},k.prototype.readInt16LE=function(gt,St){gt=gt>>>0,St||Ht(gt,2,this.length);var Nt=this[gt]|this[gt+1]<<8;return Nt&32768?Nt|4294901760:Nt},k.prototype.readInt16BE=function(gt,St){gt=gt>>>0,St||Ht(gt,2,this.length);var Nt=this[gt+1]|this[gt]<<8;return Nt&32768?Nt|4294901760:Nt},k.prototype.readInt32LE=function(gt,St){return gt=gt>>>0,St||Ht(gt,4,this.length),this[gt]|this[gt+1]<<8|this[gt+2]<<16|this[gt+3]<<24},k.prototype.readInt32BE=function(gt,St){return gt=gt>>>0,St||Ht(gt,4,this.length),this[gt]<<24|this[gt+1]<<16|this[gt+2]<<8|this[gt+3]},k.prototype.readBigInt64LE=ne(function(gt){gt=gt>>>0,Te(gt,"offset");var St=this[gt],Nt=this[gt+7];(St===void 0||Nt===void 0)&&He(gt,this.length-8);var ee=this[gt+4]+this[gt+5]*Math.pow(2,8)+this[gt+6]*Math.pow(2,16)+(Nt<<24);return(BigInt(ee)<<BigInt(32))+BigInt(St+this[++gt]*Math.pow(2,8)+this[++gt]*Math.pow(2,16)+this[++gt]*Math.pow(2,24))}),k.prototype.readBigInt64BE=ne(function(gt){gt=gt>>>0,Te(gt,"offset");var St=this[gt],Nt=this[gt+7];(St===void 0||Nt===void 0)&&He(gt,this.length-8);var ee=(St<<24)+this[++gt]*Math.pow(2,16)+this[++gt]*Math.pow(2,8)+this[++gt];return(BigInt(ee)<<BigInt(32))+BigInt(this[++gt]*Math.pow(2,24)+this[++gt]*Math.pow(2,16)+this[++gt]*Math.pow(2,8)+Nt)}),k.prototype.readFloatLE=function(gt,St){return gt=gt>>>0,St||Ht(gt,4,this.length),M.read(this,gt,!0,23,4)},k.prototype.readFloatBE=function(gt,St){return gt=gt>>>0,St||Ht(gt,4,this.length),M.read(this,gt,!1,23,4)},k.prototype.readDoubleLE=function(gt,St){return gt=gt>>>0,St||Ht(gt,8,this.length),M.read(this,gt,!0,52,8)},k.prototype.readDoubleBE=function(gt,St){return gt=gt>>>0,St||Ht(gt,8,this.length),M.read(this,gt,!1,52,8)};function Jt(gt,St,Nt,ee,le,we){if(!k.isBuffer(gt))throw new TypeError('"buffer" argument must be a Buffer instance');if(St>le||St<we)throw new RangeError('"value" argument is out of bounds');if(Nt+ee>gt.length)throw new RangeError("Index out of range")}k.prototype.writeUintLE=k.prototype.writeUIntLE=function(gt,St,Nt,ee){if(gt=+gt,St=St>>>0,Nt=Nt>>>0,!ee){var le=Math.pow(2,8*Nt)-1;Jt(this,gt,St,Nt,le,0)}var we=1,Ue=0;for(this[St]=gt&255;++Ue<Nt&&(we*=256);)this[St+Ue]=gt/we&255;return St+Nt},k.prototype.writeUintBE=k.prototype.writeUIntBE=function(gt,St,Nt,ee){if(gt=+gt,St=St>>>0,Nt=Nt>>>0,!ee){var le=Math.pow(2,8*Nt)-1;Jt(this,gt,St,Nt,le,0)}var we=Nt-1,Ue=1;for(this[St+we]=gt&255;--we>=0&&(Ue*=256);)this[St+we]=gt/Ue&255;return St+Nt},k.prototype.writeUint8=k.prototype.writeUInt8=function(gt,St,Nt){return gt=+gt,St=St>>>0,Nt||Jt(this,gt,St,1,255,0),this[St]=gt&255,St+1},k.prototype.writeUint16LE=k.prototype.writeUInt16LE=function(gt,St,Nt){return gt=+gt,St=St>>>0,Nt||Jt(this,gt,St,2,65535,0),this[St]=gt&255,this[St+1]=gt>>>8,St+2},k.prototype.writeUint16BE=k.prototype.writeUInt16BE=function(gt,St,Nt){return gt=+gt,St=St>>>0,Nt||Jt(this,gt,St,2,65535,0),this[St]=gt>>>8,this[St+1]=gt&255,St+2},k.prototype.writeUint32LE=k.prototype.writeUInt32LE=function(gt,St,Nt){return gt=+gt,St=St>>>0,Nt||Jt(this,gt,St,4,4294967295,0),this[St+3]=gt>>>24,this[St+2]=gt>>>16,this[St+1]=gt>>>8,this[St]=gt&255,St+4},k.prototype.writeUint32BE=k.prototype.writeUInt32BE=function(gt,St,Nt){return gt=+gt,St=St>>>0,Nt||Jt(this,gt,St,4,4294967295,0),this[St]=gt>>>24,this[St+1]=gt>>>16,this[St+2]=gt>>>8,this[St+3]=gt&255,St+4};function ge(gt,St,Nt,ee,le){oe(St,ee,le,gt,Nt,7);var we=Number(St&BigInt(4294967295));gt[Nt++]=we,we=we>>8,gt[Nt++]=we,we=we>>8,gt[Nt++]=we,we=we>>8,gt[Nt++]=we;var Ue=Number(St>>BigInt(32)&BigInt(4294967295));return gt[Nt++]=Ue,Ue=Ue>>8,gt[Nt++]=Ue,Ue=Ue>>8,gt[Nt++]=Ue,Ue=Ue>>8,gt[Nt++]=Ue,Nt}function he(gt,St,Nt,ee,le){oe(St,ee,le,gt,Nt,7);var we=Number(St&BigInt(4294967295));gt[Nt+7]=we,we=we>>8,gt[Nt+6]=we,we=we>>8,gt[Nt+5]=we,we=we>>8,gt[Nt+4]=we;var Ue=Number(St>>BigInt(32)&BigInt(4294967295));return gt[Nt+3]=Ue,Ue=Ue>>8,gt[Nt+2]=Ue,Ue=Ue>>8,gt[Nt+1]=Ue,Ue=Ue>>8,gt[Nt]=Ue,Nt+8}k.prototype.writeBigUInt64LE=ne(function(gt){var St=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ge(this,gt,St,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeBigUInt64BE=ne(function(gt){var St=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return he(this,gt,St,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeIntLE=function(gt,St,Nt,ee){if(gt=+gt,St=St>>>0,!ee){var le=Math.pow(2,8*Nt-1);Jt(this,gt,St,Nt,le-1,-le)}var we=0,Ue=1,qe=0;for(this[St]=gt&255;++we<Nt&&(Ue*=256);)gt<0&&qe===0&&this[St+we-1]!==0&&(qe=1),this[St+we]=(gt/Ue>>0)-qe&255;return St+Nt},k.prototype.writeIntBE=function(gt,St,Nt,ee){if(gt=+gt,St=St>>>0,!ee){var le=Math.pow(2,8*Nt-1);Jt(this,gt,St,Nt,le-1,-le)}var we=Nt-1,Ue=1,qe=0;for(this[St+we]=gt&255;--we>=0&&(Ue*=256);)gt<0&&qe===0&&this[St+we+1]!==0&&(qe=1),this[St+we]=(gt/Ue>>0)-qe&255;return St+Nt},k.prototype.writeInt8=function(gt,St,Nt){return gt=+gt,St=St>>>0,Nt||Jt(this,gt,St,1,127,-128),gt<0&&(gt=255+gt+1),this[St]=gt&255,St+1},k.prototype.writeInt16LE=function(gt,St,Nt){return gt=+gt,St=St>>>0,Nt||Jt(this,gt,St,2,32767,-32768),this[St]=gt&255,this[St+1]=gt>>>8,St+2},k.prototype.writeInt16BE=function(gt,St,Nt){return gt=+gt,St=St>>>0,Nt||Jt(this,gt,St,2,32767,-32768),this[St]=gt>>>8,this[St+1]=gt&255,St+2},k.prototype.writeInt32LE=function(gt,St,Nt){return gt=+gt,St=St>>>0,Nt||Jt(this,gt,St,4,2147483647,-2147483648),this[St]=gt&255,this[St+1]=gt>>>8,this[St+2]=gt>>>16,this[St+3]=gt>>>24,St+4},k.prototype.writeInt32BE=function(gt,St,Nt){return gt=+gt,St=St>>>0,Nt||Jt(this,gt,St,4,2147483647,-2147483648),gt<0&&(gt=4294967295+gt+1),this[St]=gt>>>24,this[St+1]=gt>>>16,this[St+2]=gt>>>8,this[St+3]=gt&255,St+4},k.prototype.writeBigInt64LE=ne(function(gt){var St=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ge(this,gt,St,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),k.prototype.writeBigInt64BE=ne(function(gt){var St=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return he(this,gt,St,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function de(gt,St,Nt,ee,le,we){if(Nt+ee>gt.length)throw new RangeError("Index out of range");if(Nt<0)throw new RangeError("Index out of range")}function se(gt,St,Nt,ee,le){return St=+St,Nt=Nt>>>0,le||de(gt,St,Nt,4),M.write(gt,St,Nt,ee,23,4),Nt+4}k.prototype.writeFloatLE=function(gt,St,Nt){return se(this,gt,St,!0,Nt)},k.prototype.writeFloatBE=function(gt,St,Nt){return se(this,gt,St,!1,Nt)};function Tt(gt,St,Nt,ee,le){return St=+St,Nt=Nt>>>0,le||de(gt,St,Nt,8),M.write(gt,St,Nt,ee,52,8),Nt+8}k.prototype.writeDoubleLE=function(gt,St,Nt){return Tt(this,gt,St,!0,Nt)},k.prototype.writeDoubleBE=function(gt,St,Nt){return Tt(this,gt,St,!1,Nt)},k.prototype.copy=function(gt,St,Nt,ee){if(!k.isBuffer(gt))throw new TypeError("argument should be a Buffer");if(Nt||(Nt=0),!ee&&ee!==0&&(ee=this.length),St>=gt.length&&(St=gt.length),St||(St=0),ee>0&&ee<Nt&&(ee=Nt),ee===Nt||gt.length===0||this.length===0)return 0;if(St<0)throw new RangeError("targetStart out of bounds");if(Nt<0||Nt>=this.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("sourceEnd out of bounds");ee>this.length&&(ee=this.length),gt.length-St<ee-Nt&&(ee=gt.length-St+Nt);var le=ee-Nt;return this===gt&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(St,Nt,ee):Uint8Array.prototype.set.call(gt,this.subarray(Nt,ee),St),le},k.prototype.fill=function(gt,St,Nt,ee){if(typeof gt=="string"){if(typeof St=="string"?(ee=St,St=0,Nt=this.length):typeof Nt=="string"&&(ee=Nt,Nt=this.length),ee!==void 0&&typeof ee!="string")throw new TypeError("encoding must be a string");if(typeof ee=="string"&&!k.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee);if(gt.length===1){var le=gt.charCodeAt(0);(ee==="utf8"&&le<128||ee==="latin1")&&(gt=le)}}else typeof gt=="number"?gt=gt&255:typeof gt=="boolean"&&(gt=Number(gt));if(St<0||this.length<St||this.length<Nt)throw new RangeError("Out of range index");if(Nt<=St)return this;St=St>>>0,Nt=Nt===void 0?this.length:Nt>>>0,gt||(gt=0);var we;if(typeof gt=="number")for(we=St;we<Nt;++we)this[we]=gt;else{var Ue=k.isBuffer(gt)?gt:k.from(gt,ee),qe=Ue.length;if(qe===0)throw new TypeError('The value "'+gt+'" is invalid for argument "value"');for(we=0;we<Nt-St;++we)this[we+St]=Ue[we%qe]}return this};var Lt={};function Mt(gt,St,Nt){Lt[gt]=function(ee){function le(){var we;return a(this,le),we=f(this,le),Object.defineProperty(we,"message",{value:St.apply(we,arguments),writable:!0,configurable:!0}),we.name="".concat(we.name," [").concat(gt,"]"),we.stack,delete we.name,we}return u(le,ee),o(le,[{key:"code",get:function(){return gt},set:function(we){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:we,writable:!0})}},{key:"toString",value:function(){return"".concat(this.name," [").concat(gt,"]: ").concat(this.message)}}])}(Nt)}Mt("ERR_BUFFER_OUT_OF_BOUNDS",function(gt){return gt?"".concat(gt," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),Mt("ERR_INVALID_ARG_TYPE",function(gt,St){return'The "'.concat(gt,'" argument must be of type number. Received type ').concat(_(St))},TypeError),Mt("ERR_OUT_OF_RANGE",function(gt,St,Nt){var ee='The value of "'.concat(gt,'" is out of range.'),le=Nt;return Number.isInteger(Nt)&&Math.abs(Nt)>Math.pow(2,32)?le=te(String(Nt)):typeof Nt=="bigint"&&(le=String(Nt),(Nt>Math.pow(BigInt(2),BigInt(32))||Nt<-Math.pow(BigInt(2),BigInt(32)))&&(le=te(le)),le+="n"),ee+=" It must be ".concat(St,". Received ").concat(le),ee},RangeError);function te(gt){for(var St="",Nt=gt.length,ee=gt[0]==="-"?1:0;Nt>=ee+4;Nt-=3)St="_".concat(gt.slice(Nt-3,Nt)).concat(St);return"".concat(gt.slice(0,Nt)).concat(St)}function ve(gt,St,Nt){Te(St,"offset"),(gt[St]===void 0||gt[St+Nt]===void 0)&&He(St,gt.length-(Nt+1))}function oe(gt,St,Nt,ee,le,we){if(gt>Nt||gt<St){var Ue=typeof St=="bigint"?"n":"",qe;throw St===0||St===BigInt(0)?qe=">= 0".concat(Ue," and < 2").concat(Ue," ** ").concat((we+1)*8).concat(Ue):qe=">= -(2".concat(Ue," ** ").concat((we+1)*8-1).concat(Ue,") and < 2 ** ")+"".concat((we+1)*8-1).concat(Ue),new Lt.ERR_OUT_OF_RANGE("value",qe,gt)}ve(ee,le,we)}function Te(gt,St){if(typeof gt!="number")throw new Lt.ERR_INVALID_ARG_TYPE(St,"number",gt)}function He(gt,St,Nt){throw Math.floor(gt)!==gt?(Te(gt,Nt),new Lt.ERR_OUT_OF_RANGE("offset","an integer",gt)):St<0?new Lt.ERR_BUFFER_OUT_OF_BOUNDS:new Lt.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(St),gt)}var Ge=/[^+/0-9A-Za-z-_]/g;function cr(gt){if(gt=gt.split("=")[0],gt=gt.trim().replace(Ge,""),gt.length<2)return"";for(;gt.length%4!==0;)gt=gt+"=";return gt}function ur(gt,St){St=St||1/0;for(var Nt,ee=gt.length,le=null,we=[],Ue=0;Ue<ee;++Ue){if(Nt=gt.charCodeAt(Ue),Nt>55295&&Nt<57344){if(!le){if(Nt>56319){(St-=3)>-1&&we.push(239,191,189);continue}else if(Ue+1===ee){(St-=3)>-1&&we.push(239,191,189);continue}le=Nt;continue}if(Nt<56320){(St-=3)>-1&&we.push(239,191,189),le=Nt;continue}Nt=(le-55296<<10|Nt-56320)+65536}else le&&(St-=3)>-1&&we.push(239,191,189);if(le=null,Nt<128){if((St-=1)<0)break;we.push(Nt)}else if(Nt<2048){if((St-=2)<0)break;we.push(Nt>>6|192,Nt&63|128)}else if(Nt<65536){if((St-=3)<0)break;we.push(Nt>>12|224,Nt>>6&63|128,Nt&63|128)}else if(Nt<1114112){if((St-=4)<0)break;we.push(Nt>>18|240,Nt>>12&63|128,Nt>>6&63|128,Nt&63|128)}else throw new Error("Invalid code point")}return we}function jr(gt){for(var St=[],Nt=0;Nt<gt.length;++Nt)St.push(gt.charCodeAt(Nt)&255);return St}function Hr(gt,St){for(var Nt,ee,le,we=[],Ue=0;Ue<gt.length&&!((St-=2)<0);++Ue)Nt=gt.charCodeAt(Ue),ee=Nt>>8,le=Nt%256,we.push(le),we.push(ee);return we}function br(gt){return C.toByteArray(cr(gt))}function Kr(gt,St,Nt,ee){var le;for(le=0;le<ee&&!(le+Nt>=St.length||le>=gt.length);++le)St[le+Nt]=gt[le];return le}function rn(gt,St){return gt instanceof St||gt!=null&&gt.constructor!=null&&gt.constructor.name!=null&&gt.constructor.name===St.name}function Ce(gt){return gt!==gt}var $t=function(){for(var gt="0123456789abcdef",St=new Array(256),Nt=0;Nt<16;++Nt)for(var ee=Nt*16,le=0;le<16;++le)St[ee+le]=gt[Nt]+gt[le];return St}();function ne(gt){return typeof BigInt>"u"?Ct:gt}function Ct(){throw new Error("BigInt not supported")}},4844:function(t){t.exports=e;function e(r,a,n,o){return r[0]=a[0]+n[0]*o,r[1]=a[1]+n[1]*o,r[2]=a[2]+n[2]*o,r[3]=a[3]+n[3]*o,r}},4905:function(t,e,r){var a=r(5874);t.exports=n;function n(o,i){var s=a(i),f=[];return f=f.concat(s(o)),f=f.concat(s(null)),f}},4935:function(t,e,r){t.exports=b;var a=r(2762),n=r(8116),o=r(4359),i=r(1879).Q,s=window||process.global||{},f=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var x=3;function y(_,C,M,E){this.gl=_,this.shader=C,this.buffer=M,this.vao=E,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var v=y.prototype,T=[0,0];v.bind=function(_,C,M,E){this.vao.bind(),this.shader.bind();var A=this.shader.uniforms;A.model=_,A.view=C,A.projection=M,A.pixelScale=E,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},v.unbind=function(){this.vao.unbind()},v.update=function(_,C,M,E,A){var h=[];function p(W,q,X,lt,yt,pt){var st=[X.style,X.weight,X.variant,X.family].join("_"),tt=f[st];tt||(tt=f[st]={});var dt=tt[q];dt||(dt=tt[q]=u(q,{triangles:!0,font:X.family,fontStyle:X.style,fontWeight:X.weight,fontVariant:X.variant,textAlign:"center",textBaseline:"middle",lineSpacing:yt,styletags:pt}));for(var rt=(lt||12)/12,at=dt.positions,vt=dt.cells,it=0,Y=vt.length;it<Y;++it)for(var ft=vt[it],ut=2;ut>=0;--ut){var wt=at[ft[ut]];h.push(rt*wt[0],-rt*wt[1],W)}}for(var k=[0,0,0],w=[0,0,0],R=[0,0,0],O=[0,0,0],N=1.25,V={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},H=0;H<3;++H){R[H]=h.length/x|0,p(.5*(_[0][H]+_[1][H]),C[H],M[H],12,N,V),O[H]=(h.length/x|0)-R[H],k[H]=h.length/x|0;for(var F=0;F<E[H].length;++F)if(E[H][F].text){var U={family:E[H][F].font||A[H].family,style:A[H].fontStyle||A[H].style,weight:A[H].fontWeight||A[H].weight,variant:A[H].fontVariant||A[H].variant};p(E[H][F].x,E[H][F].text,U,E[H][F].fontSize||12,N,V)}w[H]=(h.length/x|0)-k[H]}this.buffer.update(h),this.tickOffset=k,this.tickCount=w,this.labelOffset=R,this.labelCount=O},v.drawTicks=function(_,C,M,E,A,h,p,k){this.tickCount[_]&&(this.shader.uniforms.axis=h,this.shader.uniforms.color=A,this.shader.uniforms.angle=M,this.shader.uniforms.scale=C,this.shader.uniforms.offset=E,this.shader.uniforms.alignDir=p,this.shader.uniforms.alignOpt=k,this.vao.draw(this.gl.TRIANGLES,this.tickCount[_],this.tickOffset[_]))},v.drawLabel=function(_,C,M,E,A,h,p,k){this.labelCount[_]&&(this.shader.uniforms.axis=h,this.shader.uniforms.color=A,this.shader.uniforms.angle=M,this.shader.uniforms.scale=C,this.shader.uniforms.offset=E,this.shader.uniforms.alignDir=p,this.shader.uniforms.alignOpt=k,this.vao.draw(this.gl.TRIANGLES,this.labelCount[_],this.labelOffset[_]))},v.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function u(_,C){try{return o(_,C)}catch(M){return console.warn('error vectorizing text:"'+_+'" error:',M),{cells:[],positions:[]}}}function b(_,C,M,E,A,h){var p=a(_),k=n(_,[{buffer:p,size:3}]),w=i(_);w.attributes.position.location=0;var R=new y(_,w,p,k);return R.update(C,M,E,A,h),R}},5023:function(t,e,r){var a=r(2478);t.exports=x;function n(y,v,T,u,b,_,C){this.cells=y,this.neighbor=v,this.flags=u,this.constraint=T,this.active=b,this.next=_,this.boundary=C}var o=n.prototype;function i(y,v){return y[0]-v[0]||y[1]-v[1]||y[2]-v[2]}o.locate=function(){var y=[0,0,0];return function(v,T,u){var b=v,_=T,C=u;return T<u?T<v&&(b=T,_=u,C=v):u<v&&(b=u,_=v,C=T),b<0?-1:(y[0]=b,y[1]=_,y[2]=C,a.eq(this.cells,y,i))}}();function s(y,v){for(var T=y.cells(),u=T.length,b=0;b<u;++b){var _=T[b],C=_[0],M=_[1],E=_[2];M<E?M<C&&(_[0]=M,_[1]=E,_[2]=C):E<C&&(_[0]=E,_[1]=C,_[2]=M)}T.sort(i);for(var A=new Array(u),b=0;b<A.length;++b)A[b]=0;var h=[],p=[],k=new Array(3*u),w=new Array(3*u),R=null;v&&(R=[]);for(var O=new n(T,k,w,A,h,p,R),b=0;b<u;++b)for(var _=T[b],N=0;N<3;++N){var C=_[N],M=_[(N+1)%3],V=k[3*b+N]=O.locate(M,C,y.opposite(M,C)),H=w[3*b+N]=y.isConstraint(C,M);V<0&&(H?p.push(b):(h.push(b),A[b]=1),v&&R.push([M,C,-1]))}return O}function f(y,v,T){for(var u=0,b=0;b<y.length;++b)v[b]===T&&(y[u++]=y[b]);return y.length=u,y}function x(y,v,T){var u=s(y,T);if(v===0)return T?u.cells.concat(u.boundary):u.cells;for(var b=1,_=u.active,C=u.next,M=u.flags,E=u.cells,A=u.constraint,h=u.neighbor;_.length>0||C.length>0;){for(;_.length>0;){var p=_.pop();if(M[p]!==-b){M[p]=b;for(var k=E[p],w=0;w<3;++w){var R=h[3*p+w];R>=0&&M[R]===0&&(A[3*p+w]?C.push(R):(_.push(R),M[R]=b))}}}var O=C;C=_,_=O,C.length=0,b=-b}var N=f(E,M,v);return T?N.concat(u.boundary):N}},5033:function(t){t.exports=e;function e(r,a,n){var o=a||0,i=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]],[i*r[12]-r[8],i*r[13]-r[9],i*r[14]-r[10],i*r[15]-r[11]]]}},5085:function(t,e,r){t.exports=b;var a=r(3250)[3],n=r(4209),o=r(3352),i=r(2478);function s(){return!0}function f(_){return function(C,M){var E=_[C];return E?!!E.queryPoint(M,s):!1}}function x(_){for(var C={},M=0;M<_.length;++M){var E=_[M],A=E[0][0],h=E[0][1],p=E[1][1],k=[Math.min(h,p),Math.max(h,p)];A in C?C[A].push(k):C[A]=[k]}for(var w={},R=Object.keys(C),M=0;M<R.length;++M){var O=C[R[M]];w[R[M]]=o(O)}return f(w)}function y(_,C){return function(M){var E=i.le(C,M[0]);if(E<0)return 1;var A=_[E];if(!A)if(E>0&&C[E]===M[0])A=_[E-1];else return 1;for(var h=1;A;){var p=A.key,k=a(M,p[0],p[1]);if(p[0][0]<p[1][0])if(k<0)A=A.left;else if(k>0)h=-1,A=A.right;else return 0;else if(k>0)A=A.left;else if(k<0)h=1,A=A.right;else return 0}return h}}function v(_){return 1}function T(_){return function(C){return _(C[0],C[1])?0:1}}function u(_,C){return function(M){return _(M[0],M[1])?0:C(M)}}function b(_){for(var C=_.length,M=[],E=[],A=0,h=0;h<C;++h)for(var p=_[h],k=p.length,w=k-1,R=0;R<k;w=R++){var O=p[w],N=p[R];O[0]===N[0]?E.push([O,N]):M.push([O,N])}if(M.length===0)return E.length===0?v:T(x(E));var V=n(M),H=y(V.slabs,V.coordinates);return E.length===0?H:u(x(E),H)}},5091:function(t,e,r){e.shader=b,e.program=_;var a=r(8866),n=r(2992),o=typeof WeakMap>"u"?r(606):WeakMap,i=new o,s=0;function f(C,M,E,A,h,p,k){this.id=C,this.src=M,this.type=E,this.shader=A,this.count=p,this.programs=[],this.cache=k}f.prototype.dispose=function(){if(--this.count===0){for(var C=this.cache,M=C.gl,E=this.programs,A=0,h=E.length;A<h;++A){var p=C.programs[E[A]];p&&(delete C.programs[A],M.deleteProgram(p))}M.deleteShader(this.shader),delete C.shaders[this.type===M.FRAGMENT_SHADER|0][this.src]}};function x(C){this.gl=C,this.shaders=[{},{}],this.programs={}}var y=x.prototype;function v(C,M,E){var A=C.createShader(M);if(C.shaderSource(A,E),C.compileShader(A),!C.getShaderParameter(A,C.COMPILE_STATUS)){var h=C.getShaderInfoLog(A);try{var p=n(h,E,M)}catch(k){throw console.warn("Failed to format compiler error: "+k),new a(h,`Error compiling shader:
`+h)}throw new a(h,p.short,p.long)}return A}y.getShaderReference=function(C,M){var E=this.gl,A=this.shaders[C===E.FRAGMENT_SHADER|0],h=A[M];if(!h||!E.isShader(h.shader)){var p=v(E,C,M);h=A[M]=new f(s++,M,C,p,[],1,this)}else h.count+=1;return h};function T(C,M,E,A,h){var p=C.createProgram();C.attachShader(p,M),C.attachShader(p,E);for(var k=0;k<A.length;++k)C.bindAttribLocation(p,h[k],A[k]);if(C.linkProgram(p),!C.getProgramParameter(p,C.LINK_STATUS)){var w=C.getProgramInfoLog(p);throw new a(w,"Error linking program: "+w)}return p}y.getProgram=function(C,M,E,A){var h=[C.id,M.id,E.join(":"),A.join(":")].join("@"),p=this.programs[h];return(!p||!this.gl.isProgram(p))&&(this.programs[h]=p=T(this.gl,C.shader,M.shader,E,A),C.programs.push(h),M.programs.push(h)),p};function u(C){var M=i.get(C);return M||(M=new x(C),i.set(C,M)),M}function b(C,M,E){return u(C).getShaderReference(M,E)}function _(C,M,E,A,h){return u(C).getProgram(M,E,A,h)}},5093:function(t){t.exports=e;function e(r,a){return r[0]=-a[0],r[1]=-a[1],r[2]=-a[2],r}},5137:function(t,e,r){t.exports=n;var a=r(1091)();function n(o,i,s,f,x,y){var v,T;for(i||(i=3),s||(s=0),f?T=Math.min(f*i+s,o.length):T=o.length,v=s;v<T;v+=i)a[0]=o[v],a[1]=o[v+1],a[2]=o[v+2],x(a,a,y),o[v]=a[0],o[v+1]=a[1],o[v+2]=a[2];return o}},5171:function(t,e,r){var a=r(737);t.exports=function(n){return a[n]}},5177:function(t){t.exports=e;function e(r,a){var n=a[0],o=a[1],i=a[2],s=a[3],f=n*n+o*o+i*i+s*s;return f>0&&(f=1/Math.sqrt(f),r[0]=n*f,r[1]=o*f,r[2]=i*f,r[3]=s*f),r}},5202:function(t,e,r){var a=r(1944),n=r(8210);t.exports=s,t.exports.positive=f,t.exports.negative=x;function o(y,v){var T=n(a(y,v),[v[v.length-1]]);return T[T.length-1]}function i(y,v,T,u){var b=u-v,_=-v/b;_<0?_=0:_>1&&(_=1);for(var C=1-_,M=y.length,E=new Array(M),A=0;A<M;++A)E[A]=_*y[A]+C*T[A];return E}function s(y,v){for(var T=[],u=[],b=o(y[y.length-1],v),_=y[y.length-1],C=y[0],M=0;M<y.length;++M,_=C){C=y[M];var E=o(C,v);if(b<0&&E>0||b>0&&E<0){var A=i(_,E,C,b);T.push(A),u.push(A.slice())}E<0?u.push(C.slice()):E>0?T.push(C.slice()):(T.push(C.slice()),u.push(C.slice())),b=E}return{positive:T,negative:u}}function f(y,v){for(var T=[],u=o(y[y.length-1],v),b=y[y.length-1],_=y[0],C=0;C<y.length;++C,b=_){_=y[C];var M=o(_,v);(u<0&&M>0||u>0&&M<0)&&T.push(i(b,M,_,u)),M>=0&&T.push(_.slice()),u=M}return T}function x(y,v){for(var T=[],u=o(y[y.length-1],v),b=y[y.length-1],_=y[0],C=0;C<y.length;++C,b=_){_=y[C];var M=o(_,v);(u<0&&M>0||u>0&&M<0)&&T.push(i(b,M,_,u)),M<=0&&T.push(_.slice()),u=M}return T}},5219:function(t){t.exports=function(e){for(var r=e.length,a,n=0;n<r;n++)if(a=e.charCodeAt(n),(a<9||a>13)&&a!==32&&a!==133&&a!==160&&a!==5760&&a!==6158&&(a<8192||a>8205)&&a!==8232&&a!==8233&&a!==8239&&a!==8287&&a!==8288&&a!==12288&&a!==65279)return!1;return!0}},5250:function(t){t.exports=r;var e=+(Math.pow(2,27)+1);function r(a,n,o){var i=a*n,s=e*a,f=s-a,x=s-f,y=a-x,v=e*n,T=v-n,u=v-T,b=n-u,_=i-x*u,C=_-y*u,M=C-x*b,E=y*b-M;return o?(o[0]=E,o[1]=i,o):[E,i]}},5298:function(t,e){var r={"float64,2,1,0":function(){return function(x,y,v,T,u){var b=x[0],_=x[1],C=x[2],M=v[0],E=v[1],A=v[2];T|=0;var h=0,p=0,k=0,w=A,R=E-C*A,O=M-_*E;for(k=0;k<b;++k){for(p=0;p<_;++p){for(h=0;h<C;++h)y[T]/=u,T+=w;T+=R}T+=O}}},"uint8,2,0,1,float64,2,1,0":function(){return function(x,y,v,T,u,b,_,C){var M=x[0],E=x[1],A=x[2],h=v[0],p=v[1],k=v[2],w=b[0],R=b[1],O=b[2];T|=0,_|=0;for(var N=T,V=_,H=x[0]|0;H>0;){H<64?(M=H,H=0):(M=64,H-=64);for(var F=x[1]|0;F>0;){F<64?(E=F,F=0):(E=64,F-=64),T=N+H*h+F*p,_=V+H*w+F*R;var U=0,W=0,q=0,X=k,lt=h-A*k,yt=p-M*h,pt=O,st=w-A*O,tt=R-M*w;for(q=0;q<E;++q){for(W=0;W<M;++W){for(U=0;U<A;++U)y[T]=u[_]*C,T+=X,_+=pt;T+=lt,_+=st}T+=yt,_+=tt}}}}},"float32,1,0,float32,1,0":function(){return function(x,y,v,T,u,b,_){var C=x[0],M=x[1],E=v[0],A=v[1],h=b[0],p=b[1];T|=0,_|=0;var k=0,w=0,R=A,O=E-M*A,N=p,V=h-M*p;for(w=0;w<C;++w){for(k=0;k<M;++k)y[T]=u[_],T+=R,_+=N;T+=O,_+=V}}},"float32,1,0,float32,0,1":function(){return function(x,y,v,T,u,b,_){var C=x[0],M=x[1],E=v[0],A=v[1],h=b[0],p=b[1];T|=0,_|=0;for(var k=T,w=_,R=x[1]|0;R>0;){R<64?(M=R,R=0):(M=64,R-=64);for(var O=x[0]|0;O>0;){O<64?(C=O,O=0):(C=64,O-=64),T=k+R*A+O*E,_=w+R*p+O*h;var N=0,V=0,H=A,F=E-M*A,U=p,W=h-M*p;for(V=0;V<C;++V){for(N=0;N<M;++N)y[T]=u[_],T+=H,_+=U;T+=F,_+=W}}}}},"uint8,2,0,1,uint8,1,2,0":function(){return function(x,y,v,T,u,b,_){var C=x[0],M=x[1],E=x[2],A=v[0],h=v[1],p=v[2],k=b[0],w=b[1],R=b[2];T|=0,_|=0;for(var O=T,N=_,V=x[2]|0;V>0;){V<64?(E=V,V=0):(E=64,V-=64);for(var H=x[0]|0;H>0;){H<64?(C=H,H=0):(C=64,H-=64);for(var F=x[1]|0;F>0;){F<64?(M=F,F=0):(M=64,F-=64),T=O+V*p+H*A+F*h,_=N+V*R+H*k+F*w;var U=0,W=0,q=0,X=p,lt=A-E*p,yt=h-C*A,pt=R,st=k-E*R,tt=w-C*k;for(q=0;q<M;++q){for(W=0;W<C;++W){for(U=0;U<E;++U)y[T]=u[_],T+=X,_+=pt;T+=lt,_+=st}T+=yt,_+=tt}}}}}},"uint8,2,0,1,array,2,0,1":function(){return function(x,y,v,T,u,b,_){var C=x[0],M=x[1],E=x[2],A=v[0],h=v[1],p=v[2],k=b[0],w=b[1],R=b[2];T|=0,_|=0;var O=0,N=0,V=0,H=p,F=A-E*p,U=h-C*A,W=R,q=k-E*R,X=w-C*k;for(V=0;V<M;++V){for(N=0;N<C;++N){for(O=0;O<E;++O)y[T]=u[_],T+=H,_+=W;T+=F,_+=q}T+=U,_+=X}}}};function a(x,y){var v=y.join(","),T=r[v];return T()}var n=a,o={mul:function(x){var y={};return function(v,T,u){var b=v.dtype,_=v.order,C=T.dtype,M=T.order,E=u.dtype,A=u.order,h=[b,_.join(),C,M.join(),E,A.join()].join(),p=y[h];return p||(y[h]=p=x([b,_,C,M,E,A])),p(v.shape.slice(0),v.data,v.stride,v.offset|0,T.data,T.stride,T.offset|0,u.data,u.stride,u.offset|0)}},muls:function(x){var y={};return function(v,T,u){var b=v.dtype,_=v.order,C=T.dtype,M=T.order,E=[b,_.join(),C,M.join()].join(),A=y[E];return A||(y[E]=A=x([b,_,C,M])),A(v.shape.slice(0),v.data,v.stride,v.offset|0,T.data,T.stride,T.offset|0,u)}},mulseq:function(x){var y={};return function(v,T){var u=v.dtype,b=v.order,_=[u,b.join()].join(),C=y[_];return C||(y[_]=C=x([u,b])),C(v.shape.slice(0),v.data,v.stride,v.offset|0,T)}},div:function(x){var y={};return function(v,T,u){var b=v.dtype,_=v.order,C=T.dtype,M=T.order,E=u.dtype,A=u.order,h=[b,_.join(),C,M.join(),E,A.join()].join(),p=y[h];return p||(y[h]=p=x([b,_,C,M,E,A])),p(v.shape.slice(0),v.data,v.stride,v.offset|0,T.data,T.stride,T.offset|0,u.data,u.stride,u.offset|0)}},divs:function(x){var y={};return function(v,T,u){var b=v.dtype,_=v.order,C=T.dtype,M=T.order,E=[b,_.join(),C,M.join()].join(),A=y[E];return A||(y[E]=A=x([b,_,C,M])),A(v.shape.slice(0),v.data,v.stride,v.offset|0,T.data,T.stride,T.offset|0,u)}},divseq:function(x){var y={};return function(v,T){var u=v.dtype,b=v.order,_=[u,b.join()].join(),C=y[_];return C||(y[_]=C=x([u,b])),C(v.shape.slice(0),v.data,v.stride,v.offset|0,T)}},assign:function(x){var y={};return function(v,T){var u=v.dtype,b=v.order,_=T.dtype,C=T.order,M=[u,b.join(),_,C.join()].join(),E=y[M];return E||(y[M]=E=x([u,b,_,C])),E(v.shape.slice(0),v.data,v.stride,v.offset|0,T.data,T.stride,T.offset|0)}}};function i(x){var y=o[x.funcName];return y(n.bind(void 0,x))}function s(x){return i({funcName:x.funcName})}var f={mul:"*",div:"/"};(function(){for(var x in f)e[x]=s({funcName:x}),e[x+"s"]=s({funcName:x+"s"}),e[x+"seq"]=s({funcName:x+"seq"})})(),e.assign=s({funcName:"assign"})},5304:function(t,e,r){t.exports=f;var a=r(2762),n=r(8116),o=r(1879).bg;function i(x,y,v,T){this.gl=x,this.buffer=y,this.vao=v,this.shader=T}var s=i.prototype;s.draw=function(x,y,v,T,u,b){for(var _=!1,C=0;C<3;++C)_=_||u[C];if(_){var M=this.gl;M.enable(M.POLYGON_OFFSET_FILL),M.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:x,view:y,projection:v,bounds:T,enable:u,colors:b},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),M.disable(M.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function f(x){for(var y=[],v=[],T=0,u=0;u<3;++u)for(var b=(u+1)%3,_=(u+2)%3,C=[0,0,0],M=[0,0,0],E=-1;E<=1;E+=2){v.push(T,T+2,T+1,T+1,T+2,T+3),C[u]=E,M[u]=E;for(var A=-1;A<=1;A+=2){C[b]=A;for(var h=-1;h<=1;h+=2)C[_]=h,y.push(C[0],C[1],C[2],M[0],M[1],M[2]),T+=1}var p=b;b=_,_=p}var k=a(x,new Float32Array(y)),w=a(x,new Uint16Array(v),x.ELEMENT_ARRAY_BUFFER),R=n(x,[{buffer:k,type:x.FLOAT,size:3,offset:0,stride:24},{buffer:k,type:x.FLOAT,size:3,offset:12,stride:24}],w),O=o(x);return O.attributes.position.location=0,O.attributes.normal.location=1,new i(x,k,R,O)}},5352:function(t){t.exports=e;function e(r,a,n){var o=a[0],i=a[1],s=a[2],f=a[3];return r[0]=n[0]*o+n[4]*i+n[8]*s+n[12]*f,r[1]=n[1]*o+n[5]*i+n[9]*s+n[13]*f,r[2]=n[2]*o+n[6]*i+n[10]*s+n[14]*f,r[3]=n[3]*o+n[7]*i+n[11]*s+n[15]*f,r}},5382:function(t,e,r){var a=r(8210),n=r(3012);t.exports=o;function o(i,s){if(i.length===1)return n(s,i[0]);if(s.length===1)return n(i,s[0]);if(i.length===0||s.length===0)return[0];var f=[0];if(i.length<s.length)for(var x=0;x<i.length;++x)f=a(f,n(s,i[x]));else for(var x=0;x<s.length;++x)f=a(f,n(i,s[x]));return f}},5445:function(t,e,r){t.exports=M;var a=r(5033),n=r(5202),o=r(6429),i=r(6760),s=r(5665),f=r(5352),x=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),y=new Float32Array(16);function v(E,A,h){this.lo=E,this.hi=A,this.pixelsPerDataUnit=h}var T=[0,0,0,1],u=[0,0,0,1];function b(E,A,h,p,k){for(var w=0;w<3;++w){for(var R=T,O=u,N=0;N<3;++N)O[N]=R[N]=h[N];O[3]=R[3]=1,O[w]+=1,f(O,O,A),O[3]<0&&(E[w]=1/0),R[w]-=1,f(R,R,A),R[3]<0&&(E[w]=1/0);var V=(R[0]/R[3]-O[0]/O[3])*p,H=(R[1]/R[3]-O[1]/O[3])*k;E[w]=.25*Math.sqrt(V*V+H*H)}return E}var _=[new v(1/0,-1/0,1/0),new v(1/0,-1/0,1/0),new v(1/0,-1/0,1/0)],C=[0,0,0];function M(E,A,h,p,H){var w=A.model||x,R=A.view||x,O=A.projection||x,N=A._ortho||!1,V=E.bounds,H=H||o(w,R,O,V,N),F=H.axis;i(y,R,w),i(y,O,y);for(var U=_,W=0;W<3;++W)U[W].lo=1/0,U[W].hi=-1/0,U[W].pixelsPerDataUnit=1/0;var q=a(s(y,y));s(y,y);for(var X=0;X<3;++X){var lt=(X+1)%3,yt=(X+2)%3,pt=C;t:for(var W=0;W<2;++W){var st=[];if(F[X]<0!=!!W){pt[X]=V[W][X];for(var tt=0;tt<2;++tt){pt[lt]=V[tt^W][lt];for(var dt=0;dt<2;++dt)pt[yt]=V[dt^tt^W][yt],st.push(pt.slice())}for(var rt=N?5:4,tt=rt;tt===rt;++tt){if(st.length===0)continue t;st=n.positive(st,q[tt])}for(var tt=0;tt<st.length;++tt)for(var yt=st[tt],at=b(C,y,yt,h,p),dt=0;dt<3;++dt)U[dt].lo=Math.min(U[dt].lo,yt[dt]),U[dt].hi=Math.max(U[dt].hi,yt[dt]),dt!==X&&(U[dt].pixelsPerDataUnit=Math.min(U[dt].pixelsPerDataUnit,Math.abs(at[dt])))}}}return U}},5455:function(t,e,r){t.exports=r(7056)},5486:function(t,e,r){t.exports=r(3066)},5542:function(t,e,r){var a=r(2478);t.exports=s;function n(f,x){this.stars=f,this.edges=x}var o=n.prototype;function i(f,x,y){for(var v=1,T=f.length;v<T;v+=2)if(f[v-1]===x&&f[v]===y){f[v-1]=f[T-2],f[v]=f[T-1],f.length=T-2;return}}o.isConstraint=function(){var f=[0,0];function x(y,v){return y[0]-v[0]||y[1]-v[1]}return function(y,v){return f[0]=Math.min(y,v),f[1]=Math.max(y,v),a.eq(this.edges,f,x)>=0}}(),o.removeTriangle=function(f,x,y){var v=this.stars;i(v[f],x,y),i(v[x],y,f),i(v[y],f,x)},o.addTriangle=function(f,x,y){var v=this.stars;v[f].push(x,y),v[x].push(y,f),v[y].push(f,x)},o.opposite=function(f,x){for(var y=this.stars[x],v=1,T=y.length;v<T;v+=2)if(y[v]===f)return y[v-1];return-1},o.flip=function(f,x){var y=this.opposite(f,x),v=this.opposite(x,f);this.removeTriangle(f,x,y),this.removeTriangle(x,f,v),this.addTriangle(f,v,y),this.addTriangle(x,y,v)},o.edges=function(){for(var f=this.stars,x=[],y=0,v=f.length;y<v;++y)for(var T=f[y],u=0,b=T.length;u<b;u+=2)x.push([T[u],T[u+1]]);return x},o.cells=function(){for(var f=this.stars,x=[],y=0,v=f.length;y<v;++y)for(var T=f[y],u=0,b=T.length;u<b;u+=2){var _=T[u],C=T[u+1];y<Math.min(_,C)&&x.push([y,_,C])}return x};function s(f,x){for(var y=new Array(f),v=0;v<f;++v)y[v]=[];return new n(y,x)}},5567:function(t){t.exports=e;function e(r,a,n){var o=Math.sin(n),i=Math.cos(n),s=a[4],f=a[5],x=a[6],y=a[7],v=a[8],T=a[9],u=a[10],b=a[11];return a!==r&&(r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15]),r[4]=s*i+v*o,r[5]=f*i+T*o,r[6]=x*i+u*o,r[7]=y*i+b*o,r[8]=v*i-s*o,r[9]=T*i-f*o,r[10]=u*i-x*o,r[11]=b*i-y*o,r}},5572:function(t,e,r){var a=r(869);t.exports=n;function n(o,i){return a(o[0].mul(i[1]).sub(o[1].mul(i[0])),o[1].mul(i[1]))}},5609:function(t,e,r){t.exports=n;var a=r(3134);function n(o,i){for(var s=a(o,i.length),f=new Array(i.length),x=new Array(i.length),y=[],v=0;v<i.length;++v){var T=s[v].length;x[v]=T,f[v]=!0,T<=1&&y.push(v)}for(;y.length>0;){var u=y.pop();f[u]=!1;for(var b=s[u],v=0;v<b.length;++v){var _=b[v];--x[_]===0&&y.push(_)}}for(var C=new Array(i.length),M=[],v=0;v<i.length;++v)if(f[v]){var u=M.length;C[v]=u,M.push(i[v])}else C[v]=-1;for(var E=[],v=0;v<o.length;++v){var A=o[v];f[A[0]]&&f[A[1]]&&E.push([C[A[0]],C[A[1]]])}return[E,M]}},5632:function(t){t.exports=e;function e(r,a,n){return r[0]=a[0]+n[0],r[1]=a[1]+n[1],r[2]=a[2]+n[2],r}},5665:function(t){t.exports=e;function e(r,a){if(r===a){var n=a[1],o=a[2],i=a[3],s=a[6],f=a[7],x=a[11];r[1]=a[4],r[2]=a[8],r[3]=a[12],r[4]=n,r[6]=a[9],r[7]=a[13],r[8]=o,r[9]=s,r[11]=a[14],r[12]=i,r[13]=f,r[14]=x}else r[0]=a[0],r[1]=a[4],r[2]=a[8],r[3]=a[12],r[4]=a[1],r[5]=a[5],r[6]=a[9],r[7]=a[13],r[8]=a[2],r[9]=a[6],r[10]=a[10],r[11]=a[14],r[12]=a[3],r[13]=a[7],r[14]=a[11],r[15]=a[15];return r}},5673:function(t){t.exports=e;function e(r,a,n){var o=a[0],i=a[1],s=a[2],f=n[3]*o+n[7]*i+n[11]*s+n[15];return f=f||1,r[0]=(n[0]*o+n[4]*i+n[8]*s+n[12])/f,r[1]=(n[1]*o+n[5]*i+n[9]*s+n[13])/f,r[2]=(n[2]*o+n[6]*i+n[10]*s+n[14])/f,r}},5714:function(t,e,r){t.exports=h;var a=r(2762),n=r(8116),o=r(7766),i=new Uint8Array(4),s=new Float32Array(i.buffer);function f(p,k,w,R){return i[0]=R,i[1]=w,i[2]=k,i[3]=p,s[0]}var x=r(2478),y=r(9618),v=r(7319),T=v.createShader,u=v.createPickShader,b=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function _(p,k){for(var w=0,R=0;R<3;++R){var O=p[R]-k[R];w+=O*O}return Math.sqrt(w)}function C(p){for(var k=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],w=0;w<3;++w)k[0][w]=Math.max(p[0][w],k[0][w]),k[1][w]=Math.min(p[1][w],k[1][w]);return k}function M(p,k,w,R){this.arcLength=p,this.position=k,this.index=w,this.dataCoordinate=R}function E(p,k,w,R,O,N){this.gl=p,this.shader=k,this.pickShader=w,this.buffer=R,this.vao=O,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=N,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var A=E.prototype;A.isTransparent=function(){return this.hasAlpha},A.isOpaque=function(){return!this.hasAlpha},A.pickSlots=1,A.setPickBase=function(p){this.pickId=p},A.drawTransparent=A.draw=function(p){if(this.vertexCount){var k=this.gl,w=this.shader,R=this.vao;w.bind(),w.uniforms={model:p.model||b,view:p.view||b,projection:p.projection||b,clipBounds:C(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[k.drawingBufferWidth,k.drawingBufferHeight],pixelRatio:this.pixelRatio},R.bind(),R.draw(k.TRIANGLE_STRIP,this.vertexCount),R.unbind()}},A.drawPick=function(p){if(this.vertexCount){var k=this.gl,w=this.pickShader,R=this.vao;w.bind(),w.uniforms={model:p.model||b,view:p.view||b,projection:p.projection||b,pickId:this.pickId,clipBounds:C(this.clipBounds),screenShape:[k.drawingBufferWidth,k.drawingBufferHeight],pixelRatio:this.pixelRatio},R.bind(),R.draw(k.TRIANGLE_STRIP,this.vertexCount),R.unbind()}},A.update=function(p){var k,w;this.dirty=!0;var R=!!p.connectGaps;"dashScale"in p&&(this.dashScale=p.dashScale),this.hasAlpha=!1,"opacity"in p&&(this.opacity=+p.opacity,this.opacity<1&&(this.hasAlpha=!0));var O=[],N=[],V=[],H=0,F=0,U=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],W=p.position||p.positions;if(W){var q=p.color||p.colors||[0,0,0,1],X=p.lineWidth||1,lt=!1;t:for(k=1;k<W.length;++k){var yt=W[k-1],pt=W[k];for(N.push(H),V.push(yt.slice()),w=0;w<3;++w){if(isNaN(yt[w])||isNaN(pt[w])||!isFinite(yt[w])||!isFinite(pt[w])){if(!R&&O.length>0){for(var st=0;st<24;++st)O.push(O[O.length-12]);F+=2,lt=!0}continue t}U[0][w]=Math.min(U[0][w],yt[w],pt[w]),U[1][w]=Math.max(U[1][w],yt[w],pt[w])}var tt,dt;Array.isArray(q[0])?(tt=q.length>k-1?q[k-1]:q.length>0?q[q.length-1]:[0,0,0,1],dt=q.length>k?q[k]:q.length>0?q[q.length-1]:[0,0,0,1]):tt=dt=q,tt.length===3&&(tt=[tt[0],tt[1],tt[2],1]),dt.length===3&&(dt=[dt[0],dt[1],dt[2],1]),!this.hasAlpha&&tt[3]<1&&(this.hasAlpha=!0);var rt;Array.isArray(X)?rt=X.length>k-1?X[k-1]:X.length>0?X[X.length-1]:[0,0,0,1]:rt=X;var at=H;if(H+=_(yt,pt),lt){for(w=0;w<2;++w)O.push(yt[0],yt[1],yt[2],pt[0],pt[1],pt[2],at,rt,tt[0],tt[1],tt[2],tt[3]);F+=2,lt=!1}O.push(yt[0],yt[1],yt[2],pt[0],pt[1],pt[2],at,rt,tt[0],tt[1],tt[2],tt[3],yt[0],yt[1],yt[2],pt[0],pt[1],pt[2],at,-rt,tt[0],tt[1],tt[2],tt[3],pt[0],pt[1],pt[2],yt[0],yt[1],yt[2],H,-rt,dt[0],dt[1],dt[2],dt[3],pt[0],pt[1],pt[2],yt[0],yt[1],yt[2],H,rt,dt[0],dt[1],dt[2],dt[3]),F+=4}}if(this.buffer.update(O),N.push(H),V.push(W[W.length-1].slice()),this.bounds=U,this.vertexCount=F,this.points=V,this.arcLength=N,"dashes"in p){var vt=p.dashes,it=vt.slice();for(it.unshift(0),k=1;k<it.length;++k)it[k]=it[k-1]+it[k];var Y=y(new Array(256*4),[256,1,4]);for(k=0;k<256;++k){for(w=0;w<4;++w)Y.set(k,0,w,0);x.le(it,it[it.length-1]*k/255)&1?Y.set(k,0,0,0):Y.set(k,0,0,255)}this.texture.setPixels(Y)}},A.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},A.pick=function(p){if(!p||p.id!==this.pickId)return null;var k=f(p.value[0],p.value[1],p.value[2],0),w=x.le(this.arcLength,k);if(w<0)return null;if(w===this.arcLength.length-1)return new M(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),w);for(var R=this.points[w],O=this.points[Math.min(w+1,this.points.length-1)],N=(k-this.arcLength[w])/(this.arcLength[w+1]-this.arcLength[w]),V=1-N,H=[0,0,0],F=0;F<3;++F)H[F]=V*R[F]+N*O[F];var U=Math.min(N<.5?w:w+1,this.points.length-1);return new M(k,H,U,this.points[U])};function h(p){var k=p.gl||p.scene&&p.scene.gl,w=T(k);w.attributes.position.location=0,w.attributes.nextPosition.location=1,w.attributes.arcLength.location=2,w.attributes.lineWidth.location=3,w.attributes.color.location=4;var R=u(k);R.attributes.position.location=0,R.attributes.nextPosition.location=1,R.attributes.arcLength.location=2,R.attributes.lineWidth.location=3,R.attributes.color.location=4;for(var O=a(k),N=n(k,[{buffer:O,size:3,offset:0,stride:48},{buffer:O,size:3,offset:12,stride:48},{buffer:O,size:1,offset:24,stride:48},{buffer:O,size:1,offset:28,stride:48},{buffer:O,size:4,offset:32,stride:48}]),V=y(new Array(1024),[256,1,4]),H=0;H<1024;++H)V.data[H]=255;var F=o(k,V);F.wrap=k.REPEAT;var U=new E(k,w,R,O,N,F);return U.update(p),U}},5716:function(t,e,r){var a=r(6859);t.exports=n;function n(o){return o.cmp(new a(0))}},5721:function(t){t.exports=e;function e(r){for(var a=0,n=0,o=1;o<r.length;++o)r[o][0]<r[a][0]&&(a=o),r[o][0]>r[n][0]&&(n=o);return a<n?[[a],[n]]:a>n?[[n],[a]]:[[a]]}},5771:function(t,e,r){var a=r(8507),n=r(3788),o=r(2419);t.exports=i;function i(s){s.sort(n);for(var f=s.length,x=0,y=0;y<f;++y){var v=s[y],T=o(v);if(T!==0){if(x>0){var u=s[x-1];if(a(v,u)===0&&o(u)!==T){x-=1;continue}}s[x++]=v}}return s.length=x,s}},5838:function(t,e,r){t.exports=n;var a=r(7842);function n(o){for(var i=new Array(o.length),s=0;s<o.length;++s)i[s]=a(o[s]);return i}},5847:function(t){t.exports=e;function e(r,a,n){return r[0]=a[0]*n[0],r[1]=a[1]*n[1],r[2]=a[2]*n[2],r}},5874:function(t,e,r){t.exports=w;var a=r(620),n=r(7827),o=r(6852),i=r(7932),s=r(3508),f=999,x=9999,y=0,v=1,T=2,u=3,b=4,_=5,C=6,M=7,E=8,A=9,h=10,p=11,k=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function w(R){var O=0,N=0,V=f,H,F,U=[],W=[],q=1,X=0,lt=0,yt=!1,pt=!1,st="",tt;R=R||{};var dt=o,rt=a;R.version==="300 es"&&(dt=s,rt=i);for(var at={},vt={},O=0;O<dt.length;O++)at[dt[O]]=!0;for(var O=0;O<rt.length;O++)vt[rt[O]]=!0;return function(Tt){return W=[],Tt!==null?Y(Tt):ft()};function it(Tt){Tt.length&&W.push({type:k[V],data:Tt,position:lt,line:q,column:X})}function Y(Tt){O=0,Tt.toString&&(Tt=Tt.toString()),st+=Tt.replace(/\r\n/g,`
`),tt=st.length;for(var Lt;H=st[O],O<tt;){switch(Lt=O,V){case y:O=Wt();break;case v:O=Pt();break;case T:O=zt();break;case u:O=Ht();break;case b:O=he();break;case p:O=ge();break;case _:O=de();break;case x:O=se();break;case A:O=wt();break;case f:O=ut();break}if(Lt!==O)switch(st[Lt]){case`
`:X=0,++q;break;default:++X;break}}return N+=O,st=st.slice(O),W}function ft(Tt){return U.length&&it(U.join("")),V=h,it("(eof)"),W}function ut(){return U=U.length?[]:U,F==="/"&&H==="*"?(lt=N+O-1,V=y,F=H,O+1):F==="/"&&H==="/"?(lt=N+O-1,V=v,F=H,O+1):H==="#"?(V=T,lt=N+O,O):/\s/.test(H)?(V=A,lt=N+O,O):(yt=/\d/.test(H),pt=/[^\w_]/.test(H),lt=N+O,V=yt?b:pt?u:x,O)}function wt(){return/[^\s]/g.test(H)?(it(U.join("")),V=f,O):(U.push(H),F=H,O+1)}function zt(){return(H==="\r"||H===`
`)&&F!=="\\"?(it(U.join("")),V=f,O):(U.push(H),F=H,O+1)}function Pt(){return zt()}function Wt(){return H==="/"&&F==="*"?(U.push(H),it(U.join("")),V=f,O+1):(U.push(H),F=H,O+1)}function Ht(){if(F==="."&&/\d/.test(H))return V=_,O;if(F==="/"&&H==="*")return V=y,O;if(F==="/"&&H==="/")return V=v,O;if(H==="."&&U.length){for(;Jt(U););return V=_,O}if(H===";"||H===")"||H==="("){if(U.length)for(;Jt(U););return it(H),V=f,O+1}var Tt=U.length===2&&H!=="=";if(/[\w_\d\s]/.test(H)||Tt){for(;Jt(U););return V=f,O}return U.push(H),F=H,O+1}function Jt(Tt){var Lt=0,Mt,te;do{if(Mt=n.indexOf(Tt.slice(0,Tt.length+Lt).join("")),te=n[Mt],Mt===-1){if(Lt--+Tt.length>0)continue;te=Tt.slice(0,1).join("")}return it(te),lt+=te.length,U=U.slice(te.length),U.length}while(!0)}function ge(){return/[^a-fA-F0-9]/.test(H)?(it(U.join("")),V=f,O):(U.push(H),F=H,O+1)}function he(){return H==="."||/[eE]/.test(H)?(U.push(H),V=_,F=H,O+1):H==="x"&&U.length===1&&U[0]==="0"?(V=p,U.push(H),F=H,O+1):/[^\d]/.test(H)?(it(U.join("")),V=f,O):(U.push(H),F=H,O+1)}function de(){return H==="f"&&(U.push(H),F=H,O+=1),/[eE]/.test(H)||(H==="-"||H==="+")&&/[eE]/.test(F)?(U.push(H),F=H,O+1):/[^\d]/.test(H)?(it(U.join("")),V=f,O):(U.push(H),F=H,O+1)}function se(){if(/[^\d\w_]/.test(H)){var Tt=U.join("");return vt[Tt]?V=E:at[Tt]?V=M:V=C,it(U.join("")),V=f,O}return U.push(H),F=H,O+1}}},5878:function(t,e,r){t.exports=i;var a=r(3250),n=r(2014);function o(s,f,x){var y=Math.abs(a(s,f,x)),v=Math.sqrt(Math.pow(f[0]-x[0],2)+Math.pow(f[1]-x[1],2));return y/v}function i(s,f,x){for(var y=f.length,v=s.length,T=new Array(y),u=new Array(y),b=new Array(y),_=new Array(y),C=0;C<y;++C)T[C]=u[C]=-1,b[C]=1/0,_[C]=!1;for(var C=0;C<v;++C){var M=s[C];if(M.length!==2)throw new Error("Input must be a graph");var E=M[1],A=M[0];u[A]!==-1?u[A]=-2:u[A]=E,T[E]!==-1?T[E]=-2:T[E]=A}function h(st){if(_[st])return 1/0;var tt=T[st],dt=u[st];return tt<0||dt<0?1/0:o(f[st],f[tt],f[dt])}function p(st,tt){var dt=F[st],rt=F[tt];F[st]=rt,F[tt]=dt,U[dt]=tt,U[rt]=st}function k(st){return b[F[st]]}function w(st){return st&1?st-1>>1:(st>>1)-1}function R(st){for(var tt=k(st);;){var dt=tt,rt=2*st+1,at=2*(st+1),vt=st;if(rt<q){var it=k(rt);it<dt&&(vt=rt,dt=it)}if(at<q){var Y=k(at);Y<dt&&(vt=at)}if(vt===st)return st;p(st,vt),st=vt}}function O(st){for(var tt=k(st);st>0;){var dt=w(st);if(dt>=0){var rt=k(dt);if(tt<rt){p(st,dt),st=dt;continue}}return st}}function N(){if(q>0){var st=F[0];return p(0,q-1),q-=1,R(0),st}return-1}function V(st,tt){var dt=F[st];return b[dt]===tt?st:(b[dt]=-1/0,O(st),N(),b[dt]=tt,q+=1,O(q-1))}function H(st){if(!_[st]){_[st]=!0;var tt=T[st],dt=u[st];T[dt]>=0&&(T[dt]=tt),u[tt]>=0&&(u[tt]=dt),U[tt]>=0&&V(U[tt],h(tt)),U[dt]>=0&&V(U[dt],h(dt))}}for(var F=[],U=new Array(y),C=0;C<y;++C){var W=b[C]=h(C);W<1/0?(U[C]=F.length,F.push(C)):U[C]=-1}for(var q=F.length,C=q>>1;C>=0;--C)R(C);for(;;){var X=N();if(X<0||b[X]>x)break;H(X)}for(var lt=[],C=0;C<y;++C)_[C]||(U[C]=lt.length,lt.push(f[C].slice()));lt.length;function yt(st,tt){if(st[tt]<0)return tt;var dt=tt,rt=tt;do{var at=st[rt];if(!_[rt]||at<0||at===rt||(rt=at,at=st[rt],!_[rt]||at<0||at===rt))break;rt=at,dt=st[dt]}while(dt!==rt);for(var vt=tt;vt!==rt;vt=st[vt])st[vt]=rt;return rt}var pt=[];return s.forEach(function(st){var tt=yt(T,st[0]),dt=yt(u,st[1]);if(tt>=0&&dt>=0&&tt!==dt){var rt=U[tt],at=U[dt];rt!==at&&pt.push([rt,at])}}),n.unique(n.normalize(pt)),{positions:lt,edges:pt}}},5911:function(t){t.exports=e;function e(r,a,n){var o=a[0],i=a[1],s=a[2],f=n[0],x=n[1],y=n[2];return r[0]=i*y-s*x,r[1]=s*f-o*y,r[2]=o*x-i*f,r}},5964:function(t){t.exports=function(e){return!e&&e!==0?"":e.toString()}},5995:function(t,e,r){t.exports=o;var a=r(7642),n=r(6037);function o(i,s){return a(s).filter(function(f){for(var x=new Array(f.length),y=0;y<f.length;++y)x[y]=s[f[y]];return n(x)*i<1})}},6037:function(t,e,r){t.exports=n;var a=r(3628);function n(o){for(var i=a(o),s=0,f=0;f<o.length;++f)for(var x=o[f],y=0;y<i.length;++y)s+=Math.pow(x[y]-i[y],2);return Math.sqrt(s/o.length)}},6079:function(t){t.exports=e;function e(r,a,n,o){var i=o[0],s=o[1],f=o[2],x=Math.sqrt(i*i+s*s+f*f),y,v,T,u,b,_,C,M,E,A,h,p,k,w,R,O,N,V,H,F,U,W,q,X;return Math.abs(x)<1e-6?null:(x=1/x,i*=x,s*=x,f*=x,y=Math.sin(n),v=Math.cos(n),T=1-v,u=a[0],b=a[1],_=a[2],C=a[3],M=a[4],E=a[5],A=a[6],h=a[7],p=a[8],k=a[9],w=a[10],R=a[11],O=i*i*T+v,N=s*i*T+f*y,V=f*i*T-s*y,H=i*s*T-f*y,F=s*s*T+v,U=f*s*T+i*y,W=i*f*T+s*y,q=s*f*T-i*y,X=f*f*T+v,r[0]=u*O+M*N+p*V,r[1]=b*O+E*N+k*V,r[2]=_*O+A*N+w*V,r[3]=C*O+h*N+R*V,r[4]=u*H+M*F+p*U,r[5]=b*H+E*F+k*U,r[6]=_*H+A*F+w*U,r[7]=C*H+h*F+R*U,r[8]=u*W+M*q+p*X,r[9]=b*W+E*q+k*X,r[10]=_*W+A*q+w*X,r[11]=C*W+h*q+R*X,a!==r&&(r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15]),r)}},6141:function(t,e,r){t.exports=r(2953)},6199:function(t,e,r){var a=r(1338),n={zero:function(C,M,E,A){var h=C[0],p=E[0];A|=0;var k=0,w=p;for(k=0;k<h;++k)M[A]=0,A+=w},fdTemplate1:function(C,M,E,A,h,p,k){var w=C[0],R=E[0],O=p[0],N=-1*R,V=R;A|=0,k|=0;var H=0,F=R,U=O;for(H=0;H<w;++H)h[k]=.5*(M[A+N]-M[A+V]),A+=F,k+=U},fdTemplate2:function(C,M,E,A,h,p,k,w,R,O){var N=C[0],V=C[1],H=E[0],F=E[1],U=p[0],W=p[1],q=R[0],X=R[1],lt=-1*H,yt=H,pt=-1*F,st=F;A|=0,k|=0,O|=0;var tt=0,dt=0,rt=F,at=H-V*F,vt=W,it=U-V*W,Y=X,ft=q-V*X;for(dt=0;dt<N;++dt){for(tt=0;tt<V;++tt)h[k]=.5*(M[A+lt]-M[A+yt]),w[O]=.5*(M[A+pt]-M[A+st]),A+=rt,k+=vt,O+=Y;A+=at,k+=it,O+=ft}}},o={cdiff:function(C){var M={};return function(E,A,h){var p=E.dtype,k=E.order,w=A.dtype,R=A.order,O=h.dtype,N=h.order,V=[p,k.join(),w,R.join(),O,N.join()].join(),H=M[V];return H||(M[V]=H=C([p,k,w,R,O,N])),H(E.shape.slice(0),E.data,E.stride,E.offset|0,A.data,A.stride,A.offset|0,h.data,h.stride,h.offset|0)}},zero:function(C){var M={};return function(E){var A=E.dtype,h=E.order,p=[A,h.join()].join(),k=M[p];return k||(M[p]=k=C([A,h])),k(E.shape.slice(0),E.data,E.stride,E.offset|0)}},fdTemplate1:function(C){var M={};return function(E,A){var h=E.dtype,p=E.order,k=A.dtype,w=A.order,R=[h,p.join(),k,w.join()].join(),O=M[R];return O||(M[R]=O=C([h,p,k,w])),O(E.shape.slice(0),E.data,E.stride,E.offset|0,A.data,A.stride,A.offset|0)}},fdTemplate2:function(C){var M={};return function(E,A,h){var p=E.dtype,k=E.order,w=A.dtype,R=A.order,O=h.dtype,N=h.order,V=[p,k.join(),w,R.join(),O,N.join()].join(),H=M[V];return H||(M[V]=H=C([p,k,w,R,O,N])),H(E.shape.slice(0),E.data,E.stride,E.offset|0,A.data,A.stride,A.offset|0,h.data,h.stride,h.offset|0)}}};function i(C){var M=o[C.funcName];return M(s.bind(void 0,C))}function s(C){return n[C.funcName]}function f(C){return i({funcName:C.funcName})}var x={},y={},v=f({funcName:"cdiff"}),T=f({funcName:"zero"});function u(C){return C in x?x[C]:x[C]=f({funcName:"fdTemplate"+C})}function b(C,M,E,A){return function(h,p){var k=p.shape.slice();return k[0]>2&&k[1]>2&&A(p.pick(-1,-1).lo(1,1).hi(k[0]-2,k[1]-2),h.pick(-1,-1,0).lo(1,1).hi(k[0]-2,k[1]-2),h.pick(-1,-1,1).lo(1,1).hi(k[0]-2,k[1]-2)),k[1]>2&&(E(p.pick(0,-1).lo(1).hi(k[1]-2),h.pick(0,-1,1).lo(1).hi(k[1]-2)),M(h.pick(0,-1,0).lo(1).hi(k[1]-2))),k[1]>2&&(E(p.pick(k[0]-1,-1).lo(1).hi(k[1]-2),h.pick(k[0]-1,-1,1).lo(1).hi(k[1]-2)),M(h.pick(k[0]-1,-1,0).lo(1).hi(k[1]-2))),k[0]>2&&(E(p.pick(-1,0).lo(1).hi(k[0]-2),h.pick(-1,0,0).lo(1).hi(k[0]-2)),M(h.pick(-1,0,1).lo(1).hi(k[0]-2))),k[0]>2&&(E(p.pick(-1,k[1]-1).lo(1).hi(k[0]-2),h.pick(-1,k[1]-1,0).lo(1).hi(k[0]-2)),M(h.pick(-1,k[1]-1,1).lo(1).hi(k[0]-2))),h.set(0,0,0,0),h.set(0,0,1,0),h.set(k[0]-1,0,0,0),h.set(k[0]-1,0,1,0),h.set(0,k[1]-1,0,0),h.set(0,k[1]-1,1,0),h.set(k[0]-1,k[1]-1,0,0),h.set(k[0]-1,k[1]-1,1,0),h}}function _(C){var M=C.join(),k=y[M];if(k)return k;for(var E=C.length,A=[v,T],h=1;h<=E;++h)A.push(u(h));var p=b,k=p.apply(void 0,A);return y[M]=k,k}t.exports=function(C,M,E){if(Array.isArray(E)||(typeof E=="string"?E=a(M.dimension,E):E=a(M.dimension,"clamp")),M.size===0)return C;if(M.dimension===0)return C.set(0),C;var A=_(E);return A(C,M)}},6204:function(t){t.exports=e;function e(r){var a,n,o,i=r.length,s=0;for(a=0;a<i;++a)s+=r[a].length;var f=new Array(s),x=0;for(a=0;a<i;++a){var y=r[a],v=y.length;for(n=0;n<v;++n){var T=f[x++]=new Array(v-1),u=0;for(o=0;o<v;++o)o!==n&&(T[u++]=y[o]);if(n&1){var b=T[1];T[1]=T[0],T[0]=b}}}return f}},6296:function(t,e,r){t.exports=f;var a=r(7261),n=r(9977),o=r(1811);function i(x,y){this._controllerNames=Object.keys(x),this._controllerList=this._controllerNames.map(function(v){return x[v]}),this._mode=y,this._active=x[y],this._active||(this._mode="turntable",this._active=x.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=i.prototype;s.flush=function(x){for(var y=this._controllerList,v=0;v<y.length;++v)y[v].flush(x)},s.idle=function(x){for(var y=this._controllerList,v=0;v<y.length;++v)y[v].idle(x)},s.lookAt=function(x,y,v,T){for(var u=this._controllerList,b=0;b<u.length;++b)u[b].lookAt(x,y,v,T)},s.rotate=function(x,y,v,T){for(var u=this._controllerList,b=0;b<u.length;++b)u[b].rotate(x,y,v,T)},s.pan=function(x,y,v,T){for(var u=this._controllerList,b=0;b<u.length;++b)u[b].pan(x,y,v,T)},s.translate=function(x,y,v,T){for(var u=this._controllerList,b=0;b<u.length;++b)u[b].translate(x,y,v,T)},s.setMatrix=function(x,y){for(var v=this._controllerList,T=0;T<v.length;++T)v[T].setMatrix(x,y)},s.setDistanceLimits=function(x,y){for(var v=this._controllerList,T=0;T<v.length;++T)v[T].setDistanceLimits(x,y)},s.setDistance=function(x,y){for(var v=this._controllerList,T=0;T<v.length;++T)v[T].setDistance(x,y)},s.recalcMatrix=function(x){this._active.recalcMatrix(x)},s.getDistance=function(x){return this._active.getDistance(x)},s.getDistanceLimits=function(x){return this._active.getDistanceLimits(x)},s.lastT=function(){return this._active.lastT()},s.setMode=function(x){if(x!==this._mode){var y=this._controllerNames.indexOf(x);if(!(y<0)){var v=this._active,T=this._controllerList[y],u=Math.max(v.lastT(),T.lastT());v.recalcMatrix(u),T.setMatrix(u,v.computedMatrix),this._active=T,this._mode=x,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(x){x=x||{};var y=x.eye||[0,0,1],v=x.center||[0,0,0],T=x.up||[0,1,0],u=x.distanceLimits||[0,1/0],b=x.mode||"turntable",_=a(),C=n(),M=o();return _.setDistanceLimits(u[0],u[1]),_.lookAt(0,y,v,T),C.setDistanceLimits(u[0],u[1]),C.lookAt(0,y,v,T),M.setDistanceLimits(u[0],u[1]),M.lookAt(0,y,v,T),new i({turntable:_,orbit:C,matrix:M},b)}},6330:function(t,e,r){var a=r(1533);t.exports=n;function n(o){return Array.isArray(o)&&o.length===2&&a(o[0])&&a(o[1])}},6405:function(t,e,r){var a=r(2931);t.exports=function(o,i){var s=o.positions,f=o.vectors,x={positions:[],vertexIntensity:[],vertexIntensityBounds:o.vertexIntensityBounds,vectors:[],cells:[],coneOffset:o.coneOffset,colormap:o.colormap};if(o.positions.length===0)return i&&(i[0]=[0,0,0],i[1]=[0,0,0]),x;for(var y=0,v=1/0,T=-1/0,u=1/0,b=-1/0,_=1/0,C=-1/0,M=null,E=null,A=[],h=1/0,p=!1,k=o.coneSizemode==="raw",w=0;w<s.length;w++){var R=s[w];v=Math.min(R[0],v),T=Math.max(R[0],T),u=Math.min(R[1],u),b=Math.max(R[1],b),_=Math.min(R[2],_),C=Math.max(R[2],C);var O=f[w];if(a.length(O)>y&&(y=a.length(O)),w&&!k){var N=2*a.distance(M,R)/(a.length(E)+a.length(O));N?(h=Math.min(h,N),p=!1):p=!0}p||(M=R,E=O),A.push(O)}var V=[v,u,_],H=[T,b,C];i&&(i[0]=V,i[1]=H),y===0&&(y=1);var F=1/y;isFinite(h)||(h=1),x.vectorScale=h;var U=o.coneSize||(k?1:.5);o.absoluteConeSize&&(U=o.absoluteConeSize*F),x.coneScale=U;for(var w=0,W=0;w<s.length;w++)for(var R=s[w],q=R[0],X=R[1],lt=R[2],yt=A[w],pt=a.length(yt)*F,st=0,tt=8;st<tt;st++){x.positions.push([q,X,lt,W++]),x.positions.push([q,X,lt,W++]),x.positions.push([q,X,lt,W++]),x.positions.push([q,X,lt,W++]),x.positions.push([q,X,lt,W++]),x.positions.push([q,X,lt,W++]),x.vectors.push(yt),x.vectors.push(yt),x.vectors.push(yt),x.vectors.push(yt),x.vectors.push(yt),x.vectors.push(yt),x.vertexIntensity.push(pt,pt,pt),x.vertexIntensity.push(pt,pt,pt);var dt=x.positions.length;x.cells.push([dt-6,dt-5,dt-4],[dt-3,dt-2,dt-1])}return x};var n=r(614);t.exports.createMesh=r(9060),t.exports.createConeMesh=function(o,i){return t.exports.createMesh(o,i,{shaders:n,traceType:"cone"})}},6429:function(t,e,r){t.exports=E;var a=r(8828),n=r(6760),o=r(5202),i=r(3250),s=new Array(16),f=new Array(8),x=new Array(8),y=new Array(3),v=[0,0,0];(function(){for(var A=0;A<8;++A)f[A]=[1,1,1,1],x[A]=[1,1,1]})();function T(A,h,p){for(var k=0;k<4;++k){A[k]=p[12+k];for(var w=0;w<3;++w)A[k]+=h[w]*p[4*w+k]}}var u=[[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 b(A){for(var h=0;h<u.length;++h)if(A=o.positive(A,u[h]),A.length<3)return 0;for(var p=A[0],k=p[0]/p[3],w=p[1]/p[3],R=0,h=1;h+1<A.length;++h){var O=A[h],N=A[h+1],V=O[0]/O[3],H=O[1]/O[3],F=N[0]/N[3],U=N[1]/N[3],W=V-k,q=H-w,X=F-k,lt=U-w;R+=Math.abs(W*lt-q*X)}return R}var _=[1,1,1],C=[0,0,0],M={cubeEdges:_,axis:C};function E(A,h,p,k,w){n(s,h,A),n(s,p,s);for(var R=0,O=0;O<2;++O){y[2]=k[O][2];for(var N=0;N<2;++N){y[1]=k[N][1];for(var V=0;V<2;++V)y[0]=k[V][0],T(f[R],y,s),R+=1}}for(var H=-1,O=0;O<8;++O){for(var F=f[O][3],U=0;U<3;++U)x[O][U]=f[O][U]/F;w&&(x[O][2]*=-1),F<0&&(H<0||x[O][2]<x[H][2])&&(H=O)}if(H<0){H=0;for(var W=0;W<3;++W){for(var q=(W+2)%3,X=(W+1)%3,lt=-1,yt=-1,pt=0;pt<2;++pt){var st=pt<<W,tt=st+(pt<<q)+(1-pt<<X),dt=st+(1-pt<<q)+(pt<<X);i(x[st],x[tt],x[dt],v)<0||(pt?lt=1:yt=1)}if(lt<0||yt<0){yt>lt&&(H|=1<<W);continue}for(var pt=0;pt<2;++pt){var st=pt<<W,tt=st+(pt<<q)+(1-pt<<X),dt=st+(1-pt<<q)+(pt<<X),rt=b([f[st],f[tt],f[dt],f[st+(1<<q)+(1<<X)]]);pt?lt=rt:yt=rt}if(yt>lt){H|=1<<W;continue}}}for(var at=7^H,vt=-1,O=0;O<8;++O)O===H||O===at||(vt<0||x[vt][1]>x[O][1])&&(vt=O);for(var it=-1,O=0;O<3;++O){var Y=vt^1<<O;if(!(Y===H||Y===at)){it<0&&(it=Y);var X=x[Y];X[0]<x[it][0]&&(it=Y)}}for(var ft=-1,O=0;O<3;++O){var Y=vt^1<<O;if(!(Y===H||Y===at||Y===it)){ft<0&&(ft=Y);var X=x[Y];X[0]>x[ft][0]&&(ft=Y)}}var ut=_;ut[0]=ut[1]=ut[2]=0,ut[a.log2(it^vt)]=vt&it,ut[a.log2(vt^ft)]=vt&ft;var wt=ft^7;wt===H||wt===at?(wt=it^7,ut[a.log2(ft^wt)]=wt&ft):ut[a.log2(it^wt)]=wt&it;for(var zt=C,Pt=H,W=0;W<3;++W)Pt&1<<W?zt[W]=-1:zt[W]=1;return M}},6444:function(t,e){e.create=a,e.equal=n;function r(o,i){var s=o+"",f=s.indexOf("."),x=0;f>=0&&(x=s.length-f-1);var y=Math.pow(10,x),v=Math.round(o*i*y),T=v+"";if(T.indexOf("e")>=0)return T;var u=v/y,b=v%y;v<0?(u=-Math.ceil(u)|0,b=-b|0):(u=Math.floor(u)|0,b=b|0);var _=""+u;if(v<0&&(_="-"+_),x){for(var C=""+b;C.length<x;)C="0"+C;return _+"."+C}else return _}function a(o,i){for(var s=[],f=0;f<3;++f){for(var x=[],y=.5*(o[0][f]+o[1][f]),v=0;v*i[f]<=o[1][f];++v)x.push({x:v*i[f],text:r(i[f],v)});for(var v=-1;v*i[f]>=o[0][f];--v)x.push({x:v*i[f],text:r(i[f],v)});s.push(x)}return s}function n(o,i){for(var s=0;s<3;++s){if(o[s].length!==i[s].length)return!1;for(var f=0;f<o[s].length;++f){var x=o[s][f],y=i[s][f];if(x.x!==y.x||x.text!==y.text||x.font!==y.font||x.fontColor!==y.fontColor||x.fontSize!==y.fontSize||x.dx!==y.dx||x.dy!==y.dy)return!1}}return!0}},6468:function(t){t.exports=function(e){return atob(e)}},6504:function(t,e,r){var a=r(869);t.exports=n;function n(o,i){return a(o[0].mul(i[0]),o[1].mul(i[1]))}},6582:function(t,e,r){var a=r(7894);t.exports=n;function n(o,i,s,f){var x,y,v,T,u,b,_,C,M,E,A=i[0],h=i[1],p=i[2],k=f[0],w=f[1],R=f[2],O=s[0],N=s[1],V=s[2];return Math.abs(A-O)<1e-6&&Math.abs(h-N)<1e-6&&Math.abs(p-V)<1e-6?a(o):(_=A-O,C=h-N,M=p-V,E=1/Math.sqrt(_*_+C*C+M*M),_*=E,C*=E,M*=E,x=w*M-R*C,y=R*_-k*M,v=k*C-w*_,E=Math.sqrt(x*x+y*y+v*v),E?(E=1/E,x*=E,y*=E,v*=E):(x=0,y=0,v=0),T=C*v-M*y,u=M*x-_*v,b=_*y-C*x,E=Math.sqrt(T*T+u*u+b*b),E?(E=1/E,T*=E,u*=E,b*=E):(T=0,u=0,b=0),o[0]=x,o[1]=T,o[2]=_,o[3]=0,o[4]=y,o[5]=u,o[6]=C,o[7]=0,o[8]=v,o[9]=b,o[10]=M,o[11]=0,o[12]=-(x*A+y*h+v*p),o[13]=-(T*A+u*h+b*p),o[14]=-(_*A+C*h+M*p),o[15]=1,o)}},6621:function(t){t.exports=e;function e(r,a,n){return r[0]=a[0]*n,r[1]=a[1]*n,r[2]=a[2]*n,r}},6658:function(t){t.exports=e;function e(r,a,n,o){var i=a[0],s=a[1],f=a[2];return r[0]=i+o*(n[0]-i),r[1]=s+o*(n[1]-s),r[2]=f+o*(n[2]-f),r}},6690:function(t){t.exports=e;function e(r,a,n){return r[0]=a[0]/n[0],r[1]=a[1]/n[1],r[2]=a[2]/n[2],r}},6729:function(t,e,r){var a=r(3642),n=r(395);t.exports=o;function o(x){var y,v,T,u,b,_,C,M,p,E,A;if(x||(x={}),M=(x.nshades||72)-1,C=x.format||"hex",_=x.colormap,_||(_="jet"),typeof _=="string"){if(_=_.toLowerCase(),!a[_])throw Error(_+" not a supported colorscale");b=a[_]}else if(Array.isArray(_))b=_.slice();else throw Error("unsupported colormap option",_);if(b.length>M+1)throw new Error(_+" map requires nshades to be at least size "+b.length);Array.isArray(x.alpha)?x.alpha.length!==2?E=[1,1]:E=x.alpha.slice():typeof x.alpha=="number"?E=[x.alpha,x.alpha]:E=[1,1],y=b.map(function(R){return Math.round(R.index*M)}),E[0]=Math.min(Math.max(E[0],0),1),E[1]=Math.min(Math.max(E[1],0),1);var h=b.map(function(R,O){var N=b[O].index,V=b[O].rgb.slice();return V.length===4&&V[3]>=0&&V[3]<=1||(V[3]=E[0]+(E[1]-E[0])*N),V}),p=[];for(A=0;A<y.length-1;++A){u=y[A+1]-y[A],v=h[A],T=h[A+1];for(var k=0;k<u;k++){var w=k/u;p.push([Math.round(n(v[0],T[0],w)),Math.round(n(v[1],T[1],w)),Math.round(n(v[2],T[2],w)),n(v[3],T[3],w)])}}return p.push(b[b.length-1].rgb.concat(E[1])),C==="hex"?p=p.map(s):C==="rgbaString"?p=p.map(f):C==="float"&&(p=p.map(i)),p}function i(x){return[x[0]/255,x[1]/255,x[2]/255,x[3]]}function s(x){for(var y,v="#",T=0;T<3;++T)y=x[T],y=y.toString(16),v+=("00"+y).substr(y.length);return v}function f(x){return"rgba("+x.join(",")+")"}},6740:function(t,e,r){var a=r(3236),n=a([`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=a([`#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;
}
`]),i=a([`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=a([`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:i,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},6743:function(t){t.exports=e;function e(r,a,n){var o=a[0],i=a[1],s=a[2],f=a[3],x=o+o,y=i+i,v=s+s,T=o*x,u=o*y,b=o*v,_=i*y,C=i*v,M=s*v,E=f*x,A=f*y,h=f*v;return r[0]=1-(_+M),r[1]=u+h,r[2]=b-A,r[3]=0,r[4]=u-h,r[5]=1-(T+M),r[6]=C+E,r[7]=0,r[8]=b+A,r[9]=C-E,r[10]=1-(T+_),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,a,n){var o=a[0],i=a[1],s=a[2],f=a[3],x=a[4],y=a[5],v=a[6],T=a[7],u=a[8],b=a[9],_=a[10],C=a[11],M=a[12],E=a[13],A=a[14],h=a[15],p=n[0],k=n[1],w=n[2],R=n[3];return r[0]=p*o+k*x+w*u+R*M,r[1]=p*i+k*y+w*b+R*E,r[2]=p*s+k*v+w*_+R*A,r[3]=p*f+k*T+w*C+R*h,p=n[4],k=n[5],w=n[6],R=n[7],r[4]=p*o+k*x+w*u+R*M,r[5]=p*i+k*y+w*b+R*E,r[6]=p*s+k*v+w*_+R*A,r[7]=p*f+k*T+w*C+R*h,p=n[8],k=n[9],w=n[10],R=n[11],r[8]=p*o+k*x+w*u+R*M,r[9]=p*i+k*y+w*b+R*E,r[10]=p*s+k*v+w*_+R*A,r[11]=p*f+k*T+w*C+R*h,p=n[12],k=n[13],w=n[14],R=n[15],r[12]=p*o+k*x+w*u+R*M,r[13]=p*i+k*y+w*b+R*E,r[14]=p*s+k*v+w*_+R*A,r[15]=p*f+k*T+w*C+R*h,r}},6768:function(t,e,r){var a=r(6859);t.exports=n;function n(o){return new a(o)}},6803:function(t,e,r){r(8828),r(1755);function a(n,o){var i=n.length,s=n.length-o.length,f=Math.min;if(s)return s;switch(i){case 0:return 0;case 1:return n[0]-o[0];case 2:var u=n[0]+n[1]-o[0]-o[1];return u||f(n[0],n[1])-f(o[0],o[1]);case 3:var x=n[0]+n[1],y=o[0]+o[1];if(u=x+n[2]-(y+o[2]),u)return u;var v=f(n[0],n[1]),T=f(o[0],o[1]),u=f(v,n[2])-f(T,o[2]);return u||f(v+n[2],x)-f(T+o[2],y);default:var b=n.slice(0);b.sort();var _=o.slice(0);_.sort();for(var C=0;C<i;++C)if(s=b[C]-_[C],s)return s;return 0}}e.Fw=a},6808:function(t){t.exports=e;function e(r){var a=r[0],n=r[1],o=r[2],i=r[3];return Math.sqrt(a*a+n*n+o*o+i*i)}},6843:function(t){t.exports=e;function e(r,a,n){return r[0]=a[0]-n[0],r[1]=a[1]-n[1],r[2]=a[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(a,n){function o(F,U){if(!F)throw new Error(U||"Assertion failed")}function i(F,U){F.super_=U;var W=function(){};W.prototype=U.prototype,F.prototype=new W,F.prototype.constructor=F}function s(F,U,W){if(s.isBN(F))return F;this.negative=0,this.words=null,this.length=0,this.red=null,F!==null&&((U==="le"||U==="be")&&(W=U,U=10),this._init(F||0,U||10,W||"be"))}typeof a=="object"?a.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(F){return F instanceof s?!0:F!==null&&typeof F=="object"&&F.constructor.wordSize===s.wordSize&&Array.isArray(F.words)},s.max=function(F,U){return F.cmp(U)>0?F:U},s.min=function(F,U){return F.cmp(U)<0?F:U},s.prototype._init=function(F,U,W){if(typeof F=="number")return this._initNumber(F,U,W);if(typeof F=="object")return this._initArray(F,U,W);U==="hex"&&(U=16),o(U===(U|0)&&U>=2&&U<=36),F=F.toString().replace(/\s+/g,"");var q=0;F[0]==="-"&&(q++,this.negative=1),q<F.length&&(U===16?this._parseHex(F,q,W):(this._parseBase(F,U,q),W==="le"&&this._initArray(this.toArray(),U,W)))},s.prototype._initNumber=function(F,U,W){F<0&&(this.negative=1,F=-F),F<67108864?(this.words=[F&67108863],this.length=1):F<4503599627370496?(this.words=[F&67108863,F/67108864&67108863],this.length=2):(o(F<9007199254740992),this.words=[F&67108863,F/67108864&67108863,1],this.length=3),W==="le"&&this._initArray(this.toArray(),U,W)},s.prototype._initArray=function(F,U,W){if(o(typeof F.length=="number"),F.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(F.length/3),this.words=new Array(this.length);for(var q=0;q<this.length;q++)this.words[q]=0;var X,lt,yt=0;if(W==="be")for(q=F.length-1,X=0;q>=0;q-=3)lt=F[q]|F[q-1]<<8|F[q-2]<<16,this.words[X]|=lt<<yt&67108863,this.words[X+1]=lt>>>26-yt&67108863,yt+=24,yt>=26&&(yt-=26,X++);else if(W==="le")for(q=0,X=0;q<F.length;q+=3)lt=F[q]|F[q+1]<<8|F[q+2]<<16,this.words[X]|=lt<<yt&67108863,this.words[X+1]=lt>>>26-yt&67108863,yt+=24,yt>=26&&(yt-=26,X++);return this.strip()};function x(F,U){var W=F.charCodeAt(U);return W>=65&&W<=70?W-55:W>=97&&W<=102?W-87:W-48&15}function y(F,U,W){var q=x(F,W);return W-1>=U&&(q|=x(F,W-1)<<4),q}s.prototype._parseHex=function(F,U,W){this.length=Math.ceil((F.length-U)/6),this.words=new Array(this.length);for(var q=0;q<this.length;q++)this.words[q]=0;var X=0,lt=0,yt;if(W==="be")for(q=F.length-1;q>=U;q-=2)yt=y(F,U,q)<<X,this.words[lt]|=yt&67108863,X>=18?(X-=18,lt+=1,this.words[lt]|=yt>>>26):X+=8;else{var pt=F.length-U;for(q=pt%2===0?U+1:U;q<F.length;q+=2)yt=y(F,U,q)<<X,this.words[lt]|=yt&67108863,X>=18?(X-=18,lt+=1,this.words[lt]|=yt>>>26):X+=8}this.strip()};function v(F,U,W,q){for(var X=0,lt=Math.min(F.length,W),yt=U;yt<lt;yt++){var pt=F.charCodeAt(yt)-48;X*=q,pt>=49?X+=pt-49+10:pt>=17?X+=pt-17+10:X+=pt}return X}s.prototype._parseBase=function(F,U,W){this.words=[0],this.length=1;for(var q=0,X=1;X<=67108863;X*=U)q++;q--,X=X/U|0;for(var lt=F.length-W,yt=lt%q,pt=Math.min(lt,lt-yt)+W,st=0,tt=W;tt<pt;tt+=q)st=v(F,tt,tt+q,U),this.imuln(X),this.words[0]+st<67108864?this.words[0]+=st:this._iaddn(st);if(yt!==0){var dt=1;for(st=v(F,tt,F.length,U),tt=0;tt<yt;tt++)dt*=U;this.imuln(dt),this.words[0]+st<67108864?this.words[0]+=st:this._iaddn(st)}this.strip()},s.prototype.copy=function(F){F.words=new Array(this.length);for(var U=0;U<this.length;U++)F.words[U]=this.words[U];F.length=this.length,F.negative=this.negative,F.red=this.red},s.prototype.clone=function(){var F=new s(null);return this.copy(F),F},s.prototype._expand=function(F){for(;this.length<F;)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 T=["","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"],u=[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],b=[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(F,U){F=F||10,U=U|0||1;var W;if(F===16||F==="hex"){W="";for(var q=0,X=0,lt=0;lt<this.length;lt++){var yt=this.words[lt],pt=((yt<<q|X)&16777215).toString(16);X=yt>>>24-q&16777215,X!==0||lt!==this.length-1?W=T[6-pt.length]+pt+W:W=pt+W,q+=2,q>=26&&(q-=26,lt--)}for(X!==0&&(W=X.toString(16)+W);W.length%U!==0;)W="0"+W;return this.negative!==0&&(W="-"+W),W}if(F===(F|0)&&F>=2&&F<=36){var st=u[F],tt=b[F];W="";var dt=this.clone();for(dt.negative=0;!dt.isZero();){var rt=dt.modn(tt).toString(F);dt=dt.idivn(tt),dt.isZero()?W=rt+W:W=T[st-rt.length]+rt+W}for(this.isZero()&&(W="0"+W);W.length%U!==0;)W="0"+W;return this.negative!==0&&(W="-"+W),W}o(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var F=this.words[0];return this.length===2?F+=this.words[1]*67108864:this.length===3&&this.words[2]===1?F+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-F:F},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(F,U){return o(typeof f<"u"),this.toArrayLike(f,F,U)},s.prototype.toArray=function(F,U){return this.toArrayLike(Array,F,U)},s.prototype.toArrayLike=function(F,U,W){var q=this.byteLength(),X=W||Math.max(1,q);o(q<=X,"byte array longer than desired length"),o(X>0,"Requested array length <= 0"),this.strip();var lt=U==="le",yt=new F(X),pt,st,tt=this.clone();if(lt){for(st=0;!tt.isZero();st++)pt=tt.andln(255),tt.iushrn(8),yt[st]=pt;for(;st<X;st++)yt[st]=0}else{for(st=0;st<X-q;st++)yt[st]=0;for(st=0;!tt.isZero();st++)pt=tt.andln(255),tt.iushrn(8),yt[X-st-1]=pt}return yt},Math.clz32?s.prototype._countBits=function(F){return 32-Math.clz32(F)}:s.prototype._countBits=function(F){var U=F,W=0;return U>=4096&&(W+=13,U>>>=13),U>=64&&(W+=7,U>>>=7),U>=8&&(W+=4,U>>>=4),U>=2&&(W+=2,U>>>=2),W+U},s.prototype._zeroBits=function(F){if(F===0)return 26;var U=F,W=0;return(U&8191)===0&&(W+=13,U>>>=13),(U&127)===0&&(W+=7,U>>>=7),(U&15)===0&&(W+=4,U>>>=4),(U&3)===0&&(W+=2,U>>>=2),(U&1)===0&&W++,W},s.prototype.bitLength=function(){var F=this.words[this.length-1],U=this._countBits(F);return(this.length-1)*26+U};function _(F){for(var U=new Array(F.bitLength()),W=0;W<U.length;W++){var q=W/26|0,X=W%26;U[W]=(F.words[q]&1<<X)>>>X}return U}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var F=0,U=0;U<this.length;U++){var W=this._zeroBits(this.words[U]);if(F+=W,W!==26)break}return F},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(F){return this.negative!==0?this.abs().inotn(F).iaddn(1):this.clone()},s.prototype.fromTwos=function(F){return this.testn(F-1)?this.notn(F).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(F){for(;this.length<F.length;)this.words[this.length++]=0;for(var U=0;U<F.length;U++)this.words[U]=this.words[U]|F.words[U];return this.strip()},s.prototype.ior=function(F){return o((this.negative|F.negative)===0),this.iuor(F)},s.prototype.or=function(F){return this.length>F.length?this.clone().ior(F):F.clone().ior(this)},s.prototype.uor=function(F){return this.length>F.length?this.clone().iuor(F):F.clone().iuor(this)},s.prototype.iuand=function(F){var U;this.length>F.length?U=F:U=this;for(var W=0;W<U.length;W++)this.words[W]=this.words[W]&F.words[W];return this.length=U.length,this.strip()},s.prototype.iand=function(F){return o((this.negative|F.negative)===0),this.iuand(F)},s.prototype.and=function(F){return this.length>F.length?this.clone().iand(F):F.clone().iand(this)},s.prototype.uand=function(F){return this.length>F.length?this.clone().iuand(F):F.clone().iuand(this)},s.prototype.iuxor=function(F){var U,W;this.length>F.length?(U=this,W=F):(U=F,W=this);for(var q=0;q<W.length;q++)this.words[q]=U.words[q]^W.words[q];if(this!==U)for(;q<U.length;q++)this.words[q]=U.words[q];return this.length=U.length,this.strip()},s.prototype.ixor=function(F){return o((this.negative|F.negative)===0),this.iuxor(F)},s.prototype.xor=function(F){return this.length>F.length?this.clone().ixor(F):F.clone().ixor(this)},s.prototype.uxor=function(F){return this.length>F.length?this.clone().iuxor(F):F.clone().iuxor(this)},s.prototype.inotn=function(F){o(typeof F=="number"&&F>=0);var U=Math.ceil(F/26)|0,W=F%26;this._expand(U),W>0&&U--;for(var q=0;q<U;q++)this.words[q]=~this.words[q]&67108863;return W>0&&(this.words[q]=~this.words[q]&67108863>>26-W),this.strip()},s.prototype.notn=function(F){return this.clone().inotn(F)},s.prototype.setn=function(F,U){o(typeof F=="number"&&F>=0);var W=F/26|0,q=F%26;return this._expand(W+1),U?this.words[W]=this.words[W]|1<<q:this.words[W]=this.words[W]&~(1<<q),this.strip()},s.prototype.iadd=function(F){var U;if(this.negative!==0&&F.negative===0)return this.negative=0,U=this.isub(F),this.negative^=1,this._normSign();if(this.negative===0&&F.negative!==0)return F.negative=0,U=this.isub(F),F.negative=1,U._normSign();var W,q;this.length>F.length?(W=this,q=F):(W=F,q=this);for(var X=0,lt=0;lt<q.length;lt++)U=(W.words[lt]|0)+(q.words[lt]|0)+X,this.words[lt]=U&67108863,X=U>>>26;for(;X!==0&&lt<W.length;lt++)U=(W.words[lt]|0)+X,this.words[lt]=U&67108863,X=U>>>26;if(this.length=W.length,X!==0)this.words[this.length]=X,this.length++;else if(W!==this)for(;lt<W.length;lt++)this.words[lt]=W.words[lt];return this},s.prototype.add=function(F){var U;return F.negative!==0&&this.negative===0?(F.negative=0,U=this.sub(F),F.negative^=1,U):F.negative===0&&this.negative!==0?(this.negative=0,U=F.sub(this),this.negative=1,U):this.length>F.length?this.clone().iadd(F):F.clone().iadd(this)},s.prototype.isub=function(F){if(F.negative!==0){F.negative=0;var U=this.iadd(F);return F.negative=1,U._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(F),this.negative=1,this._normSign();var W=this.cmp(F);if(W===0)return this.negative=0,this.length=1,this.words[0]=0,this;var q,X;W>0?(q=this,X=F):(q=F,X=this);for(var lt=0,yt=0;yt<X.length;yt++)U=(q.words[yt]|0)-(X.words[yt]|0)+lt,lt=U>>26,this.words[yt]=U&67108863;for(;lt!==0&&yt<q.length;yt++)U=(q.words[yt]|0)+lt,lt=U>>26,this.words[yt]=U&67108863;if(lt===0&&yt<q.length&&q!==this)for(;yt<q.length;yt++)this.words[yt]=q.words[yt];return this.length=Math.max(this.length,yt),q!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(F){return this.clone().isub(F)};function C(F,U,W){W.negative=U.negative^F.negative;var q=F.length+U.length|0;W.length=q,q=q-1|0;var X=F.words[0]|0,lt=U.words[0]|0,yt=X*lt,pt=yt&67108863,st=yt/67108864|0;W.words[0]=pt;for(var tt=1;tt<q;tt++){for(var dt=st>>>26,rt=st&67108863,at=Math.min(tt,U.length-1),vt=Math.max(0,tt-F.length+1);vt<=at;vt++){var it=tt-vt|0;X=F.words[it]|0,lt=U.words[vt]|0,yt=X*lt+rt,dt+=yt/67108864|0,rt=yt&67108863}W.words[tt]=rt|0,st=dt|0}return st!==0?W.words[tt]=st|0:W.length--,W.strip()}var M=function(F,U,W){var q=F.words,X=U.words,lt=W.words,yt=0,pt,st,tt,dt=q[0]|0,rt=dt&8191,at=dt>>>13,vt=q[1]|0,it=vt&8191,Y=vt>>>13,ft=q[2]|0,ut=ft&8191,wt=ft>>>13,zt=q[3]|0,Pt=zt&8191,Wt=zt>>>13,Ht=q[4]|0,Jt=Ht&8191,ge=Ht>>>13,he=q[5]|0,de=he&8191,se=he>>>13,Tt=q[6]|0,Lt=Tt&8191,Mt=Tt>>>13,te=q[7]|0,ve=te&8191,oe=te>>>13,Te=q[8]|0,He=Te&8191,Ge=Te>>>13,cr=q[9]|0,ur=cr&8191,jr=cr>>>13,Hr=X[0]|0,br=Hr&8191,Kr=Hr>>>13,rn=X[1]|0,Ce=rn&8191,$t=rn>>>13,ne=X[2]|0,Ct=ne&8191,gt=ne>>>13,St=X[3]|0,Nt=St&8191,ee=St>>>13,le=X[4]|0,we=le&8191,Ue=le>>>13,qe=X[5]|0,ar=qe&8191,Ar=qe>>>13,Tr=X[6]|0,pr=Tr&8191,Jr=Tr>>>13,Vn=X[7]|0,Hn=Vn&8191,Kn=Vn>>>13,Ci=X[8]|0,ii=Ci&8191,qn=Ci>>>13,oa=X[9]|0,Hi=oa&8191,We=oa>>>13;W.negative=F.negative^U.negative,W.length=19,pt=Math.imul(rt,br),st=Math.imul(rt,Kr),st=st+Math.imul(at,br)|0,tt=Math.imul(at,Kr);var rr=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(rr>>>26)|0,rr&=67108863,pt=Math.imul(it,br),st=Math.imul(it,Kr),st=st+Math.imul(Y,br)|0,tt=Math.imul(Y,Kr),pt=pt+Math.imul(rt,Ce)|0,st=st+Math.imul(rt,$t)|0,st=st+Math.imul(at,Ce)|0,tt=tt+Math.imul(at,$t)|0;var fr=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(fr>>>26)|0,fr&=67108863,pt=Math.imul(ut,br),st=Math.imul(ut,Kr),st=st+Math.imul(wt,br)|0,tt=Math.imul(wt,Kr),pt=pt+Math.imul(it,Ce)|0,st=st+Math.imul(it,$t)|0,st=st+Math.imul(Y,Ce)|0,tt=tt+Math.imul(Y,$t)|0,pt=pt+Math.imul(rt,Ct)|0,st=st+Math.imul(rt,gt)|0,st=st+Math.imul(at,Ct)|0,tt=tt+Math.imul(at,gt)|0;var xr=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(xr>>>26)|0,xr&=67108863,pt=Math.imul(Pt,br),st=Math.imul(Pt,Kr),st=st+Math.imul(Wt,br)|0,tt=Math.imul(Wt,Kr),pt=pt+Math.imul(ut,Ce)|0,st=st+Math.imul(ut,$t)|0,st=st+Math.imul(wt,Ce)|0,tt=tt+Math.imul(wt,$t)|0,pt=pt+Math.imul(it,Ct)|0,st=st+Math.imul(it,gt)|0,st=st+Math.imul(Y,Ct)|0,tt=tt+Math.imul(Y,gt)|0,pt=pt+Math.imul(rt,Nt)|0,st=st+Math.imul(rt,ee)|0,st=st+Math.imul(at,Nt)|0,tt=tt+Math.imul(at,ee)|0;var Qr=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,pt=Math.imul(Jt,br),st=Math.imul(Jt,Kr),st=st+Math.imul(ge,br)|0,tt=Math.imul(ge,Kr),pt=pt+Math.imul(Pt,Ce)|0,st=st+Math.imul(Pt,$t)|0,st=st+Math.imul(Wt,Ce)|0,tt=tt+Math.imul(Wt,$t)|0,pt=pt+Math.imul(ut,Ct)|0,st=st+Math.imul(ut,gt)|0,st=st+Math.imul(wt,Ct)|0,tt=tt+Math.imul(wt,gt)|0,pt=pt+Math.imul(it,Nt)|0,st=st+Math.imul(it,ee)|0,st=st+Math.imul(Y,Nt)|0,tt=tt+Math.imul(Y,ee)|0,pt=pt+Math.imul(rt,we)|0,st=st+Math.imul(rt,Ue)|0,st=st+Math.imul(at,we)|0,tt=tt+Math.imul(at,Ue)|0;var Cn=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,pt=Math.imul(de,br),st=Math.imul(de,Kr),st=st+Math.imul(se,br)|0,tt=Math.imul(se,Kr),pt=pt+Math.imul(Jt,Ce)|0,st=st+Math.imul(Jt,$t)|0,st=st+Math.imul(ge,Ce)|0,tt=tt+Math.imul(ge,$t)|0,pt=pt+Math.imul(Pt,Ct)|0,st=st+Math.imul(Pt,gt)|0,st=st+Math.imul(Wt,Ct)|0,tt=tt+Math.imul(Wt,gt)|0,pt=pt+Math.imul(ut,Nt)|0,st=st+Math.imul(ut,ee)|0,st=st+Math.imul(wt,Nt)|0,tt=tt+Math.imul(wt,ee)|0,pt=pt+Math.imul(it,we)|0,st=st+Math.imul(it,Ue)|0,st=st+Math.imul(Y,we)|0,tt=tt+Math.imul(Y,Ue)|0,pt=pt+Math.imul(rt,ar)|0,st=st+Math.imul(rt,Ar)|0,st=st+Math.imul(at,ar)|0,tt=tt+Math.imul(at,Ar)|0;var wn=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(wn>>>26)|0,wn&=67108863,pt=Math.imul(Lt,br),st=Math.imul(Lt,Kr),st=st+Math.imul(Mt,br)|0,tt=Math.imul(Mt,Kr),pt=pt+Math.imul(de,Ce)|0,st=st+Math.imul(de,$t)|0,st=st+Math.imul(se,Ce)|0,tt=tt+Math.imul(se,$t)|0,pt=pt+Math.imul(Jt,Ct)|0,st=st+Math.imul(Jt,gt)|0,st=st+Math.imul(ge,Ct)|0,tt=tt+Math.imul(ge,gt)|0,pt=pt+Math.imul(Pt,Nt)|0,st=st+Math.imul(Pt,ee)|0,st=st+Math.imul(Wt,Nt)|0,tt=tt+Math.imul(Wt,ee)|0,pt=pt+Math.imul(ut,we)|0,st=st+Math.imul(ut,Ue)|0,st=st+Math.imul(wt,we)|0,tt=tt+Math.imul(wt,Ue)|0,pt=pt+Math.imul(it,ar)|0,st=st+Math.imul(it,Ar)|0,st=st+Math.imul(Y,ar)|0,tt=tt+Math.imul(Y,Ar)|0,pt=pt+Math.imul(rt,pr)|0,st=st+Math.imul(rt,Jr)|0,st=st+Math.imul(at,pr)|0,tt=tt+Math.imul(at,Jr)|0;var Mn=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,pt=Math.imul(ve,br),st=Math.imul(ve,Kr),st=st+Math.imul(oe,br)|0,tt=Math.imul(oe,Kr),pt=pt+Math.imul(Lt,Ce)|0,st=st+Math.imul(Lt,$t)|0,st=st+Math.imul(Mt,Ce)|0,tt=tt+Math.imul(Mt,$t)|0,pt=pt+Math.imul(de,Ct)|0,st=st+Math.imul(de,gt)|0,st=st+Math.imul(se,Ct)|0,tt=tt+Math.imul(se,gt)|0,pt=pt+Math.imul(Jt,Nt)|0,st=st+Math.imul(Jt,ee)|0,st=st+Math.imul(ge,Nt)|0,tt=tt+Math.imul(ge,ee)|0,pt=pt+Math.imul(Pt,we)|0,st=st+Math.imul(Pt,Ue)|0,st=st+Math.imul(Wt,we)|0,tt=tt+Math.imul(Wt,Ue)|0,pt=pt+Math.imul(ut,ar)|0,st=st+Math.imul(ut,Ar)|0,st=st+Math.imul(wt,ar)|0,tt=tt+Math.imul(wt,Ar)|0,pt=pt+Math.imul(it,pr)|0,st=st+Math.imul(it,Jr)|0,st=st+Math.imul(Y,pr)|0,tt=tt+Math.imul(Y,Jr)|0,pt=pt+Math.imul(rt,Hn)|0,st=st+Math.imul(rt,Kn)|0,st=st+Math.imul(at,Hn)|0,tt=tt+Math.imul(at,Kn)|0;var ci=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(ci>>>26)|0,ci&=67108863,pt=Math.imul(He,br),st=Math.imul(He,Kr),st=st+Math.imul(Ge,br)|0,tt=Math.imul(Ge,Kr),pt=pt+Math.imul(ve,Ce)|0,st=st+Math.imul(ve,$t)|0,st=st+Math.imul(oe,Ce)|0,tt=tt+Math.imul(oe,$t)|0,pt=pt+Math.imul(Lt,Ct)|0,st=st+Math.imul(Lt,gt)|0,st=st+Math.imul(Mt,Ct)|0,tt=tt+Math.imul(Mt,gt)|0,pt=pt+Math.imul(de,Nt)|0,st=st+Math.imul(de,ee)|0,st=st+Math.imul(se,Nt)|0,tt=tt+Math.imul(se,ee)|0,pt=pt+Math.imul(Jt,we)|0,st=st+Math.imul(Jt,Ue)|0,st=st+Math.imul(ge,we)|0,tt=tt+Math.imul(ge,Ue)|0,pt=pt+Math.imul(Pt,ar)|0,st=st+Math.imul(Pt,Ar)|0,st=st+Math.imul(Wt,ar)|0,tt=tt+Math.imul(Wt,Ar)|0,pt=pt+Math.imul(ut,pr)|0,st=st+Math.imul(ut,Jr)|0,st=st+Math.imul(wt,pr)|0,tt=tt+Math.imul(wt,Jr)|0,pt=pt+Math.imul(it,Hn)|0,st=st+Math.imul(it,Kn)|0,st=st+Math.imul(Y,Hn)|0,tt=tt+Math.imul(Y,Kn)|0,pt=pt+Math.imul(rt,ii)|0,st=st+Math.imul(rt,qn)|0,st=st+Math.imul(at,ii)|0,tt=tt+Math.imul(at,qn)|0;var xi=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(xi>>>26)|0,xi&=67108863,pt=Math.imul(ur,br),st=Math.imul(ur,Kr),st=st+Math.imul(jr,br)|0,tt=Math.imul(jr,Kr),pt=pt+Math.imul(He,Ce)|0,st=st+Math.imul(He,$t)|0,st=st+Math.imul(Ge,Ce)|0,tt=tt+Math.imul(Ge,$t)|0,pt=pt+Math.imul(ve,Ct)|0,st=st+Math.imul(ve,gt)|0,st=st+Math.imul(oe,Ct)|0,tt=tt+Math.imul(oe,gt)|0,pt=pt+Math.imul(Lt,Nt)|0,st=st+Math.imul(Lt,ee)|0,st=st+Math.imul(Mt,Nt)|0,tt=tt+Math.imul(Mt,ee)|0,pt=pt+Math.imul(de,we)|0,st=st+Math.imul(de,Ue)|0,st=st+Math.imul(se,we)|0,tt=tt+Math.imul(se,Ue)|0,pt=pt+Math.imul(Jt,ar)|0,st=st+Math.imul(Jt,Ar)|0,st=st+Math.imul(ge,ar)|0,tt=tt+Math.imul(ge,Ar)|0,pt=pt+Math.imul(Pt,pr)|0,st=st+Math.imul(Pt,Jr)|0,st=st+Math.imul(Wt,pr)|0,tt=tt+Math.imul(Wt,Jr)|0,pt=pt+Math.imul(ut,Hn)|0,st=st+Math.imul(ut,Kn)|0,st=st+Math.imul(wt,Hn)|0,tt=tt+Math.imul(wt,Kn)|0,pt=pt+Math.imul(it,ii)|0,st=st+Math.imul(it,qn)|0,st=st+Math.imul(Y,ii)|0,tt=tt+Math.imul(Y,qn)|0,pt=pt+Math.imul(rt,Hi)|0,st=st+Math.imul(rt,We)|0,st=st+Math.imul(at,Hi)|0,tt=tt+Math.imul(at,We)|0;var Pi=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(Pi>>>26)|0,Pi&=67108863,pt=Math.imul(ur,Ce),st=Math.imul(ur,$t),st=st+Math.imul(jr,Ce)|0,tt=Math.imul(jr,$t),pt=pt+Math.imul(He,Ct)|0,st=st+Math.imul(He,gt)|0,st=st+Math.imul(Ge,Ct)|0,tt=tt+Math.imul(Ge,gt)|0,pt=pt+Math.imul(ve,Nt)|0,st=st+Math.imul(ve,ee)|0,st=st+Math.imul(oe,Nt)|0,tt=tt+Math.imul(oe,ee)|0,pt=pt+Math.imul(Lt,we)|0,st=st+Math.imul(Lt,Ue)|0,st=st+Math.imul(Mt,we)|0,tt=tt+Math.imul(Mt,Ue)|0,pt=pt+Math.imul(de,ar)|0,st=st+Math.imul(de,Ar)|0,st=st+Math.imul(se,ar)|0,tt=tt+Math.imul(se,Ar)|0,pt=pt+Math.imul(Jt,pr)|0,st=st+Math.imul(Jt,Jr)|0,st=st+Math.imul(ge,pr)|0,tt=tt+Math.imul(ge,Jr)|0,pt=pt+Math.imul(Pt,Hn)|0,st=st+Math.imul(Pt,Kn)|0,st=st+Math.imul(Wt,Hn)|0,tt=tt+Math.imul(Wt,Kn)|0,pt=pt+Math.imul(ut,ii)|0,st=st+Math.imul(ut,qn)|0,st=st+Math.imul(wt,ii)|0,tt=tt+Math.imul(wt,qn)|0,pt=pt+Math.imul(it,Hi)|0,st=st+Math.imul(it,We)|0,st=st+Math.imul(Y,Hi)|0,tt=tt+Math.imul(Y,We)|0;var Di=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(Di>>>26)|0,Di&=67108863,pt=Math.imul(ur,Ct),st=Math.imul(ur,gt),st=st+Math.imul(jr,Ct)|0,tt=Math.imul(jr,gt),pt=pt+Math.imul(He,Nt)|0,st=st+Math.imul(He,ee)|0,st=st+Math.imul(Ge,Nt)|0,tt=tt+Math.imul(Ge,ee)|0,pt=pt+Math.imul(ve,we)|0,st=st+Math.imul(ve,Ue)|0,st=st+Math.imul(oe,we)|0,tt=tt+Math.imul(oe,Ue)|0,pt=pt+Math.imul(Lt,ar)|0,st=st+Math.imul(Lt,Ar)|0,st=st+Math.imul(Mt,ar)|0,tt=tt+Math.imul(Mt,Ar)|0,pt=pt+Math.imul(de,pr)|0,st=st+Math.imul(de,Jr)|0,st=st+Math.imul(se,pr)|0,tt=tt+Math.imul(se,Jr)|0,pt=pt+Math.imul(Jt,Hn)|0,st=st+Math.imul(Jt,Kn)|0,st=st+Math.imul(ge,Hn)|0,tt=tt+Math.imul(ge,Kn)|0,pt=pt+Math.imul(Pt,ii)|0,st=st+Math.imul(Pt,qn)|0,st=st+Math.imul(Wt,ii)|0,tt=tt+Math.imul(Wt,qn)|0,pt=pt+Math.imul(ut,Hi)|0,st=st+Math.imul(ut,We)|0,st=st+Math.imul(wt,Hi)|0,tt=tt+Math.imul(wt,We)|0;var Zi=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,pt=Math.imul(ur,Nt),st=Math.imul(ur,ee),st=st+Math.imul(jr,Nt)|0,tt=Math.imul(jr,ee),pt=pt+Math.imul(He,we)|0,st=st+Math.imul(He,Ue)|0,st=st+Math.imul(Ge,we)|0,tt=tt+Math.imul(Ge,Ue)|0,pt=pt+Math.imul(ve,ar)|0,st=st+Math.imul(ve,Ar)|0,st=st+Math.imul(oe,ar)|0,tt=tt+Math.imul(oe,Ar)|0,pt=pt+Math.imul(Lt,pr)|0,st=st+Math.imul(Lt,Jr)|0,st=st+Math.imul(Mt,pr)|0,tt=tt+Math.imul(Mt,Jr)|0,pt=pt+Math.imul(de,Hn)|0,st=st+Math.imul(de,Kn)|0,st=st+Math.imul(se,Hn)|0,tt=tt+Math.imul(se,Kn)|0,pt=pt+Math.imul(Jt,ii)|0,st=st+Math.imul(Jt,qn)|0,st=st+Math.imul(ge,ii)|0,tt=tt+Math.imul(ge,qn)|0,pt=pt+Math.imul(Pt,Hi)|0,st=st+Math.imul(Pt,We)|0,st=st+Math.imul(Wt,Hi)|0,tt=tt+Math.imul(Wt,We)|0;var ui=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(ui>>>26)|0,ui&=67108863,pt=Math.imul(ur,we),st=Math.imul(ur,Ue),st=st+Math.imul(jr,we)|0,tt=Math.imul(jr,Ue),pt=pt+Math.imul(He,ar)|0,st=st+Math.imul(He,Ar)|0,st=st+Math.imul(Ge,ar)|0,tt=tt+Math.imul(Ge,Ar)|0,pt=pt+Math.imul(ve,pr)|0,st=st+Math.imul(ve,Jr)|0,st=st+Math.imul(oe,pr)|0,tt=tt+Math.imul(oe,Jr)|0,pt=pt+Math.imul(Lt,Hn)|0,st=st+Math.imul(Lt,Kn)|0,st=st+Math.imul(Mt,Hn)|0,tt=tt+Math.imul(Mt,Kn)|0,pt=pt+Math.imul(de,ii)|0,st=st+Math.imul(de,qn)|0,st=st+Math.imul(se,ii)|0,tt=tt+Math.imul(se,qn)|0,pt=pt+Math.imul(Jt,Hi)|0,st=st+Math.imul(Jt,We)|0,st=st+Math.imul(ge,Hi)|0,tt=tt+Math.imul(ge,We)|0;var Pa=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,pt=Math.imul(ur,ar),st=Math.imul(ur,Ar),st=st+Math.imul(jr,ar)|0,tt=Math.imul(jr,Ar),pt=pt+Math.imul(He,pr)|0,st=st+Math.imul(He,Jr)|0,st=st+Math.imul(Ge,pr)|0,tt=tt+Math.imul(Ge,Jr)|0,pt=pt+Math.imul(ve,Hn)|0,st=st+Math.imul(ve,Kn)|0,st=st+Math.imul(oe,Hn)|0,tt=tt+Math.imul(oe,Kn)|0,pt=pt+Math.imul(Lt,ii)|0,st=st+Math.imul(Lt,qn)|0,st=st+Math.imul(Mt,ii)|0,tt=tt+Math.imul(Mt,qn)|0,pt=pt+Math.imul(de,Hi)|0,st=st+Math.imul(de,We)|0,st=st+Math.imul(se,Hi)|0,tt=tt+Math.imul(se,We)|0;var Wa=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(Wa>>>26)|0,Wa&=67108863,pt=Math.imul(ur,pr),st=Math.imul(ur,Jr),st=st+Math.imul(jr,pr)|0,tt=Math.imul(jr,Jr),pt=pt+Math.imul(He,Hn)|0,st=st+Math.imul(He,Kn)|0,st=st+Math.imul(Ge,Hn)|0,tt=tt+Math.imul(Ge,Kn)|0,pt=pt+Math.imul(ve,ii)|0,st=st+Math.imul(ve,qn)|0,st=st+Math.imul(oe,ii)|0,tt=tt+Math.imul(oe,qn)|0,pt=pt+Math.imul(Lt,Hi)|0,st=st+Math.imul(Lt,We)|0,st=st+Math.imul(Mt,Hi)|0,tt=tt+Math.imul(Mt,We)|0;var ze=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(ze>>>26)|0,ze&=67108863,pt=Math.imul(ur,Hn),st=Math.imul(ur,Kn),st=st+Math.imul(jr,Hn)|0,tt=Math.imul(jr,Kn),pt=pt+Math.imul(He,ii)|0,st=st+Math.imul(He,qn)|0,st=st+Math.imul(Ge,ii)|0,tt=tt+Math.imul(Ge,qn)|0,pt=pt+Math.imul(ve,Hi)|0,st=st+Math.imul(ve,We)|0,st=st+Math.imul(oe,Hi)|0,tt=tt+Math.imul(oe,We)|0;var Pe=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,pt=Math.imul(ur,ii),st=Math.imul(ur,qn),st=st+Math.imul(jr,ii)|0,tt=Math.imul(jr,qn),pt=pt+Math.imul(He,Hi)|0,st=st+Math.imul(He,We)|0,st=st+Math.imul(Ge,Hi)|0,tt=tt+Math.imul(Ge,We)|0;var Rr=(yt+pt|0)+((st&8191)<<13)|0;yt=(tt+(st>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,pt=Math.imul(ur,Hi),st=Math.imul(ur,We),st=st+Math.imul(jr,Hi)|0,tt=Math.imul(jr,We);var qr=(yt+pt|0)+((st&8191)<<13)|0;return yt=(tt+(st>>>13)|0)+(qr>>>26)|0,qr&=67108863,lt[0]=rr,lt[1]=fr,lt[2]=xr,lt[3]=Qr,lt[4]=Cn,lt[5]=wn,lt[6]=Mn,lt[7]=ci,lt[8]=xi,lt[9]=Pi,lt[10]=Di,lt[11]=Zi,lt[12]=ui,lt[13]=Pa,lt[14]=Wa,lt[15]=ze,lt[16]=Pe,lt[17]=Rr,lt[18]=qr,yt!==0&&(lt[19]=yt,W.length++),W};Math.imul||(M=C);function E(F,U,W){W.negative=U.negative^F.negative,W.length=F.length+U.length;for(var q=0,X=0,lt=0;lt<W.length-1;lt++){var yt=X;X=0;for(var pt=q&67108863,st=Math.min(lt,U.length-1),tt=Math.max(0,lt-F.length+1);tt<=st;tt++){var dt=lt-tt,rt=F.words[dt]|0,at=U.words[tt]|0,vt=rt*at,it=vt&67108863;yt=yt+(vt/67108864|0)|0,it=it+pt|0,pt=it&67108863,yt=yt+(it>>>26)|0,X+=yt>>>26,yt&=67108863}W.words[lt]=pt,q=yt,yt=X}return q!==0?W.words[lt]=q:W.length--,W.strip()}function A(F,U,W){var q=new h;return q.mulp(F,U,W)}s.prototype.mulTo=function(F,U){var W,q=this.length+F.length;return this.length===10&&F.length===10?W=M(this,F,U):q<63?W=C(this,F,U):q<1024?W=E(this,F,U):W=A(this,F,U),W};function h(F,U){this.x=F,this.y=U}h.prototype.makeRBT=function(F){for(var U=new Array(F),W=s.prototype._countBits(F)-1,q=0;q<F;q++)U[q]=this.revBin(q,W,F);return U},h.prototype.revBin=function(F,U,W){if(F===0||F===W-1)return F;for(var q=0,X=0;X<U;X++)q|=(F&1)<<U-X-1,F>>=1;return q},h.prototype.permute=function(F,U,W,q,X,lt){for(var yt=0;yt<lt;yt++)q[yt]=U[F[yt]],X[yt]=W[F[yt]]},h.prototype.transform=function(F,U,W,q,X,lt){this.permute(lt,F,U,W,q,X);for(var yt=1;yt<X;yt<<=1)for(var pt=yt<<1,st=Math.cos(2*Math.PI/pt),tt=Math.sin(2*Math.PI/pt),dt=0;dt<X;dt+=pt)for(var rt=st,at=tt,vt=0;vt<yt;vt++){var it=W[dt+vt],Y=q[dt+vt],ft=W[dt+vt+yt],ut=q[dt+vt+yt],wt=rt*ft-at*ut;ut=rt*ut+at*ft,ft=wt,W[dt+vt]=it+ft,q[dt+vt]=Y+ut,W[dt+vt+yt]=it-ft,q[dt+vt+yt]=Y-ut,vt!==pt&&(wt=st*rt-tt*at,at=st*at+tt*rt,rt=wt)}},h.prototype.guessLen13b=function(F,U){var W=Math.max(U,F)|1,q=W&1,X=0;for(W=W/2|0;W;W=W>>>1)X++;return 1<<X+1+q},h.prototype.conjugate=function(F,U,W){if(!(W<=1))for(var q=0;q<W/2;q++){var X=F[q];F[q]=F[W-q-1],F[W-q-1]=X,X=U[q],U[q]=-U[W-q-1],U[W-q-1]=-X}},h.prototype.normalize13b=function(F,U){for(var W=0,q=0;q<U/2;q++){var X=Math.round(F[2*q+1]/U)*8192+Math.round(F[2*q]/U)+W;F[q]=X&67108863,X<67108864?W=0:W=X/67108864|0}return F},h.prototype.convert13b=function(F,U,W,q){for(var X=0,lt=0;lt<U;lt++)X=X+(F[lt]|0),W[2*lt]=X&8191,X=X>>>13,W[2*lt+1]=X&8191,X=X>>>13;for(lt=2*U;lt<q;++lt)W[lt]=0;o(X===0),o((X&-8192)===0)},h.prototype.stub=function(F){for(var U=new Array(F),W=0;W<F;W++)U[W]=0;return U},h.prototype.mulp=function(F,U,W){var q=2*this.guessLen13b(F.length,U.length),X=this.makeRBT(q),lt=this.stub(q),yt=new Array(q),pt=new Array(q),st=new Array(q),tt=new Array(q),dt=new Array(q),rt=new Array(q),at=W.words;at.length=q,this.convert13b(F.words,F.length,yt,q),this.convert13b(U.words,U.length,tt,q),this.transform(yt,lt,pt,st,q,X),this.transform(tt,lt,dt,rt,q,X);for(var vt=0;vt<q;vt++){var it=pt[vt]*dt[vt]-st[vt]*rt[vt];st[vt]=pt[vt]*rt[vt]+st[vt]*dt[vt],pt[vt]=it}return this.conjugate(pt,st,q),this.transform(pt,st,at,lt,q,X),this.conjugate(at,lt,q),this.normalize13b(at,q),W.negative=F.negative^U.negative,W.length=F.length+U.length,W.strip()},s.prototype.mul=function(F){var U=new s(null);return U.words=new Array(this.length+F.length),this.mulTo(F,U)},s.prototype.mulf=function(F){var U=new s(null);return U.words=new Array(this.length+F.length),A(this,F,U)},s.prototype.imul=function(F){return this.clone().mulTo(F,this)},s.prototype.imuln=function(F){o(typeof F=="number"),o(F<67108864);for(var U=0,W=0;W<this.length;W++){var q=(this.words[W]|0)*F,X=(q&67108863)+(U&67108863);U>>=26,U+=q/67108864|0,U+=X>>>26,this.words[W]=X&67108863}return U!==0&&(this.words[W]=U,this.length++),this},s.prototype.muln=function(F){return this.clone().imuln(F)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(F){var U=_(F);if(U.length===0)return new s(1);for(var W=this,q=0;q<U.length&&U[q]===0;q++,W=W.sqr());if(++q<U.length)for(var X=W.sqr();q<U.length;q++,X=X.sqr())U[q]!==0&&(W=W.mul(X));return W},s.prototype.iushln=function(F){o(typeof F=="number"&&F>=0);var U=F%26,W=(F-U)/26,q=67108863>>>26-U<<26-U,X;if(U!==0){var lt=0;for(X=0;X<this.length;X++){var yt=this.words[X]&q,pt=(this.words[X]|0)-yt<<U;this.words[X]=pt|lt,lt=yt>>>26-U}lt&&(this.words[X]=lt,this.length++)}if(W!==0){for(X=this.length-1;X>=0;X--)this.words[X+W]=this.words[X];for(X=0;X<W;X++)this.words[X]=0;this.length+=W}return this.strip()},s.prototype.ishln=function(F){return o(this.negative===0),this.iushln(F)},s.prototype.iushrn=function(F,U,W){o(typeof F=="number"&&F>=0);var q;U?q=(U-U%26)/26:q=0;var X=F%26,lt=Math.min((F-X)/26,this.length),yt=67108863^67108863>>>X<<X,pt=W;if(q-=lt,q=Math.max(0,q),pt){for(var st=0;st<lt;st++)pt.words[st]=this.words[st];pt.length=lt}if(lt!==0)if(this.length>lt)for(this.length-=lt,st=0;st<this.length;st++)this.words[st]=this.words[st+lt];else this.words[0]=0,this.length=1;var tt=0;for(st=this.length-1;st>=0&&(tt!==0||st>=q);st--){var dt=this.words[st]|0;this.words[st]=tt<<26-X|dt>>>X,tt=dt&yt}return pt&&tt!==0&&(pt.words[pt.length++]=tt),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(F,U,W){return o(this.negative===0),this.iushrn(F,U,W)},s.prototype.shln=function(F){return this.clone().ishln(F)},s.prototype.ushln=function(F){return this.clone().iushln(F)},s.prototype.shrn=function(F){return this.clone().ishrn(F)},s.prototype.ushrn=function(F){return this.clone().iushrn(F)},s.prototype.testn=function(F){o(typeof F=="number"&&F>=0);var U=F%26,W=(F-U)/26,q=1<<U;if(this.length<=W)return!1;var X=this.words[W];return!!(X&q)},s.prototype.imaskn=function(F){o(typeof F=="number"&&F>=0);var U=F%26,W=(F-U)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=W)return this;if(U!==0&&W++,this.length=Math.min(W,this.length),U!==0){var q=67108863^67108863>>>U<<U;this.words[this.length-1]&=q}return this.strip()},s.prototype.maskn=function(F){return this.clone().imaskn(F)},s.prototype.iaddn=function(F){return o(typeof F=="number"),o(F<67108864),F<0?this.isubn(-F):this.negative!==0?this.length===1&&(this.words[0]|0)<F?(this.words[0]=F-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(F),this.negative=1,this):this._iaddn(F)},s.prototype._iaddn=function(F){this.words[0]+=F;for(var U=0;U<this.length&&this.words[U]>=67108864;U++)this.words[U]-=67108864,U===this.length-1?this.words[U+1]=1:this.words[U+1]++;return this.length=Math.max(this.length,U+1),this},s.prototype.isubn=function(F){if(o(typeof F=="number"),o(F<67108864),F<0)return this.iaddn(-F);if(this.negative!==0)return this.negative=0,this.iaddn(F),this.negative=1,this;if(this.words[0]-=F,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var U=0;U<this.length&&this.words[U]<0;U++)this.words[U]+=67108864,this.words[U+1]-=1;return this.strip()},s.prototype.addn=function(F){return this.clone().iaddn(F)},s.prototype.subn=function(F){return this.clone().isubn(F)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(F,U,W){var q=F.length+W,X;this._expand(q);var lt,yt=0;for(X=0;X<F.length;X++){lt=(this.words[X+W]|0)+yt;var pt=(F.words[X]|0)*U;lt-=pt&67108863,yt=(lt>>26)-(pt/67108864|0),this.words[X+W]=lt&67108863}for(;X<this.length-W;X++)lt=(this.words[X+W]|0)+yt,yt=lt>>26,this.words[X+W]=lt&67108863;if(yt===0)return this.strip();for(o(yt===-1),yt=0,X=0;X<this.length;X++)lt=-(this.words[X]|0)+yt,yt=lt>>26,this.words[X]=lt&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(F,U){var W=this.length-F.length,q=this.clone(),X=F,lt=X.words[X.length-1]|0,yt=this._countBits(lt);W=26-yt,W!==0&&(X=X.ushln(W),q.iushln(W),lt=X.words[X.length-1]|0);var pt=q.length-X.length,st;if(U!=="mod"){st=new s(null),st.length=pt+1,st.words=new Array(st.length);for(var tt=0;tt<st.length;tt++)st.words[tt]=0}var dt=q.clone()._ishlnsubmul(X,1,pt);dt.negative===0&&(q=dt,st&&(st.words[pt]=1));for(var rt=pt-1;rt>=0;rt--){var at=(q.words[X.length+rt]|0)*67108864+(q.words[X.length+rt-1]|0);for(at=Math.min(at/lt|0,67108863),q._ishlnsubmul(X,at,rt);q.negative!==0;)at--,q.negative=0,q._ishlnsubmul(X,1,rt),q.isZero()||(q.negative^=1);st&&(st.words[rt]=at)}return st&&st.strip(),q.strip(),U!=="div"&&W!==0&&q.iushrn(W),{div:st||null,mod:q}},s.prototype.divmod=function(F,U,W){if(o(!F.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var q,X,lt;return this.negative!==0&&F.negative===0?(lt=this.neg().divmod(F,U),U!=="mod"&&(q=lt.div.neg()),U!=="div"&&(X=lt.mod.neg(),W&&X.negative!==0&&X.iadd(F)),{div:q,mod:X}):this.negative===0&&F.negative!==0?(lt=this.divmod(F.neg(),U),U!=="mod"&&(q=lt.div.neg()),{div:q,mod:lt.mod}):(this.negative&F.negative)!==0?(lt=this.neg().divmod(F.neg(),U),U!=="div"&&(X=lt.mod.neg(),W&&X.negative!==0&&X.isub(F)),{div:lt.div,mod:X}):F.length>this.length||this.cmp(F)<0?{div:new s(0),mod:this}:F.length===1?U==="div"?{div:this.divn(F.words[0]),mod:null}:U==="mod"?{div:null,mod:new s(this.modn(F.words[0]))}:{div:this.divn(F.words[0]),mod:new s(this.modn(F.words[0]))}:this._wordDiv(F,U)},s.prototype.div=function(F){return this.divmod(F,"div",!1).div},s.prototype.mod=function(F){return this.divmod(F,"mod",!1).mod},s.prototype.umod=function(F){return this.divmod(F,"mod",!0).mod},s.prototype.divRound=function(F){var U=this.divmod(F);if(U.mod.isZero())return U.div;var W=U.div.negative!==0?U.mod.isub(F):U.mod,q=F.ushrn(1),X=F.andln(1),lt=W.cmp(q);return lt<0||X===1&&lt===0?U.div:U.div.negative!==0?U.div.isubn(1):U.div.iaddn(1)},s.prototype.modn=function(F){o(F<=67108863);for(var U=67108864%F,W=0,q=this.length-1;q>=0;q--)W=(U*W+(this.words[q]|0))%F;return W},s.prototype.idivn=function(F){o(F<=67108863);for(var U=0,W=this.length-1;W>=0;W--){var q=(this.words[W]|0)+U*67108864;this.words[W]=q/F|0,U=q%F}return this.strip()},s.prototype.divn=function(F){return this.clone().idivn(F)},s.prototype.egcd=function(F){o(F.negative===0),o(!F.isZero());var U=this,W=F.clone();U.negative!==0?U=U.umod(F):U=U.clone();for(var q=new s(1),X=new s(0),lt=new s(0),yt=new s(1),pt=0;U.isEven()&&W.isEven();)U.iushrn(1),W.iushrn(1),++pt;for(var st=W.clone(),tt=U.clone();!U.isZero();){for(var dt=0,rt=1;(U.words[0]&rt)===0&&dt<26;++dt,rt<<=1);if(dt>0)for(U.iushrn(dt);dt-- >0;)(q.isOdd()||X.isOdd())&&(q.iadd(st),X.isub(tt)),q.iushrn(1),X.iushrn(1);for(var at=0,vt=1;(W.words[0]&vt)===0&&at<26;++at,vt<<=1);if(at>0)for(W.iushrn(at);at-- >0;)(lt.isOdd()||yt.isOdd())&&(lt.iadd(st),yt.isub(tt)),lt.iushrn(1),yt.iushrn(1);U.cmp(W)>=0?(U.isub(W),q.isub(lt),X.isub(yt)):(W.isub(U),lt.isub(q),yt.isub(X))}return{a:lt,b:yt,gcd:W.iushln(pt)}},s.prototype._invmp=function(F){o(F.negative===0),o(!F.isZero());var U=this,W=F.clone();U.negative!==0?U=U.umod(F):U=U.clone();for(var q=new s(1),X=new s(0),lt=W.clone();U.cmpn(1)>0&&W.cmpn(1)>0;){for(var yt=0,pt=1;(U.words[0]&pt)===0&&yt<26;++yt,pt<<=1);if(yt>0)for(U.iushrn(yt);yt-- >0;)q.isOdd()&&q.iadd(lt),q.iushrn(1);for(var st=0,tt=1;(W.words[0]&tt)===0&&st<26;++st,tt<<=1);if(st>0)for(W.iushrn(st);st-- >0;)X.isOdd()&&X.iadd(lt),X.iushrn(1);U.cmp(W)>=0?(U.isub(W),q.isub(X)):(W.isub(U),X.isub(q))}var dt;return U.cmpn(1)===0?dt=q:dt=X,dt.cmpn(0)<0&&dt.iadd(F),dt},s.prototype.gcd=function(F){if(this.isZero())return F.abs();if(F.isZero())return this.abs();var U=this.clone(),W=F.clone();U.negative=0,W.negative=0;for(var q=0;U.isEven()&&W.isEven();q++)U.iushrn(1),W.iushrn(1);do{for(;U.isEven();)U.iushrn(1);for(;W.isEven();)W.iushrn(1);var X=U.cmp(W);if(X<0){var lt=U;U=W,W=lt}else if(X===0||W.cmpn(1)===0)break;U.isub(W)}while(!0);return W.iushln(q)},s.prototype.invm=function(F){return this.egcd(F).a.umod(F)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(F){return this.words[0]&F},s.prototype.bincn=function(F){o(typeof F=="number");var U=F%26,W=(F-U)/26,q=1<<U;if(this.length<=W)return this._expand(W+1),this.words[W]|=q,this;for(var X=q,lt=W;X!==0&&lt<this.length;lt++){var yt=this.words[lt]|0;yt+=X,X=yt>>>26,yt&=67108863,this.words[lt]=yt}return X!==0&&(this.words[lt]=X,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(F){var U=F<0;if(this.negative!==0&&!U)return-1;if(this.negative===0&&U)return 1;this.strip();var W;if(this.length>1)W=1;else{U&&(F=-F),o(F<=67108863,"Number is too big");var q=this.words[0]|0;W=q===F?0:q<F?-1:1}return this.negative!==0?-W|0:W},s.prototype.cmp=function(F){if(this.negative!==0&&F.negative===0)return-1;if(this.negative===0&&F.negative!==0)return 1;var U=this.ucmp(F);return this.negative!==0?-U|0:U},s.prototype.ucmp=function(F){if(this.length>F.length)return 1;if(this.length<F.length)return-1;for(var U=0,W=this.length-1;W>=0;W--){var q=this.words[W]|0,X=F.words[W]|0;if(q!==X){q<X?U=-1:q>X&&(U=1);break}}return U},s.prototype.gtn=function(F){return this.cmpn(F)===1},s.prototype.gt=function(F){return this.cmp(F)===1},s.prototype.gten=function(F){return this.cmpn(F)>=0},s.prototype.gte=function(F){return this.cmp(F)>=0},s.prototype.ltn=function(F){return this.cmpn(F)===-1},s.prototype.lt=function(F){return this.cmp(F)===-1},s.prototype.lten=function(F){return this.cmpn(F)<=0},s.prototype.lte=function(F){return this.cmp(F)<=0},s.prototype.eqn=function(F){return this.cmpn(F)===0},s.prototype.eq=function(F){return this.cmp(F)===0},s.red=function(F){return new V(F)},s.prototype.toRed=function(F){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),F.convertTo(this)._forceRed(F)},s.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(F){return this.red=F,this},s.prototype.forceRed=function(F){return o(!this.red,"Already a number in reduction context"),this._forceRed(F)},s.prototype.redAdd=function(F){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,F)},s.prototype.redIAdd=function(F){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,F)},s.prototype.redSub=function(F){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,F)},s.prototype.redISub=function(F){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,F)},s.prototype.redShl=function(F){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,F)},s.prototype.redMul=function(F){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,F),this.red.mul(this,F)},s.prototype.redIMul=function(F){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,F),this.red.imul(this,F)},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(F){return o(this.red&&!F.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,F)};var p={k256:null,p224:null,p192:null,p25519:null};function k(F,U){this.name=F,this.p=new s(U,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}k.prototype._tmp=function(){var F=new s(null);return F.words=new Array(Math.ceil(this.n/13)),F},k.prototype.ireduce=function(F){var U=F,W;do this.split(U,this.tmp),U=this.imulK(U),U=U.iadd(this.tmp),W=U.bitLength();while(W>this.n);var q=W<this.n?-1:U.ucmp(this.p);return q===0?(U.words[0]=0,U.length=1):q>0?U.isub(this.p):U.strip!==void 0?U.strip():U._strip(),U},k.prototype.split=function(F,U){F.iushrn(this.n,0,U)},k.prototype.imulK=function(F){return F.imul(this.k)};function w(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(w,k),w.prototype.split=function(F,U){for(var W=4194303,q=Math.min(F.length,9),X=0;X<q;X++)U.words[X]=F.words[X];if(U.length=q,F.length<=9){F.words[0]=0,F.length=1;return}var lt=F.words[9];for(U.words[U.length++]=lt&W,X=10;X<F.length;X++){var yt=F.words[X]|0;F.words[X-10]=(yt&W)<<4|lt>>>22,lt=yt}lt>>>=22,F.words[X-10]=lt,lt===0&&F.length>10?F.length-=10:F.length-=9},w.prototype.imulK=function(F){F.words[F.length]=0,F.words[F.length+1]=0,F.length+=2;for(var U=0,W=0;W<F.length;W++){var q=F.words[W]|0;U+=q*977,F.words[W]=U&67108863,U=q*64+(U/67108864|0)}return F.words[F.length-1]===0&&(F.length--,F.words[F.length-1]===0&&F.length--),F};function R(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(R,k);function O(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(O,k);function N(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(N,k),N.prototype.imulK=function(F){for(var U=0,W=0;W<F.length;W++){var q=(F.words[W]|0)*19+U,X=q&67108863;q>>>=26,F.words[W]=X,U=q}return U!==0&&(F.words[F.length++]=U),F},s._prime=function(F){if(p[F])return p[F];var U;if(F==="k256")U=new w;else if(F==="p224")U=new R;else if(F==="p192")U=new O;else if(F==="p25519")U=new N;else throw new Error("Unknown prime "+F);return p[F]=U,U};function V(F){if(typeof F=="string"){var U=s._prime(F);this.m=U.p,this.prime=U}else o(F.gtn(1),"modulus must be greater than 1"),this.m=F,this.prime=null}V.prototype._verify1=function(F){o(F.negative===0,"red works only with positives"),o(F.red,"red works only with red numbers")},V.prototype._verify2=function(F,U){o((F.negative|U.negative)===0,"red works only with positives"),o(F.red&&F.red===U.red,"red works only with red numbers")},V.prototype.imod=function(F){return this.prime?this.prime.ireduce(F)._forceRed(this):F.umod(this.m)._forceRed(this)},V.prototype.neg=function(F){return F.isZero()?F.clone():this.m.sub(F)._forceRed(this)},V.prototype.add=function(F,U){this._verify2(F,U);var W=F.add(U);return W.cmp(this.m)>=0&&W.isub(this.m),W._forceRed(this)},V.prototype.iadd=function(F,U){this._verify2(F,U);var W=F.iadd(U);return W.cmp(this.m)>=0&&W.isub(this.m),W},V.prototype.sub=function(F,U){this._verify2(F,U);var W=F.sub(U);return W.cmpn(0)<0&&W.iadd(this.m),W._forceRed(this)},V.prototype.isub=function(F,U){this._verify2(F,U);var W=F.isub(U);return W.cmpn(0)<0&&W.iadd(this.m),W},V.prototype.shl=function(F,U){return this._verify1(F),this.imod(F.ushln(U))},V.prototype.imul=function(F,U){return this._verify2(F,U),this.imod(F.imul(U))},V.prototype.mul=function(F,U){return this._verify2(F,U),this.imod(F.mul(U))},V.prototype.isqr=function(F){return this.imul(F,F.clone())},V.prototype.sqr=function(F){return this.mul(F,F)},V.prototype.sqrt=function(F){if(F.isZero())return F.clone();var U=this.m.andln(3);if(o(U%2===1),U===3){var W=this.m.add(new s(1)).iushrn(2);return this.pow(F,W)}for(var q=this.m.subn(1),X=0;!q.isZero()&&q.andln(1)===0;)X++,q.iushrn(1);o(!q.isZero());var lt=new s(1).toRed(this),yt=lt.redNeg(),pt=this.m.subn(1).iushrn(1),st=this.m.bitLength();for(st=new s(2*st*st).toRed(this);this.pow(st,pt).cmp(yt)!==0;)st.redIAdd(yt);for(var tt=this.pow(st,q),dt=this.pow(F,q.addn(1).iushrn(1)),rt=this.pow(F,q),at=X;rt.cmp(lt)!==0;){for(var vt=rt,it=0;vt.cmp(lt)!==0;it++)vt=vt.redSqr();o(it<at);var Y=this.pow(tt,new s(1).iushln(at-it-1));dt=dt.redMul(Y),tt=Y.redSqr(),rt=rt.redMul(tt),at=it}return dt},V.prototype.invm=function(F){var U=F._invmp(this.m);return U.negative!==0?(U.negative=0,this.imod(U).redNeg()):this.imod(U)},V.prototype.pow=function(F,U){if(U.isZero())return new s(1).toRed(this);if(U.cmpn(1)===0)return F.clone();var W=4,q=new Array(1<<W);q[0]=new s(1).toRed(this),q[1]=F;for(var X=2;X<q.length;X++)q[X]=this.mul(q[X-1],F);var lt=q[0],yt=0,pt=0,st=U.bitLength()%26;for(st===0&&(st=26),X=U.length-1;X>=0;X--){for(var tt=U.words[X],dt=st-1;dt>=0;dt--){var rt=tt>>dt&1;if(lt!==q[0]&&(lt=this.sqr(lt)),rt===0&&yt===0){pt=0;continue}yt<<=1,yt|=rt,pt++,!(pt!==W&&(X!==0||dt!==0))&&(lt=this.mul(lt,q[yt]),pt=0,yt=0)}st=26}return lt},V.prototype.convertTo=function(F){var U=F.umod(this.m);return U===F?U.clone():U},V.prototype.convertFrom=function(F){var U=F.clone();return U.red=null,U},s.mont=function(F){return new H(F)};function H(F){V.call(this,F),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)}i(H,V),H.prototype.convertTo=function(F){return this.imod(F.ushln(this.shift))},H.prototype.convertFrom=function(F){var U=this.imod(F.mul(this.rinv));return U.red=null,U},H.prototype.imul=function(F,U){if(F.isZero()||U.isZero())return F.words[0]=0,F.length=1,F;var W=F.imul(U),q=W.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),X=W.isub(q).iushrn(this.shift),lt=X;return X.cmp(this.m)>=0?lt=X.isub(this.m):X.cmpn(0)<0&&(lt=X.iadd(this.m)),lt._forceRed(this)},H.prototype.mul=function(F,U){if(F.isZero()||U.isZero())return new s(0)._forceRed(this);var W=F.mul(U),q=W.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),X=W.isub(q).iushrn(this.shift),lt=X;return X.cmp(this.m)>=0?lt=X.isub(this.m):X.cmpn(0)<0&&(lt=X.iadd(this.m)),lt._forceRed(this)},H.prototype.invm=function(F){var U=this.imod(F._invmp(this.m).mul(this.r2));return U._forceRed(this)}}(t,this)},6860:function(t){t.exports=e;function e(r,a,n){return r[0]=a[0]-n[0],r[1]=a[1]-n[1],r[2]=a[2]-n[2],r[3]=a[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=u;var a=r(1888),n=r(855),o=r(7150);function i(b,_){for(var C=0;C<b;++C)if(!(_[C]<=_[C+b]))return!0;return!1}function s(b,_,C,M){for(var E=0,A=0,h=0,p=b.length;h<p;++h){var k=b[h];if(!i(_,k)){for(var w=0;w<2*_;++w)C[E++]=k[w];M[A++]=h}}return A}function f(b,_,C,M){var E=b.length,A=_.length;if(!(E<=0||A<=0)){var h=b[0].length>>>1;if(!(h<=0)){var p,k=a.mallocDouble(2*h*E),w=a.mallocInt32(E);if(E=s(b,h,k,w),E>0){if(h===1&&M)n.init(E),p=n.sweepComplete(h,C,0,E,k,w,0,E,k,w);else{var R=a.mallocDouble(2*h*A),O=a.mallocInt32(A);A=s(_,h,R,O),A>0&&(n.init(E+A),h===1?p=n.sweepBipartite(h,C,0,E,k,w,0,A,R,O):p=o(h,C,M,E,k,w,A,R,O),a.free(R),a.free(O))}a.free(k),a.free(w)}return p}}}var x;function y(b,_){x.push([b,_])}function v(b){return x=[],f(b,b,y,!0),x}function T(b,_){return x=[],f(b,_,y,!1),x}function u(b,_,C){switch(arguments.length){case 1:return v(b);case 2:return typeof _=="function"?f(b,b,_,!0):T(b,_);case 3:return f(b,_,C,!1);default:throw new Error("box-intersect: Invalid arguments")}}},6894:function(t){t.exports=e;function e(r,a,n,o){var i=n[1],s=n[2],f=a[1]-i,x=a[2]-s,y=Math.sin(o),v=Math.cos(o);return r[0]=a[0],r[1]=i+f*v-x*y,r[2]=s+f*y+x*v,r}},7004:function(t){t.exports=e;function e(r){for(var a=r.length,n=r[r.length-1],o=a,i=a-2;i>=0;--i){var s=n,f=r[i];n=s+f;var x=n-s,y=f-x;y&&(r[--o]=n,n=y)}for(var v=0,i=o;i<a;++i){var s=r[i],f=n;n=s+f;var x=n-s,y=f-x;y&&(r[v++]=y)}return r[v++]=n,r.length=v,r}},7056:function(t){t.exports=e;function e(r,a){var n=a[0]-r[0],o=a[1]-r[1],i=a[2]-r[2];return Math.sqrt(n*n+o*o+i*i)}},7089:function(t){t.exports=e;function e(r,a,n){var o=Math.sin(n),i=Math.cos(n),s=a[0],f=a[1],x=a[2],y=a[3],v=a[4],T=a[5],u=a[6],b=a[7];return a!==r&&(r[8]=a[8],r[9]=a[9],r[10]=a[10],r[11]=a[11],r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15]),r[0]=s*i+v*o,r[1]=f*i+T*o,r[2]=x*i+u*o,r[3]=y*i+b*o,r[4]=v*i-s*o,r[5]=T*i-f*o,r[6]=u*i-x*o,r[7]=b*i-y*o,r}},7150:function(t,e,r){t.exports=F;var a=r(1888),n=r(8828),o=r(2455),i=o.partial,s=o.full,f=r(855),x=r(3545),y=r(8105),v=128,T=1<<22,u=1<<22,b=y("!(lo>=p0)&&!(p1>=hi)"),_=y("lo===p0"),C=y("lo<p0"),M=y("hi<=p0"),E=y("lo<=p0&&p0<=hi"),A=y("lo<p0&&p0<=hi"),h=6,p=2,k=1024,w=a.mallocInt32(k),R=a.mallocDouble(k);function O(U,W){var q=8*n.log2(W+1)*(U+1)|0,X=n.nextPow2(h*q);w.length<X&&(a.free(w),w=a.mallocInt32(X));var lt=n.nextPow2(p*q);R.length<lt&&(a.free(R),R=a.mallocDouble(lt))}function N(U,W,q,X,lt,yt,pt,st,tt){var dt=h*U;w[dt]=W,w[dt+1]=q,w[dt+2]=X,w[dt+3]=lt,w[dt+4]=yt,w[dt+5]=pt;var rt=p*U;R[rt]=st,R[rt+1]=tt}function V(U,W,q,X,lt,yt,pt,st,tt,dt,rt){var at=2*U,vt=tt*at,it=dt[vt+W];t:for(var Y=lt,ft=lt*at;Y<yt;++Y,ft+=at){var ut=pt[ft+W],wt=pt[ft+W+U];if(!(it<ut||wt<it)&&!(X&&it===ut)){for(var zt=st[Y],Pt=W+1;Pt<U;++Pt){var ut=pt[ft+Pt],wt=pt[ft+Pt+U],Wt=dt[vt+Pt],Ht=dt[vt+Pt+U];if(wt<Wt||Ht<ut)continue t}var Jt;if(X?Jt=q(rt,zt):Jt=q(zt,rt),Jt!==void 0)return Jt}}}function H(U,W,q,X,lt,yt,pt,st,tt,dt){var rt=2*U,at=st*rt,vt=tt[at+W];t:for(var it=X,Y=X*rt;it<lt;++it,Y+=rt){var ft=pt[it];if(ft!==dt){var ut=yt[Y+W],wt=yt[Y+W+U];if(!(vt<ut||wt<vt)){for(var zt=W+1;zt<U;++zt){var ut=yt[Y+zt],wt=yt[Y+zt+U],Pt=tt[at+zt],Wt=tt[at+zt+U];if(wt<Pt||Wt<ut)continue t}var Ht=q(ft,dt);if(Ht!==void 0)return Ht}}}}function F(U,W,q,X,lt,yt,pt,st,tt){O(U,X+pt);var dt=0,rt=2*U,at;for(N(dt++,0,0,X,0,pt,q?16:0,-1/0,1/0),q||N(dt++,0,0,pt,0,X,1,-1/0,1/0);dt>0;){dt-=1;var vt=dt*h,it=w[vt],Y=w[vt+1],ft=w[vt+2],ut=w[vt+3],wt=w[vt+4],zt=w[vt+5],Pt=dt*p,Wt=R[Pt],Ht=R[Pt+1],Jt=zt&1,ge=!!(zt&16),he=lt,de=yt,se=st,Tt=tt;if(Jt&&(he=st,de=tt,se=lt,Tt=yt),!(zt&2&&(ft=C(U,it,Y,ft,he,de,Ht),Y>=ft))&&!(zt&4&&(Y=M(U,it,Y,ft,he,de,Wt),Y>=ft))){var Lt=ft-Y,Mt=wt-ut;if(ge){if(U*Lt*(Lt+Mt)<u){if(at=f.scanComplete(U,it,W,Y,ft,he,de,ut,wt,se,Tt),at!==void 0)return at;continue}}else if(U*Math.min(Lt,Mt)<v){if(at=i(U,it,W,Jt,Y,ft,he,de,ut,wt,se,Tt),at!==void 0)return at;continue}else if(U*Lt*Mt<T){if(at=f.scanBipartite(U,it,W,Jt,Y,ft,he,de,ut,wt,se,Tt),at!==void 0)return at;continue}var te=b(U,it,Y,ft,he,de,Wt,Ht);if(Y<te)if(U*(te-Y)<v){if(at=s(U,it+1,W,Y,te,he,de,ut,wt,se,Tt),at!==void 0)return at}else if(it===U-2){if(Jt?at=f.sweepBipartite(U,W,ut,wt,se,Tt,Y,te,he,de):at=f.sweepBipartite(U,W,Y,te,he,de,ut,wt,se,Tt),at!==void 0)return at}else N(dt++,it+1,Y,te,ut,wt,Jt,-1/0,1/0),N(dt++,it+1,ut,wt,Y,te,Jt^1,-1/0,1/0);if(te<ft){var ve=x(U,it,ut,wt,se,Tt),oe=se[rt*ve+it],Te=_(U,it,ve,wt,se,Tt,oe);if(Te<wt&&N(dt++,it,te,ft,Te,wt,(Jt|4)+(ge?16:0),oe,Ht),ut<ve&&N(dt++,it,te,ft,ut,ve,(Jt|2)+(ge?16:0),Wt,oe),ve+1===Te){if(ge?at=H(U,it,W,te,ft,he,de,ve,se,Tt[ve]):at=V(U,it,W,Jt,te,ft,he,de,ve,se,Tt[ve]),at!==void 0)return at}else if(ve<Te){var He;if(ge){if(He=E(U,it,te,ft,he,de,oe),te<He){var Ge=_(U,it,te,He,he,de,oe);if(it===U-2){if(te<Ge&&(at=f.sweepComplete(U,W,te,Ge,he,de,ve,Te,se,Tt),at!==void 0)||Ge<He&&(at=f.sweepBipartite(U,W,Ge,He,he,de,ve,Te,se,Tt),at!==void 0))return at}else te<Ge&&N(dt++,it+1,te,Ge,ve,Te,16,-1/0,1/0),Ge<He&&(N(dt++,it+1,Ge,He,ve,Te,0,-1/0,1/0),N(dt++,it+1,ve,Te,Ge,He,1,-1/0,1/0))}}else Jt?He=A(U,it,te,ft,he,de,oe):He=E(U,it,te,ft,he,de,oe),te<He&&(it===U-2?Jt?at=f.sweepBipartite(U,W,ve,Te,se,Tt,te,He,he,de):at=f.sweepBipartite(U,W,te,He,he,de,ve,Te,se,Tt):(N(dt++,it+1,te,He,ve,Te,Jt,-1/0,1/0),N(dt++,it+1,ve,Te,te,He,Jt^1,-1/0,1/0)))}}}}}},7163:function(t){t.exports=function(a){return a!=null&&(e(a)||r(a)||!!a._isBuffer)};function e(a){return!!a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)}function r(a){return typeof a.readFloatLE=="function"&&typeof a.slice=="function"&&e(a.slice(0,0))}},7169:function(t,e,r){var a=typeof WeakMap>"u"?r(1538):WeakMap,n=r(2762),o=r(8116),i=new a;function s(f){var x=i.get(f),y=x&&(x._triangleBuffer.handle||x._triangleBuffer.buffer);if(!y||!f.isBuffer(y)){var v=n(f,new Float32Array([-1,-1,-1,4,4,-1]));x=o(f,[{buffer:v,type:f.FLOAT,size:2}]),x._triangleBuffer=v,i.set(f,x)}x.bind(),f.drawArrays(f.TRIANGLES,0,3),x.unbind()}t.exports=s},7182:function(t,e,r){var a={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)};a.create();var n=a.create();t.exports=function(o,i,s,f,x,y){return a.identity(o),a.fromRotationTranslation(o,y,i),o[3]=x[0],o[7]=x[1],o[11]=x[2],o[15]=x[3],a.identity(n),f[2]!==0&&(n[9]=f[2],a.multiply(o,o,n)),f[1]!==0&&(n[9]=0,n[8]=f[1],a.multiply(o,o,n)),f[0]!==0&&(n[8]=0,n[4]=f[0],a.multiply(o,o,n)),a.scale(o,o,s),o}},7201:function(t,e,r){var a=1e-6,n=1e-6,o=r(9405),i=r(2762),s=r(8116),f=r(7766),x=r(8406),y=r(6760),v=r(7608),T=r(9618),u=r(6729),b=r(7765),_=r(1888),C=r(840),M=r(7626),E=C.meshShader,A=C.wireShader,h=C.pointShader,p=C.pickShader,k=C.pointPickShader,w=C.contourShader,R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function O(st,tt,dt,rt,at,vt,it,Y,ft,ut,wt,zt,Pt,Wt,Ht,Jt,ge,he,de,se,Tt,Lt,Mt,te,ve,oe,Te){this.gl=st,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=tt,this.dirty=!0,this.triShader=dt,this.lineShader=rt,this.pointShader=at,this.pickShader=vt,this.pointPickShader=it,this.contourShader=Y,this.trianglePositions=ft,this.triangleColors=wt,this.triangleNormals=Pt,this.triangleUVs=zt,this.triangleIds=ut,this.triangleVAO=Wt,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Ht,this.edgeColors=ge,this.edgeUVs=he,this.edgeIds=Jt,this.edgeVAO=de,this.edgeCount=0,this.pointPositions=se,this.pointColors=Lt,this.pointUVs=Mt,this.pointSizes=te,this.pointIds=Tt,this.pointVAO=ve,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=oe,this.contourVAO=Te,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=R,this._view=R,this._projection=R,this._resolution=[1,1]}var N=O.prototype;N.isOpaque=function(){return!this.hasAlpha},N.isTransparent=function(){return this.hasAlpha},N.pickSlots=1,N.setPickBase=function(st){this.pickId=st};function V(st,tt){if(!tt||!tt.length)return 1;for(var dt=0;dt<tt.length;++dt){if(tt.length<2)return 1;if(tt[dt][0]===st)return tt[dt][1];if(tt[dt][0]>st&&dt>0){var rt=(tt[dt][0]-st)/(tt[dt][0]-tt[dt-1][0]);return tt[dt][1]*(1-rt)+rt*tt[dt-1][1]}}return 1}function H(st,tt){for(var dt=u({colormap:st,nshades:256,format:"rgba"}),rt=new Uint8Array(1024),at=0;at<256;++at){for(var vt=dt[at],it=0;it<3;++it)rt[4*at+it]=vt[it];tt?rt[4*at+3]=255*V(at/255,tt):rt[4*at+3]=255*vt[3]}return T(rt,[256,256,4],[4,0,1])}function F(st){for(var tt=st.length,dt=new Array(tt),rt=0;rt<tt;++rt)dt[rt]=st[rt][2];return dt}N.highlight=function(st){if(!st||!this.contourEnable){this.contourCount=0;return}for(var tt=b(this.cells,this.intensity,st.intensity),dt=tt.cells,rt=tt.vertexIds,at=tt.vertexWeights,vt=dt.length,it=_.mallocFloat32(6*vt),Y=0,ft=0;ft<vt;++ft)for(var ut=dt[ft],wt=0;wt<2;++wt){var zt=ut[0];ut.length===2&&(zt=ut[wt]);for(var Pt=rt[zt][0],Wt=rt[zt][1],Ht=at[zt],Jt=1-Ht,ge=this.positions[Pt],he=this.positions[Wt],de=0;de<3;++de)it[Y++]=Ht*ge[de]+Jt*he[de]}this.contourCount=Y/3|0,this.contourPositions.update(it.subarray(0,Y)),_.free(it)},N.update=function(st){st=st||{};var tt=this.gl;this.dirty=!0,"contourEnable"in st&&(this.contourEnable=st.contourEnable),"contourColor"in st&&(this.contourColor=st.contourColor),"lineWidth"in st&&(this.lineWidth=st.lineWidth),"lightPosition"in st&&(this.lightPosition=st.lightPosition),this.hasAlpha=!1,"opacity"in st&&(this.opacity=st.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in st&&(this.opacityscale=st.opacityscale,this.hasAlpha=!0),"ambient"in st&&(this.ambientLight=st.ambient),"diffuse"in st&&(this.diffuseLight=st.diffuse),"specular"in st&&(this.specularLight=st.specular),"roughness"in st&&(this.roughness=st.roughness),"fresnel"in st&&(this.fresnel=st.fresnel),st.texture?(this.texture.dispose(),this.texture=f(tt,st.texture)):st.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=tt.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=tt.LINEAR,this.texture.setPixels(H(st.colormap,this.opacityscale)),this.texture.generateMipmap());var dt=st.cells,rt=st.positions;if(!(!rt||!dt)){var at=[],vt=[],it=[],Y=[],ft=[],ut=[],wt=[],zt=[],Pt=[],Wt=[],Ht=[],Jt=[],ge=[],he=[];this.cells=dt,this.positions=rt;var de=st.vertexNormals,se=st.cellNormals,Tt=st.vertexNormalsEpsilon===void 0?a:st.vertexNormalsEpsilon,Lt=st.faceNormalsEpsilon===void 0?n:st.faceNormalsEpsilon;st.useFacetNormals&&!se&&(se=x.faceNormals(dt,rt,Lt)),!se&&!de&&(de=x.vertexNormals(dt,rt,Tt));var Mt=st.vertexColors,te=st.cellColors,ve=st.meshColor||[1,1,1,1],oe=st.vertexUVs,Te=st.vertexIntensity,He=st.cellUVs,Ge=st.cellIntensity,cr=1/0,ur=-1/0;if(!oe&&!He)if(Te)if(st.vertexIntensityBounds)cr=+st.vertexIntensityBounds[0],ur=+st.vertexIntensityBounds[1];else for(var jr=0;jr<Te.length;++jr){var Hr=Te[jr];cr=Math.min(cr,Hr),ur=Math.max(ur,Hr)}else if(Ge)if(st.cellIntensityBounds)cr=+st.cellIntensityBounds[0],ur=+st.cellIntensityBounds[1];else for(var jr=0;jr<Ge.length;++jr){var Hr=Ge[jr];cr=Math.min(cr,Hr),ur=Math.max(ur,Hr)}else for(var jr=0;jr<rt.length;++jr){var Hr=rt[jr][2];cr=Math.min(cr,Hr),ur=Math.max(ur,Hr)}Te?this.intensity=Te:Ge?this.intensity=Ge:this.intensity=F(rt),this.pickVertex=!(Ge||te);var br=st.pointSizes,Kr=st.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var jr=0;jr<rt.length;++jr)for(var rn=rt[jr],Ce=0;Ce<3;++Ce)isNaN(rn[Ce])||!isFinite(rn[Ce])||(this.bounds[0][Ce]=Math.min(this.bounds[0][Ce],rn[Ce]),this.bounds[1][Ce]=Math.max(this.bounds[1][Ce],rn[Ce]));var $t=0,ne=0,Ct=0;t:for(var jr=0;jr<dt.length;++jr){var gt=dt[jr];switch(gt.length){case 1:for(var St=gt[0],rn=rt[St],Ce=0;Ce<3;++Ce)if(isNaN(rn[Ce])||!isFinite(rn[Ce]))continue t;Wt.push(rn[0],rn[1],rn[2]);var Nt;Mt?Nt=Mt[St]:te?Nt=te[jr]:Nt=ve,this.opacityscale&&Te?vt.push(Nt[0],Nt[1],Nt[2],this.opacity*V((Te[St]-cr)/(ur-cr),this.opacityscale)):Nt.length===3?Ht.push(Nt[0],Nt[1],Nt[2],this.opacity):(Ht.push(Nt[0],Nt[1],Nt[2],Nt[3]*this.opacity),Nt[3]<1&&(this.hasAlpha=!0));var ee;oe?ee=oe[St]:Te?ee=[(Te[St]-cr)/(ur-cr),0]:He?ee=He[jr]:Ge?ee=[(Ge[jr]-cr)/(ur-cr),0]:ee=[(rn[2]-cr)/(ur-cr),0],Jt.push(ee[0],ee[1]),br?ge.push(br[St]):ge.push(Kr),he.push(jr),Ct+=1;break;case 2:for(var Ce=0;Ce<2;++Ce)for(var St=gt[Ce],rn=rt[St],le=0;le<3;++le)if(isNaN(rn[le])||!isFinite(rn[le]))continue t;for(var Ce=0;Ce<2;++Ce){var St=gt[Ce],rn=rt[St];ut.push(rn[0],rn[1],rn[2]);var Nt;Mt?Nt=Mt[St]:te?Nt=te[jr]:Nt=ve,this.opacityscale&&Te?vt.push(Nt[0],Nt[1],Nt[2],this.opacity*V((Te[St]-cr)/(ur-cr),this.opacityscale)):Nt.length===3?wt.push(Nt[0],Nt[1],Nt[2],this.opacity):(wt.push(Nt[0],Nt[1],Nt[2],Nt[3]*this.opacity),Nt[3]<1&&(this.hasAlpha=!0));var ee;oe?ee=oe[St]:Te?ee=[(Te[St]-cr)/(ur-cr),0]:He?ee=He[jr]:Ge?ee=[(Ge[jr]-cr)/(ur-cr),0]:ee=[(rn[2]-cr)/(ur-cr),0],zt.push(ee[0],ee[1]),Pt.push(jr)}ne+=1;break;case 3:for(var Ce=0;Ce<3;++Ce)for(var St=gt[Ce],rn=rt[St],le=0;le<3;++le)if(isNaN(rn[le])||!isFinite(rn[le]))continue t;for(var Ce=0;Ce<3;++Ce){var St=gt[2-Ce],rn=rt[St];at.push(rn[0],rn[1],rn[2]);var Nt;Mt?Nt=Mt[St]:te?Nt=te[jr]:Nt=ve,Nt?this.opacityscale&&Te?vt.push(Nt[0],Nt[1],Nt[2],this.opacity*V((Te[St]-cr)/(ur-cr),this.opacityscale)):Nt.length===3?vt.push(Nt[0],Nt[1],Nt[2],this.opacity):(vt.push(Nt[0],Nt[1],Nt[2],Nt[3]*this.opacity),Nt[3]<1&&(this.hasAlpha=!0)):vt.push(.5,.5,.5,1);var ee;oe?ee=oe[St]:Te?ee=[(Te[St]-cr)/(ur-cr),0]:He?ee=He[jr]:Ge?ee=[(Ge[jr]-cr)/(ur-cr),0]:ee=[(rn[2]-cr)/(ur-cr),0],Y.push(ee[0],ee[1]);var we;de?we=de[St]:we=se[jr],it.push(we[0],we[1],we[2]),ft.push(jr)}$t+=1;break}}this.pointCount=Ct,this.edgeCount=ne,this.triangleCount=$t,this.pointPositions.update(Wt),this.pointColors.update(Ht),this.pointUVs.update(Jt),this.pointSizes.update(ge),this.pointIds.update(new Uint32Array(he)),this.edgePositions.update(ut),this.edgeColors.update(wt),this.edgeUVs.update(zt),this.edgeIds.update(new Uint32Array(Pt)),this.trianglePositions.update(at),this.triangleColors.update(vt),this.triangleUVs.update(Y),this.triangleNormals.update(it),this.triangleIds.update(new Uint32Array(ft))}},N.drawTransparent=N.draw=function(st){st=st||{};for(var tt=this.gl,dt=st.model||R,rt=st.view||R,at=st.projection||R,vt=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],it=0;it<3;++it)vt[0][it]=Math.max(vt[0][it],this.clipBounds[0][it]),vt[1][it]=Math.min(vt[1][it],this.clipBounds[1][it]);var Y={model:dt,view:rt,projection:at,inverseModel:R.slice(),clipBounds:vt,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};Y.inverseModel=v(Y.inverseModel,Y.model),tt.disable(tt.CULL_FACE),this.texture.bind(0);var ft=new Array(16);y(ft,Y.view,Y.model),y(ft,Y.projection,ft),v(ft,ft);for(var it=0;it<3;++it)Y.eyePosition[it]=ft[12+it]/ft[15];for(var ut=ft[15],it=0;it<3;++it)ut+=this.lightPosition[it]*ft[4*it+3];for(var it=0;it<3;++it){for(var wt=ft[12+it],zt=0;zt<3;++zt)wt+=ft[4*zt+it]*this.lightPosition[zt];Y.lightPosition[it]=wt/ut}if(this.triangleCount>0){var Pt=this.triShader;Pt.bind(),Pt.uniforms=Y,this.triangleVAO.bind(),tt.drawArrays(tt.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Pt=this.lineShader;Pt.bind(),Pt.uniforms=Y,this.edgeVAO.bind(),tt.lineWidth(this.lineWidth*this.pixelRatio),tt.drawArrays(tt.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Pt=this.pointShader;Pt.bind(),Pt.uniforms=Y,this.pointVAO.bind(),tt.drawArrays(tt.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Pt=this.contourShader;Pt.bind(),Pt.uniforms=Y,this.contourVAO.bind(),tt.drawArrays(tt.LINES,0,this.contourCount),this.contourVAO.unbind()}},N.drawPick=function(st){st=st||{};for(var tt=this.gl,dt=st.model||R,rt=st.view||R,at=st.projection||R,vt=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],it=0;it<3;++it)vt[0][it]=Math.max(vt[0][it],this.clipBounds[0][it]),vt[1][it]=Math.min(vt[1][it],this.clipBounds[1][it]);this._model=[].slice.call(dt),this._view=[].slice.call(rt),this._projection=[].slice.call(at),this._resolution=[tt.drawingBufferWidth,tt.drawingBufferHeight];var Y={model:dt,view:rt,projection:at,clipBounds:vt,pickId:this.pickId/255},ft=this.pickShader;if(ft.bind(),ft.uniforms=Y,this.triangleCount>0&&(this.triangleVAO.bind(),tt.drawArrays(tt.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),tt.lineWidth(this.lineWidth*this.pixelRatio),tt.drawArrays(tt.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ft=this.pointPickShader;ft.bind(),ft.uniforms=Y,this.pointVAO.bind(),tt.drawArrays(tt.POINTS,0,this.pointCount),this.pointVAO.unbind()}},N.pick=function(st){if(!st||st.id!==this.pickId)return null;for(var tt=st.value[0]+256*st.value[1]+65536*st.value[2],dt=this.cells[tt],rt=this.positions,at=new Array(dt.length),vt=0;vt<dt.length;++vt)at[vt]=rt[dt[vt]];var it=st.coord[0],Y=st.coord[1];if(!this.pickVertex){var ft=this.positions[dt[0]],ut=this.positions[dt[1]],wt=this.positions[dt[2]],zt=[(ft[0]+ut[0]+wt[0])/3,(ft[1]+ut[1]+wt[1])/3,(ft[2]+ut[2]+wt[2])/3];return{_cellCenter:!0,position:[it,Y],index:tt,cell:dt,cellId:tt,intensity:this.intensity[tt],dataCoordinate:zt}}var Pt=M(at,[it*this.pixelRatio,this._resolution[1]-Y*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!Pt)return null;for(var Wt=Pt[2],Ht=0,vt=0;vt<dt.length;++vt)Ht+=Wt[vt]*this.intensity[dt[vt]];return{position:Pt[1],index:dt[Pt[0]],cell:dt,cellId:tt,intensity:Ht,dataCoordinate:this.positions[dt[Pt[0]]]}},N.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 U(st){var tt=o(st,E.vertex,E.fragment);return tt.attributes.position.location=0,tt.attributes.color.location=2,tt.attributes.uv.location=3,tt.attributes.normal.location=4,tt}function W(st){var tt=o(st,A.vertex,A.fragment);return tt.attributes.position.location=0,tt.attributes.color.location=2,tt.attributes.uv.location=3,tt}function q(st){var tt=o(st,h.vertex,h.fragment);return tt.attributes.position.location=0,tt.attributes.color.location=2,tt.attributes.uv.location=3,tt.attributes.pointSize.location=4,tt}function X(st){var tt=o(st,p.vertex,p.fragment);return tt.attributes.position.location=0,tt.attributes.id.location=1,tt}function lt(st){var tt=o(st,k.vertex,k.fragment);return tt.attributes.position.location=0,tt.attributes.id.location=1,tt.attributes.pointSize.location=4,tt}function yt(st){var tt=o(st,w.vertex,w.fragment);return tt.attributes.position.location=0,tt}function pt(st,tt){arguments.length===1&&(tt=st,st=tt.gl);var dt=st.getExtension("OES_standard_derivatives")||st.getExtension("MOZ_OES_standard_derivatives")||st.getExtension("WEBKIT_OES_standard_derivatives");if(!dt)throw new Error("derivatives not supported");var rt=U(st),at=W(st),vt=q(st),it=X(st),Y=lt(st),ft=yt(st),ut=f(st,T(new Uint8Array([255,255,255,255]),[1,1,4]));ut.generateMipmap(),ut.minFilter=st.LINEAR_MIPMAP_LINEAR,ut.magFilter=st.LINEAR;var wt=i(st),zt=i(st),Pt=i(st),Wt=i(st),Ht=i(st),Jt=s(st,[{buffer:wt,type:st.FLOAT,size:3},{buffer:Ht,type:st.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:zt,type:st.FLOAT,size:4},{buffer:Pt,type:st.FLOAT,size:2},{buffer:Wt,type:st.FLOAT,size:3}]),ge=i(st),he=i(st),de=i(st),se=i(st),Tt=s(st,[{buffer:ge,type:st.FLOAT,size:3},{buffer:se,type:st.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:he,type:st.FLOAT,size:4},{buffer:de,type:st.FLOAT,size:2}]),Lt=i(st),Mt=i(st),te=i(st),ve=i(st),oe=i(st),Te=s(st,[{buffer:Lt,type:st.FLOAT,size:3},{buffer:oe,type:st.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:Mt,type:st.FLOAT,size:4},{buffer:te,type:st.FLOAT,size:2},{buffer:ve,type:st.FLOAT,size:1}]),He=i(st),Ge=s(st,[{buffer:He,type:st.FLOAT,size:3}]),cr=new O(st,ut,rt,at,vt,it,Y,ft,wt,Ht,zt,Pt,Wt,Jt,ge,se,he,de,Tt,Lt,oe,Mt,te,ve,Te,He,Ge);return cr.update(tt),cr}t.exports=pt},7261:function(t,e,r){t.exports=_;var a=r(9215),n=r(7608),o=r(6079),i=r(5911),s=r(3536),f=r(244);function x(C,M,E){return Math.sqrt(Math.pow(C,2)+Math.pow(M,2)+Math.pow(E,2))}function y(C){return Math.min(1,Math.max(-1,C))}function v(C){var M=Math.abs(C[0]),E=Math.abs(C[1]),A=Math.abs(C[2]),h=[0,0,0];M>Math.max(E,A)?h[2]=1:E>Math.max(M,A)?h[0]=1:h[1]=1;for(var p=0,k=0,w=0;w<3;++w)p+=C[w]*C[w],k+=h[w]*C[w];for(var w=0;w<3;++w)h[w]-=k/p*C[w];return s(h,h),h}function T(C,M,E,A,h,p,k,w){this.center=a(E),this.up=a(A),this.right=a(h),this.radius=a([p]),this.angle=a([k,w]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(C,M),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 R=0;R<16;++R)this.computedMatrix[R]=.5;this.recalcMatrix(0)}var u=T.prototype;u.setDistanceLimits=function(C,M){C>0?C=Math.log(C):C=-1/0,M>0?M=Math.log(M):M=1/0,M=Math.max(M,C),this.radius.bounds[0][0]=C,this.radius.bounds[1][0]=M},u.getDistanceLimits=function(C){var M=this.radius.bounds[0];return C?(C[0]=Math.exp(M[0][0]),C[1]=Math.exp(M[1][0]),C):[Math.exp(M[0][0]),Math.exp(M[1][0])]},u.recalcMatrix=function(C){this.center.curve(C),this.up.curve(C),this.right.curve(C),this.radius.curve(C),this.angle.curve(C);for(var M=this.computedUp,E=this.computedRight,A=0,h=0,p=0;p<3;++p)h+=M[p]*E[p],A+=M[p]*M[p];for(var k=Math.sqrt(A),w=0,p=0;p<3;++p)E[p]-=M[p]*h/A,w+=E[p]*E[p],M[p]/=k;for(var R=Math.sqrt(w),p=0;p<3;++p)E[p]/=R;var O=this.computedToward;i(O,M,E),s(O,O);for(var N=Math.exp(this.computedRadius[0]),V=this.computedAngle[0],H=this.computedAngle[1],F=Math.cos(V),U=Math.sin(V),W=Math.cos(H),q=Math.sin(H),X=this.computedCenter,lt=F*W,yt=U*W,pt=q,st=-F*q,tt=-U*q,dt=W,rt=this.computedEye,at=this.computedMatrix,p=0;p<3;++p){var vt=lt*E[p]+yt*O[p]+pt*M[p];at[4*p+1]=st*E[p]+tt*O[p]+dt*M[p],at[4*p+2]=vt,at[4*p+3]=0}var it=at[1],Y=at[5],ft=at[9],ut=at[2],wt=at[6],zt=at[10],Pt=Y*zt-ft*wt,Wt=ft*ut-it*zt,Ht=it*wt-Y*ut,Jt=x(Pt,Wt,Ht);Pt/=Jt,Wt/=Jt,Ht/=Jt,at[0]=Pt,at[4]=Wt,at[8]=Ht;for(var p=0;p<3;++p)rt[p]=X[p]+at[2+4*p]*N;for(var p=0;p<3;++p){for(var w=0,ge=0;ge<3;++ge)w+=at[p+4*ge]*rt[ge];at[12+p]=-w}at[15]=1},u.getMatrix=function(C,M){this.recalcMatrix(C);var E=this.computedMatrix;if(M){for(var A=0;A<16;++A)M[A]=E[A];return M}return E};var b=[0,0,0];u.rotate=function(C,M,E,A){if(this.angle.move(C,M,E),A){this.recalcMatrix(C);var h=this.computedMatrix;b[0]=h[2],b[1]=h[6],b[2]=h[10];for(var p=this.computedUp,k=this.computedRight,w=this.computedToward,R=0;R<3;++R)h[4*R]=p[R],h[4*R+1]=k[R],h[4*R+2]=w[R];o(h,h,A,b);for(var R=0;R<3;++R)p[R]=h[4*R],k[R]=h[4*R+1];this.up.set(C,p[0],p[1],p[2]),this.right.set(C,k[0],k[1],k[2])}},u.pan=function(C,M,E,A){M=M||0,E=E||0,A=A||0,this.recalcMatrix(C);var h=this.computedMatrix;Math.exp(this.computedRadius[0]);var p=h[1],k=h[5],w=h[9],R=x(p,k,w);p/=R,k/=R,w/=R;var O=h[0],N=h[4],V=h[8],H=O*p+N*k+V*w;O-=p*H,N-=k*H,V-=w*H;var F=x(O,N,V);O/=F,N/=F,V/=F;var U=O*M+p*E,W=N*M+k*E,q=V*M+w*E;this.center.move(C,U,W,q);var X=Math.exp(this.computedRadius[0]);X=Math.max(1e-4,X+A),this.radius.set(C,Math.log(X))},u.translate=function(C,M,E,A){this.center.move(C,M||0,E||0,A||0)},u.setMatrix=function(C,M,E,A){var h=1;typeof E=="number"&&(h=E|0),(h<0||h>3)&&(h=1);var p=(h+2)%3;M||(this.recalcMatrix(C),M=this.computedMatrix);var k=M[h],w=M[h+4],R=M[h+8];if(A){var O=Math.abs(k),N=Math.abs(w),V=Math.abs(R),H=Math.max(O,N,V);O===H?(k=k<0?-1:1,w=R=0):V===H?(R=R<0?-1:1,k=w=0):(w=w<0?-1:1,k=R=0)}else{var F=x(k,w,R);k/=F,w/=F,R/=F}var U=M[p],W=M[p+4],q=M[p+8],X=U*k+W*w+q*R;U-=k*X,W-=w*X,q-=R*X;var lt=x(U,W,q);U/=lt,W/=lt,q/=lt;var yt=w*q-R*W,pt=R*U-k*q,st=k*W-w*U,tt=x(yt,pt,st);yt/=tt,pt/=tt,st/=tt,this.center.jump(C,Tt,Lt,Mt),this.radius.idle(C),this.up.jump(C,k,w,R),this.right.jump(C,U,W,q);var dt,rt;if(h===2){var at=M[1],vt=M[5],it=M[9],Y=at*U+vt*W+it*q,ft=at*yt+vt*pt+it*st;Pt<0?dt=-Math.PI/2:dt=Math.PI/2,rt=Math.atan2(ft,Y)}else{var ut=M[2],wt=M[6],zt=M[10],Pt=ut*k+wt*w+zt*R,Wt=ut*U+wt*W+zt*q,Ht=ut*yt+wt*pt+zt*st;dt=Math.asin(y(Pt)),rt=Math.atan2(Ht,Wt)}this.angle.jump(C,rt,dt),this.recalcMatrix(C);var Jt=M[2],ge=M[6],he=M[10],de=this.computedMatrix;n(de,M);var se=de[15],Tt=de[12]/se,Lt=de[13]/se,Mt=de[14]/se,te=Math.exp(this.computedRadius[0]);this.center.jump(C,Tt-Jt*te,Lt-ge*te,Mt-he*te)},u.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},u.idle=function(C){this.center.idle(C),this.up.idle(C),this.right.idle(C),this.radius.idle(C),this.angle.idle(C)},u.flush=function(C){this.center.flush(C),this.up.flush(C),this.right.flush(C),this.radius.flush(C),this.angle.flush(C)},u.setDistance=function(C,M){M>0&&this.radius.set(C,Math.log(M))},u.lookAt=function(C,M,E,A){this.recalcMatrix(C),M=M||this.computedEye,E=E||this.computedCenter,A=A||this.computedUp;var h=A[0],p=A[1],k=A[2],w=x(h,p,k);if(!(w<1e-6)){h/=w,p/=w,k/=w;var R=M[0]-E[0],O=M[1]-E[1],N=M[2]-E[2],V=x(R,O,N);if(!(V<1e-6)){R/=V,O/=V,N/=V;var H=this.computedRight,F=H[0],U=H[1],W=H[2],q=h*F+p*U+k*W;F-=q*h,U-=q*p,W-=q*k;var X=x(F,U,W);if(!(X<.01&&(F=p*N-k*O,U=k*R-h*N,W=h*O-p*R,X=x(F,U,W),X<1e-6))){F/=X,U/=X,W/=X,this.up.set(C,h,p,k),this.right.set(C,F,U,W),this.center.set(C,E[0],E[1],E[2]),this.radius.set(C,Math.log(V));var lt=p*W-k*U,yt=k*F-h*W,pt=h*U-p*F,st=x(lt,yt,pt);lt/=st,yt/=st,pt/=st;var tt=h*R+p*O+k*N,dt=F*R+U*O+W*N,rt=lt*R+yt*O+pt*N,at=Math.asin(y(tt)),vt=Math.atan2(rt,dt),it=this.angle._state,Y=it[it.length-1],ft=it[it.length-2];Y=Y%(2*Math.PI);var ut=Math.abs(Y+2*Math.PI-vt),wt=Math.abs(Y-vt),zt=Math.abs(Y-2*Math.PI-vt);ut<wt&&(Y+=2*Math.PI),zt<wt&&(Y-=2*Math.PI),this.angle.jump(this.angle.lastT(),Y,ft),this.angle.set(C,vt,at)}}}};function _(C){C=C||{};var M=C.center||[0,0,0],E=C.up||[0,1,0],A=C.right||v(E),h=C.radius||1,p=C.theta||0,k=C.phi||0;if(M=[].slice.call(M,0,3),E=[].slice.call(E,0,3),s(E,E),A=[].slice.call(A,0,3),s(A,A),"eye"in C){var w=C.eye,R=[w[0]-M[0],w[1]-M[1],w[2]-M[2]];i(A,R,E),x(A[0],A[1],A[2])<1e-6?A=v(E):s(A,A),h=x(R[0],R[1],R[2]);var O=f(E,R)/h,N=f(A,R)/h;k=Math.acos(O),p=Math.acos(N)}return h=Math.log(h),new T(C.zoomMin,C.zoomMax,M,E,A,h,p,k)}},7319:function(t,e,r){var a=r(3236),n=r(9405),o=a([`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;
}
`]),i=a([`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=a([`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(x){return n(x,o,i,null,f)},e.createPickShader=function(x){return n(x,o,s,null,f)}},7352:function(t,e,r){var a=r(5721),n=r(4750),o=r(2690);t.exports=i;function i(s){var f=s.length;if(f===0)return[];if(f===1)return[[0]];var x=s[0].length;return x===0?[]:x===1?a(s):x===2?n(s):o(s,x)}},7399:function(t){t.exports=e;function e(r,a){var n=a[0],o=a[1],i=a[2],s=a[3],f=n+n,x=o+o,y=i+i,v=n*f,T=o*f,u=o*x,b=i*f,_=i*x,C=i*y,M=s*f,E=s*x,A=s*y;return r[0]=1-u-C,r[1]=T+A,r[2]=b-E,r[3]=0,r[4]=T-A,r[5]=1-v-C,r[6]=_+M,r[7]=0,r[8]=b+E,r[9]=_-M,r[10]=1-v-u,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,a,n){return r[0]=Math.max(a[0],n[0]),r[1]=Math.max(a[1],n[1]),r[2]=Math.max(a[2],n[2]),r}},7442:function(t,e,r){var a=r(6658),n=r(7182),o=r(2652),i=r(9921),s=r(8648),f=T(),x=T(),y=T();t.exports=v;function v(_,C,M,E){if(i(C)===0||i(M)===0)return!1;var A=o(C,f.translate,f.scale,f.skew,f.perspective,f.quaternion),h=o(M,x.translate,x.scale,x.skew,x.perspective,x.quaternion);return!A||!h?!1:(a(y.translate,f.translate,x.translate,E),a(y.skew,f.skew,x.skew,E),a(y.scale,f.scale,x.scale,E),a(y.perspective,f.perspective,x.perspective,E),s(y.quaternion,f.quaternion,x.quaternion,E),n(_,y.translate,y.scale,y.skew,y.perspective,y.quaternion),!0)}function T(){return{translate:u(),scale:u(1),skew:u(),perspective:b(),quaternion:b()}}function u(_){return[_||0,_||0,_||0]}function b(){return[0,0,0,1]}},7507:function(t,e){e.byteLength=x,e.toByteArray=v,e.fromByteArray=b;for(var r=[],a=[],n=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=o.length;i<s;++i)r[i]=o[i],a[o.charCodeAt(i)]=i;a[45]=62,a[95]=63;function f(_){var C=_.length;if(C%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var M=_.indexOf("=");M===-1&&(M=C);var E=M===C?0:4-M%4;return[M,E]}function x(_){var C=f(_),M=C[0],E=C[1];return(M+E)*3/4-E}function y(_,C,M){return(C+M)*3/4-M}function v(_){var C,M=f(_),E=M[0],A=M[1],h=new n(y(_,E,A)),p=0,k=A>0?E-4:E,w;for(w=0;w<k;w+=4)C=a[_.charCodeAt(w)]<<18|a[_.charCodeAt(w+1)]<<12|a[_.charCodeAt(w+2)]<<6|a[_.charCodeAt(w+3)],h[p++]=C>>16&255,h[p++]=C>>8&255,h[p++]=C&255;return A===2&&(C=a[_.charCodeAt(w)]<<2|a[_.charCodeAt(w+1)]>>4,h[p++]=C&255),A===1&&(C=a[_.charCodeAt(w)]<<10|a[_.charCodeAt(w+1)]<<4|a[_.charCodeAt(w+2)]>>2,h[p++]=C>>8&255,h[p++]=C&255),h}function T(_){return r[_>>18&63]+r[_>>12&63]+r[_>>6&63]+r[_&63]}function u(_,C,M){for(var E,A=[],h=C;h<M;h+=3)E=(_[h]<<16&16711680)+(_[h+1]<<8&65280)+(_[h+2]&255),A.push(T(E));return A.join("")}function b(_){for(var C,M=_.length,E=M%3,A=[],h=16383,p=0,k=M-E;p<k;p+=h)A.push(u(_,p,p+h>k?k:p+h));return E===1?(C=_[M-1],A.push(r[C>>2]+r[C<<4&63]+"==")):E===2&&(C=(_[M-2]<<8)+_[M-1],A.push(r[C>>10]+r[C>>4&63]+r[C<<2&63]+"=")),A.join("")}},7518:function(t,e,r){var a=r(1433);function n(s,f,x,y,v,T){this.location=s,this.dimension=f,this.a=x,this.b=y,this.c=v,this.d=T}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,x){this.gl=s,this._ext=f,this.handle=x,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,x){if(this.bind(),a(this.gl,f,s),this.unbind(),this._attribs.length=0,s)for(var y=0;y<s.length;++y){var v=s[y];typeof v=="number"?this._attribs.push(new n(y,1,v)):Array.isArray(v)&&this._attribs.push(new n(y,v.length,v[0],v[1],v[2],v[3]))}this._useElements=!!f,this._elementsType=x||this.gl.UNSIGNED_SHORT},o.prototype.draw=function(s,f,x){x=x||0;var y=this.gl;this._useElements?y.drawElements(s,f,this._elementsType,x):y.drawArrays(s,x,f)};function i(s,f){return new o(s,f,f.createVertexArrayOES())}t.exports=i},7520:function(t,e,r){var a=r(9507);function n(){var o=!1;try{var i=Object.defineProperty({},"passive",{get:function(){o=!0}});window.addEventListener("test",null,i),window.removeEventListener("test",null,i)}catch{o=!1}return o}t.exports=a&&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,a){var n=a[0],o=a[1],i=a[2],s=a[3],f=a[4],x=a[5],y=a[6],v=a[7],T=a[8],u=a[9],b=a[10],_=a[11],C=a[12],M=a[13],E=a[14],A=a[15],h=n*x-o*f,p=n*y-i*f,k=n*v-s*f,w=o*y-i*x,R=o*v-s*x,O=i*v-s*y,N=T*M-u*C,V=T*E-b*C,H=T*A-_*C,F=u*E-b*M,U=u*A-_*M,W=b*A-_*E,q=h*W-p*U+k*F+w*H-R*V+O*N;return q?(q=1/q,r[0]=(x*W-y*U+v*F)*q,r[1]=(i*U-o*W-s*F)*q,r[2]=(M*O-E*R+A*w)*q,r[3]=(b*R-u*O-_*w)*q,r[4]=(y*H-f*W-v*V)*q,r[5]=(n*W-i*H+s*V)*q,r[6]=(E*k-C*O-A*p)*q,r[7]=(T*O-b*k+_*p)*q,r[8]=(f*U-x*H+v*N)*q,r[9]=(o*H-n*U-s*N)*q,r[10]=(C*R-M*k+A*h)*q,r[11]=(u*k-T*R-_*h)*q,r[12]=(x*V-f*F-y*N)*q,r[13]=(n*F-o*V+i*N)*q,r[14]=(M*p-C*w-E*h)*q,r[15]=(T*w-u*p+b*h)*q,r):null}},7626:function(t,e,r){var a=r(2642),n=r(9346);t.exports=x;function o(y,v){for(var T=[0,0,0,0],u=0;u<4;++u)for(var b=0;b<4;++b)T[b]+=y[4*u+b]*v[u];return T}function i(y,v,T,u,b){for(var _=o(u,o(T,o(v,[y[0],y[1],y[2],1]))),C=0;C<3;++C)_[C]/=_[3];return[.5*b[0]*(1+_[0]),.5*b[1]*(1-_[1])]}function s(y,v){if(y.length===2){for(var T=0,u=0,b=0;b<2;++b)T+=Math.pow(v[b]-y[0][b],2),u+=Math.pow(v[b]-y[1][b],2);return T=Math.sqrt(T),u=Math.sqrt(u),T+u<1e-6?[1,0]:[u/(T+u),T/(u+T)]}else if(y.length===3){var _=[0,0];return n(y[0],y[1],y[2],v,_),a(y,_)}return[]}function f(y,v){for(var T=[0,0,0],u=0;u<y.length;++u)for(var b=y[u],_=v[u],C=0;C<3;++C)T[C]+=_*b[C];return T}function x(y,v,T,u,b,_){if(y.length===1)return[0,y[0].slice()];for(var C=new Array(y.length),M=0;M<y.length;++M)C[M]=i(y[M],T,u,b,_);for(var E=0,A=1/0,M=0;M<C.length;++M){for(var h=0,p=0;p<2;++p)h+=Math.pow(C[M][p]-v[p],2);h<A&&(A=h,E=M)}for(var k=s(C,v),w=0,M=0;M<3;++M){if(k[M]<-.001||k[M]>1.0001)return null;w+=k[M]}return Math.abs(w-1)>.001?null:[E,f(y,k),k]}},7636:function(t){t.exports=e;function e(r,a){a=a||1;var n=Math.random()*2*Math.PI,o=Math.random()*2-1,i=Math.sqrt(1-o*o)*a;return r[0]=Math.cos(n)*i,r[1]=Math.sin(n)*i,r[2]=o*a,r}},7640:function(t,e,r){var a=r(1888);function n(v){switch(v){case"uint32":return[a.mallocUint32,a.freeUint32];default:return null}}var o={"uint32,1,0":function(v,T){return function(u,b,_,C,M,E,A,h,p,k,w){var R,O,N,V=u*M+C,H,F=v(h),U,W,q,X;for(R=u+1;R<=b;++R){for(O=R,V+=M,N=V,U=0,W=V,H=0;H<h;++H)F[U++]=_[W],W+=p;t:for(;O-- >u;){U=0,W=N-M;e:for(H=0;H<h;++H){if(q=_[W],X=F[U],q<X)break t;if(q>X)break e;W+=k,U+=w}for(U=N,W=N-M,H=0;H<h;++H)_[U]=_[W],U+=p,W+=p;N-=M}for(U=N,W=0,H=0;H<h;++H)_[U]=F[W++],U+=p}T(F)}}};function i(v,T){var u=n(T),b=[T,v].join(","),_=o[b];return u?_(u[0],u[1]):_()}var s={"uint32,1,0":function(v,T,u){return function b(_,C,M,E,A,h,p,k,w,R,O){var N=(C-_+1)/6|0,V=_+N,H=C-N,F=_+C>>1,U=F-N,W=F+N,q=V,X=U,lt=F,yt=W,pt=H,st=_+1,tt=C-1,dt=!0,rt,at,vt,it,Y,ft,ut,wt,zt,Pt=0,Wt=0,Ht=0,Jt,ge,he,de,se,Tt,Lt,Mt,te,ve,oe,Te,He,Ge,cr,ur,jr=k,Hr=T(jr),br=T(jr);ge=A*q,he=A*X,ur=E;t:for(Jt=0;Jt<k;++Jt){if(ut=ge+ur,wt=he+ur,Ht=M[ut]-M[wt],Ht>0){at=q,q=X,X=at;break t}if(Ht<0)break t;ur+=R}ge=A*yt,he=A*pt,ur=E;t:for(Jt=0;Jt<k;++Jt){if(ut=ge+ur,wt=he+ur,Ht=M[ut]-M[wt],Ht>0){at=yt,yt=pt,pt=at;break t}if(Ht<0)break t;ur+=R}ge=A*q,he=A*lt,ur=E;t:for(Jt=0;Jt<k;++Jt){if(ut=ge+ur,wt=he+ur,Ht=M[ut]-M[wt],Ht>0){at=q,q=lt,lt=at;break t}if(Ht<0)break t;ur+=R}ge=A*X,he=A*lt,ur=E;t:for(Jt=0;Jt<k;++Jt){if(ut=ge+ur,wt=he+ur,Ht=M[ut]-M[wt],Ht>0){at=X,X=lt,lt=at;break t}if(Ht<0)break t;ur+=R}ge=A*q,he=A*yt,ur=E;t:for(Jt=0;Jt<k;++Jt){if(ut=ge+ur,wt=he+ur,Ht=M[ut]-M[wt],Ht>0){at=q,q=yt,yt=at;break t}if(Ht<0)break t;ur+=R}ge=A*lt,he=A*yt,ur=E;t:for(Jt=0;Jt<k;++Jt){if(ut=ge+ur,wt=he+ur,Ht=M[ut]-M[wt],Ht>0){at=lt,lt=yt,yt=at;break t}if(Ht<0)break t;ur+=R}ge=A*X,he=A*pt,ur=E;t:for(Jt=0;Jt<k;++Jt){if(ut=ge+ur,wt=he+ur,Ht=M[ut]-M[wt],Ht>0){at=X,X=pt,pt=at;break t}if(Ht<0)break t;ur+=R}ge=A*X,he=A*lt,ur=E;t:for(Jt=0;Jt<k;++Jt){if(ut=ge+ur,wt=he+ur,Ht=M[ut]-M[wt],Ht>0){at=X,X=lt,lt=at;break t}if(Ht<0)break t;ur+=R}ge=A*yt,he=A*pt,ur=E;t:for(Jt=0;Jt<k;++Jt){if(ut=ge+ur,wt=he+ur,Ht=M[ut]-M[wt],Ht>0){at=yt,yt=pt,pt=at;break t}if(Ht<0)break t;ur+=R}for(ge=A*q,he=A*X,de=A*lt,se=A*yt,Tt=A*pt,Lt=A*V,Mt=A*F,te=A*H,cr=0,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,zt=de+ur,ve=se+ur,oe=Tt+ur,Te=Lt+ur,He=Mt+ur,Ge=te+ur,Hr[cr]=M[wt],br[cr]=M[ve],dt=dt&&Hr[cr]===br[cr],vt=M[ut],it=M[zt],Y=M[oe],M[Te]=vt,M[He]=it,M[Ge]=Y,++cr,ur+=w;for(ge=A*U,he=A*_,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,M[ut]=M[wt],ur+=w;for(ge=A*W,he=A*C,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,M[ut]=M[wt],ur+=w;if(dt)for(ft=st;ft<=tt;++ft){ut=E+ft*A,cr=0;t:for(Jt=0;Jt<k;++Jt){if(Ht=M[ut]-Hr[cr],Ht!==0)break t;cr+=O,ut+=R}if(Ht!==0)if(Ht<0){if(ft!==st)for(ge=A*ft,he=A*st,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,rt=M[ut],M[ut]=M[wt],M[wt]=rt,ur+=w;++st}else for(;;){ut=E+tt*A,cr=0;t:for(Jt=0;Jt<k;++Jt){if(Ht=M[ut]-Hr[cr],Ht!==0)break t;cr+=O,ut+=R}if(Ht>0)tt--;else if(Ht<0){for(ge=A*ft,he=A*st,de=A*tt,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,zt=de+ur,rt=M[ut],M[ut]=M[wt],M[wt]=M[zt],M[zt]=rt,ur+=w;++st,--tt;break}else{for(ge=A*ft,he=A*tt,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,rt=M[ut],M[ut]=M[wt],M[wt]=rt,ur+=w;--tt;break}}}else for(ft=st;ft<=tt;++ft){ut=E+ft*A,cr=0;t:for(Jt=0;Jt<k;++Jt){if(Pt=M[ut]-Hr[cr],Pt!==0)break t;cr+=O,ut+=R}if(Pt<0){if(ft!==st)for(ge=A*ft,he=A*st,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,rt=M[ut],M[ut]=M[wt],M[wt]=rt,ur+=w;++st}else{ut=E+ft*A,cr=0;t:for(Jt=0;Jt<k;++Jt){if(Wt=M[ut]-br[cr],Wt!==0)break t;cr+=O,ut+=R}if(Wt>0)for(;;){ut=E+tt*A,cr=0;t:for(Jt=0;Jt<k;++Jt){if(Ht=M[ut]-br[cr],Ht!==0)break t;cr+=O,ut+=R}if(Ht>0){if(--tt<ft)break;continue}else{ut=E+tt*A,cr=0;t:for(Jt=0;Jt<k;++Jt){if(Ht=M[ut]-Hr[cr],Ht!==0)break t;cr+=O,ut+=R}if(Ht<0){for(ge=A*ft,he=A*st,de=A*tt,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,zt=de+ur,rt=M[ut],M[ut]=M[wt],M[wt]=M[zt],M[zt]=rt,ur+=w;++st,--tt}else{for(ge=A*ft,he=A*tt,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,rt=M[ut],M[ut]=M[wt],M[wt]=rt,ur+=w;--tt}break}}}}for(ge=A*_,he=A*(st-1),cr=0,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,M[ut]=M[wt],M[wt]=Hr[cr],++cr,ur+=w;for(ge=A*C,he=A*(tt+1),cr=0,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,M[ut]=M[wt],M[wt]=br[cr],++cr,ur+=w;if(st-2-_<=32?v(_,st-2,M,E,A,h,p,k,w,R,O):b(_,st-2,M,E,A,h,p,k,w,R,O),C-(tt+2)<=32?v(tt+2,C,M,E,A,h,p,k,w,R,O):b(tt+2,C,M,E,A,h,p,k,w,R,O),dt){u(Hr),u(br);return}if(st<V&&tt>H){t:for(;;){for(ut=E+st*A,cr=0,ur=E,Jt=0;Jt<k;++Jt){if(M[ut]!==Hr[cr])break t;++cr,ut+=w}++st}t:for(;;){for(ut=E+tt*A,cr=0,ur=E,Jt=0;Jt<k;++Jt){if(M[ut]!==br[cr])break t;++cr,ut+=w}--tt}for(ft=st;ft<=tt;++ft){ut=E+ft*A,cr=0;t:for(Jt=0;Jt<k;++Jt){if(Pt=M[ut]-Hr[cr],Pt!==0)break t;cr+=O,ut+=R}if(Pt===0){if(ft!==st)for(ge=A*ft,he=A*st,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,rt=M[ut],M[ut]=M[wt],M[wt]=rt,ur+=w;++st}else{ut=E+ft*A,cr=0;t:for(Jt=0;Jt<k;++Jt){if(Wt=M[ut]-br[cr],Wt!==0)break t;cr+=O,ut+=R}if(Wt===0)for(;;){ut=E+tt*A,cr=0;t:for(Jt=0;Jt<k;++Jt){if(Ht=M[ut]-br[cr],Ht!==0)break t;cr+=O,ut+=R}if(Ht===0){if(--tt<ft)break;continue}else{ut=E+tt*A,cr=0;t:for(Jt=0;Jt<k;++Jt){if(Ht=M[ut]-Hr[cr],Ht!==0)break t;cr+=O,ut+=R}if(Ht<0){for(ge=A*ft,he=A*st,de=A*tt,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,zt=de+ur,rt=M[ut],M[ut]=M[wt],M[wt]=M[zt],M[zt]=rt,ur+=w;++st,--tt}else{for(ge=A*ft,he=A*tt,ur=E,Jt=0;Jt<k;++Jt)ut=ge+ur,wt=he+ur,rt=M[ut],M[ut]=M[wt],M[wt]=rt,ur+=w;--tt}break}}}}}u(Hr),u(br),tt-st<=32?v(st,tt,M,E,A,h,p,k,w,R,O):b(st,tt,M,E,A,h,p,k,w,R,O)}}};function f(v,T,u){var b=n(T),_=[T,v].join(","),C=s[_];return v.length>1&&b?C(u,b[0],b[1]):C(u)}var x={"uint32,1,0":function(v,T){return function(u){var b=u.data,_=u.offset|0,C=u.shape,M=u.stride,E=M[0]|0,A=C[0]|0,h=M[1]|0,p=C[1]|0,k=h,w=h,R=1;A<=32?v(0,A-1,b,_,E,h,A,p,k,w,R):T(0,A-1,b,_,E,h,A,p,k,w,R)}}};function y(v,T){var u=[T,v].join(","),b=x[u],_=i(v,T),C=f(v,T,_);return b(_,C)}t.exports=y},7642:function(t,e,r){var a=r(8954),n=r(1682);t.exports=f;function o(x,y){this.point=x,this.index=y}function i(x,y){for(var v=x.point,T=y.point,u=v.length,b=0;b<u;++b){var _=T[b]-v[b];if(_)return _}return 0}function s(x,y,v){if(x===1)return v?[[-1,0]]:[];var T=y.map(function(M,E){return[M[0],E]});T.sort(function(M,E){return M[0]-E[0]});for(var u=new Array(x-1),b=1;b<x;++b){var _=T[b-1],C=T[b];u[b-1]=[_[1],C[1]]}return v&&u.push([-1,u[0][1]],[u[x-1][1],-1]),u}function f(x,y){var v=x.length;if(v===0)return[];var T=x[0].length;if(T<1)return[];if(T===1)return s(v,x,y);for(var u=new Array(v),b=1,_=0;_<v;++_){for(var C=x[_],M=new Array(T+1),E=0,A=0;A<T;++A){var h=C[A];M[A]=h,E+=h*h}M[T]=E,u[_]=new o(M,_),b=Math.max(E,b)}n(u,i),v=u.length;for(var p=new Array(v+T+1),k=new Array(v+T+1),w=(T+1)*(T+1)*b,R=new Array(T+1),_=0;_<=T;++_)R[_]=0;R[T]=w,p[0]=R.slice(),k[0]=-1;for(var _=0;_<=T;++_){var M=R.slice();M[_]=1,p[_+1]=M,k[_+1]=-1}for(var _=0;_<v;++_){var O=u[_];p[_+T+1]=O.point,k[_+T+1]=O.index}var N=a(p,!1);if(y?N=N.filter(function(V){for(var H=0,F=0;F<=T;++F){var U=k[V[F]];if(U<0&&++H>=2)return!1;V[F]=U}return!0}):N=N.filter(function(V){for(var H=0;H<=T;++H){var F=k[V[H]];if(F<0)return!1;V[H]=F}return!0}),T&1)for(var _=0;_<N.length;++_){var O=N[_],M=O[0];O[0]=O[1],O[1]=M}return N}},7656:function(t){t.exports=e;function e(r,a,n){var o=n[0],i=n[1],s=n[2],f,x,y,v,T,u,b,_,C,M,E,A;return a===r?(r[12]=a[0]*o+a[4]*i+a[8]*s+a[12],r[13]=a[1]*o+a[5]*i+a[9]*s+a[13],r[14]=a[2]*o+a[6]*i+a[10]*s+a[14],r[15]=a[3]*o+a[7]*i+a[11]*s+a[15]):(f=a[0],x=a[1],y=a[2],v=a[3],T=a[4],u=a[5],b=a[6],_=a[7],C=a[8],M=a[9],E=a[10],A=a[11],r[0]=f,r[1]=x,r[2]=y,r[3]=v,r[4]=T,r[5]=u,r[6]=b,r[7]=_,r[8]=C,r[9]=M,r[10]=E,r[11]=A,r[12]=f*o+T*i+C*s+a[12],r[13]=x*o+u*i+M*s+a[13],r[14]=y*o+b*i+E*s+a[14],r[15]=v*o+_*i+A*s+a[15]),r}},7718:function(t,e,r){t.exports=O,t.exports.processPixels=R;var a=r(3711),n=r(9618),o=r(5878),i=r(332),s=r(2538),f=r(2095),x="b",y="b|",v="i",T="i|",u="sup",b="+",_="+1",C="sub",M="-",E="-1";function A(N,V,H,F){for(var U="<"+N+">",W="</"+N+">",q=U.length,X=W.length,lt=V[0]===b||V[0]===M,yt=0,pt=-X;yt>-1&&(yt=H.indexOf(U,yt),!(yt===-1||(pt=H.indexOf(W,yt+q),pt===-1)||pt<=yt));){for(var st=yt;st<pt+X;++st)if(st<yt+q||st>=pt)F[st]=null,H=H.substr(0,st)+" "+H.substr(st+1);else if(F[st]!==null){var tt=F[st].indexOf(V[0]);tt===-1?F[st]+=V:lt&&(F[st]=F[st].substr(0,tt+1)+(1+parseInt(F[st][tt+1]))+F[st].substr(tt+2))}var dt=yt+q,rt=H.substr(dt,pt-dt),at=rt.indexOf(U);at!==-1?yt=at:yt=pt+X}return F}function h(N,V,H){for(var F=V.textAlign||"start",U=V.textBaseline||"alphabetic",W=[1073741824,1073741824],q=[0,0],X=N.length,lt=0;lt<X;++lt)for(var yt=N[lt],pt=0;pt<2;++pt)W[pt]=Math.min(W[pt],yt[pt])|0,q[pt]=Math.max(q[pt],yt[pt])|0;var st=0;switch(F){case"center":st=-.5*(W[0]+q[0]);break;case"right":case"end":st=-q[0];break;case"left":case"start":st=-W[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+F+"'")}var tt=0;switch(U){case"hanging":case"top":tt=-W[1];break;case"middle":tt=-.5*(W[1]+q[1]);break;case"alphabetic":case"ideographic":tt=-3*H;break;case"bottom":tt=-q[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+U+"'")}var dt=1/H;return"lineHeight"in V?dt*=+V.lineHeight:"width"in V?dt=V.width/(q[0]-W[0]):"height"in V&&(dt=V.height/(q[1]-W[1])),N.map(function(rt){return[dt*(rt[0]+st),dt*(rt[1]+tt)]})}function p(N,V,H,F,U,W){H=H.replace(/\n/g,""),W.breaklines===!0?H=H.replace(/\<br\>/g,`
`):H=H.replace(/\<br\>/g," ");var q="",X=[];for(Y=0;Y<H.length;++Y)X[Y]=q;W.bolds===!0&&(X=A(x,y,H,X)),W.italics===!0&&(X=A(v,T,H,X)),W.superscripts===!0&&(X=A(u,_,H,X)),W.subscripts===!0&&(X=A(C,E,H,X));var lt=[],yt="";for(Y=0;Y<H.length;++Y)X[Y]!==null&&(yt+=H[Y],lt.push(X[Y]));var pt=yt.split(`
`),st=pt.length,tt=Math.round(U*F),dt=F,rt=F*2,at=0,vt=st*tt+rt;N.height<vt&&(N.height=vt),V.fillStyle="#000",V.fillRect(0,0,N.width,N.height),V.fillStyle="#fff";var it,Y,ft,ut,wt,zt=0,Pt="";function Wt(){if(Pt!==""){var Mt=V.measureText(Pt).width;V.fillText(Pt,dt+ft,rt+ut),ft+=Mt}}function Ht(){return""+Math.round(wt)+"px "}function Jt(Mt,te){var ve=""+V.font;if(W.subscripts===!0){var oe=Mt.indexOf(M),Te=te.indexOf(M),He=oe>-1?parseInt(Mt[1+oe]):0,Ge=Te>-1?parseInt(te[1+Te]):0;He!==Ge&&(ve=ve.replace(Ht(),"?px "),wt*=Math.pow(.75,Ge-He),ve=ve.replace("?px ",Ht())),ut+=.25*tt*(Ge-He)}if(W.superscripts===!0){var cr=Mt.indexOf(b),ur=te.indexOf(b),jr=cr>-1?parseInt(Mt[1+cr]):0,Hr=ur>-1?parseInt(te[1+ur]):0;jr!==Hr&&(ve=ve.replace(Ht(),"?px "),wt*=Math.pow(.75,Hr-jr),ve=ve.replace("?px ",Ht())),ut-=.25*tt*(Hr-jr)}if(W.bolds===!0){var br=Mt.indexOf(y)>-1,Kr=te.indexOf(y)>-1;!br&&Kr&&(rn?ve=ve.replace("italic ","italic bold "):ve="bold "+ve),br&&!Kr&&(ve=ve.replace("bold ",""))}if(W.italics===!0){var rn=Mt.indexOf(T)>-1,Ce=te.indexOf(T)>-1;!rn&&Ce&&(ve="italic "+ve),rn&&!Ce&&(ve=ve.replace("italic ",""))}V.font=ve}for(it=0;it<st;++it){var ge=pt[it]+`
`;for(ft=0,ut=it*tt,wt=F,Pt="",Y=0;Y<ge.length;++Y){var he=Y+zt<lt.length?lt[Y+zt]:lt[lt.length-1];q===he?Pt+=ge[Y]:(Wt(),Pt=ge[Y],he!==void 0&&(Jt(q,he),q=he))}Wt(),zt+=ge.length;var de=Math.round(ft+2*dt)|0;at<de&&(at=de)}var se=at,Tt=rt+tt*st,Lt=n(V.getImageData(0,0,se,Tt).data,[Tt,se,4]);return Lt.pick(-1,-1,0).transpose(1,0)}function k(N,V){var H=a(N,128);return V?o(H.cells,H.positions,.25):{edges:H.cells,positions:H.positions}}function w(N,V,H,F){var U=k(N,F),W=h(U.positions,V,H),q=U.edges,X=V.orientation==="ccw";if(i(W,q),V.polygons||V.polygon||V.polyline){for(var lt=f(q,W),yt=new Array(lt.length),pt=0;pt<lt.length;++pt){for(var st=lt[pt],tt=new Array(st.length),dt=0;dt<st.length;++dt){for(var rt=st[dt],at=new Array(rt.length),vt=0;vt<rt.length;++vt)at[vt]=W[rt[vt]].slice();X&&at.reverse(),tt[dt]=at}yt[pt]=tt}return yt}else return V.triangles||V.triangulate||V.triangle?{cells:s(W,q,{delaunay:!1,exterior:!1,interior:!0}),positions:W}:{edges:q,positions:W}}function R(N,V,H){try{return w(N,V,H,!0)}catch{}try{return w(N,V,H,!1)}catch{}return V.polygons||V.polyline||V.polygon?[]:V.triangles||V.triangulate||V.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function O(N,V,H,F){var U=64,W=1.25,q={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};F&&(F.size&&F.size>0&&(U=F.size),F.lineSpacing&&F.lineSpacing>0&&(W=F.lineSpacing),F.styletags&&F.styletags.breaklines&&(q.breaklines=!!F.styletags.breaklines),F.styletags&&F.styletags.bolds&&(q.bolds=!!F.styletags.bolds),F.styletags&&F.styletags.italics&&(q.italics=!!F.styletags.italics),F.styletags&&F.styletags.subscripts&&(q.subscripts=!!F.styletags.subscripts),F.styletags&&F.styletags.superscripts&&(q.superscripts=!!F.styletags.superscripts)),H.font=[F.fontStyle,F.fontVariant,F.fontWeight,U+"px",F.font].filter(function(lt){return lt}).join(" "),H.textAlign="start",H.textBaseline="alphabetic",H.direction="ltr";var X=p(V,H,N,U,W,q);return R(X,F,U)}},7721:function(t,e,r){var a=r(5716);t.exports=n;function n(o){return a(o[0])*a(o[1])}},7765:function(t,e,r){t.exports=u;var a=r(9618),n=r(1888),o=r(446),i=r(1570);function s(b){for(var _=b.length,C=0,M=0;M<_;++M)C=Math.max(C,b[M].length)|0;return C-1}function f(b,_){for(var C=b.length,M=n.mallocUint8(C),E=0;E<C;++E)M[E]=b[E]<_|0;return M}function x(b,_){for(var C=b.length,M=_*(_+1)/2*C|0,E=n.mallocUint32(M*2),A=0,h=0;h<C;++h)for(var p=b[h],_=p.length,k=0;k<_;++k)for(var w=0;w<k;++w){var R=p[w],O=p[k];E[A++]=Math.min(R,O)|0,E[A++]=Math.max(R,O)|0}var N=A/2|0;o(a(E,[N,2]));for(var V=2,h=2;h<A;h+=2)E[h-2]===E[h]&&E[h-1]===E[h+1]||(E[V++]=E[h],E[V++]=E[h+1]);return a(E,[V/2|0,2])}function y(b,_,C,M){for(var E=b.data,A=b.shape[0],h=n.mallocDouble(A),p=0,k=0;k<A;++k){var w=E[2*k],R=E[2*k+1];if(C[w]!==C[R]){var O=_[w],N=_[R];E[2*p]=w,E[2*p+1]=R,h[p++]=(N-M)/(N-O)}}return b.shape[0]=p,a(h,[p])}function v(b,_){var C=n.mallocInt32(_*2),M=b.shape[0],E=b.data;C[0]=0;for(var A=0,h=0;h<M;++h){var p=E[2*h];if(p!==A){for(C[2*A+1]=h;++A<p;)C[2*A]=h,C[2*A+1]=h;C[2*A]=h}}for(C[2*A+1]=M;++A<_;)C[2*A]=C[2*A+1]=M;return C}function T(b){for(var _=b.shape[0]|0,C=b.data,M=new Array(_),E=0;E<_;++E)M[E]=[C[2*E],C[2*E+1]];return M}function u(b,_,C,M){C=C||0,typeof M>"u"&&(M=s(b));var E=b.length;if(E===0||M<1)return{cells:[],vertexIds:[],vertexWeights:[]};var A=f(_,+C),h=x(b,M),p=y(h,_,A,+C),k=v(h,_.length|0),w=i(M)(b,h.data,k,A),R=T(h),O=[].slice.call(p.data,0,p.shape[0]);return n.free(A),n.free(h.data),n.free(p.data),n.free(k),{cells:w,vertexIds:R,vertexWeights:O}}},7766:function(t,e,r){var a=r(9618),n=r(5298),o=r(1888);t.exports=p;var i=null,s=null,f=null;function x(k){i=[k.LINEAR,k.NEAREST_MIPMAP_LINEAR,k.LINEAR_MIPMAP_NEAREST,k.LINEAR_MIPMAP_NEAREST],s=[k.NEAREST,k.LINEAR,k.NEAREST_MIPMAP_NEAREST,k.NEAREST_MIPMAP_LINEAR,k.LINEAR_MIPMAP_NEAREST,k.LINEAR_MIPMAP_LINEAR],f=[k.REPEAT,k.CLAMP_TO_EDGE,k.MIRRORED_REPEAT]}function y(k){return typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&k instanceof HTMLVideoElement||typeof ImageData<"u"&&k instanceof ImageData}var v=function(k,w){n.muls(k,w,255)};function T(k,w,R){var O=k.gl,N=O.getParameter(O.MAX_TEXTURE_SIZE);if(w<0||w>N||R<0||R>N)throw new Error("gl-texture2d: Invalid texture size");return k._shape=[w,R],k.bind(),O.texImage2D(O.TEXTURE_2D,0,k.format,w,R,0,k.format,k.type,null),k._mipLevels=[0],k}function u(k,w,R,O,N,V){this.gl=k,this.handle=w,this.format=N,this.type=V,this._shape=[R,O],this._mipLevels=[0],this._magFilter=k.NEAREST,this._minFilter=k.NEAREST,this._wrapS=k.CLAMP_TO_EDGE,this._wrapT=k.CLAMP_TO_EDGE,this._anisoSamples=1;var H=this,F=[this._wrapS,this._wrapT];Object.defineProperties(F,[{get:function(){return H._wrapS},set:function(W){return H.wrapS=W}},{get:function(){return H._wrapT},set:function(W){return H.wrapT=W}}]),this._wrapVector=F;var U=[this._shape[0],this._shape[1]];Object.defineProperties(U,[{get:function(){return H._shape[0]},set:function(W){return H.width=W}},{get:function(){return H._shape[1]},set:function(W){return H.height=W}}]),this._shapeVector=U}var b=u.prototype;Object.defineProperties(b,{minFilter:{get:function(){return this._minFilter},set:function(k){this.bind();var w=this.gl;if(this.type===w.FLOAT&&i.indexOf(k)>=0&&(w.getExtension("OES_texture_float_linear")||(k=w.NEAREST)),s.indexOf(k)<0)throw new Error("gl-texture2d: Unknown filter mode "+k);return w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MIN_FILTER,k),this._minFilter=k}},magFilter:{get:function(){return this._magFilter},set:function(k){this.bind();var w=this.gl;if(this.type===w.FLOAT&&i.indexOf(k)>=0&&(w.getExtension("OES_texture_float_linear")||(k=w.NEAREST)),s.indexOf(k)<0)throw new Error("gl-texture2d: Unknown filter mode "+k);return w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MAG_FILTER,k),this._magFilter=k}},mipSamples:{get:function(){return this._anisoSamples},set:function(k){var w=this._anisoSamples;if(this._anisoSamples=Math.max(k,1)|0,w!==this._anisoSamples){var R=this.gl.getExtension("EXT_texture_filter_anisotropic");R&&this.gl.texParameterf(this.gl.TEXTURE_2D,R.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(k){if(this.bind(),f.indexOf(k)<0)throw new Error("gl-texture2d: Unknown wrap mode "+k);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,k),this._wrapS=k}},wrapT:{get:function(){return this._wrapT},set:function(k){if(this.bind(),f.indexOf(k)<0)throw new Error("gl-texture2d: Unknown wrap mode "+k);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,k),this._wrapT=k}},wrap:{get:function(){return this._wrapVector},set:function(k){if(Array.isArray(k)||(k=[k,k]),k.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var w=0;w<2;++w)if(f.indexOf(k[w])<0)throw new Error("gl-texture2d: Unknown wrap mode "+k);this._wrapS=k[0],this._wrapT=k[1];var R=this.gl;return this.bind(),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,this._wrapS),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,this._wrapT),k}},shape:{get:function(){return this._shapeVector},set:function(k){if(!Array.isArray(k))k=[k|0,k|0];else if(k.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,k[0]|0,k[1]|0),[k[0]|0,k[1]|0]}},width:{get:function(){return this._shape[0]},set:function(k){return k=k|0,T(this,k,this._shape[1]),k}},height:{get:function(){return this._shape[1]},set:function(k){return k=k|0,T(this,this._shape[0],k),k}}}),b.bind=function(k){var w=this.gl;return k!==void 0&&w.activeTexture(w.TEXTURE0+(k|0)),w.bindTexture(w.TEXTURE_2D,this.handle),k!==void 0?k|0:w.getParameter(w.ACTIVE_TEXTURE)-w.TEXTURE0},b.dispose=function(){this.gl.deleteTexture(this.handle)},b.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var k=Math.min(this._shape[0],this._shape[1]),w=0;k>0;++w,k>>>=1)this._mipLevels.indexOf(w)<0&&this._mipLevels.push(w)},b.setPixels=function(k,w,R,O){var N=this.gl;this.bind(),Array.isArray(w)?(O=R,R=w[1]|0,w=w[0]|0):(w=w||0,R=R||0),O=O||0;var V=y(k)?k:k.raw;if(V){var H=this._mipLevels.indexOf(O)<0;H?(N.texImage2D(N.TEXTURE_2D,0,this.format,this.format,this.type,V),this._mipLevels.push(O)):N.texSubImage2D(N.TEXTURE_2D,O,w,R,this.format,this.type,V)}else if(k.shape&&k.stride&&k.data){if(k.shape.length<2||w+k.shape[1]>this._shape[1]>>>O||R+k.shape[0]>this._shape[0]>>>O||w<0||R<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");C(N,w,R,O,this.format,this.type,this._mipLevels,k)}else throw new Error("gl-texture2d: Unsupported data type")};function _(k,w){return k.length===3?w[2]===1&&w[1]===k[0]*k[2]&&w[0]===k[2]:w[0]===1&&w[1]===k[0]}function C(k,w,R,O,N,V,H,F){var U=F.dtype,W=F.shape.slice();if(W.length<2||W.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var q=0,X=0,lt=_(W,F.stride.slice());if(U==="float32"?q=k.FLOAT:U==="float64"?(q=k.FLOAT,lt=!1,U="float32"):U==="uint8"?q=k.UNSIGNED_BYTE:(q=k.UNSIGNED_BYTE,lt=!1,U="uint8"),W.length===2)X=k.LUMINANCE,W=[W[0],W[1],1],F=a(F.data,W,[F.stride[0],F.stride[1],1],F.offset);else if(W.length===3){if(W[2]===1)X=k.ALPHA;else if(W[2]===2)X=k.LUMINANCE_ALPHA;else if(W[2]===3)X=k.RGB;else if(W[2]===4)X=k.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");W[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((X===k.LUMINANCE||X===k.ALPHA)&&(N===k.LUMINANCE||N===k.ALPHA)&&(X=N),X!==N)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var yt=F.size,pt=H.indexOf(O)<0;if(pt&&H.push(O),q===V&&lt)F.offset===0&&F.data.length===yt?pt?k.texImage2D(k.TEXTURE_2D,O,N,W[0],W[1],0,N,V,F.data):k.texSubImage2D(k.TEXTURE_2D,O,w,R,W[0],W[1],N,V,F.data):pt?k.texImage2D(k.TEXTURE_2D,O,N,W[0],W[1],0,N,V,F.data.subarray(F.offset,F.offset+yt)):k.texSubImage2D(k.TEXTURE_2D,O,w,R,W[0],W[1],N,V,F.data.subarray(F.offset,F.offset+yt));else{var st;V===k.FLOAT?st=o.mallocFloat32(yt):st=o.mallocUint8(yt);var tt=a(st,W,[W[2],W[2]*W[0],1]);q===k.FLOAT&&V===k.UNSIGNED_BYTE?v(tt,F):n.assign(tt,F),pt?k.texImage2D(k.TEXTURE_2D,O,N,W[0],W[1],0,N,V,st.subarray(0,yt)):k.texSubImage2D(k.TEXTURE_2D,O,w,R,W[0],W[1],N,V,st.subarray(0,yt)),V===k.FLOAT?o.freeFloat32(st):o.freeUint8(st)}}function M(k){var w=k.createTexture();return k.bindTexture(k.TEXTURE_2D,w),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MIN_FILTER,k.NEAREST),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MAG_FILTER,k.NEAREST),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_S,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_T,k.CLAMP_TO_EDGE),w}function E(k,w,R,O,N){var V=k.getParameter(k.MAX_TEXTURE_SIZE);if(w<0||w>V||R<0||R>V)throw new Error("gl-texture2d: Invalid texture shape");if(N===k.FLOAT&&!k.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var H=M(k);return k.texImage2D(k.TEXTURE_2D,0,O,w,R,0,O,N,null),new u(k,H,w,R,O,N)}function A(k,w,R,O,N,V){var H=M(k);return k.texImage2D(k.TEXTURE_2D,0,N,N,V,w),new u(k,H,R,O,N,V)}function h(k,w){var R=w.dtype,O=w.shape.slice(),N=k.getParameter(k.MAX_TEXTURE_SIZE);if(O[0]<0||O[0]>N||O[1]<0||O[1]>N)throw new Error("gl-texture2d: Invalid texture size");var V=_(O,w.stride.slice()),H=0;R==="float32"?H=k.FLOAT:R==="float64"?(H=k.FLOAT,V=!1,R="float32"):R==="uint8"?H=k.UNSIGNED_BYTE:(H=k.UNSIGNED_BYTE,V=!1,R="uint8");var F=0;if(O.length===2)F=k.LUMINANCE,O=[O[0],O[1],1],w=a(w.data,O,[w.stride[0],w.stride[1],1],w.offset);else if(O.length===3)if(O[2]===1)F=k.ALPHA;else if(O[2]===2)F=k.LUMINANCE_ALPHA;else if(O[2]===3)F=k.RGB;else if(O[2]===4)F=k.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");H===k.FLOAT&&!k.getExtension("OES_texture_float")&&(H=k.UNSIGNED_BYTE,V=!1);var U,W,q=w.size;if(V)w.offset===0&&w.data.length===q?U=w.data:U=w.data.subarray(w.offset,w.offset+q);else{var X=[O[2],O[2]*O[0],1];W=o.malloc(q,R);var lt=a(W,O,X,0);(R==="float32"||R==="float64")&&H===k.UNSIGNED_BYTE?v(lt,w):n.assign(lt,w),U=W.subarray(0,q)}var yt=M(k);return k.texImage2D(k.TEXTURE_2D,0,F,O[0],O[1],0,F,H,U),V||o.free(W),new u(k,yt,O[0],O[1],F,H)}function p(k){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(i||x(k),typeof arguments[1]=="number")return E(k,arguments[1],arguments[2],arguments[3]||k.RGBA,arguments[4]||k.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return E(k,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||k.RGBA,arguments[3]||k.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var w=arguments[1],R=y(w)?w:w.raw;if(R)return A(k,R,w.width|0,w.height|0,arguments[2]||k.RGBA,arguments[3]||k.UNSIGNED_BYTE);if(w.shape&&w.data&&w.stride)return h(k,w)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},7790:function(){},7815:function(t,e,r){var a=r(2931),n=r(9970),o=["xyz","xzy","yxz","yzx","zxy","zyx"],i=function(_,C,M,E){for(var A=_.points,h=_.velocities,p=_.divergences,k=[],w=[],R=[],O=[],N=[],V=[],H=0,F=0,U=n.create(),W=n.create(),q=8,X=0;X<A.length;X++){var lt=A[X],yt=h[X],pt=p[X];C===0&&(pt=M*.05),F=a.length(yt)/E,U=n.create(),a.copy(U,yt),U[3]=pt;for(var st=0;st<q;st++)N[st]=[lt[0],lt[1],lt[2],st];if(O.length>0)for(var st=0;st<q;st++){var tt=(st+1)%q;k.push(O[st],N[st],N[tt],N[tt],O[tt],O[st]),R.push(W,U,U,U,W,W),V.push(H,F,F,F,H,H);var dt=k.length;w.push([dt-6,dt-5,dt-4],[dt-3,dt-2,dt-1])}var rt=O;O=N,N=rt;var at=W;W=U,U=at;var vt=H;H=F,F=vt}return{positions:k,cells:w,vectors:R,vertexIntensity:V}},s=function(_,C,M,E){for(var A=0,h=0;h<_.length;h++)for(var p=_[h].velocities,k=0;k<p.length;k++)A=Math.max(A,a.length(p[k]));for(var w=_.map(function(lt){return i(lt,M,E,A)}),R=[],O=[],N=[],V=[],h=0;h<w.length;h++){var H=w[h],F=R.length;R=R.concat(H.positions),N=N.concat(H.vectors),V=V.concat(H.vertexIntensity);for(var k=0;k<H.cells.length;k++){var U=H.cells[k],W=[];O.push(W);for(var q=0;q<U.length;q++)W.push(U[q]+F)}}return{positions:R,cells:O,vectors:N,vertexIntensity:V,colormap:C}},f=function(_,C){var M=_.length,E;for(E=0;E<M;E++){var A=_[E];if(A===C)return E;if(A>C)return E-1}return E},x=function(_,C,M){return _<C?C:_>M?M:_},y=function(_,C,M){var E=C.vectors,A=C.meshgrid,h=_[0],p=_[1],k=_[2],w=A[0].length,R=A[1].length,O=A[2].length,N=f(A[0],h),V=f(A[1],p),H=f(A[2],k),F=N+1,U=V+1,W=H+1;if(N=x(N,0,w-1),F=x(F,0,w-1),V=x(V,0,R-1),U=x(U,0,R-1),H=x(H,0,O-1),W=x(W,0,O-1),N<0||V<0||H<0||F>w-1||U>R-1||W>O-1)return a.create();var q=A[0][N],X=A[0][F],lt=A[1][V],yt=A[1][U],pt=A[2][H],st=A[2][W],tt=(h-q)/(X-q),dt=(p-lt)/(yt-lt),rt=(k-pt)/(st-pt);isFinite(tt)||(tt=.5),isFinite(dt)||(dt=.5),isFinite(rt)||(rt=.5);var at,vt,it,Y,ft,ut;switch(M.reversedX&&(N=w-1-N,F=w-1-F),M.reversedY&&(V=R-1-V,U=R-1-U),M.reversedZ&&(H=O-1-H,W=O-1-W),M.filled){case 5:ft=H,ut=W,it=V*O,Y=U*O,at=N*O*R,vt=F*O*R;break;case 4:ft=H,ut=W,at=N*O,vt=F*O,it=V*O*w,Y=U*O*w;break;case 3:it=V,Y=U,ft=H*R,ut=W*R,at=N*R*O,vt=F*R*O;break;case 2:it=V,Y=U,at=N*R,vt=F*R,ft=H*R*w,ut=W*R*w;break;case 1:at=N,vt=F,ft=H*w,ut=W*w,it=V*w*O,Y=U*w*O;break;default:at=N,vt=F,it=V*w,Y=U*w,ft=H*w*R,ut=W*w*R;break}var wt=E[at+it+ft],zt=E[at+it+ut],Pt=E[at+Y+ft],Wt=E[at+Y+ut],Ht=E[vt+it+ft],Jt=E[vt+it+ut],ge=E[vt+Y+ft],he=E[vt+Y+ut],de=a.create(),se=a.create(),Tt=a.create(),Lt=a.create();a.lerp(de,wt,Ht,tt),a.lerp(se,zt,Jt,tt),a.lerp(Tt,Pt,ge,tt),a.lerp(Lt,Wt,he,tt);var Mt=a.create(),te=a.create();a.lerp(Mt,de,Tt,dt),a.lerp(te,se,Lt,dt);var ve=a.create();return a.lerp(ve,Mt,te,rt),ve},v=function(_){var C=1/0;_.sort(function(h,p){return h-p});for(var M=_.length,E=1;E<M;E++){var A=Math.abs(_[E]-_[E-1]);A<C&&(C=A)}return C},T=function(_){for(var C=[],M=[],E=[],A={},h={},p={},k=_.length,w=0;w<k;w++){var R=_[w],O=R[0],N=R[1],V=R[2];A[O]||(C.push(O),A[O]=!0),h[N]||(M.push(N),h[N]=!0),p[V]||(E.push(V),p[V]=!0)}var H=v(C),F=v(M),U=v(E),W=Math.min(H,F,U);return isFinite(W)?W:1};t.exports=function(_,C){var M=_.startingPositions,E=_.maxLength||1e3,A=_.tubeSize||1,h=_.absoluteTubeSize,p=_.gridFill||"+x+y+z",k={};p.indexOf("-x")!==-1&&(k.reversedX=!0),p.indexOf("-y")!==-1&&(k.reversedY=!0),p.indexOf("-z")!==-1&&(k.reversedZ=!0),k.filled=o.indexOf(p.replace(/-/g,"").replace(/\+/g,""));var w=_.getVelocity||function(Jt){return y(Jt,_,k)},R=_.getDivergence||function(Jt,ge){var he=a.create(),de=1e-4;a.add(he,Jt,[de,0,0]);var se=w(he);a.subtract(se,se,ge),a.scale(se,se,1/de),a.add(he,Jt,[0,de,0]);var Tt=w(he);a.subtract(Tt,Tt,ge),a.scale(Tt,Tt,1/de),a.add(he,Jt,[0,0,de]);var Lt=w(he);return a.subtract(Lt,Lt,ge),a.scale(Lt,Lt,1/de),a.add(he,se,Tt),a.add(he,he,Lt),he},O=[],N=C[0][0],V=C[0][1],H=C[0][2],F=C[1][0],U=C[1][1],W=C[1][2],q=function(Jt){var ge=Jt[0],he=Jt[1],de=Jt[2];return!(ge<N||ge>F||he<V||he>U||de<H||de>W)},X=a.distance(C[0],C[1]),lt=10*X/E,yt=lt*lt,pt=1,st=0,tt=M.length;tt>1&&(pt=T(M));for(var dt=0;dt<tt;dt++){var rt=a.create();a.copy(rt,M[dt]);var at=[rt],vt=[],it=w(rt),Y=rt;vt.push(it);var ft=[],ut=R(rt,it),wt=a.length(ut);isFinite(wt)&&wt>st&&(st=wt),ft.push(wt),O.push({points:at,velocities:vt,divergences:ft});for(var zt=0;zt<E*100&&at.length<E&&q(rt);){zt++;var Pt=a.clone(it),Wt=a.squaredLength(Pt);if(Wt===0)break;if(Wt>yt&&a.scale(Pt,Pt,lt/Math.sqrt(Wt)),a.add(Pt,Pt,rt),it=w(Pt),a.squaredDistance(Y,Pt)-yt>-1e-4*yt){at.push(Pt),Y=Pt,vt.push(it);var ut=R(Pt,it),wt=a.length(ut);isFinite(wt)&&wt>st&&(st=wt),ft.push(wt)}rt=Pt}}var Ht=s(O,_.colormap,st,pt);return h?Ht.tubeScale=h:(st===0&&(st=1),Ht.tubeScale=A*.5*pt/st),Ht};var u=r(6740),b=r(6405).createMesh;t.exports.createTubeMesh=function(_,C){return b(_,C,{shaders:u,traceType:"streamtube"})}},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},7842:function(t,e,r){var a=r(6330),n=r(1533),o=r(2651),i=r(6768),s=r(869),f=r(8697);t.exports=x;function x(y,v){if(a(y))return v?f(y,x(v)):[y[0].clone(),y[1].clone()];var T=0,u,b;if(n(y))u=y.clone();else if(typeof y=="string")u=i(y);else{if(y===0)return[o(0),o(1)];if(y===Math.floor(y))u=o(y);else{for(;y!==Math.floor(y);)y=y*Math.pow(2,256),T-=256;u=o(y)}}if(a(v))u.mul(v[1]),b=v[0].clone();else if(n(v))b=v.clone();else if(typeof v=="string")b=i(v);else if(!v)b=o(1);else if(v===Math.floor(v))b=o(v);else{for(;v!==Math.floor(v);)v=v*Math.pow(2,256),T+=256;b=o(v)}return T>0?u=u.ushln(T):T<0&&(b=b.ushln(-T)),s(u,b)}},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 a=r(620);t.exports=a.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,a){var n=a[0]-r[0],o=a[1]-r[1],i=a[2]-r[2],s=a[3]-r[3];return n*n+o*o+i*i+s*s}},8105:function(t){t.exports=r;var e={"lo===p0":a,"lo<p0":n,"lo<=p0":o,"hi<=p0":i,"lo<p0&&p0<=hi":f,"lo<=p0&&p0<=hi":s,"!(lo>=p0)&&!(p1>=hi)":x};function r(y){return e[y]}function a(y,v,T,u,b,_,C){for(var M=2*y,E=M*T,A=E,h=T,p=v,k=y+v,w=T;u>w;++w,E+=M){var R=b[E+p];if(R===C)if(h===w)h+=1,A+=M;else{for(var O=0;M>O;++O){var N=b[E+O];b[E+O]=b[A],b[A++]=N}var V=_[w];_[w]=_[h],_[h++]=V}}return h}function n(y,v,T,u,b,_,C){for(var M=2*y,E=M*T,A=E,h=T,p=v,k=y+v,w=T;u>w;++w,E+=M){var R=b[E+p];if(R<C)if(h===w)h+=1,A+=M;else{for(var O=0;M>O;++O){var N=b[E+O];b[E+O]=b[A],b[A++]=N}var V=_[w];_[w]=_[h],_[h++]=V}}return h}function o(y,v,T,u,b,_,C){for(var M=2*y,E=M*T,A=E,h=T,p=v,k=y+v,w=T;u>w;++w,E+=M){var R=b[E+k];if(R<=C)if(h===w)h+=1,A+=M;else{for(var O=0;M>O;++O){var N=b[E+O];b[E+O]=b[A],b[A++]=N}var V=_[w];_[w]=_[h],_[h++]=V}}return h}function i(y,v,T,u,b,_,C){for(var M=2*y,E=M*T,A=E,h=T,p=v,k=y+v,w=T;u>w;++w,E+=M){var R=b[E+k];if(R<=C)if(h===w)h+=1,A+=M;else{for(var O=0;M>O;++O){var N=b[E+O];b[E+O]=b[A],b[A++]=N}var V=_[w];_[w]=_[h],_[h++]=V}}return h}function s(y,v,T,u,b,_,C){for(var M=2*y,E=M*T,A=E,h=T,p=v,k=y+v,w=T;u>w;++w,E+=M){var R=b[E+p],O=b[E+k];if(R<=C&&C<=O)if(h===w)h+=1,A+=M;else{for(var N=0;M>N;++N){var V=b[E+N];b[E+N]=b[A],b[A++]=V}var H=_[w];_[w]=_[h],_[h++]=H}}return h}function f(y,v,T,u,b,_,C){for(var M=2*y,E=M*T,A=E,h=T,p=v,k=y+v,w=T;u>w;++w,E+=M){var R=b[E+p],O=b[E+k];if(R<C&&C<=O)if(h===w)h+=1,A+=M;else{for(var N=0;M>N;++N){var V=b[E+N];b[E+N]=b[A],b[A++]=V}var H=_[w];_[w]=_[h],_[h++]=H}}return h}function x(y,v,T,u,b,_,C,M){for(var E=2*y,A=E*T,h=A,p=T,k=v,w=y+v,R=T;u>R;++R,A+=E){var O=b[A+k],N=b[A+w];if(!(O>=C)&&!(M>=N))if(p===R)p+=1,h+=E;else{for(var V=0;E>V;++V){var H=b[A+V];b[A+V]=b[h],b[h++]=H}var F=_[R];_[R]=_[p],_[p++]=F}}return p}},8107:function(t){t.exports=e;function e(r,a,n){return r[0]=Math.min(a[0],n[0]),r[1]=Math.min(a[1],n[1]),r[2]=Math.min(a[2],n[2]),r}},8116:function(t,e,r){var a=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 i(s,f,x,y){var v=s.createVertexArray?new o(s):s.getExtension("OES_vertex_array_object"),T;return v?T=a(s,v):T=n(s),T.update(f,x,y),T}t.exports=i},8192:function(t,e,r){t.exports=i;var a=r(2825),n=r(3536),o=r(244);function i(s,f){var x=a(s[0],s[1],s[2]),y=a(f[0],f[1],f[2]);n(x,x),n(y,y);var v=o(x,y);return v>1?0:Math.acos(v)}},8210:function(t){t.exports=r;function e(a,n){var o=a+n,i=o-a,s=o-i,f=n-i,x=a-s,y=x+f;return y?[y,o]:[o]}function r(a,n){var o=a.length|0,i=n.length|0;if(o===1&&i===1)return e(a[0],n[0]);var s=o+i,f=new Array(s),x=0,y=0,v=0,T=Math.abs,u=a[y],b=T(u),_=n[v],C=T(_),M,E;b<C?(E=u,y+=1,y<o&&(u=a[y],b=T(u))):(E=_,v+=1,v<i&&(_=n[v],C=T(_))),y<o&&b<C||v>=i?(M=u,y+=1,y<o&&(u=a[y],b=T(u))):(M=_,v+=1,v<i&&(_=n[v],C=T(_)));for(var A=M+E,h=A-M,p=E-h,k=p,w=A,R,O,N,V,H;y<o&&v<i;)b<C?(M=u,y+=1,y<o&&(u=a[y],b=T(u))):(M=_,v+=1,v<i&&(_=n[v],C=T(_))),E=k,A=M+E,h=A-M,p=E-h,p&&(f[x++]=p),R=w+A,O=R-w,N=R-O,V=A-O,H=w-N,k=H+V,w=R;for(;y<o;)M=u,E=k,A=M+E,h=A-M,p=E-h,p&&(f[x++]=p),R=w+A,O=R-w,N=R-O,V=A-O,H=w-N,k=H+V,w=R,y+=1,y<o&&(u=a[y]);for(;v<i;)M=_,E=k,A=M+E,h=A-M,p=E-h,p&&(f[x++]=p),R=w+A,O=R-w,N=R-O,V=A-O,H=w-N,k=H+V,w=R,v+=1,v<i&&(_=n[v]);return k&&(f[x++]=k),w&&(f[x++]=w),x||(f[x++]=0),f.length=x,f}},8277:function(t){function e(){return function(s,f,x,y,v){var T=s[0],u=s[1],b=s[2],_=x[0],C=x[1],M=x[2],E=[0,0,0];y|=0;var A=0,h=0,p=0,k=M,w=C-b*M,R=_-u*C;for(p=0;p<T;++p){for(h=0;h<u;++h){for(A=0;A<b;++A){{var O=v,N;for(N=0;N<E.length-1;++N)O=O[E[N]];f[y]=O[E[E.length-1]]}y+=k,++E[2]}y+=w,E[2]-=b,++E[1]}y+=R,E[1]-=u,++E[0]}}}function r(){return e()}var a=r;function n(s){var f={};return function(x,y){var v=x.dtype,T=x.order,u=[v,T.join()].join(),b=f[u];return b||(f[u]=b=s([v,T])),b(x.shape.slice(0),x.data,x.stride,x.offset|0,y)}}function o(s){return n(a.bind(void 0,s))}function i(s){return o({funcName:s.funcName})}t.exports=i({funcName:"convert"})},8284:function(t){t.exports=e;function e(r,a){var n={identity:a},o=r.valueOf;return Object.defineProperty(r,"valueOf",{value:function(i){return i!==a?o.apply(this,arguments):n},writable:!0}),n}},8406:function(t,e){var r=1e-6,a=1e-6;e.vertexNormals=function(n,o,i){for(var s=o.length,f=new Array(s),x=i===void 0?r:i,y=0;y<s;++y)f[y]=[0,0,0];for(var y=0;y<n.length;++y)for(var v=n[y],T=0,u=v[v.length-1],b=v[0],_=0;_<v.length;++_){T=u,u=b,b=v[(_+1)%v.length];for(var C=o[T],M=o[u],E=o[b],A=new Array(3),h=0,p=new Array(3),k=0,w=0;w<3;++w)A[w]=C[w]-M[w],h+=A[w]*A[w],p[w]=E[w]-M[w],k+=p[w]*p[w];if(h*k>x)for(var R=f[u],O=1/Math.sqrt(h*k),w=0;w<3;++w){var N=(w+1)%3,V=(w+2)%3;R[w]+=O*(p[N]*A[V]-p[V]*A[N])}}for(var y=0;y<s;++y){for(var R=f[y],H=0,w=0;w<3;++w)H+=R[w]*R[w];if(H>x)for(var O=1/Math.sqrt(H),w=0;w<3;++w)R[w]*=O;else for(var w=0;w<3;++w)R[w]=0}return f},e.faceNormals=function(n,o,i){for(var s=n.length,f=new Array(s),x=i===void 0?a:i,y=0;y<s;++y){for(var v=n[y],T=new Array(3),u=0;u<3;++u)T[u]=o[v[u]];for(var b=new Array(3),_=new Array(3),u=0;u<3;++u)b[u]=T[1][u]-T[0][u],_[u]=T[2][u]-T[0][u];for(var C=new Array(3),M=0,u=0;u<3;++u){var E=(u+1)%3,A=(u+2)%3;C[u]=b[E]*_[A]-b[A]*_[E],M+=C[u]*C[u]}M>x?M=1/Math.sqrt(M):M=0;for(var u=0;u<3;++u)C[u]*=M;f[y]=C}return f}},8418:function(t,e,r){var a=r(5219),n=r(2762),o=r(8116),i=r(1888),s=r(6760),f=r(1283),x=r(9366),y=r(5964),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,u=DataView;function b(at){return T.isView(at)&&!(at instanceof u)}function _(at){return Array.isArray(at)||b(at)}t.exports=rt;function C(at,vt){var it=at[0],Y=at[1],ft=at[2],ut=at[3];return at[0]=vt[0]*it+vt[4]*Y+vt[8]*ft+vt[12]*ut,at[1]=vt[1]*it+vt[5]*Y+vt[9]*ft+vt[13]*ut,at[2]=vt[2]*it+vt[6]*Y+vt[10]*ft+vt[14]*ut,at[3]=vt[3]*it+vt[7]*Y+vt[11]*ft+vt[15]*ut,at}function M(at,vt,it,Y){return C(Y,Y),C(Y,Y),C(Y,Y)}function E(at,vt){this.index=at,this.dataCoordinate=this.position=vt}function A(at){return at===!0||at>1?1:at}function h(at,vt,it,Y,ft,ut,wt,zt,Pt,Wt,Ht,Jt){this.gl=at,this.pixelRatio=1,this.shader=vt,this.orthoShader=it,this.projectShader=Y,this.pointBuffer=ft,this.colorBuffer=ut,this.glyphBuffer=wt,this.idBuffer=zt,this.vao=Pt,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=Wt,this.pickOrthoShader=Ht,this.pickProjectShader=Jt,this.points=[],this._selectResult=new E(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 p=h.prototype;p.pickSlots=1,p.setPickBase=function(at){this.pickId=at},p.isTransparent=function(){if(this.hasAlpha)return!0;for(var at=0;at<3;++at)if(this.axesProject[at]&&this.projectHasAlpha)return!0;return!1},p.isOpaque=function(){if(!this.hasAlpha)return!0;for(var at=0;at<3;++at)if(this.axesProject[at]&&!this.projectHasAlpha)return!0;return!1};var k=[0,0],w=[0,0,0],R=[0,0,0],O=[0,0,0,1],N=[0,0,0,1],V=v.slice(),H=[0,0,0],F=[[0,0,0],[0,0,0]];function U(at){return at[0]=at[1]=at[2]=0,at}function W(at,vt){return at[0]=vt[0],at[1]=vt[1],at[2]=vt[2],at[3]=1,at}function q(at,vt,it,Y){return at[0]=vt[0],at[1]=vt[1],at[2]=vt[2],at[it]=Y,at}function X(at){for(var vt=F,it=0;it<2;++it)for(var Y=0;Y<3;++Y)vt[it][Y]=Math.max(Math.min(at[it][Y],1e8),-1e8);return vt}function lt(at,vt,it,Y){var ft=vt.axesProject,ut=vt.gl,wt=at.uniforms,zt=it.model||v,Pt=it.view||v,Wt=it.projection||v,Ht=vt.axesBounds,Jt=X(vt.clipBounds),ge;vt.axes&&vt.axes.lastCubeProps?ge=vt.axes.lastCubeProps.axis:ge=[1,1,1],k[0]=2/ut.drawingBufferWidth,k[1]=2/ut.drawingBufferHeight,at.bind(),wt.view=Pt,wt.projection=Wt,wt.screenSize=k,wt.highlightId=vt.highlightId,wt.highlightScale=vt.highlightScale,wt.clipBounds=Jt,wt.pickGroup=vt.pickId/255,wt.pixelRatio=Y;for(var he=0;he<3;++he)if(ft[he]){wt.scale=vt.projectScale[he],wt.opacity=vt.projectOpacity[he];for(var de=V,se=0;se<16;++se)de[se]=0;for(var se=0;se<4;++se)de[5*se]=1;de[5*he]=0,ge[he]<0?de[12+he]=Ht[0][he]:de[12+he]=Ht[1][he],s(de,zt,de),wt.model=de;var Tt=(he+1)%3,Lt=(he+2)%3,Mt=U(w),te=U(R);Mt[Tt]=1,te[Lt]=1;var ve=M(Wt,Pt,zt,W(O,Mt)),oe=M(Wt,Pt,zt,W(N,te));if(Math.abs(ve[1])>Math.abs(oe[1])){var Te=ve;ve=oe,oe=Te,Te=Mt,Mt=te,te=Te;var He=Tt;Tt=Lt,Lt=He}ve[0]<0&&(Mt[Tt]=-1),oe[1]>0&&(te[Lt]=-1);for(var Ge=0,cr=0,se=0;se<4;++se)Ge+=Math.pow(zt[4*Tt+se],2),cr+=Math.pow(zt[4*Lt+se],2);Mt[Tt]/=Math.sqrt(Ge),te[Lt]/=Math.sqrt(cr),wt.axes[0]=Mt,wt.axes[1]=te,wt.fragClipBounds[0]=q(H,Jt[0],he,-1e8),wt.fragClipBounds[1]=q(H,Jt[1],he,1e8),vt.vao.bind(),vt.vao.draw(ut.TRIANGLES,vt.vertexCount),vt.lineWidth>0&&(ut.lineWidth(vt.lineWidth*Y),vt.vao.draw(ut.LINES,vt.lineVertexCount,vt.vertexCount)),vt.vao.unbind()}}var yt=[-1e8,-1e8,-1e8],pt=[1e8,1e8,1e8],st=[yt,pt];function tt(at,vt,it,Y,ft,ut,wt){var zt=it.gl;if((ut===it.projectHasAlpha||wt)&&lt(vt,it,Y,ft),ut===it.hasAlpha||wt){at.bind();var Pt=at.uniforms;Pt.model=Y.model||v,Pt.view=Y.view||v,Pt.projection=Y.projection||v,k[0]=2/zt.drawingBufferWidth,k[1]=2/zt.drawingBufferHeight,Pt.screenSize=k,Pt.highlightId=it.highlightId,Pt.highlightScale=it.highlightScale,Pt.fragClipBounds=st,Pt.clipBounds=it.axes.bounds,Pt.opacity=it.opacity,Pt.pickGroup=it.pickId/255,Pt.pixelRatio=ft,it.vao.bind(),it.vao.draw(zt.TRIANGLES,it.vertexCount),it.lineWidth>0&&(zt.lineWidth(it.lineWidth*ft),it.vao.draw(zt.LINES,it.lineVertexCount,it.vertexCount)),it.vao.unbind()}}p.draw=function(at){var vt=this.useOrtho?this.orthoShader:this.shader;tt(vt,this.projectShader,this,at,this.pixelRatio,!1,!1)},p.drawTransparent=function(at){var vt=this.useOrtho?this.orthoShader:this.shader;tt(vt,this.projectShader,this,at,this.pixelRatio,!0,!1)},p.drawPick=function(at){var vt=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;tt(vt,this.pickProjectShader,this,at,1,!0,!0)},p.pick=function(at){if(!at||at.id!==this.pickId)return null;var vt=at.value[2]+(at.value[1]<<8)+(at.value[0]<<16);if(vt>=this.pointCount||vt<0)return null;var it=this.points[vt],Y=this._selectResult;Y.index=vt;for(var ft=0;ft<3;++ft)Y.position[ft]=Y.dataCoordinate[ft]=it[ft];return Y},p.highlight=function(at){if(!at)this.highlightId=[1,1,1,1];else{var vt=at.index,it=vt&255,Y=vt>>8&255,ft=vt>>16&255;this.highlightId=[it/255,Y/255,ft/255,0]}};function dt(at,vt,it,Y){var ft;_(at)?vt<at.length?ft=at[vt]:ft=void 0:ft=at,ft=y(ft);var ut=!0;a(ft)&&(ft="▼",ut=!1),it||(it={});var wt=it.family;_(wt)&&(wt=wt[vt]),wt||(wt="normal");var zt=it.weight;_(zt)&&(zt=zt[vt]),zt||(zt="normal");var Pt=it.style;_(Pt)&&(Pt=Pt[vt]),Pt||(Pt="normal");var Wt=it.variant;_(Wt)&&(Wt=Wt[vt]),Wt||(Wt="normal");var Ht=x(ft,{family:wt,weight:zt,style:Pt,variant:Wt},Y),Ht=x(ft,it,Y);return{mesh:Ht[0],lines:Ht[1],bounds:Ht[2],visible:ut}}p.update=function(at){if(at=at||{},"perspective"in at&&(this.useOrtho=!at.perspective),"orthographic"in at&&(this.useOrtho=!!at.orthographic),"lineWidth"in at&&(this.lineWidth=at.lineWidth),"project"in at)if(_(at.project))this.axesProject=at.project;else{var vt=!!at.project;this.axesProject=[vt,vt,vt]}if("projectScale"in at)if(_(at.projectScale))this.projectScale=at.projectScale.slice();else{var it=+at.projectScale;this.projectScale=[it,it,it]}if(this.projectHasAlpha=!1,"projectOpacity"in at){if(_(at.projectOpacity))this.projectOpacity=at.projectOpacity.slice();else{var it=+at.projectOpacity;this.projectOpacity=[it,it,it]}for(var Y=0;Y<3;++Y)this.projectOpacity[Y]=A(this.projectOpacity[Y]),this.projectOpacity[Y]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in at&&(this.opacity=A(at.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var ft=at.position,ut={family:at.font||"normal",style:at.fontStyle||"normal",weight:at.fontWeight||"normal",variant:at.fontVariant||"normal"},wt=at.alignment||[0,0],zt,Pt;if(wt.length===2)zt=wt[0],Pt=wt[1];else{zt=[],Pt=[];for(var Y=0;Y<wt.length;++Y)zt[Y]=wt[Y][0],Pt[Y]=wt[Y][1]}var Wt=[1/0,1/0,1/0],Ht=[-1/0,-1/0,-1/0],Jt=at.glyph,ge=at.color,he=at.size,de=at.angle,se=at.lineColor,Tt=-1,Lt=0,Mt=0,te=0;if(ft.length){te=ft.length;t:for(var Y=0;Y<te;++Y){for(var ve=ft[Y],oe=0;oe<3;++oe)if(isNaN(ve[oe])||!isFinite(ve[oe]))continue t;var Te=dt(Jt,Y,ut,this.pixelRatio),He=Te.mesh,Ge=Te.lines,cr=Te.bounds;Lt+=He.cells.length*3,Mt+=Ge.edges.length*2}}var ur=Lt+Mt,jr=i.mallocFloat(3*ur),Hr=i.mallocFloat(4*ur),br=i.mallocFloat(2*ur),Kr=i.mallocUint32(ur);if(ur>0){var rn=0,Ce=Lt,$t=[0,0,0,1],ne=[0,0,0,1],Ct=_(ge)&&_(ge[0]),gt=_(se)&&_(se[0]);t:for(var Y=0;Y<te;++Y){Tt+=1;for(var ve=ft[Y],oe=0;oe<3;++oe){if(isNaN(ve[oe])||!isFinite(ve[oe]))continue t;Ht[oe]=Math.max(Ht[oe],ve[oe]),Wt[oe]=Math.min(Wt[oe],ve[oe])}var Te=dt(Jt,Y,ut,this.pixelRatio),He=Te.mesh,Ge=Te.lines,cr=Te.bounds,St=Te.visible;if(!St)$t=[1,1,1,0];else if(_(ge)){var Nt;if(Ct?Y<ge.length?Nt=ge[Y]:Nt=[0,0,0,0]:Nt=ge,Nt.length===3){for(var oe=0;oe<3;++oe)$t[oe]=Nt[oe];$t[3]=1}else if(Nt.length===4){for(var oe=0;oe<4;++oe)$t[oe]=Nt[oe];!this.hasAlpha&&Nt[3]<1&&(this.hasAlpha=!0)}}else $t[0]=$t[1]=$t[2]=0,$t[3]=1;if(!St)ne=[1,1,1,0];else if(_(se)){var Nt;if(gt?Y<se.length?Nt=se[Y]:Nt=[0,0,0,0]:Nt=se,Nt.length===3){for(var oe=0;oe<3;++oe)ne[oe]=Nt[oe];ne[oe]=1}else if(Nt.length===4){for(var oe=0;oe<4;++oe)ne[oe]=Nt[oe];!this.hasAlpha&&Nt[3]<1&&(this.hasAlpha=!0)}}else ne[0]=ne[1]=ne[2]=0,ne[3]=1;var ee=.5;St?_(he)?Y<he.length?ee=+he[Y]:ee=12:he?ee=+he:this.useOrtho&&(ee=12):ee=0;var le=0;_(de)?Y<de.length?le=+de[Y]:le=0:de&&(le=+de);for(var we=Math.cos(le),Ue=Math.sin(le),ve=ft[Y],oe=0;oe<3;++oe)Ht[oe]=Math.max(Ht[oe],ve[oe]),Wt[oe]=Math.min(Wt[oe],ve[oe]);var qe=zt,ar=Pt,qe=0;_(zt)?Y<zt.length?qe=zt[Y]:qe=0:zt&&(qe=zt);var ar=0;_(Pt)?Y<Pt.length?ar=Pt[Y]:ar=0:Pt&&(ar=Pt),qe*=qe>0?1-cr[0][0]:qe<0?1+cr[1][0]:1,ar*=ar>0?1-cr[0][1]:ar<0?1+cr[1][1]:1;for(var Ar=[qe,ar],Tr=He.cells||[],pr=He.positions||[],oe=0;oe<Tr.length;++oe)for(var Jr=Tr[oe],Vn=0;Vn<3;++Vn){for(var Hn=0;Hn<3;++Hn)jr[3*rn+Hn]=ve[Hn];for(var Hn=0;Hn<4;++Hn)Hr[4*rn+Hn]=$t[Hn];Kr[rn]=Tt;var Kn=pr[Jr[Vn]];br[2*rn]=ee*(we*Kn[0]-Ue*Kn[1]+Ar[0]),br[2*rn+1]=ee*(Ue*Kn[0]+we*Kn[1]+Ar[1]),rn+=1}for(var Tr=Ge.edges,pr=Ge.positions,oe=0;oe<Tr.length;++oe)for(var Jr=Tr[oe],Vn=0;Vn<2;++Vn){for(var Hn=0;Hn<3;++Hn)jr[3*Ce+Hn]=ve[Hn];for(var Hn=0;Hn<4;++Hn)Hr[4*Ce+Hn]=ne[Hn];Kr[Ce]=Tt;var Kn=pr[Jr[Vn]];br[2*Ce]=ee*(we*Kn[0]-Ue*Kn[1]+Ar[0]),br[2*Ce+1]=ee*(Ue*Kn[0]+we*Kn[1]+Ar[1]),Ce+=1}}}this.bounds=[Wt,Ht],this.points=ft,this.pointCount=ft.length,this.vertexCount=Lt,this.lineVertexCount=Mt,this.pointBuffer.update(jr),this.colorBuffer.update(Hr),this.glyphBuffer.update(br),this.idBuffer.update(Kr),i.free(jr),i.free(Hr),i.free(br),i.free(Kr)},p.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 rt(at){var vt=at.gl,it=f.createPerspective(vt),Y=f.createOrtho(vt),ft=f.createProject(vt),ut=f.createPickPerspective(vt),wt=f.createPickOrtho(vt),zt=f.createPickProject(vt),Pt=n(vt),Wt=n(vt),Ht=n(vt),Jt=n(vt),ge=o(vt,[{buffer:Pt,size:3,type:vt.FLOAT},{buffer:Wt,size:4,type:vt.FLOAT},{buffer:Ht,size:2,type:vt.FLOAT},{buffer:Jt,size:4,type:vt.UNSIGNED_BYTE,normalized:!0}]),he=new h(vt,it,Y,ft,Pt,Wt,Ht,Jt,ge,ut,wt,zt);return he.update(at),he}},8489:function(t){t.exports=e;function e(r,a,n,o){return r[0]=a[0]+n[0]*o,r[1]=a[1]+n[1]*o,r[2]=a[2]+n[2]*o,r}},8507:function(t){t.exports=a;var e=Math.min;function r(n,o){return n-o}function a(n,o){var i=n.length,s=n.length-o.length;if(s)return s;switch(i){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],x=o[0]+o[1];if(s=f+n[2]-(x+o[2]),s)return s;var y=e(n[0],n[1]),v=e(o[0],o[1]);return e(y,n[2])-e(v,o[2])||e(y+n[2],f)-e(v+o[2],x);case 4:var T=n[0],u=n[1],b=n[2],_=n[3],C=o[0],M=o[1],E=o[2],A=o[3];return T+u+b+_-(C+M+E+A)||e(T,u,b,_)-e(C,M,E,A,C)||e(T+u,T+b,T+_,u+b,u+_,b+_)-e(C+M,C+E,C+A,M+E,M+A,E+A)||e(T+u+b,T+u+_,T+b+_,u+b+_)-e(C+M+E,C+M+A,C+E+A,M+E+A);default:for(var h=n.slice().sort(r),p=o.slice().sort(r),k=0;k<i;++k)if(s=h[k]-p[k],s)return s;return 0}}},8512:function(t,e,r){var a=r(665);t.exports=n;function n(o,i,s){typeof o=="function"&&(s=!!i,i=o,o=window);var f=a("ex",o),x=function(y){s&&y.preventDefault();var v=y.deltaX||0,T=y.deltaY||0,u=y.deltaZ||0,b=y.deltaMode,_=1;switch(b){case 1:_=f;break;case 2:_=window.innerHeight;break}if(v*=_,T*=_,u*=_,v||T||u)return i(v,T,u,y)};return o.addEventListener("wheel",x),x}},8545:function(t){t.exports=r;function e(a,n){var o=a+n,i=o-a,s=o-i,f=n-i,x=a-s,y=x+f;return y?[y,o]:[o]}function r(a,n){var o=a.length|0,i=n.length|0;if(o===1&&i===1)return e(a[0],-n[0]);var s=o+i,f=new Array(s),x=0,y=0,v=0,T=Math.abs,u=a[y],b=T(u),_=-n[v],C=T(_),M,E;b<C?(E=u,y+=1,y<o&&(u=a[y],b=T(u))):(E=_,v+=1,v<i&&(_=-n[v],C=T(_))),y<o&&b<C||v>=i?(M=u,y+=1,y<o&&(u=a[y],b=T(u))):(M=_,v+=1,v<i&&(_=-n[v],C=T(_)));for(var A=M+E,h=A-M,p=E-h,k=p,w=A,R,O,N,V,H;y<o&&v<i;)b<C?(M=u,y+=1,y<o&&(u=a[y],b=T(u))):(M=_,v+=1,v<i&&(_=-n[v],C=T(_))),E=k,A=M+E,h=A-M,p=E-h,p&&(f[x++]=p),R=w+A,O=R-w,N=R-O,V=A-O,H=w-N,k=H+V,w=R;for(;y<o;)M=u,E=k,A=M+E,h=A-M,p=E-h,p&&(f[x++]=p),R=w+A,O=R-w,N=R-O,V=A-O,H=w-N,k=H+V,w=R,y+=1,y<o&&(u=a[y]);for(;v<i;)M=_,E=k,A=M+E,h=A-M,p=E-h,p&&(f[x++]=p),R=w+A,O=R-w,N=R-O,V=A-O,H=w-N,k=H+V,w=R,v+=1,v<i&&(_=-n[v]);return k&&(f[x++]=k),w&&(f[x++]=w),x||(f[x++]=0),f.length=x,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,a,n,o){var i=n[0],s=n[1],f=a[0]-i,x=a[1]-s,y=Math.sin(o),v=Math.cos(o);return r[0]=i+f*v-x*y,r[1]=s+f*y+x*v,r[2]=a[2],r}},8697:function(t,e,r){var a=r(869);t.exports=n;function n(o,i){return a(o[0].mul(i[1]),o[1].mul(i[0]))}},8731:function(t,e,r){t.exports=x;var a=r(8866);function n(y,v,T,u,b,_){this._gl=y,this._wrapper=v,this._index=T,this._locations=u,this._dimension=b,this._constFunc=_}var o=n.prototype;o.pointer=function(y,v,T,u){var b=this,_=b._gl,C=b._locations[b._index];_.vertexAttribPointer(C,b._dimension,y||_.FLOAT,!!v,T||0,u||0),_.enableVertexAttribArray(C)},o.set=function(y,v,T,u){return this._constFunc(this._locations[this._index],y,v,T,u)},Object.defineProperty(o,"location",{get:function(){return this._locations[this._index]},set:function(y){return y!==this._locations[this._index]&&(this._locations[this._index]=y|0,this._wrapper.program=null),y|0}});var i=[function(y,v,T){return T.length===void 0?y.vertexAttrib1f(v,T):y.vertexAttrib1fv(v,T)},function(y,v,T,u){return T.length===void 0?y.vertexAttrib2f(v,T,u):y.vertexAttrib2fv(v,T)},function(y,v,T,u,b){return T.length===void 0?y.vertexAttrib3f(v,T,u,b):y.vertexAttrib3fv(v,T)},function(y,v,T,u,b,_){return T.length===void 0?y.vertexAttrib4f(v,T,u,b,_):y.vertexAttrib4fv(v,T)}];function s(y,v,T,u,b,_,C){var M=i[b],E=new n(y,v,T,u,b,M);Object.defineProperty(_,C,{set:function(A){return y.disableVertexAttribArray(u[T]),M(y,u[T],A),A},get:function(){return E},enumerable:!0})}function f(y,v,T,u,b,_,C){for(var M=new Array(b),E=new Array(b),A=0;A<b;++A)s(y,v,T[A],u,b,M,A),E[A]=M[A];Object.defineProperty(M,"location",{set:function(k){if(Array.isArray(k))for(var w=0;w<b;++w)E[w].location=k[w];else for(var w=0;w<b;++w)E[w].location=k+w;return k},get:function(){for(var k=new Array(b),w=0;w<b;++w)k[w]=u[T[w]];return k},enumerable:!0}),M.pointer=function(k,w,R,O){k=k||y.FLOAT,w=!!w,R=R||b*b,O=O||0;for(var N=0;N<b;++N){var V=u[T[N]];y.vertexAttribPointer(V,b,k,w,R,O+N*b),y.enableVertexAttribArray(V)}};var h=new Array(b),p=y["vertexAttrib"+b+"fv"];Object.defineProperty(_,C,{set:function(k){for(var w=0;w<b;++w){var R=u[T[w]];if(y.disableVertexAttribArray(R),Array.isArray(k[0]))p.call(y,R,k[w]);else{for(var O=0;O<b;++O)h[O]=k[b*w+O];p.call(y,R,h)}}return k},get:function(){return M},enumerable:!0})}function x(y,v,T,u){for(var b={},_=0,C=T.length;_<C;++_){var M=T[_],E=M.name,A=M.type,h=M.locations;switch(A){case"bool":case"int":case"float":s(y,v,h[0],u,1,b,E);break;default:if(A.indexOf("vec")>=0){var p=A.charCodeAt(A.length-1)-48;if(p<2||p>4)throw new a("","Invalid data type for attribute "+E+": "+A);s(y,v,h[0],u,p,b,E)}else if(A.indexOf("mat")>=0){var p=A.charCodeAt(A.length-1)-48;if(p<2||p>4)throw new a("","Invalid data type for attribute "+E+": "+A);f(y,v,h,u,p,b,E)}else throw new a("","Unknown data type for attribute "+E+": "+A);break}}return b}},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 i=o>>r-1;return(o^i)-i},e.min=function(o,i){return i^(o^i)&-(o<i)},e.max=function(o,i){return o^(o^i)&-(o<i)},e.isPow2=function(o){return!(o&o-1)&&!!o},e.log2=function(o){var i,s;return i=(o>65535)<<4,o>>>=i,s=(o>255)<<3,o>>>=s,i|=s,s=(o>15)<<2,o>>>=s,i|=s,s=(o>3)<<1,o>>>=s,i|=s,i|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 a(o){var i=32;return o&=-o,o&&i--,o&65535&&(i-=16),o&16711935&&(i-=8),o&252645135&&(i-=4),o&858993459&&(i-=2),o&1431655765&&(i-=1),i}e.countTrailingZeros=a,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 i=0;i<256;++i){var s=i,f=i,x=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--x;o[i]=f<<x&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,i){return o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,o|i<<1},e.deinterleave2=function(o,i){return o=o>>>i&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,i,s){return o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,o|=i<<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,i){return o=o>>>i&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 i=o|o-1;return i+1|(~i&-~i)-1>>>a(o)+1}},8866:function(t){function e(r,a,n){this.shortMessage=a||"",this.longMessage=n||"",this.rawError=r||"",this.message="gl-shader: "+(a||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 a=r(2478),n=r(3250)[3],o=0,i=1,s=2;t.exports=C;function f(M,E,A,h,p){this.a=M,this.b=E,this.idx=A,this.lowerIds=h,this.upperIds=p}function x(M,E,A,h){this.a=M,this.b=E,this.type=A,this.idx=h}function y(M,E){var A=M.a[0]-E.a[0]||M.a[1]-E.a[1]||M.type-E.type;return A||M.type!==o&&(A=n(M.a,M.b,E.b),A)?A:M.idx-E.idx}function v(M,E){return n(M.a,M.b,E)}function T(M,E,A,h,p){for(var k=a.lt(E,h,v),w=a.gt(E,h,v),R=k;R<w;++R){for(var O=E[R],N=O.lowerIds,V=N.length;V>1&&n(A[N[V-2]],A[N[V-1]],h)>0;)M.push([N[V-1],N[V-2],p]),V-=1;N.length=V,N.push(p);for(var H=O.upperIds,V=H.length;V>1&&n(A[H[V-2]],A[H[V-1]],h)<0;)M.push([H[V-2],H[V-1],p]),V-=1;H.length=V,H.push(p)}}function u(M,E){var A;return M.a[0]<E.a[0]?A=n(M.a,M.b,E.a):A=n(E.b,E.a,M.a),A||(E.b[0]<M.b[0]?A=n(M.a,M.b,E.b):A=n(E.b,E.a,M.b),A||M.idx-E.idx)}function b(M,E,A){var h=a.le(M,A,u),p=M[h],k=p.upperIds,w=k[k.length-1];p.upperIds=[w],M.splice(h+1,0,new f(A.a,A.b,A.idx,[w],k))}function _(M,E,A){var h=A.a;A.a=A.b,A.b=h;var p=a.eq(M,A,u),k=M[p],w=M[p-1];w.upperIds=k.upperIds,M.splice(p,1)}function C(M,E){for(var A=M.length,h=E.length,p=[],k=0;k<A;++k)p.push(new x(M[k],null,o,k));for(var k=0;k<h;++k){var w=E[k],R=M[w[0]],O=M[w[1]];R[0]<O[0]?p.push(new x(R,O,s,k),new x(O,R,i,k)):R[0]>O[0]&&p.push(new x(O,R,s,k),new x(R,O,i,k))}p.sort(y);for(var N=p[0].a[0]-(1+Math.abs(p[0].a[0]))*Math.pow(2,-52),V=[new f([N,1],[N,0],-1,[],[])],H=[],k=0,F=p.length;k<F;++k){var U=p[k],W=U.type;W===o?T(H,V,M,U.a,U.idx):W===s?b(V,M,U):_(V,M,U)}return H}},8954:function(t,e,r){t.exports=u;var a=r(3250),n=r(6803).Fw;function o(b,_,C){this.vertices=b,this.adjacent=_,this.boundary=C,this.lastVisited=-1}o.prototype.flip=function(){var b=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=b;var _=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=_};function i(b,_,C){this.vertices=b,this.cell=_,this.index=C}function s(b,_){return n(b.vertices,_.vertices)}function f(b){return function(){var _=this.tuple;return b.apply(this,_)}}function x(b){var _=a[b+1];return _||(_=a),f(_)}var y=[];function v(b,_,C){this.dimension=b,this.vertices=_,this.simplices=C,this.interior=C.filter(function(A){return!A.boundary}),this.tuple=new Array(b+1);for(var M=0;M<=b;++M)this.tuple[M]=this.vertices[M];var E=y[b];E||(E=y[b]=x(b)),this.orient=E}var T=v.prototype;T.handleBoundaryDegeneracy=function(b,_){var C=this.dimension,M=this.vertices.length-1,E=this.tuple,A=this.vertices,h=[b];for(b.lastVisited=-M;h.length>0;){b=h.pop();for(var p=b.adjacent,k=0;k<=C;++k){var w=p[k];if(!(!w.boundary||w.lastVisited<=-M)){for(var R=w.vertices,O=0;O<=C;++O){var N=R[O];N<0?E[O]=_:E[O]=A[N]}var V=this.orient();if(V>0)return w;w.lastVisited=-M,V===0&&h.push(w)}}}return null},T.walk=function(b,_){var C=this.vertices.length-1,M=this.dimension,E=this.vertices,A=this.tuple,h=_?this.interior.length*Math.random()|0:this.interior.length-1,p=this.interior[h];t:for(;!p.boundary;){for(var k=p.vertices,w=p.adjacent,R=0;R<=M;++R)A[R]=E[k[R]];p.lastVisited=C;for(var R=0;R<=M;++R){var O=w[R];if(!(O.lastVisited>=C)){var N=A[R];A[R]=b;var V=this.orient();if(A[R]=N,V<0){p=O;continue t}else O.boundary?O.lastVisited=-C:O.lastVisited=C}}return}return p},T.addPeaks=function(b,_){var C=this.vertices.length-1,M=this.dimension,E=this.vertices,A=this.tuple,h=this.interior,p=this.simplices,k=[_];_.lastVisited=C,_.vertices[_.vertices.indexOf(-1)]=C,_.boundary=!1,h.push(_);for(var w=[];k.length>0;){var _=k.pop(),R=_.vertices,O=_.adjacent,N=R.indexOf(C);if(!(N<0)){for(var V=0;V<=M;++V)if(V!==N){var H=O[V];if(!(!H.boundary||H.lastVisited>=C)){var F=H.vertices;if(H.lastVisited!==-C){for(var U=0,W=0;W<=M;++W)F[W]<0?(U=W,A[W]=b):A[W]=E[F[W]];var q=this.orient();if(q>0){F[U]=C,H.boundary=!1,h.push(H),k.push(H),H.lastVisited=C;continue}else H.lastVisited=-C}var X=H.adjacent,lt=R.slice(),yt=O.slice(),pt=new o(lt,yt,!0);p.push(pt);var st=X.indexOf(_);if(!(st<0)){X[st]=pt,yt[N]=H,lt[V]=-1,yt[V]=_,O[V]=pt,pt.flip();for(var W=0;W<=M;++W){var tt=lt[W];if(!(tt<0||tt===C)){for(var dt=new Array(M-1),rt=0,at=0;at<=M;++at){var vt=lt[at];vt<0||at===W||(dt[rt++]=vt)}w.push(new i(dt,pt,W))}}}}}}}w.sort(s);for(var V=0;V+1<w.length;V+=2){var it=w[V],Y=w[V+1],ft=it.index,ut=Y.index;ft<0||ut<0||(it.cell.adjacent[it.index]=Y.cell,Y.cell.adjacent[Y.index]=it.cell)}},T.insert=function(b,_){var C=this.vertices;C.push(b);var M=this.walk(b,_);if(M){for(var E=this.dimension,A=this.tuple,h=0;h<=E;++h){var p=M.vertices[h];p<0?A[h]=b:A[h]=C[p]}var k=this.orient(A);k<0||k===0&&(M=this.handleBoundaryDegeneracy(M,b),!M)||this.addPeaks(b,M)}},T.boundary=function(){for(var b=this.dimension,_=[],C=this.simplices,M=C.length,E=0;E<M;++E){var A=C[E];if(A.boundary){for(var h=new Array(b),p=A.vertices,k=0,w=0,R=0;R<=b;++R)p[R]>=0?h[k++]=p[R]:w=R&1;if(w===(b&1)){var O=h[0];h[0]=h[1],h[1]=O}_.push(h)}}return _};function u(b,_){var C=b.length;if(C===0)throw new Error("Must have at least d+1 points");var M=b[0].length;if(C<=M)throw new Error("Must input at least d+1 points");var E=b.slice(0,M+1),A=a.apply(void 0,E);if(A===0)throw new Error("Input not in general position");for(var h=new Array(M+1),p=0;p<=M;++p)h[p]=p;A<0&&(h[0]=1,h[1]=0);for(var k=new o(h,new Array(M+1),!1),w=k.adjacent,R=new Array(M+2),p=0;p<=M;++p){for(var O=h.slice(),N=0;N<=M;++N)N===p&&(O[N]=-1);var V=O[0];O[0]=O[1],O[1]=V;var H=new o(O,new Array(M+1),!0);w[p]=H,R[p]=H}R[M+1]=k;for(var p=0;p<=M;++p)for(var O=w[p].vertices,F=w[p].adjacent,N=0;N<=M;++N){var U=O[N];if(U<0){F[N]=k;continue}for(var W=0;W<=M;++W)w[W].vertices.indexOf(U)<0&&(F[N]=w[W])}for(var q=new v(M,E,R),X=!!_,p=M+1;p<C;++p)q.insert(b[p],X);return q.boundary()}},8987:function(t,e,r){var a=r(7842),n=r(6504);t.exports=o;function o(i,s){for(var f=a(s),x=i.length,y=new Array(x),v=0;v<x;++v)y[v]=n(i[v],f);return y}},9060:function(t,e,r){var a=r(9405),n=r(2762),o=r(8116),i=r(7766),s=r(6760),f=r(7608),x=r(9618),y=r(6729),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(A,h,p,k,w,R,O,N,V,H,F){this.gl=A,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=h,this.dirty=!0,this.triShader=p,this.pickShader=k,this.trianglePositions=w,this.triangleVectors=R,this.triangleColors=N,this.triangleUVs=V,this.triangleIds=O,this.triangleVAO=H,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=F,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=v,this._view=v,this._projection=v,this._resolution=[1,1]}var u=T.prototype;u.isOpaque=function(){return this.opacity>=1},u.isTransparent=function(){return this.opacity<1},u.pickSlots=1,u.setPickBase=function(A){this.pickId=A};function b(A){for(var h=y({colormap:A,nshades:256,format:"rgba"}),p=new Uint8Array(1024),k=0;k<256;++k){for(var w=h[k],R=0;R<3;++R)p[4*k+R]=w[R];p[4*k+3]=w[3]*255}return x(p,[256,256,4],[4,0,1])}function _(A){for(var h=A.length,p=new Array(h),k=0;k<h;++k)p[k]=A[k][2];return p}u.update=function(A){A=A||{};var h=this.gl;this.dirty=!0,"lightPosition"in A&&(this.lightPosition=A.lightPosition),"opacity"in A&&(this.opacity=A.opacity),"ambient"in A&&(this.ambientLight=A.ambient),"diffuse"in A&&(this.diffuseLight=A.diffuse),"specular"in A&&(this.specularLight=A.specular),"roughness"in A&&(this.roughness=A.roughness),"fresnel"in A&&(this.fresnel=A.fresnel),A.tubeScale!==void 0&&(this.tubeScale=A.tubeScale),A.vectorScale!==void 0&&(this.vectorScale=A.vectorScale),A.coneScale!==void 0&&(this.coneScale=A.coneScale),A.coneOffset!==void 0&&(this.coneOffset=A.coneOffset),A.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=h.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=h.LINEAR,this.texture.setPixels(b(A.colormap)),this.texture.generateMipmap());var p=A.cells,k=A.positions,w=A.vectors;if(!(!k||!p||!w)){var R=[],O=[],N=[],V=[],H=[];this.cells=p,this.positions=k,this.vectors=w;var F=A.meshColor||[1,1,1,1],U=A.vertexIntensity,W=1/0,q=-1/0;if(U)if(A.vertexIntensityBounds)W=+A.vertexIntensityBounds[0],q=+A.vertexIntensityBounds[1];else for(var X=0;X<U.length;++X){var lt=U[X];W=Math.min(W,lt),q=Math.max(q,lt)}else for(var X=0;X<k.length;++X){var lt=k[X][2];W=Math.min(W,lt),q=Math.max(q,lt)}U?this.intensity=U:this.intensity=_(k),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var X=0;X<k.length;++X)for(var yt=k[X],pt=0;pt<3;++pt)isNaN(yt[pt])||!isFinite(yt[pt])||(this.bounds[0][pt]=Math.min(this.bounds[0][pt],yt[pt]),this.bounds[1][pt]=Math.max(this.bounds[1][pt],yt[pt]));var st=0;t:for(var X=0;X<p.length;++X){var tt=p[X];switch(tt.length){case 3:for(var pt=0;pt<3;++pt)for(var dt=tt[pt],yt=k[dt],rt=0;rt<3;++rt)if(isNaN(yt[rt])||!isFinite(yt[rt]))continue t;for(var pt=0;pt<3;++pt){var dt=tt[2-pt],yt=k[dt];R.push(yt[0],yt[1],yt[2],yt[3]);var at=w[dt];O.push(at[0],at[1],at[2],at[3]||0);var vt=F;vt.length===3?N.push(vt[0],vt[1],vt[2],1):N.push(vt[0],vt[1],vt[2],vt[3]);var it;U?it=[(U[dt]-W)/(q-W),0]:it=[(yt[2]-W)/(q-W),0],V.push(it[0],it[1]),H.push(X)}st+=1;break}}this.triangleCount=st,this.trianglePositions.update(R),this.triangleVectors.update(O),this.triangleColors.update(N),this.triangleUVs.update(V),this.triangleIds.update(new Uint32Array(H))}},u.drawTransparent=u.draw=function(A){A=A||{};for(var h=this.gl,p=A.model||v,k=A.view||v,w=A.projection||v,R=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],O=0;O<3;++O)R[0][O]=Math.max(R[0][O],this.clipBounds[0][O]),R[1][O]=Math.min(R[1][O],this.clipBounds[1][O]);var N={model:p,view:k,projection:w,inverseModel:v.slice(),clipBounds:R,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};N.inverseModel=f(N.inverseModel,N.model),h.disable(h.CULL_FACE),this.texture.bind(0);var V=new Array(16);s(V,N.view,N.model),s(V,N.projection,V),f(V,V);for(var O=0;O<3;++O)N.eyePosition[O]=V[12+O]/V[15];for(var H=V[15],O=0;O<3;++O)H+=this.lightPosition[O]*V[4*O+3];for(var O=0;O<3;++O){for(var F=V[12+O],U=0;U<3;++U)F+=V[4*U+O]*this.lightPosition[U];N.lightPosition[O]=F/H}if(this.triangleCount>0){var W=this.triShader;W.bind(),W.uniforms=N,this.triangleVAO.bind(),h.drawArrays(h.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},u.drawPick=function(A){A=A||{};for(var h=this.gl,p=A.model||v,k=A.view||v,w=A.projection||v,R=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],O=0;O<3;++O)R[0][O]=Math.max(R[0][O],this.clipBounds[0][O]),R[1][O]=Math.min(R[1][O],this.clipBounds[1][O]);this._model=[].slice.call(p),this._view=[].slice.call(k),this._projection=[].slice.call(w),this._resolution=[h.drawingBufferWidth,h.drawingBufferHeight];var N={model:p,view:k,projection:w,clipBounds:R,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},V=this.pickShader;V.bind(),V.uniforms=N,this.triangleCount>0&&(this.triangleVAO.bind(),h.drawArrays(h.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},u.pick=function(A){if(!A||A.id!==this.pickId)return null;var h=A.value[0]+256*A.value[1]+65536*A.value[2],p=this.cells[h],k=this.positions[p[1]].slice(0,3),w={position:k,dataCoordinate:k,index:Math.floor(p[1]/48)};return this.traceType==="cone"?w.index=Math.floor(p[1]/48):this.traceType==="streamtube"&&(w.intensity=this.intensity[p[1]],w.velocity=this.vectors[p[1]].slice(0,3),w.divergence=this.vectors[p[1]][3],w.index=h),w},u.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 C(A,h){var p=a(A,h.meshShader.vertex,h.meshShader.fragment,null,h.meshShader.attributes);return p.attributes.position.location=0,p.attributes.color.location=2,p.attributes.uv.location=3,p.attributes.vector.location=4,p}function M(A,h){var p=a(A,h.pickShader.vertex,h.pickShader.fragment,null,h.pickShader.attributes);return p.attributes.position.location=0,p.attributes.id.location=1,p.attributes.vector.location=4,p}function E(A,h,p){var k=p.shaders;arguments.length===1&&(h=A,A=h.gl);var w=C(A,k),R=M(A,k),O=i(A,x(new Uint8Array([255,255,255,255]),[1,1,4]));O.generateMipmap(),O.minFilter=A.LINEAR_MIPMAP_LINEAR,O.magFilter=A.LINEAR;var N=n(A),V=n(A),H=n(A),F=n(A),U=n(A),W=o(A,[{buffer:N,type:A.FLOAT,size:4},{buffer:U,type:A.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:H,type:A.FLOAT,size:4},{buffer:F,type:A.FLOAT,size:2},{buffer:V,type:A.FLOAT,size:4}]),q=new T(A,O,w,R,N,V,U,H,F,W,p.traceType||"cone");return q.update(h),q}t.exports=E},9127:function(t,e,r){t.exports=o;var a=r(6204),n=r(5771);function o(i){return n(a(i))}},9131:function(t,e,r){var a=r(5177),n=r(9288);t.exports=o;function o(i,s){return s=s||1,i[0]=Math.random(),i[1]=Math.random(),i[2]=Math.random(),i[3]=Math.random(),a(i,i),n(i,i,s),i}},9165:function(t,e,r){t.exports=T;var a=r(2762),n=r(8116),o=r(3436),i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(u,b,_,C){this.gl=u,this.shader=C,this.buffer=b,this.vao=_,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(u){var b=this.gl,_=this.shader.uniforms;this.shader.bind();var C=_.view=u.view||i,M=_.projection=u.projection||i;_.model=u.model||i,_.clipBounds=this.clipBounds,_.opacity=this.opacity;var E=C[12],A=C[13],h=C[14],p=C[15],k=u._ortho||!1,w=k?2:1,R=w*this.pixelRatio*(M[3]*E+M[7]*A+M[11]*h+M[15]*p)/b.drawingBufferHeight;this.vao.bind();for(var O=0;O<3;++O)b.lineWidth(this.lineWidth[O]*this.pixelRatio),_.capSize=this.capSize[O]*R,this.lineCount[O]&&b.drawArrays(b.LINES,this.lineOffset[O],this.lineCount[O]);this.vao.unbind()};function x(u,b){for(var _=0;_<3;++_)u[0][_]=Math.min(u[0][_],b[_]),u[1][_]=Math.max(u[1][_],b[_])}var y=function(){for(var u=new Array(3),b=0;b<3;++b){for(var _=[],C=1;C<=2;++C)for(var M=-1;M<=1;M+=2){var E=(C+b)%3,A=[0,0,0];A[E]=M,_.push(A)}u[b]=_}return u}();function v(u,b,_,C){for(var M=y[C],E=0;E<M.length;++E){var A=M[E];u.push(b[0],b[1],b[2],_[0],_[1],_[2],_[3],A[0],A[1],A[2])}return M.length}f.update=function(u){u=u||{},"lineWidth"in u&&(this.lineWidth=u.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in u&&(this.capSize=u.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),this.hasAlpha=!1,"opacity"in u&&(this.opacity=+u.opacity,this.opacity<1&&(this.hasAlpha=!0));var b=u.color||[[0,0,0],[0,0,0],[0,0,0]],_=u.position,C=u.error;if(Array.isArray(b[0])||(b=[b,b,b]),_&&C){var M=[],E=_.length,A=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var h=0;h<3;++h){this.lineOffset[h]=A;t:for(var p=0;p<E;++p){for(var k=_[p],w=0;w<3;++w)if(isNaN(k[w])||!isFinite(k[w]))continue t;var R=C[p],O=b[h];if(Array.isArray(O[0])&&(O=b[p]),O.length===3?O=[O[0],O[1],O[2],1]:O.length===4&&(O=[O[0],O[1],O[2],O[3]],!this.hasAlpha&&O[3]<1&&(this.hasAlpha=!0)),!(isNaN(R[0][h])||isNaN(R[1][h]))){if(R[0][h]<0){var N=k.slice();N[h]+=R[0][h],M.push(k[0],k[1],k[2],O[0],O[1],O[2],O[3],0,0,0,N[0],N[1],N[2],O[0],O[1],O[2],O[3],0,0,0),x(this.bounds,N),A+=2+v(M,N,O,h)}if(R[1][h]>0){var N=k.slice();N[h]+=R[1][h],M.push(k[0],k[1],k[2],O[0],O[1],O[2],O[3],0,0,0,N[0],N[1],N[2],O[0],O[1],O[2],O[3],0,0,0),x(this.bounds,N),A+=2+v(M,N,O,h)}}}this.lineCount[h]=A-this.lineOffset[h]}this.buffer.update(M)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(u){var b=u.gl,_=a(b),C=n(b,[{buffer:_,type:b.FLOAT,size:3,offset:0,stride:40},{buffer:_,type:b.FLOAT,size:4,offset:12,stride:40},{buffer:_,type:b.FLOAT,size:3,offset:28,stride:40}]),M=o(b);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.offset.location=2;var E=new s(b,_,C,M);return E.update(u),E}},9215:function(t,e,r){t.exports=x;var a=r(4769),n=r(2478);function o(y,v,T){return Math.min(v,Math.max(y,T))}function i(y,v,T){this.dimension=y.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var u=0;u<this.dimension;++u)this.bounds[0][u]=-1/0,this.bounds[1][u]=1/0;this._state=y.slice().reverse(),this._velocity=v.slice().reverse(),this._time=[T],this._scratch=[y.slice(),y.slice(),y.slice(),y.slice(),y.slice()]}var s=i.prototype;s.flush=function(y){var v=n.gt(this._time,y)-1;v<=0||(this._time.splice(0,v),this._state.splice(0,v*this.dimension),this._velocity.splice(0,v*this.dimension))},s.curve=function(y){var v=this._time,T=v.length,u=n.le(v,y),b=this._scratch[0],_=this._state,C=this._velocity,M=this.dimension,E=this.bounds;if(u<0)for(var A=M-1,h=0;h<M;++h,--A)b[h]=_[A];else if(u>=T-1)for(var A=_.length-1,p=y-v[T-1],h=0;h<M;++h,--A)b[h]=_[A]+p*C[A];else{for(var A=M*(u+1)-1,k=v[u],w=v[u+1],R=w-k||1,O=this._scratch[1],N=this._scratch[2],V=this._scratch[3],H=this._scratch[4],F=!0,h=0;h<M;++h,--A)O[h]=_[A],V[h]=C[A]*R,N[h]=_[A+M],H[h]=C[A+M]*R,F=F&&O[h]===N[h]&&V[h]===H[h]&&V[h]===0;if(F)for(var h=0;h<M;++h)b[h]=O[h];else a(O,V,N,H,(y-k)/R,b)}for(var U=E[0],W=E[1],h=0;h<M;++h)b[h]=o(U[h],W[h],b[h]);return b},s.dcurve=function(y){var v=this._time,T=v.length,u=n.le(v,y),b=this._scratch[0],_=this._state,C=this._velocity,M=this.dimension;if(u>=T-1)for(var E=_.length-1,A=y-v[T-1],h=0;h<M;++h,--E)b[h]=C[E];else{for(var E=M*(u+1)-1,p=v[u],k=v[u+1],w=k-p||1,R=this._scratch[1],O=this._scratch[2],N=this._scratch[3],V=this._scratch[4],H=!0,h=0;h<M;++h,--E)R[h]=_[E],N[h]=C[E]*w,O[h]=_[E+M],V[h]=C[E+M]*w,H=H&&R[h]===O[h]&&N[h]===V[h]&&N[h]===0;if(H)for(var h=0;h<M;++h)b[h]=0;else{a.derivative(R,N,O,V,(y-p)/w,b);for(var h=0;h<M;++h)b[h]/=w}}return b},s.lastT=function(){var y=this._time;return y[y.length-1]},s.stable=function(){for(var y=this._velocity,v=y.length,T=this.dimension-1;T>=0;--T)if(y[--v])return!1;return!0},s.jump=function(y){var v=this.lastT(),T=this.dimension;if(!(y<v||arguments.length!==T+1)){var u=this._state,b=this._velocity,_=u.length-this.dimension,C=this.bounds,M=C[0],E=C[1];this._time.push(v,y);for(var A=0;A<2;++A)for(var h=0;h<T;++h)u.push(u[_++]),b.push(0);this._time.push(y);for(var h=T;h>0;--h)u.push(o(M[h-1],E[h-1],arguments[h])),b.push(0)}},s.push=function(y){var v=this.lastT(),T=this.dimension;if(!(y<v||arguments.length!==T+1)){var u=this._state,b=this._velocity,_=u.length-this.dimension,C=y-v,M=this.bounds,E=M[0],A=M[1],h=C>1e-6?1/C:0;this._time.push(y);for(var p=T;p>0;--p){var k=o(E[p-1],A[p-1],arguments[p]);u.push(k),b.push((k-u[_++])*h)}}},s.set=function(y){var v=this.dimension;if(!(y<this.lastT()||arguments.length!==v+1)){var T=this._state,u=this._velocity,b=this.bounds,_=b[0],C=b[1];this._time.push(y);for(var M=v;M>0;--M)T.push(o(_[M-1],C[M-1],arguments[M])),u.push(0)}},s.move=function(y){var v=this.lastT(),T=this.dimension;if(!(y<=v||arguments.length!==T+1)){var u=this._state,b=this._velocity,_=u.length-this.dimension,C=this.bounds,M=C[0],E=C[1],A=y-v,h=A>1e-6?1/A:0;this._time.push(y);for(var p=T;p>0;--p){var k=arguments[p];u.push(o(M[p-1],E[p-1],u[_++]+k)),b.push(k*h)}}},s.idle=function(y){var v=this.lastT();if(!(y<v)){var T=this.dimension,u=this._state,b=this._velocity,_=u.length-T,C=this.bounds,M=C[0],E=C[1],A=y-v;this._time.push(y);for(var h=T-1;h>=0;--h)u.push(o(M[h],E[h],u[_]+A*b[_])),b.push(0),_+=1}};function f(y){for(var v=new Array(y),T=0;T<y;++T)v[T]=0;return v}function x(y,v,T){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if(typeof y=="number"){var u=f(y);return new i(u,u,0)}else return new i(y,f(y.length),0);case 2:if(typeof v=="number"){var u=f(y.length);return new i(y,u,+v)}else T=0;case 3:if(y.length!==v.length)throw new Error("state and velocity lengths must match");return new i(y,v,T)}}},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/,a=/android|ipad|playbook|silk/i;function n(o){o||(o={});var i=o.ua;if(!i&&typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&typeof i.headers["user-agent"]=="string"&&(i=i.headers["user-agent"]),typeof i!="string")return!1;var s=e.test(i)&&!r.test(i)||!!o.tablet&&a.test(i);return!s&&o.tablet&&o.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf("Macintosh")!==-1&&i.indexOf("Safari")!==-1&&(s=!0),s}},9226:function(t){t.exports=e;function e(r,a){return r[0]=Math.ceil(a[0]),r[1]=Math.ceil(a[1]),r[2]=Math.ceil(a[2]),r}},9265:function(t){t.exports=e;function e(r,a){return r[0]===a[0]&&r[1]===a[1]&&r[2]===a[2]}},9288:function(t){t.exports=e;function e(r,a,n){return r[0]=a[0]*n,r[1]=a[1]*n,r[2]=a[2]*n,r[3]=a[3]*n,r}},9346:function(t){var e=new Float64Array(4),r=new Float64Array(4),a=new Float64Array(4);function n(o,i,s,f,x){e.length<f.length&&(e=new Float64Array(f.length),r=new Float64Array(f.length),a=new Float64Array(f.length));for(var y=0;y<f.length;++y)e[y]=o[y]-f[y],r[y]=i[y]-o[y],a[y]=s[y]-o[y];for(var v=0,T=0,u=0,b=0,_=0,C=0,y=0;y<f.length;++y){var M=r[y],E=a[y],A=e[y];v+=M*M,T+=M*E,u+=E*E,b+=A*M,_+=A*E,C+=A*A}var h=Math.abs(v*u-T*T),p=T*_-u*b,k=T*b-v*_,w;if(p+k<=h)if(p<0)k<0&&b<0?(k=0,-b>=v?(p=1,w=v+2*b+C):(p=-b/v,w=b*p+C)):(p=0,_>=0?(k=0,w=C):-_>=u?(k=1,w=u+2*_+C):(k=-_/u,w=_*k+C));else if(k<0)k=0,b>=0?(p=0,w=C):-b>=v?(p=1,w=v+2*b+C):(p=-b/v,w=b*p+C);else{var R=1/h;p*=R,k*=R,w=p*(v*p+T*k+2*b)+k*(T*p+u*k+2*_)+C}else{var O,N,V,H;p<0?(O=T+b,N=u+_,N>O?(V=N-O,H=v-2*T+u,V>=H?(p=1,k=0,w=v+2*b+C):(p=V/H,k=1-p,w=p*(v*p+T*k+2*b)+k*(T*p+u*k+2*_)+C)):(p=0,N<=0?(k=1,w=u+2*_+C):_>=0?(k=0,w=C):(k=-_/u,w=_*k+C))):k<0?(O=T+_,N=v+b,N>O?(V=N-O,H=v-2*T+u,V>=H?(k=1,p=0,w=u+2*_+C):(k=V/H,p=1-k,w=p*(v*p+T*k+2*b)+k*(T*p+u*k+2*_)+C)):(k=0,N<=0?(p=1,w=v+2*b+C):b>=0?(p=0,w=C):(p=-b/v,w=b*p+C))):(V=u+_-T-b,V<=0?(p=0,k=1,w=u+2*_+C):(H=v-2*T+u,V>=H?(p=1,k=0,w=v+2*b+C):(p=V/H,k=1-p,w=p*(v*p+T*k+2*b)+k*(T*p+u*k+2*_)+C)))}for(var F=1-p-k,y=0;y<f.length;++y)x[y]=F*o[y]+p*i[y]+k*s[y];return w<0?0:w}t.exports=n},9362:function(t){t.exports=e;function e(r,a,n){var o=r+a,i=o-r,s=o-i,f=a-i,x=r-s;return n?(n[0]=x+f,n[1]=o,n):[x+f,o]}},9366:function(t,e,r){var a=r(4359);t.exports=o;var n={};function o(i,s,f){var x=[s.style,s.weight,s.variant,s.family].join("_"),y=n[x];if(y||(y=n[x]={}),i in y)return y[i];var v={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}};v.triangles=!0;var T=a(i,v);v.triangles=!1;var u=a(i,v),b,_;if(f&&f!==1){for(b=0;b<T.positions.length;++b)for(_=0;_<T.positions[b].length;++_)T.positions[b][_]/=f;for(b=0;b<u.positions.length;++b)for(_=0;_<u.positions[b].length;++_)u.positions[b][_]/=f}var C=[[1/0,1/0],[-1/0,-1/0]],M=u.positions.length;for(b=0;b<M;++b){var E=u.positions[b];for(_=0;_<2;++_)C[0][_]=Math.min(C[0][_],E[_]),C[1][_]=Math.max(C[1][_],E[_])}return y[i]=[T,u,C]}},9405:function(t,e,r){var a=r(3327),n=r(8731),o=r(216),i=r(5091),s=r(2145),f=r(8866);function x(u){this.gl=u,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var y=x.prototype;y.bind=function(){this.program||this._relink();var u,b=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),_=this.gl.lastAttribCount;if(b>_)for(u=_;u<b;u++)this.gl.enableVertexAttribArray(u);else if(_>b)for(u=b;u<_;u++)this.gl.disableVertexAttribArray(u);this.gl.lastAttribCount=b,this.gl.useProgram(this.program)},y.dispose=function(){for(var u=this.gl.lastAttribCount,b=0;b<u;b++)this.gl.disableVertexAttribArray(b);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 v(u,b){return u.name<b.name?-1:1}y.update=function(u,b,_,C){if(!b||arguments.length===1){var M=u;u=M.vertex,b=M.fragment,_=M.uniforms,C=M.attributes}var E=this,A=E.gl,h=E._vref;E._vref=i.shader(A,A.VERTEX_SHADER,u),h&&h.dispose(),E.vertShader=E._vref.shader;var p=this._fref;if(E._fref=i.shader(A,A.FRAGMENT_SHADER,b),p&&p.dispose(),E.fragShader=E._fref.shader,!_||!C){var k=A.createProgram();if(A.attachShader(k,E.fragShader),A.attachShader(k,E.vertShader),A.linkProgram(k),!A.getProgramParameter(k,A.LINK_STATUS)){var w=A.getProgramInfoLog(k);throw new f(w,"Error linking program:"+w)}_=_||s.uniforms(A,k),C=C||s.attributes(A,k),A.deleteProgram(k)}C=C.slice(),C.sort(v);var R=[],O=[],N=[],V;for(V=0;V<C.length;++V){var H=C[V];if(H.type.indexOf("mat")>=0){for(var F=H.type.charAt(H.type.length-1)|0,U=new Array(F),W=0;W<F;++W)U[W]=N.length,O.push(H.name+"["+W+"]"),typeof H.location=="number"?N.push(H.location+W):Array.isArray(H.location)&&H.location.length===F&&typeof H.location[W]=="number"?N.push(H.location[W]|0):N.push(-1);R.push({name:H.name,type:H.type,locations:U})}else R.push({name:H.name,type:H.type,locations:[N.length]}),O.push(H.name),typeof H.location=="number"?N.push(H.location|0):N.push(-1)}var q=0;for(V=0;V<N.length;++V)if(N[V]<0){for(;N.indexOf(q)>=0;)q+=1;N[V]=q}var X=new Array(_.length);function lt(){E.program=i.program(A,E._vref,E._fref,O,N);for(var yt=0;yt<_.length;++yt)X[yt]=A.getUniformLocation(E.program,_[yt].name)}lt(),E._relink=lt,E.types={uniforms:o(_),attributes:o(C)},E.attributes=n(A,E,R,N),Object.defineProperty(E,"uniforms",a(A,E,_,X))};function T(u,b,_,C,M){var E=new x(u);return E.update(b,_,C,M),E}t.exports=T},9499:function(t,e,r){t.exports=vt;var a=r(8828),n=r(2762),o=r(8116),i=r(7766),s=r(1888),f=r(6729),x=r(5298),y=r(9994),v=r(9618),T=r(3711),u=r(6760),b=r(7608),_=r(2478),C=r(6199),M=r(990),E=M.createShader,A=M.createContourShader,h=M.createPickShader,p=M.createPickContourShader,k=40,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],R=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],O=[[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 it=0;it<3;++it){var Y=O[it],ft=(it+1)%3,ut=(it+2)%3;Y[ft+0]=1,Y[ut+3]=1,Y[it+6]=1}})();function N(it,Y,ft,ut,wt){this.position=it,this.index=Y,this.uv=ft,this.level=ut,this.dataCoordinate=wt}var V=256;function H(it,Y,ft,ut,wt,zt,Pt,Wt,Ht,Jt,ge,he,de,se,Tt){this.gl=it,this.shape=Y,this.bounds=ft,this.objectOffset=Tt,this.intensityBounds=[],this._shader=ut,this._pickShader=wt,this._coordinateBuffer=zt,this._vao=Pt,this._colorMap=Wt,this._contourShader=Ht,this._contourPickShader=Jt,this._contourBuffer=ge,this._contourVAO=he,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new N([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=de,this._dynamicVAO=se,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=[v(s.mallocFloat(1024),[0,0]),v(s.mallocFloat(1024),[0,0]),v(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 F=H.prototype;F.genColormap=function(it,Y){var ft=!1,ut=y([f({colormap:it,nshades:V,format:"rgba"}).map(function(wt,zt){var Pt=Y?U(zt/255,Y):wt[3];return Pt<1&&(ft=!0),[wt[0],wt[1],wt[2],255*Pt]})]);return x.divseq(ut,255),this.hasAlphaScale=ft,ut},F.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},F.isOpaque=function(){return!this.isTransparent()},F.pickSlots=1,F.setPickBase=function(it){this.pickId=it};function U(it,Y){if(!Y||!Y.length)return 1;for(var ft=0;ft<Y.length;++ft){if(Y.length<2)return 1;if(Y[ft][0]===it)return Y[ft][1];if(Y[ft][0]>it&&ft>0){var ut=(Y[ft][0]-it)/(Y[ft][0]-Y[ft-1][0]);return Y[ft][1]*(1-ut)+ut*Y[ft-1][1]}}return 1}var W=[0,0,0],q={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function X(it,Y){var ft,ut,wt,zt=Y.axes&&Y.axes.lastCubeProps.axis||W,Pt=Y.showSurface,Wt=Y.showContour;for(ft=0;ft<3;++ft)for(Pt=Pt||Y.surfaceProject[ft],ut=0;ut<3;++ut)Wt=Wt||Y.contourProject[ft][ut];for(ft=0;ft<3;++ft){var Ht=q.projections[ft];for(ut=0;ut<16;++ut)Ht[ut]=0;for(ut=0;ut<4;++ut)Ht[5*ut]=1;Ht[5*ft]=0,Ht[12+ft]=Y.axesBounds[+(zt[ft]>0)][ft],u(Ht,it.model,Ht);var Jt=q.clipBounds[ft];for(wt=0;wt<2;++wt)for(ut=0;ut<3;++ut)Jt[wt][ut]=it.clipBounds[wt][ut];Jt[0][ft]=-1e8,Jt[1][ft]=1e8}return q.showSurface=Pt,q.showContour=Wt,q}var lt={model:w,view:w,projection:w,inverseModel:w.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},yt=w.slice(),pt=[1,0,0,0,1,0,0,0,1];function st(it,Y){it=it||{};var ft=this.gl;ft.disable(ft.CULL_FACE),this._colorMap.bind(0);var ut=lt;ut.model=it.model||w,ut.view=it.view||w,ut.projection=it.projection||w,ut.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],ut.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],ut.objectOffset=this.objectOffset,ut.contourColor=this.contourColor[0],ut.inverseModel=b(ut.inverseModel,ut.model);for(var wt=0;wt<2;++wt)for(var zt=ut.clipBounds[wt],Pt=0;Pt<3;++Pt)zt[Pt]=Math.min(Math.max(this.clipBounds[wt][Pt],-1e8),1e8);ut.kambient=this.ambientLight,ut.kdiffuse=this.diffuseLight,ut.kspecular=this.specularLight,ut.roughness=this.roughness,ut.fresnel=this.fresnel,ut.opacity=this.opacity,ut.height=0,ut.permutation=pt,ut.vertexColor=this.vertexColor;var Wt=yt;for(u(Wt,ut.view,ut.model),u(Wt,ut.projection,Wt),b(Wt,Wt),wt=0;wt<3;++wt)ut.eyePosition[wt]=Wt[12+wt]/Wt[15];var Ht=Wt[15];for(wt=0;wt<3;++wt)Ht+=this.lightPosition[wt]*Wt[4*wt+3];for(wt=0;wt<3;++wt){var Jt=Wt[12+wt];for(Pt=0;Pt<3;++Pt)Jt+=Wt[4*Pt+wt]*this.lightPosition[Pt];ut.lightPosition[wt]=Jt/Ht}var ge=X(ut,this);if(ge.showSurface){for(this._shader.bind(),this._shader.uniforms=ut,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ft.TRIANGLES,this._vertexCount),wt=0;wt<3;++wt)!this.surfaceProject[wt]||!this.vertexCount||(this._shader.uniforms.model=ge.projections[wt],this._shader.uniforms.clipBounds=ge.clipBounds[wt],this._vao.draw(ft.TRIANGLES,this._vertexCount));this._vao.unbind()}if(ge.showContour){var he=this._contourShader;ut.kambient=1,ut.kdiffuse=0,ut.kspecular=0,ut.opacity=1,he.bind(),he.uniforms=ut;var de=this._contourVAO;for(de.bind(),wt=0;wt<3;++wt)for(he.uniforms.permutation=O[wt],ft.lineWidth(this.contourWidth[wt]*this.pixelRatio),Pt=0;Pt<this.contourLevels[wt].length;++Pt)Pt===this.highlightLevel[wt]?(he.uniforms.contourColor=this.highlightColor[wt],he.uniforms.contourTint=this.highlightTint[wt]):(Pt===0||Pt-1===this.highlightLevel[wt])&&(he.uniforms.contourColor=this.contourColor[wt],he.uniforms.contourTint=this.contourTint[wt]),this._contourCounts[wt][Pt]&&(he.uniforms.height=this.contourLevels[wt][Pt],de.draw(ft.LINES,this._contourCounts[wt][Pt],this._contourOffsets[wt][Pt]));for(wt=0;wt<3;++wt)for(he.uniforms.model=ge.projections[wt],he.uniforms.clipBounds=ge.clipBounds[wt],Pt=0;Pt<3;++Pt)if(this.contourProject[wt][Pt]){he.uniforms.permutation=O[Pt],ft.lineWidth(this.contourWidth[Pt]*this.pixelRatio);for(var se=0;se<this.contourLevels[Pt].length;++se)se===this.highlightLevel[Pt]?(he.uniforms.contourColor=this.highlightColor[Pt],he.uniforms.contourTint=this.highlightTint[Pt]):(se===0||se-1===this.highlightLevel[Pt])&&(he.uniforms.contourColor=this.contourColor[Pt],he.uniforms.contourTint=this.contourTint[Pt]),this._contourCounts[Pt][se]&&(he.uniforms.height=this.contourLevels[Pt][se],de.draw(ft.LINES,this._contourCounts[Pt][se],this._contourOffsets[Pt][se]))}for(de.unbind(),de=this._dynamicVAO,de.bind(),wt=0;wt<3;++wt)if(this._dynamicCounts[wt]!==0)for(he.uniforms.model=ut.model,he.uniforms.clipBounds=ut.clipBounds,he.uniforms.permutation=O[wt],ft.lineWidth(this.dynamicWidth[wt]*this.pixelRatio),he.uniforms.contourColor=this.dynamicColor[wt],he.uniforms.contourTint=this.dynamicTint[wt],he.uniforms.height=this.dynamicLevel[wt],de.draw(ft.LINES,this._dynamicCounts[wt],this._dynamicOffsets[wt]),Pt=0;Pt<3;++Pt)this.contourProject[Pt][wt]&&(he.uniforms.model=ge.projections[Pt],he.uniforms.clipBounds=ge.clipBounds[Pt],de.draw(ft.LINES,this._dynamicCounts[wt],this._dynamicOffsets[wt]));de.unbind()}}F.draw=function(it){return st.call(this,it,!1)},F.drawTransparent=function(it){return st.call(this,it,!0)};var tt={model:w,view:w,projection:w,inverseModel:w,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]};F.drawPick=function(it){it=it||{};var Y=this.gl;Y.disable(Y.CULL_FACE);var ft=tt;ft.model=it.model||w,ft.view=it.view||w,ft.projection=it.projection||w,ft.shape=this._field[2].shape,ft.pickId=this.pickId/255,ft.lowerBound=this.bounds[0],ft.upperBound=this.bounds[1],ft.objectOffset=this.objectOffset,ft.permutation=pt;for(var ut=0;ut<2;++ut)for(var wt=ft.clipBounds[ut],zt=0;zt<3;++zt)wt[zt]=Math.min(Math.max(this.clipBounds[ut][zt],-1e8),1e8);var Pt=X(ft,this);if(Pt.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=ft,this._vao.bind(),this._vao.draw(Y.TRIANGLES,this._vertexCount),ut=0;ut<3;++ut)this.surfaceProject[ut]&&(this._pickShader.uniforms.model=Pt.projections[ut],this._pickShader.uniforms.clipBounds=Pt.clipBounds[ut],this._vao.draw(Y.TRIANGLES,this._vertexCount));this._vao.unbind()}if(Pt.showContour){var Wt=this._contourPickShader;Wt.bind(),Wt.uniforms=ft;var Ht=this._contourVAO;for(Ht.bind(),zt=0;zt<3;++zt)for(Y.lineWidth(this.contourWidth[zt]*this.pixelRatio),Wt.uniforms.permutation=O[zt],ut=0;ut<this.contourLevels[zt].length;++ut)this._contourCounts[zt][ut]&&(Wt.uniforms.height=this.contourLevels[zt][ut],Ht.draw(Y.LINES,this._contourCounts[zt][ut],this._contourOffsets[zt][ut]));for(ut=0;ut<3;++ut)for(Wt.uniforms.model=Pt.projections[ut],Wt.uniforms.clipBounds=Pt.clipBounds[ut],zt=0;zt<3;++zt)if(this.contourProject[ut][zt]){Wt.uniforms.permutation=O[zt],Y.lineWidth(this.contourWidth[zt]*this.pixelRatio);for(var Jt=0;Jt<this.contourLevels[zt].length;++Jt)this._contourCounts[zt][Jt]&&(Wt.uniforms.height=this.contourLevels[zt][Jt],Ht.draw(Y.LINES,this._contourCounts[zt][Jt],this._contourOffsets[zt][Jt]))}Ht.unbind()}},F.pick=function(it){if(!it||it.id!==this.pickId)return null;var Y=this._field[2].shape,ft=this._pickResult,ut=Y[0]*(it.value[0]+(it.value[2]>>4)/16)/255,wt=Math.floor(ut),zt=ut-wt,Pt=Y[1]*(it.value[1]+(it.value[2]&15)/16)/255,Wt=Math.floor(Pt),Ht=Pt-Wt;wt+=1,Wt+=1;var Jt=ft.position;Jt[0]=Jt[1]=Jt[2]=0;for(var ge=0;ge<2;++ge)for(var he=ge?zt:1-zt,de=0;de<2;++de)for(var se=de?Ht:1-Ht,Tt=wt+ge,Lt=Wt+de,Mt=he*se,te=0;te<3;++te)Jt[te]+=this._field[te].get(Tt,Lt)*Mt;for(var ve=this._pickResult.level,oe=0;oe<3;++oe)if(ve[oe]=_.le(this.contourLevels[oe],Jt[oe]),ve[oe]<0)this.contourLevels[oe].length>0&&(ve[oe]=0);else if(ve[oe]<this.contourLevels[oe].length-1){var Te=this.contourLevels[oe][ve[oe]],He=this.contourLevels[oe][ve[oe]+1];Math.abs(Te-Jt[oe])>Math.abs(He-Jt[oe])&&(ve[oe]+=1)}for(ft.index[0]=zt<.5?wt:wt+1,ft.index[1]=Ht<.5?Wt:Wt+1,ft.uv[0]=ut/Y[0],ft.uv[1]=Pt/Y[1],te=0;te<3;++te)ft.dataCoordinate[te]=this._field[te].get(ft.index[0],ft.index[1]);return ft},F.padField=function(it,Y){var ft=Y.shape.slice(),ut=it.shape.slice();x.assign(it.lo(1,1).hi(ft[0],ft[1]),Y),x.assign(it.lo(1).hi(ft[0],1),Y.hi(ft[0],1)),x.assign(it.lo(1,ut[1]-1).hi(ft[0],1),Y.lo(0,ft[1]-1).hi(ft[0],1)),x.assign(it.lo(0,1).hi(1,ft[1]),Y.hi(1)),x.assign(it.lo(ut[0]-1,1).hi(1,ft[1]),Y.lo(ft[0]-1)),it.set(0,0,Y.get(0,0)),it.set(0,ut[1]-1,Y.get(0,ft[1]-1)),it.set(ut[0]-1,0,Y.get(ft[0]-1,0)),it.set(ut[0]-1,ut[1]-1,Y.get(ft[0]-1,ft[1]-1))};function dt(it,Y){return Array.isArray(it)?[Y(it[0]),Y(it[1]),Y(it[2])]:[Y(it),Y(it),Y(it)]}function rt(it){return Array.isArray(it)?it.length===3?[it[0],it[1],it[2],1]:[it[0],it[1],it[2],it[3]]:[0,0,0,1]}function at(it){if(Array.isArray(it)){if(Array.isArray(it))return[rt(it[0]),rt(it[1]),rt(it[2])];var Y=rt(it);return[Y.slice(),Y.slice(),Y.slice()]}}F.update=function(it){it=it||{},this.objectOffset=it.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in it&&(this.contourWidth=dt(it.contourWidth,Number)),"showContour"in it&&(this.showContour=dt(it.showContour,Boolean)),"showSurface"in it&&(this.showSurface=!!it.showSurface),"contourTint"in it&&(this.contourTint=dt(it.contourTint,Boolean)),"contourColor"in it&&(this.contourColor=at(it.contourColor)),"contourProject"in it&&(this.contourProject=dt(it.contourProject,function(Zi){return dt(Zi,Boolean)})),"surfaceProject"in it&&(this.surfaceProject=it.surfaceProject),"dynamicColor"in it&&(this.dynamicColor=at(it.dynamicColor)),"dynamicTint"in it&&(this.dynamicTint=dt(it.dynamicTint,Number)),"dynamicWidth"in it&&(this.dynamicWidth=dt(it.dynamicWidth,Number)),"opacity"in it&&(this.opacity=it.opacity),"opacityscale"in it&&(this.opacityscale=it.opacityscale),"colorBounds"in it&&(this.colorBounds=it.colorBounds),"vertexColor"in it&&(this.vertexColor=it.vertexColor?1:0),"colormap"in it&&this._colorMap.setPixels(this.genColormap(it.colormap,this.opacityscale));var Y=it.field||it.coords&&it.coords[2]||null,ft=!1;if(Y||(this._field[2].shape[0]||this._field[2].shape[2]?Y=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):Y=this._field[2].hi(0,0)),"field"in it||"coords"in it){var ut=(Y.shape[0]+2)*(Y.shape[1]+2);ut>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(a.nextPow2(ut))),this._field[2]=v(this._field[2].data,[Y.shape[0]+2,Y.shape[1]+2]),this.padField(this._field[2],Y),this.shape=Y.shape.slice();for(var wt=this.shape,zt=0;zt<2;++zt)this._field[2].size>this._field[zt].data.length&&(s.freeFloat(this._field[zt].data),this._field[zt].data=s.mallocFloat(this._field[2].size)),this._field[zt]=v(this._field[zt].data,[wt[0]+2,wt[1]+2]);if(it.coords){var Pt=it.coords;if(!Array.isArray(Pt)||Pt.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(zt=0;zt<2;++zt){var Wt=Pt[zt];for(de=0;de<2;++de)if(Wt.shape[de]!==wt[de])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[zt],Wt)}}else if(it.ticks){var Ht=it.ticks;if(!Array.isArray(Ht)||Ht.length!==2)throw new Error("gl-surface: invalid ticks");for(zt=0;zt<2;++zt){var Jt=Ht[zt];if((Array.isArray(Jt)||Jt.length)&&(Jt=v(Jt)),Jt.shape[0]!==wt[zt])throw new Error("gl-surface: invalid tick length");var ge=v(Jt.data,wt);ge.stride[zt]=Jt.stride[0],ge.stride[zt^1]=0,this.padField(this._field[zt],ge)}}else{for(zt=0;zt<2;++zt){var he=[0,0];he[zt]=1,this._field[zt]=v(this._field[zt].data,[wt[0]+2,wt[1]+2],he,0)}this._field[0].set(0,0,0);for(var de=0;de<wt[0];++de)this._field[0].set(de+1,0,de);for(this._field[0].set(wt[0]+1,0,wt[0]-1),this._field[1].set(0,0,0),de=0;de<wt[1];++de)this._field[1].set(0,de+1,de);this._field[1].set(0,wt[1]+1,wt[1]-1)}var se=this._field,Tt=v(s.mallocFloat(se[2].size*3*2),[3,wt[0]+2,wt[1]+2,2]);for(zt=0;zt<3;++zt)C(Tt.pick(zt),se[zt],"mirror");var Lt=v(s.mallocFloat(se[2].size*3),[wt[0]+2,wt[1]+2,3]);for(zt=0;zt<wt[0]+2;++zt)for(de=0;de<wt[1]+2;++de){var Mt=Tt.get(0,zt,de,0),te=Tt.get(0,zt,de,1),ve=Tt.get(1,zt,de,0),oe=Tt.get(1,zt,de,1),Te=Tt.get(2,zt,de,0),He=Tt.get(2,zt,de,1),Ge=ve*He-oe*Te,cr=Te*te-He*Mt,ur=Mt*oe-te*ve,jr=Math.sqrt(Ge*Ge+cr*cr+ur*ur);jr<1e-8?(jr=Math.max(Math.abs(Ge),Math.abs(cr),Math.abs(ur)),jr<1e-8?(ur=1,cr=Ge=0,jr=1):jr=1/jr):jr=1/Math.sqrt(jr),Lt.set(zt,de,0,Ge*jr),Lt.set(zt,de,1,cr*jr),Lt.set(zt,de,2,ur*jr)}s.free(Tt.data);var Hr=[1/0,1/0,1/0],br=[-1/0,-1/0,-1/0],Kr=1/0,rn=-1/0,Ce=(wt[0]-1)*(wt[1]-1)*6,$t=s.mallocFloat(a.nextPow2(10*Ce)),ne=0,Ct=0;for(zt=0;zt<wt[0]-1;++zt)t:for(de=0;de<wt[1]-1;++de){for(var gt=0;gt<2;++gt)for(var St=0;St<2;++St)for(var Nt=0;Nt<3;++Nt){var ee=this._field[Nt].get(1+zt+gt,1+de+St);if(isNaN(ee)||!isFinite(ee))continue t}for(Nt=0;Nt<6;++Nt){var le=zt+R[Nt][0],we=de+R[Nt][1],Ue=this._field[0].get(le+1,we+1),qe=this._field[1].get(le+1,we+1);ee=this._field[2].get(le+1,we+1),Ge=Lt.get(le+1,we+1,0),cr=Lt.get(le+1,we+1,1),ur=Lt.get(le+1,we+1,2),it.intensity&&(ar=it.intensity.get(le,we));var ar=it.intensity?it.intensity.get(le,we):ee+this.objectOffset[2];$t[ne++]=le,$t[ne++]=we,$t[ne++]=Ue,$t[ne++]=qe,$t[ne++]=ee,$t[ne++]=0,$t[ne++]=ar,$t[ne++]=Ge,$t[ne++]=cr,$t[ne++]=ur,Hr[0]=Math.min(Hr[0],Ue+this.objectOffset[0]),Hr[1]=Math.min(Hr[1],qe+this.objectOffset[1]),Hr[2]=Math.min(Hr[2],ee+this.objectOffset[2]),Kr=Math.min(Kr,ar),br[0]=Math.max(br[0],Ue+this.objectOffset[0]),br[1]=Math.max(br[1],qe+this.objectOffset[1]),br[2]=Math.max(br[2],ee+this.objectOffset[2]),rn=Math.max(rn,ar),Ct+=1}}for(it.intensityBounds&&(Kr=+it.intensityBounds[0],rn=+it.intensityBounds[1]),zt=6;zt<ne;zt+=10)$t[zt]=($t[zt]-Kr)/(rn-Kr);this._vertexCount=Ct,this._coordinateBuffer.update($t.subarray(0,ne)),s.freeFloat($t),s.free(Lt.data),this.bounds=[Hr,br],this.intensity=it.intensity||this._field[2],(this.intensityBounds[0]!==Kr||this.intensityBounds[1]!==rn)&&(ft=!0),this.intensityBounds=[Kr,rn]}if("levels"in it){var Ar=it.levels;for(Array.isArray(Ar[0])?Ar=Ar.slice():Ar=[[],[],Ar],zt=0;zt<3;++zt)Ar[zt]=Ar[zt].slice(),Ar[zt].sort(function(Zi,ui){return Zi-ui});for(zt=0;zt<3;++zt)for(de=0;de<Ar[zt].length;++de)Ar[zt][de]-=this.objectOffset[zt];t:for(zt=0;zt<3;++zt){if(Ar[zt].length!==this.contourLevels[zt].length){ft=!0;break}for(de=0;de<Ar[zt].length;++de)if(Ar[zt][de]!==this.contourLevels[zt][de]){ft=!0;break t}}this.contourLevels=Ar}if(ft){se=this._field,wt=this.shape;for(var Tr=[],pr=0;pr<3;++pr){var Jr=this.contourLevels[pr],Vn=[],Hn=[],Kn=[0,0,0];for(zt=0;zt<Jr.length;++zt){var Ci=T(this._field[pr],Jr[zt]);Vn.push(Tr.length/5|0),Ct=0;t:for(de=0;de<Ci.cells.length;++de){var ii=Ci.cells[de];for(Nt=0;Nt<2;++Nt){var qn=Ci.positions[ii[Nt]],oa=qn[0],Hi=Math.floor(oa)|0,We=oa-Hi,rr=qn[1],fr=Math.floor(rr)|0,xr=rr-fr,Qr=!1;e:for(var Cn=0;Cn<3;++Cn){Kn[Cn]=0;var wn=(pr+Cn+1)%3;for(gt=0;gt<2;++gt){var Mn=gt?We:1-We;for(le=Math.min(Math.max(Hi+gt,0),wt[0])|0,St=0;St<2;++St){var ci=St?xr:1-xr;if(we=Math.min(Math.max(fr+St,0),wt[1])|0,Cn<2?ee=this._field[wn].get(le,we):ee=(this.intensity.get(le,we)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(ee)||isNaN(ee)){Qr=!0;break e}var xi=Mn*ci;Kn[Cn]+=xi*ee}}}if(!Qr)Tr.push(Kn[0],Kn[1],qn[0],qn[1],Kn[2]),Ct+=1;else{if(Nt>0){for(var Pi=0;Pi<5;++Pi)Tr.pop();Ct-=1}continue t}}}Hn.push(Ct)}this._contourOffsets[pr]=Vn,this._contourCounts[pr]=Hn}var Di=s.mallocFloat(Tr.length);for(zt=0;zt<Tr.length;++zt)Di[zt]=Tr[zt];this._contourBuffer.update(Di),s.freeFloat(Di)}},F.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 it=0;it<3;++it)s.freeFloat(this._field[it].data)},F.highlight=function(it){var Y;if(!it){this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],this.highlightLevel=[-1,-1,-1];return}for(Y=0;Y<3;++Y)this.enableHighlight[Y]?this.highlightLevel[Y]=it.level[Y]:this.highlightLevel[Y]=-1;var ft;for(this.snapToData?ft=it.dataCoordinate:ft=it.position,Y=0;Y<3;++Y)ft[Y]-=this.objectOffset[Y];if(!((!this.enableDynamic[0]||ft[0]===this.dynamicLevel[0])&&(!this.enableDynamic[1]||ft[1]===this.dynamicLevel[1])&&(!this.enableDynamic[2]||ft[2]===this.dynamicLevel[2]))){for(var ut=0,wt=this.shape,zt=s.mallocFloat(12*wt[0]*wt[1]),Pt=0;Pt<3;++Pt){if(!this.enableDynamic[Pt]){this.dynamicLevel[Pt]=NaN,this._dynamicCounts[Pt]=0;continue}this.dynamicLevel[Pt]=ft[Pt];var Wt=(Pt+1)%3,Ht=(Pt+2)%3,Jt=this._field[Pt],ge=this._field[Wt],he=this._field[Ht],de=T(Jt,ft[Pt]),se=de.cells,Tt=de.positions;for(this._dynamicOffsets[Pt]=ut,Y=0;Y<se.length;++Y)for(var Lt=se[Y],Mt=0;Mt<2;++Mt){var te=Tt[Lt[Mt]],ve=+te[0],oe=ve|0,Te=Math.min(oe+1,wt[0])|0,He=ve-oe,Ge=1-He,cr=+te[1],ur=cr|0,jr=Math.min(ur+1,wt[1])|0,Hr=cr-ur,br=1-Hr,Kr=Ge*br,rn=Ge*Hr,Ce=He*br,$t=He*Hr,ne=Kr*ge.get(oe,ur)+rn*ge.get(oe,jr)+Ce*ge.get(Te,ur)+$t*ge.get(Te,jr),Ct=Kr*he.get(oe,ur)+rn*he.get(oe,jr)+Ce*he.get(Te,ur)+$t*he.get(Te,jr);if(isNaN(ne)||isNaN(Ct)){Mt&&(ut-=1);break}zt[2*ut+0]=ne,zt[2*ut+1]=Ct,ut+=1}this._dynamicCounts[Pt]=ut-this._dynamicOffsets[Pt]}this._dynamicBuffer.update(zt.subarray(0,2*ut)),s.freeFloat(zt)}};function vt(it){var Y=it.gl,ft=E(Y),ut=h(Y),wt=A(Y),zt=p(Y),Pt=n(Y),Wt=o(Y,[{buffer:Pt,size:4,stride:k,offset:0},{buffer:Pt,size:3,stride:k,offset:16},{buffer:Pt,size:3,stride:k,offset:28}]),Ht=n(Y),Jt=o(Y,[{buffer:Ht,size:4,stride:20,offset:0},{buffer:Ht,size:1,stride:20,offset:16}]),ge=n(Y),he=o(Y,[{buffer:ge,size:2,type:Y.FLOAT}]),de=i(Y,1,V,Y.RGBA,Y.UNSIGNED_BYTE);de.minFilter=Y.LINEAR,de.magFilter=Y.LINEAR;var se=new H(Y,[0,0],[[0,0,0],[0,0,0]],ft,ut,Pt,Wt,de,wt,zt,Ht,Jt,ge,he,[0,0,0]),Tt={levels:[[],[],[]]};for(var Lt in it)Tt[Lt]=it[Lt];return Tt.colormap=Tt.colormap||"jet",se.update(Tt),se}},9507:function(t){t.exports=!0},9618:function(t,e,r){var a=r(7163),n=typeof Float64Array<"u";function o(T,u){return T[0]-u[0]}function i(){var T=this.stride,u=new Array(T.length),b;for(b=0;b<u.length;++b)u[b]=[Math.abs(T[b]),b];u.sort(o);var _=new Array(u.length);for(b=0;b<_.length;++b)_[b]=u[b][1];return _}var s={T:function(T){function u(_){this.data=_}var b=u.prototype;return b.dtype=T,b.index=function(){return-1},b.size=0,b.dimension=-1,b.shape=b.stride=b.order=[],b.lo=b.hi=b.transpose=b.step=function(){return new u(this.data)},b.get=b.set=function(){},b.pick=function(){return null},function(_){return new u(_)}},0:function(T,u){function b(C,M){this.data=C,this.offset=M}var _=b.prototype;return _.dtype=T,_.index=function(){return this.offset},_.dimension=0,_.size=1,_.shape=_.stride=_.order=[],_.lo=_.hi=_.transpose=_.step=function(){return new b(this.data,this.offset)},_.pick=function(){return u(this.data)},_.valueOf=_.get=function(){return T==="generic"?this.data.get(this.offset):this.data[this.offset]},_.set=function(C){return T==="generic"?this.data.set(this.offset,C):this.data[this.offset]=C},function(C,M,E,A){return new b(C,A)}},1:function(T,u,b){function _(M,E,A,h){this.data=M,this.shape=[E],this.stride=[A],this.offset=h|0}var C=_.prototype;return C.dtype=T,C.dimension=1,Object.defineProperty(C,"size",{get:function(){return this.shape[0]}}),C.order=[0],C.set=function(M,E){return T==="generic"?this.data.set(this.offset+this.stride[0]*M,E):this.data[this.offset+this.stride[0]*M]=E},C.get=function(M){return T==="generic"?this.data.get(this.offset+this.stride[0]*M):this.data[this.offset+this.stride[0]*M]},C.index=function(M){return this.offset+this.stride[0]*M},C.hi=function(M){return new _(this.data,typeof M!="number"||M<0?this.shape[0]:M|0,this.stride[0],this.offset)},C.lo=function(M){var E=this.offset,A=0,h=this.shape[0],p=this.stride[0];return typeof M=="number"&&M>=0&&(A=M|0,E+=p*A,h-=A),new _(this.data,h,p,E)},C.step=function(M){var E=this.shape[0],A=this.stride[0],h=this.offset,p=0,k=Math.ceil;return typeof M=="number"&&(p=M|0,p<0?(h+=A*(E-1),E=k(-E/p)):E=k(E/p),A*=p),new _(this.data,E,A,h)},C.transpose=function(M){M=M===void 0?0:M|0;var E=this.shape,A=this.stride;return new _(this.data,E[M],A[M],this.offset)},C.pick=function(M){var E=[],A=[],h=this.offset;typeof M=="number"&&M>=0?h=h+this.stride[0]*M|0:(E.push(this.shape[0]),A.push(this.stride[0]));var p=u[E.length+1];return p(this.data,E,A,h)},function(M,E,A,h){return new _(M,E[0],A[0],h)}},2:function(T,u,b){function _(M,E,A,h,p,k){this.data=M,this.shape=[E,A],this.stride=[h,p],this.offset=k|0}var C=_.prototype;return C.dtype=T,C.dimension=2,Object.defineProperty(C,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(C,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),C.set=function(M,E,A){return T==="generic"?this.data.set(this.offset+this.stride[0]*M+this.stride[1]*E,A):this.data[this.offset+this.stride[0]*M+this.stride[1]*E]=A},C.get=function(M,E){return T==="generic"?this.data.get(this.offset+this.stride[0]*M+this.stride[1]*E):this.data[this.offset+this.stride[0]*M+this.stride[1]*E]},C.index=function(M,E){return this.offset+this.stride[0]*M+this.stride[1]*E},C.hi=function(M,E){return new _(this.data,typeof M!="number"||M<0?this.shape[0]:M|0,typeof E!="number"||E<0?this.shape[1]:E|0,this.stride[0],this.stride[1],this.offset)},C.lo=function(M,E){var A=this.offset,h=0,p=this.shape[0],k=this.shape[1],w=this.stride[0],R=this.stride[1];return typeof M=="number"&&M>=0&&(h=M|0,A+=w*h,p-=h),typeof E=="number"&&E>=0&&(h=E|0,A+=R*h,k-=h),new _(this.data,p,k,w,R,A)},C.step=function(M,E){var A=this.shape[0],h=this.shape[1],p=this.stride[0],k=this.stride[1],w=this.offset,R=0,O=Math.ceil;return typeof M=="number"&&(R=M|0,R<0?(w+=p*(A-1),A=O(-A/R)):A=O(A/R),p*=R),typeof E=="number"&&(R=E|0,R<0?(w+=k*(h-1),h=O(-h/R)):h=O(h/R),k*=R),new _(this.data,A,h,p,k,w)},C.transpose=function(M,E){M=M===void 0?0:M|0,E=E===void 0?1:E|0;var A=this.shape,h=this.stride;return new _(this.data,A[M],A[E],h[M],h[E],this.offset)},C.pick=function(M,E){var A=[],h=[],p=this.offset;typeof M=="number"&&M>=0?p=p+this.stride[0]*M|0:(A.push(this.shape[0]),h.push(this.stride[0])),typeof E=="number"&&E>=0?p=p+this.stride[1]*E|0:(A.push(this.shape[1]),h.push(this.stride[1]));var k=u[A.length+1];return k(this.data,A,h,p)},function(M,E,A,h){return new _(M,E[0],E[1],A[0],A[1],h)}},3:function(T,u,b){function _(M,E,A,h,p,k,w,R){this.data=M,this.shape=[E,A,h],this.stride=[p,k,w],this.offset=R|0}var C=_.prototype;return C.dtype=T,C.dimension=3,Object.defineProperty(C,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(C,"order",{get:function(){var M=Math.abs(this.stride[0]),E=Math.abs(this.stride[1]),A=Math.abs(this.stride[2]);return M>E?E>A?[2,1,0]:M>A?[1,2,0]:[1,0,2]:M>A?[2,0,1]:A>E?[0,1,2]:[0,2,1]}}),C.set=function(M,E,A,h){return T==="generic"?this.data.set(this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A,h):this.data[this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A]=h},C.get=function(M,E,A){return T==="generic"?this.data.get(this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A):this.data[this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A]},C.index=function(M,E,A){return this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A},C.hi=function(M,E,A){return new _(this.data,typeof M!="number"||M<0?this.shape[0]:M|0,typeof E!="number"||E<0?this.shape[1]:E|0,typeof A!="number"||A<0?this.shape[2]:A|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},C.lo=function(M,E,A){var h=this.offset,p=0,k=this.shape[0],w=this.shape[1],R=this.shape[2],O=this.stride[0],N=this.stride[1],V=this.stride[2];return typeof M=="number"&&M>=0&&(p=M|0,h+=O*p,k-=p),typeof E=="number"&&E>=0&&(p=E|0,h+=N*p,w-=p),typeof A=="number"&&A>=0&&(p=A|0,h+=V*p,R-=p),new _(this.data,k,w,R,O,N,V,h)},C.step=function(M,E,A){var h=this.shape[0],p=this.shape[1],k=this.shape[2],w=this.stride[0],R=this.stride[1],O=this.stride[2],N=this.offset,V=0,H=Math.ceil;return typeof M=="number"&&(V=M|0,V<0?(N+=w*(h-1),h=H(-h/V)):h=H(h/V),w*=V),typeof E=="number"&&(V=E|0,V<0?(N+=R*(p-1),p=H(-p/V)):p=H(p/V),R*=V),typeof A=="number"&&(V=A|0,V<0?(N+=O*(k-1),k=H(-k/V)):k=H(k/V),O*=V),new _(this.data,h,p,k,w,R,O,N)},C.transpose=function(M,E,A){M=M===void 0?0:M|0,E=E===void 0?1:E|0,A=A===void 0?2:A|0;var h=this.shape,p=this.stride;return new _(this.data,h[M],h[E],h[A],p[M],p[E],p[A],this.offset)},C.pick=function(M,E,A){var h=[],p=[],k=this.offset;typeof M=="number"&&M>=0?k=k+this.stride[0]*M|0:(h.push(this.shape[0]),p.push(this.stride[0])),typeof E=="number"&&E>=0?k=k+this.stride[1]*E|0:(h.push(this.shape[1]),p.push(this.stride[1])),typeof A=="number"&&A>=0?k=k+this.stride[2]*A|0:(h.push(this.shape[2]),p.push(this.stride[2]));var w=u[h.length+1];return w(this.data,h,p,k)},function(M,E,A,h){return new _(M,E[0],E[1],E[2],A[0],A[1],A[2],h)}},4:function(T,u,b){function _(M,E,A,h,p,k,w,R,O,N){this.data=M,this.shape=[E,A,h,p],this.stride=[k,w,R,O],this.offset=N|0}var C=_.prototype;return C.dtype=T,C.dimension=4,Object.defineProperty(C,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(C,"order",{get:b}),C.set=function(M,E,A,h,p){return T==="generic"?this.data.set(this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A+this.stride[3]*h,p):this.data[this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A+this.stride[3]*h]=p},C.get=function(M,E,A,h){return T==="generic"?this.data.get(this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A+this.stride[3]*h):this.data[this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A+this.stride[3]*h]},C.index=function(M,E,A,h){return this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A+this.stride[3]*h},C.hi=function(M,E,A,h){return new _(this.data,typeof M!="number"||M<0?this.shape[0]:M|0,typeof E!="number"||E<0?this.shape[1]:E|0,typeof A!="number"||A<0?this.shape[2]:A|0,typeof h!="number"||h<0?this.shape[3]:h|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},C.lo=function(M,E,A,h){var p=this.offset,k=0,w=this.shape[0],R=this.shape[1],O=this.shape[2],N=this.shape[3],V=this.stride[0],H=this.stride[1],F=this.stride[2],U=this.stride[3];return typeof M=="number"&&M>=0&&(k=M|0,p+=V*k,w-=k),typeof E=="number"&&E>=0&&(k=E|0,p+=H*k,R-=k),typeof A=="number"&&A>=0&&(k=A|0,p+=F*k,O-=k),typeof h=="number"&&h>=0&&(k=h|0,p+=U*k,N-=k),new _(this.data,w,R,O,N,V,H,F,U,p)},C.step=function(M,E,A,h){var p=this.shape[0],k=this.shape[1],w=this.shape[2],R=this.shape[3],O=this.stride[0],N=this.stride[1],V=this.stride[2],H=this.stride[3],F=this.offset,U=0,W=Math.ceil;return typeof M=="number"&&(U=M|0,U<0?(F+=O*(p-1),p=W(-p/U)):p=W(p/U),O*=U),typeof E=="number"&&(U=E|0,U<0?(F+=N*(k-1),k=W(-k/U)):k=W(k/U),N*=U),typeof A=="number"&&(U=A|0,U<0?(F+=V*(w-1),w=W(-w/U)):w=W(w/U),V*=U),typeof h=="number"&&(U=h|0,U<0?(F+=H*(R-1),R=W(-R/U)):R=W(R/U),H*=U),new _(this.data,p,k,w,R,O,N,V,H,F)},C.transpose=function(M,E,A,h){M=M===void 0?0:M|0,E=E===void 0?1:E|0,A=A===void 0?2:A|0,h=h===void 0?3:h|0;var p=this.shape,k=this.stride;return new _(this.data,p[M],p[E],p[A],p[h],k[M],k[E],k[A],k[h],this.offset)},C.pick=function(M,E,A,h){var p=[],k=[],w=this.offset;typeof M=="number"&&M>=0?w=w+this.stride[0]*M|0:(p.push(this.shape[0]),k.push(this.stride[0])),typeof E=="number"&&E>=0?w=w+this.stride[1]*E|0:(p.push(this.shape[1]),k.push(this.stride[1])),typeof A=="number"&&A>=0?w=w+this.stride[2]*A|0:(p.push(this.shape[2]),k.push(this.stride[2])),typeof h=="number"&&h>=0?w=w+this.stride[3]*h|0:(p.push(this.shape[3]),k.push(this.stride[3]));var R=u[p.length+1];return R(this.data,p,k,w)},function(M,E,A,h){return new _(M,E[0],E[1],E[2],E[3],A[0],A[1],A[2],A[3],h)}},5:function(T,u,b){function _(M,E,A,h,p,k,w,R,O,N,V,H){this.data=M,this.shape=[E,A,h,p,k],this.stride=[w,R,O,N,V],this.offset=H|0}var C=_.prototype;return C.dtype=T,C.dimension=5,Object.defineProperty(C,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(C,"order",{get:b}),C.set=function(M,E,A,h,p,k){return T==="generic"?this.data.set(this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A+this.stride[3]*h+this.stride[4]*p,k):this.data[this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A+this.stride[3]*h+this.stride[4]*p]=k},C.get=function(M,E,A,h,p){return T==="generic"?this.data.get(this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A+this.stride[3]*h+this.stride[4]*p):this.data[this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A+this.stride[3]*h+this.stride[4]*p]},C.index=function(M,E,A,h,p){return this.offset+this.stride[0]*M+this.stride[1]*E+this.stride[2]*A+this.stride[3]*h+this.stride[4]*p},C.hi=function(M,E,A,h,p){return new _(this.data,typeof M!="number"||M<0?this.shape[0]:M|0,typeof E!="number"||E<0?this.shape[1]:E|0,typeof A!="number"||A<0?this.shape[2]:A|0,typeof h!="number"||h<0?this.shape[3]:h|0,typeof p!="number"||p<0?this.shape[4]:p|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},C.lo=function(M,E,A,h,p){var k=this.offset,w=0,R=this.shape[0],O=this.shape[1],N=this.shape[2],V=this.shape[3],H=this.shape[4],F=this.stride[0],U=this.stride[1],W=this.stride[2],q=this.stride[3],X=this.stride[4];return typeof M=="number"&&M>=0&&(w=M|0,k+=F*w,R-=w),typeof E=="number"&&E>=0&&(w=E|0,k+=U*w,O-=w),typeof A=="number"&&A>=0&&(w=A|0,k+=W*w,N-=w),typeof h=="number"&&h>=0&&(w=h|0,k+=q*w,V-=w),typeof p=="number"&&p>=0&&(w=p|0,k+=X*w,H-=w),new _(this.data,R,O,N,V,H,F,U,W,q,X,k)},C.step=function(M,E,A,h,p){var k=this.shape[0],w=this.shape[1],R=this.shape[2],O=this.shape[3],N=this.shape[4],V=this.stride[0],H=this.stride[1],F=this.stride[2],U=this.stride[3],W=this.stride[4],q=this.offset,X=0,lt=Math.ceil;return typeof M=="number"&&(X=M|0,X<0?(q+=V*(k-1),k=lt(-k/X)):k=lt(k/X),V*=X),typeof E=="number"&&(X=E|0,X<0?(q+=H*(w-1),w=lt(-w/X)):w=lt(w/X),H*=X),typeof A=="number"&&(X=A|0,X<0?(q+=F*(R-1),R=lt(-R/X)):R=lt(R/X),F*=X),typeof h=="number"&&(X=h|0,X<0?(q+=U*(O-1),O=lt(-O/X)):O=lt(O/X),U*=X),typeof p=="number"&&(X=p|0,X<0?(q+=W*(N-1),N=lt(-N/X)):N=lt(N/X),W*=X),new _(this.data,k,w,R,O,N,V,H,F,U,W,q)},C.transpose=function(M,E,A,h,p){M=M===void 0?0:M|0,E=E===void 0?1:E|0,A=A===void 0?2:A|0,h=h===void 0?3:h|0,p=p===void 0?4:p|0;var k=this.shape,w=this.stride;return new _(this.data,k[M],k[E],k[A],k[h],k[p],w[M],w[E],w[A],w[h],w[p],this.offset)},C.pick=function(M,E,A,h,p){var k=[],w=[],R=this.offset;typeof M=="number"&&M>=0?R=R+this.stride[0]*M|0:(k.push(this.shape[0]),w.push(this.stride[0])),typeof E=="number"&&E>=0?R=R+this.stride[1]*E|0:(k.push(this.shape[1]),w.push(this.stride[1])),typeof A=="number"&&A>=0?R=R+this.stride[2]*A|0:(k.push(this.shape[2]),w.push(this.stride[2])),typeof h=="number"&&h>=0?R=R+this.stride[3]*h|0:(k.push(this.shape[3]),w.push(this.stride[3])),typeof p=="number"&&p>=0?R=R+this.stride[4]*p|0:(k.push(this.shape[4]),w.push(this.stride[4]));var O=u[k.length+1];return O(this.data,k,w,R)},function(M,E,A,h){return new _(M,E[0],E[1],E[2],E[3],E[4],A[0],A[1],A[2],A[3],A[4],h)}}};function f(T,u){var b=u===-1?"T":String(u),_=s[b];return u===-1?_(T):u===0?_(T,y[T][0]):_(T,y[T],i)}function x(T){if(a(T))return"buffer";if(n)switch(Object.prototype.toString.call(T)){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(T)?"array":"generic"}var y={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function v(T,u,b,_){if(T===void 0){var p=y.array[0];return p([])}else typeof T=="number"&&(T=[T]);u===void 0&&(u=[T.length]);var C=u.length;if(b===void 0){b=new Array(C);for(var M=C-1,E=1;M>=0;--M)b[M]=E,E*=u[M]}if(_===void 0){_=0;for(var M=0;M<C;++M)b[M]<0&&(_-=(u[M]-1)*b[M])}for(var A=x(T),h=y[A];h.length<=C+1;)h.push(f(A,h.length-1));var p=h[C+1];return p(T,u,b,_)}t.exports=v},9921:function(t){t.exports=e;function e(r){var a=r[0],n=r[1],o=r[2],i=r[3],s=r[4],f=r[5],x=r[6],y=r[7],v=r[8],T=r[9],u=r[10],b=r[11],_=r[12],C=r[13],M=r[14],E=r[15],A=a*f-n*s,h=a*x-o*s,p=a*y-i*s,k=n*x-o*f,w=n*y-i*f,R=o*y-i*x,O=v*C-T*_,N=v*M-u*_,V=v*E-b*_,H=T*M-u*C,F=T*E-b*C,U=u*E-b*M;return A*U-h*F+p*H+k*V-w*N+R*O}},9922:function(t,e,r){t.exports=n;var a=r(2613);function n(o,i){var s=o[0],f=o[1],x=o[2],y=i[0],v=i[1],T=i[2];return Math.abs(s-y)<=a*Math.max(1,Math.abs(s),Math.abs(y))&&Math.abs(f-v)<=a*Math.max(1,Math.abs(f),Math.abs(v))&&Math.abs(x-T)<=a*Math.max(1,Math.abs(x),Math.abs(T))}},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=u;var a=r(9215),n=r(6582),o=r(7399),i=r(7608),s=r(4081);function f(b,_,C){return Math.sqrt(Math.pow(b,2)+Math.pow(_,2)+Math.pow(C,2))}function x(b,_,C,M){return Math.sqrt(Math.pow(b,2)+Math.pow(_,2)+Math.pow(C,2)+Math.pow(M,2))}function y(b,_){var C=_[0],M=_[1],E=_[2],A=_[3],h=x(C,M,E,A);h>1e-6?(b[0]=C/h,b[1]=M/h,b[2]=E/h,b[3]=A/h):(b[0]=b[1]=b[2]=0,b[3]=1)}function v(b,_,C){this.radius=a([C]),this.center=a(_),this.rotation=a(b),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 T=v.prototype;T.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},T.recalcMatrix=function(b){this.radius.curve(b),this.center.curve(b),this.rotation.curve(b);var _=this.computedRotation;y(_,_);var C=this.computedMatrix;o(C,_);var M=this.computedCenter,E=this.computedEye,A=this.computedUp,h=Math.exp(this.computedRadius[0]);E[0]=M[0]+h*C[2],E[1]=M[1]+h*C[6],E[2]=M[2]+h*C[10],A[0]=C[1],A[1]=C[5],A[2]=C[9];for(var p=0;p<3;++p){for(var k=0,w=0;w<3;++w)k+=C[p+4*w]*E[w];C[12+p]=-k}},T.getMatrix=function(b,_){this.recalcMatrix(b);var C=this.computedMatrix;if(_){for(var M=0;M<16;++M)_[M]=C[M];return _}return C},T.idle=function(b){this.center.idle(b),this.radius.idle(b),this.rotation.idle(b)},T.flush=function(b){this.center.flush(b),this.radius.flush(b),this.rotation.flush(b)},T.pan=function(b,_,C,M){_=_||0,C=C||0,M=M||0,this.recalcMatrix(b);var E=this.computedMatrix,A=E[1],h=E[5],p=E[9],k=f(A,h,p);A/=k,h/=k,p/=k;var w=E[0],R=E[4],O=E[8],N=w*A+R*h+O*p;w-=A*N,R-=h*N,O-=p*N;var V=f(w,R,O);w/=V,R/=V,O/=V,E[2],E[6],E[10];var H=w*_+A*C,F=R*_+h*C,U=O*_+p*C;this.center.move(b,H,F,U);var W=Math.exp(this.computedRadius[0]);W=Math.max(1e-4,W+M),this.radius.set(b,Math.log(W))},T.rotate=function(b,_,C,M){this.recalcMatrix(b),_=_||0,C=C||0;var E=this.computedMatrix,A=E[0],h=E[4],p=E[8],k=E[1],w=E[5],R=E[9],O=E[2],N=E[6],V=E[10],H=_*A+C*k,F=_*h+C*w,U=_*p+C*R,W=-(N*U-V*F),q=-(V*H-O*U),X=-(O*F-N*H),lt=Math.sqrt(Math.max(0,1-Math.pow(W,2)-Math.pow(q,2)-Math.pow(X,2))),yt=x(W,q,X,lt);yt>1e-6?(W/=yt,q/=yt,X/=yt,lt/=yt):(W=q=X=0,lt=1);var pt=this.computedRotation,st=pt[0],tt=pt[1],dt=pt[2],rt=pt[3],at=st*lt+rt*W+tt*X-dt*q,vt=tt*lt+rt*q+dt*W-st*X,it=dt*lt+rt*X+st*q-tt*W,Y=rt*lt-st*W-tt*q-dt*X;if(M){W=O,q=N,X=V;var ft=Math.sin(M)/f(W,q,X);W*=ft,q*=ft,X*=ft,lt=Math.cos(_),at=at*lt+Y*W+vt*X-it*q,vt=vt*lt+Y*q+it*W-at*X,it=it*lt+Y*X+at*q-vt*W,Y=Y*lt-at*W-vt*q-it*X}var ut=x(at,vt,it,Y);ut>1e-6?(at/=ut,vt/=ut,it/=ut,Y/=ut):(at=vt=it=0,Y=1),this.rotation.set(b,at,vt,it,Y)},T.lookAt=function(b,_,C,M){this.recalcMatrix(b),C=C||this.computedCenter,_=_||this.computedEye,M=M||this.computedUp;var E=this.computedMatrix;n(E,_,C,M);var A=this.computedRotation;s(A,E[0],E[1],E[2],E[4],E[5],E[6],E[8],E[9],E[10]),y(A,A),this.rotation.set(b,A[0],A[1],A[2],A[3]);for(var h=0,p=0;p<3;++p)h+=Math.pow(C[p]-_[p],2);this.radius.set(b,.5*Math.log(Math.max(h,1e-6))),this.center.set(b,C[0],C[1],C[2])},T.translate=function(b,_,C,M){this.center.move(b,_||0,C||0,M||0)},T.setMatrix=function(b,_){var C=this.computedRotation;s(C,_[0],_[1],_[2],_[4],_[5],_[6],_[8],_[9],_[10]),y(C,C),this.rotation.set(b,C[0],C[1],C[2],C[3]);var M=this.computedMatrix;i(M,_);var E=M[15];if(Math.abs(E)>1e-6){var A=M[12]/E,h=M[13]/E,p=M[14]/E;this.recalcMatrix(b);var k=Math.exp(this.computedRadius[0]);this.center.set(b,A-M[2]*k,h-M[6]*k,p-M[10]*k),this.radius.idle(b)}else this.center.idle(b),this.radius.idle(b)},T.setDistance=function(b,_){_>0&&this.radius.set(b,Math.log(_))},T.setDistanceLimits=function(b,_){b>0?b=Math.log(b):b=-1/0,_>0?_=Math.log(_):_=1/0,_=Math.max(_,b),this.radius.bounds[0][0]=b,this.radius.bounds[1][0]=_},T.getDistanceLimits=function(b){var _=this.radius.bounds;return b?(b[0]=Math.exp(_[0][0]),b[1]=Math.exp(_[1][0]),b):[Math.exp(_[0][0]),Math.exp(_[1][0])]},T.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]}},T.fromJSON=function(b){var _=this.lastT(),C=b.center;C&&this.center.set(_,C[0],C[1],C[2]);var M=b.rotation;M&&this.rotation.set(_,M[0],M[1],M[2],M[3]);var E=b.distance;E&&E>0&&this.radius.set(_,Math.log(E)),this.setDistanceLimits(b.zoomMin,b.zoomMax)};function u(b){b=b||{};var _=b.center||[0,0,0],C=b.rotation||[0,0,0,1],M=b.radius||1;_=[].slice.call(_,0,3),C=[].slice.call(C,0,4),y(C,C);var E=new v(C,_,Math.log(M));return E.setDistanceLimits(b.zoomMin,b.zoomMax),("eye"in b||"up"in b)&&E.lookAt(0,b.eye,b.center,b.up),E}},9994:function(t,e,r){var a=r(9618),n=r(8277);t.exports=function(o,i){for(var s=[],f=o,x=1;Array.isArray(f);)s.push(f.length),x*=f.length,f=f[0];return s.length===0?a():(i||(i=a(new Float64Array(x),s)),n(i,o),i)}}},g={};function P(t){var e=g[t];if(e!==void 0)return e.exports;var r=g[t]={id:t,loaded:!1,exports:{}};return c[t].call(r.exports,r,r.exports,P),r.loaded=!0,r.exports}(function(){P.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()})(),function(){P.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t}}();var S=P(1964);$.exports=S})()}),nS=Ft((Q,$)=>{$.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]}}),Pj=Ft((Q,$)=>{var c=nS();$.exports=P;var g={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function P(S){var t,e=[],r=1,a;if(typeof S=="string")if(S=S.toLowerCase(),c[S])e=c[S].slice(),a="rgb";else if(S==="transparent")r=0,a="rgb",e=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(S)){var n=S.slice(1),o=n.length,i=o<=4;r=1,i?(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),a="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(S)){var s=t[1],f=s==="rgb",n=s.replace(/a$/,"");a=n;var o=n==="cmyk"?4:n==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(v,T){if(/%$/.test(v))return T===o?parseFloat(v)/100:n==="rgb"?parseFloat(v)*255/100:parseFloat(v);if(n[T]==="h"){if(/deg$/.test(v))return parseFloat(v);if(g[v]!==void 0)return g[v]}return parseFloat(v)}),s===n&&e.push(1),r=f||e[o]===void 0?1:e[o],e=e.slice(0,o)}else S.length>10&&/[0-9](?:\s|\/)/.test(S)&&(e=S.match(/([0-9]+)/g).map(function(x){return parseFloat(x)}),a=S.match(/([a-z])/ig).join("").toLowerCase());else isNaN(S)?Array.isArray(S)||S.length?(e=[S[0],S[1],S[2]],a="rgb",r=S.length===4?S[3]:1):S instanceof Object&&(S.r!=null||S.red!=null||S.R!=null?(a="rgb",e=[S.r||S.red||S.R||0,S.g||S.green||S.G||0,S.b||S.blue||S.B||0]):(a="hsl",e=[S.h||S.hue||S.H||0,S.s||S.saturation||S.S||0,S.l||S.lightness||S.L||S.b||S.brightness]),r=S.a||S.alpha||S.opacity||1,S.opacity!=null&&(r/=100)):(a="rgb",e=[S>>>16,(S&65280)>>>8,S&255]);return{space:a,values:e,alpha:r}}}),zj=Ft((Q,$)=>{var c=Pj();$.exports=function(P){Array.isArray(P)&&P.raw&&(P=String.raw.apply(null,arguments));var S,t=c(P);if(!t.space)return[];var e=[0,0,0],r=t.space[0]==="h"?[360,100,100]:[255,255,255];return S=Array(3),S[0]=Math.min(Math.max(t.values[0],e[0]),r[0]),S[1]=Math.min(Math.max(t.values[1],e[1]),r[1]),S[2]=Math.min(Math.max(t.values[2],e[2]),r[2]),t.space[0]==="h"&&(S=g(S)),S.push(Math.min(Math.max(t.alpha,0),1)),S};function g(P){var S=P[0]/360,t=P[1]/100,e=P[2]/100,r,a,n,o,i,s=0;if(t===0)return i=e*255,[i,i,i];for(a=e<.5?e*(1+t):e+t-e*t,r=2*e-a,o=[0,0,0];s<3;)n=S+1/3*-(s-1),n<0?n++:n>1&&n--,i=6*n<1?r+(a-r)*6*n:2*n<1?a:3*n<2?r+(a-r)*(2/3-n)*6:r,o[s++]=i*255;return o}}),m3=Ft((Q,$)=>{$.exports=c;function c(g,P,S){return P<S?g<P?P:g>S?S:g:g<S?S:g>P?P:g}}),Vk=Ft((Q,$)=>{$.exports=function(c){switch(c){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}),N1=Ft((Q,$)=>{var c=zj(),g=m3(),P=Vk();$.exports=function(t,e){(e==="float"||!e)&&(e="array"),e==="uint"&&(e="uint8"),e==="uint_clamped"&&(e="uint8_clamped");var r=P(e),a=new r(4),n=e!=="uint8"&&e!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=c(t),t[0]/=255,t[1]/=255,t[2]/=255),S(t)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:255,n&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(n?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:1):(a[0]=g(Math.floor(t[0]*255),0,255),a[1]=g(Math.floor(t[1]*255),0,255),a[2]=g(Math.floor(t[2]*255),0,255),a[3]=t[3]==null?255:g(Math.floor(t[3]*255),0,255)),a)};function S(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))}}),Tv=Ft((Q,$)=>{var c=N1();function g(P){return P?c(P):[0,0,0,1]}$.exports=g}),Av=Ft((Q,$)=>{var c=ra(),g=fo(),P=N1(),S=Xc(),t=bi().defaultLine,e=Va().isArrayOrTypedArray,r=P(t),a=1;function n(x,y){var v=x;return v[3]*=y,v}function o(x){if(c(x))return r;var y=P(x);return y.length?y:r}function i(x){return c(x)?x:a}function s(x,y,v){var T=x.color;T&&T._inputArray&&(T=T._inputArray);var u=e(T),b=e(y),_=S.extractOpts(x),C=[],M,E,A,h,p;if(_.colorscale!==void 0?M=S.makeColorScaleFuncFromTrace(x):M=o,u?E=function(w,R){return w[R]===void 0?r:P(M(w[R]))}:E=o,b?A=function(w,R){return w[R]===void 0?a:i(w[R])}:A=i,u||b)for(var k=0;k<v;k++)h=E(T,k),p=A(y,k),C[k]=n(h,p);else C=n(P(T),y);return C}function f(x){var y=S.extractOpts(x),v=y.colorscale;return y.reversescale&&(v=S.flipScale(y.colorscale)),v.map(function(T){var u=T[0],b=g(T[1]),_=b.toRgb();return{index:u,rgb:[_.r,_.g,_.b,_.a]}})}$.exports={formatColor:s,parseColorScale:f}}),iS=Ft((Q,$)=>{$.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]}}),Hk=Ft((Q,$)=>{$.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}),Ij=Ft((Q,$)=>{var c=Xo();function g(t,e,r,a){if(!e||!e.visible)return null;for(var n=c.getComponentMethod("errorbars","makeComputeError")(e),o=new Array(t.length),i=0;i<t.length;i++){var s=n(+t[i],i);if(a.type==="log"){var f=a.c2l(t[i]),x=t[i]-s[0],y=t[i]+s[1];if(o[i]=[(a.c2l(x,!0)-f)*r,(a.c2l(y,!0)-f)*r],x>0){var v=a.c2l(x);a._lowerLogErrorBound||(a._lowerLogErrorBound=v),a._lowerErrorBound=Math.min(a._lowerLogErrorBound,v)}}else o[i]=[-s[0]*r,s[1]*r]}return o}function P(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}function S(t,e,r){var a=[g(t.x,t.error_x,e[0],r.xaxis),g(t.y,t.error_y,e[1],r.yaxis),g(t.z,t.error_z,e[2],r.zaxis)],n=P(a);if(n===0)return null;for(var o=new Array(n),i=0;i<n;i++){for(var s=[[0,0,0],[0,0,0]],f=0;f<3;f++)if(a[f])for(var x=0;x<2;x++)s[x][f]=a[f][i][x];o[i]=s}return o}$.exports=S}),Oj=Ft((Q,$)=>{var c=fp().gl_line3d,g=fp().gl_scatter3d,P=fp().gl_error3d,S=fp().gl_mesh3d,t=fp().delaunay_triangulate,e=bn(),r=Tv(),a=Av().formatColor,n=yg(),o=iS(),i=Hk(),s=Es(),f=Dp().appendArrayPointValue,x=Ij();function y(R,O){this.scene=R,this.uid=O,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 v=y.prototype;v.handlePick=function(R){if(R.object&&(R.object===this.linePlot||R.object===this.delaunayMesh||R.object===this.textMarkers||R.object===this.scatterPlot)){var O=R.index=R.data.index;return R.object.highlight&&R.object.highlight(null),this.scatterPlot&&(R.object=this.scatterPlot,this.scatterPlot.highlight(R.data)),R.textLabel="",this.textLabels&&(e.isArrayOrTypedArray(this.textLabels)?(this.textLabels[O]||this.textLabels[O]===0)&&(R.textLabel=this.textLabels[O]):R.textLabel=this.textLabels),R.traceCoordinate=[this.data.x[O],this.data.y[O],this.data.z[O]],!0}};function T(R,O,N){var V=(N+1)%3,H=(N+2)%3,F=[],U=[],W;for(W=0;W<R.length;++W){var q=R[W];isNaN(q[V])||!isFinite(q[V])||isNaN(q[H])||!isFinite(q[H])||(F.push([q[V],q[H]]),U.push(W))}var X=t(F);for(W=0;W<X.length;++W)for(var lt=X[W],yt=0;yt<lt.length;++yt)lt[yt]=U[lt[yt]];return{positions:R,cells:X,meshColor:O}}function u(R){for(var O=[0,0,0],N=[[0,0,0],[0,0,0],[0,0,0]],V=[1,1,1],H=0;H<3;H++){var F=R[H];F&&F.copy_zstyle!==!1&&R[2].visible!==!1&&(F=R[2]),!(!F||!F.visible)&&(O[H]=F.width/2,N[H]=r(F.color),V[H]=F.thickness)}return{capSize:O,color:N,lineWidth:V}}function b(R){return R==null?0:R.indexOf("left")>-1?-1:R.indexOf("right")>-1?1:0}function _(R){return R==null?0:R.indexOf("top")>-1?-1:R.indexOf("bottom")>-1?1:0}function C(R){var O=0,N=0,V=[O,N];if(Array.isArray(R))for(var H=0;H<R.length;H++)V[H]=[O,N],R[H]&&(V[H][0]=b(R[H]),V[H][1]=_(R[H]));else V[0]=b(R),V[1]=_(R);return V}function M(R,O){return O(R*4)}function E(R){return i[R]}function A(R,O,N,V,H){var F=null;if(e.isArrayOrTypedArray(R)){F=[];for(var U=0;U<O;U++)R[U]===void 0?F[U]=V:F[U]=N(R[U],H)}else F=N(R,e.identity);return F}function h(R,O){var N=[],V=R.fullSceneLayout,H=R.dataScale,F=V.xaxis,U=V.yaxis,W=V.zaxis,q=O.marker,X=O.line,lt=O.x||[],yt=O.y||[],pt=O.z||[],st=lt.length,tt=O.xcalendar,dt=O.ycalendar,rt=O.zcalendar,at,vt,it,Y,ft,ut;for(ft=0;ft<st;ft++)at=F.d2l(lt[ft],0,tt)*H[0],vt=U.d2l(yt[ft],0,dt)*H[1],it=W.d2l(pt[ft],0,rt)*H[2],N[ft]=[at,vt,it];if(Array.isArray(O.text))ut=O.text;else if(e.isTypedArray(O.text))ut=Array.from(O.text);else if(O.text!==void 0)for(ut=new Array(st),ft=0;ft<st;ft++)ut[ft]=O.text;function wt(ve,oe){var Te=V[ve];return s.tickText(Te,Te.d2l(oe),!0).text}var zt=O.texttemplate;if(zt){var Pt=R.fullLayout,Wt=Pt._d3locale,Ht=Array.isArray(zt),Jt=Ht?Math.min(zt.length,st):st,ge=Ht?function(ve){return zt[ve]}:function(){return zt};for(ut=new Array(Jt),ft=0;ft<Jt;ft++){var he={x:lt[ft],y:yt[ft],z:pt[ft]},de={xLabel:wt("xaxis",lt[ft]),yLabel:wt("yaxis",yt[ft]),zLabel:wt("zaxis",pt[ft])},se={};f(se,O,ft),ut[ft]=e.texttemplateString({data:[se,he,O._meta],fallback:O.texttemplatefallback,labels:de,locale:Wt,template:ge(ft)})}}if(Y={position:N,mode:O.mode,text:ut},"line"in O&&(Y.lineColor=a(X,1,st),Y.lineWidth=X.width,Y.lineDashes=X.dash),"marker"in O){var Tt=n(O);Y.scatterColor=a(q,1,st),Y.scatterSize=A(q.size,st,M,20,Tt),Y.scatterMarker=A(q.symbol,st,E,"●"),Y.scatterLineWidth=q.line.width,Y.scatterLineColor=a(q.line,1,st),Y.scatterAngle=0}"textposition"in O&&(Y.textOffset=C(O.textposition),Y.textColor=a(O.textfont,1,st),Y.textSize=A(O.textfont.size,st,e.identity,12),Y.textFontFamily=O.textfont.family,Y.textFontWeight=O.textfont.weight,Y.textFontStyle=O.textfont.style,Y.textFontVariant=O.textfont.variant,Y.textAngle=0);var Lt=["x","y","z"];for(Y.project=[!1,!1,!1],Y.projectScale=[1,1,1],Y.projectOpacity=[1,1,1],ft=0;ft<3;++ft){var Mt=O.projection[Lt[ft]];(Y.project[ft]=Mt.show)&&(Y.projectOpacity[ft]=Mt.opacity,Y.projectScale[ft]=Mt.scale)}Y.errorBounds=x(O,H,V);var te=u([O.error_x,O.error_y,O.error_z]);return Y.errorColor=te.color,Y.errorLineWidth=te.lineWidth,Y.errorCapSize=te.capSize,Y.delaunayAxis=O.surfaceaxis,Y.delaunayColor=r(O.surfacecolor),Y}function p(R){if(e.isArrayOrTypedArray(R)){var O=R[0];return e.isArrayOrTypedArray(O)&&(R=O),"rgb("+R.slice(0,3).map(function(N){return Math.round(N*255)})+")"}return null}function k(R){return e.isArrayOrTypedArray(R)?R.length===4&&typeof R[0]=="number"?p(R):R.map(p):null}v.update=function(R){var O=this.scene.glplot.gl,N,V,H,F,U=o.solid;this.data=R;var W=h(this.scene,R);"mode"in W&&(this.mode=W.mode),"lineDashes"in W&&W.lineDashes in o&&(U=o[W.lineDashes]),this.color=k(W.scatterColor)||k(W.lineColor),this.dataPoints=W.position,N={gl:this.scene.glplot.gl,position:W.position,color:W.lineColor,lineWidth:W.lineWidth||1,dashes:U[0],dashScale:U[1],opacity:R.opacity,connectGaps:R.connectgaps},this.mode.indexOf("lines")!==-1?this.linePlot?this.linePlot.update(N):(this.linePlot=c(N),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 q=R.opacity;if(R.marker&&R.marker.opacity!==void 0&&(q*=R.marker.opacity),V={gl:this.scene.glplot.gl,position:W.position,color:W.scatterColor,size:W.scatterSize,glyph:W.scatterMarker,opacity:q,orthographic:!0,lineWidth:W.scatterLineWidth,lineColor:W.scatterLineColor,project:W.project,projectScale:W.projectScale,projectOpacity:W.projectOpacity},this.mode.indexOf("markers")!==-1?this.scatterPlot?this.scatterPlot.update(V):(this.scatterPlot=g(V),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),F={gl:this.scene.glplot.gl,position:W.position,glyph:W.text,color:W.textColor,size:W.textSize,angle:W.textAngle,alignment:W.textOffset,font:W.textFontFamily,fontWeight:W.textFontWeight,fontStyle:W.textFontStyle,fontVariant:W.textFontVariant,orthographic:!0,lineWidth:0,project:!1,opacity:R.opacity},this.textLabels=R.hovertext||R.text,this.mode.indexOf("text")!==-1?this.textMarkers?this.textMarkers.update(F):(this.textMarkers=g(F),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),H={gl:this.scene.glplot.gl,position:W.position,color:W.errorColor,error:W.errorBounds,lineWidth:W.errorLineWidth,capSize:W.errorCapSize,opacity:R.opacity},this.errorBars?W.errorBounds?this.errorBars.update(H):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):W.errorBounds&&(this.errorBars=P(H),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),W.delaunayAxis>=0){var X=T(W.position,W.delaunayColor,W.delaunayAxis);X.opacity=R.opacity,this.delaunayMesh?this.delaunayMesh.update(X):(X.gl=O,this.delaunayMesh=S(X),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)},v.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 w(R,O){var N=new y(R,O.uid);return N.update(O),N}$.exports=w}),aS=Ft((Q,$)=>{var c=tf(),g=Ea(),P=Tc(),S=fh().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=$u(),a=$o(),n=iS(),o=Hk(),i=Ta().extendFlat,s=Yc().overrideAll,f=G0(),x=c.line,y=c.marker,v=y.line,T=i({width:x.width,dash:{valType:"enumerated",values:f(n),dflt:"solid"}},P("line"));function u(_){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 b=$.exports=s({x:c.x,y:c.y,z:{valType:"data_array"},text:i({},c.text,{}),texttemplate:e(),texttemplatefallback:r({editType:"calc"}),hovertext:i({},c.hovertext,{}),hovertemplate:t(),hovertemplatefallback:r(),xhoverformat:S("x"),yhoverformat:S("y"),zhoverformat:S("z"),mode:i({},c.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:u(),y:u(),z:u()},connectgaps:c.connectgaps,line:T,marker:i({symbol:{valType:"enumerated",values:f(o),dflt:"circle",arrayOk:!0},size:i({},y.size,{dflt:8}),sizeref:y.sizeref,sizemin:y.sizemin,sizemode:y.sizemode,opacity:i({},y.opacity,{arrayOk:!1}),colorbar:y.colorbar,line:i({width:i({},v.width,{arrayOk:!1})},P("marker.line"))},P("marker")),textposition:i({},c.textposition,{dflt:"top center"}),textfont:g({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:a.opacity,hoverinfo:i({},a.hoverinfo)},"calc","nested");b.x.editType=b.y.editType=b.z.editType="calc+clearAxisTypes"}),Dj=Ft((Q,$)=>{var c=Xo(),g=bn(),P=Ac(),S=s0(),t=I0(),e=x0(),r=aS();$.exports=function(n,o,i,s){function f(C,M){return g.coerce(n,o,r,C,M)}var x=a(n,o,f,s);if(!x){o.visible=!1;return}f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),f("mode"),P.hasMarkers(o)&&S(n,o,i,s,f,{noSelect:!0,noAngle:!0}),P.hasLines(o)&&(f("connectgaps"),t(n,o,i,s,f)),P.hasText(o)&&(f("texttemplate"),f("texttemplatefallback"),e(n,o,s,f,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var y=(o.line||{}).color,v=(o.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",y||v);for(var T=["x","y","z"],u=0;u<3;++u){var b="projection."+T[u];f(b+".show")&&(f(b+".opacity"),f(b+".scale"))}var _=c.getComponentMethod("errorbars","supplyDefaults");_(n,o,y||v||i,{axis:"z"}),_(n,o,y||v||i,{axis:"y",inherit:"z"}),_(n,o,y||v||i,{axis:"x",inherit:"z"})};function a(n,o,i,s){var f=0,x=i("x"),y=i("y"),v=i("z"),T=c.getComponentMethod("calendars","handleTraceDefaults");return T(n,o,["x","y","z"],s),x&&y&&v&&(f=Math.min(x.length,y.length,v.length),o._length=o._xlength=o._ylength=o._zlength=f),f}}),Fj=Ft((Q,$)=>{var c=ct(),g=F0();$.exports=function(P,S){var t=[{x:!1,y:!1,trace:S,t:{}}];return c(t,S),g(P,S),t}}),Rj=Ft((Q,$)=>{$.exports=c;function c(g,P){if(typeof g!="string")throw new TypeError("must specify type string");if(P=P||{},typeof document>"u"&&!P.canvas)return null;var S=P.canvas||document.createElement("canvas");typeof P.width=="number"&&(S.width=P.width),typeof P.height=="number"&&(S.height=P.height);var t=P,e;try{var r=[g];g.indexOf("webgl")===0&&r.push("experimental-"+g);for(var a=0;a<r.length;a++)if(e=S.getContext(r[a],t),e)return e}catch{e=null}return e||null}}),Bj=Ft((Q,$)=>{var c=Rj();$.exports=function(g){return c("webgl",g)}}),oS=Ft((Q,$)=>{var c=li(),g=function(){};$.exports=function(P){for(var S in P)typeof P[S]=="function"&&(P[S]=g);P.destroy=function(){P.container.parentNode.removeChild(P.container)};var t=document.createElement("div");t.className="no-webgl",t.style.cursor="pointer",t.style.fontSize="24px",t.style.color=c.defaults[0],t.style.position="absolute",t.style.left=t.style.top="0px",t.style.width=t.style.height="100%",t.style["background-color"]=c.lightLine,t.style["z-index"]=30;var e=document.createElement("p");return e.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",e.style.position="relative",e.style.top="50%",e.style.left="50%",e.style.height="30%",e.style.width="50%",e.style.margin="-15% 0 0 -25%",t.appendChild(e),P.container.appendChild(t),P.container.style.background="#FFFFFF",P.container.onclick=function(){window.open("https://get.webgl.org")},!1}}),Nj=Ft((Q,$)=>{var c=Tv(),g=bn(),P=["xaxis","yaxis","zaxis"];function S(){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=S.prototype;t.merge=function(r,a){for(var n=this,o=0;o<3;++o){var i=a[P[o]];if(!i.visible){n.tickEnable[o]=!1,n.labelEnable[o]=!1,n.lineEnable[o]=!1,n.lineTickEnable[o]=!1,n.gridEnable[o]=!1,n.zeroEnable[o]=!1,n.backgroundEnable[o]=!1;continue}n.labels[o]=r._meta?g.templateString(i.title.text,r._meta):i.title.text,"font"in i.title&&(i.title.font.color&&(n.labelColor[o]=c(i.title.font.color)),i.title.font.family&&(n.labelFont[o]=i.title.font.family),i.title.font.size&&(n.labelSize[o]=i.title.font.size),i.title.font.weight&&(n.labelFontWeight[o]=i.title.font.weight),i.title.font.style&&(n.labelFontStyle[o]=i.title.font.style),i.title.font.variant&&(n.labelFontVariant[o]=i.title.font.variant)),"showline"in i&&(n.lineEnable[o]=i.showline),"linecolor"in i&&(n.lineColor[o]=c(i.linecolor)),"linewidth"in i&&(n.lineWidth[o]=i.linewidth),"showgrid"in i&&(n.gridEnable[o]=i.showgrid),"gridcolor"in i&&(n.gridColor[o]=c(i.gridcolor)),"gridwidth"in i&&(n.gridWidth[o]=i.gridwidth),i.type==="log"?n.zeroEnable[o]=!1:"zeroline"in i&&(n.zeroEnable[o]=i.zeroline),"zerolinecolor"in i&&(n.zeroLineColor[o]=c(i.zerolinecolor)),"zerolinewidth"in i&&(n.zeroLineWidth[o]=i.zerolinewidth),"ticks"in i&&i.ticks?n.lineTickEnable[o]=!0:n.lineTickEnable[o]=!1,"ticklen"in i&&(n.lineTickLength[o]=n._defaultLineTickLength[o]=i.ticklen),"tickcolor"in i&&(n.lineTickColor[o]=c(i.tickcolor)),"tickwidth"in i&&(n.lineTickWidth[o]=i.tickwidth),"tickangle"in i&&(n.tickAngle[o]=i.tickangle==="auto"?-3600:Math.PI*-i.tickangle/180),"showticklabels"in i&&(n.tickEnable[o]=i.showticklabels),"tickfont"in i&&(i.tickfont.color&&(n.tickColor[o]=c(i.tickfont.color)),i.tickfont.family&&(n.tickFont[o]=i.tickfont.family),i.tickfont.size&&(n.tickSize[o]=i.tickfont.size),i.tickfont.weight&&(n.tickFontWeight[o]=i.tickfont.weight),i.tickfont.style&&(n.tickFontStyle[o]=i.tickfont.style),i.tickfont.variant&&(n.tickFontVariant[o]=i.tickfont.variant)),"mirror"in i?["ticks","all","allticks"].indexOf(i.mirror)!==-1?(n.lineTickMirror[o]=!0,n.lineMirror[o]=!0):i.mirror===!0?(n.lineTickMirror[o]=!1,n.lineMirror[o]=!0):(n.lineTickMirror[o]=!1,n.lineMirror[o]=!1):n.lineMirror[o]=!1,"showbackground"in i&&i.showbackground!==!1?(n.backgroundEnable[o]=!0,n.backgroundColor[o]=c(i.backgroundcolor)):n.backgroundEnable[o]=!1}};function e(r,a){var n=new S;return n.merge(r,a),n}$.exports=e}),jj=Ft((Q,$)=>{var c=Tv(),g=["xaxis","yaxis","zaxis"];function P(){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 S=P.prototype;S.merge=function(e){for(var r=0;r<3;++r){var a=e[g[r]];if(!a.visible){this.enabled[r]=!1,this.drawSides[r]=!1;continue}this.enabled[r]=a.showspikes,this.colors[r]=c(a.spikecolor),this.drawSides[r]=a.spikesides,this.lineWidth[r]=a.spikethickness}};function t(e){var r=new P;return r.merge(e),r}$.exports=t}),Uj=Ft((Q,$)=>{$.exports=t;var c=Es(),g=bn(),P=["xaxis","yaxis","zaxis"];function S(e){for(var r=new Array(3),a=0;a<3;++a){for(var n=e[a],o=new Array(n.length),i=0;i<n.length;++i)o[i]=n[i].x;r[a]=o}return r}function t(e){for(var r=e.axesOptions,a=e.glplot.axesPixels,n=e.fullSceneLayout,o=[[],[],[]],i=0;i<3;++i){var s=n[P[i]];if(s._length=(a[i].hi-a[i].lo)*a[i].pixelsPerDataUnit/e.dataScale[i],Math.abs(s._length)===1/0||isNaN(s._length))o[i]=[];else{s._input_range=s.range.slice(),s.range[0]=a[i].lo/e.dataScale[i],s.range[1]=a[i].hi/e.dataScale[i],s._m=1/(e.dataScale[i]*a[i].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 x=s.nticks||g.constrain(s._length/40,4,9);c.autoTicks(s,Math.abs(s.range[1]-s.range[0])/x)}for(var y=c.calcTicks(s,{msUTC:!0}),v=0;v<y.length;++v)y[v].x=y[v].x*e.dataScale[i],s.type==="date"&&(y[v].text=y[v].text.replace(/\<br\>/g," "));o[i]=y,s.tickmode=f}}r.ticks=o;for(var i=0;i<3;++i){.5*(e.glplot.bounds[0][i]+e.glplot.bounds[1][i]);for(var v=0;v<2;++v)r.bounds[v][i]=e.glplot.bounds[v][i]}e.contourLevels=S(o)}}),Vj=Ft((Q,$)=>{var c=fp().gl_plot3d,g=c.createCamera,P=c.createScene,S=Bj(),t=C_(),e=Xo(),r=bn(),a=r.preserveDrawingBuffer(),n=Es(),o=Qh(),i=Tv(),s=oS(),f=kM(),x=Nj(),y=jj(),v=Uj(),T=Y0().applyAutorangeOptions,u,b,_=!1;function C(N,V){var H=document.createElement("div"),F=N.container;this.graphDiv=N.graphDiv;var U=document.createElementNS("http://www.w3.org/2000/svg","svg");U.style.position="absolute",U.style.top=U.style.left="0px",U.style.width=U.style.height="100%",U.style["z-index"]=20,U.style["pointer-events"]="none",H.appendChild(U),this.svgContainer=U,H.id=N.id,H.style.position="absolute",H.style.top=H.style.left="0px",H.style.width=H.style.height="100%",F.appendChild(H),this.fullLayout=V,this.id=N.id||"scene",this.fullSceneLayout=V[this.id],this.plotArgs=[[],{},{}],this.axesOptions=x(V,V[this.id]),this.spikeOptions=y(V[this.id]),this.container=H,this.staticMode=!!N.staticPlot,this.pixelRatio=this.pixelRatio||N.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=e.getComponentMethod("annotations3d","convert"),this.drawAnnotations=e.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var M=C.prototype;M.prepareOptions=function(){var N=this,V={canvas:N.canvas,gl:N.gl,glOptions:{preserveDrawingBuffer:a,premultipliedAlpha:!0,antialias:!0},container:N.container,axes:N.axesOptions,spikes:N.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:N.camera,pixelRatio:N.pixelRatio};if(N.staticMode){if(!b&&(u=document.createElement("canvas"),b=S({canvas:u,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!b))throw new Error("error creating static canvas/context for image server");V.gl=b,V.canvas=u}return V};var E=!0;M.tryCreatePlot=function(){var N=this,V=N.prepareOptions(),H=!0;try{N.glplot=P(V)}catch{if(N.staticMode||!E||a)H=!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{a=V.glOptions.preserveDrawingBuffer=!0,N.glplot=P(V)}catch{a=V.glOptions.preserveDrawingBuffer=!1,H=!1}}}return E=!1,H},M.initializeGLCamera=function(){var N=this,V=N.fullSceneLayout.camera,H=V.projection.type==="orthographic";N.camera=g(N.container,{center:[V.center.x,V.center.y,V.center.z],eye:[V.eye.x,V.eye.y,V.eye.z],up:[V.up.x,V.up.y,V.up.z],_ortho:H,zoomMin:.01,zoomMax:100,mode:"orbit"})},M.initializeGLPlot=function(){var N=this;N.initializeGLCamera();var V=N.tryCreatePlot();if(!V)return s(N);N.traces={},N.make4thDimension();var H=N.graphDiv,F=H.layout,U=function(){var q={};return N.isCameraChanged(F)&&(q[N.id+".camera"]=N.getCamera()),N.isAspectChanged(F)&&(q[N.id+".aspectratio"]=N.glplot.getAspectratio(),F[N.id].aspectmode!=="manual"&&(N.fullSceneLayout.aspectmode=F[N.id].aspectmode=q[N.id+".aspectmode"]="manual")),q},W=function(q){if(q.fullSceneLayout.dragmode!==!1){var X=U();q.saveLayout(F),q.graphDiv.emit("plotly_relayout",X)}};return N.glplot.canvas&&(N.glplot.canvas.addEventListener("mouseup",function(){W(N)}),N.glplot.canvas.addEventListener("touchstart",function(){_=!0}),N.glplot.canvas.addEventListener("wheel",function(q){if(H._context._scrollZoom.gl3d){if(N.camera._ortho){var X=q.deltaX>q.deltaY?1.1:.9090909090909091,lt=N.glplot.getAspectratio();N.glplot.setAspectratio({x:X*lt.x,y:X*lt.y,z:X*lt.z})}W(N)}},t?{passive:!1}:!1),N.glplot.canvas.addEventListener("mousemove",function(){if(N.fullSceneLayout.dragmode!==!1&&N.camera.mouseListener.buttons!==0){var q=U();N.graphDiv.emit("plotly_relayouting",q)}}),N.staticMode||N.glplot.canvas.addEventListener("webglcontextlost",function(q){H&&H.emit&&H.emit("plotly_webglcontextlost",{event:q,layer:N.id})},!1)),N.glplot.oncontextloss=function(){N.recoverContext()},N.glplot.onrender=function(){N.render()},!0},M.render=function(){var N=this,V=N.graphDiv,H,F=N.svgContainer,U=N.container.getBoundingClientRect();V._fullLayout._calcInverseTransform(V);var W=V._fullLayout._invScaleX,q=V._fullLayout._invScaleY,X=U.width*W,lt=U.height*q;F.setAttributeNS(null,"viewBox","0 0 "+X+" "+lt),F.setAttributeNS(null,"width",X),F.setAttributeNS(null,"height",lt),v(N),N.glplot.axes.update(N.axesOptions);for(var yt=Object.keys(N.traces),pt=null,st=N.glplot.selection,tt=0;tt<yt.length;++tt)H=N.traces[yt[tt]],H.data.hoverinfo!=="skip"&&H.handlePick(st)&&(pt=H),H.setContourLevels&&H.setContourLevels();function dt(Jt,ge,he){var de=N.fullSceneLayout[Jt+"axis"];return de.type!=="log"&&(ge=de.d2l(ge)),n.hoverLabelText(de,ge,he)}if(pt!==null){var rt=f(N.glplot.cameraParams,st.dataCoordinate);H=pt.data;var at=V._fullData[H.index],vt=st.index,it={xLabel:dt("x",st.traceCoordinate[0],H.xhoverformat),yLabel:dt("y",st.traceCoordinate[1],H.yhoverformat),zLabel:dt("z",st.traceCoordinate[2],H.zhoverformat)},Y=o.castHoverinfo(at,N.fullLayout,vt),ft=(Y||"").split("+"),ut=Y&&Y==="all";!at.hovertemplate&&!ut&&(ft.indexOf("x")===-1&&(it.xLabel=void 0),ft.indexOf("y")===-1&&(it.yLabel=void 0),ft.indexOf("z")===-1&&(it.zLabel=void 0),ft.indexOf("text")===-1&&(st.textLabel=void 0),ft.indexOf("name")===-1&&(pt.name=void 0));var wt,zt=[];H.type==="cone"||H.type==="streamtube"?(it.uLabel=dt("x",st.traceCoordinate[3],H.uhoverformat),(ut||ft.indexOf("u")!==-1)&&zt.push("u: "+it.uLabel),it.vLabel=dt("y",st.traceCoordinate[4],H.vhoverformat),(ut||ft.indexOf("v")!==-1)&&zt.push("v: "+it.vLabel),it.wLabel=dt("z",st.traceCoordinate[5],H.whoverformat),(ut||ft.indexOf("w")!==-1)&&zt.push("w: "+it.wLabel),it.normLabel=st.traceCoordinate[6].toPrecision(3),(ut||ft.indexOf("norm")!==-1)&&zt.push("norm: "+it.normLabel),H.type==="streamtube"&&(it.divergenceLabel=st.traceCoordinate[7].toPrecision(3),(ut||ft.indexOf("divergence")!==-1)&&zt.push("divergence: "+it.divergenceLabel)),st.textLabel&&zt.push(st.textLabel),wt=zt.join("<br>")):H.type==="isosurface"||H.type==="volume"?(it.valueLabel=n.hoverLabelText(N._mockAxis,N._mockAxis.d2l(st.traceCoordinate[3]),H.valuehoverformat),zt.push("value: "+it.valueLabel),st.textLabel&&zt.push(st.textLabel),wt=zt.join("<br>")):wt=st.textLabel;var Pt={x:st.traceCoordinate[0],y:st.traceCoordinate[1],z:st.traceCoordinate[2],data:at._input,fullData:at,curveNumber:at.index,pointNumber:vt};o.appendArrayPointValue(Pt,at,vt),H._module.eventData&&(Pt=at._module.eventData(Pt,st,at,{},vt));var Wt={points:[Pt]};if(N.fullSceneLayout.hovermode){var Ht=[];o.loneHover({trace:at,x:(.5+.5*rt[0]/rt[3])*X,y:(.5-.5*rt[1]/rt[3])*lt,xLabel:it.xLabel,yLabel:it.yLabel,zLabel:it.zLabel,text:wt,name:pt.name,color:o.castHoverOption(at,vt,"bgcolor")||pt.color,borderColor:o.castHoverOption(at,vt,"bordercolor"),fontFamily:o.castHoverOption(at,vt,"font.family"),fontSize:o.castHoverOption(at,vt,"font.size"),fontColor:o.castHoverOption(at,vt,"font.color"),nameLength:o.castHoverOption(at,vt,"namelength"),textAlign:o.castHoverOption(at,vt,"align"),hovertemplate:r.castOption(at,vt,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Pt,it),eventData:[Pt]},{container:F,gd:V,inOut_bbox:Ht}),Pt.bbox=Ht[0]}st.distance<5&&(st.buttons||_)?V.emit("plotly_click",Wt):V.emit("plotly_hover",Wt),this.oldEventData=Wt}else o.loneUnhover(F),this.oldEventData&&V.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;N.drawAnnotations(N)},M.recoverContext=function(){var N=this;N.glplot.dispose();var V=function(){if(N.glplot.gl.isContextLost()){requestAnimationFrame(V);return}if(!N.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}N.plot.apply(N,N.plotArgs)};requestAnimationFrame(V)};var A=["xaxis","yaxis","zaxis"];function h(N,V,H){for(var F=N.fullSceneLayout,U=0;U<3;U++){var W=A[U],q=W.charAt(0),X=F[W],lt=V[q],yt=V[q+"calendar"],pt=V["_"+q+"length"];if(!r.isArrayOrTypedArray(lt))H[0][U]=Math.min(H[0][U],0),H[1][U]=Math.max(H[1][U],pt-1);else for(var st,tt=0;tt<(pt||lt.length);tt++)if(r.isArrayOrTypedArray(lt[tt]))for(var dt=0;dt<lt[tt].length;++dt)st=X.d2l(lt[tt][dt],0,yt),!isNaN(st)&&isFinite(st)&&(H[0][U]=Math.min(H[0][U],st),H[1][U]=Math.max(H[1][U],st));else st=X.d2l(lt[tt],0,yt),!isNaN(st)&&isFinite(st)&&(H[0][U]=Math.min(H[0][U],st),H[1][U]=Math.max(H[1][U],st))}}function p(N,V){for(var H=N.fullSceneLayout,F=H.annotations||[],U=0;U<3;U++)for(var W=A[U],q=W.charAt(0),X=H[W],lt=0;lt<F.length;lt++){var yt=F[lt];if(yt.visible){var pt=X.r2l(yt[q]);!isNaN(pt)&&isFinite(pt)&&(V[0][U]=Math.min(V[0][U],pt),V[1][U]=Math.max(V[1][U],pt))}}}M.plot=function(N,V,H){var F=this;if(F.plotArgs=[N,V,H],!F.glplot.contextLost){var U,W,q,X,lt,yt,pt=V[F.id],st=H[F.id];F.fullLayout=V,F.fullSceneLayout=pt,F.axesOptions.merge(V,pt),F.spikeOptions.merge(pt),F.setViewport(pt),F.updateFx(pt.dragmode,pt.hovermode),F.camera.enableWheel=F.graphDiv._context._scrollZoom.gl3d,F.glplot.setClearColor(i(pt.bgcolor)),F.setConvert(lt),N?Array.isArray(N)||(N=[N]):N=[];var tt=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(q=0;q<N.length;++q)U=N[q],!(U.visible!==!0||U._length===0)&&h(this,U,tt);p(this,tt);var dt=[1,1,1];for(X=0;X<3;++X)tt[1][X]===tt[0][X]?dt[X]=1:dt[X]=1/(tt[1][X]-tt[0][X]);for(F.dataScale=dt,F.convertAnnotations(this),q=0;q<N.length;++q)U=N[q],!(U.visible!==!0||U._length===0)&&(W=F.traces[U.uid],W?W.data.type===U.type?W.update(U):(W.dispose(),W=U._module.plot(this,U),F.traces[U.uid]=W):(W=U._module.plot(this,U),F.traces[U.uid]=W),W.name=U.name);var rt=Object.keys(F.traces);t:for(q=0;q<rt.length;++q){for(X=0;X<N.length;++X)if(N[X].uid===rt[q]&&N[X].visible===!0&&N[X]._length!==0)continue t;W=F.traces[rt[q]],W.dispose(),delete F.traces[rt[q]]}F.glplot.objects.sort(function(Te,He){return Te._trace.data.index-He._trace.data.index});var at=[[0,0,0],[0,0,0]],vt=[],it={};for(q=0;q<3;++q){lt=pt[A[q]],yt=lt.type,yt in it?(it[yt].acc*=dt[q],it[yt].count+=1):it[yt]={acc:dt[q],count:1};var Y;if(lt.autorange){at[0][q]=1/0,at[1][q]=-1/0;var ft=F.glplot.objects,ut=F.fullSceneLayout.annotations||[],wt=lt._name.charAt(0);for(X=0;X<ft.length;X++){var zt=ft[X],Pt=zt.bounds,Wt=zt._trace.data._pad||0;zt.constructor.name==="ErrorBars"&&lt._lowerLogErrorBound?at[0][q]=Math.min(at[0][q],lt._lowerLogErrorBound):at[0][q]=Math.min(at[0][q],Pt[0][q]/dt[q]-Wt),at[1][q]=Math.max(at[1][q],Pt[1][q]/dt[q]+Wt)}for(X=0;X<ut.length;X++){var Ht=ut[X];if(Ht.visible){var Jt=lt.r2l(Ht[wt]);at[0][q]=Math.min(at[0][q],Jt),at[1][q]=Math.max(at[1][q],Jt)}}if("rangemode"in lt&&lt.rangemode==="tozero"&&(at[0][q]=Math.min(at[0][q],0),at[1][q]=Math.max(at[1][q],0)),at[0][q]>at[1][q])at[0][q]=-1,at[1][q]=1;else{var ge=at[1][q]-at[0][q];at[0][q]-=ge/32,at[1][q]+=ge/32}if(Y=[at[0][q],at[1][q]],Y=T(Y,lt),at[0][q]=Y[0],at[1][q]=Y[1],lt.isReversed()){var he=at[0][q];at[0][q]=at[1][q],at[1][q]=he}}else Y=lt.range,at[0][q]=lt.r2l(Y[0]),at[1][q]=lt.r2l(Y[1]);at[0][q]===at[1][q]&&(at[0][q]-=1,at[1][q]+=1),vt[q]=at[1][q]-at[0][q],lt.range=[at[0][q],at[1][q]],lt.limitRange(),F.glplot.setBounds(q,{min:lt.range[0]*dt[q],max:lt.range[1]*dt[q]})}var de,se=pt.aspectmode;if(se==="cube")de=[1,1,1];else if(se==="manual"){var Tt=pt.aspectratio;de=[Tt.x,Tt.y,Tt.z]}else if(se==="auto"||se==="data"){var Lt=[1,1,1];for(q=0;q<3;++q){lt=pt[A[q]],yt=lt.type;var Mt=it[yt];Lt[q]=Math.pow(Mt.acc,1/Mt.count)/dt[q]}se==="data"||Math.max.apply(null,Lt)/Math.min.apply(null,Lt)<=4?de=Lt:de=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");pt.aspectratio.x=st.aspectratio.x=de[0],pt.aspectratio.y=st.aspectratio.y=de[1],pt.aspectratio.z=st.aspectratio.z=de[2],F.glplot.setAspectratio(pt.aspectratio),F.viewInitial.aspectratio||(F.viewInitial.aspectratio={x:pt.aspectratio.x,y:pt.aspectratio.y,z:pt.aspectratio.z}),F.viewInitial.aspectmode||(F.viewInitial.aspectmode=pt.aspectmode);var te=pt.domain||null,ve=V._size||null;if(te&&ve){var oe=F.container.style;oe.position="absolute",oe.left=ve.l+te.x[0]*ve.w+"px",oe.top=ve.t+(1-te.y[1])*ve.h+"px",oe.width=ve.w*(te.x[1]-te.x[0])+"px",oe.height=ve.h*(te.y[1]-te.y[0])+"px"}F.glplot.redraw()}},M.destroy=function(){var N=this;N.glplot&&(N.camera.mouseListener.enabled=!1,N.container.removeEventListener("wheel",N.camera.wheelListener),N.camera=null,N.glplot.dispose(),N.container.parentNode.removeChild(N.container),N.glplot=null)};function k(N){return[[N.eye.x,N.eye.y,N.eye.z],[N.center.x,N.center.y,N.center.z],[N.up.x,N.up.y,N.up.z]]}function w(N){return{up:{x:N.up[0],y:N.up[1],z:N.up[2]},center:{x:N.center[0],y:N.center[1],z:N.center[2]},eye:{x:N.eye[0],y:N.eye[1],z:N.eye[2]},projection:{type:N._ortho===!0?"orthographic":"perspective"}}}M.getCamera=function(){var N=this;return N.camera.view.recalcMatrix(N.camera.view.lastT()),w(N.camera)},M.setViewport=function(N){var V=this,H=N.camera;V.camera.lookAt.apply(this,k(H)),V.glplot.setAspectratio(N.aspectratio);var F=H.projection.type==="orthographic",U=V.camera._ortho;F!==U&&(V.glplot.redraw(),V.glplot.clearRGBA(),V.glplot.dispose(),V.initializeGLPlot())},M.isCameraChanged=function(N){var V=this,H=V.getCamera(),F=r.nestedProperty(N,V.id+".camera"),U=F.get();function W(yt,pt,st,tt){var dt=["up","center","eye"],rt=["x","y","z"];return pt[dt[st]]&&yt[dt[st]][rt[tt]]===pt[dt[st]][rt[tt]]}var q=!1;if(U===void 0)q=!0;else{for(var X=0;X<3;X++)for(var lt=0;lt<3;lt++)if(!W(H,U,X,lt)){q=!0;break}(!U.projection||H.projection&&H.projection.type!==U.projection.type)&&(q=!0)}return q},M.isAspectChanged=function(N){var V=this,H=V.glplot.getAspectratio(),F=r.nestedProperty(N,V.id+".aspectratio"),U=F.get();return U===void 0||U.x!==H.x||U.y!==H.y||U.z!==H.z},M.saveLayout=function(N){var V=this,H=V.fullLayout,F,U,W,q,X,lt,yt=V.isCameraChanged(N),pt=V.isAspectChanged(N),st=yt||pt;if(st){var tt={};if(yt&&(F=V.getCamera(),U=r.nestedProperty(N,V.id+".camera"),W=U.get(),tt[V.id+".camera"]=W),pt&&(q=V.glplot.getAspectratio(),X=r.nestedProperty(N,V.id+".aspectratio"),lt=X.get(),tt[V.id+".aspectratio"]=lt),e.call("_storeDirectGUIEdit",N,H._preGUI,tt),yt){U.set(F);var dt=r.nestedProperty(H,V.id+".camera");dt.set(F)}if(pt){X.set(q);var rt=r.nestedProperty(H,V.id+".aspectratio");rt.set(q),V.glplot.redraw()}}return st},M.updateFx=function(N,V){var H=this,F=H.camera;if(F)if(N==="orbit")F.mode="orbit",F.keyBindingMode="rotate";else if(N==="turntable"){F.up=[0,0,1],F.mode="turntable",F.keyBindingMode="rotate";var U=H.graphDiv,W=U._fullLayout,q=H.fullSceneLayout.camera,X=q.up.x,lt=q.up.y,yt=q.up.z;if(yt/Math.sqrt(X*X+lt*lt+yt*yt)<.999){var pt=H.id+".camera.up",st={x:0,y:0,z:1},tt={};tt[pt]=st;var dt=U.layout;e.call("_storeDirectGUIEdit",dt,W._preGUI,tt),q.up=st,r.nestedProperty(dt,pt).set(st)}}else F.keyBindingMode=N;H.fullSceneLayout.hovermode=V};function R(N,V,H){for(var F=0,U=H-1;F<U;++F,--U)for(var W=0;W<V;++W)for(var q=0;q<4;++q){var X=4*(V*F+W)+q,lt=4*(V*U+W)+q,yt=N[X];N[X]=N[lt],N[lt]=yt}}function O(N,V,H){for(var F=0;F<H;++F)for(var U=0;U<V;++U){var W=4*(V*F+U),q=N[W+3];if(q>0)for(var X=255/q,lt=0;lt<3;++lt)N[W+lt]=Math.min(X*N[W+lt],255)}}M.toImage=function(N){var V=this;N||(N="png"),V.staticMode&&V.container.appendChild(u),V.glplot.redraw();var H=V.glplot.gl,F=H.drawingBufferWidth,U=H.drawingBufferHeight;H.bindFramebuffer(H.FRAMEBUFFER,null);var W=new Uint8Array(F*U*4);H.readPixels(0,0,F,U,H.RGBA,H.UNSIGNED_BYTE,W),R(W,F,U),O(W,F,U);var q=document.createElement("canvas");q.width=F,q.height=U;var X=q.getContext("2d",{willReadFrequently:!0}),lt=X.createImageData(F,U);lt.data.set(W),X.putImageData(lt,0,0);var yt;switch(N){case"jpeg":yt=q.toDataURL("image/jpeg");break;case"webp":yt=q.toDataURL("image/webp");break;default:yt=q.toDataURL("image/png")}return V.staticMode&&V.container.removeChild(u),yt},M.setConvert=function(){for(var N=this,V=0;V<3;V++){var H=N.fullSceneLayout[A[V]];n.setConvert(H,N.fullLayout),H.setScale=r.noop}},M.make4thDimension=function(){var N=this,V=N.graphDiv,H=V._fullLayout;N._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},n.setConvert(N._mockAxis,H)},$.exports=C}),Hj=Ft((Q,$)=>{$.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}),sS=Ft((Q,$)=>{var c=li(),g=Ad(),P=Ta().extendFlat,S=Yc().overrideAll;$.exports=S({visible:g.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:c.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:g.color,categoryorder:g.categoryorder,categoryarray:g.categoryarray,title:{text:g.title.text,font:g.title.font},type:P({},g.type,{values:["-","linear","log","date","category"]}),autotypenumbers:g.autotypenumbers,autorange:g.autorange,autorangeoptions:{minallowed:g.autorangeoptions.minallowed,maxallowed:g.autorangeoptions.maxallowed,clipmin:g.autorangeoptions.clipmin,clipmax:g.autorangeoptions.clipmax,include:g.autorangeoptions.include,editType:"plot"},rangemode:g.rangemode,minallowed:g.minallowed,maxallowed:g.maxallowed,range:P({},g.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:g.minor.tickmode,nticks:g.nticks,tick0:g.tick0,dtick:g.dtick,tickvals:g.tickvals,ticktext:g.ticktext,ticks:g.ticks,mirror:g.mirror,ticklen:g.ticklen,tickwidth:g.tickwidth,tickcolor:g.tickcolor,showticklabels:g.showticklabels,labelalias:g.labelalias,tickfont:g.tickfont,tickangle:g.tickangle,tickprefix:g.tickprefix,showtickprefix:g.showtickprefix,ticksuffix:g.ticksuffix,showticksuffix:g.showticksuffix,showexponent:g.showexponent,exponentformat:g.exponentformat,minexponent:g.minexponent,separatethousands:g.separatethousands,tickformat:g.tickformat,tickformatstops:g.tickformatstops,hoverformat:g.hoverformat,showline:g.showline,linecolor:g.linecolor,linewidth:g.linewidth,showgrid:g.showgrid,gridcolor:P({},g.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:g.gridwidth,zeroline:g.zeroline,zerolinecolor:g.zerolinecolor,zerolinewidth:g.zerolinewidth},"plot","from-root")}),lS=Ft((Q,$)=>{var c=sS(),g=Nh().attributes,P=Ta().extendFlat,S=bn().counterRegex;function t(e,r,a){return{x:{valType:"number",dflt:e,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:a,editType:"camera"},editType:"camera"}}$.exports={_arrayAttrRegexps:[S("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:P(t(0,0,1),{}),center:P(t(0,0,0),{}),eye:P(t(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:g({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:c,yaxis:c,zaxis:c,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}),Wj=Ft((Q,$)=>{var c=fo().mix,g=bn(),P=pu(),S=sS(),t=wp(),e=Ky(),r=["xaxis","yaxis","zaxis"],a=13600/187;$.exports=function(n,o,i){var s,f;function x(T,u){return g.coerce(s,f,S,T,u)}for(var y=0;y<r.length;y++){var v=r[y];s=n[v]||{},f=P.newContainer(o,v),f._id=v[0]+i.scene,f._name=v,t(s,f,x,i),e(s,f,x,{font:i.font,letter:v[0],data:i.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:i.bgColor,calendar:i.calendar},i.fullLayout),x("gridcolor",c(f.color,i.bgColor,a).toRgbString()),x("title.text",v[0]),f.setScale=g.noop,x("showspikes")&&(x("spikesides"),x("spikethickness"),x("spikecolor",f.color)),x("showaxeslabels"),x("showbackground")&&x("backgroundcolor")}}}),qj=Ft((Q,$)=>{var c=bn(),g=li(),P=Xo(),S=P1(),t=Wj(),e=lS(),r=ud().getSubplotData,a="gl3d";$.exports=function(o,i,s){var f=i._basePlotModules.length>1;function x(y){if(!f){var v=c.validate(o[y],e[y]);if(v)return o[y]}}S(o,i,s,{type:a,attributes:e,handleDefaults:n,fullLayout:i,font:i.font,fullData:s,getDfltFromLayout:x,autotypenumbersDflt:i.autotypenumbers,paper_bgcolor:i.paper_bgcolor,calendar:i.calendar})};function n(o,i,s,f){for(var x=s("bgcolor"),y=g.combine(x,f.paper_bgcolor),v=["up","center","eye"],T=0;T<v.length;T++)s("camera."+v[T]+".x"),s("camera."+v[T]+".y"),s("camera."+v[T]+".z");s("camera.projection.type");var u=!!s("aspectratio.x")&&!!s("aspectratio.y")&&!!s("aspectratio.z"),b=u?"manual":"auto",_=s("aspectmode",b);u||(o.aspectratio=i.aspectratio={x:1,y:1,z:1},_==="manual"&&(i.aspectmode="auto"),o.aspectmode=i.aspectmode);var C=r(f.fullData,a,f.id);t(o,i,{font:f.font,scene:f.id,data:C,bgColor:y,calendar:f.calendar,autotypenumbersDflt:f.autotypenumbersDflt,fullLayout:f.fullLayout}),P.getComponentMethod("annotations3d","handleDefaults")(o,i,f);var M=f.getDfltFromLayout("dragmode");if(M!==!1&&!M)if(M="orbit",o.camera&&o.camera.up){var E=o.camera.up.x,A=o.camera.up.y,h=o.camera.up.z;h!==0&&(!E||!A||!h||h/Math.sqrt(E*E+A*A+h*h)>.999)&&(M="turntable")}else M="turntable";s("dragmode",M),s("hovermode",f.getDfltFromLayout("hovermode"))}}),j1=Ft(Q=>{var $=Yc().overrideAll,c=Ao(),g=Vj(),P=ud().getSubplotData,S=bn(),t=Op(),e="gl3d",r="scene";Q.name=e,Q.attr=r,Q.idRoot=r,Q.idRegex=Q.attrRegex=S.counterRegex("scene"),Q.attributes=Hj(),Q.layoutAttributes=lS(),Q.baseLayoutAttrOverrides=$({hoverlabel:c.hoverlabel},"plot","nested"),Q.supplyLayoutDefaults=qj(),Q.plot=function(a){for(var n=a._fullLayout,o=a._fullData,i=n._subplots[e],s=0;s<i.length;s++){var f=i[s],x=P(o,e,f),y=n[f],v=y.camera,T=y._scene;T||(T=new g({id:f,graphDiv:a,container:a.querySelector(".gl-container"),staticPlot:a._context.staticPlot,plotGlPixelRatio:a._context.plotGlPixelRatio,camera:v},n),y._scene=T),T.viewInitial||(T.viewInitial={up:{x:v.up.x,y:v.up.y,z:v.up.z},eye:{x:v.eye.x,y:v.eye.y,z:v.eye.z},center:{x:v.center.x,y:v.center.y,z:v.center.z}}),T.plot(x,n,a.layout)}},Q.clean=function(a,n,o,i){for(var s=i._subplots[e]||[],f=0;f<s.length;f++){var x=s[f];!n[x]&&i[x]._scene&&(i[x]._scene.destroy(),i._infolayer&&i._infolayer.selectAll(".annotation-"+x).remove())}},Q.toSVG=function(a){for(var n=a._fullLayout,o=n._subplots[e],i=n._size,s=0;s<o.length;s++){var f=n[o[s]],x=f.domain,y=f._scene,v=y.toImage("png"),T=n._glimages.append("svg:image");T.attr({xmlns:t.svg,"xlink:href":v,x:i.l+i.w*x.x[0],y:i.t+i.h*(1-x.y[1]),width:i.w*(x.x[1]-x.x[0]),height:i.h*(x.y[1]-x.y[0]),preserveAspectRatio:"none"}),y.destroy()}},Q.cleanId=function(a){if(a.match(/^scene[0-9]*$/)){var n=a.substr(5);return n==="1"&&(n=""),r+n}},Q.updateFx=function(a){for(var n=a._fullLayout,o=n._subplots[e],i=0;i<o.length;i++){var s=n[o[i]]._scene;s.updateFx(n.dragmode,n.hovermode)}}}),Zj=Ft((Q,$)=>{$.exports={plot:Oj(),attributes:aS(),markerSymbols:Hk(),supplyDefaults:Dj(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:Fj(),moduleType:"trace",name:"scatter3d",basePlotModule:j1(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}),$j=Ft((Q,$)=>{$.exports=Zj()}),g3=Ft((Q,$)=>{var c=li(),g=Tc(),P=fh().axisHoverFormat,{hovertemplateAttrs:S,templatefallbackAttrs:t}=$u(),e=$o(),r=Ta().extendFlat,a=Yc().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:c.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:c.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var i=$.exports=a(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:S(),hovertemplatefallback:t(),xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},g("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x: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");i.x.editType=i.y.editType=i.z.editType="calc+clearAxisTypes"}),uS=Ft((Q,$)=>{var c=Xo(),g=bn(),P=mc(),S=g3(),t=.1;function e(o,i){for(var s=[],f=32,x=0;x<f;x++){var y=x/(f-1),v=i+(1-i)*(1-Math.pow(Math.sin(o*y*Math.PI),2));s.push([y,Math.max(0,Math.min(1,v))])}return s}function r(o){var i=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]<i)return!1;i=+f[0]}return!0}function a(o,i,s,f){var x,y;function v(h,p){return g.coerce(o,i,S,h,p)}var T=v("x"),u=v("y"),b=v("z");if(!b||!b.length||T&&T.length<1||u&&u.length<1){i.visible=!1;return}i._xlength=Array.isArray(T)&&g.isArrayOrTypedArray(T[0])?b.length:b[0].length,i._ylength=b.length;var _=c.getComponentMethod("calendars","handleTraceDefaults");_(o,i,["x","y","z"],f),v("text"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),v("xhoverformat"),v("yhoverformat"),v("zhoverformat"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","connectgaps","opacity"].forEach(function(h){v(h)}),v("surfacecolor");var C=["x","y","z"];for(x=0;x<3;++x){var M="contours."+C[x],E=v(M+".show"),A=v(M+".highlight");if(E||A)for(y=0;y<3;++y)v(M+".project."+C[y]);E&&(v(M+".color"),v(M+".width"),v(M+".usecolormap")),A&&(v(M+".highlightcolor"),v(M+".highlightwidth")),v(M+".start"),v(M+".end"),v(M+".size")}P(o,i,f,v,{prefix:"",cLetter:"c"}),n(o,i,f,v),i._length=null}function n(o,i,s,f){var x=f("opacityscale");x==="max"?i.opacityscale=[[0,t],[1,1]]:x==="min"?i.opacityscale=[[0,1],[1,t]]:x==="extremes"?i.opacityscale=e(1,t):r(x)||(i.opacityscale=void 0)}$.exports={supplyDefaults:a,opacityscaleDefaults:n}}),Gj=Ft((Q,$)=>{var c=Jd();$.exports=function(g,P){P.surfacecolor?c(g,P,{vals:P.surfacecolor,containerStr:"",cLetter:"c"}):c(g,P,{vals:P.z,containerStr:"",cLetter:"c"})}}),Yj=Ft((Q,$)=>{var c=fp().gl_surface3d,g=fp().ndarray,P=fp().ndarray_linear_interpolate.d2,S=N6(),t=j6(),e=bn().isArrayOrTypedArray,r=Av().parseColorScale,a=Tv(),n=Xc().extractOpts;function o(k,w,R){this.scene=k,this.uid=R,this.surface=w,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 i=o.prototype;i.getXat=function(k,w,R,O){var N=e(this.data.x)?e(this.data.x[0])?this.data.x[w][k]:this.data.x[k]:k;return R===void 0?N:O.d2l(N,0,R)},i.getYat=function(k,w,R,O){var N=e(this.data.y)?e(this.data.y[0])?this.data.y[w][k]:this.data.y[w]:w;return R===void 0?N:O.d2l(N,0,R)},i.getZat=function(k,w,R,O){var N=this.data.z[w][k];return N===null&&this.data.connectgaps&&this.data._interpolatedZ&&(N=this.data._interpolatedZ[w][k]),R===void 0?N:O.d2l(N,0,R)},i.handlePick=function(k){if(k.object===this.surface){var w=(k.data.index[0]-1)/this.dataScaleX-1,R=(k.data.index[1]-1)/this.dataScaleY-1,O=Math.max(Math.min(Math.round(w),this.data.z[0].length-1),0),N=Math.max(Math.min(Math.round(R),this.data._ylength-1),0);k.index=[O,N],k.traceCoordinate=[this.getXat(O,N),this.getYat(O,N),this.getZat(O,N)],k.dataCoordinate=[this.getXat(O,N,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(O,N,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(O,N,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var V=0;V<3;V++){var H=k.dataCoordinate[V];H!=null&&(k.dataCoordinate[V]*=this.scene.dataScale[V])}var F=this.data.hovertext||this.data.text;return e(F)&&F[N]&&F[N][O]!==void 0?k.textLabel=F[N][O]:F?k.textLabel=F:k.textLabel="",k.data.dataCoordinate=k.dataCoordinate.slice(),this.surface.highlight(k.data),this.scene.glplot.spikes.position=k.dataCoordinate,!0}};function s(k){var w=k[0].rgb,R=k[k.length-1].rgb;return w[0]===R[0]&&w[1]===R[1]&&w[2]===R[2]&&w[3]===R[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 x(k,w){if(k<w)return 0;for(var R=0;Math.floor(k%w)===0;)k/=w,R++;return R}function y(k){for(var w=[],R=0;R<f.length;R++){var O=f[R];w.push(x(k,O))}return w}function v(k){for(var w=y(k),R=k,O=0;O<f.length;O++)if(w[O]>0){R=f[O];break}return R}function T(k,w){if(!(k<1||w<1)){for(var R=y(k),O=y(w),N=1,V=0;V<f.length;V++)N*=Math.pow(f[V],Math.max(R[V],O[V]));return N}}function u(k){if(k.length!==0){for(var w=1,R=0;R<k.length;R++)w=T(w,k[R]);return w}}i.calcXnums=function(k){var w,R=[];for(w=1;w<k;w++){var O=this.getXat(w-1,0),N=this.getXat(w,0);N!==O&&O!==void 0&&O!==null&&N!==void 0&&N!==null?R[w-1]=Math.abs(N-O):R[w-1]=0}var V=0;for(w=1;w<k;w++)V+=R[w-1];for(w=1;w<k;w++)R[w-1]===0?R[w-1]=1:R[w-1]=Math.round(V/R[w-1]);return R},i.calcYnums=function(k){var w,R=[];for(w=1;w<k;w++){var O=this.getYat(0,w-1),N=this.getYat(0,w);N!==O&&O!==void 0&&O!==null&&N!==void 0&&N!==null?R[w-1]=Math.abs(N-O):R[w-1]=0}var V=0;for(w=1;w<k;w++)V+=R[w-1];for(w=1;w<k;w++)R[w-1]===0?R[w-1]=1:R[w-1]=Math.round(V/R[w-1]);return R};var b=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],_=b[9],C=b[13];i.estimateScale=function(k,w){for(var R=w===0?this.calcXnums(k):this.calcYnums(k),O=1+u(R);O<_;)O*=2;for(;O>C;)O--,O/=v(O),O++,O<_&&(O=C);var N=Math.round(O/k);return N>1?N:1};function M(k,w,R){var O=R[8]+R[2]*w[0]+R[5]*w[1];return k[0]=(R[6]+R[0]*w[0]+R[3]*w[1])/O,k[1]=(R[7]+R[1]*w[0]+R[4]*w[1])/O,k}function E(k,w,R){return A(k,w,M,R),k}function A(k,w,R,O){for(var N=[0,0],V=k.shape[0],H=k.shape[1],F=0;F<V;F++)for(var U=0;U<H;U++)R(N,[F,U],O),k.set(F,U,P(w,N[0],N[1]));return k}i.refineCoords=function(k){for(var w=this.dataScaleX,R=this.dataScaleY,O=k[0].shape[0],N=k[0].shape[1],V=Math.floor(k[0].shape[0]*w+1)|0,H=Math.floor(k[0].shape[1]*R+1)|0,F=1+O+1,U=1+N+1,W=g(new Float32Array(F*U),[F,U]),q=[1/w,0,0,0,1/R,0,0,0,1],X=0;X<k.length;++X){this.surface.padField(W,k[X]);var lt=g(new Float32Array(V*H),[V,H]);E(lt,W,q),k[X]=lt}};function h(k,w){for(var R=!1,O=0;O<k.length;O++)if(w===k[O]){R=!0;break}R===!1&&k.push(w)}i.setContourLevels=function(){var k=[[],[],[]],w=[!1,!1,!1],R=!1,O,N,V;for(O=0;O<3;++O)if(this.showContour[O]&&(R=!0,this.contourSize[O]>0&&this.contourStart[O]!==null&&this.contourEnd[O]!==null&&this.contourEnd[O]>this.contourStart[O]))for(w[O]=!0,N=this.contourStart[O];N<this.contourEnd[O];N+=this.contourSize[O])V=N*this.scene.dataScale[O],h(k[O],V);if(R){var H=[[],[],[]];for(O=0;O<3;++O)this.showContour[O]&&(H[O]=w[O]?k[O]:this.scene.contourLevels[O]);this.surface.update({levels:H})}},i.update=function(k){var w=this.scene,R=w.fullSceneLayout,O=this.surface,N=r(k),V=w.dataScale,H=k.z[0].length,F=k._ylength,U=w.contourLevels;this.data=k;var W,q,X,lt,yt=[];for(W=0;W<3;W++)for(yt[W]=[],q=0;q<H;q++)yt[W][q]=[];for(q=0;q<H;q++)for(X=0;X<F;X++)yt[0][q][X]=this.getXat(q,X,k.xcalendar,R.xaxis),yt[1][q][X]=this.getYat(q,X,k.ycalendar,R.yaxis),yt[2][q][X]=this.getZat(q,X,k.zcalendar,R.zaxis);if(k.connectgaps)for(k._emptypoints=t(yt[2]),S(yt[2],k._emptypoints),k._interpolatedZ=[],q=0;q<H;q++)for(k._interpolatedZ[q]=[],X=0;X<F;X++)k._interpolatedZ[q][X]=yt[2][q][X];for(W=0;W<3;W++)for(q=0;q<H;q++)for(X=0;X<F;X++)lt=yt[W][q][X],lt==null?yt[W][q][X]=NaN:lt=yt[W][q][X]*=V[W];for(W=0;W<3;W++)for(q=0;q<H;q++)for(X=0;X<F;X++)lt=yt[W][q][X],lt!=null&&(this.minValues[W]>lt&&(this.minValues[W]=lt),this.maxValues[W]<lt&&(this.maxValues[W]=lt));for(W=0;W<3;W++)this.objectOffset[W]=.5*(this.minValues[W]+this.maxValues[W]);for(W=0;W<3;W++)for(q=0;q<H;q++)for(X=0;X<F;X++)lt=yt[W][q][X],lt!=null&&(yt[W][q][X]-=this.objectOffset[W]);var pt=[g(new Float32Array(H*F),[H,F]),g(new Float32Array(H*F),[H,F]),g(new Float32Array(H*F),[H,F])];for(W=0;W<3;W++)for(q=0;q<H;q++)for(X=0;X<F;X++)pt[W].set(q,X,yt[W][q][X]);yt=[];var st={colormap:N,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!k.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacityscale:k.opacityscale,opacity:k.opacity},tt=n(k);if(st.intensityBounds=[tt.min,tt.max],k.surfacecolor){var dt=g(new Float32Array(H*F),[H,F]);for(q=0;q<H;q++)for(X=0;X<F;X++)dt.set(q,X,k.surfacecolor[X][q]);pt.push(dt)}else st.intensityBounds[0]*=V[2],st.intensityBounds[1]*=V[2];(C<pt[0].shape[0]||C<pt[0].shape[1])&&(this.refineData=!1),this.refineData===!0&&(this.dataScaleX=this.estimateScale(pt[0].shape[0],0),this.dataScaleY=this.estimateScale(pt[0].shape[1],1),(this.dataScaleX!==1||this.dataScaleY!==1)&&this.refineCoords(pt)),k.surfacecolor&&(st.intensity=pt.pop());var rt=[!0,!0,!0],at=["x","y","z"];for(W=0;W<3;++W){var vt=k.contours[at[W]];rt[W]=vt.highlight,st.showContour[W]=vt.show||vt.highlight,st.showContour[W]&&(st.contourProject[W]=[vt.project.x,vt.project.y,vt.project.z],vt.show?(this.showContour[W]=!0,st.levels[W]=U[W],O.highlightColor[W]=st.contourColor[W]=a(vt.color),vt.usecolormap?O.highlightTint[W]=st.contourTint[W]=0:O.highlightTint[W]=st.contourTint[W]=1,st.contourWidth[W]=vt.width,this.contourStart[W]=vt.start,this.contourEnd[W]=vt.end,this.contourSize[W]=vt.size):(this.showContour[W]=!1,this.contourStart[W]=null,this.contourEnd[W]=null,this.contourSize[W]=0),vt.highlight&&(st.dynamicColor[W]=a(vt.highlightcolor),st.dynamicWidth[W]=vt.highlightwidth))}s(N)&&(st.vertexColor=!0),st.objectOffset=this.objectOffset,st.coords=pt,O.update(st),O.visible=k.visible,O.enableDynamic=rt,O.enableHighlight=rt,O.snapToData=!0,"lighting"in k&&(O.ambientLight=k.lighting.ambient,O.diffuseLight=k.lighting.diffuse,O.specularLight=k.lighting.specular,O.roughness=k.lighting.roughness,O.fresnel=k.lighting.fresnel),"lightposition"in k&&(O.lightPosition=[k.lightposition.x,k.lightposition.y,k.lightposition.z])},i.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()};function p(k,w){var R=k.glplot.gl,O=c({gl:R}),N=new o(k,O,w.uid);return O._trace=N,N.update(w),k.glplot.add(O),N}$.exports=p}),Kj=Ft((Q,$)=>{$.exports={attributes:g3(),supplyDefaults:uS().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:Gj(),plot:Yj(),moduleType:"trace",name:"surface",basePlotModule:j1(),categories:["gl3d","2dMap","showLegend"],meta:{}}}),Xj=Ft((Q,$)=>{$.exports=Kj()}),cb=Ft((Q,$)=>{var c=Tc(),g=fh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:S}=$u(),t=g3(),e=$o(),r=Ta().extendFlat;$.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:P({editType:"calc"}),hovertemplatefallback:S({editType:"calc"}),xhoverformat:g("x"),yhoverformat:g("y"),zhoverformat:g("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"}},c("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity: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})})}),Wk=Ft((Q,$)=>{var c=Tc(),g=fh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:S}=$u(),t=cb(),e=$o(),r=Ta().extendFlat,a=Yc().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 i=$.exports=a(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:P(),hovertemplatefallback:S(),xhoverformat:g("x"),yhoverformat:g("y"),zhoverformat:g("z"),valuehoverformat:g("value",1),showlegend:r({},e.showlegend,{dflt:!1})},c("",{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");i.flatshading.dflt=!0,i.lighting.facenormalsepsilon.dflt=0,i.x.editType=i.y.editType=i.z.editType=i.value.editType="calc+clearAxisTypes"}),cS=Ft((Q,$)=>{var c=bn(),g=Xo(),P=Wk(),S=mc();function t(r,a,n,o){function i(s,f){return c.coerce(r,a,P,s,f)}e(r,a,n,o,i)}function e(r,a,n,o,i){var s=i("isomin"),f=i("isomax");f!=null&&s!==void 0&&s!==null&&s>f&&(a.isomin=null,a.isomax=null);var x=i("x"),y=i("y"),v=i("z"),T=i("value");if(!x||!x.length||!y||!y.length||!v||!v.length||!T||!T.length){a.visible=!1;return}var u=g.getComponentMethod("calendars","handleTraceDefaults");u(r,a,["x","y","z"],o),i("valuehoverformat"),["x","y","z"].forEach(function(M){i(M+"hoverformat");var E="caps."+M,A=i(E+".show");A&&i(E+".fill");var h="slices."+M,p=i(h+".show");p&&(i(h+".fill"),i(h+".locations"))});var b=i("spaceframe.show");b&&i("spaceframe.fill");var _=i("surface.show");_&&(i("surface.count"),i("surface.fill"),i("surface.pattern"));var C=i("contour.show");C&&(i("contour.color"),i("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(M){i(M)}),S(r,a,o,i,{prefix:"",cLetter:"c"}),a._length=null}$.exports={supplyDefaults:t,supplyIsoDefaults:e}}),qk=Ft((Q,$)=>{var c=bn(),g=Jd();function P(r,a){a._len=Math.min(a.u.length,a.v.length,a.w.length,a.x.length,a.y.length,a.z.length),a._u=e(a.u,a._len),a._v=e(a.v,a._len),a._w=e(a.w,a._len),a._x=e(a.x,a._len),a._y=e(a.y,a._len),a._z=e(a.z,a._len);var n=S(a);a._gridFill=n.fill,a._Xs=n.Xs,a._Ys=n.Ys,a._Zs=n.Zs,a._len=n.len;var o=0,i,s,f;a.starts&&(i=e(a.starts.x||[]),s=e(a.starts.y||[]),f=e(a.starts.z||[]),o=Math.min(i.length,s.length,f.length)),a._startsX=i||[],a._startsY=s||[],a._startsZ=f||[];var x=0,y=1/0,v;for(v=0;v<a._len;v++){var T=a._u[v],u=a._v[v],b=a._w[v],_=Math.sqrt(T*T+u*u+b*b);x=Math.max(x,_),y=Math.min(y,_)}for(g(r,a,{vals:[y,x],containerStr:"",cLetter:"c"}),v=0;v<o;v++){var C=i[v];n.xMax=Math.max(n.xMax,C),n.xMin=Math.min(n.xMin,C);var M=s[v];n.yMax=Math.max(n.yMax,M),n.yMin=Math.min(n.yMin,M);var E=f[v];n.zMax=Math.max(n.zMax,E),n.zMin=Math.min(n.zMin,E)}a._slen=o,a._normMax=x,a._xbnds=[n.xMin,n.xMax],a._ybnds=[n.yMin,n.yMax],a._zbnds=[n.zMin,n.zMax]}function S(r){var a=r._x,n=r._y,o=r._z,i=r._len,s,f,x,y=-1/0,v=1/0,T=-1/0,u=1/0,b=-1/0,_=1/0,C="",M,E,A,h,p,k,w,R,O;for(i&&(h=a[0],k=n[0],R=o[0]),i>1&&(p=a[i-1],w=n[i-1],O=o[i-1]),s=0;s<i;s++)y=Math.max(y,a[s]),v=Math.min(v,a[s]),T=Math.max(T,n[s]),u=Math.min(u,n[s]),b=Math.max(b,o[s]),_=Math.min(_,o[s]),!M&&a[s]!==h&&(M=!0,C+="x"),!E&&n[s]!==k&&(E=!0,C+="y"),!A&&o[s]!==R&&(A=!0,C+="z");M||(C+="x"),E||(C+="y"),A||(C+="z");var N=t(r._x),V=t(r._y),H=t(r._z);C=C.replace("x",(h>p?"-":"+")+"x"),C=C.replace("y",(k>w?"-":"+")+"y"),C=C.replace("z",(R>O?"-":"+")+"z");var F=function(){i=0,N=[],V=[],H=[]};(!i||i<N.length*V.length*H.length)&&F();var U=function(zt){return zt==="x"?a:zt==="y"?n:o},W=function(zt){return zt==="x"?N:zt==="y"?V:H},q=function(zt){return zt[i-1]<zt[0]?-1:1},X=U(C[1]),lt=U(C[3]),yt=U(C[5]),pt=W(C[1]).length,st=W(C[3]).length,tt=W(C[5]).length,dt=!1,rt=function(zt,Pt,Wt){return pt*(st*zt+Pt)+Wt},at=q(U(C[1])),vt=q(U(C[3])),it=q(U(C[5]));for(s=0;s<tt-1;s++){for(f=0;f<st-1;f++){for(x=0;x<pt-1;x++){var Y=rt(s,f,x),ft=rt(s,f,x+1),ut=rt(s,f+1,x),wt=rt(s+1,f,x);if((!(X[Y]*at<X[ft]*at)||!(lt[Y]*vt<lt[ut]*vt)||!(yt[Y]*it<yt[wt]*it))&&(dt=!0),dt)break}if(dt)break}if(dt)break}return dt&&(c.warn("Encountered arbitrary coordinates! Unable to input data grid."),F()),{xMin:v,yMin:u,zMin:_,xMax:y,yMax:T,zMax:b,Xs:N,Ys:V,Zs:H,len:i,fill:C}}function t(r){return c.distinctVals(r).vals}function e(r,a){if(a===void 0&&(a=r.length),c.isTypedArray(r))return r.subarray(0,a);for(var n=[],o=0;o<a;o++)n[o]=+r[o];return n}$.exports={calc:P,filter:e,processGrid:S}}),hS=Ft((Q,$)=>{var c=Jd(),g=qk().processGrid,P=qk().filter;$.exports=function(S,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=P(t.x,t._len),t._y=P(t.y,t._len),t._z=P(t.z,t._len),t._value=P(t.value,t._len);var e=g(t);t._gridFill=e.fill,t._Xs=e.Xs,t._Ys=e.Ys,t._Zs=e.Zs,t._len=e.len;for(var r=1/0,a=-1/0,n=0;n<t._len;n++){var o=t._value[n];r=Math.min(r,o),a=Math.max(a,o)}t._minValues=r,t._maxValues=a,t._vMin=t.isomin===void 0||t.isomin===null?r:t.isomin,t._vMax=t.isomax===void 0||t.isomax===null?a:t.isomax,c(S,t,{vals:[t._vMin,t._vMax],containerStr:"",cLetter:"c"})}}),hb=Ft((Q,$)=>{$.exports=function(c,g,P,S){S=S||c.length;for(var t=new Array(S),e=0;e<S;e++)t[e]=[c[e],g[e],P[e]];return t}}),Zk=Ft((Q,$)=>{var c=fp().gl_mesh3d,g=Av().parseColorScale,P=bn().isArrayOrTypedArray,S=Tv(),t=Xc().extractOpts,e=hb(),r=function(f,x){for(var y=x.length-1;y>0;y--){var v=Math.min(x[y],x[y-1]),T=Math.max(x[y],x[y-1]);if(T>v&&v<f&&f<=T)return{id:y,distRatio:(T-f)/(T-v)}}return{id:0,distRatio:0}};function a(f,x,y){this.scene=f,this.uid=y,this.mesh=x,this.name="",this.data=null,this.showContour=!1}var n=a.prototype;n.handlePick=function(f){if(f.object===this.mesh){var x=f.data.index,y=this.data._meshX[x],v=this.data._meshY[x],T=this.data._meshZ[x],u=this.data._Ys.length,b=this.data._Zs.length,_=r(y,this.data._Xs).id,C=r(v,this.data._Ys).id,M=r(T,this.data._Zs).id,E=f.index=M+b*C+b*u*_;f.traceCoordinate=[this.data._meshX[E],this.data._meshY[E],this.data._meshZ[E],this.data._value[E]];var A=this.data.hovertext||this.data.text;return P(A)&&A[E]!==void 0?f.textLabel=A[E]:A&&(f.textLabel=A),!0}},n.update=function(f){var x=this.scene,y=x.fullSceneLayout;this.data=i(f);function v(C,M,E,A){return M.map(function(h){return C.d2l(h,0,A)*E})}var T=e(v(y.xaxis,f._meshX,x.dataScale[0],f.xcalendar),v(y.yaxis,f._meshY,x.dataScale[1],f.ycalendar),v(y.zaxis,f._meshZ,x.dataScale[2],f.zcalendar)),u=e(f._meshI,f._meshJ,f._meshK),b={positions:T,cells:u,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:S(f.contour.color).slice(0,3),contourWidth:f.contour.width,useFacetNormals:f.flatshading},_=t(f);b.vertexIntensity=f._meshIntensity,b.vertexIntensityBounds=[_.min,_.max],b.colormap=g(f),this.mesh.update(b)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};var o=["xyz","xzy","yxz","yzx","zxy","zyx"];function i(f){f._meshI=[],f._meshJ=[],f._meshK=[];var x=f.surface.show,y=f.spaceframe.show,v=f.surface.fill,T=f.spaceframe.fill,u=!1,b=!1,_=0,C,M,E=f._Xs,A=f._Ys,h=f._Zs,p=E.length,k=A.length,w=h.length,R=o.indexOf(f._gridFill.replace(/-/g,"").replace(/\+/g,"")),O=function(Ce,$t,ne){switch(R){case 5:return ne+w*$t+w*k*Ce;case 4:return ne+w*Ce+w*p*$t;case 3:return $t+k*ne+k*w*Ce;case 2:return $t+k*Ce+k*p*ne;case 1:return Ce+p*ne+p*w*$t;default:return Ce+p*$t+p*k*ne}},N=f._minValues,V=f._maxValues,H=f._vMin,F=f._vMax,U,W,q,X;function lt(Ce,$t,ne){for(var Ct=X.length,gt=M;gt<Ct;gt++)if(Ce===U[gt]&&$t===W[gt]&&ne===q[gt])return gt;return-1}function yt(){M=C}function pt(){U=[],W=[],q=[],X=[],C=0,yt()}function st(Ce,$t,ne,Ct){return U.push(Ce),W.push($t),q.push(ne),X.push(Ct),C++,C-1}function tt(Ce,$t,ne){return f._meshI.push(Ce),f._meshJ.push($t),f._meshK.push(ne),_++,_-1}function dt(Ce,$t,ne){for(var Ct=[],gt=0;gt<Ce.length;gt++)Ct[gt]=(Ce[gt]+$t[gt]+ne[gt])/3;return Ct}function rt(Ce,$t,ne){for(var Ct=[],gt=0;gt<Ce.length;gt++)Ct[gt]=Ce[gt]*(1-ne)+ne*$t[gt];return Ct}var at;function vt(Ce){at=Ce}function it(Ce,$t){var ne=Ce[0],Ct=Ce[1],gt=Ce[2],St=dt(ne,Ct,gt),Nt=Math.sqrt(1-at),ee=rt(St,ne,Nt),le=rt(St,Ct,Nt),we=rt(St,gt,Nt),Ue=$t[0],qe=$t[1],ar=$t[2];return{xyzv:[[ne,Ct,le],[le,ee,ne],[Ct,gt,we],[we,le,Ct],[gt,ne,ee],[ee,we,gt]],abc:[[Ue,qe,-1],[-1,-1,Ue],[qe,ar,-1],[-1,-1,qe],[ar,Ue,-1],[-1,-1,ar]]}}function Y(Ce,$t){return Ce==="all"||Ce===null?!0:Ce.indexOf($t)>-1}function ft(Ce,$t){return Ce===null?$t:Ce}function ut(Ce,$t,ne){yt();var Ct=[$t],gt=[ne];if(at>=1)Ct=[$t],gt=[ne];else if(at>0){var St=it($t,ne);Ct=St.xyzv,gt=St.abc}for(var Nt=0;Nt<Ct.length;Nt++){$t=Ct[Nt],ne=gt[Nt];for(var ee=[],le=0;le<3;le++){var we=$t[le][0],Ue=$t[le][1],qe=$t[le][2],ar=$t[le][3],Ar=ne[le]>-1?ne[le]:lt(we,Ue,qe);Ar>-1?ee[le]=Ar:ee[le]=st(we,Ue,qe,ft(Ce,ar))}tt(ee[0],ee[1],ee[2])}}function wt(Ce,$t,ne){var Ct=function(gt,St,Nt){ut(Ce,[$t[gt],$t[St],$t[Nt]],[ne[gt],ne[St],ne[Nt]])};Ct(0,1,2),Ct(2,3,0)}function zt(Ce,$t,ne){var Ct=function(gt,St,Nt){ut(Ce,[$t[gt],$t[St],$t[Nt]],[ne[gt],ne[St],ne[Nt]])};Ct(0,1,2),Ct(3,0,1),Ct(2,3,0),Ct(1,2,3)}function Pt(Ce,$t,ne,Ct){var gt=Ce[3];gt<ne&&(gt=ne),gt>Ct&&(gt=Ct);for(var St=(Ce[3]-gt)/(Ce[3]-$t[3]+1e-9),Nt=[],ee=0;ee<4;ee++)Nt[ee]=(1-St)*Ce[ee]+St*$t[ee];return Nt}function Wt(Ce,$t,ne){return Ce>=$t&&Ce<=ne}function Ht(Ce){var $t=.001*(F-H);return Ce>=H-$t&&Ce<=F+$t}function Jt(Ce){for(var $t=[],ne=0;ne<4;ne++){var Ct=Ce[ne];$t.push([f._x[Ct],f._y[Ct],f._z[Ct],f._value[Ct]])}return $t}var ge=3;function he(Ce,$t,ne,Ct,gt,St){St||(St=1),ne=[-1,-1,-1];var Nt=!1,ee=[Wt($t[0][3],Ct,gt),Wt($t[1][3],Ct,gt),Wt($t[2][3],Ct,gt)];if(!ee[0]&&!ee[1]&&!ee[2])return!1;var le=function(Ue,qe,ar){return Ht(qe[0][3])&&Ht(qe[1][3])&&Ht(qe[2][3])?(ut(Ue,qe,ar),!0):St<ge?he(Ue,qe,ar,H,F,++St):!1};if(ee[0]&&ee[1]&&ee[2])return le(Ce,$t,ne)||Nt;var we=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(Ue){if(ee[Ue[0]]&&ee[Ue[1]]&&!ee[Ue[2]]){var qe=$t[Ue[0]],ar=$t[Ue[1]],Ar=$t[Ue[2]],Tr=Pt(Ar,qe,Ct,gt),pr=Pt(Ar,ar,Ct,gt);Nt=le(Ce,[pr,Tr,qe],[-1,-1,ne[Ue[0]]])||Nt,Nt=le(Ce,[qe,ar,pr],[ne[Ue[0]],ne[Ue[1]],-1])||Nt,we=!0}}),we||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(Ue){if(ee[Ue[0]]&&!ee[Ue[1]]&&!ee[Ue[2]]){var qe=$t[Ue[0]],ar=$t[Ue[1]],Ar=$t[Ue[2]],Tr=Pt(ar,qe,Ct,gt),pr=Pt(Ar,qe,Ct,gt);Nt=le(Ce,[pr,Tr,qe],[-1,-1,ne[Ue[0]]])||Nt,we=!0}}),Nt}function de(Ce,$t,ne,Ct){var gt=!1,St=Jt($t),Nt=[Wt(St[0][3],ne,Ct),Wt(St[1][3],ne,Ct),Wt(St[2][3],ne,Ct),Wt(St[3][3],ne,Ct)];if(!Nt[0]&&!Nt[1]&&!Nt[2]&&!Nt[3])return gt;if(Nt[0]&&Nt[1]&&Nt[2]&&Nt[3])return b&&(gt=zt(Ce,St,$t)||gt),gt;var ee=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(le){if(Nt[le[0]]&&Nt[le[1]]&&Nt[le[2]]&&!Nt[le[3]]){var we=St[le[0]],Ue=St[le[1]],qe=St[le[2]],ar=St[le[3]];if(b)gt=ut(Ce,[we,Ue,qe],[$t[le[0]],$t[le[1]],$t[le[2]]])||gt;else{var Ar=Pt(ar,we,ne,Ct),Tr=Pt(ar,Ue,ne,Ct),pr=Pt(ar,qe,ne,Ct);gt=ut(null,[Ar,Tr,pr],[-1,-1,-1])||gt}ee=!0}}),ee||([[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(le){if(Nt[le[0]]&&Nt[le[1]]&&!Nt[le[2]]&&!Nt[le[3]]){var we=St[le[0]],Ue=St[le[1]],qe=St[le[2]],ar=St[le[3]],Ar=Pt(qe,we,ne,Ct),Tr=Pt(qe,Ue,ne,Ct),pr=Pt(ar,Ue,ne,Ct),Jr=Pt(ar,we,ne,Ct);b?(gt=ut(Ce,[we,Jr,Ar],[$t[le[0]],-1,-1])||gt,gt=ut(Ce,[Ue,Tr,pr],[$t[le[1]],-1,-1])||gt):gt=wt(null,[Ar,Tr,pr,Jr],[-1,-1,-1,-1])||gt,ee=!0}}),ee)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(le){if(Nt[le[0]]&&!Nt[le[1]]&&!Nt[le[2]]&&!Nt[le[3]]){var we=St[le[0]],Ue=St[le[1]],qe=St[le[2]],ar=St[le[3]],Ar=Pt(Ue,we,ne,Ct),Tr=Pt(qe,we,ne,Ct),pr=Pt(ar,we,ne,Ct);b?(gt=ut(Ce,[we,Ar,Tr],[$t[le[0]],-1,-1])||gt,gt=ut(Ce,[we,Tr,pr],[$t[le[0]],-1,-1])||gt,gt=ut(Ce,[we,pr,Ar],[$t[le[0]],-1,-1])||gt):gt=ut(null,[Ar,Tr,pr],[-1,-1,-1])||gt,ee=!0}}),gt}function se(Ce,$t,ne,Ct,gt,St,Nt,ee,le,we,Ue){var qe=!1;return u&&(Y(Ce,"A")&&(qe=de(null,[$t,ne,Ct,St],we,Ue)||qe),Y(Ce,"B")&&(qe=de(null,[ne,Ct,gt,le],we,Ue)||qe),Y(Ce,"C")&&(qe=de(null,[ne,St,Nt,le],we,Ue)||qe),Y(Ce,"D")&&(qe=de(null,[Ct,St,ee,le],we,Ue)||qe),Y(Ce,"E")&&(qe=de(null,[ne,Ct,St,le],we,Ue)||qe)),b&&(qe=de(Ce,[ne,Ct,St,le],we,Ue)||qe),qe}function Tt(Ce,$t,ne,Ct,gt,St,Nt,ee){return[ee[0]===!0?!0:he(Ce,Jt([$t,ne,Ct]),[$t,ne,Ct],St,Nt),ee[1]===!0?!0:he(Ce,Jt([Ct,gt,$t]),[Ct,gt,$t],St,Nt)]}function Lt(Ce,$t,ne,Ct,gt,St,Nt,ee,le){return ee?Tt(Ce,$t,ne,gt,Ct,St,Nt,le):Tt(Ce,ne,gt,Ct,$t,St,Nt,le)}function Mt(Ce,$t,ne,Ct,gt,St,Nt){var ee=!1,le,we,Ue,qe,ar=function(){ee=he(Ce,[le,we,Ue],[-1,-1,-1],gt,St)||ee,ee=he(Ce,[Ue,qe,le],[-1,-1,-1],gt,St)||ee},Ar=Nt[0],Tr=Nt[1],pr=Nt[2];return Ar&&(le=rt(Jt([O($t,ne-0,Ct-0)])[0],Jt([O($t-1,ne-0,Ct-0)])[0],Ar),we=rt(Jt([O($t,ne-0,Ct-1)])[0],Jt([O($t-1,ne-0,Ct-1)])[0],Ar),Ue=rt(Jt([O($t,ne-1,Ct-1)])[0],Jt([O($t-1,ne-1,Ct-1)])[0],Ar),qe=rt(Jt([O($t,ne-1,Ct-0)])[0],Jt([O($t-1,ne-1,Ct-0)])[0],Ar),ar()),Tr&&(le=rt(Jt([O($t-0,ne,Ct-0)])[0],Jt([O($t-0,ne-1,Ct-0)])[0],Tr),we=rt(Jt([O($t-0,ne,Ct-1)])[0],Jt([O($t-0,ne-1,Ct-1)])[0],Tr),Ue=rt(Jt([O($t-1,ne,Ct-1)])[0],Jt([O($t-1,ne-1,Ct-1)])[0],Tr),qe=rt(Jt([O($t-1,ne,Ct-0)])[0],Jt([O($t-1,ne-1,Ct-0)])[0],Tr),ar()),pr&&(le=rt(Jt([O($t-0,ne-0,Ct)])[0],Jt([O($t-0,ne-0,Ct-1)])[0],pr),we=rt(Jt([O($t-0,ne-1,Ct)])[0],Jt([O($t-0,ne-1,Ct-1)])[0],pr),Ue=rt(Jt([O($t-1,ne-1,Ct)])[0],Jt([O($t-1,ne-1,Ct-1)])[0],pr),qe=rt(Jt([O($t-1,ne-0,Ct)])[0],Jt([O($t-1,ne-0,Ct-1)])[0],pr),ar()),ee}function te(Ce,$t,ne,Ct,gt,St,Nt,ee,le,we,Ue,qe){var ar=Ce;return qe?(u&&Ce==="even"&&(ar=null),se(ar,$t,ne,Ct,gt,St,Nt,ee,le,we,Ue)):(u&&Ce==="odd"&&(ar=null),se(ar,le,ee,Nt,St,gt,Ct,ne,$t,we,Ue))}function ve(Ce,$t,ne,Ct,gt){for(var St=[],Nt=0,ee=0;ee<$t.length;ee++)for(var le=$t[ee],we=1;we<w;we++)for(var Ue=1;Ue<k;Ue++)St.push(Lt(Ce,O(le,Ue-1,we-1),O(le,Ue-1,we),O(le,Ue,we-1),O(le,Ue,we),ne,Ct,(le+Ue+we)%2,gt&&gt[Nt]?gt[Nt]:[])),Nt++;return St}function oe(Ce,$t,ne,Ct,gt){for(var St=[],Nt=0,ee=0;ee<$t.length;ee++)for(var le=$t[ee],we=1;we<p;we++)for(var Ue=1;Ue<w;Ue++)St.push(Lt(Ce,O(we-1,le,Ue-1),O(we,le,Ue-1),O(we-1,le,Ue),O(we,le,Ue),ne,Ct,(we+le+Ue)%2,gt&&gt[Nt]?gt[Nt]:[])),Nt++;return St}function Te(Ce,$t,ne,Ct,gt){for(var St=[],Nt=0,ee=0;ee<$t.length;ee++)for(var le=$t[ee],we=1;we<k;we++)for(var Ue=1;Ue<p;Ue++)St.push(Lt(Ce,O(Ue-1,we-1,le),O(Ue-1,we,le),O(Ue,we-1,le),O(Ue,we,le),ne,Ct,(Ue+we+le)%2,gt&&gt[Nt]?gt[Nt]:[])),Nt++;return St}function He(Ce,$t,ne){for(var Ct=1;Ct<w;Ct++)for(var gt=1;gt<k;gt++)for(var St=1;St<p;St++)te(Ce,O(St-1,gt-1,Ct-1),O(St-1,gt-1,Ct),O(St-1,gt,Ct-1),O(St-1,gt,Ct),O(St,gt-1,Ct-1),O(St,gt-1,Ct),O(St,gt,Ct-1),O(St,gt,Ct),$t,ne,(St+gt+Ct)%2)}function Ge(Ce,$t,ne){b=!0,He(Ce,$t,ne),b=!1}function cr(Ce,$t,ne){u=!0,He(Ce,$t,ne),u=!1}function ur(Ce,$t,ne,Ct,gt,St){for(var Nt=[],ee=0,le=0;le<$t.length;le++)for(var we=$t[le],Ue=1;Ue<w;Ue++)for(var qe=1;qe<k;qe++)Nt.push(Mt(Ce,we,qe,Ue,ne,Ct,gt[le],St&&St[ee]?St[ee]:[])),ee++;return Nt}function jr(Ce,$t,ne,Ct,gt,St){for(var Nt=[],ee=0,le=0;le<$t.length;le++)for(var we=$t[le],Ue=1;Ue<p;Ue++)for(var qe=1;qe<w;qe++)Nt.push(Mt(Ce,Ue,we,qe,ne,Ct,gt[le],St&&St[ee]?St[ee]:[])),ee++;return Nt}function Hr(Ce,$t,ne,Ct,gt,St){for(var Nt=[],ee=0,le=0;le<$t.length;le++)for(var we=$t[le],Ue=1;Ue<k;Ue++)for(var qe=1;qe<p;qe++)Nt.push(Mt(Ce,qe,Ue,we,ne,Ct,gt[le],St&&St[ee]?St[ee]:[])),ee++;return Nt}function br(Ce,$t){for(var ne=[],Ct=Ce;Ct<$t;Ct++)ne.push(Ct);return ne}function Kr(){for(var Ce=0;Ce<p;Ce++)for(var $t=0;$t<k;$t++)for(var ne=0;ne<w;ne++){var Ct=O(Ce,$t,ne);st(f._x[Ct],f._y[Ct],f._z[Ct],f._value[Ct])}}function rn(){pt(),Kr();var Ce=null;if(y&&T&&(vt(T),Ge(Ce,H,F)),x&&v){vt(v);for(var $t=f.surface.pattern,ne=f.surface.count,Ct=0;Ct<ne;Ct++){var gt=ne===1?.5:Ct/(ne-1),St=(1-gt)*H+gt*F,Nt=Math.abs(St-N),ee=Math.abs(St-V),le=Nt>ee?[N,St]:[St,V];cr($t,le[0],le[1])}}var we=[[Math.min(H,V),Math.max(H,V)],[Math.min(N,F),Math.max(N,F)]];["x","y","z"].forEach(function(Ue){for(var qe=[],ar=0;ar<we.length;ar++){var Ar=0,Tr=we[ar][0],pr=we[ar][1],Jr=f.slices[Ue];if(Jr.show&&Jr.fill){vt(Jr.fill);var Vn=[],Hn=[],Kn=[];if(Jr.locations.length)for(var Ci=0;Ci<Jr.locations.length;Ci++){var ii=r(Jr.locations[Ci],Ue==="x"?E:Ue==="y"?A:h);ii.distRatio===0?Vn.push(ii.id):ii.id>0&&(Hn.push(ii.id),Ue==="x"?Kn.push([ii.distRatio,0,0]):Ue==="y"?Kn.push([0,ii.distRatio,0]):Kn.push([0,0,ii.distRatio]))}else Ue==="x"?Vn=br(1,p-1):Ue==="y"?Vn=br(1,k-1):Vn=br(1,w-1);Hn.length>0&&(Ue==="x"?qe[Ar]=ur(Ce,Hn,Tr,pr,Kn,qe[Ar]):Ue==="y"?qe[Ar]=jr(Ce,Hn,Tr,pr,Kn,qe[Ar]):qe[Ar]=Hr(Ce,Hn,Tr,pr,Kn,qe[Ar]),Ar++),Vn.length>0&&(Ue==="x"?qe[Ar]=ve(Ce,Vn,Tr,pr,qe[Ar]):Ue==="y"?qe[Ar]=oe(Ce,Vn,Tr,pr,qe[Ar]):qe[Ar]=Te(Ce,Vn,Tr,pr,qe[Ar]),Ar++)}var qn=f.caps[Ue];qn.show&&qn.fill&&(vt(qn.fill),Ue==="x"?qe[Ar]=ve(Ce,[0,p-1],Tr,pr,qe[Ar]):Ue==="y"?qe[Ar]=oe(Ce,[0,k-1],Tr,pr,qe[Ar]):qe[Ar]=Te(Ce,[0,w-1],Tr,pr,qe[Ar]),Ar++)}}),_===0&&pt(),f._meshX=U,f._meshY=W,f._meshZ=q,f._meshIntensity=X,f._Xs=E,f._Ys=A,f._Zs=h}return rn(),f}function s(f,x){var y=f.glplot.gl,v=c({gl:y}),T=new a(f,v,x.uid);return v._trace=T,T.update(x),f.glplot.add(v),T}$.exports={findNearestOnAxis:r,generateIsoMeshes:i,createIsosurfaceTrace:s}}),Jj=Ft((Q,$)=>{$.exports={attributes:Wk(),supplyDefaults:cS().supplyDefaults,calc:hS(),colorbar:{min:"cmin",max:"cmax"},plot:Zk().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:j1(),categories:["gl3d","showLegend"],meta:{}}}),Qj=Ft((Q,$)=>{$.exports=Jj()}),fS=Ft((Q,$)=>{var c=Tc(),g=Wk(),P=g3(),S=$o(),t=Ta().extendFlat,e=Yc().overrideAll,r=$.exports=e(t({x:g.x,y:g.y,z:g.z,value:g.value,isomin:g.isomin,isomax:g.isomax,surface:g.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:g.slices,caps:g.caps,text:g.text,hovertext:g.hovertext,xhoverformat:g.xhoverformat,yhoverformat:g.yhoverformat,zhoverformat:g.zhoverformat,valuehoverformat:g.valuehoverformat,hovertemplate:g.hovertemplate,hovertemplatefallback:g.hovertemplatefallback},c("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:g.colorbar,opacity:g.opacity,opacityscale:P.opacityscale,lightposition:g.lightposition,lighting:g.lighting,flatshading:g.flatshading,contour:g.contour,hoverinfo:t({},S.hoverinfo),showlegend:t({},S.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}),tU=Ft((Q,$)=>{var c=bn(),g=fS(),P=cS().supplyIsoDefaults,S=uS().opacityscaleDefaults;$.exports=function(t,e,r,a){function n(o,i){return c.coerce(t,e,g,o,i)}P(t,e,r,a,n),S(t,e,a,n)}}),eU=Ft((Q,$)=>{var c=fp().gl_mesh3d,g=Av().parseColorScale,P=bn().isArrayOrTypedArray,S=Tv(),t=Xc().extractOpts,e=hb(),r=Zk().findNearestOnAxis,a=Zk().generateIsoMeshes;function n(s,f,x){this.scene=s,this.uid=x,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,x=this.data._meshX[f],y=this.data._meshY[f],v=this.data._meshZ[f],T=this.data._Ys.length,u=this.data._Zs.length,b=r(x,this.data._Xs).id,_=r(y,this.data._Ys).id,C=r(v,this.data._Zs).id,M=s.index=C+u*_+u*T*b;s.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var E=this.data.hovertext||this.data.text;return P(E)&&E[M]!==void 0?s.textLabel=E[M]:E&&(s.textLabel=E),!0}},o.update=function(s){var f=this.scene,x=f.fullSceneLayout;this.data=a(s);function y(_,C,M,E){return C.map(function(A){return _.d2l(A,0,E)*M})}var v=e(y(x.xaxis,s._meshX,f.dataScale[0],s.xcalendar),y(x.yaxis,s._meshY,f.dataScale[1],s.ycalendar),y(x.zaxis,s._meshZ,f.dataScale[2],s.zcalendar)),T=e(s._meshI,s._meshJ,s._meshK),u={positions:v,cells:T,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:S(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},b=t(s);u.vertexIntensity=s._meshIntensity,u.vertexIntensityBounds=[b.min,b.max],u.colormap=g(s),this.mesh.update(u)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function i(s,f){var x=s.glplot.gl,y=c({gl:x}),v=new n(s,y,f.uid);return y._trace=v,v.update(f),s.glplot.add(y),v}$.exports=i}),rU=Ft((Q,$)=>{$.exports={attributes:fS(),supplyDefaults:tU(),calc:hS(),colorbar:{min:"cmin",max:"cmax"},plot:eU(),moduleType:"trace",name:"volume",basePlotModule:j1(),categories:["gl3d","showLegend"],meta:{}}}),nU=Ft((Q,$)=>{$.exports=rU()}),iU=Ft((Q,$)=>{var c=Xo(),g=bn(),P=mc(),S=cb();$.exports=function(t,e,r,a){function n(x,y){return g.coerce(t,e,S,x,y)}function o(x){var y=x.map(function(v){var T=n(v);return T&&g.isArrayOrTypedArray(T)?T:null});return y.every(function(v){return v&&v.length===y[0].length})&&y}var i=o(["x","y","z"]);if(!i){e.visible=!1;return}if(o(["i","j","k"]),e.i&&(!e.j||!e.k)||e.j&&(!e.k||!e.i)||e.k&&(!e.i||!e.j)){e.visible=!1;return}var s=c.getComponentMethod("calendars","handleTraceDefaults");s(t,e,["x","y","z"],a),["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(x){n(x)});var f=n("contour.show");f&&(n("contour.color"),n("contour.width")),"intensity"in t?(n("intensity"),n("intensitymode"),P(t,e,a,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}}),aU=Ft((Q,$)=>{var c=Jd();$.exports=function(g,P){P.intensity&&c(g,P,{vals:P.intensity,containerStr:"",cLetter:"c"})}}),oU=Ft((Q,$)=>{var c=fp().gl_mesh3d,g=fp().delaunay_triangulate,P=fp().alpha_shape,S=fp().convex_hull,t=Av().parseColorScale,e=bn().isArrayOrTypedArray,r=Tv(),a=Xc().extractOpts,n=hb();function o(u,b,_){this.scene=u,this.uid=_,this.mesh=b,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var i=o.prototype;i.handlePick=function(u){if(u.object===this.mesh){var b=u.index=u.data.index;u.data._cellCenter?u.traceCoordinate=u.data.dataCoordinate:u.traceCoordinate=[this.data.x[b],this.data.y[b],this.data.z[b]];var _=this.data.hovertext||this.data.text;return e(_)&&_[b]!==void 0?u.textLabel=_[b]:_&&(u.textLabel=_),!0}};function s(u){for(var b=[],_=u.length,C=0;C<_;C++)b[C]=r(u[C]);return b}function f(u,b,_,C){for(var M=[],E=b.length,A=0;A<E;A++)M[A]=u.d2l(b[A],0,C)*_;return M}function x(u){for(var b=[],_=u.length,C=0;C<_;C++)b[C]=Math.round(u[C]);return b}function y(u,b){for(var _=["x","y","z"].indexOf(u),C=[],M=b.length,E=0;E<M;E++)C[E]=[b[E][(_+1)%3],b[E][(_+2)%3]];return g(C)}function v(u,b){for(var _=u.length,C=0;C<_;C++)if(u[C]<=-.5||u[C]>=b-.5)return!1;return!0}i.update=function(u){var b=this.scene,_=b.fullSceneLayout;this.data=u;var C=u.x.length,M=n(f(_.xaxis,u.x,b.dataScale[0],u.xcalendar),f(_.yaxis,u.y,b.dataScale[1],u.ycalendar),f(_.zaxis,u.z,b.dataScale[2],u.zcalendar)),E;if(u.i&&u.j&&u.k){if(u.i.length!==u.j.length||u.j.length!==u.k.length||!v(u.i,C)||!v(u.j,C)||!v(u.k,C))return;E=n(x(u.i),x(u.j),x(u.k))}else u.alphahull===0?E=S(M):u.alphahull>0?E=P(u.alphahull,M):E=y(u.delaunayaxis,M);var A={positions:M,cells:E,lightPosition:[u.lightposition.x,u.lightposition.y,u.lightposition.z],ambient:u.lighting.ambient,diffuse:u.lighting.diffuse,specular:u.lighting.specular,roughness:u.lighting.roughness,fresnel:u.lighting.fresnel,vertexNormalsEpsilon:u.lighting.vertexnormalsepsilon,faceNormalsEpsilon:u.lighting.facenormalsepsilon,opacity:u.opacity,contourEnable:u.contour.show,contourColor:r(u.contour.color).slice(0,3),contourWidth:u.contour.width,useFacetNormals:u.flatshading};if(u.intensity){var h=a(u);this.color="#fff";var p=u.intensitymode;A[p+"Intensity"]=u.intensity,A[p+"IntensityBounds"]=[h.min,h.max],A.colormap=t(u)}else u.vertexcolor?(this.color=u.vertexcolor[0],A.vertexColors=s(u.vertexcolor)):u.facecolor?(this.color=u.facecolor[0],A.cellColors=s(u.facecolor)):(this.color=u.color,A.meshColor=r(u.color));this.mesh.update(A)},i.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(u,b){var _=u.glplot.gl,C=c({gl:_}),M=new o(u,C,b.uid);return C._trace=M,M.update(b),u.glplot.add(C),M}$.exports=T}),sU=Ft((Q,$)=>{$.exports={attributes:cb(),supplyDefaults:iU(),calc:aU(),colorbar:{min:"cmin",max:"cmax"},plot:oU(),moduleType:"trace",name:"mesh3d",basePlotModule:j1(),categories:["gl3d","showLegend"],meta:{}}}),lU=Ft((Q,$)=>{$.exports=sU()}),dS=Ft((Q,$)=>{var c=Tc(),g=fh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:S}=$u(),t=cb(),e=$o(),r=Ta().extendFlat,a={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:P({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:S({editType:"calc"}),uhoverformat:g("u",1),vhoverformat:g("v",1),whoverformat:g("w",1),xhoverformat:g("x"),yhoverformat:g("y"),zhoverformat:g("z"),showlegend:r({},e.showlegend,{dflt:!1})};r(a,c("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var n=["opacity","lightposition","lighting"];n.forEach(function(o){a[o]=t[o]}),a.hoverinfo=r({},e.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),$.exports=a}),uU=Ft((Q,$)=>{var c=bn(),g=mc(),P=dS();$.exports=function(S,t,e,r){function a(v,T){return c.coerce(S,t,P,v,T)}var n=a("u"),o=a("v"),i=a("w"),s=a("x"),f=a("y"),x=a("z");if(!n||!n.length||!o||!o.length||!i||!i.length||!s||!s.length||!f||!f.length||!x||!x.length){t.visible=!1;return}var y=a("sizemode");a("sizeref",y==="raw"?1:.5),a("anchor"),a("lighting.ambient"),a("lighting.diffuse"),a("lighting.specular"),a("lighting.roughness"),a("lighting.fresnel"),a("lightposition.x"),a("lightposition.y"),a("lightposition.z"),g(S,t,r,a,{prefix:"",cLetter:"c"}),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("uhoverformat"),a("vhoverformat"),a("whoverformat"),a("xhoverformat"),a("yhoverformat"),a("zhoverformat"),t._length=null}}),cU=Ft((Q,$)=>{var c=Jd();$.exports=function(g,P){for(var S=P.u,t=P.v,e=P.w,r=Math.min(P.x.length,P.y.length,P.z.length,S.length,t.length,e.length),a=-1/0,n=1/0,o=0;o<r;o++){var i=S[o],s=t[o],f=e[o],x=Math.sqrt(i*i+s*s+f*f);a=Math.max(a,x),n=Math.min(n,x)}P._len=r,P._normMax=a,c(g,P,{vals:[n,a],containerStr:"",cLetter:"c"})}}),hU=Ft((Q,$)=>{var c=fp().gl_cone3d,g=fp().gl_cone3d.createConeMesh,P=bn().simpleMap,S=Av().parseColorScale,t=Xc().extractOpts,e=bn().isArrayOrTypedArray,r=hb();function a(y,v){this.scene=y,this.uid=v,this.mesh=null,this.data=null}var n=a.prototype;n.handlePick=function(y){if(y.object===this.mesh){var v=y.index=y.data.index,T=this.data.x[v],u=this.data.y[v],b=this.data.z[v],_=this.data.u[v],C=this.data.v[v],M=this.data.w[v];y.traceCoordinate=[T,u,b,_,C,M,Math.sqrt(_*_+C*C+M*M)];var E=this.data.hovertext||this.data.text;return e(E)&&E[v]!==void 0?y.textLabel=E[v]:E&&(y.textLabel=E),!0}};var o={xaxis:0,yaxis:1,zaxis:2},i={tip:1,tail:0,cm:.25,center:.5},s={tip:1,tail:1,cm:.75,center:.5};function f(y,v){var T=y.fullSceneLayout,u=y.dataScale,b={};function _(h,p){var k=T[p],w=u[o[p]];return P(h,function(R){return k.d2l(R)*w})}b.vectors=r(_(v.u,"xaxis"),_(v.v,"yaxis"),_(v.w,"zaxis"),v._len),b.positions=r(_(v.x,"xaxis"),_(v.y,"yaxis"),_(v.z,"zaxis"),v._len);var C=t(v);b.colormap=S(v),b.vertexIntensityBounds=[C.min/v._normMax,C.max/v._normMax],b.coneOffset=i[v.anchor];var M=v.sizemode;M==="scaled"?b.coneSize=v.sizeref||.5:M==="absolute"?b.coneSize=v.sizeref&&v._normMax?v.sizeref/v._normMax:.5:M==="raw"&&(b.coneSize=v.sizeref),b.coneSizemode=M;var E=c(b),A=v.lightposition;return E.lightPosition=[A.x,A.y,A.z],E.ambient=v.lighting.ambient,E.diffuse=v.lighting.diffuse,E.specular=v.lighting.specular,E.roughness=v.lighting.roughness,E.fresnel=v.lighting.fresnel,E.opacity=v.opacity,v._pad=s[v.anchor]*E.vectorScale*E.coneScale*v._normMax,E}n.update=function(y){this.data=y;var v=f(this.scene,y);this.mesh.update(v)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function x(y,v){var T=y.glplot.gl,u=f(y,v),b=g(T,u),_=new a(y,v.uid);return _.mesh=b,_.data=v,b._trace=_,y.glplot.add(b),_}$.exports=x}),fU=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"cone",basePlotModule:j1(),categories:["gl3d","showLegend"],attributes:dS(),supplyDefaults:uU(),colorbar:{min:"cmin",max:"cmax"},calc:cU(),plot:hU(),eventData:function(c,g){return c.norm=g.traceCoordinate[6],c},meta:{}}}),dU=Ft((Q,$)=>{$.exports=fU()}),pS=Ft((Q,$)=>{var c=Tc(),g=fh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:S}=$u(),t=cb(),e=$o(),r=Ta().extendFlat,a={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:P({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),hovertemplatefallback:S({editType:"calc"}),uhoverformat:g("u",1),vhoverformat:g("v",1),whoverformat:g("w",1),xhoverformat:g("x"),yhoverformat:g("y"),zhoverformat:g("z"),showlegend:r({},e.showlegend,{dflt:!1})};r(a,c("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var n=["opacity","lightposition","lighting"];n.forEach(function(o){a[o]=t[o]}),a.hoverinfo=r({},e.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),$.exports=a}),pU=Ft((Q,$)=>{var c=bn(),g=mc(),P=pS();$.exports=function(S,t,e,r){function a(y,v){return c.coerce(S,t,P,y,v)}var n=a("u"),o=a("v"),i=a("w"),s=a("x"),f=a("y"),x=a("z");if(!n||!n.length||!o||!o.length||!i||!i.length||!s||!s.length||!f||!f.length||!x||!x.length){t.visible=!1;return}a("starts.x"),a("starts.y"),a("starts.z"),a("maxdisplayed"),a("sizeref"),a("lighting.ambient"),a("lighting.diffuse"),a("lighting.specular"),a("lighting.roughness"),a("lighting.fresnel"),a("lightposition.x"),a("lightposition.y"),a("lightposition.z"),g(S,t,r,a,{prefix:"",cLetter:"c"}),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("uhoverformat"),a("vhoverformat"),a("whoverformat"),a("xhoverformat"),a("yhoverformat"),a("zhoverformat"),t._length=null}}),mU=Ft((Q,$)=>{var c=fp().gl_streamtube3d,g=c.createTubeMesh,P=bn(),S=Av().parseColorScale,t=Xc().extractOpts,e=hb(),r={xaxis:0,yaxis:1,zaxis:2};function a(x,y){this.scene=x,this.uid=y,this.mesh=null,this.data=null}var n=a.prototype;n.handlePick=function(x){var y=this.scene.fullSceneLayout,v=this.scene.dataScale;function T(_,C){var M=y[C],E=v[r[C]];return M.l2c(_)/E}if(x.object===this.mesh){var u=x.data.position,b=x.data.velocity;return x.traceCoordinate=[T(u[0],"xaxis"),T(u[1],"yaxis"),T(u[2],"zaxis"),T(b[0],"xaxis"),T(b[1],"yaxis"),T(b[2],"zaxis"),x.data.intensity*this.data._normMax,x.data.divergence],x.textLabel=this.data.hovertext||this.data.text,!0}};function o(x){var y=x.length,v;return y>2?v=x.slice(1,y-1):y===2?v=[(x[0]+x[1])/2]:v=x,v}function i(x){var y=x.length;return y===1?[.5,.5]:[x[1]-x[0],x[y-1]-x[y-2]]}function s(x,y){var v=x.fullSceneLayout,T=x.dataScale,u=y._len,b={};function _(st,tt){var dt=v[tt],rt=T[r[tt]];return P.simpleMap(st,function(at){return dt.d2l(at)*rt})}if(b.vectors=e(_(y._u,"xaxis"),_(y._v,"yaxis"),_(y._w,"zaxis"),u),!u)return{positions:[],cells:[]};var C=_(y._Xs,"xaxis"),M=_(y._Ys,"yaxis"),E=_(y._Zs,"zaxis");b.meshgrid=[C,M,E],b.gridFill=y._gridFill;var A=y._slen;if(A)b.startingPositions=e(_(y._startsX,"xaxis"),_(y._startsY,"yaxis"),_(y._startsZ,"zaxis"));else{for(var h=M[0],p=o(C),k=o(E),w=new Array(p.length*k.length),R=0,O=0;O<p.length;O++)for(var N=0;N<k.length;N++)w[R++]=[p[O],h,k[N]];b.startingPositions=w}b.colormap=S(y),b.tubeSize=y.sizeref,b.maxLength=y.maxdisplayed;var V=_(y._xbnds,"xaxis"),H=_(y._ybnds,"yaxis"),F=_(y._zbnds,"zaxis"),U=i(C),W=i(M),q=i(E),X=[[V[0]-U[0],H[0]-W[0],F[0]-q[0]],[V[1]+U[1],H[1]+W[1],F[1]+q[1]]],lt=c(b,X),yt=t(y);lt.vertexIntensityBounds=[yt.min/y._normMax,yt.max/y._normMax];var pt=y.lightposition;return lt.lightPosition=[pt.x,pt.y,pt.z],lt.ambient=y.lighting.ambient,lt.diffuse=y.lighting.diffuse,lt.specular=y.lighting.specular,lt.roughness=y.lighting.roughness,lt.fresnel=y.lighting.fresnel,lt.opacity=y.opacity,y._pad=lt.tubeScale*y.sizeref*2,lt}n.update=function(x){this.data=x;var y=s(this.scene,x);this.mesh.update(y)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function f(x,y){var v=x.glplot.gl,T=s(x,y),u=g(v,T),b=new a(x,y.uid);return b.mesh=u,b.data=y,u._trace=b,x.glplot.add(u),b}$.exports=f}),gU=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"streamtube",basePlotModule:j1(),categories:["gl3d","showLegend"],attributes:pS(),supplyDefaults:pU(),colorbar:{min:"cmin",max:"cmax"},calc:qk().calc,plot:mU(),eventData:function(c,g){return c.tubex=c.x,c.tubey=c.y,c.tubez=c.z,c.tubeu=g.traceCoordinate[3],c.tubev=g.traceCoordinate[4],c.tubew=g.traceCoordinate[5],c.norm=g.traceCoordinate[6],c.divergence=g.traceCoordinate[7],delete c.x,delete c.y,delete c.z,c},meta:{}}}),vU=Ft((Q,$)=>{$.exports=gU()}),dx=Ft((Q,$)=>{var{hovertemplateAttrs:c,texttemplateAttrs:g,templatefallbackAttrs:P}=$u(),S=z0(),t=tf(),e=$o(),r=Tc(),a=Td().dash,n=Ta().extendFlat,o=Yc().overrideAll,i=t.marker,s=t.line,f=i.line;$.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:g({editType:"plot"},{keys:["lat","lon","location","text"]}),texttemplatefallback:P({editType:"plot"}),hovertext:n({},t.hovertext,{}),textfont:t.textfont,textposition:t.textposition,line:{color:s.color,width:s.width,dash:a},connectgaps:t.connectgaps,marker:n({symbol:i.symbol,opacity:i.opacity,angle:i.angle,angleref:n({},i.angleref,{values:["previous","up","north"]}),standoff:i.standoff,size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,colorbar:i.colorbar,line:n({width:f.width},r("marker.line")),gradient:i.gradient},r("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:S(),selected:t.selected,unselected:t.unselected,hoverinfo:n({},e.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:c(),hovertemplatefallback:P()},"calc","nested")}),yU=Ft((Q,$)=>{var c=bn(),g=Ac(),P=s0(),S=I0(),t=x0(),e=O0(),r=dx(),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(" ");$.exports=function(n,o,i,s){function f(C,M){return c.coerce(n,o,r,C,M)}var x=f("locations"),y;if(x&&x.length){var v=f("geojson"),T;(typeof v=="string"&&v!==""||c.isPlainObject(v))&&(T="geojson-id");var u=f("locationmode",T);u==="country names"&&c.warn(a),u==="geojson-id"&&f("featureidkey"),y=x.length}else{var b=f("lon")||[],_=f("lat")||[];y=Math.min(b.length,_.length)}if(!y){o.visible=!1;return}o._length=y,f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("mode"),g.hasMarkers(o)&&P(n,o,i,s,f,{gradient:!0}),g.hasLines(o)&&(S(n,o,i,s,f),f("connectgaps")),g.hasText(o)&&(f("texttemplate"),f("texttemplatefallback"),t(n,o,s,f)),f("fill"),o.fill!=="none"&&e(n,o,i,f),c.coerceSelectionMarkerOpacity(o,f)}}),xU=Ft((Q,$)=>{var c=Es();$.exports=function(g,P,S){var t={},e=S[P.geo]._subplot,r=e.mockAxis,a=g.lonlat;return t.lonLabel=c.tickText(r,r.c2l(a[0]),!0).text,t.latLabel=c.tickText(r,r.c2l(a[1]),!0).text,t}}),$k=Ft((Q,$)=>{var c=ra(),g=Da().BADNUM,P=F0(),S=ct(),t=Bt(),e=bn().isArrayOrTypedArray,r=bn()._;function a(n){return n&&typeof n=="string"}$.exports=function(n,o){var i=e(o.locations),s=i?o.locations.length:o._length,f=new Array(s),x;o.geojson?x=function(_){return a(_)||c(_)}:x=a;for(var y=0;y<s;y++){var v=f[y]={};if(i){var T=o.locations[y];v.loc=x(T)?T:null}else{var u=o.lon[y],b=o.lat[y];c(u)&&c(b)?v.lonlat=[+u,+b]:v.lonlat=[g,g]}}return S(f,o),P(n,o),t(f,o),s&&(f[0].t={labels:{lat:r(n,"lat:")+" ",lon:r(n,"lon:")+" "}}),f}}),v3=Ft(Q=>{Q.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"},Q.axesNames=["lonaxis","lataxis"],Q.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},Q.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},Q.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]}},Q.clipPad=.001,Q.precision=.1,Q.landColor="#F0DC82",Q.waterColor="#3399FF",Q.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},Q.sphereSVG={type:"Sphere"},Q.fillLayers={ocean:1,land:1,lakes:1},Q.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},Q.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],Q.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],Q.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}),mS=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=c||self,g(c.topojson=c.topojson||{}))})(Q,function(c){function g(_){return _}function P(_){if(_==null)return g;var C,M,E=_.scale[0],A=_.scale[1],h=_.translate[0],p=_.translate[1];return function(k,w){w||(C=M=0);var R=2,O=k.length,N=new Array(O);for(N[0]=(C+=k[0])*E+h,N[1]=(M+=k[1])*A+p;R<O;)N[R]=k[R],++R;return N}}function S(_){var C=P(_.transform),M,E=1/0,A=E,h=-E,p=-E;function k(R){R=C(R),R[0]<E&&(E=R[0]),R[0]>h&&(h=R[0]),R[1]<A&&(A=R[1]),R[1]>p&&(p=R[1])}function w(R){switch(R.type){case"GeometryCollection":R.geometries.forEach(w);break;case"Point":k(R.coordinates);break;case"MultiPoint":R.coordinates.forEach(k);break}}_.arcs.forEach(function(R){for(var O=-1,N=R.length,V;++O<N;)V=C(R[O],O),V[0]<E&&(E=V[0]),V[0]>h&&(h=V[0]),V[1]<A&&(A=V[1]),V[1]>p&&(p=V[1])});for(M in _.objects)w(_.objects[M]);return[E,A,h,p]}function t(_,C){for(var M,E=_.length,A=E-C;A<--E;)M=_[A],_[A++]=_[E],_[E]=M}function e(_,C){return typeof C=="string"&&(C=_.objects[C]),C.type==="GeometryCollection"?{type:"FeatureCollection",features:C.geometries.map(function(M){return r(_,M)})}:r(_,C)}function r(_,C){var M=C.id,E=C.bbox,A=C.properties==null?{}:C.properties,h=a(_,C);return M==null&&E==null?{type:"Feature",properties:A,geometry:h}:E==null?{type:"Feature",id:M,properties:A,geometry:h}:{type:"Feature",id:M,bbox:E,properties:A,geometry:h}}function a(_,C){var M=P(_.transform),E=_.arcs;function A(O,N){N.length&&N.pop();for(var V=E[O<0?~O:O],H=0,F=V.length;H<F;++H)N.push(M(V[H],H));O<0&&t(N,F)}function h(O){return M(O)}function p(O){for(var N=[],V=0,H=O.length;V<H;++V)A(O[V],N);return N.length<2&&N.push(N[0]),N}function k(O){for(var N=p(O);N.length<4;)N.push(N[0]);return N}function w(O){return O.map(k)}function R(O){var N=O.type,V;switch(N){case"GeometryCollection":return{type:N,geometries:O.geometries.map(R)};case"Point":V=h(O.coordinates);break;case"MultiPoint":V=O.coordinates.map(h);break;case"LineString":V=p(O.arcs);break;case"MultiLineString":V=O.arcs.map(p);break;case"Polygon":V=w(O.arcs);break;case"MultiPolygon":V=O.arcs.map(w);break;default:return null}return{type:N,coordinates:V}}return R(C)}function n(_,C){var M={},E={},A={},h=[],p=-1;C.forEach(function(R,O){var N=_.arcs[R<0?~R:R],V;N.length<3&&!N[1][0]&&!N[1][1]&&(V=C[++p],C[p]=R,C[O]=V)}),C.forEach(function(R){var O=k(R),N=O[0],V=O[1],H,F;if(H=A[N])if(delete A[H.end],H.push(R),H.end=V,F=E[V]){delete E[F.start];var U=F===H?H:H.concat(F);E[U.start=H.start]=A[U.end=F.end]=U}else E[H.start]=A[H.end]=H;else if(H=E[V])if(delete E[H.start],H.unshift(R),H.start=N,F=A[N]){delete A[F.end];var W=F===H?H:F.concat(H);E[W.start=F.start]=A[W.end=H.end]=W}else E[H.start]=A[H.end]=H;else H=[R],E[H.start=N]=A[H.end=V]=H});function k(R){var O=_.arcs[R<0?~R:R],N=O[0],V;return _.transform?(V=[0,0],O.forEach(function(H){V[0]+=H[0],V[1]+=H[1]})):V=O[O.length-1],R<0?[V,N]:[N,V]}function w(R,O){for(var N in R){var V=R[N];delete O[V.start],delete V.start,delete V.end,V.forEach(function(H){M[H<0?~H:H]=1}),h.push(V)}}return w(A,E),w(E,A),C.forEach(function(R){M[R<0?~R:R]||h.push([R])}),h}function o(_){return a(_,i.apply(this,arguments))}function i(_,C,M){var E,A,h;if(arguments.length>1)E=s(_,C,M);else for(A=0,E=new Array(h=_.arcs.length);A<h;++A)E[A]=A;return{type:"MultiLineString",arcs:n(_,E)}}function s(_,C,M){var E=[],A=[],h;function p(N){var V=N<0?~N:N;(A[V]||(A[V]=[])).push({i:N,g:h})}function k(N){N.forEach(p)}function w(N){N.forEach(k)}function R(N){N.forEach(w)}function O(N){switch(h=N,N.type){case"GeometryCollection":N.geometries.forEach(O);break;case"LineString":k(N.arcs);break;case"MultiLineString":case"Polygon":w(N.arcs);break;case"MultiPolygon":R(N.arcs);break}}return O(C),A.forEach(M==null?function(N){E.push(N[0].i)}:function(N){M(N[0].g,N[N.length-1].g)&&E.push(N[0].i)}),E}function f(_){for(var C=-1,M=_.length,E,A=_[M-1],h=0;++C<M;)E=A,A=_[C],h+=E[0]*A[1]-E[1]*A[0];return Math.abs(h)}function x(_){return a(_,y.apply(this,arguments))}function y(_,C){var M={},E=[],A=[];C.forEach(h);function h(w){switch(w.type){case"GeometryCollection":w.geometries.forEach(h);break;case"Polygon":p(w.arcs);break;case"MultiPolygon":w.arcs.forEach(p);break}}function p(w){w.forEach(function(R){R.forEach(function(O){(M[O=O<0?~O:O]||(M[O]=[])).push(w)})}),E.push(w)}function k(w){return f(a(_,{type:"Polygon",arcs:[w]}).coordinates[0])}return E.forEach(function(w){if(!w._){var R=[],O=[w];for(w._=1,A.push(R);w=O.pop();)R.push(w),w.forEach(function(N){N.forEach(function(V){M[V<0?~V:V].forEach(function(H){H._||(H._=1,O.push(H))})})})}}),E.forEach(function(w){delete w._}),{type:"MultiPolygon",arcs:A.map(function(w){var R=[],O;if(w.forEach(function(U){U.forEach(function(W){W.forEach(function(q){M[q<0?~q:q].length<2&&R.push(q)})})}),R=n(_,R),(O=R.length)>1)for(var N=1,V=k(R[0]),H,F;N<O;++N)(H=k(R[N]))>V&&(F=R[0],R[0]=R[N],R[N]=F,V=H);return R}).filter(function(w){return w.length>0})}}function v(_,C){for(var M=0,E=_.length;M<E;){var A=M+E>>>1;_[A]<C?M=A+1:E=A}return M}function T(_){var C={},M=_.map(function(){return[]});function E(U,W){U.forEach(function(q){q<0&&(q=~q);var X=C[q];X?X.push(W):C[q]=[W]})}function A(U,W){U.forEach(function(q){E(q,W)})}function h(U,W){U.type==="GeometryCollection"?U.geometries.forEach(function(q){h(q,W)}):U.type in p&&p[U.type](U.arcs,W)}var p={LineString:E,MultiLineString:A,Polygon:A,MultiPolygon:function(U,W){U.forEach(function(q){A(q,W)})}};_.forEach(h);for(var k in C)for(var w=C[k],R=w.length,O=0;O<R;++O)for(var N=O+1;N<R;++N){var V=w[O],H=w[N],F;(F=M[V])[k=v(F,H)]!==H&&F.splice(k,0,H),(F=M[H])[k=v(F,V)]!==V&&F.splice(k,0,V)}return M}function u(_){if(_==null)return g;var C,M,E=_.scale[0],A=_.scale[1],h=_.translate[0],p=_.translate[1];return function(k,w){w||(C=M=0);var R=2,O=k.length,N=new Array(O),V=Math.round((k[0]-h)/E),H=Math.round((k[1]-p)/A);for(N[0]=V-C,C=V,N[1]=H-M,M=H;R<O;)N[R]=k[R],++R;return N}}function b(_,C){if(_.transform)throw new Error("already quantized");if(!C||!C.scale){if(!((p=Math.floor(C))>=2))throw new Error("n must be ≥2");w=_.bbox||S(_);var M=w[0],E=w[1],A=w[2],h=w[3],p;C={scale:[A-M?(A-M)/(p-1):1,h-E?(h-E)/(p-1):1],translate:[M,E]}}else w=_.bbox;var k=u(C),w,R,O=_.objects,N={};function V(U){return k(U)}function H(U){var W;switch(U.type){case"GeometryCollection":W={type:"GeometryCollection",geometries:U.geometries.map(H)};break;case"Point":W={type:"Point",coordinates:V(U.coordinates)};break;case"MultiPoint":W={type:"MultiPoint",coordinates:U.coordinates.map(V)};break;default:return U}return U.id!=null&&(W.id=U.id),U.bbox!=null&&(W.bbox=U.bbox),U.properties!=null&&(W.properties=U.properties),W}function F(U){var W=0,q=1,X=U.length,lt,yt=new Array(X);for(yt[0]=k(U[0],0);++W<X;)((lt=k(U[W],W))[0]||lt[1])&&(yt[q++]=lt);return q===1&&(yt[q++]=[0,0]),yt.length=q,yt}for(R in O)N[R]=H(O[R]);return{type:"Topology",bbox:w,transform:C,objects:N,arcs:_.arcs.map(F)}}c.bbox=S,c.feature=e,c.merge=x,c.mergeArcs=y,c.mesh=o,c.meshArcs=i,c.neighbors=T,c.quantize=b,c.transform=P,c.untransform=u,Object.defineProperty(c,"__esModule",{value:!0})})}),Gk=Ft((Q,$)=>{var c=$.exports={},g=v3().locationmodeToLayer,P=mS().feature;c.getTopojsonName=function(S){return[S.scope.replace(/ /g,"-"),"_",S.resolution.toString(),"m"].join("")},c.getTopojsonPath=function(S,t){return S+=S.endsWith("/")?"":"/",`${S}${t}.json`},c.getTopojsonFeatures=function(S,t){var e=g[S.locationmode],r=t.objects[e];return P(t,r).features}}),U1=Ft(Q=>{var $=Da().BADNUM;Q.calcTraceToLineCoords=function(c){for(var g=c[0].trace,P=g.connectgaps,S=[],t=[],e=0;e<c.length;e++){var r=c[e],a=r.lonlat;a[0]!==$?t.push(a):!P&&t.length>0&&(S.push(t),t=[])}return t.length>0&&S.push(t),S},Q.makeLine=function(c){return c.length===1?{type:"LineString",coordinates:c[0]}:{type:"MultiLineString",coordinates:c}},Q.makePolygon=function(c){if(c.length===1)return{type:"Polygon",coordinates:c};for(var g=new Array(c.length),P=0;P<c.length;P++)g[P]=[c[P]];return{type:"MultiPolygon",coordinates:g}},Q.makeBlank=function(){return{type:"Point",coordinates:[]}}}),_U=Ft((Q,$)=>{$.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"}}),Yk=Ft(Q=>{Object.defineProperty(Q,"__esModule",{value:!0});var $=63710088e-1,c={centimeters:$*100,centimetres:$*100,degrees:360/(2*Math.PI),feet:$*3.28084,inches:$*39.37,kilometers:$/1e3,kilometres:$/1e3,meters:$,metres:$,miles:$/1609.344,millimeters:$*1e3,millimetres:$*1e3,nauticalmiles:$/1852,radians:1,yards:$*1.0936},g={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function P(O,N,V={}){let H={type:"Feature"};return(V.id===0||V.id)&&(H.id=V.id),V.bbox&&(H.bbox=V.bbox),H.properties=N||{},H.geometry=O,H}function S(O,N,V={}){switch(O){case"Point":return t(N).geometry;case"LineString":return n(N).geometry;case"Polygon":return r(N).geometry;case"MultiPoint":return f(N).geometry;case"MultiLineString":return s(N).geometry;case"MultiPolygon":return x(N).geometry;default:throw new Error(O+" is invalid")}}function t(O,N,V={}){if(!O)throw new Error("coordinates is required");if(!Array.isArray(O))throw new Error("coordinates must be an Array");if(O.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!p(O[0])||!p(O[1]))throw new Error("coordinates must contain numbers");return P({type:"Point",coordinates:O},N,V)}function e(O,N,V={}){return i(O.map(H=>t(H,N)),V)}function r(O,N,V={}){for(let H of O){if(H.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(H[H.length-1].length!==H[0].length)throw new Error("First and last Position are not equivalent.");for(let F=0;F<H[H.length-1].length;F++)if(H[H.length-1][F]!==H[0][F])throw new Error("First and last Position are not equivalent.")}return P({type:"Polygon",coordinates:O},N,V)}function a(O,N,V={}){return i(O.map(H=>r(H,N)),V)}function n(O,N,V={}){if(O.length<2)throw new Error("coordinates must be an array of two or more positions");return P({type:"LineString",coordinates:O},N,V)}function o(O,N,V={}){return i(O.map(H=>n(H,N)),V)}function i(O,N={}){let V={type:"FeatureCollection"};return N.id&&(V.id=N.id),N.bbox&&(V.bbox=N.bbox),V.features=O,V}function s(O,N,V={}){return P({type:"MultiLineString",coordinates:O},N,V)}function f(O,N,V={}){return P({type:"MultiPoint",coordinates:O},N,V)}function x(O,N,V={}){return P({type:"MultiPolygon",coordinates:O},N,V)}function y(O,N,V={}){return P({type:"GeometryCollection",geometries:O},N,V)}function v(O,N=0){if(N&&!(N>=0))throw new Error("precision must be a positive number");let V=Math.pow(10,N||0);return Math.round(O*V)/V}function T(O,N="kilometers"){let V=c[N];if(!V)throw new Error(N+" units is invalid");return O*V}function u(O,N="kilometers"){let V=c[N];if(!V)throw new Error(N+" units is invalid");return O/V}function b(O,N){return M(u(O,N))}function _(O){let N=O%360;return N<0&&(N+=360),N}function C(O){return O=O%360,O>180?O-360:O<-180?O+360:O}function M(O){return O%(2*Math.PI)*180/Math.PI}function E(O){return O%360*Math.PI/180}function A(O,N="kilometers",V="kilometers"){if(!(O>=0))throw new Error("length must be a positive number");return T(u(O,N),V)}function h(O,N="meters",V="kilometers"){if(!(O>=0))throw new Error("area must be a positive number");let H=g[N];if(!H)throw new Error("invalid original units");let F=g[V];if(!F)throw new Error("invalid final units");return O/H*F}function p(O){return!isNaN(O)&&O!==null&&!Array.isArray(O)}function k(O){return O!==null&&typeof O=="object"&&!Array.isArray(O)}function w(O){if(!O)throw new Error("bbox is required");if(!Array.isArray(O))throw new Error("bbox must be an Array");if(O.length!==4&&O.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");O.forEach(N=>{if(!p(N))throw new Error("bbox must only contain numbers")})}function R(O){if(!O)throw new Error("id is required");if(["string","number"].indexOf(typeof O)===-1)throw new Error("id must be a number or a string")}Q.areaFactors=g,Q.azimuthToBearing=C,Q.bearingToAzimuth=_,Q.convertArea=h,Q.convertLength=A,Q.degreesToRadians=E,Q.earthRadius=$,Q.factors=c,Q.feature=P,Q.featureCollection=i,Q.geometry=S,Q.geometryCollection=y,Q.isNumber=p,Q.isObject=k,Q.lengthToDegrees=b,Q.lengthToRadians=u,Q.lineString=n,Q.lineStrings=o,Q.multiLineString=s,Q.multiPoint=f,Q.multiPolygon=x,Q.point=t,Q.points=e,Q.polygon=r,Q.polygons=a,Q.radiansToDegrees=M,Q.radiansToLength=T,Q.round=v,Q.validateBBox=w,Q.validateId=R}),Kk=Ft(Q=>{Object.defineProperty(Q,"__esModule",{value:!0});var $=Yk();function c(u,b,_){if(u!==null)for(var C,M,E,A,h,p,k,w=0,R=0,O,N=u.type,V=N==="FeatureCollection",H=N==="Feature",F=V?u.features.length:1,U=0;U<F;U++){k=V?u.features[U].geometry:H?u.geometry:u,O=k?k.type==="GeometryCollection":!1,h=O?k.geometries.length:1;for(var W=0;W<h;W++){var q=0,X=0;if(A=O?k.geometries[W]:k,A!==null){p=A.coordinates;var lt=A.type;switch(w=_&&(lt==="Polygon"||lt==="MultiPolygon")?1:0,lt){case null:break;case"Point":if(b(p,R,U,q,X)===!1)return!1;R++,q++;break;case"LineString":case"MultiPoint":for(C=0;C<p.length;C++){if(b(p[C],R,U,q,X)===!1)return!1;R++,lt==="MultiPoint"&&q++}lt==="LineString"&&q++;break;case"Polygon":case"MultiLineString":for(C=0;C<p.length;C++){for(M=0;M<p[C].length-w;M++){if(b(p[C][M],R,U,q,X)===!1)return!1;R++}lt==="MultiLineString"&&q++,lt==="Polygon"&&X++}lt==="Polygon"&&q++;break;case"MultiPolygon":for(C=0;C<p.length;C++){for(X=0,M=0;M<p[C].length;M++){for(E=0;E<p[C][M].length-w;E++){if(b(p[C][M][E],R,U,q,X)===!1)return!1;R++}X++}q++}break;case"GeometryCollection":for(C=0;C<A.geometries.length;C++)if(c(A.geometries[C],b,_)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function g(u,b,_,C){var M=_;return c(u,function(E,A,h,p,k){A===0&&_===void 0?M=E:M=b(M,E,A,h,p,k)},C),M}function P(u,b){var _;switch(u.type){case"FeatureCollection":for(_=0;_<u.features.length&&b(u.features[_].properties,_)!==!1;_++);break;case"Feature":b(u.properties,0);break}}function S(u,b,_){var C=_;return P(u,function(M,E){E===0&&_===void 0?C=M:C=b(C,M,E)}),C}function t(u,b){if(u.type==="Feature")b(u,0);else if(u.type==="FeatureCollection")for(var _=0;_<u.features.length&&b(u.features[_],_)!==!1;_++);}function e(u,b,_){var C=_;return t(u,function(M,E){E===0&&_===void 0?C=M:C=b(C,M,E)}),C}function r(u){var b=[];return c(u,function(_){b.push(_)}),b}function a(u,b){var _,C,M,E,A,h,p,k,w,R,O=0,N=u.type==="FeatureCollection",V=u.type==="Feature",H=N?u.features.length:1;for(_=0;_<H;_++){for(h=N?u.features[_].geometry:V?u.geometry:u,k=N?u.features[_].properties:V?u.properties:{},w=N?u.features[_].bbox:V?u.bbox:void 0,R=N?u.features[_].id:V?u.id:void 0,p=h?h.type==="GeometryCollection":!1,A=p?h.geometries.length:1,M=0;M<A;M++){if(E=p?h.geometries[M]:h,E===null){if(b(null,O,k,w,R)===!1)return!1;continue}switch(E.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(b(E,O,k,w,R)===!1)return!1;break}case"GeometryCollection":{for(C=0;C<E.geometries.length;C++)if(b(E.geometries[C],O,k,w,R)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}O++}}function n(u,b,_){var C=_;return a(u,function(M,E,A,h,p){E===0&&_===void 0?C=M:C=b(C,M,E,A,h,p)}),C}function o(u,b){a(u,function(_,C,M,E,A){var h=_===null?null:_.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return b($.feature.call(void 0,_,M,{bbox:E,id:A}),C,0)===!1?!1:void 0}var p;switch(h){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var k=0;k<_.coordinates.length;k++){var w=_.coordinates[k],R={type:p,coordinates:w};if(b($.feature.call(void 0,R,M),C,k)===!1)return!1}})}function i(u,b,_){var C=_;return o(u,function(M,E,A){E===0&&A===0&&_===void 0?C=M:C=b(C,M,E,A)}),C}function s(u,b){o(u,function(_,C,M){var E=0;if(_.geometry){var A=_.geometry.type;if(!(A==="Point"||A==="MultiPoint")){var h,p=0,k=0,w=0;if(c(_,function(R,O,N,V,H){if(h===void 0||C>p||V>k||H>w){h=R,p=C,k=V,w=H,E=0;return}var F=$.lineString.call(void 0,[h,R],_.properties);if(b(F,C,M,H,E)===!1)return!1;E++,h=R})===!1)return!1}}})}function f(u,b,_){var C=_,M=!1;return s(u,function(E,A,h,p,k){M===!1&&_===void 0?C=E:C=b(C,E,A,h,p,k),M=!0}),C}function x(u,b){if(!u)throw new Error("geojson is required");o(u,function(_,C,M){if(_.geometry!==null){var E=_.geometry.type,A=_.geometry.coordinates;switch(E){case"LineString":if(b(_,C,M,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<A.length;h++)if(b($.lineString.call(void 0,A[h],_.properties),C,M,h)===!1)return!1;break}}})}function y(u,b,_){var C=_;return x(u,function(M,E,A,h){E===0&&_===void 0?C=M:C=b(C,M,E,A,h)}),C}function v(u,b){if(b=b||{},!$.isObject.call(void 0,b))throw new Error("options is invalid");var _=b.featureIndex||0,C=b.multiFeatureIndex||0,M=b.geometryIndex||0,E=b.segmentIndex||0,A=b.properties,h;switch(u.type){case"FeatureCollection":_<0&&(_=u.features.length+_),A=A||u.features[_].properties,h=u.features[_].geometry;break;case"Feature":A=A||u.properties,h=u.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=u;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var p=h.coordinates;switch(h.type){case"Point":case"MultiPoint":return null;case"LineString":return E<0&&(E=p.length+E-1),$.lineString.call(void 0,[p[E],p[E+1]],A,b);case"Polygon":return M<0&&(M=p.length+M),E<0&&(E=p[M].length+E-1),$.lineString.call(void 0,[p[M][E],p[M][E+1]],A,b);case"MultiLineString":return C<0&&(C=p.length+C),E<0&&(E=p[C].length+E-1),$.lineString.call(void 0,[p[C][E],p[C][E+1]],A,b);case"MultiPolygon":return C<0&&(C=p.length+C),M<0&&(M=p[C].length+M),E<0&&(E=p[C][M].length-E-1),$.lineString.call(void 0,[p[C][M][E],p[C][M][E+1]],A,b)}throw new Error("geojson is invalid")}function T(u,b){if(b=b||{},!$.isObject.call(void 0,b))throw new Error("options is invalid");var _=b.featureIndex||0,C=b.multiFeatureIndex||0,M=b.geometryIndex||0,E=b.coordIndex||0,A=b.properties,h;switch(u.type){case"FeatureCollection":_<0&&(_=u.features.length+_),A=A||u.features[_].properties,h=u.features[_].geometry;break;case"Feature":A=A||u.properties,h=u.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=u;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var p=h.coordinates;switch(h.type){case"Point":return $.point.call(void 0,p,A,b);case"MultiPoint":return C<0&&(C=p.length+C),$.point.call(void 0,p[C],A,b);case"LineString":return E<0&&(E=p.length+E),$.point.call(void 0,p[E],A,b);case"Polygon":return M<0&&(M=p.length+M),E<0&&(E=p[M].length+E),$.point.call(void 0,p[M][E],A,b);case"MultiLineString":return C<0&&(C=p.length+C),E<0&&(E=p[C].length+E),$.point.call(void 0,p[C][E],A,b);case"MultiPolygon":return C<0&&(C=p.length+C),M<0&&(M=p[C].length+M),E<0&&(E=p[C][M].length-E),$.point.call(void 0,p[C][M][E],A,b)}throw new Error("geojson is invalid")}Q.coordAll=r,Q.coordEach=c,Q.coordReduce=g,Q.featureEach=t,Q.featureReduce=e,Q.findPoint=T,Q.findSegment=v,Q.flattenEach=o,Q.flattenReduce=i,Q.geomEach=a,Q.geomReduce=n,Q.lineEach=x,Q.lineReduce=y,Q.propEach=P,Q.propReduce=S,Q.segmentEach=s,Q.segmentReduce=f}),bU=Ft(Q=>{Object.defineProperty(Q,"__esModule",{value:!0});var $=Yk(),c=Kk();function g(n){return c.geomReduce.call(void 0,n,(o,i)=>o+P(i),0)}function P(n){let o=0,i;switch(n.type){case"Polygon":return S(n.coordinates);case"MultiPolygon":for(i=0;i<n.coordinates.length;i++)o+=S(n.coordinates[i]);return o;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function S(n){let o=0;if(n&&n.length>0){o+=Math.abs(r(n[0]));for(let i=1;i<n.length;i++)o-=Math.abs(r(n[i]))}return o}var t=$.earthRadius*$.earthRadius/2,e=Math.PI/180;function r(n){let o=n.length-1;if(o<=2)return 0;let i=0,s=0;for(;s<o;){let f=n[s],x=n[s+1===o?0:s+1],y=n[s+2>=o?(s+2)%o:s+2],v=f[0]*e,T=x[1]*e,u=y[0]*e;i+=(u-v)*Math.sin(T),s++}return i*t}var a=g;Q.area=g,Q.default=a}),wU=Ft(Q=>{Object.defineProperty(Q,"__esModule",{value:!0});var $=Yk(),c=Kk();function g(S,t={}){let e=0,r=0,a=0;return c.coordEach.call(void 0,S,function(n){e+=n[0],r+=n[1],a++},!0),$.point.call(void 0,[e/a,r/a],t.properties)}var P=g;Q.centroid=g,Q.default=P}),kU=Ft(Q=>{Object.defineProperty(Q,"__esModule",{value:!0});var $=Kk();function c(P,S={}){if(P.bbox!=null&&S.recompute!==!0)return P.bbox;let t=[1/0,1/0,-1/0,-1/0];return $.coordEach.call(void 0,P,e=>{t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}var g=c;Q.bbox=c,Q.default=g}),V1=Ft((Q,$)=>{var c=un(),g=_U(),{area:P}=bU(),{centroid:S}=wU(),{bbox:t}=kU(),e=_1(),r=Ko(),a=Ei(),n=ss(),o=mm(),i=Object.keys(g),s={"ISO-3":e,"USA-states":e,"country names":f};function f(C){for(var M=0;M<i.length;M++){var E=i[M],A=new RegExp(g[E]);if(A.test(C.trim().toLowerCase()))return E}return r.log("Unrecognized country name: "+C+"."),!1}function x(C,M,E){if(!M||typeof M!="string")return!1;var A=s[C](M),h,p,k;if(A){if(C==="USA-states")for(h=[],k=0;k<E.length;k++)p=E[k],p.properties&&p.properties.gu&&p.properties.gu==="USA"&&h.push(p);else h=E;for(k=0;k<h.length;k++)if(p=h[k],p.id===A)return p;r.log(["Location with id",A,"does not have a matching topojson feature at this resolution."].join(" "))}return!1}function y(C){var M=C.geometry,E=M.coordinates,A=C.id,h=[],p,k,w,R;function O(N){for(var V=0;V<N.length-1;V++)if(N[V][0]>0&&N[V+1][0]<0)return V;return null}switch(A==="RUS"||A==="FJI"?p=function(N){var V;if(O(N)===null)V=N;else for(V=new Array(N.length),R=0;R<N.length;R++)V[R]=[N[R][0]<0?N[R][0]+360:N[R][0],N[R][1]];h.push(o.tester(V))}:A==="ATA"?p=function(N){var V=O(N);if(V===null)return h.push(o.tester(N));var H=new Array(N.length+1),F=0;for(R=0;R<N.length;R++)R>V?H[F++]=[N[R][0]+360,N[R][1]]:R===V?(H[F++]=N[R],H[F++]=[N[R][0],-90]):H[F++]=N[R];var U=o.tester(H);U.pts.pop(),h.push(U)}:p=function(N){h.push(o.tester(N))},M.type){case"MultiPolygon":for(k=0;k<E.length;k++)for(w=0;w<E[k].length;w++)p(E[k][w]);break;case"Polygon":for(k=0;k<E.length;k++)p(E[k]);break}return h}function v(C){var M=C.geojson,E=window.PlotlyGeoAssets||{},A=typeof M=="string"?E[M]:M;return a(A)?A:(r.error("Oops ... something went wrong when fetching "+M),!1)}function T(C){var M=C[0].trace,E=v(M);if(!E)return!1;var A={},h=[],p;for(p=0;p<M._length;p++){var k=C[p];(k.loc||k.loc===0)&&(A[k.loc]=k)}function w(N){var V=n(N,M.featureidkey||"id").get(),H=A[V];if(H){var F=N.geometry;if(F.type==="Polygon"||F.type==="MultiPolygon"){var U={type:"Feature",id:V,geometry:F,properties:{}};U.geometry.coordinates.length>0?U.properties.ct=u(U):U.properties.ct=[NaN,NaN],H.fIn=N,H.fOut=U,h.push(U)}else r.log(["Location",H.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete A[V]}switch(E.type){case"FeatureCollection":var R=E.features;for(p=0;p<R.length;p++)w(R[p]);break;case"Feature":w(E);break;default:return r.warn(["Invalid GeoJSON type",(E.type||"none")+".","Traces with locationmode *geojson-id* only support","*FeatureCollection* and *Feature* types."].join(" ")),!1}for(var O in A)r.log(["Location *"+O+"*","does not have a matching feature with id-key","*"+M.featureidkey+"*."].join(" "));return h}function u(C){var M=C.geometry,E;if(M.type==="MultiPolygon")for(var A=M.coordinates,h=0,p=0;p<A.length;p++){var k={type:"Polygon",coordinates:A[p]},w=P(k);w>h&&(h=w,E=k)}else E=M;return S(E).geometry.coordinates}function b(C){var M=window.PlotlyGeoAssets||{},E=[];function A(R){return new Promise(function(O,N){c.json(R,function(V,H){if(V){delete M[R];var F=V.status===404?'GeoJSON at URL "'+R+'" does not exist.':"Unexpected error while fetching from "+R;return N(new Error(F))}return M[R]=H,O(H)})})}function h(R){return new Promise(function(O,N){var V=0,H=setInterval(function(){if(M[R]&&M[R]!=="pending")return clearInterval(H),O(M[R]);if(V>100)return clearInterval(H),N("Unexpected error while fetching from "+R);V++},50)})}for(var p=0;p<C.length;p++){var k=C[p][0].trace,w=k.geojson;typeof w=="string"&&(M[w]?M[w]==="pending"&&E.push(h(w)):(M[w]="pending",E.push(A(w))))}return E}function _(C){return t(C)}$.exports={locationToFeature:x,feature2polygons:y,getTraceGeojson:v,extractTraceFeature:T,fetchTraceGeoData:b,computeBbox:_}}),gS=Ft((Q,$)=>{var c=un(),g=js(),P=li(),S=xl(),t=S.stylePoints,e=S.styleText;$.exports=function(a,n){n&&r(a,n)};function r(a,n){var o=n[0].trace,i=n[0].node3;i.style("opacity",n[0].trace.opacity),t(i,o,a),e(i,o,a),i.selectAll("path.js-line").style("fill","none").each(function(s){var f=c.select(this),x=s.trace,y=x.line||{};f.call(P.stroke,y.color).call(g.dashLine,y.dash||"",y.width||0),x.fill!=="none"&&f.call(P.fill,x.fillcolor)})}}),vS=Ft((Q,$)=>{var c=un(),g=bn(),P=Gk().getTopojsonFeatures,S=U1(),t=V1(),e=Y0().findExtremes,r=Da().BADNUM,a=me().calcMarkerSize,n=Ac(),o=gS();function i(f,x,y){var v=x.layers.frontplot.select(".scatterlayer"),T=g.makeTraceGroups(v,y,"trace scattergeo");function u(b,_){b.lonlat[0]===r&&c.select(_).remove()}T.selectAll("*").remove(),T.each(function(b){var _=c.select(this),C=b[0].trace;if(n.hasLines(C)||C.fill!=="none"){var M=S.calcTraceToLineCoords(b),E=C.fill!=="none"?S.makePolygon(M):S.makeLine(M);_.selectAll("path.js-line").data([{geojson:E,trace:C}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}n.hasMarkers(C)&&_.selectAll("path.point").data(g.identity).enter().append("path").classed("point",!0).each(function(A){u(A,this)}),n.hasText(C)&&_.selectAll("g").data(g.identity).enter().append("g").append("text").each(function(A){u(A,this)}),o(f,b)})}function s(f,x){var y=f[0].trace,v=x[y.geo],T=v._subplot,u=y._length,b,_;if(g.isArrayOrTypedArray(y.locations)){var C=y.locationmode,M=C==="geojson-id"?t.extractTraceFeature(f):P(y,T.topojson);for(b=0;b<u;b++){_=f[b];var E=C==="geojson-id"?_.fOut:t.locationToFeature(C,_.loc,M);_.lonlat=E?E.properties.ct:[r,r]}}var A={padded:!0},h,p;if(v.fitbounds==="geojson"&&y.locationmode==="geojson-id"){var k=t.computeBbox(t.getTraceGeojson(y));h=[k[0],k[2]],p=[k[1],k[3]]}else{for(h=new Array(u),p=new Array(u),b=0;b<u;b++)_=f[b],h[b]=_.lonlat[0],p[b]=_.lonlat[1];A.ppad=a(y,u)}y._extremes.lon=e(v.lonaxis._ax,h,A),y._extremes.lat=e(v.lataxis._ax,p,A)}$.exports={calcGeoJSON:s,plot:i}}),TU=Ft((Q,$)=>{var c=Qh(),g=Da().BADNUM,P=Du(),S=bn().fillText,t=dx();$.exports=function(r,a,n){var o=r.cd,i=o[0].trace,s=r.xa,f=r.ya,x=r.subplot,y=x.projection.isLonLatOverEdges,v=x.project;function T(A){var h=A.lonlat;if(h[0]===g||y(h))return 1/0;var p=v(h),k=v([a,n]),w=Math.abs(p[0]-k[0]),R=Math.abs(p[1]-k[1]),O=Math.max(3,A.mrc||0);return Math.max(Math.sqrt(w*w+R*R)-O,1-3/O)}if(c.getClosest(o,T,r),r.index!==!1){var u=o[r.index],b=u.lonlat,_=[s.c2p(b),f.c2p(b)],C=u.mrc||1;r.x0=_[0]-C,r.x1=_[0]+C,r.y0=_[1]-C,r.y1=_[1]+C,r.loc=u.loc,r.lon=b[0],r.lat=b[1];var M={};M[i.geo]={_subplot:x};var E=i._module.formatLabels(u,i,M);return r.lonLabel=E.lonLabel,r.latLabel=E.latLabel,r.color=P(i,u),r.extraText=e(i,u,r,o[0].t.labels),r.hovertemplate=i.hovertemplate,[r]}};function e(r,a,n,o){if(r.hovertemplate)return;var i=a.hi||r.hoverinfo,s=i==="all"?t.hoverinfo.flags:i.split("+"),f=s.indexOf("location")!==-1&&Array.isArray(r.locations),x=s.indexOf("lon")!==-1,y=s.indexOf("lat")!==-1,v=s.indexOf("text")!==-1,T=[];function u(b){return b+"°"}return f?T.push(a.loc):x&&y?T.push("("+u(n.latLabel)+", "+u(n.lonLabel)+")"):x?T.push(o.lon+u(n.lonLabel)):y&&T.push(o.lat+u(n.latLabel)),v&&S(a,r,T),T.join("<br>")}}),AU=Ft((Q,$)=>{$.exports=function(c,g,P,S,t){c.lon=g.lon,c.lat=g.lat,c.location=g.loc?g.loc:null;var e=S[t];return e.fIn&&e.fIn.properties&&(c.properties=e.fIn.properties),c}}),MU=Ft((Q,$)=>{var c=Ac(),g=Da().BADNUM;$.exports=function(P,S){var t=P.cd,e=P.xaxis,r=P.yaxis,a=[],n=t[0].trace,o,i,s,f,x,y=!c.hasMarkers(n)&&!c.hasText(n);if(y)return[];if(S===!1)for(x=0;x<t.length;x++)t[x].selected=0;else for(x=0;x<t.length;x++)o=t[x],i=o.lonlat,i[0]!==g&&(s=e.c2p(i),f=r.c2p(i),S.contains([s,f],null,x,P)?(a.push({pointNumber:x,lon:i[0],lat:i[1]}),o.selected=1):o.selected=0);return a}}),y3=Ft((Q,$)=>{(function(c,g){g(typeof Q=="object"&&typeof $<"u"?Q:c.d3=c.d3||{})})(Q,function(c){function g(rt,at){return rt<at?-1:rt>at?1:rt>=at?0:NaN}function P(rt){return rt.length===1&&(rt=S(rt)),{left:function(at,vt,it,Y){for(it==null&&(it=0),Y==null&&(Y=at.length);it<Y;){var ft=it+Y>>>1;rt(at[ft],vt)<0?it=ft+1:Y=ft}return it},right:function(at,vt,it,Y){for(it==null&&(it=0),Y==null&&(Y=at.length);it<Y;){var ft=it+Y>>>1;rt(at[ft],vt)>0?Y=ft:it=ft+1}return it}}}function S(rt){return function(at,vt){return g(rt(at),vt)}}var t=P(g),e=t.right,r=t.left;function a(rt,at){at==null&&(at=n);for(var vt=0,it=rt.length-1,Y=rt[0],ft=new Array(it<0?0:it);vt<it;)ft[vt]=at(Y,Y=rt[++vt]);return ft}function n(rt,at){return[rt,at]}function o(rt,at,vt){var it=rt.length,Y=at.length,ft=new Array(it*Y),ut,wt,zt,Pt;for(vt==null&&(vt=n),ut=zt=0;ut<it;++ut)for(Pt=rt[ut],wt=0;wt<Y;++wt,++zt)ft[zt]=vt(Pt,at[wt]);return ft}function i(rt,at){return at<rt?-1:at>rt?1:at>=rt?0:NaN}function s(rt){return rt===null?NaN:+rt}function f(rt,at){var vt=rt.length,it=0,Y=-1,ft=0,ut,wt,zt=0;if(at==null)for(;++Y<vt;)isNaN(ut=s(rt[Y]))||(wt=ut-ft,ft+=wt/++it,zt+=wt*(ut-ft));else for(;++Y<vt;)isNaN(ut=s(at(rt[Y],Y,rt)))||(wt=ut-ft,ft+=wt/++it,zt+=wt*(ut-ft));if(it>1)return zt/(it-1)}function x(rt,at){var vt=f(rt,at);return vt&&Math.sqrt(vt)}function y(rt,at){var vt=rt.length,it=-1,Y,ft,ut;if(at==null){for(;++it<vt;)if((Y=rt[it])!=null&&Y>=Y)for(ft=ut=Y;++it<vt;)(Y=rt[it])!=null&&(ft>Y&&(ft=Y),ut<Y&&(ut=Y))}else for(;++it<vt;)if((Y=at(rt[it],it,rt))!=null&&Y>=Y)for(ft=ut=Y;++it<vt;)(Y=at(rt[it],it,rt))!=null&&(ft>Y&&(ft=Y),ut<Y&&(ut=Y));return[ft,ut]}var v=Array.prototype,T=v.slice,u=v.map;function b(rt){return function(){return rt}}function _(rt){return rt}function C(rt,at,vt){rt=+rt,at=+at,vt=(Y=arguments.length)<2?(at=rt,rt=0,1):Y<3?1:+vt;for(var it=-1,Y=Math.max(0,Math.ceil((at-rt)/vt))|0,ft=new Array(Y);++it<Y;)ft[it]=rt+it*vt;return ft}var M=Math.sqrt(50),E=Math.sqrt(10),A=Math.sqrt(2);function h(rt,at,vt){var it,Y=-1,ft,ut,wt;if(at=+at,rt=+rt,vt=+vt,rt===at&&vt>0)return[rt];if((it=at<rt)&&(ft=rt,rt=at,at=ft),(wt=p(rt,at,vt))===0||!isFinite(wt))return[];if(wt>0)for(rt=Math.ceil(rt/wt),at=Math.floor(at/wt),ut=new Array(ft=Math.ceil(at-rt+1));++Y<ft;)ut[Y]=(rt+Y)*wt;else for(rt=Math.floor(rt*wt),at=Math.ceil(at*wt),ut=new Array(ft=Math.ceil(rt-at+1));++Y<ft;)ut[Y]=(rt-Y)/wt;return it&&ut.reverse(),ut}function p(rt,at,vt){var it=(at-rt)/Math.max(0,vt),Y=Math.floor(Math.log(it)/Math.LN10),ft=it/Math.pow(10,Y);return Y>=0?(ft>=M?10:ft>=E?5:ft>=A?2:1)*Math.pow(10,Y):-Math.pow(10,-Y)/(ft>=M?10:ft>=E?5:ft>=A?2:1)}function k(rt,at,vt){var it=Math.abs(at-rt)/Math.max(0,vt),Y=Math.pow(10,Math.floor(Math.log(it)/Math.LN10)),ft=it/Y;return ft>=M?Y*=10:ft>=E?Y*=5:ft>=A&&(Y*=2),at<rt?-Y:Y}function w(rt){return Math.ceil(Math.log(rt.length)/Math.LN2)+1}function R(){var rt=_,at=y,vt=w;function it(Y){var ft,ut=Y.length,wt,zt=new Array(ut);for(ft=0;ft<ut;++ft)zt[ft]=rt(Y[ft],ft,Y);var Pt=at(zt),Wt=Pt[0],Ht=Pt[1],Jt=vt(zt,Wt,Ht);Array.isArray(Jt)||(Jt=k(Wt,Ht,Jt),Jt=C(Math.ceil(Wt/Jt)*Jt,Ht,Jt));for(var ge=Jt.length;Jt[0]<=Wt;)Jt.shift(),--ge;for(;Jt[ge-1]>Ht;)Jt.pop(),--ge;var he=new Array(ge+1),de;for(ft=0;ft<=ge;++ft)de=he[ft]=[],de.x0=ft>0?Jt[ft-1]:Wt,de.x1=ft<ge?Jt[ft]:Ht;for(ft=0;ft<ut;++ft)wt=zt[ft],Wt<=wt&&wt<=Ht&&he[e(Jt,wt,0,ge)].push(Y[ft]);return he}return it.value=function(Y){return arguments.length?(rt=typeof Y=="function"?Y:b(Y),it):rt},it.domain=function(Y){return arguments.length?(at=typeof Y=="function"?Y:b([Y[0],Y[1]]),it):at},it.thresholds=function(Y){return arguments.length?(vt=typeof Y=="function"?Y:Array.isArray(Y)?b(T.call(Y)):b(Y),it):vt},it}function O(rt,at,vt){if(vt==null&&(vt=s),!!(it=rt.length)){if((at=+at)<=0||it<2)return+vt(rt[0],0,rt);if(at>=1)return+vt(rt[it-1],it-1,rt);var it,Y=(it-1)*at,ft=Math.floor(Y),ut=+vt(rt[ft],ft,rt),wt=+vt(rt[ft+1],ft+1,rt);return ut+(wt-ut)*(Y-ft)}}function N(rt,at,vt){return rt=u.call(rt,s).sort(g),Math.ceil((vt-at)/(2*(O(rt,.75)-O(rt,.25))*Math.pow(rt.length,-1/3)))}function V(rt,at,vt){return Math.ceil((vt-at)/(3.5*x(rt)*Math.pow(rt.length,-1/3)))}function H(rt,at){var vt=rt.length,it=-1,Y,ft;if(at==null){for(;++it<vt;)if((Y=rt[it])!=null&&Y>=Y)for(ft=Y;++it<vt;)(Y=rt[it])!=null&&Y>ft&&(ft=Y)}else for(;++it<vt;)if((Y=at(rt[it],it,rt))!=null&&Y>=Y)for(ft=Y;++it<vt;)(Y=at(rt[it],it,rt))!=null&&Y>ft&&(ft=Y);return ft}function F(rt,at){var vt=rt.length,it=vt,Y=-1,ft,ut=0;if(at==null)for(;++Y<vt;)isNaN(ft=s(rt[Y]))?--it:ut+=ft;else for(;++Y<vt;)isNaN(ft=s(at(rt[Y],Y,rt)))?--it:ut+=ft;if(it)return ut/it}function U(rt,at){var vt=rt.length,it=-1,Y,ft=[];if(at==null)for(;++it<vt;)isNaN(Y=s(rt[it]))||ft.push(Y);else for(;++it<vt;)isNaN(Y=s(at(rt[it],it,rt)))||ft.push(Y);return O(ft.sort(g),.5)}function W(rt){for(var at=rt.length,vt,it=-1,Y=0,ft,ut;++it<at;)Y+=rt[it].length;for(ft=new Array(Y);--at>=0;)for(ut=rt[at],vt=ut.length;--vt>=0;)ft[--Y]=ut[vt];return ft}function q(rt,at){var vt=rt.length,it=-1,Y,ft;if(at==null){for(;++it<vt;)if((Y=rt[it])!=null&&Y>=Y)for(ft=Y;++it<vt;)(Y=rt[it])!=null&&ft>Y&&(ft=Y)}else for(;++it<vt;)if((Y=at(rt[it],it,rt))!=null&&Y>=Y)for(ft=Y;++it<vt;)(Y=at(rt[it],it,rt))!=null&&ft>Y&&(ft=Y);return ft}function X(rt,at){for(var vt=at.length,it=new Array(vt);vt--;)it[vt]=rt[at[vt]];return it}function lt(rt,at){if(vt=rt.length){var vt,it=0,Y=0,ft,ut=rt[Y];for(at==null&&(at=g);++it<vt;)(at(ft=rt[it],ut)<0||at(ut,ut)!==0)&&(ut=ft,Y=it);if(at(ut,ut)===0)return Y}}function yt(rt,at,vt){for(var it=(vt??rt.length)-(at=at==null?0:+at),Y,ft;it;)ft=Math.random()*it--|0,Y=rt[it+at],rt[it+at]=rt[ft+at],rt[ft+at]=Y;return rt}function pt(rt,at){var vt=rt.length,it=-1,Y,ft=0;if(at==null)for(;++it<vt;)(Y=+rt[it])&&(ft+=Y);else for(;++it<vt;)(Y=+at(rt[it],it,rt))&&(ft+=Y);return ft}function st(rt){if(!(ft=rt.length))return[];for(var at=-1,vt=q(rt,tt),it=new Array(vt);++at<vt;)for(var Y=-1,ft,ut=it[at]=new Array(ft);++Y<ft;)ut[Y]=rt[Y][at];return it}function tt(rt){return rt.length}function dt(){return st(arguments)}c.bisect=e,c.bisectRight=e,c.bisectLeft=r,c.ascending=g,c.bisector=P,c.cross=o,c.descending=i,c.deviation=x,c.extent=y,c.histogram=R,c.thresholdFreedmanDiaconis=N,c.thresholdScott=V,c.thresholdSturges=w,c.max=H,c.mean=F,c.median=U,c.merge=W,c.min=q,c.pairs=a,c.permute=X,c.quantile=O,c.range=C,c.scan=lt,c.shuffle=yt,c.sum=pt,c.ticks=h,c.tickIncrement=p,c.tickStep=k,c.transpose=st,c.variance=f,c.zip=dt,Object.defineProperty(c,"__esModule",{value:!0})})}),yS=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q,y3()):(c=c||self,g(c.d3=c.d3||{},c.d3))})(Q,function(c,g){function P(){return new S}function S(){this.reset()}S.prototype={constructor:S,reset:function(){this.s=this.t=0},add:function(mr){e(t,mr,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 S;function e(mr,Ur,_n){var cn=mr.s=Ur+_n,Wn=cn-Ur,hi=cn-Wn;mr.t=Ur-hi+(_n-Wn)}var r=1e-6,a=1e-12,n=Math.PI,o=n/2,i=n/4,s=n*2,f=180/n,x=n/180,y=Math.abs,v=Math.atan,T=Math.atan2,u=Math.cos,b=Math.ceil,_=Math.exp,C=Math.log,M=Math.pow,E=Math.sin,A=Math.sign||function(mr){return mr>0?1:mr<0?-1:0},h=Math.sqrt,p=Math.tan;function k(mr){return mr>1?0:mr<-1?n:Math.acos(mr)}function w(mr){return mr>1?o:mr<-1?-o:Math.asin(mr)}function R(mr){return(mr=E(mr/2))*mr}function O(){}function N(mr,Ur){mr&&H.hasOwnProperty(mr.type)&&H[mr.type](mr,Ur)}var V={Feature:function(mr,Ur){N(mr.geometry,Ur)},FeatureCollection:function(mr,Ur){for(var _n=mr.features,cn=-1,Wn=_n.length;++cn<Wn;)N(_n[cn].geometry,Ur)}},H={Sphere:function(mr,Ur){Ur.sphere()},Point:function(mr,Ur){mr=mr.coordinates,Ur.point(mr[0],mr[1],mr[2])},MultiPoint:function(mr,Ur){for(var _n=mr.coordinates,cn=-1,Wn=_n.length;++cn<Wn;)mr=_n[cn],Ur.point(mr[0],mr[1],mr[2])},LineString:function(mr,Ur){F(mr.coordinates,Ur,0)},MultiLineString:function(mr,Ur){for(var _n=mr.coordinates,cn=-1,Wn=_n.length;++cn<Wn;)F(_n[cn],Ur,0)},Polygon:function(mr,Ur){U(mr.coordinates,Ur)},MultiPolygon:function(mr,Ur){for(var _n=mr.coordinates,cn=-1,Wn=_n.length;++cn<Wn;)U(_n[cn],Ur)},GeometryCollection:function(mr,Ur){for(var _n=mr.geometries,cn=-1,Wn=_n.length;++cn<Wn;)N(_n[cn],Ur)}};function F(mr,Ur,_n){var cn=-1,Wn=mr.length-_n,hi;for(Ur.lineStart();++cn<Wn;)hi=mr[cn],Ur.point(hi[0],hi[1],hi[2]);Ur.lineEnd()}function U(mr,Ur){var _n=-1,cn=mr.length;for(Ur.polygonStart();++_n<cn;)F(mr[_n],Ur,1);Ur.polygonEnd()}function W(mr,Ur){mr&&V.hasOwnProperty(mr.type)?V[mr.type](mr,Ur):N(mr,Ur)}var q=P(),X=P(),lt,yt,pt,st,tt,dt={point:O,lineStart:O,lineEnd:O,polygonStart:function(){q.reset(),dt.lineStart=rt,dt.lineEnd=at},polygonEnd:function(){var mr=+q;X.add(mr<0?s+mr:mr),this.lineStart=this.lineEnd=this.point=O},sphere:function(){X.add(s)}};function rt(){dt.point=vt}function at(){it(lt,yt)}function vt(mr,Ur){dt.point=it,lt=mr,yt=Ur,mr*=x,Ur*=x,pt=mr,st=u(Ur=Ur/2+i),tt=E(Ur)}function it(mr,Ur){mr*=x,Ur*=x,Ur=Ur/2+i;var _n=mr-pt,cn=_n>=0?1:-1,Wn=cn*_n,hi=u(Ur),ea=E(Ur),ga=tt*ea,Ra=st*hi+ga*u(Wn),$a=ga*cn*E(Wn);q.add(T($a,Ra)),pt=mr,st=hi,tt=ea}function Y(mr){return X.reset(),W(mr,dt),X*2}function ft(mr){return[T(mr[1],mr[0]),w(mr[2])]}function ut(mr){var Ur=mr[0],_n=mr[1],cn=u(_n);return[cn*u(Ur),cn*E(Ur),E(_n)]}function wt(mr,Ur){return mr[0]*Ur[0]+mr[1]*Ur[1]+mr[2]*Ur[2]}function zt(mr,Ur){return[mr[1]*Ur[2]-mr[2]*Ur[1],mr[2]*Ur[0]-mr[0]*Ur[2],mr[0]*Ur[1]-mr[1]*Ur[0]]}function Pt(mr,Ur){mr[0]+=Ur[0],mr[1]+=Ur[1],mr[2]+=Ur[2]}function Wt(mr,Ur){return[mr[0]*Ur,mr[1]*Ur,mr[2]*Ur]}function Ht(mr){var Ur=h(mr[0]*mr[0]+mr[1]*mr[1]+mr[2]*mr[2]);mr[0]/=Ur,mr[1]/=Ur,mr[2]/=Ur}var Jt,ge,he,de,se,Tt,Lt,Mt,te=P(),ve,oe,Te={point:He,lineStart:cr,lineEnd:ur,polygonStart:function(){Te.point=jr,Te.lineStart=Hr,Te.lineEnd=br,te.reset(),dt.polygonStart()},polygonEnd:function(){dt.polygonEnd(),Te.point=He,Te.lineStart=cr,Te.lineEnd=ur,q<0?(Jt=-(he=180),ge=-(de=90)):te>r?de=90:te<-r&&(ge=-90),oe[0]=Jt,oe[1]=he},sphere:function(){Jt=-(he=180),ge=-(de=90)}};function He(mr,Ur){ve.push(oe=[Jt=mr,he=mr]),Ur<ge&&(ge=Ur),Ur>de&&(de=Ur)}function Ge(mr,Ur){var _n=ut([mr*x,Ur*x]);if(Mt){var cn=zt(Mt,_n),Wn=[cn[1],-cn[0],0],hi=zt(Wn,cn);Ht(hi),hi=ft(hi);var ea=mr-se,ga=ea>0?1:-1,Ra=hi[0]*f*ga,$a,ua=y(ea)>180;ua^(ga*se<Ra&&Ra<ga*mr)?($a=hi[1]*f,$a>de&&(de=$a)):(Ra=(Ra+360)%360-180,ua^(ga*se<Ra&&Ra<ga*mr)?($a=-hi[1]*f,$a<ge&&(ge=$a)):(Ur<ge&&(ge=Ur),Ur>de&&(de=Ur))),ua?mr<se?Kr(Jt,mr)>Kr(Jt,he)&&(he=mr):Kr(mr,he)>Kr(Jt,he)&&(Jt=mr):he>=Jt?(mr<Jt&&(Jt=mr),mr>he&&(he=mr)):mr>se?Kr(Jt,mr)>Kr(Jt,he)&&(he=mr):Kr(mr,he)>Kr(Jt,he)&&(Jt=mr)}else ve.push(oe=[Jt=mr,he=mr]);Ur<ge&&(ge=Ur),Ur>de&&(de=Ur),Mt=_n,se=mr}function cr(){Te.point=Ge}function ur(){oe[0]=Jt,oe[1]=he,Te.point=He,Mt=null}function jr(mr,Ur){if(Mt){var _n=mr-se;te.add(y(_n)>180?_n+(_n>0?360:-360):_n)}else Tt=mr,Lt=Ur;dt.point(mr,Ur),Ge(mr,Ur)}function Hr(){dt.lineStart()}function br(){jr(Tt,Lt),dt.lineEnd(),y(te)>r&&(Jt=-(he=180)),oe[0]=Jt,oe[1]=he,Mt=null}function Kr(mr,Ur){return(Ur-=mr)<0?Ur+360:Ur}function rn(mr,Ur){return mr[0]-Ur[0]}function Ce(mr,Ur){return mr[0]<=mr[1]?mr[0]<=Ur&&Ur<=mr[1]:Ur<mr[0]||mr[1]<Ur}function $t(mr){var Ur,_n,cn,Wn,hi,ea,ga;if(de=he=-(Jt=ge=1/0),ve=[],W(mr,Te),_n=ve.length){for(ve.sort(rn),Ur=1,cn=ve[0],hi=[cn];Ur<_n;++Ur)Wn=ve[Ur],Ce(cn,Wn[0])||Ce(cn,Wn[1])?(Kr(cn[0],Wn[1])>Kr(cn[0],cn[1])&&(cn[1]=Wn[1]),Kr(Wn[0],cn[1])>Kr(cn[0],cn[1])&&(cn[0]=Wn[0])):hi.push(cn=Wn);for(ea=-1/0,_n=hi.length-1,Ur=0,cn=hi[_n];Ur<=_n;cn=Wn,++Ur)Wn=hi[Ur],(ga=Kr(cn[1],Wn[0]))>ea&&(ea=ga,Jt=Wn[0],he=cn[1])}return ve=oe=null,Jt===1/0||ge===1/0?[[NaN,NaN],[NaN,NaN]]:[[Jt,ge],[he,de]]}var ne,Ct,gt,St,Nt,ee,le,we,Ue,qe,ar,Ar,Tr,pr,Jr,Vn,Hn={sphere:O,point:Kn,lineStart:ii,lineEnd:Hi,polygonStart:function(){Hn.lineStart=We,Hn.lineEnd=rr},polygonEnd:function(){Hn.lineStart=ii,Hn.lineEnd=Hi}};function Kn(mr,Ur){mr*=x,Ur*=x;var _n=u(Ur);Ci(_n*u(mr),_n*E(mr),E(Ur))}function Ci(mr,Ur,_n){++ne,gt+=(mr-gt)/ne,St+=(Ur-St)/ne,Nt+=(_n-Nt)/ne}function ii(){Hn.point=qn}function qn(mr,Ur){mr*=x,Ur*=x;var _n=u(Ur);pr=_n*u(mr),Jr=_n*E(mr),Vn=E(Ur),Hn.point=oa,Ci(pr,Jr,Vn)}function oa(mr,Ur){mr*=x,Ur*=x;var _n=u(Ur),cn=_n*u(mr),Wn=_n*E(mr),hi=E(Ur),ea=T(h((ea=Jr*hi-Vn*Wn)*ea+(ea=Vn*cn-pr*hi)*ea+(ea=pr*Wn-Jr*cn)*ea),pr*cn+Jr*Wn+Vn*hi);Ct+=ea,ee+=ea*(pr+(pr=cn)),le+=ea*(Jr+(Jr=Wn)),we+=ea*(Vn+(Vn=hi)),Ci(pr,Jr,Vn)}function Hi(){Hn.point=Kn}function We(){Hn.point=fr}function rr(){xr(Ar,Tr),Hn.point=Kn}function fr(mr,Ur){Ar=mr,Tr=Ur,mr*=x,Ur*=x,Hn.point=xr;var _n=u(Ur);pr=_n*u(mr),Jr=_n*E(mr),Vn=E(Ur),Ci(pr,Jr,Vn)}function xr(mr,Ur){mr*=x,Ur*=x;var _n=u(Ur),cn=_n*u(mr),Wn=_n*E(mr),hi=E(Ur),ea=Jr*hi-Vn*Wn,ga=Vn*cn-pr*hi,Ra=pr*Wn-Jr*cn,$a=h(ea*ea+ga*ga+Ra*Ra),ua=w($a),za=$a&&-ua/$a;Ue+=za*ea,qe+=za*ga,ar+=za*Ra,Ct+=ua,ee+=ua*(pr+(pr=cn)),le+=ua*(Jr+(Jr=Wn)),we+=ua*(Vn+(Vn=hi)),Ci(pr,Jr,Vn)}function Qr(mr){ne=Ct=gt=St=Nt=ee=le=we=Ue=qe=ar=0,W(mr,Hn);var Ur=Ue,_n=qe,cn=ar,Wn=Ur*Ur+_n*_n+cn*cn;return Wn<a&&(Ur=ee,_n=le,cn=we,Ct<r&&(Ur=gt,_n=St,cn=Nt),Wn=Ur*Ur+_n*_n+cn*cn,Wn<a)?[NaN,NaN]:[T(_n,Ur)*f,w(cn/h(Wn))*f]}function Cn(mr){return function(){return mr}}function wn(mr,Ur){function _n(cn,Wn){return cn=mr(cn,Wn),Ur(cn[0],cn[1])}return mr.invert&&Ur.invert&&(_n.invert=function(cn,Wn){return cn=Ur.invert(cn,Wn),cn&&mr.invert(cn[0],cn[1])}),_n}function Mn(mr,Ur){return[y(mr)>n?mr+Math.round(-mr/s)*s:mr,Ur]}Mn.invert=Mn;function ci(mr,Ur,_n){return(mr%=s)?Ur||_n?wn(Pi(mr),Di(Ur,_n)):Pi(mr):Ur||_n?Di(Ur,_n):Mn}function xi(mr){return function(Ur,_n){return Ur+=mr,[Ur>n?Ur-s:Ur<-n?Ur+s:Ur,_n]}}function Pi(mr){var Ur=xi(mr);return Ur.invert=xi(-mr),Ur}function Di(mr,Ur){var _n=u(mr),cn=E(mr),Wn=u(Ur),hi=E(Ur);function ea(ga,Ra){var $a=u(Ra),ua=u(ga)*$a,za=E(ga)*$a,wa=E(Ra),Ji=wa*_n+ua*cn;return[T(za*Wn-Ji*hi,ua*_n-wa*cn),w(Ji*Wn+za*hi)]}return ea.invert=function(ga,Ra){var $a=u(Ra),ua=u(ga)*$a,za=E(ga)*$a,wa=E(Ra),Ji=wa*Wn-za*hi;return[T(za*Wn+wa*hi,ua*_n+Ji*cn),w(Ji*_n-ua*cn)]},ea}function Zi(mr){mr=ci(mr[0]*x,mr[1]*x,mr.length>2?mr[2]*x:0);function Ur(_n){return _n=mr(_n[0]*x,_n[1]*x),_n[0]*=f,_n[1]*=f,_n}return Ur.invert=function(_n){return _n=mr.invert(_n[0]*x,_n[1]*x),_n[0]*=f,_n[1]*=f,_n},Ur}function ui(mr,Ur,_n,cn,Wn,hi){if(_n){var ea=u(Ur),ga=E(Ur),Ra=cn*_n;Wn==null?(Wn=Ur+cn*s,hi=Ur-Ra/2):(Wn=Pa(ea,Wn),hi=Pa(ea,hi),(cn>0?Wn<hi:Wn>hi)&&(Wn+=cn*s));for(var $a,ua=Wn;cn>0?ua>hi:ua<hi;ua-=Ra)$a=ft([ea,-ga*u(ua),-ga*E(ua)]),mr.point($a[0],$a[1])}}function Pa(mr,Ur){Ur=ut(Ur),Ur[0]-=mr,Ht(Ur);var _n=k(-Ur[1]);return((-Ur[2]<0?-_n:_n)+s-r)%s}function Wa(){var mr=Cn([0,0]),Ur=Cn(90),_n=Cn(6),cn,Wn,hi={point:ea};function ea(Ra,$a){cn.push(Ra=Wn(Ra,$a)),Ra[0]*=f,Ra[1]*=f}function ga(){var Ra=mr.apply(this,arguments),$a=Ur.apply(this,arguments)*x,ua=_n.apply(this,arguments)*x;return cn=[],Wn=ci(-Ra[0]*x,-Ra[1]*x,0).invert,ui(hi,$a,ua,1),Ra={type:"Polygon",coordinates:[cn]},cn=Wn=null,Ra}return ga.center=function(Ra){return arguments.length?(mr=typeof Ra=="function"?Ra:Cn([+Ra[0],+Ra[1]]),ga):mr},ga.radius=function(Ra){return arguments.length?(Ur=typeof Ra=="function"?Ra:Cn(+Ra),ga):Ur},ga.precision=function(Ra){return arguments.length?(_n=typeof Ra=="function"?Ra:Cn(+Ra),ga):_n},ga}function ze(){var mr=[],Ur;return{point:function(_n,cn,Wn){Ur.push([_n,cn,Wn])},lineStart:function(){mr.push(Ur=[])},lineEnd:O,rejoin:function(){mr.length>1&&mr.push(mr.pop().concat(mr.shift()))},result:function(){var _n=mr;return mr=[],Ur=null,_n}}}function Pe(mr,Ur){return y(mr[0]-Ur[0])<r&&y(mr[1]-Ur[1])<r}function Rr(mr,Ur,_n,cn){this.x=mr,this.z=Ur,this.o=_n,this.e=cn,this.v=!1,this.n=this.p=null}function qr(mr,Ur,_n,cn,Wn){var hi=[],ea=[],ga,Ra;if(mr.forEach(function(eo){if(!((rs=eo.length-1)<=0)){var rs,Zo=eo[0],os=eo[rs],fs;if(Pe(Zo,os)){if(!Zo[2]&&!os[2]){for(Wn.lineStart(),ga=0;ga<rs;++ga)Wn.point((Zo=eo[ga])[0],Zo[1]);Wn.lineEnd();return}os[0]+=2*r}hi.push(fs=new Rr(Zo,eo,null,!0)),ea.push(fs.o=new Rr(Zo,null,fs,!1)),hi.push(fs=new Rr(os,eo,null,!1)),ea.push(fs.o=new Rr(os,null,fs,!0))}}),!!hi.length){for(ea.sort(Ur),$r(hi),$r(ea),ga=0,Ra=ea.length;ga<Ra;++ga)ea[ga].e=_n=!_n;for(var $a=hi[0],ua,za;;){for(var wa=$a,Ji=!0;wa.v;)if((wa=wa.n)===$a)return;ua=wa.z,Wn.lineStart();do{if(wa.v=wa.o.v=!0,wa.e){if(Ji)for(ga=0,Ra=ua.length;ga<Ra;++ga)Wn.point((za=ua[ga])[0],za[1]);else cn(wa.x,wa.n.x,1,Wn);wa=wa.n}else{if(Ji)for(ua=wa.p.z,ga=ua.length-1;ga>=0;--ga)Wn.point((za=ua[ga])[0],za[1]);else cn(wa.x,wa.p.x,-1,Wn);wa=wa.p}wa=wa.o,ua=wa.z,Ji=!Ji}while(!wa.v);Wn.lineEnd()}}}function $r(mr){if(Ur=mr.length){for(var Ur,_n=0,cn=mr[0],Wn;++_n<Ur;)cn.n=Wn=mr[_n],Wn.p=cn,cn=Wn;cn.n=Wn=mr[0],Wn.p=cn}}var Br=P();function Gr(mr){return y(mr[0])<=n?mr[0]:A(mr[0])*((y(mr[0])+n)%s-n)}function dn(mr,Ur){var _n=Gr(Ur),cn=Ur[1],Wn=E(cn),hi=[E(_n),-u(_n),0],ea=0,ga=0;Br.reset(),Wn===1?cn=o+r:Wn===-1&&(cn=-o-r);for(var Ra=0,$a=mr.length;Ra<$a;++Ra)if(za=(ua=mr[Ra]).length)for(var ua,za,wa=ua[za-1],Ji=Gr(wa),eo=wa[1]/2+i,rs=E(eo),Zo=u(eo),os=0;os<za;++os,Ji=no,rs=ds,Zo=tl,wa=fs){var fs=ua[os],no=Gr(fs),qa=fs[1]/2+i,ds=E(qa),tl=u(qa),Pl=no-Ji,iu=Pl>=0?1:-1,Hl=iu*Pl,au=Hl>n,ml=rs*ds;if(Br.add(T(ml*iu*E(Hl),Zo*tl+ml*u(Hl))),ea+=au?Pl+iu*s:Pl,au^Ji>=_n^no>=_n){var qu=zt(ut(wa),ut(fs));Ht(qu);var Lu=zt(hi,qu);Ht(Lu);var uu=(au^Pl>=0?-1:1)*w(Lu[2]);(cn>uu||cn===uu&&(qu[0]||qu[1]))&&(ga+=au^Pl>=0?1:-1)}}return(ea<-r||ea<r&&Br<-r)^ga&1}function an(mr,Ur,_n,cn){return function(Wn){var hi=Ur(Wn),ea=ze(),ga=Ur(ea),Ra=!1,$a,ua,za,wa={point:Ji,lineStart:rs,lineEnd:Zo,polygonStart:function(){wa.point=os,wa.lineStart=fs,wa.lineEnd=no,ua=[],$a=[]},polygonEnd:function(){wa.point=Ji,wa.lineStart=rs,wa.lineEnd=Zo,ua=g.merge(ua);var qa=dn($a,cn);ua.length?(Ra||(Wn.polygonStart(),Ra=!0),qr(ua,dr,qa,_n,Wn)):qa&&(Ra||(Wn.polygonStart(),Ra=!0),Wn.lineStart(),_n(null,null,1,Wn),Wn.lineEnd()),Ra&&(Wn.polygonEnd(),Ra=!1),ua=$a=null},sphere:function(){Wn.polygonStart(),Wn.lineStart(),_n(null,null,1,Wn),Wn.lineEnd(),Wn.polygonEnd()}};function Ji(qa,ds){mr(qa,ds)&&Wn.point(qa,ds)}function eo(qa,ds){hi.point(qa,ds)}function rs(){wa.point=eo,hi.lineStart()}function Zo(){wa.point=Ji,hi.lineEnd()}function os(qa,ds){za.push([qa,ds]),ga.point(qa,ds)}function fs(){ga.lineStart(),za=[]}function no(){os(za[0][0],za[0][1]),ga.lineEnd();var qa=ga.clean(),ds=ea.result(),tl,Pl=ds.length,iu,Hl,au;if(za.pop(),$a.push(za),za=null,!!Pl){if(qa&1){if(Hl=ds[0],(iu=Hl.length-1)>0){for(Ra||(Wn.polygonStart(),Ra=!0),Wn.lineStart(),tl=0;tl<iu;++tl)Wn.point((au=Hl[tl])[0],au[1]);Wn.lineEnd()}return}Pl>1&&qa&2&&ds.push(ds.pop().concat(ds.shift())),ua.push(ds.filter(Ee))}}return wa}}function Ee(mr){return mr.length>1}function dr(mr,Ur){return((mr=mr.x)[0]<0?mr[1]-o-r:o-mr[1])-((Ur=Ur.x)[0]<0?Ur[1]-o-r:o-Ur[1])}var Vr=an(function(){return!0},yn,Xn,[-n,-o]);function yn(mr){var Ur=NaN,_n=NaN,cn=NaN,Wn;return{lineStart:function(){mr.lineStart(),Wn=1},point:function(hi,ea){var ga=hi>0?n:-n,Ra=y(hi-Ur);y(Ra-n)<r?(mr.point(Ur,_n=(_n+ea)/2>0?o:-o),mr.point(cn,_n),mr.lineEnd(),mr.lineStart(),mr.point(ga,_n),mr.point(hi,_n),Wn=0):cn!==ga&&Ra>=n&&(y(Ur-cn)<r&&(Ur-=cn*r),y(hi-ga)<r&&(hi-=ga*r),_n=Fn(Ur,_n,hi,ea),mr.point(cn,_n),mr.lineEnd(),mr.lineStart(),mr.point(ga,_n),Wn=0),mr.point(Ur=hi,_n=ea),cn=ga},lineEnd:function(){mr.lineEnd(),Ur=_n=NaN},clean:function(){return 2-Wn}}}function Fn(mr,Ur,_n,cn){var Wn,hi,ea=E(mr-_n);return y(ea)>r?v((E(Ur)*(hi=u(cn))*E(_n)-E(cn)*(Wn=u(Ur))*E(mr))/(Wn*hi*ea)):(Ur+cn)/2}function Xn(mr,Ur,_n,cn){var Wn;if(mr==null)Wn=_n*o,cn.point(-n,Wn),cn.point(0,Wn),cn.point(n,Wn),cn.point(n,0),cn.point(n,-Wn),cn.point(0,-Wn),cn.point(-n,-Wn),cn.point(-n,0),cn.point(-n,Wn);else if(y(mr[0]-Ur[0])>r){var hi=mr[0]<Ur[0]?n:-n;Wn=_n*hi/2,cn.point(-hi,Wn),cn.point(0,Wn),cn.point(hi,Wn)}else cn.point(Ur[0],Ur[1])}function Pn(mr){var Ur=u(mr),_n=6*x,cn=Ur>0,Wn=y(Ur)>r;function hi(ua,za,wa,Ji){ui(Ji,mr,_n,wa,ua,za)}function ea(ua,za){return u(ua)*u(za)>Ur}function ga(ua){var za,wa,Ji,eo,rs;return{lineStart:function(){eo=Ji=!1,rs=1},point:function(Zo,os){var fs=[Zo,os],no,qa=ea(Zo,os),ds=cn?qa?0:$a(Zo,os):qa?$a(Zo+(Zo<0?n:-n),os):0;if(!za&&(eo=Ji=qa)&&ua.lineStart(),qa!==Ji&&(no=Ra(za,fs),(!no||Pe(za,no)||Pe(fs,no))&&(fs[2]=1)),qa!==Ji)rs=0,qa?(ua.lineStart(),no=Ra(fs,za),ua.point(no[0],no[1])):(no=Ra(za,fs),ua.point(no[0],no[1],2),ua.lineEnd()),za=no;else if(Wn&&za&&cn^qa){var tl;!(ds&wa)&&(tl=Ra(fs,za,!0))&&(rs=0,cn?(ua.lineStart(),ua.point(tl[0][0],tl[0][1]),ua.point(tl[1][0],tl[1][1]),ua.lineEnd()):(ua.point(tl[1][0],tl[1][1]),ua.lineEnd(),ua.lineStart(),ua.point(tl[0][0],tl[0][1],3)))}qa&&(!za||!Pe(za,fs))&&ua.point(fs[0],fs[1]),za=fs,Ji=qa,wa=ds},lineEnd:function(){Ji&&ua.lineEnd(),za=null},clean:function(){return rs|(eo&&Ji)<<1}}}function Ra(ua,za,wa){var Ji=ut(ua),eo=ut(za),rs=[1,0,0],Zo=zt(Ji,eo),os=wt(Zo,Zo),fs=Zo[0],no=os-fs*fs;if(!no)return!wa&&ua;var qa=Ur*os/no,ds=-Ur*fs/no,tl=zt(rs,Zo),Pl=Wt(rs,qa),iu=Wt(Zo,ds);Pt(Pl,iu);var Hl=tl,au=wt(Pl,Hl),ml=wt(Hl,Hl),qu=au*au-ml*(wt(Pl,Pl)-1);if(!(qu<0)){var Lu=h(qu),uu=Wt(Hl,(-au-Lu)/ml);if(Pt(uu,Pl),uu=ft(uu),!wa)return uu;var zo=ua[0],Ms=za[0],$l=ua[1],Fl=za[1],vc;Ms<zo&&(vc=zo,zo=Ms,Ms=vc);var Hc=Ms-zo,Pc=y(Hc-n)<r,Ph=Pc||Hc<r;if(!Pc&&Fl<$l&&(vc=$l,$l=Fl,Fl=vc),Ph?Pc?$l+Fl>0^uu[1]<(y(uu[0]-zo)<r?$l:Fl):$l<=uu[1]&&uu[1]<=Fl:Hc>n^(zo<=uu[0]&&uu[0]<=Ms)){var Wc=Wt(Hl,(-au+Lu)/ml);return Pt(Wc,Pl),[uu,ft(Wc)]}}}function $a(ua,za){var wa=cn?mr:n-mr,Ji=0;return ua<-wa?Ji|=1:ua>wa&&(Ji|=2),za<-wa?Ji|=4:za>wa&&(Ji|=8),Ji}return an(ea,ga,hi,cn?[0,-mr]:[-n,mr-n])}function En(mr,Ur,_n,cn,Wn,hi){var ea=mr[0],ga=mr[1],Ra=Ur[0],$a=Ur[1],ua=0,za=1,wa=Ra-ea,Ji=$a-ga,eo;if(eo=_n-ea,!(!wa&&eo>0)){if(eo/=wa,wa<0){if(eo<ua)return;eo<za&&(za=eo)}else if(wa>0){if(eo>za)return;eo>ua&&(ua=eo)}if(eo=Wn-ea,!(!wa&&eo<0)){if(eo/=wa,wa<0){if(eo>za)return;eo>ua&&(ua=eo)}else if(wa>0){if(eo<ua)return;eo<za&&(za=eo)}if(eo=cn-ga,!(!Ji&&eo>0)){if(eo/=Ji,Ji<0){if(eo<ua)return;eo<za&&(za=eo)}else if(Ji>0){if(eo>za)return;eo>ua&&(ua=eo)}if(eo=hi-ga,!(!Ji&&eo<0)){if(eo/=Ji,Ji<0){if(eo>za)return;eo>ua&&(ua=eo)}else if(Ji>0){if(eo<ua)return;eo<za&&(za=eo)}return ua>0&&(mr[0]=ea+ua*wa,mr[1]=ga+ua*Ji),za<1&&(Ur[0]=ea+za*wa,Ur[1]=ga+za*Ji),!0}}}}}var Zn=1e9,Ca=-Zn;function Ri(mr,Ur,_n,cn){function Wn($a,ua){return mr<=$a&&$a<=_n&&Ur<=ua&&ua<=cn}function hi($a,ua,za,wa){var Ji=0,eo=0;if($a==null||(Ji=ea($a,za))!==(eo=ea(ua,za))||Ra($a,ua)<0^za>0)do wa.point(Ji===0||Ji===3?mr:_n,Ji>1?cn:Ur);while((Ji=(Ji+za+4)%4)!==eo);else wa.point(ua[0],ua[1])}function ea($a,ua){return y($a[0]-mr)<r?ua>0?0:3:y($a[0]-_n)<r?ua>0?2:1:y($a[1]-Ur)<r?ua>0?1:0:ua>0?3:2}function ga($a,ua){return Ra($a.x,ua.x)}function Ra($a,ua){var za=ea($a,1),wa=ea(ua,1);return za!==wa?za-wa:za===0?ua[1]-$a[1]:za===1?$a[0]-ua[0]:za===2?$a[1]-ua[1]:ua[0]-$a[0]}return function($a){var ua=$a,za=ze(),wa,Ji,eo,rs,Zo,os,fs,no,qa,ds,tl,Pl={point:iu,lineStart:qu,lineEnd:Lu,polygonStart:au,polygonEnd:ml};function iu(zo,Ms){Wn(zo,Ms)&&ua.point(zo,Ms)}function Hl(){for(var zo=0,Ms=0,$l=Ji.length;Ms<$l;++Ms)for(var Fl=Ji[Ms],vc=1,Hc=Fl.length,Pc=Fl[0],Ph,Wc,zh=Pc[0],Iu=Pc[1];vc<Hc;++vc)Ph=zh,Wc=Iu,Pc=Fl[vc],zh=Pc[0],Iu=Pc[1],Wc<=cn?Iu>cn&&(zh-Ph)*(cn-Wc)>(Iu-Wc)*(mr-Ph)&&++zo:Iu<=cn&&(zh-Ph)*(cn-Wc)<(Iu-Wc)*(mr-Ph)&&--zo;return zo}function au(){ua=za,wa=[],Ji=[],tl=!0}function ml(){var zo=Hl(),Ms=tl&&zo,$l=(wa=g.merge(wa)).length;(Ms||$l)&&($a.polygonStart(),Ms&&($a.lineStart(),hi(null,null,1,$a),$a.lineEnd()),$l&&qr(wa,ga,zo,hi,$a),$a.polygonEnd()),ua=$a,wa=Ji=eo=null}function qu(){Pl.point=uu,Ji&&Ji.push(eo=[]),ds=!0,qa=!1,fs=no=NaN}function Lu(){wa&&(uu(rs,Zo),os&&qa&&za.rejoin(),wa.push(za.result())),Pl.point=iu,qa&&ua.lineEnd()}function uu(zo,Ms){var $l=Wn(zo,Ms);if(Ji&&eo.push([zo,Ms]),ds)rs=zo,Zo=Ms,os=$l,ds=!1,$l&&(ua.lineStart(),ua.point(zo,Ms));else if($l&&qa)ua.point(zo,Ms);else{var Fl=[fs=Math.max(Ca,Math.min(Zn,fs)),no=Math.max(Ca,Math.min(Zn,no))],vc=[zo=Math.max(Ca,Math.min(Zn,zo)),Ms=Math.max(Ca,Math.min(Zn,Ms))];En(Fl,vc,mr,Ur,_n,cn)?(qa||(ua.lineStart(),ua.point(Fl[0],Fl[1])),ua.point(vc[0],vc[1]),$l||ua.lineEnd(),tl=!1):$l&&(ua.lineStart(),ua.point(zo,Ms),tl=!1)}fs=zo,no=Ms,qa=$l}return Pl}}function Ja(){var mr=0,Ur=0,_n=960,cn=500,Wn,hi,ea;return ea={stream:function(ga){return Wn&&hi===ga?Wn:Wn=Ri(mr,Ur,_n,cn)(hi=ga)},extent:function(ga){return arguments.length?(mr=+ga[0][0],Ur=+ga[0][1],_n=+ga[1][0],cn=+ga[1][1],Wn=hi=null,ea):[[mr,Ur],[_n,cn]]}}}var Xa=P(),Io,po,Do,Ia={sphere:O,point:O,lineStart:gs,lineEnd:O,polygonStart:O,polygonEnd:O};function gs(){Ia.point=ll,Ia.lineEnd=is}function is(){Ia.point=Ia.lineEnd=O}function ll(mr,Ur){mr*=x,Ur*=x,Io=mr,po=E(Ur),Do=u(Ur),Ia.point=Ho}function Ho(mr,Ur){mr*=x,Ur*=x;var _n=E(Ur),cn=u(Ur),Wn=y(mr-Io),hi=u(Wn),ea=E(Wn),ga=cn*ea,Ra=Do*_n-po*cn*hi,$a=po*_n+Do*cn*hi;Xa.add(T(h(ga*ga+Ra*Ra),$a)),Io=mr,po=_n,Do=cn}function Gs(mr){return Xa.reset(),W(mr,Ia),+Xa}var as=[null,null],ul={type:"LineString",coordinates:as};function Js(mr,Ur){return as[0]=mr,as[1]=Ur,Gs(ul)}var Rl={Feature:function(mr,Ur){return Cs(mr.geometry,Ur)},FeatureCollection:function(mr,Ur){for(var _n=mr.features,cn=-1,Wn=_n.length;++cn<Wn;)if(Cs(_n[cn].geometry,Ur))return!0;return!1}},ls={Sphere:function(){return!0},Point:function(mr,Ur){return Co(mr.coordinates,Ur)},MultiPoint:function(mr,Ur){for(var _n=mr.coordinates,cn=-1,Wn=_n.length;++cn<Wn;)if(Co(_n[cn],Ur))return!0;return!1},LineString:function(mr,Ur){return ks(mr.coordinates,Ur)},MultiLineString:function(mr,Ur){for(var _n=mr.coordinates,cn=-1,Wn=_n.length;++cn<Wn;)if(ks(_n[cn],Ur))return!0;return!1},Polygon:function(mr,Ur){return kl(mr.coordinates,Ur)},MultiPolygon:function(mr,Ur){for(var _n=mr.coordinates,cn=-1,Wn=_n.length;++cn<Wn;)if(kl(_n[cn],Ur))return!0;return!1},GeometryCollection:function(mr,Ur){for(var _n=mr.geometries,cn=-1,Wn=_n.length;++cn<Wn;)if(Cs(_n[cn],Ur))return!0;return!1}};function Cs(mr,Ur){return mr&&ls.hasOwnProperty(mr.type)?ls[mr.type](mr,Ur):!1}function Co(mr,Ur){return Js(mr,Ur)===0}function ks(mr,Ur){for(var _n,cn,Wn,hi=0,ea=mr.length;hi<ea;hi++){if(cn=Js(mr[hi],Ur),cn===0||hi>0&&(Wn=Js(mr[hi],mr[hi-1]),Wn>0&&_n<=Wn&&cn<=Wn&&(_n+cn-Wn)*(1-Math.pow((_n-cn)/Wn,2))<a*Wn))return!0;_n=cn}return!1}function kl(mr,Ur){return!!dn(mr.map(Vl),Yl(Ur))}function Vl(mr){return mr=mr.map(Yl),mr.pop(),mr}function Yl(mr){return[mr[0]*x,mr[1]*x]}function Ns(mr,Ur){return(mr&&Rl.hasOwnProperty(mr.type)?Rl[mr.type]:Cs)(mr,Ur)}function La(mr,Ur,_n){var cn=g.range(mr,Ur-r,_n).concat(Ur);return function(Wn){return cn.map(function(hi){return[Wn,hi]})}}function uo(mr,Ur,_n){var cn=g.range(mr,Ur-r,_n).concat(Ur);return function(Wn){return cn.map(function(hi){return[hi,Wn]})}}function Hs(){var mr,Ur,_n,cn,Wn,hi,ea,ga,Ra=10,$a=Ra,ua=90,za=360,wa,Ji,eo,rs,Zo=2.5;function os(){return{type:"MultiLineString",coordinates:fs()}}function fs(){return g.range(b(cn/ua)*ua,_n,ua).map(eo).concat(g.range(b(ga/za)*za,ea,za).map(rs)).concat(g.range(b(Ur/Ra)*Ra,mr,Ra).filter(function(no){return y(no%ua)>r}).map(wa)).concat(g.range(b(hi/$a)*$a,Wn,$a).filter(function(no){return y(no%za)>r}).map(Ji))}return os.lines=function(){return fs().map(function(no){return{type:"LineString",coordinates:no}})},os.outline=function(){return{type:"Polygon",coordinates:[eo(cn).concat(rs(ea).slice(1),eo(_n).reverse().slice(1),rs(ga).reverse().slice(1))]}},os.extent=function(no){return arguments.length?os.extentMajor(no).extentMinor(no):os.extentMinor()},os.extentMajor=function(no){return arguments.length?(cn=+no[0][0],_n=+no[1][0],ga=+no[0][1],ea=+no[1][1],cn>_n&&(no=cn,cn=_n,_n=no),ga>ea&&(no=ga,ga=ea,ea=no),os.precision(Zo)):[[cn,ga],[_n,ea]]},os.extentMinor=function(no){return arguments.length?(Ur=+no[0][0],mr=+no[1][0],hi=+no[0][1],Wn=+no[1][1],Ur>mr&&(no=Ur,Ur=mr,mr=no),hi>Wn&&(no=hi,hi=Wn,Wn=no),os.precision(Zo)):[[Ur,hi],[mr,Wn]]},os.step=function(no){return arguments.length?os.stepMajor(no).stepMinor(no):os.stepMinor()},os.stepMajor=function(no){return arguments.length?(ua=+no[0],za=+no[1],os):[ua,za]},os.stepMinor=function(no){return arguments.length?(Ra=+no[0],$a=+no[1],os):[Ra,$a]},os.precision=function(no){return arguments.length?(Zo=+no,wa=La(hi,Wn,90),Ji=uo(Ur,mr,Zo),eo=La(ga,ea,90),rs=uo(cn,_n,Zo),os):Zo},os.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Kl(){return Hs()()}function Go(mr,Ur){var _n=mr[0]*x,cn=mr[1]*x,Wn=Ur[0]*x,hi=Ur[1]*x,ea=u(cn),ga=E(cn),Ra=u(hi),$a=E(hi),ua=ea*u(_n),za=ea*E(_n),wa=Ra*u(Wn),Ji=Ra*E(Wn),eo=2*w(h(R(hi-cn)+ea*Ra*R(Wn-_n))),rs=E(eo),Zo=eo?function(os){var fs=E(os*=eo)/rs,no=E(eo-os)/rs,qa=no*ua+fs*wa,ds=no*za+fs*Ji,tl=no*ga+fs*$a;return[T(ds,qa)*f,T(tl,h(qa*qa+ds*ds))*f]}:function(){return[_n*f,cn*f]};return Zo.distance=eo,Zo}function ql(mr){return mr}var il=P(),Cl=P(),Fu,ao,Ts,Ls,nu={point:O,lineStart:O,lineEnd:O,polygonStart:function(){nu.lineStart=cl,nu.lineEnd=Gu},polygonEnd:function(){nu.lineStart=nu.lineEnd=nu.point=O,il.add(y(Cl)),Cl.reset()},result:function(){var mr=il/2;return il.reset(),mr}};function cl(){nu.point=Qo}function Qo(mr,Ur){nu.point=Mu,Fu=Ts=mr,ao=Ls=Ur}function Mu(mr,Ur){Cl.add(Ls*mr-Ts*Ur),Ts=mr,Ls=Ur}function Gu(){Mu(Fu,ao)}var _l=1/0,Ol=_l,Xl=-_l,tu=Xl,ac={point:ph,lineStart:O,lineEnd:O,polygonStart:O,polygonEnd:O,result:function(){var mr=[[_l,Ol],[Xl,tu]];return Xl=tu=-(Ol=_l=1/0),mr}};function ph(mr,Ur){mr<_l&&(_l=mr),mr>Xl&&(Xl=mr),Ur<Ol&&(Ol=Ur),Ur>tu&&(tu=Ur)}var Jc=0,ah=0,Nf=0,Sf=0,Dl=0,Bc=0,jf=0,hc=0,oc=0,fc,oh,su,sc,el={point:Zl,lineStart:Mh,lineEnd:xu,polygonStart:function(){el.lineStart=Cd,el.lineEnd=Qs},polygonEnd:function(){el.point=Zl,el.lineStart=Mh,el.lineEnd=xu},result:function(){var mr=oc?[jf/oc,hc/oc]:Bc?[Sf/Bc,Dl/Bc]:Nf?[Jc/Nf,ah/Nf]:[NaN,NaN];return Jc=ah=Nf=Sf=Dl=Bc=jf=hc=oc=0,mr}};function Zl(mr,Ur){Jc+=mr,ah+=Ur,++Nf}function Mh(){el.point=Lc}function Lc(mr,Ur){el.point=jh,Zl(su=mr,sc=Ur)}function jh(mr,Ur){var _n=mr-su,cn=Ur-sc,Wn=h(_n*_n+cn*cn);Sf+=Wn*(su+mr)/2,Dl+=Wn*(sc+Ur)/2,Bc+=Wn,Zl(su=mr,sc=Ur)}function xu(){el.point=Zl}function Cd(){el.point=Wd}function Qs(){Ll(fc,oh)}function Wd(mr,Ur){el.point=Ll,Zl(fc=su=mr,oh=sc=Ur)}function Ll(mr,Ur){var _n=mr-su,cn=Ur-sc,Wn=h(_n*_n+cn*cn);Sf+=Wn*(su+mr)/2,Dl+=Wn*(sc+Ur)/2,Bc+=Wn,Wn=sc*mr-su*Ur,jf+=Wn*(su+mr),hc+=Wn*(sc+Ur),oc+=Wn*3,Zl(su=mr,sc=Ur)}function Jo(mr){this._context=mr}Jo.prototype={_radius:4.5,pointRadius:function(mr){return this._radius=mr,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(mr,Ur){switch(this._point){case 0:{this._context.moveTo(mr,Ur),this._point=1;break}case 1:{this._context.lineTo(mr,Ur);break}default:{this._context.moveTo(mr+this._radius,Ur),this._context.arc(mr,Ur,this._radius,0,s);break}}},result:O};var lf=P(),sh,ec,Uf,Uh,yf,lc={point:O,lineStart:function(){lc.point=hd},lineEnd:function(){sh&&$f(ec,Uf),lc.point=O},polygonStart:function(){sh=!0},polygonEnd:function(){sh=null},result:function(){var mr=+lf;return lf.reset(),mr}};function hd(mr,Ur){lc.point=$f,ec=Uh=mr,Uf=yf=Ur}function $f(mr,Ur){Uh-=mr,yf-=Ur,lf.add(h(Uh*Uh+yf*yf)),Uh=mr,yf=Ur}function xf(){this._string=[]}xf.prototype={_radius:4.5,_circle:Vh(4.5),pointRadius:function(mr){return(mr=+mr)!==this._radius&&(this._radius=mr,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(mr,Ur){switch(this._point){case 0:{this._string.push("M",mr,",",Ur),this._point=1;break}case 1:{this._string.push("L",mr,",",Ur);break}default:{this._circle==null&&(this._circle=Vh(this._radius)),this._string.push("M",mr,",",Ur,this._circle);break}}},result:function(){if(this._string.length){var mr=this._string.join("");return this._string=[],mr}else return null}};function Vh(mr){return"m0,"+mr+"a"+mr+","+mr+" 0 1,1 0,"+-2*mr+"a"+mr+","+mr+" 0 1,1 0,"+2*mr+"z"}function Vf(mr,Ur){var _n=4.5,cn,Wn;function hi(ea){return ea&&(typeof _n=="function"&&Wn.pointRadius(+_n.apply(this,arguments)),W(ea,cn(Wn))),Wn.result()}return hi.area=function(ea){return W(ea,cn(nu)),nu.result()},hi.measure=function(ea){return W(ea,cn(lc)),lc.result()},hi.bounds=function(ea){return W(ea,cn(ac)),ac.result()},hi.centroid=function(ea){return W(ea,cn(el)),el.result()},hi.projection=function(ea){return arguments.length?(cn=ea==null?(mr=null,ql):(mr=ea).stream,hi):mr},hi.context=function(ea){return arguments.length?(Wn=ea==null?(Ur=null,new xf):new Jo(Ur=ea),typeof _n!="function"&&Wn.pointRadius(_n),hi):Ur},hi.pointRadius=function(ea){return arguments.length?(_n=typeof ea=="function"?ea:(Wn.pointRadius(+ea),+ea),hi):_n},hi.projection(mr).context(Ur)}function Hf(mr){return{stream:lh(mr)}}function lh(mr){return function(Ur){var _n=new Gf;for(var cn in mr)_n[cn]=mr[cn];return _n.stream=Ur,_n}}function Gf(){}Gf.prototype={constructor:Gf,point:function(mr,Ur){this.stream.point(mr,Ur)},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 Sh(mr,Ur,_n){var cn=mr.clipExtent&&mr.clipExtent();return mr.scale(150).translate([0,0]),cn!=null&&mr.clipExtent(null),W(_n,mr.stream(ac)),Ur(ac.result()),cn!=null&&mr.clipExtent(cn),mr}function mh(mr,Ur,_n){return Sh(mr,function(cn){var Wn=Ur[1][0]-Ur[0][0],hi=Ur[1][1]-Ur[0][1],ea=Math.min(Wn/(cn[1][0]-cn[0][0]),hi/(cn[1][1]-cn[0][1])),ga=+Ur[0][0]+(Wn-ea*(cn[1][0]+cn[0][0]))/2,Ra=+Ur[0][1]+(hi-ea*(cn[1][1]+cn[0][1]))/2;mr.scale(150*ea).translate([ga,Ra])},_n)}function uc(mr,Ur,_n){return mh(mr,[[0,0],Ur],_n)}function ef(mr,Ur,_n){return Sh(mr,function(cn){var Wn=+Ur,hi=Wn/(cn[1][0]-cn[0][0]),ea=(Wn-hi*(cn[1][0]+cn[0][0]))/2,ga=-hi*cn[0][1];mr.scale(150*hi).translate([ea,ga])},_n)}function Wf(mr,Ur,_n){return Sh(mr,function(cn){var Wn=+Ur,hi=Wn/(cn[1][1]-cn[0][1]),ea=-hi*cn[0][0],ga=(Wn-hi*(cn[1][1]+cn[0][1]))/2;mr.scale(150*hi).translate([ea,ga])},_n)}var Jl=16,Ef=u(30*x);function Ld(mr,Ur){return+Ur?_f(mr,Ur):Yf(mr)}function Yf(mr){return lh({point:function(Ur,_n){Ur=mr(Ur,_n),this.stream.point(Ur[0],Ur[1])}})}function _f(mr,Ur){function _n(cn,Wn,hi,ea,ga,Ra,$a,ua,za,wa,Ji,eo,rs,Zo){var os=$a-cn,fs=ua-Wn,no=os*os+fs*fs;if(no>4*Ur&&rs--){var qa=ea+wa,ds=ga+Ji,tl=Ra+eo,Pl=h(qa*qa+ds*ds+tl*tl),iu=w(tl/=Pl),Hl=y(y(tl)-1)<r||y(hi-za)<r?(hi+za)/2:T(ds,qa),au=mr(Hl,iu),ml=au[0],qu=au[1],Lu=ml-cn,uu=qu-Wn,zo=fs*Lu-os*uu;(zo*zo/no>Ur||y((os*Lu+fs*uu)/no-.5)>.3||ea*wa+ga*Ji+Ra*eo<Ef)&&(_n(cn,Wn,hi,ea,ga,Ra,ml,qu,Hl,qa/=Pl,ds/=Pl,tl,rs,Zo),Zo.point(ml,qu),_n(ml,qu,Hl,qa,ds,tl,$a,ua,za,wa,Ji,eo,rs,Zo))}}return function(cn){var Wn,hi,ea,ga,Ra,$a,ua,za,wa,Ji,eo,rs,Zo={point:os,lineStart:fs,lineEnd:qa,polygonStart:function(){cn.polygonStart(),Zo.lineStart=ds},polygonEnd:function(){cn.polygonEnd(),Zo.lineStart=fs}};function os(iu,Hl){iu=mr(iu,Hl),cn.point(iu[0],iu[1])}function fs(){za=NaN,Zo.point=no,cn.lineStart()}function no(iu,Hl){var au=ut([iu,Hl]),ml=mr(iu,Hl);_n(za,wa,ua,Ji,eo,rs,za=ml[0],wa=ml[1],ua=iu,Ji=au[0],eo=au[1],rs=au[2],Jl,cn),cn.point(za,wa)}function qa(){Zo.point=os,cn.lineEnd()}function ds(){fs(),Zo.point=tl,Zo.lineEnd=Pl}function tl(iu,Hl){no(Wn=iu,Hl),hi=za,ea=wa,ga=Ji,Ra=eo,$a=rs,Zo.point=no}function Pl(){_n(za,wa,ua,Ji,eo,rs,hi,ea,Wn,ga,Ra,$a,Jl,cn),Zo.lineEnd=qa,qa()}return Zo}}var Kf=lh({point:function(mr,Ur){this.stream.point(mr*x,Ur*x)}});function Nc(mr){return lh({point:function(Ur,_n){var cn=mr(Ur,_n);return this.stream.point(cn[0],cn[1])}})}function Xf(mr,Ur,_n,cn,Wn){function hi(ea,ga){return ea*=cn,ga*=Wn,[Ur+mr*ea,_n-mr*ga]}return hi.invert=function(ea,ga){return[(ea-Ur)/mr*cn,(_n-ga)/mr*Wn]},hi}function zu(mr,Ur,_n,cn,Wn,hi){var ea=u(hi),ga=E(hi),Ra=ea*mr,$a=ga*mr,ua=ea/mr,za=ga/mr,wa=(ga*_n-ea*Ur)/mr,Ji=(ga*Ur+ea*_n)/mr;function eo(rs,Zo){return rs*=cn,Zo*=Wn,[Ra*rs-$a*Zo+Ur,_n-$a*rs-Ra*Zo]}return eo.invert=function(rs,Zo){return[cn*(ua*rs-za*Zo+wa),Wn*(Ji-za*rs-ua*Zo)]},eo}function jc(mr){return Hh(function(){return mr})()}function Hh(mr){var Ur,_n=150,cn=480,Wn=250,hi=0,ea=0,ga=0,Ra=0,$a=0,ua,za=0,wa=1,Ji=1,eo=null,rs=Vr,Zo=null,os,fs,no,qa=ql,ds=.5,tl,Pl,iu,Hl,au;function ml(zo){return iu(zo[0]*x,zo[1]*x)}function qu(zo){return zo=iu.invert(zo[0],zo[1]),zo&&[zo[0]*f,zo[1]*f]}ml.stream=function(zo){return Hl&&au===zo?Hl:Hl=Kf(Nc(ua)(rs(tl(qa(au=zo)))))},ml.preclip=function(zo){return arguments.length?(rs=zo,eo=void 0,uu()):rs},ml.postclip=function(zo){return arguments.length?(qa=zo,Zo=os=fs=no=null,uu()):qa},ml.clipAngle=function(zo){return arguments.length?(rs=+zo?Pn(eo=zo*x):(eo=null,Vr),uu()):eo*f},ml.clipExtent=function(zo){return arguments.length?(qa=zo==null?(Zo=os=fs=no=null,ql):Ri(Zo=+zo[0][0],os=+zo[0][1],fs=+zo[1][0],no=+zo[1][1]),uu()):Zo==null?null:[[Zo,os],[fs,no]]},ml.scale=function(zo){return arguments.length?(_n=+zo,Lu()):_n},ml.translate=function(zo){return arguments.length?(cn=+zo[0],Wn=+zo[1],Lu()):[cn,Wn]},ml.center=function(zo){return arguments.length?(hi=zo[0]%360*x,ea=zo[1]%360*x,Lu()):[hi*f,ea*f]},ml.rotate=function(zo){return arguments.length?(ga=zo[0]%360*x,Ra=zo[1]%360*x,$a=zo.length>2?zo[2]%360*x:0,Lu()):[ga*f,Ra*f,$a*f]},ml.angle=function(zo){return arguments.length?(za=zo%360*x,Lu()):za*f},ml.reflectX=function(zo){return arguments.length?(wa=zo?-1:1,Lu()):wa<0},ml.reflectY=function(zo){return arguments.length?(Ji=zo?-1:1,Lu()):Ji<0},ml.precision=function(zo){return arguments.length?(tl=Ld(Pl,ds=zo*zo),uu()):h(ds)},ml.fitExtent=function(zo,Ms){return mh(ml,zo,Ms)},ml.fitSize=function(zo,Ms){return uc(ml,zo,Ms)},ml.fitWidth=function(zo,Ms){return ef(ml,zo,Ms)},ml.fitHeight=function(zo,Ms){return Wf(ml,zo,Ms)};function Lu(){var zo=zu(_n,0,0,wa,Ji,za).apply(null,Ur(hi,ea)),Ms=(za?zu:Xf)(_n,cn-zo[0],Wn-zo[1],wa,Ji,za);return ua=ci(ga,Ra,$a),Pl=wn(Ur,Ms),iu=wn(ua,Pl),tl=Ld(Pl,ds),uu()}function uu(){return Hl=au=null,ml}return function(){return Ur=mr.apply(this,arguments),ml.invert=Ur.invert&&qu,Lu()}}function lu(mr){var Ur=0,_n=n/3,cn=Hh(mr),Wn=cn(Ur,_n);return Wn.parallels=function(hi){return arguments.length?cn(Ur=hi[0]*x,_n=hi[1]*x):[Ur*f,_n*f]},Wn}function Eh(mr){var Ur=u(mr);function _n(cn,Wn){return[cn*Ur,E(Wn)/Ur]}return _n.invert=function(cn,Wn){return[cn/Ur,w(Wn*Ur)]},_n}function Sc(mr,Ur){var _n=E(mr),cn=(_n+E(Ur))/2;if(y(cn)<r)return Eh(mr);var Wn=1+_n*(2*cn-_n),hi=h(Wn)/cn;function ea(ga,Ra){var $a=h(Wn-2*cn*E(Ra))/cn;return[$a*E(ga*=cn),hi-$a*u(ga)]}return ea.invert=function(ga,Ra){var $a=hi-Ra,ua=T(ga,y($a))*A($a);return $a*cn<0&&(ua-=n*A(ga)*A($a)),[ua/cn,w((Wn-(ga*ga+$a*$a)*cn*cn)/(2*cn))]},ea}function Uc(){return lu(Sc).scale(155.424).center([0,33.6442])}function _u(){return Uc().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function uf(mr){var Ur=mr.length;return{point:function(_n,cn){for(var Wn=-1;++Wn<Ur;)mr[Wn].point(_n,cn)},sphere:function(){for(var _n=-1;++_n<Ur;)mr[_n].sphere()},lineStart:function(){for(var _n=-1;++_n<Ur;)mr[_n].lineStart()},lineEnd:function(){for(var _n=-1;++_n<Ur;)mr[_n].lineEnd()},polygonStart:function(){for(var _n=-1;++_n<Ur;)mr[_n].polygonStart()},polygonEnd:function(){for(var _n=-1;++_n<Ur;)mr[_n].polygonEnd()}}}function gh(){var mr,Ur,_n=_u(),cn,Wn=Uc().rotate([154,0]).center([-2,58.5]).parallels([55,65]),hi,ea=Uc().rotate([157,0]).center([-3,19.9]).parallels([8,18]),ga,Ra,$a={point:function(wa,Ji){Ra=[wa,Ji]}};function ua(wa){var Ji=wa[0],eo=wa[1];return Ra=null,cn.point(Ji,eo),Ra||(hi.point(Ji,eo),Ra)||(ga.point(Ji,eo),Ra)}ua.invert=function(wa){var Ji=_n.scale(),eo=_n.translate(),rs=(wa[0]-eo[0])/Ji,Zo=(wa[1]-eo[1])/Ji;return(Zo>=.12&&Zo<.234&&rs>=-.425&&rs<-.214?Wn:Zo>=.166&&Zo<.234&&rs>=-.214&&rs<-.115?ea:_n).invert(wa)},ua.stream=function(wa){return mr&&Ur===wa?mr:mr=uf([_n.stream(Ur=wa),Wn.stream(wa),ea.stream(wa)])},ua.precision=function(wa){return arguments.length?(_n.precision(wa),Wn.precision(wa),ea.precision(wa),za()):_n.precision()},ua.scale=function(wa){return arguments.length?(_n.scale(wa),Wn.scale(wa*.35),ea.scale(wa),ua.translate(_n.translate())):_n.scale()},ua.translate=function(wa){if(!arguments.length)return _n.translate();var Ji=_n.scale(),eo=+wa[0],rs=+wa[1];return cn=_n.translate(wa).clipExtent([[eo-.455*Ji,rs-.238*Ji],[eo+.455*Ji,rs+.238*Ji]]).stream($a),hi=Wn.translate([eo-.307*Ji,rs+.201*Ji]).clipExtent([[eo-.425*Ji+r,rs+.12*Ji+r],[eo-.214*Ji-r,rs+.234*Ji-r]]).stream($a),ga=ea.translate([eo-.205*Ji,rs+.212*Ji]).clipExtent([[eo-.214*Ji+r,rs+.166*Ji+r],[eo-.115*Ji-r,rs+.234*Ji-r]]).stream($a),za()},ua.fitExtent=function(wa,Ji){return mh(ua,wa,Ji)},ua.fitSize=function(wa,Ji){return uc(ua,wa,Ji)},ua.fitWidth=function(wa,Ji){return ef(ua,wa,Ji)},ua.fitHeight=function(wa,Ji){return Wf(ua,wa,Ji)};function za(){return mr=Ur=null,ua}return ua.scale(1070)}function Wh(mr){return function(Ur,_n){var cn=u(Ur),Wn=u(_n),hi=mr(cn*Wn);return[hi*Wn*E(Ur),hi*E(_n)]}}function Cf(mr){return function(Ur,_n){var cn=h(Ur*Ur+_n*_n),Wn=mr(cn),hi=E(Wn),ea=u(Wn);return[T(Ur*hi,cn*ea),w(cn&&_n*hi/cn)]}}var Pd=Wh(function(mr){return h(2/(1+mr))});Pd.invert=Cf(function(mr){return 2*w(mr/2)});function Qd(){return jc(Pd).scale(124.75).clipAngle(180-.001)}var cf=Wh(function(mr){return(mr=k(mr))&&mr/E(mr)});cf.invert=Cf(function(mr){return mr});function Lf(){return jc(cf).scale(79.4188).clipAngle(180-.001)}function wc(mr,Ur){return[mr,C(p((o+Ur)/2))]}wc.invert=function(mr,Ur){return[mr,2*v(_(Ur))-o]};function hf(){return Qc(wc).scale(961/s)}function Qc(mr){var Ur=jc(mr),_n=Ur.center,cn=Ur.scale,Wn=Ur.translate,hi=Ur.clipExtent,ea=null,ga,Ra,$a;Ur.scale=function(za){return arguments.length?(cn(za),ua()):cn()},Ur.translate=function(za){return arguments.length?(Wn(za),ua()):Wn()},Ur.center=function(za){return arguments.length?(_n(za),ua()):_n()},Ur.clipExtent=function(za){return arguments.length?(za==null?ea=ga=Ra=$a=null:(ea=+za[0][0],ga=+za[0][1],Ra=+za[1][0],$a=+za[1][1]),ua()):ea==null?null:[[ea,ga],[Ra,$a]]};function ua(){var za=n*cn(),wa=Ur(Zi(Ur.rotate()).invert([0,0]));return hi(ea==null?[[wa[0]-za,wa[1]-za],[wa[0]+za,wa[1]+za]]:mr===wc?[[Math.max(wa[0]-za,ea),ga],[Math.min(wa[0]+za,Ra),$a]]:[[ea,Math.max(wa[1]-za,ga)],[Ra,Math.min(wa[1]+za,$a)]])}return ua()}function ff(mr){return p((o+mr)/2)}function Pf(mr,Ur){var _n=u(mr),cn=mr===Ur?E(mr):C(_n/u(Ur))/C(ff(Ur)/ff(mr)),Wn=_n*M(ff(mr),cn)/cn;if(!cn)return wc;function hi(ea,ga){Wn>0?ga<-o+r&&(ga=-o+r):ga>o-r&&(ga=o-r);var Ra=Wn/M(ff(ga),cn);return[Ra*E(cn*ea),Wn-Ra*u(cn*ea)]}return hi.invert=function(ea,ga){var Ra=Wn-ga,$a=A(cn)*h(ea*ea+Ra*Ra),ua=T(ea,y(Ra))*A(Ra);return Ra*cn<0&&(ua-=n*A(ea)*A(Ra)),[ua/cn,2*v(M(Wn/$a,1/cn))-o]},hi}function vh(){return lu(Pf).scale(109.5).parallels([30,30])}function bu(mr,Ur){return[mr,Ur]}bu.invert=bu;function Ch(){return jc(bu).scale(152.63)}function Vc(mr,Ur){var _n=u(mr),cn=mr===Ur?E(mr):(_n-u(Ur))/(Ur-mr),Wn=_n/cn+mr;if(y(cn)<r)return bu;function hi(ea,ga){var Ra=Wn-ga,$a=cn*ea;return[Ra*E($a),Wn-Ra*u($a)]}return hi.invert=function(ea,ga){var Ra=Wn-ga,$a=T(ea,y(Ra))*A(Ra);return Ra*cn<0&&($a-=n*A(ea)*A(Ra)),[$a/cn,Wn-A(cn)*h(ea*ea+Ra*Ra)]},hi}function fd(){return lu(Vc).scale(131.154).center([0,13.9389])}var vu=1.340264,bf=-.081106,qh=893e-6,th=.003796,rf=h(3)/2,Zh=12;function wf(mr,Ur){var _n=w(rf*E(Ur)),cn=_n*_n,Wn=cn*cn*cn;return[mr*u(_n)/(rf*(vu+3*bf*cn+Wn*(7*qh+9*th*cn))),_n*(vu+bf*cn+Wn*(qh+th*cn))]}wf.invert=function(mr,Ur){for(var _n=Ur,cn=_n*_n,Wn=cn*cn*cn,hi=0,ea,ga,Ra;hi<Zh&&(ga=_n*(vu+bf*cn+Wn*(qh+th*cn))-Ur,Ra=vu+3*bf*cn+Wn*(7*qh+9*th*cn),_n-=ea=ga/Ra,cn=_n*_n,Wn=cn*cn*cn,!(y(ea)<a));++hi);return[rf*mr*(vu+3*bf*cn+Wn*(7*qh+9*th*cn))/u(_n),w(E(_n)/rf)]};function zd(){return jc(wf).scale(177.158)}function gc(mr,Ur){var _n=u(Ur),cn=u(mr)*_n;return[_n*E(mr)/cn,E(Ur)/cn]}gc.invert=Cf(v);function Jf(){return jc(gc).scale(144.049).clipAngle(60)}function eh(){var mr=1,Ur=0,_n=0,cn=1,Wn=1,hi=0,ea,ga,Ra=null,$a,ua,za,wa=1,Ji=1,eo=lh({point:function(qa,ds){var tl=no([qa,ds]);this.stream.point(tl[0],tl[1])}}),rs=ql,Zo,os;function fs(){return wa=mr*cn,Ji=mr*Wn,Zo=os=null,no}function no(qa){var ds=qa[0]*wa,tl=qa[1]*Ji;if(hi){var Pl=tl*ea-ds*ga;ds=ds*ea+tl*ga,tl=Pl}return[ds+Ur,tl+_n]}return no.invert=function(qa){var ds=qa[0]-Ur,tl=qa[1]-_n;if(hi){var Pl=tl*ea+ds*ga;ds=ds*ea-tl*ga,tl=Pl}return[ds/wa,tl/Ji]},no.stream=function(qa){return Zo&&os===qa?Zo:Zo=eo(rs(os=qa))},no.postclip=function(qa){return arguments.length?(rs=qa,Ra=$a=ua=za=null,fs()):rs},no.clipExtent=function(qa){return arguments.length?(rs=qa==null?(Ra=$a=ua=za=null,ql):Ri(Ra=+qa[0][0],$a=+qa[0][1],ua=+qa[1][0],za=+qa[1][1]),fs()):Ra==null?null:[[Ra,$a],[ua,za]]},no.scale=function(qa){return arguments.length?(mr=+qa,fs()):mr},no.translate=function(qa){return arguments.length?(Ur=+qa[0],_n=+qa[1],fs()):[Ur,_n]},no.angle=function(qa){return arguments.length?(hi=qa%360*x,ga=E(hi),ea=u(hi),fs()):hi*f},no.reflectX=function(qa){return arguments.length?(cn=qa?-1:1,fs()):cn<0},no.reflectY=function(qa){return arguments.length?(Wn=qa?-1:1,fs()):Wn<0},no.fitExtent=function(qa,ds){return mh(no,qa,ds)},no.fitSize=function(qa,ds){return uc(no,qa,ds)},no.fitWidth=function(qa,ds){return ef(no,qa,ds)},no.fitHeight=function(qa,ds){return Wf(no,qa,ds)},no}function Lh(mr,Ur){var _n=Ur*Ur,cn=_n*_n;return[mr*(.8707-.131979*_n+cn*(-.013791+cn*(.003971*_n-.001529*cn))),Ur*(1.007226+_n*(.015085+cn*(-.044475+.028874*_n-.005916*cn)))]}Lh.invert=function(mr,Ur){var _n=Ur,cn=25,Wn;do{var hi=_n*_n,ea=hi*hi;_n-=Wn=(_n*(1.007226+hi*(.015085+ea*(-.044475+.028874*hi-.005916*ea)))-Ur)/(1.007226+hi*(.015085*3+ea*(-.044475*7+.028874*9*hi-.005916*11*ea)))}while(y(Wn)>r&&--cn>0);return[mr/(.8707+(hi=_n*_n)*(-.131979+hi*(-.013791+hi*hi*hi*(.003971-.001529*hi)))),_n]};function yh(){return jc(Lh).scale(175.295)}function Ru(mr,Ur){return[u(Ur)*E(mr),E(Ur)]}Ru.invert=Cf(w);function eu(){return jc(Ru).scale(249.5).clipAngle(90+r)}function xh(mr,Ur){var _n=u(Ur),cn=1+u(mr)*_n;return[_n*E(mr)/cn,E(Ur)/cn]}xh.invert=Cf(function(mr){return 2*v(mr)});function df(){return jc(xh).scale(250).clipAngle(142)}function _h(mr,Ur){return[C(p((o+Ur)/2)),-mr]}_h.invert=function(mr,Ur){return[-Ur,2*v(_(mr))-o]};function qf(){var mr=Qc(_h),Ur=mr.center,_n=mr.rotate;return mr.center=function(cn){return arguments.length?Ur([-cn[1],cn[0]]):(cn=Ur(),[cn[1],-cn[0]])},mr.rotate=function(cn){return arguments.length?_n([cn[0],cn[1],cn.length>2?cn[2]+90:90]):(cn=_n(),[cn[0],cn[1],cn[2]-90])},_n([0,0,90]).scale(159.155)}c.geoAlbers=_u,c.geoAlbersUsa=gh,c.geoArea=Y,c.geoAzimuthalEqualArea=Qd,c.geoAzimuthalEqualAreaRaw=Pd,c.geoAzimuthalEquidistant=Lf,c.geoAzimuthalEquidistantRaw=cf,c.geoBounds=$t,c.geoCentroid=Qr,c.geoCircle=Wa,c.geoClipAntimeridian=Vr,c.geoClipCircle=Pn,c.geoClipExtent=Ja,c.geoClipRectangle=Ri,c.geoConicConformal=vh,c.geoConicConformalRaw=Pf,c.geoConicEqualArea=Uc,c.geoConicEqualAreaRaw=Sc,c.geoConicEquidistant=fd,c.geoConicEquidistantRaw=Vc,c.geoContains=Ns,c.geoDistance=Js,c.geoEqualEarth=zd,c.geoEqualEarthRaw=wf,c.geoEquirectangular=Ch,c.geoEquirectangularRaw=bu,c.geoGnomonic=Jf,c.geoGnomonicRaw=gc,c.geoGraticule=Hs,c.geoGraticule10=Kl,c.geoIdentity=eh,c.geoInterpolate=Go,c.geoLength=Gs,c.geoMercator=hf,c.geoMercatorRaw=wc,c.geoNaturalEarth1=yh,c.geoNaturalEarth1Raw=Lh,c.geoOrthographic=eu,c.geoOrthographicRaw=Ru,c.geoPath=Vf,c.geoProjection=jc,c.geoProjectionMutator=Hh,c.geoRotation=Zi,c.geoStereographic=df,c.geoStereographicRaw=xh,c.geoStream=W,c.geoTransform=Hf,c.geoTransverseMercator=qf,c.geoTransverseMercatorRaw=_h,Object.defineProperty(c,"__esModule",{value:!0})})}),SU=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q,yS(),y3()):g(c.d3=c.d3||{},c.d3,c.d3)})(Q,function(c,g,P){var S=Math.abs,t=Math.atan,e=Math.atan2,r=Math.cos,a=Math.exp,n=Math.floor,o=Math.log,i=Math.max,s=Math.min,f=Math.pow,x=Math.round,y=Math.sign||function(Xt){return Xt>0?1:Xt<0?-1:0},v=Math.sin,T=Math.tan,u=1e-6,b=1e-12,_=Math.PI,C=_/2,M=_/4,E=Math.SQRT1_2,A=V(2),h=V(_),p=_*2,k=180/_,w=_/180;function R(Xt){return Xt?Xt/Math.sin(Xt):1}function O(Xt){return Xt>1?C:Xt<-1?-C:Math.asin(Xt)}function N(Xt){return Xt>1?0:Xt<-1?_:Math.acos(Xt)}function V(Xt){return Xt>0?Math.sqrt(Xt):0}function H(Xt){return Xt=a(2*Xt),(Xt-1)/(Xt+1)}function F(Xt){return(a(Xt)-a(-Xt))/2}function U(Xt){return(a(Xt)+a(-Xt))/2}function W(Xt){return o(Xt+V(Xt*Xt+1))}function q(Xt){return o(Xt+V(Xt*Xt-1))}function X(Xt){var ae=T(Xt/2),xe=2*o(r(Xt/2))/(ae*ae);function Ae(je,Ie){var Ze=r(je),wr=r(Ie),Ir=v(Ie),Nr=wr*Ze,tn=-((1-Nr?o((1+Nr)/2)/(1-Nr):-.5)+xe/(1+Nr));return[tn*wr*v(je),tn*Ir]}return Ae.invert=function(je,Ie){var Ze=V(je*je+Ie*Ie),wr=-Xt/2,Ir=50,Nr;if(!Ze)return[0,0];do{var tn=wr/2,mn=r(tn),zn=v(tn),Bn=zn/mn,ri=-o(S(mn));wr-=Nr=(2/Bn*ri-xe*Bn-Ze)/(-ri/(zn*zn)+1-xe/(2*mn*mn))*(mn<0?.7:1)}while(S(Nr)>u&&--Ir>0);var Fi=v(wr);return[e(je*Fi,Ze*r(wr)),O(Ie*Fi/Ze)]},Ae}function lt(){var Xt=C,ae=g.geoProjectionMutator(X),xe=ae(Xt);return xe.radius=function(Ae){return arguments.length?ae(Xt=Ae*w):Xt*k},xe.scale(179.976).clipAngle(147)}function yt(Xt,ae){var xe=r(ae),Ae=R(N(xe*r(Xt/=2)));return[2*xe*v(Xt)*Ae,v(ae)*Ae]}yt.invert=function(Xt,ae){if(!(Xt*Xt+4*ae*ae>_*_+u)){var xe=Xt,Ae=ae,je=25;do{var Ie=v(xe),Ze=v(xe/2),wr=r(xe/2),Ir=v(Ae),Nr=r(Ae),tn=v(2*Ae),mn=Ir*Ir,zn=Nr*Nr,Bn=Ze*Ze,ri=1-zn*wr*wr,Fi=ri?N(Nr*wr)*V(da=1/ri):da=0,da,ha=2*Fi*Nr*Ze-Xt,ka=Fi*Ir-ae,io=da*(zn*Bn+Fi*Nr*wr*mn),Ro=da*(.5*Ie*tn-Fi*2*Ir*Ze),Mo=da*.25*(tn*Ze-Fi*Ir*zn*Ie),hs=da*(mn*wr+Fi*Bn*Nr),hl=Ro*Mo-hs*io;if(!hl)break;var vl=(ka*Ro-ha*hs)/hl,Os=(ha*Mo-ka*io)/hl;xe-=vl,Ae-=Os}while((S(vl)>u||S(Os)>u)&&--je>0);return[xe,Ae]}};function pt(){return g.geoProjection(yt).scale(152.63)}function st(Xt){var ae=v(Xt),xe=r(Xt),Ae=Xt>=0?1:-1,je=T(Ae*Xt),Ie=(1+ae-xe)/2;function Ze(wr,Ir){var Nr=r(Ir),tn=r(wr/=2);return[(1+Nr)*v(wr),(Ae*Ir>-e(tn,je)-.001?0:-Ae*10)+Ie+v(Ir)*xe-(1+Nr)*ae*tn]}return Ze.invert=function(wr,Ir){var Nr=0,tn=0,mn=50;do{var zn=r(Nr),Bn=v(Nr),ri=r(tn),Fi=v(tn),da=1+ri,ha=da*Bn-wr,ka=Ie+Fi*xe-da*ae*zn-Ir,io=da*zn/2,Ro=-Bn*Fi,Mo=ae*da*Bn/2,hs=xe*ri+ae*zn*Fi,hl=Ro*Mo-hs*io,vl=(ka*Ro-ha*hs)/hl/2,Os=(ha*Mo-ka*io)/hl;S(Os)>2&&(Os/=2),Nr-=vl,tn-=Os}while((S(vl)>u||S(Os)>u)&&--mn>0);return Ae*tn>-e(r(Nr),je)-.001?[Nr*2,tn]:null},Ze}function tt(){var Xt=20*w,ae=Xt>=0?1:-1,xe=T(ae*Xt),Ae=g.geoProjectionMutator(st),je=Ae(Xt),Ie=je.stream;return je.parallel=function(Ze){return arguments.length?(xe=T((ae=(Xt=Ze*w)>=0?1:-1)*Xt),Ae(Xt)):Xt*k},je.stream=function(Ze){var wr=je.rotate(),Ir=Ie(Ze),Nr=(je.rotate([0,0]),Ie(Ze)),tn=je.precision();return je.rotate(wr),Ir.sphere=function(){Nr.polygonStart(),Nr.lineStart();for(var mn=ae*-180;ae*mn<180;mn+=ae*90)Nr.point(mn,ae*90);if(Xt)for(;ae*(mn-=3*ae*tn)>=-180;)Nr.point(mn,ae*-e(r(mn*w/2),xe)*k);Nr.lineEnd(),Nr.polygonEnd()},Ir},je.scale(218.695).center([0,28.0974])}function dt(Xt,ae){var xe=T(ae/2),Ae=V(1-xe*xe),je=1+Ae*r(Xt/=2),Ie=v(Xt)*Ae/je,Ze=xe/je,wr=Ie*Ie,Ir=Ze*Ze;return[4/3*Ie*(3+wr-3*Ir),4/3*Ze*(3+3*wr-Ir)]}dt.invert=function(Xt,ae){if(Xt*=3/8,ae*=3/8,!Xt&&S(ae)>1)return null;var xe=Xt*Xt,Ae=ae*ae,je=1+xe+Ae,Ie=V((je-V(je*je-4*ae*ae))/2),Ze=O(Ie)/3,wr=Ie?q(S(ae/Ie))/3:W(S(Xt))/3,Ir=r(Ze),Nr=U(wr),tn=Nr*Nr-Ir*Ir;return[y(Xt)*2*e(F(wr)*Ir,.25-tn),y(ae)*2*e(Nr*v(Ze),.25+tn)]};function rt(){return g.geoProjection(dt).scale(66.1603)}var at=V(8),vt=o(1+A);function it(Xt,ae){var xe=S(ae);return xe<M?[Xt,o(T(M+ae/2))]:[Xt*r(xe)*(2*A-1/v(xe)),y(ae)*(2*A*(xe-M)-o(T(xe/2)))]}it.invert=function(Xt,ae){if((Ie=S(ae))<vt)return[Xt,2*t(a(ae))-C];var xe=M,Ae=25,je,Ie;do{var Ze=r(xe/2),wr=T(xe/2);xe-=je=(at*(xe-M)-o(wr)-Ie)/(at-Ze*Ze/(2*wr))}while(S(je)>b&&--Ae>0);return[Xt/(r(xe)*(at-1/v(xe))),y(ae)*xe]};function Y(){return g.geoProjection(it).scale(112.314)}function ft(Xt){var ae=2*_/Xt;function xe(Ae,je){var Ie=g.geoAzimuthalEquidistantRaw(Ae,je);if(S(Ae)>C){var Ze=e(Ie[1],Ie[0]),wr=V(Ie[0]*Ie[0]+Ie[1]*Ie[1]),Ir=ae*x((Ze-C)/ae)+C,Nr=e(v(Ze-=Ir),2-r(Ze));Ze=Ir+O(_/wr*v(Nr))-Nr,Ie[0]=wr*r(Ze),Ie[1]=wr*v(Ze)}return Ie}return xe.invert=function(Ae,je){var Ie=V(Ae*Ae+je*je);if(Ie>C){var Ze=e(je,Ae),wr=ae*x((Ze-C)/ae)+C,Ir=Ze>wr?-1:1,Nr=Ie*r(wr-Ze),tn=1/T(Ir*N((Nr-_)/V(_*(_-2*Nr)+Ie*Ie)));Ze=wr+2*t((tn+Ir*V(tn*tn-3))/3),Ae=Ie*r(Ze),je=Ie*v(Ze)}return g.geoAzimuthalEquidistantRaw.invert(Ae,je)},xe}function ut(){var Xt=5,ae=g.geoProjectionMutator(ft),xe=ae(Xt),Ae=xe.stream,je=.01,Ie=-r(je*w),Ze=v(je*w);return xe.lobes=function(wr){return arguments.length?ae(Xt=+wr):Xt},xe.stream=function(wr){var Ir=xe.rotate(),Nr=Ae(wr),tn=(xe.rotate([0,0]),Ae(wr));return xe.rotate(Ir),Nr.sphere=function(){tn.polygonStart(),tn.lineStart();for(var mn=0,zn=360/Xt,Bn=2*_/Xt,ri=90-180/Xt,Fi=C;mn<Xt;++mn,ri-=zn,Fi-=Bn)tn.point(e(Ze*r(Fi),Ie)*k,O(Ze*v(Fi))*k),ri<-90?(tn.point(-90,-180-ri-je),tn.point(-90,-180-ri+je)):(tn.point(90,ri+je),tn.point(90,ri-je));tn.lineEnd(),tn.polygonEnd()},Nr},xe.scale(87.8076).center([0,17.1875]).clipAngle(180-.001)}function wt(Xt,ae){if(arguments.length<2&&(ae=Xt),ae===1)return g.geoAzimuthalEqualAreaRaw;if(ae===1/0)return zt;function xe(Ae,je){var Ie=g.geoAzimuthalEqualAreaRaw(Ae/ae,je);return Ie[0]*=Xt,Ie}return xe.invert=function(Ae,je){var Ie=g.geoAzimuthalEqualAreaRaw.invert(Ae/Xt,je);return Ie[0]*=ae,Ie},xe}function zt(Xt,ae){return[Xt*r(ae)/r(ae/=2),2*v(ae)]}zt.invert=function(Xt,ae){var xe=2*O(ae/2);return[Xt*r(xe/2)/r(xe),xe]};function Pt(){var Xt=2,ae=g.geoProjectionMutator(wt),xe=ae(Xt);return xe.coefficient=function(Ae){return arguments.length?ae(Xt=+Ae):Xt},xe.scale(169.529)}function Wt(Xt,ae,xe){var Ae=100,je,Ie,Ze;xe=xe===void 0?0:+xe,ae=+ae;do Ie=Xt(xe),Ze=Xt(xe+u),Ie===Ze&&(Ze=Ie+u),xe-=je=-1*u*(Ie-ae)/(Ie-Ze);while(Ae-- >0&&S(je)>u);return Ae<0?NaN:xe}function Ht(Xt,ae,xe){return ae===void 0&&(ae=40),xe===void 0&&(xe=b),function(Ae,je,Ie,Ze){var wr,Ir,Nr;Ie=Ie===void 0?0:+Ie,Ze=Ze===void 0?0:+Ze;for(var tn=0;tn<ae;tn++){var mn=Xt(Ie,Ze),zn=mn[0]-Ae,Bn=mn[1]-je;if(S(zn)<xe&&S(Bn)<xe)break;var ri=zn*zn+Bn*Bn;if(ri>wr){Ie-=Ir/=2,Ze-=Nr/=2;continue}wr=ri;var Fi=(Ie>0?-1:1)*xe,da=(Ze>0?-1:1)*xe,ha=Xt(Ie+Fi,Ze),ka=Xt(Ie,Ze+da),io=(ha[0]-mn[0])/Fi,Ro=(ha[1]-mn[1])/Fi,Mo=(ka[0]-mn[0])/da,hs=(ka[1]-mn[1])/da,hl=hs*io-Ro*Mo,vl=(S(hl)<.5?.5:1)/hl;if(Ir=(Bn*Mo-zn*hs)*vl,Nr=(zn*Ro-Bn*io)*vl,Ie+=Ir,Ze+=Nr,S(Ir)<xe&&S(Nr)<xe)break}return[Ie,Ze]}}function Jt(){var Xt=wt(1.68,2),ae=1.4,xe=12;function Ae(je,Ie){if(je+Ie<-ae){var Ze=(je-Ie+1.6)*(je+Ie+ae)/8;je+=Ze,Ie-=.8*Ze*v(Ie+_/2)}var wr=Xt(je,Ie),Ir=(1-r(je*Ie))/xe;return wr[1]<0&&(wr[0]*=1+Ir),wr[1]>0&&(wr[1]*=1+Ir/1.5*wr[0]*wr[0]),wr}return Ae.invert=Ht(Ae),Ae}function ge(){return g.geoProjection(Jt()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function he(Xt,ae){var xe=Xt*v(ae),Ae=30,je;do ae-=je=(ae+v(ae)-xe)/(1+r(ae));while(S(je)>u&&--Ae>0);return ae/2}function de(Xt,ae,xe){function Ae(je,Ie){return[Xt*je*r(Ie=he(xe,Ie)),ae*v(Ie)]}return Ae.invert=function(je,Ie){return Ie=O(Ie/ae),[je/(Xt*r(Ie)),O((2*Ie+v(2*Ie))/xe)]},Ae}var se=de(A/C,A,_);function Tt(){return g.geoProjection(se).scale(169.529)}var Lt=2.00276,Mt=1.11072;function te(Xt,ae){var xe=he(_,ae);return[Lt*Xt/(1/r(ae)+Mt/r(xe)),(ae+A*v(xe))/Lt]}te.invert=function(Xt,ae){var xe=Lt*ae,Ae=ae<0?-M:M,je=25,Ie,Ze;do Ze=xe-A*v(Ae),Ae-=Ie=(v(2*Ae)+2*Ae-_*v(Ze))/(2*r(2*Ae)+2+_*r(Ze)*A*r(Ae));while(S(Ie)>u&&--je>0);return Ze=xe-A*v(Ae),[Xt*(1/r(Ze)+Mt/r(Ae))/Lt,Ze]};function ve(){return g.geoProjection(te).scale(160.857)}function oe(Xt){var ae=0,xe=g.geoProjectionMutator(Xt),Ae=xe(ae);return Ae.parallel=function(je){return arguments.length?xe(ae=je*w):ae*k},Ae}function Te(Xt,ae){return[Xt*r(ae),ae]}Te.invert=function(Xt,ae){return[Xt/r(ae),ae]};function He(){return g.geoProjection(Te).scale(152.63)}function Ge(Xt){if(!Xt)return Te;var ae=1/T(Xt);function xe(Ae,je){var Ie=ae+Xt-je,Ze=Ie&&Ae*r(je)/Ie;return[Ie*v(Ze),ae-Ie*r(Ze)]}return xe.invert=function(Ae,je){var Ie=V(Ae*Ae+(je=ae-je)*je),Ze=ae+Xt-Ie;return[Ie/r(Ze)*e(Ae,je),Ze]},xe}function cr(){return oe(Ge).scale(123.082).center([0,26.1441]).parallel(45)}function ur(Xt){function ae(xe,Ae){var je=C-Ae,Ie=je&&xe*Xt*v(je)/je;return[je*v(Ie)/Xt,C-je*r(Ie)]}return ae.invert=function(xe,Ae){var je=xe*Xt,Ie=C-Ae,Ze=V(je*je+Ie*Ie),wr=e(je,Ie);return[(Ze?Ze/v(Ze):1)*wr/Xt,C-Ze]},ae}function jr(){var Xt=.5,ae=g.geoProjectionMutator(ur),xe=ae(Xt);return xe.fraction=function(Ae){return arguments.length?ae(Xt=+Ae):Xt},xe.scale(158.837)}var Hr=de(1,4/_,_);function br(){return g.geoProjection(Hr).scale(152.63)}function Kr(Xt,ae,xe,Ae,je,Ie){var Ze=r(Ie),wr;if(S(Xt)>1||S(Ie)>1)wr=N(xe*je+ae*Ae*Ze);else{var Ir=v(Xt/2),Nr=v(Ie/2);wr=2*O(V(Ir*Ir+ae*Ae*Nr*Nr))}return S(wr)>u?[wr,e(Ae*v(Ie),ae*je-xe*Ae*Ze)]:[0,0]}function rn(Xt,ae,xe){return N((Xt*Xt+ae*ae-xe*xe)/(2*Xt*ae))}function Ce(Xt){return Xt-2*_*n((Xt+_)/(2*_))}function $t(Xt,ae,xe){for(var Ae=[[Xt[0],Xt[1],v(Xt[1]),r(Xt[1])],[ae[0],ae[1],v(ae[1]),r(ae[1])],[xe[0],xe[1],v(xe[1]),r(xe[1])]],je=Ae[2],Ie,Ze=0;Ze<3;++Ze,je=Ie)Ie=Ae[Ze],je.v=Kr(Ie[1]-je[1],je[3],je[2],Ie[3],Ie[2],Ie[0]-je[0]),je.point=[0,0];var wr=rn(Ae[0].v[0],Ae[2].v[0],Ae[1].v[0]),Ir=rn(Ae[0].v[0],Ae[1].v[0],Ae[2].v[0]),Nr=_-wr;Ae[2].point[1]=0,Ae[0].point[0]=-(Ae[1].point[0]=Ae[0].v[0]/2);var tn=[Ae[2].point[0]=Ae[0].point[0]+Ae[2].v[0]*r(wr),2*(Ae[0].point[1]=Ae[1].point[1]=Ae[2].v[0]*v(wr))];function mn(zn,Bn){var ri=v(Bn),Fi=r(Bn),da=new Array(3),ha;for(ha=0;ha<3;++ha){var ka=Ae[ha];if(da[ha]=Kr(Bn-ka[1],ka[3],ka[2],Fi,ri,zn-ka[0]),!da[ha][0])return ka.point;da[ha][1]=Ce(da[ha][1]-ka.v[1])}var io=tn.slice();for(ha=0;ha<3;++ha){var Ro=ha==2?0:ha+1,Mo=rn(Ae[ha].v[0],da[ha][0],da[Ro][0]);da[ha][1]<0&&(Mo=-Mo),ha?ha==1?(Mo=Ir-Mo,io[0]-=da[ha][0]*r(Mo),io[1]-=da[ha][0]*v(Mo)):(Mo=Nr-Mo,io[0]+=da[ha][0]*r(Mo),io[1]+=da[ha][0]*v(Mo)):(io[0]+=da[ha][0]*r(Mo),io[1]-=da[ha][0]*v(Mo))}return io[0]/=3,io[1]/=3,io}return mn}function ne(Xt){return Xt[0]*=w,Xt[1]*=w,Xt}function Ct(){return gt([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function gt(Xt,ae,xe){var Ae=g.geoCentroid({type:"MultiPoint",coordinates:[Xt,ae,xe]}),je=[-Ae[0],-Ae[1]],Ie=g.geoRotation(je),Ze=$t(ne(Ie(Xt)),ne(Ie(ae)),ne(Ie(xe)));Ze.invert=Ht(Ze);var wr=g.geoProjection(Ze).rotate(je),Ir=wr.center;return delete wr.rotate,wr.center=function(Nr){return arguments.length?Ir(Ie(Nr)):Ie.invert(Ir())},wr.clipAngle(90)}function St(Xt,ae){var xe=V(1-v(ae));return[2/h*Xt*xe,h*(1-xe)]}St.invert=function(Xt,ae){var xe=(xe=ae/h-1)*xe;return[xe>0?Xt*V(_/xe)/2:0,O(1-xe)]};function Nt(){return g.geoProjection(St).scale(95.6464).center([0,30])}function ee(Xt){var ae=T(Xt);function xe(Ae,je){return[Ae,(Ae?Ae/v(Ae):1)*(v(je)*r(Ae)-ae*r(je))]}return xe.invert=ae?function(Ae,je){Ae&&(je*=v(Ae)/Ae);var Ie=r(Ae);return[Ae,2*e(V(Ie*Ie+ae*ae-je*je)-Ie,ae-je)]}:function(Ae,je){return[Ae,O(Ae?je*T(Ae)/Ae:je)]},xe}function le(){return oe(ee).scale(249.828).clipAngle(90)}var we=V(3);function Ue(Xt,ae){return[we*Xt*(2*r(2*ae/3)-1)/h,we*h*v(ae/3)]}Ue.invert=function(Xt,ae){var xe=3*O(ae/(we*h));return[h*Xt/(we*(2*r(2*xe/3)-1)),xe]};function qe(){return g.geoProjection(Ue).scale(156.19)}function ar(Xt){var ae=r(Xt);function xe(Ae,je){return[Ae*ae,v(je)/ae]}return xe.invert=function(Ae,je){return[Ae/ae,O(je*ae)]},xe}function Ar(){return oe(ar).parallel(38.58).scale(195.044)}function Tr(Xt){var ae=r(Xt);function xe(Ae,je){return[Ae*ae,(1+ae)*T(je/2)]}return xe.invert=function(Ae,je){return[Ae/ae,t(je/(1+ae))*2]},xe}function pr(){return oe(Tr).scale(124.75)}function Jr(Xt,ae){var xe=V(8/(3*_));return[xe*Xt*(1-S(ae)/_),xe*ae]}Jr.invert=function(Xt,ae){var xe=V(8/(3*_)),Ae=ae/xe;return[Xt/(xe*(1-S(Ae)/_)),Ae]};function Vn(){return g.geoProjection(Jr).scale(165.664)}function Hn(Xt,ae){var xe=V(4-3*v(S(ae)));return[2/V(6*_)*Xt*xe,y(ae)*V(2*_/3)*(2-xe)]}Hn.invert=function(Xt,ae){var xe=2-S(ae)/V(2*_/3);return[Xt*V(6*_)/(2*xe),y(ae)*O((4-xe*xe)/3)]};function Kn(){return g.geoProjection(Hn).scale(165.664)}function Ci(Xt,ae){var xe=V(_*(4+_));return[2/xe*Xt*(1+V(1-4*ae*ae/(_*_))),4/xe*ae]}Ci.invert=function(Xt,ae){var xe=V(_*(4+_))/2;return[Xt*xe/(1+V(1-ae*ae*(4+_)/(4*_))),ae*xe/2]};function ii(){return g.geoProjection(Ci).scale(180.739)}function qn(Xt,ae){var xe=(2+C)*v(ae);ae/=2;for(var Ae=0,je=1/0;Ae<10&&S(je)>u;Ae++){var Ie=r(ae);ae-=je=(ae+v(ae)*(Ie+2)-xe)/(2*Ie*(1+Ie))}return[2/V(_*(4+_))*Xt*(1+r(ae)),2*V(_/(4+_))*v(ae)]}qn.invert=function(Xt,ae){var xe=ae*V((4+_)/_)/2,Ae=O(xe),je=r(Ae);return[Xt/(2/V(_*(4+_))*(1+je)),O((Ae+xe*(je+2))/(2+C))]};function oa(){return g.geoProjection(qn).scale(180.739)}function Hi(Xt,ae){return[Xt*(1+r(ae))/V(2+_),2*ae/V(2+_)]}Hi.invert=function(Xt,ae){var xe=V(2+_),Ae=ae*xe/2;return[xe*Xt/(1+r(Ae)),Ae]};function We(){return g.geoProjection(Hi).scale(173.044)}function rr(Xt,ae){for(var xe=(1+C)*v(ae),Ae=0,je=1/0;Ae<10&&S(je)>u;Ae++)ae-=je=(ae+v(ae)-xe)/(1+r(ae));return xe=V(2+_),[Xt*(1+r(ae))/xe,2*ae/xe]}rr.invert=function(Xt,ae){var xe=1+C,Ae=V(xe/2);return[Xt*2*Ae/(1+r(ae*=Ae)),O((ae+v(ae))/xe)]};function fr(){return g.geoProjection(rr).scale(173.044)}var xr=3+2*A;function Qr(Xt,ae){var xe=v(Xt/=2),Ae=r(Xt),je=V(r(ae)),Ie=r(ae/=2),Ze=v(ae)/(Ie+A*Ae*je),wr=V(2/(1+Ze*Ze)),Ir=V((A*Ie+(Ae+xe)*je)/(A*Ie+(Ae-xe)*je));return[xr*(wr*(Ir-1/Ir)-2*o(Ir)),xr*(wr*Ze*(Ir+1/Ir)-2*t(Ze))]}Qr.invert=function(Xt,ae){if(!(Ie=dt.invert(Xt/1.2,ae*1.065)))return null;var xe=Ie[0],Ae=Ie[1],je=20,Ie;Xt/=xr,ae/=xr;do{var Ze=xe/2,wr=Ae/2,Ir=v(Ze),Nr=r(Ze),tn=v(wr),mn=r(wr),zn=r(Ae),Bn=V(zn),ri=tn/(mn+A*Nr*Bn),Fi=ri*ri,da=V(2/(1+Fi)),ha=A*mn+(Nr+Ir)*Bn,ka=A*mn+(Nr-Ir)*Bn,io=ha/ka,Ro=V(io),Mo=Ro-1/Ro,hs=Ro+1/Ro,hl=da*Mo-2*o(Ro)-Xt,vl=da*ri*hs-2*t(ri)-ae,Os=tn&&E*Bn*Ir*Fi/tn,bl=(A*Nr*mn+Bn)/(2*(mn+A*Nr*Bn)*(mn+A*Nr*Bn)*Bn),Su=-.5*ri*da*da*da,mu=Su*Os,Ws=Su*bl,qs=(qs=2*mn+A*Bn*(Nr-Ir))*qs*Ro,Yu=(A*Nr*mn*Bn+zn)/qs,dc=-(A*Ir*tn)/(Bn*qs),Zc=Mo*mu-2*Yu/Ro+da*(Yu+Yu/io),At=Mo*Ws-2*dc/Ro+da*(dc+dc/io),jt=ri*hs*mu-2*Os/(1+Fi)+da*hs*Os+da*ri*(Yu-Yu/io),ue=ri*hs*Ws-2*bl/(1+Fi)+da*hs*bl+da*ri*(dc-dc/io),Me=At*jt-ue*Zc;if(!Me)break;var Le=(vl*At-hl*ue)/Me,Be=(hl*jt-vl*Zc)/Me;xe-=Le,Ae=i(-C,s(C,Ae-Be))}while((S(Le)>u||S(Be)>u)&&--je>0);return S(S(Ae)-C)<u?[0,Ae]:je&&[xe,Ae]};function Cn(){return g.geoProjection(Qr).scale(62.5271)}var wn=r(35*w);function Mn(Xt,ae){var xe=T(ae/2);return[Xt*wn*V(1-xe*xe),(1+wn)*xe]}Mn.invert=function(Xt,ae){var xe=ae/(1+wn);return[Xt&&Xt/(wn*V(1-xe*xe)),2*t(xe)]};function ci(){return g.geoProjection(Mn).scale(137.152)}function xi(Xt,ae){var xe=ae/2,Ae=r(xe);return[2*Xt/h*r(ae)*Ae*Ae,h*T(xe)]}xi.invert=function(Xt,ae){var xe=t(ae/h),Ae=r(xe),je=2*xe;return[Xt*h/2/(r(je)*Ae*Ae),je]};function Pi(){return g.geoProjection(xi).scale(135.264)}function Di(Xt){var ae=1-Xt,xe=Ie(_,0)[0]-Ie(-_,0)[0],Ae=Ie(0,C)[1]-Ie(0,-C)[1],je=V(2*Ae/xe);function Ie(Ir,Nr){var tn=r(Nr),mn=v(Nr);return[tn/(ae+Xt*tn)*Ir,ae*Nr+Xt*mn]}function Ze(Ir,Nr){var tn=Ie(Ir,Nr);return[tn[0]*je,tn[1]/je]}function wr(Ir){return Ze(0,Ir)[1]}return Ze.invert=function(Ir,Nr){var tn=Wt(wr,Nr),mn=Ir/je*(Xt+ae/r(tn));return[mn,tn]},Ze}function Zi(){var Xt=.5,ae=g.geoProjectionMutator(Di),xe=ae(Xt);return xe.alpha=function(Ae){return arguments.length?ae(Xt=+Ae):Xt},xe.scale(168.725)}function ui(Xt){return[Xt[0]/2,O(T(Xt[1]/2*w))*k]}function Pa(Xt){return[Xt[0]*2,2*t(v(Xt[1]*w))*k]}function Wa(Xt){Xt==null&&(Xt=g.geoOrthographic);var ae=Xt(),xe=g.geoEquirectangular().scale(k).precision(0).clipAngle(null).translate([0,0]);function Ae(Ie){return ae(ui(Ie))}ae.invert&&(Ae.invert=function(Ie){return Pa(ae.invert(Ie))}),Ae.stream=function(Ie){var Ze=ae.stream(Ie),wr=xe.stream({point:function(Ir,Nr){Ze.point(Ir/2,O(T(-Nr/2*w))*k)},lineStart:function(){Ze.lineStart()},lineEnd:function(){Ze.lineEnd()},polygonStart:function(){Ze.polygonStart()},polygonEnd:function(){Ze.polygonEnd()}});return wr.sphere=Ze.sphere,wr};function je(Ie){Ae[Ie]=function(){return arguments.length?(ae[Ie].apply(ae,arguments),Ae):ae[Ie]()}}return Ae.rotate=function(Ie){return arguments.length?(xe.rotate(Ie),Ae):xe.rotate()},Ae.center=function(Ie){return arguments.length?(ae.center(ui(Ie)),Ae):Pa(ae.center())},je("angle"),je("clipAngle"),je("clipExtent"),je("fitExtent"),je("fitHeight"),je("fitSize"),je("fitWidth"),je("scale"),je("translate"),je("precision"),Ae.scale(249.5)}function ze(Xt,ae){var xe=2*_/ae,Ae=Xt*Xt;function je(Ie,Ze){var wr=g.geoAzimuthalEquidistantRaw(Ie,Ze),Ir=wr[0],Nr=wr[1],tn=Ir*Ir+Nr*Nr;if(tn>Ae){var mn=V(tn),zn=e(Nr,Ir),Bn=xe*x(zn/xe),ri=zn-Bn,Fi=Xt*r(ri),da=(Xt*v(ri)-ri*v(Fi))/(C-Fi),ha=Pe(ri,da),ka=(_-Xt)/Rr(ha,Fi,_);Ir=mn;var io=50,Ro;do Ir-=Ro=(Xt+Rr(ha,Fi,Ir)*ka-mn)/(ha(Ir)*ka);while(S(Ro)>u&&--io>0);Nr=ri*v(Ir),Ir<C&&(Nr-=da*(Ir-C));var Mo=v(Bn),hs=r(Bn);wr[0]=Ir*hs-Nr*Mo,wr[1]=Ir*Mo+Nr*hs}return wr}return je.invert=function(Ie,Ze){var wr=Ie*Ie+Ze*Ze;if(wr>Ae){var Ir=V(wr),Nr=e(Ze,Ie),tn=xe*x(Nr/xe),mn=Nr-tn;Ie=Ir*r(mn),Ze=Ir*v(mn);for(var zn=Ie-C,Bn=v(Ie),ri=Ze/Bn,Fi=Ie<C?1/0:0,da=10;;){var ha=Xt*v(ri),ka=Xt*r(ri),io=v(ka),Ro=C-ka,Mo=(ha-ri*io)/Ro,hs=Pe(ri,Mo);if(S(Fi)<b||!--da)break;ri-=Fi=(ri*Bn-Mo*zn-Ze)/(Bn-zn*2*(Ro*(ka+ri*ha*r(ka)-io)-ha*(ha-ri*io))/(Ro*Ro))}Ir=Xt+Rr(hs,ka,Ie)*(_-Xt)/Rr(hs,ka,_),Nr=tn+ri,Ie=Ir*r(Nr),Ze=Ir*v(Nr)}return g.geoAzimuthalEquidistantRaw.invert(Ie,Ze)},je}function Pe(Xt,ae){return function(xe){var Ae=Xt*r(xe);return xe<C&&(Ae-=ae),V(1+Ae*Ae)}}function Rr(Xt,ae,xe){for(var Ae=50,je=(xe-ae)/Ae,Ie=Xt(ae)+Xt(xe),Ze=1,wr=ae;Ze<Ae;++Ze)Ie+=2*Xt(wr+=je);return Ie*.5*je}function qr(){var Xt=6,ae=30*w,xe=r(ae),Ae=v(ae),je=g.geoProjectionMutator(ze),Ie=je(ae,Xt),Ze=Ie.stream,wr=.01,Ir=-r(wr*w),Nr=v(wr*w);return Ie.radius=function(tn){return arguments.length?(xe=r(ae=tn*w),Ae=v(ae),je(ae,Xt)):ae*k},Ie.lobes=function(tn){return arguments.length?je(ae,Xt=+tn):Xt},Ie.stream=function(tn){var mn=Ie.rotate(),zn=Ze(tn),Bn=(Ie.rotate([0,0]),Ze(tn));return Ie.rotate(mn),zn.sphere=function(){Bn.polygonStart(),Bn.lineStart();for(var ri=0,Fi=2*_/Xt,da=0;ri<Xt;++ri,da-=Fi)Bn.point(e(Nr*r(da),Ir)*k,O(Nr*v(da))*k),Bn.point(e(Ae*r(da-Fi/2),xe)*k,O(Ae*v(da-Fi/2))*k);Bn.lineEnd(),Bn.polygonEnd()},zn},Ie.rotate([90,-40]).scale(91.7095).clipAngle(180-.001)}function $r(Xt,ae,xe,Ae,je,Ie,Ze,wr){arguments.length<8&&(wr=0);function Ir(Nr,tn){if(!tn)return[Xt*Nr/_,0];var mn=tn*tn,zn=Xt+mn*(ae+mn*(xe+mn*Ae)),Bn=tn*(je-1+mn*(Ie-wr+mn*Ze)),ri=(zn*zn+Bn*Bn)/(2*Bn),Fi=Nr*O(zn/ri)/_;return[ri*v(Fi),tn*(1+mn*wr)+ri*(1-r(Fi))]}return Ir.invert=function(Nr,tn){var mn=_*Nr/Xt,zn=tn,Bn,ri,Fi=50;do{var da=zn*zn,ha=Xt+da*(ae+da*(xe+da*Ae)),ka=zn*(je-1+da*(Ie-wr+da*Ze)),io=ha*ha+ka*ka,Ro=2*ka,Mo=io/Ro,hs=Mo*Mo,hl=O(ha/Mo)/_,vl=mn*hl,Os=ha*ha,bl=(2*ae+da*(4*xe+da*6*Ae))*zn,Su=je+da*(3*Ie+da*5*Ze),mu=2*(ha*bl+ka*(Su-1)),Ws=2*(Su-1),qs=(mu*Ro-io*Ws)/(Ro*Ro),Yu=r(vl),dc=v(vl),Zc=Mo*Yu,At=Mo*dc,jt=mn/_*(1/V(1-Os/hs))*(bl*Mo-ha*qs)/hs,ue=At-Nr,Me=zn*(1+da*wr)+Mo-Zc-tn,Le=qs*dc+Zc*jt,Be=Zc*hl,sr=1+qs-(qs*Yu-At*jt),ir=At*hl,Mr=Le*ir-sr*Be;if(!Mr)break;mn-=Bn=(Me*Le-ue*sr)/Mr,zn-=ri=(ue*ir-Me*Be)/Mr}while((S(Bn)>u||S(ri)>u)&&--Fi>0);return[mn,zn]},Ir}var Br=$r(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Gr(){return g.geoProjection(Br).scale(149.995)}var dn=$r(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function an(){return g.geoProjection(dn).scale(153.93)}var Ee=$r(5/6*_,-.62636,-.0344,0,1.3493,-.05524,0,.045);function dr(){return g.geoProjection(Ee).scale(130.945)}function Vr(Xt,ae){var xe=Xt*Xt,Ae=ae*ae;return[Xt*(1-.162388*Ae)*(.87-952426e-9*xe*xe),ae*(1+Ae/12)]}Vr.invert=function(Xt,ae){var xe=Xt,Ae=ae,je=50,Ie;do{var Ze=Ae*Ae;Ae-=Ie=(Ae*(1+Ze/12)-ae)/(1+Ze/4)}while(S(Ie)>u&&--je>0);je=50,Xt/=1-.162388*Ze;do{var wr=(wr=xe*xe)*wr;xe-=Ie=(xe*(.87-952426e-9*wr)-Xt)/(.87-.00476213*wr)}while(S(Ie)>u&&--je>0);return[xe,Ae]};function yn(){return g.geoProjection(Vr).scale(131.747)}var Fn=$r(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Xn(){return g.geoProjection(Fn).scale(131.087)}function Pn(Xt){var ae=Xt(C,0)[0]-Xt(-C,0)[0];function xe(Ae,je){var Ie=Ae>0?-.5:.5,Ze=Xt(Ae+Ie*_,je);return Ze[0]-=Ie*ae,Ze}return Xt.invert&&(xe.invert=function(Ae,je){var Ie=Ae>0?-.5:.5,Ze=Xt.invert(Ae+Ie*ae,je),wr=Ze[0]-Ie*_;return wr<-_?wr+=2*_:wr>_&&(wr-=2*_),Ze[0]=wr,Ze}),xe}function En(Xt,ae){var xe=y(Xt),Ae=y(ae),je=r(ae),Ie=r(Xt)*je,Ze=v(Xt)*je,wr=v(Ae*ae);Xt=S(e(Ze,wr)),ae=O(Ie),S(Xt-C)>u&&(Xt%=C);var Ir=Zn(Xt>_/4?C-Xt:Xt,ae);return Xt>_/4&&(wr=Ir[0],Ir[0]=-Ir[1],Ir[1]=-wr),Ir[0]*=xe,Ir[1]*=-Ae,Ir}En.invert=function(Xt,ae){S(Xt)>1&&(Xt=y(Xt)*2-Xt),S(ae)>1&&(ae=y(ae)*2-ae);var xe=y(Xt),Ae=y(ae),je=-xe*Xt,Ie=-Ae*ae,Ze=Ie/je<1,wr=Ca(Ze?Ie:je,Ze?je:Ie),Ir=wr[0],Nr=wr[1],tn=r(Nr);return Ze&&(Ir=-C-Ir),[xe*(e(v(Ir)*tn,-v(Nr))+_),Ae*O(r(Ir)*tn)]};function Zn(Xt,ae){if(ae===C)return[0,0];var xe=v(ae),Ae=xe*xe,je=Ae*Ae,Ie=1+je,Ze=1+3*je,wr=1-je,Ir=O(1/V(Ie)),Nr=wr+Ae*Ie*Ir,tn=(1-xe)/Nr,mn=V(tn),zn=tn*Ie,Bn=V(zn),ri=mn*wr,Fi,da;if(Xt===0)return[0,-(ri+Ae*Bn)];var ha=r(ae),ka=1/ha,io=2*xe*ha,Ro=(-3*Ae+Ir*Ze)*io,Mo=(-Nr*ha-(1-xe)*Ro)/(Nr*Nr),hs=.5*Mo/mn,hl=wr*hs-2*Ae*mn*io,vl=Ae*Ie*Mo+tn*Ze*io,Os=-ka*io,bl=-ka*vl,Su=-2*ka*hl,mu=4*Xt/_,Ws;if(Xt>.222*_||ae<_/4&&Xt>.175*_){if(Fi=(ri+Ae*V(zn*(1+je)-ri*ri))/(1+je),Xt>_/4)return[Fi,Fi];var qs=Fi,Yu=.5*Fi;Fi=.5*(Yu+qs),da=50;do{var dc=V(zn-Fi*Fi),Zc=Fi*(Su+Os*dc)+bl*O(Fi/Bn)-mu;if(!Zc)break;Zc<0?Yu=Fi:qs=Fi,Fi=.5*(Yu+qs)}while(S(qs-Yu)>u&&--da>0)}else{Fi=u,da=25;do{var At=Fi*Fi,jt=V(zn-At),ue=Su+Os*jt,Me=Fi*ue+bl*O(Fi/Bn)-mu,Le=ue+(bl-Os*At)/jt;Fi-=Ws=jt?Me/Le:0}while(S(Ws)>u&&--da>0)}return[Fi,-ri-Ae*V(zn-Fi*Fi)]}function Ca(Xt,ae){for(var xe=0,Ae=1,je=.5,Ie=50;;){var Ze=je*je,wr=V(je),Ir=O(1/V(1+Ze)),Nr=1-Ze+je*(1+Ze)*Ir,tn=(1-wr)/Nr,mn=V(tn),zn=tn*(1+Ze),Bn=mn*(1-Ze),ri=zn-Xt*Xt,Fi=V(ri),da=ae+Bn+je*Fi;if(S(Ae-xe)<b||--Ie===0||da===0)break;da>0?xe=je:Ae=je,je=.5*(xe+Ae)}if(!Ie)return null;var ha=O(wr),ka=r(ha),io=1/ka,Ro=2*wr*ka,Mo=(-3*je+Ir*(1+3*Ze))*Ro,hs=(-Nr*ka-(1-wr)*Mo)/(Nr*Nr),hl=.5*hs/mn,vl=(1-Ze)*hl-2*je*mn*Ro,Os=-2*io*vl,bl=-io*Ro,Su=-io*(je*(1+Ze)*hs+tn*(1+3*Ze)*Ro);return[_/4*(Xt*(Os+bl*Fi)+Su*O(Xt/V(zn))),ha]}function Ri(){return g.geoProjection(Pn(En)).scale(239.75)}function Ja(Xt,ae,xe){var Ae,je,Ie;return Xt?(Ae=Xa(Xt,xe),ae?(je=Xa(ae,1-xe),Ie=je[1]*je[1]+xe*Ae[0]*Ae[0]*je[0]*je[0],[[Ae[0]*je[2]/Ie,Ae[1]*Ae[2]*je[0]*je[1]/Ie],[Ae[1]*je[1]/Ie,-Ae[0]*Ae[2]*je[0]*je[2]/Ie],[Ae[2]*je[1]*je[2]/Ie,-xe*Ae[0]*Ae[1]*je[0]/Ie]]):[[Ae[0],0],[Ae[1],0],[Ae[2],0]]):(je=Xa(ae,1-xe),[[0,je[0]/je[1]],[1/je[1],0],[je[2]/je[1],0]])}function Xa(Xt,ae){var xe,Ae,je,Ie,Ze;if(ae<u)return Ie=v(Xt),Ae=r(Xt),xe=ae*(Xt-Ie*Ae)/4,[Ie-xe*Ae,Ae+xe*Ie,1-ae*Ie*Ie/2,Xt-xe];if(ae>=1-u)return xe=(1-ae)/4,Ae=U(Xt),Ie=H(Xt),je=1/Ae,Ze=Ae*F(Xt),[Ie+xe*(Ze-Xt)/(Ae*Ae),je-xe*Ie*je*(Ze-Xt),je+xe*Ie*je*(Ze+Xt),2*t(a(Xt))-C+xe*(Ze-Xt)/Ae];var wr=[1,0,0,0,0,0,0,0,0],Ir=[V(ae),0,0,0,0,0,0,0,0],Nr=0;for(Ae=V(1-ae),Ze=1;S(Ir[Nr]/wr[Nr])>u&&Nr<8;)xe=wr[Nr++],Ir[Nr]=(xe-Ae)/2,wr[Nr]=(xe+Ae)/2,Ae=V(xe*Ae),Ze*=2;je=Ze*wr[Nr]*Xt;do Ie=Ir[Nr]*v(Ae=je)/wr[Nr],je=(O(Ie)+je)/2;while(--Nr);return[v(je),Ie=r(je),Ie/r(je-Ae),je]}function Io(Xt,ae,xe){var Ae=S(Xt),je=S(ae),Ie=F(je);if(Ae){var Ze=1/v(Ae),wr=1/(T(Ae)*T(Ae)),Ir=-(wr+xe*(Ie*Ie*Ze*Ze)-1+xe),Nr=(xe-1)*wr,tn=(-Ir+V(Ir*Ir-4*Nr))/2;return[po(t(1/V(tn)),xe)*y(Xt),po(t(V((tn/wr-1)/xe)),1-xe)*y(ae)]}return[0,po(t(Ie),1-xe)*y(ae)]}function po(Xt,ae){if(!ae)return Xt;if(ae===1)return o(T(Xt/2+M));for(var xe=1,Ae=V(1-ae),je=V(ae),Ie=0;S(je)>u;Ie++){if(Xt%_){var Ze=t(Ae*T(Xt)/xe);Ze<0&&(Ze+=_),Xt+=Ze+~~(Xt/_)*_}else Xt+=Xt;je=(xe+Ae)/2,Ae=V(xe*Ae),je=((xe=je)-Ae)/2}return Xt/(f(2,Ie)*xe)}function Do(Xt,ae){var xe=(A-1)/(A+1),Ae=V(1-xe*xe),je=po(C,Ae*Ae),Ie=-1,Ze=o(T(_/4+S(ae)/2)),wr=a(Ie*Ze)/V(xe),Ir=Ia(wr*r(Ie*Xt),wr*v(Ie*Xt)),Nr=Io(Ir[0],Ir[1],Ae*Ae);return[-Nr[1],(ae>=0?1:-1)*(.5*je-Nr[0])]}function Ia(Xt,ae){var xe=Xt*Xt,Ae=ae+1,je=1-xe-ae*ae;return[.5*((Xt>=0?C:-C)-e(je,2*Xt)),-.25*o(je*je+4*xe)+.5*o(Ae*Ae+xe)]}function gs(Xt,ae){var xe=ae[0]*ae[0]+ae[1]*ae[1];return[(Xt[0]*ae[0]+Xt[1]*ae[1])/xe,(Xt[1]*ae[0]-Xt[0]*ae[1])/xe]}Do.invert=function(Xt,ae){var xe=(A-1)/(A+1),Ae=V(1-xe*xe),je=po(C,Ae*Ae),Ie=-1,Ze=Ja(.5*je-ae,-Xt,Ae*Ae),wr=gs(Ze[0],Ze[1]),Ir=e(wr[1],wr[0])/Ie;return[Ir,2*t(a(.5/Ie*o(xe*wr[0]*wr[0]+xe*wr[1]*wr[1])))-C]};function is(){return g.geoProjection(Pn(Do)).scale(151.496)}function ll(Xt){var ae=v(Xt),xe=r(Xt),Ae=Ho(Xt);Ae.invert=Ho(-Xt);function je(Ie,Ze){var wr=Ae(Ie,Ze);Ie=wr[0],Ze=wr[1];var Ir=v(Ze),Nr=r(Ze),tn=r(Ie),mn=N(ae*Ir+xe*Nr*tn),zn=v(mn),Bn=S(zn)>u?mn/zn:1;return[Bn*xe*v(Ie),(S(Ie)>C?Bn:-Bn)*(ae*Nr-xe*Ir*tn)]}return je.invert=function(Ie,Ze){var wr=V(Ie*Ie+Ze*Ze),Ir=-v(wr),Nr=r(wr),tn=wr*Nr,mn=-Ze*Ir,zn=wr*ae,Bn=V(tn*tn+mn*mn-zn*zn),ri=e(tn*zn+mn*Bn,mn*zn-tn*Bn),Fi=(wr>C?-1:1)*e(Ie*Ir,wr*r(ri)*Nr+Ze*v(ri)*Ir);return Ae.invert(Fi,ri)},je}function Ho(Xt){var ae=v(Xt),xe=r(Xt);return function(Ae,je){var Ie=r(je),Ze=r(Ae)*Ie,wr=v(Ae)*Ie,Ir=v(je);return[e(wr,Ze*xe-Ir*ae),O(Ir*xe+Ze*ae)]}}function Gs(){var Xt=0,ae=g.geoProjectionMutator(ll),xe=ae(Xt),Ae=xe.rotate,je=xe.stream,Ie=g.geoCircle();return xe.parallel=function(Ze){if(!arguments.length)return Xt*k;var wr=xe.rotate();return ae(Xt=Ze*w).rotate(wr)},xe.rotate=function(Ze){return arguments.length?(Ae.call(xe,[Ze[0],Ze[1]-Xt*k]),Ie.center([-Ze[0],-Ze[1]]),xe):(Ze=Ae.call(xe),Ze[1]+=Xt*k,Ze)},xe.stream=function(Ze){return Ze=je(Ze),Ze.sphere=function(){Ze.polygonStart();var wr=.01,Ir=Ie.radius(90-wr)().coordinates[0],Nr=Ir.length-1,tn=-1,mn;for(Ze.lineStart();++tn<Nr;)Ze.point((mn=Ir[tn])[0],mn[1]);for(Ze.lineEnd(),Ir=Ie.radius(90+wr)().coordinates[0],Nr=Ir.length-1,Ze.lineStart();--tn>=0;)Ze.point((mn=Ir[tn])[0],mn[1]);Ze.lineEnd(),Ze.polygonEnd()},Ze},xe.scale(79.4187).parallel(45).clipAngle(180-.001)}var as=3,ul=O(1-1/as)*k,Js=ar(0);function Rl(Xt){var ae=ul*w,xe=St(_,ae)[0]-St(-_,ae)[0],Ae=Js(0,ae)[1],je=St(0,ae)[1],Ie=h-je,Ze=p/Xt,wr=4/p,Ir=Ae+Ie*Ie*4/p;function Nr(tn,mn){var zn,Bn=S(mn);if(Bn>ae){var ri=s(Xt-1,i(0,n((tn+_)/Ze)));tn+=_*(Xt-1)/Xt-ri*Ze,zn=St(tn,Bn),zn[0]=zn[0]*p/xe-p*(Xt-1)/(2*Xt)+ri*p/Xt,zn[1]=Ae+(zn[1]-je)*4*Ie/p,mn<0&&(zn[1]=-zn[1])}else zn=Js(tn,mn);return zn[0]*=wr,zn[1]/=Ir,zn}return Nr.invert=function(tn,mn){tn/=wr,mn*=Ir;var zn=S(mn);if(zn>Ae){var Bn=s(Xt-1,i(0,n((tn+_)/Ze)));tn=(tn+_*(Xt-1)/Xt-Bn*Ze)*xe/p;var ri=St.invert(tn,.25*(zn-Ae)*p/Ie+je);return ri[0]-=_*(Xt-1)/Xt-Bn*Ze,mn<0&&(ri[1]=-ri[1]),ri}return Js.invert(tn,mn)},Nr}function ls(Xt,ae){return[Xt,ae&1?90-u:ul]}function Cs(Xt,ae){return[Xt,ae&1?-90+u:-ul]}function Co(Xt){return[Xt[0]*(1-u),Xt[1]]}function ks(Xt){var ae=[].concat(P.range(-180,180+Xt/2,Xt).map(ls),P.range(180,-180-Xt/2,-Xt).map(Cs));return{type:"Polygon",coordinates:[Xt===180?ae.map(Co):ae]}}function kl(){var Xt=4,ae=g.geoProjectionMutator(Rl),xe=ae(Xt),Ae=xe.stream;return xe.lobes=function(je){return arguments.length?ae(Xt=+je):Xt},xe.stream=function(je){var Ie=xe.rotate(),Ze=Ae(je),wr=(xe.rotate([0,0]),Ae(je));return xe.rotate(Ie),Ze.sphere=function(){g.geoStream(ks(180/Xt),wr)},Ze},xe.scale(239.75)}function Vl(Xt){var ae=1+Xt,xe=v(1/ae),Ae=O(xe),je=2*V(_/(Ie=_+4*Ae*ae)),Ie,Ze=.5*je*(ae+V(Xt*(2+Xt))),wr=Xt*Xt,Ir=ae*ae;function Nr(tn,mn){var zn=1-v(mn),Bn,ri;if(zn&&zn<2){var Fi=C-mn,da=25,ha;do{var ka=v(Fi),io=r(Fi),Ro=Ae+e(ka,ae-io),Mo=1+Ir-2*ae*io;Fi-=ha=(Fi-wr*Ae-ae*ka+Mo*Ro-.5*zn*Ie)/(2*ae*ka*Ro)}while(S(ha)>b&&--da>0);Bn=je*V(Mo),ri=tn*Ro/_}else Bn=je*(Xt+zn),ri=tn*Ae/_;return[Bn*v(ri),Ze-Bn*r(ri)]}return Nr.invert=function(tn,mn){var zn=tn*tn+(mn-=Ze)*mn,Bn=(1+Ir-zn/(je*je))/(2*ae),ri=N(Bn),Fi=v(ri),da=Ae+e(Fi,ae-Bn);return[O(tn/V(zn))*_/da,O(1-2*(ri-wr*Ae-ae*Fi+(1+Ir-2*ae*Bn)*da)/Ie)]},Nr}function Yl(){var Xt=1,ae=g.geoProjectionMutator(Vl),xe=ae(Xt);return xe.ratio=function(Ae){return arguments.length?ae(Xt=+Ae):Xt},xe.scale(167.774).center([0,18.67])}var Ns=.7109889596207567,La=.0528035274542;function uo(Xt,ae){return ae>-Ns?(Xt=se(Xt,ae),Xt[1]+=La,Xt):Te(Xt,ae)}uo.invert=function(Xt,ae){return ae>-Ns?se.invert(Xt,ae-La):Te.invert(Xt,ae)};function Hs(){return g.geoProjection(uo).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Kl(Xt,ae){return S(ae)>Ns?(Xt=se(Xt,ae),Xt[1]-=ae>0?La:-La,Xt):Te(Xt,ae)}Kl.invert=function(Xt,ae){return S(ae)>Ns?se.invert(Xt,ae+(ae>0?La:-La)):Te.invert(Xt,ae)};function Go(){return g.geoProjection(Kl).scale(152.63)}function ql(Xt,ae,xe,Ae){var je=V(4*_/(2*xe+(1+Xt-ae/2)*v(2*xe)+(Xt+ae)/2*v(4*xe)+ae/2*v(6*xe))),Ie=V(Ae*v(xe)*V((1+Xt*r(2*xe)+ae*r(4*xe))/(1+Xt+ae))),Ze=xe*Ir(1);function wr(mn){return V(1+Xt*r(2*mn)+ae*r(4*mn))}function Ir(mn){var zn=mn*xe;return(2*zn+(1+Xt-ae/2)*v(2*zn)+(Xt+ae)/2*v(4*zn)+ae/2*v(6*zn))/xe}function Nr(mn){return wr(mn)*v(mn)}var tn=function(mn,zn){var Bn=xe*Wt(Ir,Ze*v(zn)/xe,zn/_);isNaN(Bn)&&(Bn=xe*y(zn));var ri=je*wr(Bn);return[ri*Ie*mn/_*r(Bn),ri/Ie*v(Bn)]};return tn.invert=function(mn,zn){var Bn=Wt(Nr,zn*Ie/je);return[mn*_/(r(Bn)*je*Ie*wr(Bn)),O(xe*Ir(Bn/xe)/Ze)]},xe===0&&(je=V(Ae/_),tn=function(mn,zn){return[mn*je,v(zn)/je]},tn.invert=function(mn,zn){return[mn/je,O(zn*je)]}),tn}function il(){var Xt=1,ae=0,xe=45*w,Ae=2,je=g.geoProjectionMutator(ql),Ie=je(Xt,ae,xe,Ae);return Ie.a=function(Ze){return arguments.length?je(Xt=+Ze,ae,xe,Ae):Xt},Ie.b=function(Ze){return arguments.length?je(Xt,ae=+Ze,xe,Ae):ae},Ie.psiMax=function(Ze){return arguments.length?je(Xt,ae,xe=+Ze*w,Ae):xe*k},Ie.ratio=function(Ze){return arguments.length?je(Xt,ae,xe,Ae=+Ze):Ae},Ie.scale(180.739)}function Cl(Xt,ae,xe,Ae,je,Ie,Ze,wr,Ir,Nr,tn){if(tn.nanEncountered)return NaN;var mn,zn,Bn,ri,Fi,da,ha,ka,io,Ro;if(mn=xe-ae,zn=Xt(ae+mn*.25),Bn=Xt(xe-mn*.25),isNaN(zn)){tn.nanEncountered=!0;return}if(isNaN(Bn)){tn.nanEncountered=!0;return}return ri=mn*(Ae+4*zn+je)/12,Fi=mn*(je+4*Bn+Ie)/12,da=ri+Fi,Ro=(da-Ze)/15,Nr>Ir?(tn.maxDepthCount++,da+Ro):Math.abs(Ro)<wr?da+Ro:(ha=ae+mn*.5,ka=Cl(Xt,ae,ha,Ae,zn,je,ri,wr*.5,Ir,Nr+1,tn),isNaN(ka)?(tn.nanEncountered=!0,NaN):(io=Cl(Xt,ha,xe,je,Bn,Ie,Fi,wr*.5,Ir,Nr+1,tn),isNaN(io)?(tn.nanEncountered=!0,NaN):ka+io))}function Fu(Xt,ae,xe,Ae,je){var Ie={maxDepthCount:0,nanEncountered:!1};je===void 0&&(je=20);var Ze=Xt(ae),wr=Xt(.5*(ae+xe)),Ir=Xt(xe),Nr=(Ze+4*wr+Ir)*(xe-ae)/6,tn=Cl(Xt,ae,xe,Ze,wr,Ir,Nr,Ae,je,1,Ie);return tn}function ao(Xt,ae,xe){function Ae(Bn){return Xt+(1-Xt)*f(1-f(Bn,ae),1/ae)}function je(Bn){return Fu(Ae,0,Bn,1e-4)}for(var Ie=1/je(1),Ze=1e3,wr=(1+1e-8)*Ie,Ir=[],Nr=0;Nr<=Ze;Nr++)Ir.push(je(Nr/Ze)*wr);function tn(Bn){var ri=0,Fi=Ze,da=Ze>>1;do Ir[da]>Bn?Fi=da:ri=da,da=ri+Fi>>1;while(da>ri);var ha=Ir[da+1]-Ir[da];return ha&&(ha=(Bn-Ir[da+1])/ha),(da+1+ha)/Ze}var mn=2*tn(1)/_*Ie/xe,zn=function(Bn,ri){var Fi=tn(S(v(ri))),da=Ae(Fi)*Bn;return Fi/=mn,[da,ri>=0?Fi:-Fi]};return zn.invert=function(Bn,ri){var Fi;return ri*=mn,S(ri)<1&&(Fi=y(ri)*O(je(S(ri))*Ie)),[Bn/Ae(S(ri)),Fi]},zn}function Ts(){var Xt=0,ae=2.5,xe=1.183136,Ae=g.geoProjectionMutator(ao),je=Ae(Xt,ae,xe);return je.alpha=function(Ie){return arguments.length?Ae(Xt=+Ie,ae,xe):Xt},je.k=function(Ie){return arguments.length?Ae(Xt,ae=+Ie,xe):ae},je.gamma=function(Ie){return arguments.length?Ae(Xt,ae,xe=+Ie):xe},je.scale(152.63)}function Ls(Xt,ae){return S(Xt[0]-ae[0])<u&&S(Xt[1]-ae[1])<u}function nu(Xt,ae){for(var xe=-1,Ae=Xt.length,je=Xt[0],Ie,Ze,wr,Ir=[];++xe<Ae;){Ie=Xt[xe],Ze=(Ie[0]-je[0])/ae,wr=(Ie[1]-je[1])/ae;for(var Nr=0;Nr<ae;++Nr)Ir.push([je[0]+Nr*Ze,je[1]+Nr*wr]);je=Ie}return Ir.push(Ie),Ir}function cl(Xt){var ae=[],xe,Ae,je,Ie,Ze,wr,Ir,Nr=Xt[0].length;for(Ir=0;Ir<Nr;++Ir)xe=Xt[0][Ir],Ae=xe[0][0],je=xe[0][1],Ie=xe[1][1],Ze=xe[2][0],wr=xe[2][1],ae.push(nu([[Ae+u,je+u],[Ae+u,Ie-u],[Ze-u,Ie-u],[Ze-u,wr+u]],30));for(Ir=Xt[1].length-1;Ir>=0;--Ir)xe=Xt[1][Ir],Ae=xe[0][0],je=xe[0][1],Ie=xe[1][1],Ze=xe[2][0],wr=xe[2][1],ae.push(nu([[Ze-u,wr-u],[Ze-u,Ie+u],[Ae+u,Ie+u],[Ae+u,je-u]],30));return{type:"Polygon",coordinates:[P.merge(ae)]}}function Qo(Xt,ae,xe){var Ae,je;function Ie(Ir,Nr){for(var tn=Nr<0?-1:1,mn=ae[+(Nr<0)],zn=0,Bn=mn.length-1;zn<Bn&&Ir>mn[zn][2][0];++zn);var ri=Xt(Ir-mn[zn][1][0],Nr);return ri[0]+=Xt(mn[zn][1][0],tn*Nr>tn*mn[zn][0][1]?mn[zn][0][1]:Nr)[0],ri}xe?Ie.invert=xe(Ie):Xt.invert&&(Ie.invert=function(Ir,Nr){for(var tn=je[+(Nr<0)],mn=ae[+(Nr<0)],zn=0,Bn=tn.length;zn<Bn;++zn){var ri=tn[zn];if(ri[0][0]<=Ir&&Ir<ri[1][0]&&ri[0][1]<=Nr&&Nr<ri[1][1]){var Fi=Xt.invert(Ir-Xt(mn[zn][1][0],0)[0],Nr);return Fi[0]+=mn[zn][1][0],Ls(Ie(Fi[0],Fi[1]),[Ir,Nr])?Fi:null}}});var Ze=g.geoProjection(Ie),wr=Ze.stream;return Ze.stream=function(Ir){var Nr=Ze.rotate(),tn=wr(Ir),mn=(Ze.rotate([0,0]),wr(Ir));return Ze.rotate(Nr),tn.sphere=function(){g.geoStream(Ae,mn)},tn},Ze.lobes=function(Ir){return arguments.length?(Ae=cl(Ir),ae=Ir.map(function(Nr){return Nr.map(function(tn){return[[tn[0][0]*w,tn[0][1]*w],[tn[1][0]*w,tn[1][1]*w],[tn[2][0]*w,tn[2][1]*w]]})}),je=ae.map(function(Nr){return Nr.map(function(tn){var mn=Xt(tn[0][0],tn[0][1])[0],zn=Xt(tn[2][0],tn[2][1])[0],Bn=Xt(tn[1][0],tn[0][1])[1],ri=Xt(tn[1][0],tn[1][1])[1],Fi;return Bn>ri&&(Fi=Bn,Bn=ri,ri=Fi),[[mn,Bn],[zn,ri]]})}),Ze):ae.map(function(Nr){return Nr.map(function(tn){return[[tn[0][0]*k,tn[0][1]*k],[tn[1][0]*k,tn[1][1]*k],[tn[2][0]*k,tn[2][1]*k]]})})},ae!=null&&Ze.lobes(ae),Ze}var Mu=[[[[-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 Gu(){return Qo(te,Mu).scale(160.857)}var _l=[[[[-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 Ol(){return Qo(Kl,_l).scale(152.63)}var Xl=[[[[-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 tu(){return Qo(se,Xl).scale(169.529)}var ac=[[[[-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 ph(){return Qo(se,ac).scale(169.529).rotate([20,0])}var Jc=[[[[-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 ah(){return Qo(uo,Jc,Ht).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Nf=[[[[-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 Sf(){return Qo(Te,Nf).scale(152.63).rotate([-20,0])}function Dl(Xt,ae){return[3/p*Xt*V(_*_/3-ae*ae),ae]}Dl.invert=function(Xt,ae){return[p/3*Xt/V(_*_/3-ae*ae),ae]};function Bc(){return g.geoProjection(Dl).scale(158.837)}function jf(Xt){function ae(xe,Ae){if(S(S(Ae)-C)<u)return[0,Ae<0?-2:2];var je=v(Ae),Ie=f((1+je)/(1-je),Xt/2),Ze=.5*(Ie+1/Ie)+r(xe*=Xt);return[2*v(xe)/Ze,(Ie-1/Ie)/Ze]}return ae.invert=function(xe,Ae){var je=S(Ae);if(S(je-2)<u)return xe?null:[0,y(Ae)*C];if(je>2)return null;xe/=2,Ae/=2;var Ie=xe*xe,Ze=Ae*Ae,wr=2*Ae/(1+Ie+Ze);return wr=f((1+wr)/(1-wr),1/Xt),[e(2*xe,1-Ie-Ze)/Xt,O((wr-1)/(wr+1))]},ae}function hc(){var Xt=.5,ae=g.geoProjectionMutator(jf),xe=ae(Xt);return xe.spacing=function(Ae){return arguments.length?ae(Xt=+Ae):Xt},xe.scale(124.75)}var oc=_/A;function fc(Xt,ae){return[Xt*(1+V(r(ae)))/2,ae/(r(ae/2)*r(Xt/6))]}fc.invert=function(Xt,ae){var xe=S(Xt),Ae=S(ae),je=u,Ie=C;Ae<oc?Ie*=Ae/oc:je+=6*N(oc/Ae);for(var Ze=0;Ze<25;Ze++){var wr=v(Ie),Ir=V(r(Ie)),Nr=v(Ie/2),tn=r(Ie/2),mn=v(je/6),zn=r(je/6),Bn=.5*je*(1+Ir)-xe,ri=Ie/(tn*zn)-Ae,Fi=Ir?-.25*je*wr/Ir:0,da=.5*(1+Ir),ha=(1+.5*Ie*Nr/tn)/(tn*zn),ka=Ie/tn*(mn/6)/(zn*zn),io=Fi*ka-ha*da,Ro=(Bn*ka-ri*da)/io,Mo=(ri*Fi-Bn*ha)/io;if(Ie-=Ro,je-=Mo,S(Ro)<u&&S(Mo)<u)break}return[Xt<0?-je:je,ae<0?-Ie:Ie]};function oh(){return g.geoProjection(fc).scale(97.2672)}function su(Xt,ae){var xe=Xt*Xt,Ae=ae*ae;return[Xt*(.975534+Ae*(-.119161+xe*-.0143059+Ae*-.0547009)),ae*(1.00384+xe*(.0802894+Ae*-.02855+xe*199025e-9)+Ae*(.0998909+Ae*-.0491032))]}su.invert=function(Xt,ae){var xe=y(Xt)*_,Ae=ae/2,je=50;do{var Ie=xe*xe,Ze=Ae*Ae,wr=xe*Ae,Ir=xe*(.975534+Ze*(-.119161+Ie*-.0143059+Ze*-.0547009))-Xt,Nr=Ae*(1.00384+Ie*(.0802894+Ze*-.02855+Ie*199025e-9)+Ze*(.0998909+Ze*-.0491032))-ae,tn=.975534-Ze*(.119161+3*Ie*.0143059+Ze*.0547009),mn=-wr*(2*.119161+4*.0547009*Ze+2*.0143059*Ie),zn=wr*(2*.0802894+4*199025e-9*Ie+2*-.02855*Ze),Bn=1.00384+Ie*(.0802894+199025e-9*Ie)+Ze*(3*(.0998909-.02855*Ie)-5*.0491032*Ze),ri=mn*zn-Bn*tn,Fi=(Nr*mn-Ir*Bn)/ri,da=(Ir*zn-Nr*tn)/ri;xe-=Fi,Ae-=da}while((S(Fi)>u||S(da)>u)&&--je>0);return je&&[xe,Ae]};function sc(){return g.geoProjection(su).scale(139.98)}function el(Xt,ae){return[v(Xt)/r(ae),T(ae)*r(Xt)]}el.invert=function(Xt,ae){var xe=Xt*Xt,Ae=ae*ae,je=Ae+1,Ie=xe+je,Ze=Xt?E*V((Ie-V(Ie*Ie-4*xe))/xe):1/V(je);return[O(Xt*Ze),y(ae)*N(Ze)]};function Zl(){return g.geoProjection(el).scale(144.049).clipAngle(90-.001)}function Mh(Xt){var ae=r(Xt),xe=T(M+Xt/2);function Ae(je,Ie){var Ze=Ie-Xt,wr=S(Ze)<u?je*ae:S(wr=M+Ie/2)<u||S(S(wr)-C)<u?0:je*Ze/o(T(wr)/xe);return[wr,Ze]}return Ae.invert=function(je,Ie){var Ze,wr=Ie+Xt;return[S(Ie)<u?je/ae:S(Ze=M+wr/2)<u||S(S(Ze)-C)<u?0:je*o(T(Ze)/xe)/Ie,wr]},Ae}function Lc(){return oe(Mh).parallel(40).scale(158.837)}function jh(Xt,ae){return[Xt,1.25*o(T(M+.4*ae))]}jh.invert=function(Xt,ae){return[Xt,2.5*t(a(.8*ae))-.625*_]};function xu(){return g.geoProjection(jh).scale(108.318)}function Cd(Xt){var ae=Xt.length-1;function xe(Ae,je){for(var Ie=r(je),Ze=2/(1+Ie*r(Ae)),wr=Ze*Ie*v(Ae),Ir=Ze*v(je),Nr=ae,tn=Xt[Nr],mn=tn[0],zn=tn[1],Bn;--Nr>=0;)tn=Xt[Nr],mn=tn[0]+wr*(Bn=mn)-Ir*zn,zn=tn[1]+wr*zn+Ir*Bn;return mn=wr*(Bn=mn)-Ir*zn,zn=wr*zn+Ir*Bn,[mn,zn]}return xe.invert=function(Ae,je){var Ie=20,Ze=Ae,wr=je;do{for(var Ir=ae,Nr=Xt[Ir],tn=Nr[0],mn=Nr[1],zn=0,Bn=0,ri;--Ir>=0;)Nr=Xt[Ir],zn=tn+Ze*(ri=zn)-wr*Bn,Bn=mn+Ze*Bn+wr*ri,tn=Nr[0]+Ze*(ri=tn)-wr*mn,mn=Nr[1]+Ze*mn+wr*ri;zn=tn+Ze*(ri=zn)-wr*Bn,Bn=mn+Ze*Bn+wr*ri,tn=Ze*(ri=tn)-wr*mn-Ae,mn=Ze*mn+wr*ri-je;var Fi=zn*zn+Bn*Bn,da,ha;Ze-=da=(tn*zn+mn*Bn)/Fi,wr-=ha=(mn*zn-tn*Bn)/Fi}while(S(da)+S(ha)>u*u&&--Ie>0);if(Ie){var ka=V(Ze*Ze+wr*wr),io=2*t(ka*.5),Ro=v(io);return[e(Ze*Ro,ka*r(io)),ka?O(wr*Ro/ka):0]}},xe}var Qs=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Wd=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Ll=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Jo=[[.9245,0],[0,0],[.01943,0]],lf=[[.721316,0],[0,0],[-.00881625,-.00617325]];function sh(){return lc(Qs,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function ec(){return lc(Wd,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Uf(){return lc(Ll,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Uh(){return lc(Jo,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function yf(){return lc(lf,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function lc(Xt,ae){var xe=g.geoProjection(Cd(Xt)).rotate(ae).clipAngle(90),Ae=g.geoRotation(ae),je=xe.center;return delete xe.rotate,xe.center=function(Ie){return arguments.length?je(Ae(Ie)):Ae.invert(je())},xe}var hd=V(6),$f=V(7);function xf(Xt,ae){var xe=O(7*v(ae)/(3*hd));return[hd*Xt*(2*r(2*xe/3)-1)/$f,9*v(xe/3)/$f]}xf.invert=function(Xt,ae){var xe=3*O(ae*$f/9);return[Xt*$f/(hd*(2*r(2*xe/3)-1)),O(v(xe)*3*hd/7)]};function Vh(){return g.geoProjection(xf).scale(164.859)}function Vf(Xt,ae){for(var xe=(1+E)*v(ae),Ae=ae,je=0,Ie;je<25&&(Ae-=Ie=(v(Ae/2)+v(Ae)-xe)/(.5*r(Ae/2)+r(Ae)),!(S(Ie)<u));je++);return[Xt*(1+2*r(Ae)/r(Ae/2))/(3*A),2*V(3)*v(Ae/2)/V(2+A)]}Vf.invert=function(Xt,ae){var xe=ae*V(2+A)/(2*V(3)),Ae=2*O(xe);return[3*A*Xt/(1+2*r(Ae)/r(Ae/2)),O((xe+v(Ae))/(1+E))]};function Hf(){return g.geoProjection(Vf).scale(188.209)}function lh(Xt,ae){for(var xe=V(6/(4+_)),Ae=(1+_/4)*v(ae),je=ae/2,Ie=0,Ze;Ie<25&&(je-=Ze=(je/2+v(je)-Ae)/(.5+r(je)),!(S(Ze)<u));Ie++);return[xe*(.5+r(je))*Xt/1.5,xe*je]}lh.invert=function(Xt,ae){var xe=V(6/(4+_)),Ae=ae/xe;return S(S(Ae)-C)<u&&(Ae=Ae<0?-C:C),[1.5*Xt/(xe*(.5+r(Ae))),O((Ae/2+v(Ae))/(1+_/4))]};function Gf(){return g.geoProjection(lh).scale(166.518)}function Sh(Xt,ae){var xe=ae*ae,Ae=xe*xe,je=xe*Ae;return[Xt*(.84719-.13063*xe+je*je*(-.04515+.05494*xe-.02326*Ae+.00331*je)),ae*(1.01183+Ae*Ae*(-.02625+.01926*xe-.00396*Ae))]}Sh.invert=function(Xt,ae){var xe=ae,Ae=25,je,Ie,Ze,wr;do Ie=xe*xe,Ze=Ie*Ie,xe-=je=(xe*(1.01183+Ze*Ze*(-.02625+.01926*Ie-.00396*Ze))-ae)/(1.01183+Ze*Ze*(9*-.02625+11*.01926*Ie+13*-.00396*Ze));while(S(je)>b&&--Ae>0);return Ie=xe*xe,Ze=Ie*Ie,wr=Ie*Ze,[Xt/(.84719-.13063*Ie+wr*wr*(-.04515+.05494*Ie-.02326*Ze+.00331*wr)),xe]};function mh(){return g.geoProjection(Sh).scale(175.295)}function uc(Xt,ae){return[Xt*(1+r(ae))/2,2*(ae-T(ae/2))]}uc.invert=function(Xt,ae){for(var xe=ae/2,Ae=0,je=1/0;Ae<10&&S(je)>u;++Ae){var Ie=r(ae/2);ae-=je=(ae-T(ae/2)-xe)/(1-.5/(Ie*Ie))}return[2*Xt/(1+r(ae)),ae]};function ef(){return g.geoProjection(uc).scale(152.63)}var Wf=[[[[-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 Jl(){return Qo(wt(1/0),Wf).rotate([20,0]).scale(152.63)}function Ef(Xt,ae){var xe=v(ae),Ae=r(ae),je=y(Xt);if(Xt===0||S(ae)===C)return[0,ae];if(ae===0)return[Xt,0];if(S(Xt)===C)return[Xt*Ae,C*xe];var Ie=_/(2*Xt)-2*Xt/_,Ze=2*ae/_,wr=(1-Ze*Ze)/(xe-Ze),Ir=Ie*Ie,Nr=wr*wr,tn=1+Ir/Nr,mn=1+Nr/Ir,zn=(Ie*xe/wr-Ie/2)/tn,Bn=(Nr*xe/Ir+wr/2)/mn,ri=zn*zn+Ae*Ae/tn,Fi=Bn*Bn-(Nr*xe*xe/Ir+wr*xe-1)/mn;return[C*(zn+V(ri)*je),C*(Bn+V(Fi<0?0:Fi)*y(-ae*Ie)*je)]}Ef.invert=function(Xt,ae){Xt/=C,ae/=C;var xe=Xt*Xt,Ae=ae*ae,je=xe+Ae,Ie=_*_;return[Xt?(je-1+V((1-je)*(1-je)+4*xe))/(2*Xt)*C:0,Wt(function(Ze){return je*(_*v(Ze)-2*Ze)*_+4*Ze*Ze*(ae-v(Ze))+2*_*Ze-Ie*ae},0)]};function Ld(){return g.geoProjection(Ef).scale(127.267)}var Yf=1.0148,_f=.23185,Kf=-.14499,Nc=.02406,Xf=Yf,zu=5*_f,jc=7*Kf,Hh=9*Nc,lu=1.790857183;function Eh(Xt,ae){var xe=ae*ae;return[Xt,ae*(Yf+xe*xe*(_f+xe*(Kf+Nc*xe)))]}Eh.invert=function(Xt,ae){ae>lu?ae=lu:ae<-lu&&(ae=-lu);var xe=ae,Ae;do{var je=xe*xe;xe-=Ae=(xe*(Yf+je*je*(_f+je*(Kf+Nc*je)))-ae)/(Xf+je*je*(zu+je*(jc+Hh*je)))}while(S(Ae)>u);return[Xt,xe]};function Sc(){return g.geoProjection(Eh).scale(139.319)}function Uc(Xt,ae){if(S(ae)<u)return[Xt,0];var xe=T(ae),Ae=Xt*v(ae);return[v(Ae)/xe,ae+(1-r(Ae))/xe]}Uc.invert=function(Xt,ae){if(S(ae)<u)return[Xt,0];var xe=Xt*Xt+ae*ae,Ae=ae*.5,je=10,Ie;do{var Ze=T(Ae),wr=1/r(Ae),Ir=xe-2*ae*Ae+Ae*Ae;Ae-=Ie=(Ze*Ir+2*(Ae-ae))/(2+Ir*wr*wr+2*(Ae-ae)*Ze)}while(S(Ie)>u&&--je>0);return Ze=T(Ae),[(S(ae)<S(Ae+1/Ze)?O(Xt*Ze):y(ae)*y(Xt)*(N(S(Xt*Ze))+C))/v(Ae),Ae]};function _u(){return g.geoProjection(Uc).scale(103.74)}function uf(Xt,ae){var xe=Cf(Xt[1],Xt[0]),Ae=Cf(ae[1],ae[0]),je=Qd(xe,Ae),Ie=Pd(xe)/Pd(Ae);return Wh([1,0,Xt[0][0],0,1,Xt[0][1]],Wh([Ie,0,0,0,Ie,0],Wh([r(je),v(je),0,-v(je),r(je),0],[1,0,-ae[0][0],0,1,-ae[0][1]])))}function gh(Xt){var ae=1/(Xt[0]*Xt[4]-Xt[1]*Xt[3]);return[ae*Xt[4],-ae*Xt[1],ae*(Xt[1]*Xt[5]-Xt[2]*Xt[4]),-ae*Xt[3],ae*Xt[0],ae*(Xt[2]*Xt[3]-Xt[0]*Xt[5])]}function Wh(Xt,ae){return[Xt[0]*ae[0]+Xt[1]*ae[3],Xt[0]*ae[1]+Xt[1]*ae[4],Xt[0]*ae[2]+Xt[1]*ae[5]+Xt[2],Xt[3]*ae[0]+Xt[4]*ae[3],Xt[3]*ae[1]+Xt[4]*ae[4],Xt[3]*ae[2]+Xt[4]*ae[5]+Xt[5]]}function Cf(Xt,ae){return[Xt[0]-ae[0],Xt[1]-ae[1]]}function Pd(Xt){return V(Xt[0]*Xt[0]+Xt[1]*Xt[1])}function Qd(Xt,ae){return e(Xt[0]*ae[1]-Xt[1]*ae[0],Xt[0]*ae[0]+Xt[1]*ae[1])}function cf(Xt,ae,xe){Ae(Xt,{transform:null});function Ae(Nr,tn){if(Nr.edges=Qc(Nr.face),tn.face){var mn=Nr.shared=hf(Nr.face,tn.face),zn=uf(mn.map(tn.project),mn.map(Nr.project));Nr.transform=tn.transform?Wh(tn.transform,zn):zn;for(var Bn=tn.edges,ri=0,Fi=Bn.length;ri<Fi;++ri)wc(mn[0],Bn[ri][1])&&wc(mn[1],Bn[ri][0])&&(Bn[ri]=Nr),wc(mn[0],Bn[ri][0])&&wc(mn[1],Bn[ri][1])&&(Bn[ri]=Nr);for(Bn=Nr.edges,ri=0,Fi=Bn.length;ri<Fi;++ri)wc(mn[0],Bn[ri][0])&&wc(mn[1],Bn[ri][1])&&(Bn[ri]=tn),wc(mn[0],Bn[ri][1])&&wc(mn[1],Bn[ri][0])&&(Bn[ri]=tn)}else Nr.transform=tn.transform;return Nr.children&&Nr.children.forEach(function(da){Ae(da,Nr)}),Nr}function je(Nr,tn){var mn=ae(Nr,tn),zn=mn.project([Nr*k,tn*k]),Bn;return(Bn=mn.transform)?[Bn[0]*zn[0]+Bn[1]*zn[1]+Bn[2],-(Bn[3]*zn[0]+Bn[4]*zn[1]+Bn[5])]:(zn[1]=-zn[1],zn)}ff(Xt)&&(je.invert=function(Nr,tn){var mn=Ie(Xt,[Nr,-tn]);return mn&&(mn[0]*=w,mn[1]*=w,mn)});function Ie(Nr,tn){var mn=Nr.project.invert,zn=Nr.transform,Bn=tn;if(zn&&(zn=gh(zn),Bn=[zn[0]*Bn[0]+zn[1]*Bn[1]+zn[2],zn[3]*Bn[0]+zn[4]*Bn[1]+zn[5]]),mn&&Nr===Ze(ri=mn(Bn)))return ri;for(var ri,Fi=Nr.children,da=0,ha=Fi&&Fi.length;da<ha;++da)if(ri=Ie(Fi[da],tn))return ri}function Ze(Nr){return ae(Nr[0]*w,Nr[1]*w)}var wr=g.geoProjection(je),Ir=wr.stream;return wr.stream=function(Nr){var tn=wr.rotate(),mn=Ir(Nr),zn=(wr.rotate([0,0]),Ir(Nr));return wr.rotate(tn),mn.sphere=function(){zn.polygonStart(),zn.lineStart(),Lf(zn,Xt),zn.lineEnd(),zn.polygonEnd()},mn},wr.angle(xe==null?-30:xe*k)}function Lf(Xt,ae,xe){var Ae,je=ae.edges,Ie=je.length,Ze,wr={type:"MultiPoint",coordinates:ae.face},Ir=ae.face.filter(function(Fi){return S(Fi[1])!==90}),Nr=g.geoBounds({type:"MultiPoint",coordinates:Ir}),tn=!1,mn=-1,zn=Nr[1][0]-Nr[0][0],Bn=zn===180||zn===360?[(Nr[0][0]+Nr[1][0])/2,(Nr[0][1]+Nr[1][1])/2]:g.geoCentroid(wr);if(xe)for(;++mn<Ie&&je[mn]!==xe;);++mn;for(var ri=0;ri<Ie;++ri)Ze=je[(ri+mn)%Ie],Array.isArray(Ze)?(tn||(Xt.point((Ae=g.geoInterpolate(Ze[0],Bn)(u))[0],Ae[1]),tn=!0),Xt.point((Ae=g.geoInterpolate(Ze[1],Bn)(u))[0],Ae[1])):(tn=!1,Ze!==xe&&Lf(Xt,Ze,ae))}function wc(Xt,ae){return Xt&&ae&&Xt[0]===ae[0]&&Xt[1]===ae[1]}function hf(Xt,ae){for(var xe,Ae,je=Xt.length,Ie=null,Ze=0;Ze<je;++Ze){xe=Xt[Ze];for(var wr=ae.length;--wr>=0;)if(Ae=ae[wr],xe[0]===Ae[0]&&xe[1]===Ae[1]){if(Ie)return[Ie,xe];Ie=xe}}}function Qc(Xt){for(var ae=Xt.length,xe=[],Ae=Xt[ae-1],je=0;je<ae;++je)xe.push([Ae,Ae=Xt[je]]);return xe}function ff(Xt){return Xt.project.invert||Xt.children&&Xt.children.some(ff)}var Pf=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],vh=[[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(Xt){return Xt.map(function(ae){return Pf[ae]})});function bu(Xt){Xt=Xt||function(xe){var Ae=g.geoCentroid({type:"MultiPoint",coordinates:xe});return g.geoGnomonic().scale(1).translate([0,0]).rotate([-Ae[0],-Ae[1]])};var ae=vh.map(function(xe){return{face:xe,project:Xt(xe)}});return[-1,0,0,1,0,1,4,5].forEach(function(xe,Ae){var je=ae[xe];je&&(je.children||(je.children=[])).push(ae[Ae])}),cf(ae[0],function(xe,Ae){return ae[xe<-_/2?Ae<0?6:4:xe<0?Ae<0?2:0:xe<_/2?Ae<0?3:1:Ae<0?7:5]}).angle(-30).scale(101.858).center([0,45])}var Ch=2/V(3);function Vc(Xt,ae){var xe=St(Xt,ae);return[xe[0]*Ch,xe[1]]}Vc.invert=function(Xt,ae){return St.invert(Xt/Ch,ae)};function fd(Xt){Xt=Xt||function(xe){var Ae=g.geoCentroid({type:"MultiPoint",coordinates:xe});return g.geoProjection(Vc).translate([0,0]).scale(1).rotate(Ae[1]>0?[-Ae[0],0]:[180-Ae[0],180])};var ae=vh.map(function(xe){return{face:xe,project:Xt(xe)}});return[-1,0,0,1,0,1,4,5].forEach(function(xe,Ae){var je=ae[xe];je&&(je.children||(je.children=[])).push(ae[Ae])}),cf(ae[0],function(xe,Ae){return ae[xe<-_/2?Ae<0?6:4:xe<0?Ae<0?2:0:xe<_/2?Ae<0?3:1:Ae<0?7:5]}).angle(-30).scale(121.906).center([0,48.5904])}function vu(Xt){Xt=Xt||function(Ze){var wr=Ze.length===6?g.geoCentroid({type:"MultiPoint",coordinates:Ze}):Ze[0];return g.geoGnomonic().scale(1).translate([0,0]).rotate([-wr[0],-wr[1]])};var ae=vh.map(function(Ze){for(var wr=Ze.map(rf),Ir=wr.length,Nr=wr[Ir-1],tn,mn=[],zn=0;zn<Ir;++zn)tn=wr[zn],mn.push(th([Nr[0]*.9486832980505138+tn[0]*.31622776601683794,Nr[1]*.9486832980505138+tn[1]*.31622776601683794,Nr[2]*.9486832980505138+tn[2]*.31622776601683794]),th([tn[0]*.9486832980505138+Nr[0]*.31622776601683794,tn[1]*.9486832980505138+Nr[1]*.31622776601683794,tn[2]*.9486832980505138+Nr[2]*.31622776601683794])),Nr=tn;return mn}),xe=[],Ae=[-1,0,0,1,0,1,4,5];ae.forEach(function(Ze,wr){for(var Ir=vh[wr],Nr=Ir.length,tn=xe[wr]=[],mn=0;mn<Nr;++mn)ae.push([Ir[mn],Ze[(mn*2+2)%(2*Nr)],Ze[(mn*2+1)%(2*Nr)]]),Ae.push(wr),tn.push(qh(rf(Ze[(mn*2+2)%(2*Nr)]),rf(Ze[(mn*2+1)%(2*Nr)])))});var je=ae.map(function(Ze){return{project:Xt(Ze),face:Ze}});Ae.forEach(function(Ze,wr){var Ir=je[Ze];Ir&&(Ir.children||(Ir.children=[])).push(je[wr])});function Ie(Ze,wr){var Ir=r(wr),Nr=[Ir*r(Ze),Ir*v(Ze),v(wr)],tn=Ze<-_/2?wr<0?6:4:Ze<0?wr<0?2:0:Ze<_/2?wr<0?3:1:wr<0?7:5,mn=xe[tn];return je[bf(mn[0],Nr)<0?8+3*tn:bf(mn[1],Nr)<0?8+3*tn+1:bf(mn[2],Nr)<0?8+3*tn+2:tn]}return cf(je[0],Ie).angle(-30).scale(110.625).center([0,45])}function bf(Xt,ae){for(var xe=0,Ae=Xt.length,je=0;xe<Ae;++xe)je+=Xt[xe]*ae[xe];return je}function qh(Xt,ae){return[Xt[1]*ae[2]-Xt[2]*ae[1],Xt[2]*ae[0]-Xt[0]*ae[2],Xt[0]*ae[1]-Xt[1]*ae[0]]}function th(Xt){return[e(Xt[1],Xt[0])*k,O(i(-1,s(1,Xt[2])))*k]}function rf(Xt){var ae=Xt[0]*w,xe=Xt[1]*w,Ae=r(xe);return[Ae*r(ae),Ae*v(ae),v(xe)]}function Zh(){}function wf(Xt){if((xe=Xt.length)<4)return!1;for(var ae=0,xe,Ae=Xt[xe-1][1]*Xt[0][0]-Xt[xe-1][0]*Xt[0][1];++ae<xe;)Ae+=Xt[ae-1][1]*Xt[ae][0]-Xt[ae-1][0]*Xt[ae][1];return Ae<=0}function zd(Xt,ae){for(var xe=ae[0],Ae=ae[1],je=!1,Ie=0,Ze=Xt.length,wr=Ze-1;Ie<Ze;wr=Ie++){var Ir=Xt[Ie],Nr=Ir[0],tn=Ir[1],mn=Xt[wr],zn=mn[0],Bn=mn[1];tn>Ae^Bn>Ae&&xe<(zn-Nr)*(Ae-tn)/(Bn-tn)+Nr&&(je=!je)}return je}function gc(Xt,ae){var xe=ae.stream,Ae;if(!xe)throw new Error("invalid projection");switch(Xt&&Xt.type){case"Feature":Ae=eh;break;case"FeatureCollection":Ae=Jf;break;default:Ae=yh;break}return Ae(Xt,xe)}function Jf(Xt,ae){return{type:"FeatureCollection",features:Xt.features.map(function(xe){return eh(xe,ae)})}}function eh(Xt,ae){return{type:"Feature",id:Xt.id,properties:Xt.properties,geometry:yh(Xt.geometry,ae)}}function Lh(Xt,ae){return{type:"GeometryCollection",geometries:Xt.geometries.map(function(xe){return yh(xe,ae)})}}function yh(Xt,ae){if(!Xt)return null;if(Xt.type==="GeometryCollection")return Lh(Xt,ae);var xe;switch(Xt.type){case"Point":xe=xh;break;case"MultiPoint":xe=xh;break;case"LineString":xe=df;break;case"MultiLineString":xe=df;break;case"Polygon":xe=_h;break;case"MultiPolygon":xe=_h;break;case"Sphere":xe=_h;break;default:return null}return g.geoStream(Xt,ae(xe)),xe.result()}var Ru=[],eu=[],xh={point:function(Xt,ae){Ru.push([Xt,ae])},result:function(){var Xt=Ru.length?Ru.length<2?{type:"Point",coordinates:Ru[0]}:{type:"MultiPoint",coordinates:Ru}:null;return Ru=[],Xt}},df={lineStart:Zh,point:function(Xt,ae){Ru.push([Xt,ae])},lineEnd:function(){Ru.length&&(eu.push(Ru),Ru=[])},result:function(){var Xt=eu.length?eu.length<2?{type:"LineString",coordinates:eu[0]}:{type:"MultiLineString",coordinates:eu}:null;return eu=[],Xt}},_h={polygonStart:Zh,lineStart:Zh,point:function(Xt,ae){Ru.push([Xt,ae])},lineEnd:function(){var Xt=Ru.length;if(Xt){do Ru.push(Ru[0].slice());while(++Xt<4);eu.push(Ru),Ru=[]}},polygonEnd:Zh,result:function(){if(!eu.length)return null;var Xt=[],ae=[];return eu.forEach(function(xe){wf(xe)?Xt.push([xe]):ae.push(xe)}),ae.forEach(function(xe){var Ae=xe[0];Xt.some(function(je){if(zd(je[0],Ae))return je.push(xe),!0})||Xt.push([xe])}),eu=[],Xt.length?Xt.length>1?{type:"MultiPolygon",coordinates:Xt}:{type:"Polygon",coordinates:Xt[0]}:null}};function qf(Xt){var ae=Xt(C,0)[0]-Xt(-C,0)[0];function xe(Ae,je){var Ie=S(Ae)<C,Ze=Xt(Ie?Ae:Ae>0?Ae-_:Ae+_,je),wr=(Ze[0]-Ze[1])*E,Ir=(Ze[0]+Ze[1])*E;if(Ie)return[wr,Ir];var Nr=ae*E,tn=wr>0^Ir>0?-1:1;return[tn*wr-y(Ir)*Nr,tn*Ir-y(wr)*Nr]}return Xt.invert&&(xe.invert=function(Ae,je){var Ie=(Ae+je)*E,Ze=(je-Ae)*E,wr=S(Ie)<.5*ae&&S(Ze)<.5*ae;if(!wr){var Ir=ae*E,Nr=Ie>0^Ze>0?-1:1,tn=-Nr*Ae+(Ze>0?1:-1)*Ir,mn=-Nr*je+(Ie>0?1:-1)*Ir;Ie=(-tn-mn)*E,Ze=(tn-mn)*E}var zn=Xt.invert(Ie,Ze);return wr||(zn[0]+=Ie>0?_:-_),zn}),g.geoProjection(xe).rotate([-90,-90,45]).clipAngle(180-.001)}function mr(){return qf(En).scale(176.423)}function Ur(){return qf(Do).scale(111.48)}function _n(Xt,ae){if(!(0<=(ae=+ae)&&ae<=20))throw new Error("invalid digits");function xe(Nr){var tn=Nr.length,mn=2,zn=new Array(tn);for(zn[0]=+Nr[0].toFixed(ae),zn[1]=+Nr[1].toFixed(ae);mn<tn;)zn[mn]=Nr[mn],++mn;return zn}function Ae(Nr){return Nr.map(xe)}function je(Nr){for(var tn=xe(Nr[0]),mn=[tn],zn=1;zn<Nr.length;zn++){var Bn=xe(Nr[zn]);(Bn.length>2||Bn[0]!=tn[0]||Bn[1]!=tn[1])&&(mn.push(Bn),tn=Bn)}return mn.length===1&&Nr.length>1&&mn.push(xe(Nr[Nr.length-1])),mn}function Ie(Nr){return Nr.map(je)}function Ze(Nr){if(Nr==null)return Nr;var tn;switch(Nr.type){case"GeometryCollection":tn={type:"GeometryCollection",geometries:Nr.geometries.map(Ze)};break;case"Point":tn={type:"Point",coordinates:xe(Nr.coordinates)};break;case"MultiPoint":tn={type:Nr.type,coordinates:Ae(Nr.coordinates)};break;case"LineString":tn={type:Nr.type,coordinates:je(Nr.coordinates)};break;case"MultiLineString":case"Polygon":tn={type:Nr.type,coordinates:Ie(Nr.coordinates)};break;case"MultiPolygon":tn={type:"MultiPolygon",coordinates:Nr.coordinates.map(Ie)};break;default:return Nr}return Nr.bbox!=null&&(tn.bbox=Nr.bbox),tn}function wr(Nr){var tn={type:"Feature",properties:Nr.properties,geometry:Ze(Nr.geometry)};return Nr.id!=null&&(tn.id=Nr.id),Nr.bbox!=null&&(tn.bbox=Nr.bbox),tn}if(Xt!=null)switch(Xt.type){case"Feature":return wr(Xt);case"FeatureCollection":{var Ir={type:"FeatureCollection",features:Xt.features.map(wr)};return Xt.bbox!=null&&(Ir.bbox=Xt.bbox),Ir}default:return Ze(Xt)}return Xt}function cn(Xt){var ae=v(Xt);function xe(Ae,je){var Ie=ae?T(Ae*ae/2)/ae:Ae/2;if(!je)return[2*Ie,-Xt];var Ze=2*t(Ie*v(je)),wr=1/T(je);return[v(Ze)*wr,je+(1-r(Ze))*wr-Xt]}return xe.invert=function(Ae,je){if(S(je+=Xt)<u)return[ae?2*t(ae*Ae/2)/ae:Ae,0];var Ie=Ae*Ae+je*je,Ze=0,wr=10,Ir;do{var Nr=T(Ze),tn=1/r(Ze),mn=Ie-2*je*Ze+Ze*Ze;Ze-=Ir=(Nr*mn+2*(Ze-je))/(2+mn*tn*tn+2*(Ze-je)*Nr)}while(S(Ir)>u&&--wr>0);var zn=Ae*(Nr=T(Ze)),Bn=T(S(je)<S(Ze+1/Nr)?O(zn)*.5:N(zn)*.5+_/4)/v(Ze);return[ae?2*t(ae*Bn)/ae:2*Bn,Ze]},xe}function Wn(){return oe(cn).scale(131.215)}var hi=[[.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]];hi.forEach(function(Xt){Xt[1]*=1.0144});function ea(Xt,ae){var xe=s(18,S(ae)*36/_),Ae=n(xe),je=xe-Ae,Ie=(mn=hi[Ae])[0],Ze=mn[1],wr=(mn=hi[++Ae])[0],Ir=mn[1],Nr=(mn=hi[s(19,++Ae)])[0],tn=mn[1],mn;return[Xt*(wr+je*(Nr-Ie)/2+je*je*(Nr-2*wr+Ie)/2),(ae>0?C:-C)*(Ir+je*(tn-Ze)/2+je*je*(tn-2*Ir+Ze)/2)]}ea.invert=function(Xt,ae){var xe=ae/C,Ae=xe*90,je=s(18,S(Ae/5)),Ie=i(0,n(je));do{var Ze=hi[Ie][1],wr=hi[Ie+1][1],Ir=hi[s(19,Ie+2)][1],Nr=Ir-Ze,tn=Ir-2*wr+Ze,mn=2*(S(xe)-wr)/Nr,zn=tn/Nr,Bn=mn*(1-zn*mn*(1-2*zn*mn));if(Bn>=0||Ie===1){Ae=(ae>=0?5:-5)*(Bn+je);var ri=50,Fi;do je=s(18,S(Ae)/5),Ie=n(je),Bn=je-Ie,Ze=hi[Ie][1],wr=hi[Ie+1][1],Ir=hi[s(19,Ie+2)][1],Ae-=(Fi=(ae>=0?C:-C)*(wr+Bn*(Ir-Ze)/2+Bn*Bn*(Ir-2*wr+Ze)/2)-ae)*k;while(S(Fi)>b&&--ri>0);break}}while(--Ie>=0);var da=hi[Ie][0],ha=hi[Ie+1][0],ka=hi[s(19,Ie+2)][0];return[Xt/(ha+Bn*(ka-da)/2+Bn*Bn*(ka-2*ha+da)/2),Ae*w]};function ga(){return g.geoProjection(ea).scale(152.63)}function Ra(Xt){function ae(xe,Ae){var je=r(Ae),Ie=(Xt-1)/(Xt-je*r(xe));return[Ie*je*v(xe),Ie*v(Ae)]}return ae.invert=function(xe,Ae){var je=xe*xe+Ae*Ae,Ie=V(je),Ze=(Xt-V(1-je*(Xt+1)/(Xt-1)))/((Xt-1)/Ie+Ie/(Xt-1));return[e(xe*Ze,Ie*V(1-Ze*Ze)),Ie?O(Ae*Ze/Ie):0]},ae}function $a(Xt,ae){var xe=Ra(Xt);if(!ae)return xe;var Ae=r(ae),je=v(ae);function Ie(Ze,wr){var Ir=xe(Ze,wr),Nr=Ir[1],tn=Nr*je/(Xt-1)+Ae;return[Ir[0]*Ae/tn,Nr/tn]}return Ie.invert=function(Ze,wr){var Ir=(Xt-1)/(Xt-1-wr*je);return xe.invert(Ir*Ze,Ir*wr*Ae)},Ie}function ua(){var Xt=2,ae=0,xe=g.geoProjectionMutator($a),Ae=xe(Xt,ae);return Ae.distance=function(je){return arguments.length?xe(Xt=+je,ae):Xt},Ae.tilt=function(je){return arguments.length?xe(Xt,ae=je*w):ae*k},Ae.scale(432.147).clipAngle(N(1/Xt)*k-1e-6)}var za=1e-4,wa=1e4,Ji=-180,eo=Ji+za,rs=180,Zo=rs-za,os=-90,fs=os+za,no=90,qa=no-za;function ds(Xt){return Xt.length>0}function tl(Xt){return Math.floor(Xt*wa)/wa}function Pl(Xt){return Xt===os||Xt===no?[0,Xt]:[Ji,tl(Xt)]}function iu(Xt){var ae=Xt[0],xe=Xt[1],Ae=!1;return ae<=eo?(ae=Ji,Ae=!0):ae>=Zo&&(ae=rs,Ae=!0),xe<=fs?(xe=os,Ae=!0):xe>=qa&&(xe=no,Ae=!0),Ae?[ae,xe]:Xt}function Hl(Xt){return Xt.map(iu)}function au(Xt,ae,xe){for(var Ae=0,je=Xt.length;Ae<je;++Ae){var Ie=Xt[Ae].slice();xe.push({index:-1,polygon:ae,ring:Ie});for(var Ze=0,wr=Ie.length;Ze<wr;++Ze){var Ir=Ie[Ze],Nr=Ir[0],tn=Ir[1];if(Nr<=eo||Nr>=Zo||tn<=fs||tn>=qa){Ie[Ze]=iu(Ir);for(var mn=Ze+1;mn<wr;++mn){var zn=Ie[mn],Bn=zn[0],ri=zn[1];if(Bn>eo&&Bn<Zo&&ri>fs&&ri<qa)break}if(mn===Ze+1)continue;if(Ze){var Fi={index:-1,polygon:ae,ring:Ie.slice(0,Ze+1)};Fi.ring[Fi.ring.length-1]=Pl(tn),xe[xe.length-1]=Fi}else xe.pop();if(mn>=wr)break;xe.push({index:-1,polygon:ae,ring:Ie=Ie.slice(mn-1)}),Ie[0]=Pl(Ie[0][1]),Ze=-1,wr=Ie.length}}}}function ml(Xt){var ae,xe=Xt.length,Ae={},je={},Ie,Ze,wr,Ir,Nr;for(ae=0;ae<xe;++ae){if(Ie=Xt[ae],Ze=Ie.ring[0],Ir=Ie.ring[Ie.ring.length-1],Ze[0]===Ir[0]&&Ze[1]===Ir[1]){Ie.polygon.push(Ie.ring),Xt[ae]=null;continue}Ie.index=ae,Ae[Ze]=je[Ir]=Ie}for(ae=0;ae<xe;++ae)if(Ie=Xt[ae],Ie){if(Ze=Ie.ring[0],Ir=Ie.ring[Ie.ring.length-1],wr=je[Ze],Nr=Ae[Ir],delete Ae[Ze],delete je[Ir],Ze[0]===Ir[0]&&Ze[1]===Ir[1]){Ie.polygon.push(Ie.ring);continue}wr?(delete je[Ze],delete Ae[wr.ring[0]],wr.ring.pop(),Xt[wr.index]=null,Ie={index:-1,polygon:wr.polygon,ring:wr.ring.concat(Ie.ring)},wr===Nr?Ie.polygon.push(Ie.ring):(Ie.index=xe++,Xt.push(Ae[Ie.ring[0]]=je[Ie.ring[Ie.ring.length-1]]=Ie))):Nr?(delete Ae[Ir],delete je[Nr.ring[Nr.ring.length-1]],Ie.ring.pop(),Ie={index:xe++,polygon:Nr.polygon,ring:Ie.ring.concat(Nr.ring)},Xt[Nr.index]=null,Xt.push(Ae[Ie.ring[0]]=je[Ie.ring[Ie.ring.length-1]]=Ie)):(Ie.ring.push(Ie.ring[0]),Ie.polygon.push(Ie.ring))}}function qu(Xt){var ae={type:"Feature",geometry:Lu(Xt.geometry)};return Xt.id!=null&&(ae.id=Xt.id),Xt.bbox!=null&&(ae.bbox=Xt.bbox),Xt.properties!=null&&(ae.properties=Xt.properties),ae}function Lu(Xt){if(Xt==null)return Xt;var ae,xe,Ae,je;switch(Xt.type){case"GeometryCollection":ae={type:"GeometryCollection",geometries:Xt.geometries.map(Lu)};break;case"Point":ae={type:"Point",coordinates:iu(Xt.coordinates)};break;case"MultiPoint":case"LineString":ae={type:Xt.type,coordinates:Hl(Xt.coordinates)};break;case"MultiLineString":ae={type:"MultiLineString",coordinates:Xt.coordinates.map(Hl)};break;case"Polygon":{var Ie=[];au(Xt.coordinates,Ie,xe=[]),ml(xe),ae={type:"Polygon",coordinates:Ie};break}case"MultiPolygon":{xe=[],Ae=-1,je=Xt.coordinates.length;for(var Ze=new Array(je);++Ae<je;)au(Xt.coordinates[Ae],Ze[Ae]=[],xe);ml(xe),ae={type:"MultiPolygon",coordinates:Ze.filter(ds)};break}default:return Xt}return Xt.bbox!=null&&(ae.bbox=Xt.bbox),ae}function uu(Xt){if(Xt==null)return Xt;switch(Xt.type){case"Feature":return qu(Xt);case"FeatureCollection":{var ae={type:"FeatureCollection",features:Xt.features.map(qu)};return Xt.bbox!=null&&(ae.bbox=Xt.bbox),ae}default:return Lu(Xt)}}function zo(Xt,ae){var xe=T(ae/2),Ae=v(M*xe);return[Xt*(.74482-.34588*Ae*Ae),1.70711*xe]}zo.invert=function(Xt,ae){var xe=ae/1.70711,Ae=v(M*xe);return[Xt/(.74482-.34588*Ae*Ae),2*t(xe)]};function Ms(){return g.geoProjection(zo).scale(146.153)}function $l(Xt,ae,xe){var Ae=g.geoInterpolate(ae,xe),je=Ae(.5),Ie=g.geoRotation([-je[0],-je[1]])(ae),Ze=Ae.distance/2,wr=-O(v(Ie[1]*w)/v(Ze)),Ir=[-je[0],-je[1],-(Ie[0]>0?_-wr:wr)*k],Nr=g.geoProjection(Xt(Ze)).rotate(Ir),tn=g.geoRotation(Ir),mn=Nr.center;return delete Nr.rotate,Nr.center=function(zn){return arguments.length?mn(tn(zn)):tn.invert(mn())},Nr.clipAngle(90)}function Fl(Xt){var ae=r(Xt);function xe(Ae,je){var Ie=g.geoGnomonicRaw(Ae,je);return Ie[0]*=ae,Ie}return xe.invert=function(Ae,je){return g.geoGnomonicRaw.invert(Ae/ae,je)},xe}function vc(){return Hc([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Hc(Xt,ae){return $l(Fl,Xt,ae)}function Pc(Xt){if(!(Xt*=2))return g.geoAzimuthalEquidistantRaw;var ae=-Xt/2,xe=-ae,Ae=Xt*Xt,je=T(xe),Ie=.5/v(xe);function Ze(wr,Ir){var Nr=N(r(Ir)*r(wr-ae)),tn=N(r(Ir)*r(wr-xe)),mn=Ir<0?-1:1;return Nr*=Nr,tn*=tn,[(Nr-tn)/(2*Xt),mn*V(4*Ae*tn-(Ae-Nr+tn)*(Ae-Nr+tn))/(2*Xt)]}return Ze.invert=function(wr,Ir){var Nr=Ir*Ir,tn=r(V(Nr+(zn=wr+ae)*zn)),mn=r(V(Nr+(zn=wr+xe)*zn)),zn,Bn;return[e(Bn=tn-mn,zn=(tn+mn)*je),(Ir<0?-1:1)*N(V(zn*zn+Bn*Bn)*Ie)]},Ze}function Ph(){return Wc([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Wc(Xt,ae){return $l(Pc,Xt,ae)}function zh(Xt,ae){if(S(ae)<u)return[Xt,0];var xe=S(ae/C),Ae=O(xe);if(S(Xt)<u||S(S(ae)-C)<u)return[0,y(ae)*_*T(Ae/2)];var je=r(Ae),Ie=S(_/Xt-Xt/_)/2,Ze=Ie*Ie,wr=je/(xe+je-1),Ir=wr*(2/xe-1),Nr=Ir*Ir,tn=Nr+Ze,mn=wr-Nr,zn=Ze+wr;return[y(Xt)*_*(Ie*mn+V(Ze*mn*mn-tn*(wr*wr-Nr)))/tn,y(ae)*_*(Ir*zn-Ie*V((Ze+1)*tn-zn*zn))/tn]}zh.invert=function(Xt,ae){if(S(ae)<u)return[Xt,0];if(S(Xt)<u)return[0,C*v(2*t(ae/_))];var xe=(Xt/=_)*Xt,Ae=(ae/=_)*ae,je=xe+Ae,Ie=je*je,Ze=-S(ae)*(1+je),wr=Ze-2*Ae+xe,Ir=-2*Ze+1+2*Ae+Ie,Nr=Ae/Ir+(2*wr*wr*wr/(Ir*Ir*Ir)-9*Ze*wr/(Ir*Ir))/27,tn=(Ze-wr*wr/(3*Ir))/Ir,mn=2*V(-tn/3),zn=N(3*Nr/(tn*mn))/3;return[_*(je-1+V(1+2*(xe-Ae)+Ie))/(2*Xt),y(ae)*_*(-mn*r(zn+_/3)-wr/(3*Ir))]};function Iu(){return g.geoProjection(zh).scale(79.4183)}function Ih(Xt,ae){if(S(ae)<u)return[Xt,0];var xe=S(ae/C),Ae=O(xe);if(S(Xt)<u||S(S(ae)-C)<u)return[0,y(ae)*_*T(Ae/2)];var je=r(Ae),Ie=S(_/Xt-Xt/_)/2,Ze=Ie*Ie,wr=je*(V(1+Ze)-Ie*je)/(1+Ze*xe*xe);return[y(Xt)*_*wr,y(ae)*_*V(1-wr*(2*Ie+wr))]}Ih.invert=function(Xt,ae){if(!Xt)return[0,C*v(2*t(ae/_))];var xe=S(Xt/_),Ae=(1-xe*xe-(ae/=_)*ae)/(2*xe),je=Ae*Ae,Ie=V(je+1);return[y(Xt)*_*(Ie-Ae),y(ae)*C*v(2*e(V((1-2*Ae*xe)*(Ae+Ie)-xe),V(Ie+Ae+xe)))]};function es(){return g.geoProjection(Ih).scale(79.4183)}function zs(Xt,ae){if(S(ae)<u)return[Xt,0];var xe=ae/C,Ae=O(xe);if(S(Xt)<u||S(S(ae)-C)<u)return[0,_*T(Ae/2)];var je=(_/Xt-Xt/_)/2,Ie=xe/(1+r(Ae));return[_*(y(Xt)*V(je*je+1-Ie*Ie)-je),_*Ie]}zs.invert=function(Xt,ae){if(!ae)return[Xt,0];var xe=ae/_,Ae=(_*_*(1-xe*xe)-Xt*Xt)/(2*_*Xt);return[Xt?_*(y(Xt)*V(Ae*Ae+1)-Ae):0,C*v(2*t(xe))]};function qc(){return g.geoProjection(zs).scale(79.4183)}function Zu(Xt,ae){if(!ae)return[Xt,0];var xe=S(ae);if(!Xt||xe===C)return[0,ae];var Ae=xe/C,je=Ae*Ae,Ie=(8*Ae-je*(je+2)-5)/(2*je*(Ae-1)),Ze=Ie*Ie,wr=Ae*Ie,Ir=je+Ze+2*wr,Nr=Ae+3*Ie,tn=Xt/C,mn=tn+1/tn,zn=y(S(Xt)-C)*V(mn*mn-4),Bn=zn*zn,ri=Ir*(je+Ze*Bn-1)+(1-je)*(je*(Nr*Nr+4*Ze)+12*wr*Ze+4*Ze*Ze),Fi=(zn*(Ir+Ze-1)+2*V(ri))/(4*Ir+Bn);return[y(Xt)*C*Fi,y(ae)*C*V(1+zn*S(Fi)-Fi*Fi)]}Zu.invert=function(Xt,ae){var xe;if(!Xt||!ae)return[Xt,ae];ae/=_;var Ae=y(Xt)*Xt/C,je=(Ae*Ae-1+4*ae*ae)/S(Ae),Ie=je*je,Ze=2*ae,wr=50;do{var Ir=Ze*Ze,Nr=(8*Ze-Ir*(Ir+2)-5)/(2*Ir*(Ze-1)),tn=(3*Ze-Ir*Ze-10)/(2*Ir*Ze),mn=Nr*Nr,zn=Ze*Nr,Bn=Ze+Nr,ri=Bn*Bn,Fi=Ze+3*Nr,da=ri*(Ir+mn*Ie-1)+(1-Ir)*(Ir*(Fi*Fi+4*mn)+mn*(12*zn+4*mn)),ha=-2*Bn*(4*zn*mn+(1-4*Ir+3*Ir*Ir)*(1+tn)+mn*(-6+14*Ir-Ie+(-8+8*Ir-2*Ie)*tn)+zn*(-8+12*Ir+(-10+10*Ir-Ie)*tn)),ka=V(da),io=je*(ri+mn-1)+2*ka-Ae*(4*ri+Ie),Ro=je*(2*Nr*tn+2*Bn*(1+tn))+ha/ka-8*Bn*(je*(-1+mn+ri)+2*ka)*(1+tn)/(Ie+4*ri);Ze-=xe=io/Ro}while(xe>u&&--wr>0);return[y(Xt)*(V(je*je+4)+je)*_/4,C*Ze]};function Zf(){return g.geoProjection(Zu).scale(127.16)}function qt(Xt,ae,xe,Ae,je){function Ie(Ze,wr){var Ir=xe*v(Ae*wr),Nr=V(1-Ir*Ir),tn=V(2/(1+Nr*r(Ze*=je)));return[Xt*Nr*tn*v(Ze),ae*Ir*tn]}return Ie.invert=function(Ze,wr){var Ir=Ze/Xt,Nr=wr/ae,tn=V(Ir*Ir+Nr*Nr),mn=2*O(tn/2);return[e(Ze*T(mn),Xt*tn)/je,tn&&O(wr*v(mn)/(ae*xe*tn))/Ae]},Ie}function I(Xt,ae,xe,Ae){var je=_/3;Xt=i(Xt,u),ae=i(ae,u),Xt=s(Xt,C),ae=s(ae,_-u),xe=i(xe,0),xe=s(xe,100-u),Ae=i(Ae,u);var Ie=xe/100+1,Ze=Ae/100,wr=N(Ie*r(je))/je,Ir=v(Xt)/v(wr*C),Nr=ae/_,tn=V(Ze*v(Xt/2)/v(ae/2)),mn=tn/V(Nr*Ir*wr),zn=1/(tn*V(Nr*Ir*wr));return qt(mn,zn,Ir,wr,Nr)}function ht(){var Xt=65*w,ae=60*w,xe=20,Ae=200,je=g.geoProjectionMutator(I),Ie=je(Xt,ae,xe,Ae);return Ie.poleline=function(Ze){return arguments.length?je(Xt=+Ze*w,ae,xe,Ae):Xt*k},Ie.parallels=function(Ze){return arguments.length?je(Xt,ae=+Ze*w,xe,Ae):ae*k},Ie.inflation=function(Ze){return arguments.length?je(Xt,ae,xe=+Ze,Ae):xe},Ie.ratio=function(Ze){return arguments.length?je(Xt,ae,xe,Ae=+Ze):Ae},Ie.scale(163.775)}function Et(){return ht().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var It=4*_+3*V(3),Vt=2*V(2*_*V(3)/It),ke=de(Vt*V(3)/_,Vt,It/6);function Oe(){return g.geoProjection(ke).scale(176.84)}function Ke(Xt,ae){return[Xt*V(1-3*ae*ae/(_*_)),ae]}Ke.invert=function(Xt,ae){return[Xt/V(1-3*ae*ae/(_*_)),ae]};function gr(){return g.geoProjection(Ke).scale(152.63)}function Or(Xt,ae){var xe=r(ae),Ae=r(Xt)*xe,je=1-Ae,Ie=r(Xt=e(v(Xt)*xe,-v(ae))),Ze=v(Xt);return xe=V(1-Ae*Ae),[Ze*xe-Ie*je,-Ie*xe-Ze*je]}Or.invert=function(Xt,ae){var xe=(Xt*Xt+ae*ae)/-2,Ae=V(-xe*(2+xe)),je=ae*xe+Xt*Ae,Ie=Xt*xe-ae*Ae,Ze=V(Ie*Ie+je*je);return[e(Ae*je,Ze*(1+xe)),Ze?-O(Ae*Ie/Ze):0]};function Dr(){return g.geoProjection(Or).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function ln(Xt,ae){var xe=yt(Xt,ae);return[(xe[0]+Xt/C)/2,(xe[1]+ae)/2]}ln.invert=function(Xt,ae){var xe=Xt,Ae=ae,je=25;do{var Ie=r(Ae),Ze=v(Ae),wr=v(2*Ae),Ir=Ze*Ze,Nr=Ie*Ie,tn=v(xe),mn=r(xe/2),zn=v(xe/2),Bn=zn*zn,ri=1-Nr*mn*mn,Fi=ri?N(Ie*mn)*V(da=1/ri):da=0,da,ha=.5*(2*Fi*Ie*zn+xe/C)-Xt,ka=.5*(Fi*Ze+Ae)-ae,io=.5*da*(Nr*Bn+Fi*Ie*mn*Ir)+.5/C,Ro=da*(tn*wr/4-Fi*Ze*zn),Mo=.125*da*(wr*zn-Fi*Ze*Nr*tn),hs=.5*da*(Ir*mn+Fi*Bn*Ie)+.5,hl=Ro*Mo-hs*io,vl=(ka*Ro-ha*hs)/hl,Os=(ha*Mo-ka*io)/hl;xe-=vl,Ae-=Os}while((S(vl)>u||S(Os)>u)&&--je>0);return[xe,Ae]};function Sn(){return g.geoProjection(ln).scale(158.837)}c.geoNaturalEarth=g.geoNaturalEarth1,c.geoNaturalEarthRaw=g.geoNaturalEarth1Raw,c.geoAiry=lt,c.geoAiryRaw=X,c.geoAitoff=pt,c.geoAitoffRaw=yt,c.geoArmadillo=tt,c.geoArmadilloRaw=st,c.geoAugust=rt,c.geoAugustRaw=dt,c.geoBaker=Y,c.geoBakerRaw=it,c.geoBerghaus=ut,c.geoBerghausRaw=ft,c.geoBertin1953=ge,c.geoBertin1953Raw=Jt,c.geoBoggs=ve,c.geoBoggsRaw=te,c.geoBonne=cr,c.geoBonneRaw=Ge,c.geoBottomley=jr,c.geoBottomleyRaw=ur,c.geoBromley=br,c.geoBromleyRaw=Hr,c.geoChamberlin=gt,c.geoChamberlinRaw=$t,c.geoChamberlinAfrica=Ct,c.geoCollignon=Nt,c.geoCollignonRaw=St,c.geoCraig=le,c.geoCraigRaw=ee,c.geoCraster=qe,c.geoCrasterRaw=Ue,c.geoCylindricalEqualArea=Ar,c.geoCylindricalEqualAreaRaw=ar,c.geoCylindricalStereographic=pr,c.geoCylindricalStereographicRaw=Tr,c.geoEckert1=Vn,c.geoEckert1Raw=Jr,c.geoEckert2=Kn,c.geoEckert2Raw=Hn,c.geoEckert3=ii,c.geoEckert3Raw=Ci,c.geoEckert4=oa,c.geoEckert4Raw=qn,c.geoEckert5=We,c.geoEckert5Raw=Hi,c.geoEckert6=fr,c.geoEckert6Raw=rr,c.geoEisenlohr=Cn,c.geoEisenlohrRaw=Qr,c.geoFahey=ci,c.geoFaheyRaw=Mn,c.geoFoucaut=Pi,c.geoFoucautRaw=xi,c.geoFoucautSinusoidal=Zi,c.geoFoucautSinusoidalRaw=Di,c.geoGilbert=Wa,c.geoGingery=qr,c.geoGingeryRaw=ze,c.geoGinzburg4=Gr,c.geoGinzburg4Raw=Br,c.geoGinzburg5=an,c.geoGinzburg5Raw=dn,c.geoGinzburg6=dr,c.geoGinzburg6Raw=Ee,c.geoGinzburg8=yn,c.geoGinzburg8Raw=Vr,c.geoGinzburg9=Xn,c.geoGinzburg9Raw=Fn,c.geoGringorten=Ri,c.geoGringortenRaw=En,c.geoGuyou=is,c.geoGuyouRaw=Do,c.geoHammer=Pt,c.geoHammerRaw=wt,c.geoHammerRetroazimuthal=Gs,c.geoHammerRetroazimuthalRaw=ll,c.geoHealpix=kl,c.geoHealpixRaw=Rl,c.geoHill=Yl,c.geoHillRaw=Vl,c.geoHomolosine=Go,c.geoHomolosineRaw=Kl,c.geoHufnagel=il,c.geoHufnagelRaw=ql,c.geoHyperelliptical=Ts,c.geoHyperellipticalRaw=ao,c.geoInterrupt=Qo,c.geoInterruptedBoggs=Gu,c.geoInterruptedHomolosine=Ol,c.geoInterruptedMollweide=tu,c.geoInterruptedMollweideHemispheres=ph,c.geoInterruptedSinuMollweide=ah,c.geoInterruptedSinusoidal=Sf,c.geoKavrayskiy7=Bc,c.geoKavrayskiy7Raw=Dl,c.geoLagrange=hc,c.geoLagrangeRaw=jf,c.geoLarrivee=oh,c.geoLarriveeRaw=fc,c.geoLaskowski=sc,c.geoLaskowskiRaw=su,c.geoLittrow=Zl,c.geoLittrowRaw=el,c.geoLoximuthal=Lc,c.geoLoximuthalRaw=Mh,c.geoMiller=xu,c.geoMillerRaw=jh,c.geoModifiedStereographic=lc,c.geoModifiedStereographicRaw=Cd,c.geoModifiedStereographicAlaska=sh,c.geoModifiedStereographicGs48=ec,c.geoModifiedStereographicGs50=Uf,c.geoModifiedStereographicMiller=Uh,c.geoModifiedStereographicLee=yf,c.geoMollweide=Tt,c.geoMollweideRaw=se,c.geoMtFlatPolarParabolic=Vh,c.geoMtFlatPolarParabolicRaw=xf,c.geoMtFlatPolarQuartic=Hf,c.geoMtFlatPolarQuarticRaw=Vf,c.geoMtFlatPolarSinusoidal=Gf,c.geoMtFlatPolarSinusoidalRaw=lh,c.geoNaturalEarth2=mh,c.geoNaturalEarth2Raw=Sh,c.geoNellHammer=ef,c.geoNellHammerRaw=uc,c.geoInterruptedQuarticAuthalic=Jl,c.geoNicolosi=Ld,c.geoNicolosiRaw=Ef,c.geoPatterson=Sc,c.geoPattersonRaw=Eh,c.geoPolyconic=_u,c.geoPolyconicRaw=Uc,c.geoPolyhedral=cf,c.geoPolyhedralButterfly=bu,c.geoPolyhedralCollignon=fd,c.geoPolyhedralWaterman=vu,c.geoProject=gc,c.geoGringortenQuincuncial=mr,c.geoPeirceQuincuncial=Ur,c.geoPierceQuincuncial=Ur,c.geoQuantize=_n,c.geoQuincuncial=qf,c.geoRectangularPolyconic=Wn,c.geoRectangularPolyconicRaw=cn,c.geoRobinson=ga,c.geoRobinsonRaw=ea,c.geoSatellite=ua,c.geoSatelliteRaw=$a,c.geoSinuMollweide=Hs,c.geoSinuMollweideRaw=uo,c.geoSinusoidal=He,c.geoSinusoidalRaw=Te,c.geoStitch=uu,c.geoTimes=Ms,c.geoTimesRaw=zo,c.geoTwoPointAzimuthal=Hc,c.geoTwoPointAzimuthalRaw=Fl,c.geoTwoPointAzimuthalUsa=vc,c.geoTwoPointEquidistant=Wc,c.geoTwoPointEquidistantRaw=Pc,c.geoTwoPointEquidistantUsa=Ph,c.geoVanDerGrinten=Iu,c.geoVanDerGrintenRaw=zh,c.geoVanDerGrinten2=es,c.geoVanDerGrinten2Raw=Ih,c.geoVanDerGrinten3=qc,c.geoVanDerGrinten3Raw=zs,c.geoVanDerGrinten4=Zf,c.geoVanDerGrinten4Raw=Zu,c.geoWagner=ht,c.geoWagner7=Et,c.geoWagnerRaw=I,c.geoWagner4=Oe,c.geoWagner4Raw=ke,c.geoWagner6=gr,c.geoWagner6Raw=Ke,c.geoWiechel=Dr,c.geoWiechelRaw=Or,c.geoWinkel3=Sn,c.geoWinkel3Raw=ln,Object.defineProperty(c,"__esModule",{value:!0})})}),EU=Ft((Q,$)=>{var c=un(),g=bn(),P=Xo(),S=Math.PI/180,t=180/Math.PI,e={cursor:"pointer"},r={cursor:"auto"};function a(k,w){var R=k.projection,O;return w._isScoped?O=i:w._isClipped?O=f:O=s,O(k,R)}$.exports=a;function n(k,w){return c.behavior.zoom().translate(w.translate()).scale(w.scale())}function o(k,w,R){var O=k.id,N=k.graphDiv,V=N.layout,H=V[O],F=N._fullLayout,U=F[O],W={},q={};function X(lt,yt){W[O+"."+lt]=g.nestedProperty(H,lt).get(),P.call("_storeDirectGUIEdit",V,F._preGUI,W);var pt=g.nestedProperty(U,lt);pt.get()!==yt&&(pt.set(yt),g.nestedProperty(H,lt).set(yt),q[O+"."+lt]=yt)}R(X),X("projection.scale",w.scale()/k.fitScale),X("fitbounds",!1),N.emit("plotly_relayout",q)}function i(k,w){var R=n(k,w);function O(){c.select(this).style(e)}function N(){w.scale(c.event.scale).translate(c.event.translate),k.render(!0);var F=w.invert(k.midPt);k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":w.scale()/k.fitScale,"geo.center.lon":F[0],"geo.center.lat":F[1]})}function V(F){var U=w.invert(k.midPt);F("center.lon",U[0]),F("center.lat",U[1])}function H(){c.select(this).style(r),o(k,w,V)}return R.on("zoomstart",O).on("zoom",N).on("zoomend",H),R}function s(k,w){var R=n(k,w),O=2,N,V,H,F,U,W,q,X,lt;function yt(at){return w.invert(at)}function pt(at){var vt=yt(at);if(!vt)return!0;var it=w(vt);return Math.abs(it[0]-at[0])>O||Math.abs(it[1]-at[1])>O}function st(){c.select(this).style(e),N=c.mouse(this),V=w.rotate(),H=w.translate(),F=V,U=yt(N)}function tt(){if(W=c.mouse(this),pt(N)){R.scale(w.scale()),R.translate(w.translate());return}w.scale(c.event.scale),w.translate([H[0],c.event.translate[1]]),U?yt(W)&&(X=yt(W),q=[F[0]+(X[0]-U[0]),V[1],V[2]],w.rotate(q),F=q):(N=W,U=yt(N)),lt=!0,k.render(!0);var at=w.rotate(),vt=w.invert(k.midPt);k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":w.scale()/k.fitScale,"geo.center.lon":vt[0],"geo.center.lat":vt[1],"geo.projection.rotation.lon":-at[0]})}function dt(){c.select(this).style(r),lt&&o(k,w,rt)}function rt(at){var vt=w.rotate(),it=w.invert(k.midPt);at("projection.rotation.lon",-vt[0]),at("center.lon",it[0]),at("center.lat",it[1])}return R.on("zoomstart",st).on("zoom",tt).on("zoomend",dt),R}function f(k,w){w.rotate(),w.scale();var R=n(k,w),O=p(R,"zoomstart","zoom","zoomend"),N=0,V=R.on,H;R.on("zoomstart",function(){c.select(this).style(e);var X=c.mouse(this),lt=w.rotate(),yt=lt,pt=w.translate(),st=y(lt);H=x(w,X),V.call(R,"zoom",function(){var tt=c.mouse(this);if(w.scale(c.event.scale),!H)X=tt,H=x(w,X);else if(x(w,tt)){w.rotate(lt).translate(pt);var dt=x(w,tt),rt=T(H,dt),at=M(v(st,rt)),vt=u(at,H,yt);(!isFinite(vt[0])||!isFinite(vt[1])||!isFinite(vt[2]))&&(vt=yt),w.rotate(vt),yt=vt}U(O.of(this,arguments))}),F(O.of(this,arguments))}).on("zoomend",function(){c.select(this).style(r),V.call(R,"zoom",null),W(O.of(this,arguments)),o(k,w,q)}).on("zoom.redraw",function(){k.render(!0);var X=w.rotate();k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":w.scale()/k.fitScale,"geo.projection.rotation.lon":-X[0],"geo.projection.rotation.lat":-X[1]})});function F(X){N++||X({type:"zoomstart"})}function U(X){X({type:"zoom"})}function W(X){--N||X({type:"zoomend"})}function q(X){var lt=w.rotate();X("projection.rotation.lon",-lt[0]),X("projection.rotation.lat",-lt[1])}return c.rebind(R,O,"on")}function x(k,w){var R=k.invert(w);return R&&isFinite(R[0])&&isFinite(R[1])&&E(R)}function y(k){var w=.5*k[0]*S,R=.5*k[1]*S,O=.5*k[2]*S,N=Math.sin(w),V=Math.cos(w),H=Math.sin(R),F=Math.cos(R),U=Math.sin(O),W=Math.cos(O);return[V*F*W+N*H*U,N*F*W-V*H*U,V*H*W+N*F*U,V*F*U-N*H*W]}function v(k,w){var R=k[0],O=k[1],N=k[2],V=k[3],H=w[0],F=w[1],U=w[2],W=w[3];return[R*H-O*F-N*U-V*W,R*F+O*H+N*W-V*U,R*U-O*W+N*H+V*F,R*W+O*U-N*F+V*H]}function T(k,w){if(!(!k||!w)){var R=h(k,w),O=Math.sqrt(A(R,R)),N=.5*Math.acos(Math.max(-1,Math.min(1,A(k,w)))),V=Math.sin(N)/O;return O&&[Math.cos(N),R[2]*V,-R[1]*V,R[0]*V]}}function u(k,w,R){var O=C(w,2,k[0]);O=C(O,1,k[1]),O=C(O,0,k[2]-R[2]);var N=w[0],V=w[1],H=w[2],F=O[0],U=O[1],W=O[2],q=Math.atan2(V,N)*t,X=Math.sqrt(N*N+V*V),lt,yt;Math.abs(U)>X?(yt=(U>0?90:-90)-q,lt=0):(yt=Math.asin(U/X)*t-q,lt=Math.sqrt(X*X-U*U));var pt=180-yt-2*q,st=(Math.atan2(W,F)-Math.atan2(H,lt))*t,tt=(Math.atan2(W,F)-Math.atan2(H,-lt))*t,dt=b(R[0],R[1],yt,st),rt=b(R[0],R[1],pt,tt);return dt<=rt?[yt,st,R[2]]:[pt,tt,R[2]]}function b(k,w,R,O){var N=_(R-k),V=_(O-w);return Math.sqrt(N*N+V*V)}function _(k){return(k%360+540)%360-180}function C(k,w,R){var O=R*S,N=k.slice(),V=w===0?1:0,H=w===2?1:2,F=Math.cos(O),U=Math.sin(O);return N[V]=k[V]*F-k[H]*U,N[H]=k[H]*F+k[V]*U,N}function M(k){return[Math.atan2(2*(k[0]*k[1]+k[2]*k[3]),1-2*(k[1]*k[1]+k[2]*k[2]))*t,Math.asin(Math.max(-1,Math.min(1,2*(k[0]*k[2]-k[3]*k[1]))))*t,Math.atan2(2*(k[0]*k[3]+k[1]*k[2]),1-2*(k[2]*k[2]+k[3]*k[3]))*t]}function E(k){var w=k[0]*S,R=k[1]*S,O=Math.cos(R);return[O*Math.cos(w),O*Math.sin(w),Math.sin(R)]}function A(k,w){for(var R=0,O=0,N=k.length;O<N;++O)R+=k[O]*w[O];return R}function h(k,w){return[k[1]*w[2]-k[2]*w[1],k[2]*w[0]-k[0]*w[2],k[0]*w[1]-k[1]*w[0]]}function p(k){for(var w=0,R=arguments.length,O=[];++w<R;)O.push(arguments[w]);var N=c.dispatch.apply(null,O);return N.of=function(V,H){return function(F){var U;try{U=F.sourceEvent=c.event,F.target=k,c.event=F,N[F.type].apply(V,H)}finally{c.event=U}}},N}}),CU=Ft((Q,$)=>{var c=un(),g=yS(),P=g.geoPath,S=g.geoDistance,t=SU(),e=Xo(),r=bn(),a=r.strTranslate,n=li(),o=js(),i=Qh(),s=Kc(),f=Es(),x=Y0().getAutoRange,y=up(),v=vf().prepSelect,T=vf().clearOutline,u=vf().selectOnClick,b=EU(),_=v3(),C=V1(),M=Gk(),E=mS().feature;function A(R){this.id=R.id,this.graphDiv=R.graphDiv,this.container=R.container,this.topojsonURL=R.topojsonURL,this.isStatic=R.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 h=A.prototype;$.exports=function(R){return new A(R)},h.plot=function(R,O,N,V){var H=this;if(V)return H.update(R,O,!0);H._geoCalcData=R,H._fullLayout=O;var F=O[this.id],U=[],W=!1;for(var q in _.layerNameToAdjective)if(q!=="frame"&&F["show"+q]){W=!0;break}for(var X=!1,lt=0;lt<R.length;lt++){var yt=R[0][0].trace;yt._geo=H,yt.locationmode&&(W=!0);var pt=yt.marker;if(pt){var st=pt.angle,tt=pt.angleref;(st||tt==="north"||tt==="previous")&&(X=!0)}}if(this._hasMarkerAngles=X,W){var dt=M.getTopojsonName(F);(H.topojson===null||dt!==H.topojsonName)&&(H.topojsonName=dt,PlotlyGeoAssets.topojson[H.topojsonName]===void 0&&U.push(H.fetchTopojson()))}U=U.concat(C.fetchTraceGeoData(R)),N.push(new Promise(function(rt,at){Promise.all(U).then(function(){H.topojson=PlotlyGeoAssets.topojson[H.topojsonName],H.update(R,O),rt()}).catch(at)}))},h.fetchTopojson=function(){var R=this,O=M.getTopojsonPath(R.topojsonURL,R.topojsonName);return new Promise(function(N,V){c.json(O,function(H,F){if(H)return H.status===404?V(new Error(["plotly.js could not find topojson file at",O+".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):V(new Error(["unexpected error while fetching topojson file at",O].join(" ")));PlotlyGeoAssets.topojson[R.topojsonName]=F,N()})})},h.update=function(R,O,N){var V=O[this.id];this.hasChoropleth=!1;for(var H=0;H<R.length;H++){var F=R[H],U=F[0].trace;U.type==="choropleth"&&(this.hasChoropleth=!0),U.visible===!0&&U._length>0&&U._module.calcGeoJSON(F,O)}if(!N){var W=this.updateProjection(R,O);if(W)return;(!this.viewInitial||this.scope!==V.scope)&&this.saveViewInitial(V)}this.scope=V.scope,this.updateBaseLayers(O,V),this.updateDims(O,V),this.updateFx(O,V),s.generalUpdatePerTraceModule(this.graphDiv,this,R,V);var q=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=q.selectAll(".point"),this.dataPoints.text=q.selectAll("text"),this.dataPaths.line=q.selectAll(".js-line");var X=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=X.selectAll("path"),this._render()},h.updateProjection=function(R,O){var N=this.graphDiv,V=O[this.id],H=O._size,F=V.domain,U=V.projection,W=V.lonaxis,q=V.lataxis,X=W._ax,lt=q._ax,yt=this.projection=p(V),pt=[[H.l+H.w*F.x[0],H.t+H.h*(1-F.y[1])],[H.l+H.w*F.x[1],H.t+H.h*(1-F.y[0])]],st=V.center||{},tt=U.rotation||{},dt=W.range||[],rt=q.range||[];if(V.fitbounds){X._length=pt[1][0]-pt[0][0],lt._length=pt[1][1]-pt[0][1],X.range=x(N,X),lt.range=x(N,lt);var at=(X.range[0]+X.range[1])/2,vt=(lt.range[0]+lt.range[1])/2;if(V._isScoped)st={lon:at,lat:vt};else if(V._isClipped){st={lon:at,lat:vt},tt={lon:at,lat:vt,roll:tt.roll};var it=U.type,Y=_.lonaxisSpan[it]/2||180,ft=_.lataxisSpan[it]/2||90;dt=[at-Y,at+Y],rt=[vt-ft,vt+ft]}else st={lon:at,lat:vt},tt={lon:at,lat:tt.lat,roll:tt.roll}}yt.center([st.lon-tt.lon,st.lat-tt.lat]).rotate([-tt.lon,-tt.lat,tt.roll]).parallels(U.parallels);var ut=w(dt,rt);yt.fitExtent(pt,ut);var wt=this.bounds=yt.getBounds(ut),zt=this.fitScale=yt.scale(),Pt=yt.translate();if(V.fitbounds){var Wt=yt.getBounds(w(X.range,lt.range)),Ht=Math.min((wt[1][0]-wt[0][0])/(Wt[1][0]-Wt[0][0]),(wt[1][1]-wt[0][1])/(Wt[1][1]-Wt[0][1]));isFinite(Ht)?yt.scale(Ht*zt):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else yt.scale(U.scale*zt);var Jt=this.midPt=[(wt[0][0]+wt[1][0])/2,(wt[0][1]+wt[1][1])/2];if(yt.translate([Pt[0]+(Jt[0]-Pt[0]),Pt[1]+(Jt[1]-Pt[1])]).clipExtent(wt),V._isAlbersUsa){var ge=yt([st.lon,st.lat]),he=yt.translate();yt.translate([he[0]-(ge[0]-he[0]),he[1]-(ge[1]-he[1])])}},h.updateBaseLayers=function(R,O){var N=this,V=N.topojson,H=N.layers,F=N.basePaths;function U(pt){return pt==="lonaxis"||pt==="lataxis"}function W(pt){return!!_.lineLayers[pt]}function q(pt){return!!_.fillLayers[pt]}var X=this.hasChoropleth?_.layersForChoropleth:_.layers,lt=X.filter(function(pt){return W(pt)||q(pt)?O["show"+pt]:U(pt)?O[pt].showgrid:!0}),yt=N.framework.selectAll(".layer").data(lt,String);yt.exit().each(function(pt){delete H[pt],delete F[pt],c.select(this).remove()}),yt.enter().append("g").attr("class",function(pt){return"layer "+pt}).each(function(pt){var st=H[pt]=c.select(this);pt==="bg"?N.bgRect=st.append("rect").style("pointer-events","all"):U(pt)?F[pt]=st.append("path").style("fill","none"):pt==="backplot"?st.append("g").classed("choroplethlayer",!0):pt==="frontplot"?st.append("g").classed("scatterlayer",!0):W(pt)?F[pt]=st.append("path").style("fill","none").style("stroke-miterlimit",2):q(pt)&&(F[pt]=st.append("path").style("stroke","none"))}),yt.order(),yt.each(function(pt){var st=F[pt],tt=_.layerNameToAdjective[pt];pt==="frame"?st.datum(_.sphereSVG):W(pt)||q(pt)?st.datum(E(V,V.objects[pt])):U(pt)&&st.datum(k(pt,O,R)).call(n.stroke,O[pt].gridcolor).call(o.dashLine,O[pt].griddash,O[pt].gridwidth),W(pt)?st.call(n.stroke,O[tt+"color"]).call(o.dashLine,"",O[tt+"width"]):q(pt)&&st.call(n.fill,O[tt+"color"])})},h.updateDims=function(R,O){var N=this.bounds,V=(O.framewidth||0)/2,H=N[0][0]-V,F=N[0][1]-V,U=N[1][0]-H+V,W=N[1][1]-F+V;o.setRect(this.clipRect,H,F,U,W),this.bgRect.call(o.setRect,H,F,U,W).call(n.fill,O.bgcolor),this.xaxis._offset=H,this.xaxis._length=U,this.yaxis._offset=F,this.yaxis._length=W},h.updateFx=function(R,O){var N=this,V=N.graphDiv,H=N.bgRect,F=R.dragmode,U=R.clickmode;if(N.isStatic)return;function W(){var yt=N.viewInitial,pt={};for(var st in yt)pt[N.id+"."+st]=yt[st];e.call("_guiRelayout",V,pt),V.emit("plotly_doubleclick",null)}function q(yt){return N.projection.invert([yt[0]+N.xaxis._offset,yt[1]+N.yaxis._offset])}var X=function(yt,pt){if(pt.isRect){var st=yt.range={};st[N.id]=[q([pt.xmin,pt.ymin]),q([pt.xmax,pt.ymax])]}else{var tt=yt.lassoPoints={};tt[N.id]=pt.map(q)}},lt={element:N.bgRect.node(),gd:V,plotinfo:{id:N.id,xaxis:N.xaxis,yaxis:N.yaxis,fillRangeItems:X},xaxes:[N.xaxis],yaxes:[N.yaxis],subplot:N.id,clickFn:function(yt){yt===2&&T(V)}};F==="pan"?(H.node().onmousedown=null,H.call(b(N,O)),H.on("dblclick.zoom",W),V._context._scrollZoom.geo||H.on("wheel.zoom",null)):(F==="select"||F==="lasso")&&(H.on(".zoom",null),lt.prepFn=function(yt,pt,st){v(yt,pt,st,lt,F)},y.init(lt)),H.on("mousemove",function(){var yt=N.projection.invert(r.getPositionFromD3Event());if(!yt)return y.unhover(V,c.event);N.xaxis.p2c=function(){return yt[0]},N.yaxis.p2c=function(){return yt[1]},i.hover(V,c.event,N.id)}),H.on("mouseout",function(){V._dragging||y.unhover(V,c.event)}),H.on("click",function(){F!=="select"&&F!=="lasso"&&(U.indexOf("select")>-1&&u(c.event,V,[N.xaxis],[N.yaxis],N.id,lt),U.indexOf("event")>-1&&i.click(V,c.event))})},h.makeFramework=function(){var R=this,O=R.graphDiv,N=O._fullLayout,V="clip"+N._uid+R.id;R.clipDef=N._clips.append("clipPath").attr("id",V),R.clipRect=R.clipDef.append("rect"),R.framework=c.select(R.container).append("g").attr("class","geo "+R.id).call(o.setClipUrl,V,O),R.project=function(H){var F=R.projection(H);return F?[F[0]-R.xaxis._offset,F[1]-R.yaxis._offset]:[null,null]},R.xaxis={_id:"x",c2p:function(H){return R.project(H)[0]}},R.yaxis={_id:"y",c2p:function(H){return R.project(H)[1]}},R.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(R.mockAxis,N)},h.saveViewInitial=function(R){var O=R.center||{},N=R.projection,V=N.rotation||{};this.viewInitial={fitbounds:R.fitbounds,"projection.scale":N.scale};var H;R._isScoped?H={"center.lon":O.lon,"center.lat":O.lat}:R._isClipped?H={"projection.rotation.lon":V.lon,"projection.rotation.lat":V.lat}:H={"center.lon":O.lon,"center.lat":O.lat,"projection.rotation.lon":V.lon},r.extendFlat(this.viewInitial,H)},h.render=function(R){this._hasMarkerAngles&&R?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},h._render=function(){var R=this.projection,O=R.getPath(),N;function V(F){var U=R(F.lonlat);return U?a(U[0],U[1]):null}function H(F){return R.isLonLatOverEdges(F.lonlat)?"none":null}for(N in this.basePaths)this.basePaths[N].attr("d",O);for(N in this.dataPaths)this.dataPaths[N].attr("d",function(F){return O(F.geojson)});for(N in this.dataPoints)this.dataPoints[N].attr("display",H).attr("transform",V)};function p(R){var O=R.projection,N=O.type,V=_.projNames[N];V="geo"+r.titleCase(V);for(var H=g[V]||t[V],F=H(),U=R._isSatellite?Math.acos(1/O.distance)*180/Math.PI:R._isClipped?_.lonaxisSpan[N]/2:null,W=["center","rotate","parallels","clipExtent"],q=function(yt){return yt?F:[]},X=0;X<W.length;X++){var lt=W[X];typeof F[lt]!="function"&&(F[lt]=q)}return F.isLonLatOverEdges=function(yt){if(F(yt)===null)return!0;if(U){var pt=F.rotate(),st=S(yt,[-pt[0],-pt[1]]),tt=U*Math.PI/180;return st>tt}else return!1},F.getPath=function(){return P().projection(F)},F.getBounds=function(yt){return F.getPath().bounds(yt)},F.precision(_.precision),R._isSatellite&&F.tilt(O.tilt).distance(O.distance),U&&F.clipAngle(U-_.clipPad),F}function k(R,O,N){var V=1e-6,H=2.5,F=O[R],U=_.scopeDefaults[O.scope],W,q,X;R==="lonaxis"?(W=U.lonaxisRange,q=U.lataxisRange,X=function(vt,it){return[vt,it]}):R==="lataxis"&&(W=U.lataxisRange,q=U.lonaxisRange,X=function(vt,it){return[it,vt]});var lt={type:"linear",range:[W[0],W[1]-V],tick0:F.tick0,dtick:F.dtick};f.setConvert(lt,N);var yt=f.calcTicks(lt);!O.isScoped&&R==="lonaxis"&&yt.pop();for(var pt=yt.length,st=new Array(pt),tt=0;tt<pt;tt++)for(var dt=yt[tt].x,rt=st[tt]=[],at=q[0];at<q[1]+H;at+=H)rt.push(X(dt,at));return{type:"MultiLineString",coordinates:st}}function w(R,O){var N=_.clipPad,V=R[0]+N,H=R[1]-N,F=O[0]+N,U=O[1]-N;V>0&&H<0&&(H+=360);var W=(H-V)/4;return{type:"Polygon",coordinates:[[[V,F],[V,U],[V+W,U],[V+2*W,U],[V+3*W,U],[H,U],[H,F],[H-W,F],[H-2*W,F],[H-3*W,F],[V,F]]]}}}),xS=Ft((Q,$)=>{var c=bi(),g=Nh().attributes,P=Td().dash,S=v3(),t=Yc().overrideAll,e=G0(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:c.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:P},a=$.exports=t({domain:g({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:e(S.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:e(S.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:c.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:S.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:S.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:S.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:S.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:c.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:c.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:c.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:c.background},lonaxis:r,lataxis:r},"plot","from-root");a.uirevision={valType:"any",editType:"none"}}),LU=Ft((Q,$)=>{var c=bn(),g=P1(),P=ud().getSubplotData,S=v3(),t=xS(),e=S.axesNames;$.exports=function(a,n,o){g(a,n,o,{type:"geo",attributes:t,handleDefaults:r,fullData:o,partition:"y"})};function r(a,n,o,i){var s=P(i.fullData,"geo",i.id),f=s.map(function(rt){return rt.index}),x=o("resolution"),y=o("scope"),v=S.scopeDefaults[y],T=o("projection.type",v.projType),u=n._isAlbersUsa=T==="albers usa";u&&(y=n.scope="usa");var b=n._isScoped=y!=="world",_=n._isSatellite=T==="satellite",C=n._isConic=T.indexOf("conic")!==-1||T==="albers",M=n._isClipped=!!S.lonaxisSpan[T];if(a.visible===!1){var E=c.extendDeep({},n._template);E.showcoastlines=!1,E.showcountries=!1,E.showframe=!1,E.showlakes=!1,E.showland=!1,E.showocean=!1,E.showrivers=!1,E.showsubunits=!1,E.lonaxis&&(E.lonaxis.showgrid=!1),E.lataxis&&(E.lataxis.showgrid=!1),n._template=E}for(var A=o("visible"),h,p=0;p<e.length;p++){var k=e[p],w=[30,10][p],R;if(b)R=v[k+"Range"];else{var O=S[k+"Span"],N=(O[T]||O["*"])/2,V=o("projection.rotation."+k.substr(0,3),v.projRotate[p]);R=[V-N,V+N]}var H=o(k+".range",R);o(k+".tick0"),o(k+".dtick",w),h=o(k+".showgrid",A?void 0:!1),h&&(o(k+".gridcolor"),o(k+".gridwidth"),o(k+".griddash")),n[k]._ax={type:"linear",_id:k.slice(0,3),_traceIndices:f,setScale:c.identity,c2l:c.identity,r2l:c.identity,autorange:!0,range:H.slice(),_m:1,_input:{}}}var F=n.lonaxis.range,U=n.lataxis.range,W=F[0],q=F[1];W>0&&q<0&&(q+=360);var X=(W+q)/2,lt;if(!u){var yt=b?v.projRotate:[X,0,0];lt=o("projection.rotation.lon",yt[0]),o("projection.rotation.lat",yt[1]),o("projection.rotation.roll",yt[2]),h=o("showcoastlines",!b&&A),h&&(o("coastlinecolor"),o("coastlinewidth")),h=o("showocean",A?void 0:!1),h&&o("oceancolor")}var pt,st;if(u?(pt=-96.6,st=38.7):(pt=b?X:lt,st=(U[0]+U[1])/2),o("center.lon",pt),o("center.lat",st),_&&(o("projection.tilt"),o("projection.distance")),C){var tt=v.projParallels||[0,60];o("projection.parallels",tt)}o("projection.scale"),h=o("showland",A?void 0:!1),h&&o("landcolor"),h=o("showlakes",A?void 0:!1),h&&o("lakecolor"),h=o("showrivers",A?void 0:!1),h&&(o("rivercolor"),o("riverwidth")),h=o("showcountries",b&&y!=="usa"&&A),h&&(o("countrycolor"),o("countrywidth")),(y==="usa"||y==="north america"&&x===50)&&(o("showsubunits",A),o("subunitcolor"),o("subunitwidth")),b||(h=o("showframe",A),h&&(o("framecolor"),o("framewidth"))),o("bgcolor");var dt=o("fitbounds");dt&&(delete n.projection.scale,b?(delete n.center.lon,delete n.center.lat):M?(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))}}),_S=Ft((Q,$)=>{var c=ud().getSubplotCalcData,g=bn().counterRegex,P=CU(),S="geo",t=g(S),e={};e[S]={valType:"subplotid",dflt:S,editType:"calc"};function r(o){for(var i=o._fullLayout,s=o.calcdata,f=i._subplots[S],x=0;x<f.length;x++){var y=f[x],v=c(s,S,y),T=i[y],u=T._subplot;u||(u=P({id:y,graphDiv:o,container:i._geolayer.node(),topojsonURL:o._context.topojsonURL,staticPlot:o._context.staticPlot}),i[y]._subplot=u),u.plot(v,i,o._promises)}}function a(o,i,s,f){for(var x=f._subplots[S]||[],y=0;y<x.length;y++){var v=x[y],T=f[v]._subplot;!i[v]&&T&&(T.framework.remove(),T.clipDef.remove())}}function n(o){for(var i=o._fullLayout,s=i._subplots[S],f=0;f<s.length;f++){var x=i[s[f]],y=x._subplot;y.updateFx(i,x)}}$.exports={attr:S,name:S,idRoot:S,idRegex:t,attrRegex:t,attributes:e,layoutAttributes:xS(),supplyLayoutDefaults:LU(),plot:r,updateFx:n,clean:a}}),PU=Ft((Q,$)=>{$.exports={attributes:dx(),supplyDefaults:yU(),colorbar:xo(),formatLabels:xU(),calc:$k(),calcGeoJSON:vS().calcGeoJSON,plot:vS().plot,style:gS(),styleOnSelect:xl().styleOnSelect,hoverPoints:TU(),eventData:AU(),selectPoints:MU(),moduleType:"trace",name:"scattergeo",basePlotModule:_S(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}),zU=Ft((Q,$)=>{$.exports=PU()}),fb=Ft((Q,$)=>{var{hovertemplateAttrs:c,templatefallbackAttrs:g}=$u(),P=dx(),S=Tc(),t=$o(),e=bi().defaultLine,r=Ta().extendFlat,a=P.marker.line;$.exports=r({locations:{valType:"data_array",editType:"calc"},locationmode:P.locationmode,z:{valType:"data_array",editType:"calc"},geojson:r({},P.geojson,{}),featureidkey:P.featureidkey,text:r({},P.text,{}),hovertext:r({},P.hovertext,{}),marker:{line:{color:r({},a.color,{dflt:e}),width:r({},a.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:P.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:P.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:r({},t.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:c(),hovertemplatefallback:g(),showlegend:r({},t.showlegend,{dflt:!1})},S("",{cLetter:"z",editTypeOverride:"calc"}))}),IU=Ft((Q,$)=>{var c=bn(),g=mc(),P=fb(),S=["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(" ");$.exports=function(t,e,r,a){function n(v,T){return c.coerce(t,e,P,v,T)}var o=n("locations"),i=n("z");if(!(o&&o.length&&c.isArrayOrTypedArray(i)&&i.length)){e.visible=!1;return}e._length=Math.min(o.length,i.length);var s=n("geojson"),f;(typeof s=="string"&&s!==""||c.isPlainObject(s))&&(f="geojson-id");var x=n("locationmode",f);x==="country names"&&c.warn(S),x==="geojson-id"&&n("featureidkey"),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback");var y=n("marker.line.width");y&&n("marker.line.color"),n("marker.opacity"),g(t,e,a,n,{prefix:"",cLetter:"z"}),c.coerceSelectionMarkerOpacity(e,n)}}),Xk=Ft((Q,$)=>{var c=ra(),g=Da().BADNUM,P=Jd(),S=ct(),t=Bt();function e(r){return r&&typeof r=="string"}$.exports=function(r,a){var n=a._length,o=new Array(n),i;a.geojson?i=function(v){return e(v)||c(v)}:i=e;for(var s=0;s<n;s++){var f=o[s]={},x=a.locations[s],y=a.z[s];i(x)&&c(y)?(f.loc=x,f.z=y):(f.loc=null,f.z=g),f.index=s}return S(o,a),P(r,a,{vals:a.z,containerStr:"",cLetter:"z"}),t(o,a),o}}),Jk=Ft((Q,$)=>{var c=un(),g=li(),P=js(),S=Xc();function t(a,n){n&&e(a,n)}function e(a,n){var o=n[0].trace,i=n[0].node3,s=i.selectAll(".choroplethlocation"),f=o.marker||{},x=f.line||{},y=S.makeColorScaleFuncFromTrace(o);s.each(function(v){c.select(this).attr("fill",y(v.z)).call(g.stroke,v.mlc||x.color).call(P.dashLine,"",v.mlw||x.width||0).style("opacity",f.opacity)}),P.selectedPointStyle(s,o)}function r(a,n){var o=n[0].node3,i=n[0].trace;i.selectedpoints?P.selectedPointStyle(o.selectAll(".choroplethlocation"),i):e(a,n)}$.exports={style:t,styleOnSelect:r}}),bS=Ft((Q,$)=>{var c=un(),g=bn(),P=V1(),S=Gk().getTopojsonFeatures,t=Y0().findExtremes,e=Jk().style;function r(n,o,i){var s=o.layers.backplot.select(".choroplethlayer");g.makeTraceGroups(s,i,"trace choropleth").each(function(f){var x=c.select(this),y=x.selectAll("path.choroplethlocation").data(g.identity);y.enter().append("path").classed("choroplethlocation",!0),y.exit().remove(),e(n,f)})}function a(n,o){for(var i=n[0].trace,s=o[i.geo],f=s._subplot,x=i.locationmode,y=i._length,v=x==="geojson-id"?P.extractTraceFeature(n):S(i,f.topojson),T=[],u=[],b=0;b<y;b++){var _=n[b],C=x==="geojson-id"?_.fOut:P.locationToFeature(x,_.loc,v);if(C){_.geojson=C,_.ct=C.properties.ct,_._polygons=P.feature2polygons(C);var M=P.computeBbox(C);T.push(M[0],M[2]),u.push(M[1],M[3])}else _.geojson=null}if(s.fitbounds==="geojson"&&x==="geojson-id"){var E=P.computeBbox(P.getTraceGeojson(i));T=[E[0],E[2]],u=[E[1],E[3]]}var A={padded:!0};i._extremes.lon=t(s.lonaxis._ax,T,A),i._extremes.lat=t(s.lataxis._ax,u,A)}$.exports={calcGeoJSON:a,plot:r}}),Qk=Ft((Q,$)=>{var c=Es(),g=fb(),P=bn().fillText;$.exports=function(t,e,r){var a=t.cd,n=a[0].trace,o=t.subplot,i,s,f,x,y=[e,r],v=[e+360,r];for(s=0;s<a.length;s++)if(i=a[s],x=!1,i._polygons){for(f=0;f<i._polygons.length;f++)i._polygons[f].contains(y)&&(x=!x),i._polygons[f].contains(v)&&(x=!x);if(x)break}if(!(!x||!i))return t.x0=t.x1=t.xa.c2p(i.ct),t.y0=t.y1=t.ya.c2p(i.ct),t.index=i.index,t.location=i.loc,t.z=i.z,t.zLabel=c.tickText(o.mockAxis,o.mockAxis.c2l(i.z),"hover").text,t.hovertemplate=i.hovertemplate,S(t,n,i),[t]};function S(t,e,r){if(!e.hovertemplate){var a=r.hi||e.hoverinfo,n=String(r.loc),o=a==="all"?g.hoverinfo.flags:a.split("+"),i=o.indexOf("name")!==-1,s=o.indexOf("location")!==-1,f=o.indexOf("z")!==-1,x=o.indexOf("text")!==-1,y=!i&&s,v=[];y?t.nameOverride=n:(i&&(t.nameOverride=e.name),s&&v.push(n)),f&&v.push(t.zLabel),x&&P(r,e,v),t.extraText=v.join("<br>")}}}),tT=Ft((Q,$)=>{$.exports=function(c,g,P,S,t){c.location=g.location,c.z=g.z;var e=S[t];return e.fIn&&e.fIn.properties&&(c.properties=e.fIn.properties),c.ct=e.ct,c}}),eT=Ft((Q,$)=>{$.exports=function(c,g){var P=c.cd,S=c.xaxis,t=c.yaxis,e=[],r,a,n,o,i;if(g===!1)for(r=0;r<P.length;r++)P[r].selected=0;else for(r=0;r<P.length;r++)a=P[r],n=a.ct,n&&(o=S.c2p(n),i=t.c2p(n),g.contains([o,i],null,r,c)?(e.push({pointNumber:r,lon:n[0],lat:n[1]}),a.selected=1):a.selected=0);return e}}),OU=Ft((Q,$)=>{$.exports={attributes:fb(),supplyDefaults:IU(),colorbar:L1(),calc:Xk(),calcGeoJSON:bS().calcGeoJSON,plot:bS().plot,style:Jk().style,styleOnSelect:Jk().styleOnSelect,hoverPoints:Qk(),eventData:tT(),selectPoints:eT(),moduleType:"trace",name:"choropleth",basePlotModule:_S(),categories:["geo","noOpacity","showLegend"],meta:{}}}),DU=Ft((Q,$)=>{$.exports=OU()}),rT=Ft((Q,$)=>{var c=Xo(),g=bn(),P=Du();function S(e,r,a,n){var o=e.cd,i=o[0].t,s=o[0].trace,f=e.xa,x=e.ya,y=i.x,v=i.y,T=f.c2p(r),u=x.c2p(a),b=e.distance,_;if(i.tree){var C=f.p2c(T-b),M=f.p2c(T+b),E=x.p2c(u-b),A=x.p2c(u+b);n==="x"?_=i.tree.range(Math.min(C,M),Math.min(x._rl[0],x._rl[1]),Math.max(C,M),Math.max(x._rl[0],x._rl[1])):_=i.tree.range(Math.min(C,M),Math.min(E,A),Math.max(C,M),Math.max(E,A))}else _=i.ids;var h,p,k,w,R,O,N,V,H,F=b;if(n==="x"){var U=!!s.xperiodalignment,W=!!s.yperiodalignment;for(R=0;R<_.length;R++){if(h=_[R],k=y[h],O=Math.abs(f.c2p(k)-T),U){var q=f.c2p(s._xStarts[h]),X=f.c2p(s._xEnds[h]);O=T>=Math.min(q,X)&&T<=Math.max(q,X)?0:1/0}if(O<F){if(F=O,w=v[h],N=x.c2p(w)-u,W){var lt=x.c2p(s._yStarts[h]),yt=x.c2p(s._yEnds[h]);N=u>=Math.min(lt,yt)&&u<=Math.max(lt,yt)?0:1/0}H=Math.sqrt(O*O+N*N),p=_[R]}}}else for(R=_.length-1;R>-1;R--)h=_[R],k=y[h],w=v[h],O=f.c2p(k)-T,N=x.c2p(w)-u,V=Math.sqrt(O*O+N*N),V<F&&(F=H=V,p=h);return e.index=p,e.distance=F,e.dxy=H,p===void 0?[e]:[t(e,y,v,s)]}function t(e,r,a,n){var o=e.xa,i=e.ya,s=e.distance,f=e.dxy,x=e.index,y={pointNumber:x,x:r[x],y:a[x]};y.tx=g.isArrayOrTypedArray(n.text)?n.text[x]:n.text,y.htx=Array.isArray(n.hovertext)?n.hovertext[x]:n.hovertext,y.data=Array.isArray(n.customdata)?n.customdata[x]:n.customdata,y.tp=Array.isArray(n.textposition)?n.textposition[x]:n.textposition;var v=n.textfont;v&&(y.ts=g.isArrayOrTypedArray(v.size)?v.size[x]:v.size,y.tc=g.isArrayOrTypedArray(v.color)?v.color[x]:v.color,y.tf=Array.isArray(v.family)?v.family[x]:v.family,y.tw=Array.isArray(v.weight)?v.weight[x]:v.weight,y.ty=Array.isArray(v.style)?v.style[x]:v.style,y.tv=Array.isArray(v.variant)?v.variant[x]:v.variant);var T=n.marker;T&&(y.ms=g.isArrayOrTypedArray(T.size)?T.size[x]:T.size,y.mo=g.isArrayOrTypedArray(T.opacity)?T.opacity[x]:T.opacity,y.mx=g.isArrayOrTypedArray(T.symbol)?T.symbol[x]:T.symbol,y.ma=g.isArrayOrTypedArray(T.angle)?T.angle[x]:T.angle,y.mc=g.isArrayOrTypedArray(T.color)?T.color[x]:T.color);var u=T&&T.line;u&&(y.mlc=Array.isArray(u.color)?u.color[x]:u.color,y.mlw=g.isArrayOrTypedArray(u.width)?u.width[x]:u.width);var b=T&&T.gradient;b&&b.type!=="none"&&(y.mgt=Array.isArray(b.type)?b.type[x]:b.type,y.mgc=Array.isArray(b.color)?b.color[x]:b.color);var _=o.c2p(y.x,!0),C=i.c2p(y.y,!0),M=y.mrc||1,E=n.hoverlabel;E&&(y.hbg=Array.isArray(E.bgcolor)?E.bgcolor[x]:E.bgcolor,y.hbc=Array.isArray(E.bordercolor)?E.bordercolor[x]:E.bordercolor,y.hts=g.isArrayOrTypedArray(E.font.size)?E.font.size[x]:E.font.size,y.htc=Array.isArray(E.font.color)?E.font.color[x]:E.font.color,y.htf=Array.isArray(E.font.family)?E.font.family[x]:E.font.family,y.hnl=g.isArrayOrTypedArray(E.namelength)?E.namelength[x]:E.namelength);var A=n.hoverinfo;A&&(y.hi=Array.isArray(A)?A[x]:A);var h=n.hovertemplate;h&&(y.ht=Array.isArray(h)?h[x]:h);var p={};p[e.index]=y;var k=n._origX,w=n._origY,R=g.extendFlat({},e,{color:P(n,y),x0:_-M,x1:_+M,xLabelVal:k?k[x]:y.x,y0:C-M,y1:C+M,yLabelVal:w?w[x]:y.y,cd:p,distance:s,spikeDistance:f,hovertemplate:y.ht});return y.htx?R.text=y.htx:y.tx?R.text=y.tx:n.text&&(R.text=n.text),g.fillText(y,n,R),c.getComponentMethod("errorbars","hoverInfo")(y,n,R),R}$.exports={hoverPoints:S,calcHover:t}}),H1=Ft((Q,$)=>{var c=20;$.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:c,SYMBOL_STROKE:c/20,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}}),x3=Ft((Q,$)=>{var c=$o(),g=Ea(),P=z0(),S=tf(),t=fh().axisHoverFormat,e=Tc(),r=G0(),a=Ta().extendFlat,n=Yc().overrideAll,o=H1().DASHES,i=S.line,s=S.marker,f=s.line,x=$.exports=n({x:S.x,x0:S.x0,dx:S.dx,y:S.y,y0:S.y0,dy:S.dy,xperiod:S.xperiod,yperiod:S.yperiod,xperiod0:S.xperiod0,yperiod0:S.yperiod0,xperiodalignment:S.xperiodalignment,yperiodalignment:S.yperiodalignment,xhoverformat:t("x"),yhoverformat:t("y"),text:S.text,hovertext:S.hovertext,textposition:S.textposition,textfont:g({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:i.color,width:i.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:r(o),dflt:"solid"}},marker:a({},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:a({},e("marker.line"),{width:f.width})}),connectgaps:S.connectgaps,fill:a({},S.fill,{dflt:"none"}),fillcolor:P(),selected:{marker:S.selected.marker,textfont:S.selected.textfont},unselected:{marker:S.unselected.marker,textfont:S.unselected.textfont},opacity:c.opacity},"calc","nested");x.x.editType=x.y.editType=x.x0.editType=x.y0.editType="calc+clearAxisTypes",x.hovertemplate=S.hovertemplate,x.hovertemplatefallback=S.hovertemplatefallback,x.texttemplate=S.texttemplate,x.texttemplatefallback=S.texttemplatefallback}),nT=Ft(Q=>{var $=H1();Q.isOpenSymbol=function(c){return typeof c=="string"?$.OPEN_RE.test(c):c%200>100},Q.isDotSymbol=function(c){return typeof c=="string"?$.DOT_RE.test(c):c>200}}),FU=Ft((Q,$)=>{var c=bn(),g=Xo(),P=nT(),S=x3(),t=vm(),e=Ac(),r=Nm(),a=Fp(),n=s0(),o=I0(),i=O0(),s=x0();$.exports=function(f,x,y,v){function T(h,p){return c.coerce(f,x,S,h,p)}var u=f.marker?P.isOpenSymbol(f.marker.symbol):!1,b=e.isBubble(f),_=r(f,x,v,T);if(!_){x.visible=!1;return}a(f,x,v,T),T("xhoverformat"),T("yhoverformat");var C=_<t.PTS_LINESONLY?"lines+markers":"lines";T("text"),T("hovertext"),T("hovertemplate"),T("hovertemplatefallback"),T("mode",C),e.hasMarkers(x)&&(n(f,x,y,v,T,{noAngleRef:!0,noStandOff:!0}),T("marker.line.width",u||b?1:0)),e.hasLines(x)&&(T("connectgaps"),o(f,x,y,v,T),T("line.shape")),e.hasText(x)&&(T("texttemplate"),T("texttemplatefallback"),s(f,x,v,T,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var M=(x.line||{}).color,E=(x.marker||{}).color;T("fill"),x.fill!=="none"&&i(f,x,y,T);var A=g.getComponentMethod("errorbars","supplyDefaults");A(f,x,M||E||y,{axis:"y"}),A(f,x,M||E||y,{axis:"x",inherit:"y"}),c.coerceSelectionMarkerOpacity(x,T)}}),RU=Ft((Q,$)=>{var c=Vs();$.exports=function(g,P,S){var t=g.i;return"x"in g||(g.x=P._x[t]),"y"in g||(g.y=P._y[t]),c(g,P,S)}}),BU=Ft((Q,$)=>{function c(r,a,n,o,i){for(var s=i+1;o<=i;){var f=o+i>>>1,x=r[f],y=n!==void 0?n(x,a):x-a;y>=0?(s=f,i=f-1):o=f+1}return s}function g(r,a,n,o,i){for(var s=i+1;o<=i;){var f=o+i>>>1,x=r[f],y=n!==void 0?n(x,a):x-a;y>0?(s=f,i=f-1):o=f+1}return s}function P(r,a,n,o,i){for(var s=o-1;o<=i;){var f=o+i>>>1,x=r[f],y=n!==void 0?n(x,a):x-a;y<0?(s=f,o=f+1):i=f-1}return s}function S(r,a,n,o,i){for(var s=o-1;o<=i;){var f=o+i>>>1,x=r[f],y=n!==void 0?n(x,a):x-a;y<=0?(s=f,o=f+1):i=f-1}return s}function t(r,a,n,o,i){for(;o<=i;){var s=o+i>>>1,f=r[s],x=n!==void 0?n(f,a):f-a;if(x===0)return s;x<=0?o=s+1:i=s-1}return-1}function e(r,a,n,o,i,s){return typeof n=="function"?s(r,a,n,o===void 0?0:o|0,i===void 0?r.length-1:i|0):s(r,a,void 0,n===void 0?0:n|0,o===void 0?r.length-1:o|0)}$.exports={ge:function(r,a,n,o,i){return e(r,a,n,o,i,c)},gt:function(r,a,n,o,i){return e(r,a,n,o,i,g)},lt:function(r,a,n,o,i){return e(r,a,n,o,i,P)},le:function(r,a,n,o,i){return e(r,a,n,o,i,S)},eq:function(r,a,n,o,i){return e(r,a,n,o,i,t)}}}),Cg=Ft((Q,$)=>{$.exports=function(P,S,t){var e={},r,a;if(typeof S=="string"&&(S=g(S)),Array.isArray(S)){var n={};for(a=0;a<S.length;a++)n[S[a]]=!0;S=n}for(r in S)S[r]=g(S[r]);var o={};for(r in S){var i=S[r];if(Array.isArray(i))for(a=0;a<i.length;a++){var s=i[a];if(t&&(o[s]=!0),s in P){if(e[r]=P[s],t)for(var f=a;f<i.length;f++)o[i[f]]=!0;break}}else r in P&&(S[r]&&(e[r]=P[r]),t&&(o[r]=!0))}if(t)for(r in P)o[r]||(e[r]=P[r]);return e};var c={};function g(P){return c[P]?c[P]:(typeof P=="string"&&(P=c[P]=P.split(/\s*,\s*|\s+/)),P)}}),db=Ft((Q,$)=>{var c=Cg();$.exports=g;function g(P){var S;return arguments.length>1&&(P=arguments),typeof P=="string"?P=P.split(/\s/).map(parseFloat):typeof P=="number"&&(P=[P]),P.length&&typeof P[0]=="number"?P.length===1?S={width:P[0],height:P[0],x:0,y:0}:P.length===2?S={width:P[0],height:P[1],x:0,y:0}:S={x:P[0],y:P[1],width:P[2]-P[0]||0,height:P[3]-P[1]||0}:P&&(P=c(P,{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"}),S={x:P.left||0,y:P.top||0},P.width==null?P.right?S.width=P.right-S.x:S.width=0:S.width=P.width,P.height==null?P.bottom?S.height=P.bottom-S.y:S.height=0:S.height=P.height),S}}),px=Ft((Q,$)=>{$.exports=c;function c(g,P){if(!g||g.length==null)throw Error("Argument should be an array");P==null?P=1:P=Math.floor(P);for(var S=Array(P*2),t=0;t<P;t++){for(var e=-1/0,r=1/0,a=t,n=g.length;a<n;a+=P)g[a]>e&&(e=g[a]),g[a]<r&&(r=g[a]);S[t]=r,S[P+t]=e}return S}}),NU=Ft((Q,$)=>{$.exports=function(){for(var c=0;c<arguments.length;c++)if(arguments[c]!==void 0)return arguments[c]}}),mx=Ft((Q,$)=>{var c=Vk();$.exports=g;function g(P,S,t){if(!P)throw new TypeError("must specify data as first parameter");if(t=+(t||0)|0,Array.isArray(P)&&P[0]&&typeof P[0][0]=="number"){var e=P[0].length,r=P.length*e,a,n,o,i;(!S||typeof S=="string")&&(S=new(c(S||"float32"))(r+t));var s=S.length-t;if(r!==s)throw new Error("source length "+r+" ("+e+"x"+P.length+") does not match destination length "+s);for(a=0,o=t;a<P.length;a++)for(n=0;n<e;n++)S[o++]=P[a][n]===null?NaN:P[a][n]}else if(!S||typeof S=="string"){var f=c(S||"float32");if(Array.isArray(P)||S==="array")for(S=new f(P.length+t),a=0,o=t,i=S.length;o<i;o++,a++)S[o]=P[a]===null?NaN:P[a];else t===0?S=new f(P):(S=new f(P.length+t),S.set(P,t))}else S.set(P,t);return S}}),jU=Ft((Q,$)=>{$.exports=function(c){var g=typeof c;return c!==null&&(g==="object"||g==="function")}}),UU=Ft((Q,$)=>{$.exports=Math.log2||function(c){return Math.log(c)*Math.LOG2E}}),VU=Ft((Q,$)=>{var c=BU(),g=m3(),P=db(),S=px(),t=Cg(),e=NU(),r=mx(),a=jU(),n=Vk(),o=UU(),i=1073741824;$.exports=function(f,x){x||(x={}),f=r(f,"float64"),x=t(x,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let y=e(x.maxDepth,255),v=e(x.bounds,S(f,2));v[0]===v[2]&&v[2]++,v[1]===v[3]&&v[3]++;let T=s(f,v),u=f.length>>>1,b;x.dtype||(x.dtype="array"),typeof x.dtype=="string"?b=new(n(x.dtype))(u):x.dtype&&(b=x.dtype,Array.isArray(b)&&(b.length=u));for(let R=0;R<u;++R)b[R]=R;let _=[],C=[],M=[],E=[];h(0,0,1,b,0,1);let A=0;for(let R=0;R<_.length;R++){let O=_[R];if(b.set)b.set(O,A);else for(let V=0,H=O.length;V<H;V++)b[V+A]=O[V];let N=A+_[R].length;E[R]=[A,N],A=N}return b.range=p,b;function h(R,O,N,V,H,F){if(!V.length)return null;let U=_[H]||(_[H]=[]),W=M[H]||(M[H]=[]),q=C[H]||(C[H]=[]),X=U.length;if(H++,H>y||F>i){for(let at=0;at<V.length;at++)U.push(V[at]),W.push(F),q.push(null,null,null,null);return X}if(U.push(V[0]),W.push(F),V.length<=1)return q.push(null,null,null,null),X;let lt=N*.5,yt=R+lt,pt=O+lt,st=[],tt=[],dt=[],rt=[];for(let at=1,vt=V.length;at<vt;at++){let it=V[at],Y=T[it*2],ft=T[it*2+1];Y<yt?ft<pt?st.push(it):tt.push(it):ft<pt?dt.push(it):rt.push(it)}return F<<=2,q.push(h(R,O,lt,st,H,F),h(R,pt,lt,tt,H,F+1),h(yt,O,lt,dt,H,F+2),h(yt,pt,lt,rt,H,F+3)),X}function p(...R){let O;if(a(R[R.length-1])){let dt=R.pop();!R.length&&(dt.x!=null||dt.l!=null||dt.left!=null)&&(R=[dt],O={}),O=t(dt,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else O={};R.length||(R=v);let N=P(...R),[V,H,F,U]=[Math.min(N.x,N.x+N.width),Math.min(N.y,N.y+N.height),Math.max(N.x,N.x+N.width),Math.max(N.y,N.y+N.height)],[W,q,X,lt]=s([V,H,F,U],v),yt=e(O.level,_.length);if(O.d!=null){let dt;typeof O.d=="number"?dt=[O.d,O.d]:O.d.length&&(dt=O.d),yt=Math.min(Math.max(Math.ceil(-o(Math.abs(dt[0])/(v[2]-v[0]))),Math.ceil(-o(Math.abs(dt[1])/(v[3]-v[1])))),yt)}if(yt=Math.min(yt,_.length),O.lod)return k(W,q,X,lt,yt);let pt=[];st(0,0,1,0,0,1);function st(dt,rt,at,vt,it,Y){if(it===null||Y===null)return;let ft=dt+at,ut=rt+at;if(W>ft||q>ut||X<dt||lt<rt||vt>=yt||it===Y)return;let wt=_[vt];Y===void 0&&(Y=wt.length);for(let se=it;se<Y;se++){let Tt=wt[se],Lt=f[Tt*2],Mt=f[Tt*2+1];Lt>=V&&Lt<=F&&Mt>=H&&Mt<=U&&pt.push(Tt)}let zt=C[vt],Pt=zt[it*4+0],Wt=zt[it*4+1],Ht=zt[it*4+2],Jt=zt[it*4+3],ge=tt(zt,it+1),he=at*.5,de=vt+1;st(dt,rt,he,de,Pt,Wt||Ht||Jt||ge),st(dt,rt+he,he,de,Wt,Ht||Jt||ge),st(dt+he,rt,he,de,Ht,Jt||ge),st(dt+he,rt+he,he,de,Jt,ge)}function tt(dt,rt){let at=null,vt=0;for(;at===null;)if(at=dt[rt*4+vt],vt++,vt>dt.length)return null;return at}return pt}function k(R,O,N,V,H){let F=[];for(let U=0;U<H;U++){let W=M[U],q=E[U][0],X=w(R,O,U),lt=w(N,V,U),yt=c.ge(W,X),pt=c.gt(W,lt,yt,W.length-1);F[U]=[yt+q,pt+q]}return F}function w(R,O,N){let V=1,H=.5,F=.5,U=.5;for(let W=0;W<N;W++)V<<=2,V+=R<H?O<F?0:1:O<F?2:3,U*=.5,H+=R<H?-U:U,F+=O<F?-U:U;return V}};function s(f,x){let[y,v,T,u]=x,b=1/(T-y),_=1/(u-v),C=new Array(f.length);for(let M=0,E=f.length/2;M<E;M++)C[2*M]=g((f[2*M]-y)*b,0,1),C[2*M+1]=g((f[2*M+1]-v)*_,0,1);return C}}),iT=Ft((Q,$)=>{$.exports=VU()}),wS=Ft((Q,$)=>{$.exports=c;function c(g){var P=0,S=0,t=0,e=0;return g.map(function(r){r=r.slice();var a=r[0],n=a.toUpperCase();if(a!=n)switch(r[0]=n,a){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=P,e=S;break;case"H":t=r[1];break;case"V":e=r[1];break;case"M":t=P=r[1],e=S=r[2];break;default:t=r[r.length-2],e=r[r.length-1]}return r})}}),HU=Ft((Q,$)=>{Object.defineProperty(Q,"__esModule",{value:!0});var c=function(){function a(n,o){var i=[],s=!0,f=!1,x=void 0;try{for(var y=n[Symbol.iterator](),v;!(s=(v=y.next()).done)&&(i.push(v.value),!(o&&i.length===o));s=!0);}catch(T){f=!0,x=T}finally{try{!s&&y.return&&y.return()}finally{if(f)throw x}}return i}return function(n,o){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return a(n,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=Math.PI*2,P=function(a,n,o,i,s,f,x){var y=a.x,v=a.y;y*=n,v*=o;var T=i*y-s*v,u=s*y+i*v;return{x:T+f,y:u+x}},S=function(a,n){var o=n===1.5707963267948966?.551915024494:n===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(n/4),i=Math.cos(a),s=Math.sin(a),f=Math.cos(a+n),x=Math.sin(a+n);return[{x:i-s*o,y:s+i*o},{x:f+x*o,y:x-f*o},{x:f,y:x}]},t=function(a,n,o,i){var s=a*i-n*o<0?-1:1,f=a*o+n*i;return f>1&&(f=1),f<-1&&(f=-1),s*Math.acos(f)},e=function(a,n,o,i,s,f,x,y,v,T,u,b){var _=Math.pow(s,2),C=Math.pow(f,2),M=Math.pow(u,2),E=Math.pow(b,2),A=_*C-_*E-C*M;A<0&&(A=0),A/=_*E+C*M,A=Math.sqrt(A)*(x===y?-1:1);var h=A*s/f*b,p=A*-f/s*u,k=T*h-v*p+(a+o)/2,w=v*h+T*p+(n+i)/2,R=(u-h)/s,O=(b-p)/f,N=(-u-h)/s,V=(-b-p)/f,H=t(1,0,R,O),F=t(R,O,N,V);return y===0&&F>0&&(F-=g),y===1&&F<0&&(F+=g),[k,w,H,F]},r=function(a){var n=a.px,o=a.py,i=a.cx,s=a.cy,f=a.rx,x=a.ry,y=a.xAxisRotation,v=y===void 0?0:y,T=a.largeArcFlag,u=T===void 0?0:T,b=a.sweepFlag,_=b===void 0?0:b,C=[];if(f===0||x===0)return[];var M=Math.sin(v*g/360),E=Math.cos(v*g/360),A=E*(n-i)/2+M*(o-s)/2,h=-M*(n-i)/2+E*(o-s)/2;if(A===0&&h===0)return[];f=Math.abs(f),x=Math.abs(x);var p=Math.pow(A,2)/Math.pow(f,2)+Math.pow(h,2)/Math.pow(x,2);p>1&&(f*=Math.sqrt(p),x*=Math.sqrt(p));var k=e(n,o,i,s,f,x,u,_,M,E,A,h),w=c(k,4),R=w[0],O=w[1],N=w[2],V=w[3],H=Math.abs(V)/(g/4);Math.abs(1-H)<1e-7&&(H=1);var F=Math.max(Math.ceil(H),1);V/=F;for(var U=0;U<F;U++)C.push(S(N,V)),N+=V;return C.map(function(W){var q=P(W[0],f,x,E,M,R,O),X=q.x,lt=q.y,yt=P(W[1],f,x,E,M,R,O),pt=yt.x,st=yt.y,tt=P(W[2],f,x,E,M,R,O),dt=tt.x,rt=tt.y;return{x1:X,y1:lt,x2:pt,y2:st,x:dt,y:rt}})};Q.default=r,$.exports=Q.default}),WU=Ft((Q,$)=>{$.exports=g;var c=HU();function g(t){for(var e,r=[],a=0,n=0,o=0,i=0,s=null,f=null,x=0,y=0,v=0,T=t.length;v<T;v++){var u=t[v],b=u[0];switch(b){case"M":o=u[1],i=u[2];break;case"A":var _=c({px:x,py:y,cx:u[6],cy:u[7],rx:u[1],ry:u[2],xAxisRotation:u[3],largeArcFlag:u[4],sweepFlag:u[5]});if(!_.length)continue;for(var C=0,M;C<_.length;C++)M=_[C],u=["C",M.x1,M.y1,M.x2,M.y2,M.x,M.y],C<_.length-1&&r.push(u);break;case"S":var E=x,A=y;(e=="C"||e=="S")&&(E+=E-a,A+=A-n),u=["C",E,A,u[1],u[2],u[3],u[4]];break;case"T":e=="Q"||e=="T"?(s=x*2-s,f=y*2-f):(s=x,f=y),u=S(x,y,s,f,u[1],u[2]);break;case"Q":s=u[1],f=u[2],u=S(x,y,u[1],u[2],u[3],u[4]);break;case"L":u=P(x,y,u[1],u[2]);break;case"H":u=P(x,y,u[1],y);break;case"V":u=P(x,y,x,u[1]);break;case"Z":u=P(x,y,o,i);break}e=b,x=u[u.length-2],y=u[u.length-1],u.length>4?(a=u[u.length-4],n=u[u.length-3]):(a=x,n=y),r.push(u)}return r}function P(t,e,r,a){return["C",t,e,r,a,r,a]}function S(t,e,r,a,n,o){return["C",t/3+2/3*r,e/3+2/3*a,n/3+2/3*r,o/3+2/3*a,n,o]}}),kS=Ft((Q,$)=>{$.exports=function(c){return typeof c!="string"?!1:(c=c.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(c)&&/[\dz]$/i.test(c)&&c.length>4))}}),qU=Ft((Q,$)=>{var c=A1(),g=wS(),P=WU(),S=kS(),t=Yw();$.exports=e;function e(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(t(S(r),"String is not an SVG path."),r=c(r)),t(Array.isArray(r),"Argument should be a string or an array of path segments."),r=g(r),r=P(r),!r.length)return[0,0,0,0];for(var a=[1/0,1/0,-1/0,-1/0],n=0,o=r.length;n<o;n++)for(var i=r[n].slice(1),s=0;s<i.length;s+=2)i[s+0]<a[0]&&(a[0]=i[s+0]),i[s+1]<a[1]&&(a[1]=i[s+1]),i[s+0]>a[2]&&(a[2]=i[s+0]),i[s+1]>a[3]&&(a[3]=i[s+1]);return a}}),ZU=Ft((Q,$)=>{var c=Math.PI,g=a(120);$.exports=P;function P(n){for(var o,i=[],s=0,f=0,x=0,y=0,v=null,T=null,u=0,b=0,_=0,C=n.length;_<C;_++){var M=n[_],E=M[0];switch(E){case"M":x=M[1],y=M[2];break;case"A":M=e(u,b,M[1],M[2],a(M[3]),M[4],M[5],M[6],M[7]),M.unshift("C"),M.length>7&&(i.push(M.splice(0,7)),M.unshift("C"));break;case"S":var A=u,h=b;(o=="C"||o=="S")&&(A+=A-s,h+=h-f),M=["C",A,h,M[1],M[2],M[3],M[4]];break;case"T":o=="Q"||o=="T"?(v=u*2-v,T=b*2-T):(v=u,T=b),M=t(u,b,v,T,M[1],M[2]);break;case"Q":v=M[1],T=M[2],M=t(u,b,M[1],M[2],M[3],M[4]);break;case"L":M=S(u,b,M[1],M[2]);break;case"H":M=S(u,b,M[1],b);break;case"V":M=S(u,b,u,M[1]);break;case"Z":M=S(u,b,x,y);break}o=E,u=M[M.length-2],b=M[M.length-1],M.length>4?(s=M[M.length-4],f=M[M.length-3]):(s=u,f=b),i.push(M)}return i}function S(n,o,i,s){return["C",n,o,i,s,i,s]}function t(n,o,i,s,f,x){return["C",n/3+2/3*i,o/3+2/3*s,f/3+2/3*i,x/3+2/3*s,f,x]}function e(n,o,i,s,f,x,y,v,T,u){if(u)w=u[0],R=u[1],p=u[2],k=u[3];else{var b=r(n,o,-f);n=b.x,o=b.y,b=r(v,T,-f),v=b.x,T=b.y;var _=(n-v)/2,C=(o-T)/2,M=_*_/(i*i)+C*C/(s*s);M>1&&(M=Math.sqrt(M),i=M*i,s=M*s);var E=i*i,A=s*s,h=(x==y?-1:1)*Math.sqrt(Math.abs((E*A-E*C*C-A*_*_)/(E*C*C+A*_*_)));h==1/0&&(h=1);var p=h*i*C/s+(n+v)/2,k=h*-s*_/i+(o+T)/2,w=Math.asin(((o-k)/s).toFixed(9)),R=Math.asin(((T-k)/s).toFixed(9));w=n<p?c-w:w,R=v<p?c-R:R,w<0&&(w=c*2+w),R<0&&(R=c*2+R),y&&w>R&&(w=w-c*2),!y&&R>w&&(R=R-c*2)}if(Math.abs(R-w)>g){var O=R,N=v,V=T;R=w+g*(y&&R>w?1:-1),v=p+i*Math.cos(R),T=k+s*Math.sin(R);var H=e(v,T,i,s,f,0,y,N,V,[R,O,p,k])}var F=Math.tan((R-w)/4),U=4/3*i*F,W=4/3*s*F,q=[2*n-(n+U*Math.sin(w)),2*o-(o-W*Math.cos(w)),v+U*Math.sin(R),T-W*Math.cos(R),v,T];if(u)return q;H&&(q=q.concat(H));for(var X=0;X<q.length;){var lt=r(q[X],q[X+1],f);q[X++]=lt.x,q[X++]=lt.y}return q}function r(n,o,i){return{x:n*Math.cos(i)-o*Math.sin(i),y:n*Math.sin(i)+o*Math.cos(i)}}function a(n){return n*(c/180)}}),$U=Ft((Q,$)=>{var c=wS(),g=ZU(),P={M:"moveTo",C:"bezierCurveTo"};$.exports=function(S,t){S.beginPath(),g(c(t)).forEach(function(e){var r=e[0],a=e.slice(1);S[P[r]].apply(S,a)}),S.closePath()}}),GU=Ft((Q,$)=>{var c=m3();$.exports=P;var g=1e20;function P(e,r){r||(r={});var a=r.cutoff==null?.25:r.cutoff,n=r.radius==null?8:r.radius,o=r.channel||0,i,s,f,x,y,v,T,u,b,_,C;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");i=r.width,s=r.height,x=e,r.stride?v=r.stride:v=Math.floor(e.length/i/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(u=e,T=u.getContext("2d"),i=u.width,s=u.height,b=T.getImageData(0,0,i,s),x=b.data,v=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(u=e.canvas,T=e,i=u.width,s=u.height,b=T.getImageData(0,0,i,s),x=b.data,v=4):window.ImageData&&e instanceof window.ImageData&&(b=e,i=e.width,s=e.height,x=b.data,v=4);if(f=Math.max(i,s),window.Uint8ClampedArray&&x instanceof window.Uint8ClampedArray||window.Uint8Array&&x instanceof window.Uint8Array)for(y=x,x=Array(i*s),_=0,C=y.length;_<C;_++)x[_]=y[_*v+o]/255;else if(v!==1)throw Error("Raw data can have only 1 value per pixel");var M=Array(i*s),E=Array(i*s),A=Array(f),h=Array(f),p=Array(f+1),k=Array(f);for(_=0,C=i*s;_<C;_++){var w=x[_];M[_]=w===1?0:w===0?g:Math.pow(Math.max(0,.5-w),2),E[_]=w===1?g:w===0?0:Math.pow(Math.max(0,w-.5),2)}S(M,i,s,A,h,k,p),S(E,i,s,A,h,k,p);var R=window.Float32Array?new Float32Array(i*s):new Array(i*s);for(_=0,C=i*s;_<C;_++)R[_]=c(1-((M[_]-E[_])/n+a),0,1);return R}function S(e,r,a,n,o,i,s){for(var f=0;f<r;f++){for(var x=0;x<a;x++)n[x]=e[x*r+f];for(t(n,o,i,s,a),x=0;x<a;x++)e[x*r+f]=o[x]}for(x=0;x<a;x++){for(f=0;f<r;f++)n[f]=e[x*r+f];for(t(n,o,i,s,r),f=0;f<r;f++)e[x*r+f]=Math.sqrt(o[f])}}function t(e,r,a,n,o){a[0]=0,n[0]=-g,n[1]=+g;for(var i=1,s=0;i<o;i++){for(var f=(e[i]+i*i-(e[a[s]]+a[s]*a[s]))/(2*i-2*a[s]);f<=n[s];)s--,f=(e[i]+i*i-(e[a[s]]+a[s]*a[s]))/(2*i-2*a[s]);s++,a[s]=i,n[s]=f,n[s+1]=+g}for(i=0,s=0;i<o;i++){for(;n[s+1]<i;)s++;r[i]=(i-a[s])*(i-a[s])+e[a[s]]}}}),YU=Ft((Q,$)=>{var c=qU(),g=A1(),P=$U(),S=kS(),t=GU(),e=document.createElement("canvas"),r=e.getContext("2d");$.exports=a;function a(i,s){if(!S(i))throw Error("Argument should be valid svg path string");s||(s={});var f,x;s.shape?(f=s.shape[0],x=s.shape[1]):(f=e.width=s.w||s.width||200,x=e.height=s.h||s.height||200);var y=Math.min(f,x),v=s.stroke||0,T=s.viewbox||s.viewBox||c(i),u=[f/(T[2]-T[0]),x/(T[3]-T[1])],b=Math.min(u[0]||0,u[1]||0)/2;if(r.fillStyle="black",r.fillRect(0,0,f,x),r.fillStyle="white",v&&(typeof v!="number"&&(v=1),v>0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(v)),r.translate(f*.5,x*.5),r.scale(b,b),o()){var _=new Path2D(i);r.fill(_),v&&r.stroke(_)}else{var C=g(i);P(r,C),r.fill(),v&&r.stroke()}r.setTransform(1,0,0,1,0,0);var M=t(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:y*.5});return M}var n;function o(){if(n!=null)return n;var i=document.createElement("canvas").getContext("2d");if(i.canvas.width=i.canvas.height=1,!window.Path2D)return n=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");i.fillStyle="black",i.fill(s);var f=i.getImageData(0,0,1,1);return n=f&&f.data&&f.data[3]===255}}),gx=Ft((Q,$)=>{var c=ra(),g=YU(),P=N1(),S=Xo(),t=bn(),e=t.isArrayOrTypedArray,r=js(),a=Rc(),n=Av().formatColor,o=Ac(),i=yg(),s=nT(),f=H1(),x=co().DESELECTDIM,y={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=Dp().appendArrayPointValue;function T(H,F){var U,W={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},q=H._context.plotGlPixelRatio;if(F.visible!==!0)return W;if(o.hasText(F)&&(W.text=u(H,F),W.textSel=M(H,F,F.selected),W.textUnsel=M(H,F,F.unselected)),o.hasMarkers(F)&&(W.marker=_(H,F),W.markerSel=C(H,F,F.selected),W.markerUnsel=C(H,F,F.unselected),!F.unselected&&e(F.marker.opacity))){var X=F.marker.opacity;for(W.markerUnsel.opacity=new Array(X.length),U=0;U<X.length;U++)W.markerUnsel.opacity[U]=x*X[U]}if(o.hasLines(F)){W.line={overlay:!0,thickness:F.line.width*q,color:F.line.color,opacity:F.opacity};var lt=(f.DASHES[F.line.dash]||[1]).slice();for(U=0;U<lt.length;++U)lt[U]*=F.line.width*q;W.line.dashes=lt}return F.error_x&&F.error_x.visible&&(W.errorX=E(F,F.error_x,q)),F.error_y&&F.error_y.visible&&(W.errorY=E(F,F.error_y,q)),F.fill&&F.fill!=="none"&&(W.fill={closed:!0,fill:F.fillcolor,thickness:0}),W}function u(H,F){var U=H._fullLayout,W=F._length,q=F.textfont,X=F.textposition,lt=e(X)?X:[X],yt=q.color,pt=q.size,st=q.family,tt=q.weight,dt=q.style,rt=q.variant,at={},vt,it=H._context.plotGlPixelRatio,Y=F.texttemplate;if(Y){at.text=[];var ft=U._d3locale,ut=Array.isArray(Y),wt=ut?Math.min(Y.length,W):W,zt=ut?function(he){return Y[he]}:function(){return Y};for(vt=0;vt<wt;vt++){var Pt={i:vt},Wt=F._module.formatLabels(Pt,F,U),Ht={};v(Ht,F,vt),at.text.push(t.texttemplateString({data:[Ht,Pt,F._meta],fallback:F.texttemplatefallback,labels:Wt,locale:ft,template:zt(vt)}))}}else e(F.text)&&F.text.length<W?at.text=F.text.slice():at.text=F.text;if(e(at.text))for(vt=at.text.length;vt<W;vt++)at.text[vt]="";for(at.opacity=F.opacity,at.font={},at.align=[],at.baseline=[],vt=0;vt<lt.length;vt++){var Jt=lt[vt].split(/\s+/);switch(Jt[1]){case"left":at.align.push("right");break;case"right":at.align.push("left");break;default:at.align.push(Jt[1])}switch(Jt[0]){case"top":at.baseline.push("bottom");break;case"bottom":at.baseline.push("top");break;default:at.baseline.push(Jt[0])}}if(e(yt))for(at.color=new Array(W),vt=0;vt<W;vt++)at.color[vt]=yt[vt];else at.color=yt;if(e(pt)||Array.isArray(st)||e(tt)||Array.isArray(dt)||Array.isArray(rt))for(at.font=new Array(W),vt=0;vt<W;vt++){var ge=at.font[vt]={};ge.size=(t.isTypedArray(pt)?pt[vt]:e(pt)?c(pt[vt])?pt[vt]:0:pt)*it,ge.family=Array.isArray(st)?st[vt]:st,ge.weight=b(e(tt)?tt[vt]:tt),ge.style=Array.isArray(dt)?dt[vt]:dt,ge.variant=Array.isArray(rt)?rt[vt]:rt}else at.font={size:pt*it,family:st,weight:b(tt),style:dt,variant:rt};return at}function b(H){return H<=1e3?H>500?"bold":"normal":H}function _(H,F){var U=F._length,W=F.marker,q={},X,lt=e(W.symbol),yt=e(W.angle),pt=e(W.color),st=e(W.line.color),tt=e(W.opacity),dt=e(W.size),rt=e(W.line.width),at;if(lt||(at=s.isOpenSymbol(W.symbol)),lt||pt||st||tt||yt){q.symbols=new Array(U),q.angles=new Array(U),q.colors=new Array(U),q.borderColors=new Array(U);var vt=W.symbol,it=W.angle,Y=n(W,W.opacity,U),ft=n(W.line,W.opacity,U);if(!e(ft[0])){var ut=ft;for(ft=Array(U),X=0;X<U;X++)ft[X]=ut}if(!e(Y[0])){var wt=Y;for(Y=Array(U),X=0;X<U;X++)Y[X]=wt}if(!e(vt)){var zt=vt;for(vt=Array(U),X=0;X<U;X++)vt[X]=zt}if(!e(it)){var Pt=it;for(it=Array(U),X=0;X<U;X++)it[X]=Pt}for(q.symbols=vt,q.angles=it,q.colors=Y,q.borderColors=ft,X=0;X<U;X++)lt&&(at=s.isOpenSymbol(W.symbol[X])),at&&(ft[X]=Y[X].slice(),Y[X]=Y[X].slice(),Y[X][3]=0);for(q.opacity=F.opacity,q.markers=new Array(U),X=0;X<U;X++)q.markers[X]=R({mx:q.symbols[X],ma:q.angles[X]},F)}else at?(q.color=P(W.color,"uint8"),q.color[3]=0,q.borderColor=P(W.color,"uint8")):(q.color=P(W.color,"uint8"),q.borderColor=P(W.line.color,"uint8")),q.opacity=F.opacity*W.opacity,q.marker=R({mx:W.symbol,ma:W.angle},F);var Wt=1,Ht=i(F,Wt),Jt;if(dt||rt){var ge=q.sizes=new Array(U),he=q.borderSizes=new Array(U),de=0,se;if(dt){for(X=0;X<U;X++)ge[X]=Ht(W.size[X]),de+=ge[X];se=de/U}else for(Jt=Ht(W.size),X=0;X<U;X++)ge[X]=Jt;if(rt)for(X=0;X<U;X++)he[X]=W.line.width[X];else for(Jt=W.line.width,X=0;X<U;X++)he[X]=Jt;q.sizeAvg=se}else q.size=Ht(W&&W.size||10),q.borderSizes=Ht(W.line.width);return q}function C(H,F,U){var W=F.marker,q={};return U&&(U.marker&&U.marker.symbol?q=_(H,t.extendFlat({},W,U.marker)):U.marker&&(U.marker.size&&(q.size=U.marker.size),U.marker.color&&(q.colors=U.marker.color),U.marker.opacity!==void 0&&(q.opacity=U.marker.opacity))),q}function M(H,F,U){var W={};if(!U)return W;if(U.textfont){var q={opacity:1,text:F.text,texttemplate:F.texttemplate,textposition:F.textposition,textfont:t.extendFlat({},F.textfont)};U.textfont&&t.extendFlat(q.textfont,U.textfont),W=u(H,q)}return W}function E(H,F,U){var W={capSize:F.width*2*U,lineWidth:F.thickness*U,color:F.color};return F.copy_ystyle&&(W=H.error_y),W}var A=f.SYMBOL_SDF_SIZE,h=f.SYMBOL_SIZE,p=f.SYMBOL_STROKE,k={},w=r.symbolFuncs[0](h*.05);function R(H,F){var U=H.mx;if(U==="circle")return null;var W,q,X=r.symbolNumber(U),lt=r.symbolFuncs[X%100],yt=!!r.symbolNoDot[X%100],pt=!!r.symbolNoFill[X%100],st=s.isDotSymbol(U);if(H.ma&&(U+="_"+H.ma),k[U])return k[U];var tt=r.getMarkerAngle(H,F);return st&&!yt?W=lt(h*1.1,tt)+w:W=lt(h,tt),q=g(W,{w:A,h:A,viewBox:[-h,-h,h,h],stroke:pt?p:-p}),k[U]=q,q||null}function O(H,F,U){var W=U.length,q=W/2,X,lt;if(o.hasLines(F)&&q)if(F.line.shape==="hv"){for(X=[],lt=0;lt<q-1;lt++)isNaN(U[lt*2])||isNaN(U[lt*2+1])?X.push(NaN,NaN,NaN,NaN):(X.push(U[lt*2],U[lt*2+1]),!isNaN(U[lt*2+2])&&!isNaN(U[lt*2+3])?X.push(U[lt*2+2],U[lt*2+1]):X.push(NaN,NaN));X.push(U[W-2],U[W-1])}else if(F.line.shape==="hvh"){for(X=[],lt=0;lt<q-1;lt++)if(isNaN(U[lt*2])||isNaN(U[lt*2+1])||isNaN(U[lt*2+2])||isNaN(U[lt*2+3]))!isNaN(U[lt*2])&&!isNaN(U[lt*2+1])?X.push(U[lt*2],U[lt*2+1]):X.push(NaN,NaN),X.push(NaN,NaN);else{var yt=(U[lt*2]+U[lt*2+2])/2;X.push(U[lt*2],U[lt*2+1],yt,U[lt*2+1],yt,U[lt*2+3])}X.push(U[W-2],U[W-1])}else if(F.line.shape==="vhv"){for(X=[],lt=0;lt<q-1;lt++)if(isNaN(U[lt*2])||isNaN(U[lt*2+1])||isNaN(U[lt*2+2])||isNaN(U[lt*2+3]))!isNaN(U[lt*2])&&!isNaN(U[lt*2+1])?X.push(U[lt*2],U[lt*2+1]):X.push(NaN,NaN),X.push(NaN,NaN);else{var pt=(U[lt*2+1]+U[lt*2+3])/2;X.push(U[lt*2],U[lt*2+1],U[lt*2],pt,U[lt*2+2],pt)}X.push(U[W-2],U[W-1])}else if(F.line.shape==="vh"){for(X=[],lt=0;lt<q-1;lt++)isNaN(U[lt*2])||isNaN(U[lt*2+1])?X.push(NaN,NaN,NaN,NaN):(X.push(U[lt*2],U[lt*2+1]),!isNaN(U[lt*2+2])&&!isNaN(U[lt*2+3])?X.push(U[lt*2],U[lt*2+3]):X.push(NaN,NaN));X.push(U[W-2],U[W-1])}else X=U;var st=!1;for(lt=0;lt<X.length;lt++)if(isNaN(X[lt])){st=!0;break}var tt=st||X.length>f.TOO_MANY_POINTS||o.hasMarkers(F)?"rect":"round";if(st&&F.connectgaps){var dt=X[0],rt=X[1];for(lt=0;lt<X.length;lt+=2)isNaN(X[lt])||isNaN(X[lt+1])?(X[lt]=dt,X[lt+1]=rt):(dt=X[lt],rt=X[lt+1])}return{join:tt,positions:X}}function N(H,F,U,W,q){var X=S.getComponentMethod("errorbars","makeComputeError"),lt=a.getFromId(H,F.xaxis,"x"),yt=a.getFromId(H,F.yaxis,"y"),pt=U.length/2,st={};function tt(dt,rt){var at=rt._id.charAt(0),vt=F["error_"+at];if(vt&&vt.visible&&(rt.type==="linear"||rt.type==="log")){for(var it=X(vt),Y={x:0,y:1}[at],ft={x:[0,1,2,3],y:[2,3,0,1]}[at],ut=new Float64Array(4*pt),wt=1/0,zt=-1/0,Pt=0,Wt=0;Pt<pt;Pt++,Wt+=4){var Ht=dt[Pt];if(c(Ht)){var Jt=U[Pt*2+Y],ge=it(Ht,Pt),he=ge[0],de=ge[1];if(c(he)&&c(de)){var se=Ht-he,Tt=Ht+de;ut[Wt+ft[0]]=Jt-rt.c2l(se),ut[Wt+ft[1]]=rt.c2l(Tt)-Jt,ut[Wt+ft[2]]=0,ut[Wt+ft[3]]=0,wt=Math.min(wt,Ht-he),zt=Math.max(zt,Ht+de)}}}st[at]={positions:U,errors:ut,_bnds:[wt,zt]}}}return tt(W,lt),tt(q,yt),st}function V(H,F,U,W){var q=F._length,X={},lt;if(o.hasMarkers(F)){var yt=U.font,pt=U.align,st=U.baseline;for(X.offset=new Array(q),lt=0;lt<q;lt++){var tt=W.sizes?W.sizes[lt]:W.size,dt=e(yt)?yt[lt].size:yt.size,rt=e(pt)?pt.length>1?pt[lt]:pt[0]:pt,at=e(st)?st.length>1?st[lt]:st[0]:st,vt=y[rt],it=y[at],Y=tt?tt/.8+1:0,ft=-it*Y-it*.5;X.offset[lt]=[vt*Y/dt,ft/dt]}}return X}$.exports={style:T,markerStyle:_,markerSelection:C,linePositions:O,errorBarPositions:N,textPosition:V}}),TS=Ft((Q,$)=>{var c=bn();$.exports=function(g,P){var S=P._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 P._scene||(S=P._scene={},S.init=function(){c.extendFlat(S,e,t)},S.init(),S.update=function(r){var a=c.repeat(r,S.count);if(S.fill2d&&S.fill2d.update(a),S.scatter2d&&S.scatter2d.update(a),S.line2d&&S.line2d.update(a),S.error2d&&S.error2d.update(a.concat(a)),S.select2d&&S.select2d.update(a),S.glText)for(var n=0;n<S.count;n++)S.glText[n].update(r)},S.draw=function(){for(var r=S.count,a=S.fill2d,n=S.error2d,o=S.line2d,i=S.scatter2d,s=S.glText,f=S.select2d,x=S.selectBatch,y=S.unselectBatch,v=0;v<r;v++){if(a&&S.fillOrder[v]&&a.draw(S.fillOrder[v]),o&&S.lineOptions[v]&&o.draw(v),n&&(S.errorXOptions[v]&&n.draw(v),S.errorYOptions[v]&&n.draw(v+r)),i&&S.markerOptions[v])if(y[v].length){var T=c.repeat([],S.count);T[v]=y[v],i.draw(T)}else x[v].length||i.draw(v);s[v]&&S.textOptions[v]&&s[v].render()}f&&f.draw(x),S.dirty=!1},S.destroy=function(){S.fill2d&&S.fill2d.destroy&&S.fill2d.destroy(),S.scatter2d&&S.scatter2d.destroy&&S.scatter2d.destroy(),S.error2d&&S.error2d.destroy&&S.error2d.destroy(),S.line2d&&S.line2d.destroy&&S.line2d.destroy(),S.select2d&&S.select2d.destroy&&S.select2d.destroy(),S.glText&&S.glText.forEach(function(r){r.destroy&&r.destroy()}),S.lineOptions=null,S.fillOptions=null,S.markerOptions=null,S.markerSelectedOptions=null,S.markerUnselectedOptions=null,S.errorXOptions=null,S.errorYOptions=null,S.textOptions=null,S.textSelectedOptions=null,S.textUnselectedOptions=null,S.selectBatch=null,S.unselectBatch=null,P._scene=null}),S.dirty||c.extendFlat(S,t),S}}),KU=Ft((Q,$)=>{var c=iT(),g=bn(),P=Rc(),S=Y0().findExtremes,t=D0(),e=me(),r=e.calcMarkerSize,a=e.calcAxisExpansion,n=e.setFirstScatter,o=F0(),i=gx(),s=TS(),f=Da().BADNUM,x=H1().TOO_MANY_POINTS;$.exports=function(T,u){var b=T._fullLayout,_=u._xA=P.getFromId(T,u.xaxis,"x"),C=u._yA=P.getFromId(T,u.yaxis,"y"),M=b._plots[u.xaxis+u.yaxis],E=u._length,A=E>=x,h=E*2,p={},k,w=_.makeCalcdata(u,"x"),R=C.makeCalcdata(u,"y"),O=t(u,_,"x",w),N=t(u,C,"y",R),V=O.vals,H=N.vals;u._x=V,u._y=H,u.xperiodalignment&&(u._origX=w,u._xStarts=O.starts,u._xEnds=O.ends),u.yperiodalignment&&(u._origY=R,u._yStarts=N.starts,u._yEnds=N.ends);var F=new Array(h),U=new Array(E);for(k=0;k<E;k++)F[k*2]=V[k]===f?NaN:V[k],F[k*2+1]=H[k]===f?NaN:H[k],U[k]=k;if(_.type==="log")for(k=0;k<h;k+=2)F[k]=_.c2l(F[k]);if(C.type==="log")for(k=1;k<h;k+=2)F[k]=C.c2l(F[k]);A&&_.type!=="log"&&C.type!=="log"?p.tree=c(F):p.ids=U,o(T,u);var W=v(T,M,u,F,V,H),q=s(T,M);n(b,u);var X;return A?W.marker&&(X=W.marker.sizeAvg||Math.max(W.marker.size,3)):X=r(u,E),a(T,u,_,C,V,H,X),W.errorX&&y(u,_,W.errorX),W.errorY&&y(u,C,W.errorY),W.fill&&!q.fill2d&&(q.fill2d=!0),W.marker&&!q.scatter2d&&(q.scatter2d=!0),W.line&&!q.line2d&&(q.line2d=!0),(W.errorX||W.errorY)&&!q.error2d&&(q.error2d=!0),W.text&&!q.glText&&(q.glText=!0),W.marker&&(W.marker.snap=E),q.lineOptions.push(W.line),q.errorXOptions.push(W.errorX),q.errorYOptions.push(W.errorY),q.fillOptions.push(W.fill),q.markerOptions.push(W.marker),q.markerSelectedOptions.push(W.markerSel),q.markerUnselectedOptions.push(W.markerUnsel),q.textOptions.push(W.text),q.textSelectedOptions.push(W.textSel),q.textUnselectedOptions.push(W.textUnsel),q.selectBatch.push([]),q.unselectBatch.push([]),p._scene=q,p.index=q.count,p.x=V,p.y=H,p.positions=F,q.count++,[{x:!1,y:!1,t:p,trace:u}]};function y(T,u,b){var _=T._extremes[u._id],C=S(u,b._bnds,{padded:!0});_.min=_.min.concat(C.min),_.max=_.max.concat(C.max)}function v(T,u,b,_,C,M){var E=i.style(T,b);if(E.marker&&(E.marker.positions=_),E.line&&_.length>1&&g.extendFlat(E.line,i.linePositions(T,b,_)),E.errorX||E.errorY){var A=i.errorBarPositions(T,b,_,C,M);E.errorX&&g.extendFlat(E.errorX,A.x),E.errorY&&g.extendFlat(E.errorY,A.y)}return E.text&&(g.extendFlat(E.text,{positions:_},i.textPosition(T,b,E.text,E.marker)),g.extendFlat(E.textSel,{positions:_},i.textPosition(T,b,E.text,E.markerSel)),g.extendFlat(E.textUnsel,{positions:_},i.textPosition(T,b,E.text,E.markerUnsel))),E}}),AS=Ft((Q,$)=>{var c=bn(),g=li(),P=co().DESELECTDIM;function S(t){var e=t[0],r=e.trace,a=e.t,n=a._scene,o=a.index,i=n.selectBatch[o],s=n.unselectBatch[o],f=n.textOptions[o],x=n.textSelectedOptions[o]||{},y=n.textUnselectedOptions[o]||{},v=c.extendFlat({},f),T,u;if(i.length||s.length){var b=x.color,_=y.color,C=f.color,M=c.isArrayOrTypedArray(C);for(v.color=new Array(r._length),T=0;T<i.length;T++)u=i[T],v.color[u]=b||(M?C[u]:C);for(T=0;T<s.length;T++){u=s[T];var E=M?C[u]:C;v.color[u]=_||(b?E:g.addOpacity(E,P))}}n.glText[o].update(v)}$.exports={styleTextSelection:S}}),MS=Ft((Q,$)=>{var c=Ac(),g=AS().styleTextSelection;$.exports=function(P,S){var t=P.cd,e=P.xaxis,r=P.yaxis,a=[],n=t[0].trace,o=t[0].t,i=n._length,s=o.x,f=o.y,x=o._scene,y=o.index;if(!x)return a;var v=c.hasText(n),T=c.hasMarkers(n),u=!T&&!v;if(n.visible!==!0||u)return a;var b=[],_=[];if(S!==!1&&!S.degenerate)for(var C=0;C<i;C++)S.contains([o.xpx[C],o.ypx[C]],!1,C,P)?(b.push(C),a.push({pointNumber:C,x:e.c2d(s[C]),y:r.c2d(f[C])})):_.push(C);if(T){var M=x.scatter2d;if(!b.length&&!_.length){var E=new Array(x.count);E[y]=x.markerOptions[y],M.update.apply(M,E)}else if(!x.selectBatch[y].length&&!x.unselectBatch[y].length){var A=new Array(x.count);A[y]=x.markerUnselectedOptions[y],M.update.apply(M,A)}}return x.selectBatch[y]=b,x.unselectBatch[y]=_,v&&g(t),a}}),XU=Ft((Q,$)=>{var c=rT();$.exports={moduleType:"trace",name:"scattergl",basePlotModule:Mf(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:x3(),supplyDefaults:FU(),crossTraceDefaults:Pw(),colorbar:xo(),formatLabels:RU(),calc:KU(),hoverPoints:c.hoverPoints,selectPoints:MS(),meta:{}}}),JU=Ft((Q,$)=>{var c=m3();$.exports=g,$.exports.to=g,$.exports.from=P;function g(S,t){t==null&&(t=!0);var e=S[0],r=S[1],a=S[2],n=S[3];n==null&&(n=t?1:255),t&&(e*=255,r*=255,a*=255,n*=255),e=c(e,0,255)&255,r=c(r,0,255)&255,a=c(a,0,255)&255,n=c(n,0,255)&255;var o=e*16777216+(r<<16)+(a<<8)+n;return o}function P(S,t){S=+S;var e=S>>>24,r=(S&16711680)>>>16,a=(S&65280)>>>8,n=S&255;return t===!1?[e,r,a,n]:[e/255,r/255,a/255,n/255]}}),Ed=Ft((Q,$)=>{var c=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;function S(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={},a=0;a<10;a++)r["_"+String.fromCharCode(a)]=a;var n=Object.getOwnPropertyNames(r).map(function(i){return r[i]});if(n.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}$.exports=t()?Object.assign:function(e,r){for(var a,n=S(e),o,i=1;i<arguments.length;i++){a=Object(arguments[i]);for(var s in a)g.call(a,s)&&(n[s]=a[s]);if(c){o=c(a);for(var f=0;f<o.length;f++)P.call(a,o[f])&&(n[o[f]]=a[o[f]])}}return n}}),QU=Ft((Q,$)=>{$.exports=function(c){typeof c=="string"&&(c=[c]);for(var g=[].slice.call(arguments,1),P=[],S=0;S<c.length-1;S++)P.push(c[S],g[S]||"");return P.push(c[S]),P.join("")}}),SS=Ft((Q,$)=>{$.exports=function(c,g,P){Array.isArray(P)||(P=[].slice.call(arguments,2));for(var S=0,t=P.length;S<t;S++){var e=P[S];for(var r in e)if(!(g[r]!==void 0&&!Array.isArray(g[r])&&c[r]===g[r])&&r in g){var a;if(e[r]===!0)a=g[r];else if(e[r]===!1||typeof e[r]=="function"&&(a=e[r](g[r],c,g),a===void 0))continue;c[r]=a}}return c}}),tV=Ft((Q,$)=>{$.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}),aT=Ft((Q,$)=>{$.exports=P,$.exports.float32=$.exports.float=P,$.exports.fract32=$.exports.fract=g;var c=new Float32Array(1);function g(S,t){if(S.length){if(S instanceof Float32Array)return new Float32Array(S.length);t instanceof Float32Array||(t=P(S));for(var e=0,r=t.length;e<r;e++)t[e]=S[e]-t[e];return t}return P(S-P(S))}function P(S){return S.length?S instanceof Float32Array?S:new Float32Array(S):(c[0]=S,c[0])}}),ES=Ft((Q,$)=>{function c(k,w){var R=k==null?null:typeof Symbol<"u"&&k[Symbol.iterator]||k["@@iterator"];if(R!=null){var O,N,V,H,F=[],U=!0,W=!1;try{if(V=(R=R.call(k)).next,w!==0)for(;!(U=(O=V.call(R)).done)&&(F.push(O.value),F.length!==w);U=!0);}catch(q){W=!0,N=q}finally{try{if(!U&&R.return!=null&&(H=R.return(),Object(H)!==H))return}finally{if(W)throw N}}return F}}function g(k,w){return t(k)||c(k,w)||r(k,w)||o()}function P(k){return S(k)||e(k)||r(k)||n()}function S(k){if(Array.isArray(k))return a(k)}function t(k){if(Array.isArray(k))return k}function e(k){if(typeof Symbol<"u"&&k[Symbol.iterator]!=null||k["@@iterator"]!=null)return Array.from(k)}function r(k,w){if(k){if(typeof k=="string")return a(k,w);var R=Object.prototype.toString.call(k).slice(8,-1);if(R==="Object"&&k.constructor&&(R=k.constructor.name),R==="Map"||R==="Set")return Array.from(k);if(R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R))return a(k,w)}}function a(k,w){(w==null||w>k.length)&&(w=k.length);for(var R=0,O=new Array(w);R<w;R++)O[R]=k[R];return O}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 i=N1(),s=px(),f=JU(),x=iT(),y=Ed(),v=QU(),T=Cg(),u=SS(),b=mx(),_=tV(),C=aT(),M=db(),E=A;function A(k,w){var R=this;if(!(this instanceof A))return new A(k,w);typeof k=="function"?(w||(w={}),w.regl=k):(w=k,k=null),w&&w.length&&(w.positions=w),k=w.regl;var O=k._gl,N,V=[],H={},F=[],U=[null],W=[null],q=255,X=100;this.tooManyColors=_,N=k.texture({data:new Uint8Array(q*4),width:q,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),y(this,{regl:k,gl:O,groups:F,markerCache:W,markerTextures:U,palette:V,paletteIds:H,paletteTexture:N,maxColors:q,maxSize:X,canvas:O.canvas}),this.update(w);var lt={uniforms:{constPointSize:!!w.constPointSize,opacity:k.prop("opacity"),paletteSize:function(st,tt){return[R.tooManyColors?0:q,N.height]},pixelRatio:k.context("pixelRatio"),scale:k.prop("scale"),scaleFract:k.prop("scaleFract"),translate:k.prop("translate"),translateFract:k.prop("translateFract"),markerTexture:k.prop("markerTexture"),paletteTexture:N},attributes:{x:function(st,tt){return tt.xAttr||{buffer:tt.positionBuffer,stride:8,offset:0}},y:function(st,tt){return tt.yAttr||{buffer:tt.positionBuffer,stride:8,offset:4}},xFract:function(st,tt){return tt.xAttr?{constant:[0,0]}:{buffer:tt.positionFractBuffer,stride:8,offset:0}},yFract:function(st,tt){return tt.yAttr?{constant:[0,0]}:{buffer:tt.positionFractBuffer,stride:8,offset:4}},size:function(st,tt){return tt.size.length?{buffer:tt.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(tt.size*255/R.maxSize)]}},borderSize:function(st,tt){return tt.borderSize.length?{buffer:tt.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(tt.borderSize*255/R.maxSize)]}},colorId:function(st,tt){return tt.color.length?{buffer:tt.colorBuffer,stride:R.tooManyColors?8:4,offset:0}:{constant:R.tooManyColors?V.slice(tt.color*4,tt.color*4+4):[tt.color]}},borderColorId:function(st,tt){return tt.borderColor.length?{buffer:tt.colorBuffer,stride:R.tooManyColors?8:4,offset:R.tooManyColors?4:2}:{constant:R.tooManyColors?V.slice(tt.borderColor*4,tt.borderColor*4+4):[tt.borderColor]}},isActive:function(st,tt){return tt.activation===!0?{constant:[1]}:tt.activation?tt.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:k.prop("viewport")},viewport:k.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:k.prop("elements"),count:k.prop("count"),offset:k.prop("offset"),primitive:"points"},yt=y({},lt);yt.frag=v([`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;
}
}
`]),yt.vert=v([`precision highp float;
#define GLSLIFY 1
attribute float x, y, xFract, yFract;
attribute float size, borderSize;
attribute vec4 colorId, borderColorId;
attribute float isActive;
// \`invariant\` effectively turns off optimizations for the position.
// We need this because -fast-math on M1 Macs is re-ordering
// floating point operations in a way that causes floating point
// precision limits to put points in the wrong locations.
invariant gl_Position;
uniform bool constPointSize;
uniform float pixelRatio;
uniform vec2 scale, scaleFract, translate, translateFract, paletteSize;
uniform sampler2D paletteTexture;
const float maxSize = 100.;
const float borderLevel = .5;
varying vec4 fragColor, fragBorderColor;
varying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;
float pointSizeScale = (constPointSize) ? 2. : pixelRatio;
bool isDirect = (paletteSize.x < 1.);
vec4 getColor(vec4 id) {
return isDirect ? id / 255. : texture2D(paletteTexture,
vec2(
(id.x + .5) / paletteSize.x,
(id.y + .5) / paletteSize.y
)
);
}
void main() {
// ignore inactive points
if (isActive == 0.) return;
vec2 position = vec2(x, y);
vec2 positionFract = vec2(xFract, yFract);
vec4 color = getColor(colorId);
vec4 borderColor = getColor(borderColorId);
float size = size * maxSize / 255.;
float borderSize = borderSize * maxSize / 255.;
gl_PointSize = 2. * size * pointSizeScale;
fragPointSize = size * pixelRatio;
vec2 pos = (position + translate) * scale
+ (positionFract + translateFract) * scale
+ (position + translate) * scaleFract
+ (positionFract + translateFract) * scaleFract;
gl_Position = vec4(pos * 2. - 1., 0., 1.);
fragColor = color;
fragBorderColor = borderColor;
fragWidth = 1. / gl_PointSize;
fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);
fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);
}
`]),this.drawMarker=k(yt);var pt=y({},lt);pt.frag=v([`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;
}
`]),pt.vert=v([`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;
}
`]),_&&(pt.frag=pt.frag.replace("smoothstep","smoothStep"),yt.frag=yt.frag.replace("smoothstep","smoothStep")),this.drawCircle=k(pt)}A.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},A.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},A.prototype.draw=function(){for(var k=this,w=arguments.length,R=new Array(w),O=0;O<w;O++)R[O]=arguments[O];var N=this.groups;if(R.length===1&&Array.isArray(R[0])&&(R[0][0]===null||Array.isArray(R[0][0]))&&(R=R[0]),this.regl._refresh(),R.length)for(var V=0;V<R.length;V++)this.drawItem(V,R[V]);else N.forEach(function(H,F){k.drawItem(F)});return this},A.prototype.drawItem=function(k,w){var R=this.groups,O=R[k];if(typeof w=="number"&&(k=w,O=R[w],w=null),!!(O&&O.count&&O.opacity)){O.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,O,w));for(var N=[],V=1;V<O.activation.length;V++)!O.activation[V]||O.activation[V]!==!0&&!O.activation[V].data.length||N.push.apply(N,P(this.getMarkerDrawOptions(V,O,w)));N.length&&this.drawMarker(N)}},A.prototype.getMarkerDrawOptions=function(k,w,R){var O=w.range,N=w.tree,V=w.viewport,H=w.activation,F=w.selectionBuffer,U=w.count;if(this.regl,!N)return R?[y({},w,{markerTexture:this.markerTextures[k],activation:H[k],count:R.length,elements:R,offset:0})]:[y({},w,{markerTexture:this.markerTextures[k],activation:H[k],offset:0})];var W=[],q=N.range(O,{lod:!0,px:[(O[2]-O[0])/V.width,(O[3]-O[1])/V.height]});if(R){for(var X=H[k],lt=X.data,yt=new Uint8Array(U),pt=0;pt<R.length;pt++){var st=R[pt];yt[st]=lt?lt[st]:1}F.subdata(yt)}for(var tt=q.length;tt--;){var dt=g(q[tt],2),rt=dt[0],at=dt[1];W.push(y({},w,{markerTexture:this.markerTextures[k],activation:R?F:H[k],offset:rt,count:at-rt}))}return W},A.prototype.update=function(){for(var k=this,w=arguments.length,R=new Array(w),O=0;O<w;O++)R[O]=arguments[O];if(R.length){R.length===1&&Array.isArray(R[0])&&(R=R[0]);var N=this.groups,V=this.gl,H=this.regl,F=this.maxSize,U=this.maxColors,W=this.palette;this.groups=N=R.map(function(q,X){var lt=N[X];if(q===void 0)return lt;q===null?q={positions:null}:typeof q=="function"?q={ondraw:q}:typeof q[0]=="number"&&(q={positions:q}),q=T(q,{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"}),q.positions===null&&(q.positions=[]),q.tooManyColors!=null&&(k.tooManyColors=q.tooManyColors),lt||(N[X]=lt={id:X,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:H.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:H.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:H.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:H.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:H.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},q=y({},A.defaults,q)),q.positions&&!("marker"in q)&&(q.marker=lt.marker,delete lt.marker),q.marker&&!("positions"in q)&&(q.positions=lt.positions,delete lt.positions);var yt=0,pt=0;if(u(lt,q,[{snap:!0,size:function(he,de){return he==null&&(he=A.defaults.size),yt+=he&&he.length?1:0,he},borderSize:function(he,de){return he==null&&(he=A.defaults.borderSize),yt+=he&&he.length?1:0,he},opacity:parseFloat,color:function(he,de){return he==null&&(he=A.defaults.color),he=k.updateColor(he),pt++,he},borderColor:function(he,de){return he==null&&(he=A.defaults.borderColor),he=k.updateColor(he),pt++,he},bounds:function(he,de,se){return"range"in se||(se.range=null),he},positions:function(he,de,se){var Tt=de.snap,Lt=de.positionBuffer,Mt=de.positionFractBuffer,te=de.selectionBuffer;if(he.x||he.y)return he.x.length?de.xAttr={buffer:H.buffer(he.x),offset:0,stride:4,count:he.x.length}:de.xAttr={buffer:he.x.buffer,offset:he.x.offset*4||0,stride:(he.x.stride||1)*4,count:he.x.count},he.y.length?de.yAttr={buffer:H.buffer(he.y),offset:0,stride:4,count:he.y.length}:de.yAttr={buffer:he.y.buffer,offset:he.y.offset*4||0,stride:(he.y.stride||1)*4,count:he.y.count},de.count=Math.max(de.xAttr.count,de.yAttr.count),he;he=b(he,"float64");var ve=de.count=Math.floor(he.length/2),oe=de.bounds=ve?s(he,2):null;if(!se.range&&!de.range&&(delete de.range,se.range=oe),!se.marker&&!de.marker&&(delete de.marker,se.marker=null),Tt&&(Tt===!0||ve>Tt)?de.tree=x(he,{bounds:oe}):Tt&&Tt.length&&(de.tree=Tt),de.tree){var Te={primitive:"points",usage:"static",data:de.tree,type:"uint32"};de.elements?de.elements(Te):de.elements=H.elements(Te)}var He=C.float32(he);Lt({data:He,usage:"dynamic"});var Ge=C.fract32(he,He);return Mt({data:Ge,usage:"dynamic"}),te({data:new Uint8Array(ve),type:"uint8",usage:"stream"}),he}},{marker:function(he,de,se){var Tt=de.activation;if(Tt.forEach(function(Ge){return Ge&&Ge.destroy&&Ge.destroy()}),Tt.length=0,!he||typeof he[0]=="number"){var Lt=k.addMarker(he);Tt[Lt]=!0}else{for(var Mt=[],te=0,ve=Math.min(he.length,de.count);te<ve;te++){var oe=k.addMarker(he[te]);Mt[oe]||(Mt[oe]=new Uint8Array(de.count)),Mt[oe][te]=1}for(var Te=0;Te<Mt.length;Te++)if(Mt[Te]){var He={data:Mt[Te],type:"uint8",usage:"static"};Tt[Te]?Tt[Te](He):Tt[Te]=H.buffer(He),Tt[Te].data=Mt[Te]}}return he},range:function(he,de,se){var Tt=de.bounds;if(Tt)return he||(he=Tt),de.scale=[1/(he[2]-he[0]),1/(he[3]-he[1])],de.translate=[-he[0],-he[1]],de.scaleFract=C.fract(de.scale),de.translateFract=C.fract(de.translate),he},viewport:function(he){var de=M(he||[V.drawingBufferWidth,V.drawingBufferHeight]);return de}}]),yt){var st=lt,tt=st.count,dt=st.size,rt=st.borderSize,at=st.sizeBuffer,vt=new Uint8Array(tt*2);if(dt.length||rt.length)for(var it=0;it<tt;it++)vt[it*2]=Math.round((dt[it]==null?dt:dt[it])*255/F),vt[it*2+1]=Math.round((rt[it]==null?rt:rt[it])*255/F);at({data:vt,usage:"dynamic"})}if(pt){var Y=lt,ft=Y.count,ut=Y.color,wt=Y.borderColor,zt=Y.colorBuffer,Pt;if(k.tooManyColors){if(ut.length||wt.length){Pt=new Uint8Array(ft*8);for(var Wt=0;Wt<ft;Wt++){var Ht=ut[Wt];Pt[Wt*8]=W[Ht*4],Pt[Wt*8+1]=W[Ht*4+1],Pt[Wt*8+2]=W[Ht*4+2],Pt[Wt*8+3]=W[Ht*4+3];var Jt=wt[Wt];Pt[Wt*8+4]=W[Jt*4],Pt[Wt*8+5]=W[Jt*4+1],Pt[Wt*8+6]=W[Jt*4+2],Pt[Wt*8+7]=W[Jt*4+3]}}}else if(ut.length||wt.length){Pt=new Uint8Array(ft*4+2);for(var ge=0;ge<ft;ge++)ut[ge]!=null&&(Pt[ge*4]=ut[ge]%U,Pt[ge*4+1]=Math.floor(ut[ge]/U)),wt[ge]!=null&&(Pt[ge*4+2]=wt[ge]%U,Pt[ge*4+3]=Math.floor(wt[ge]/U))}zt({data:Pt||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return lt})}},A.prototype.addMarker=function(k){var w=this.markerTextures,R=this.regl,O=this.markerCache,N=k==null?0:O.indexOf(k);if(N>=0)return N;var V;if(k instanceof Uint8Array||k instanceof Uint8ClampedArray)V=k;else{V=new Uint8Array(k.length);for(var H=0,F=k.length;H<F;H++)V[H]=k[H]*255}var U=Math.floor(Math.sqrt(V.length));return N=w.length,O.push(k),w.push(R.texture({channels:1,data:V,radius:U,mag:"linear",min:"linear"})),N},A.prototype.updateColor=function(k){var w=this.paletteIds,R=this.palette,O=this.maxColors;Array.isArray(k)||(k=[k]);var N=[];if(typeof k[0]=="number"){var V=[];if(Array.isArray(k))for(var H=0;H<k.length;H+=4)V.push(k.slice(H,H+4));else for(var F=0;F<k.length;F+=4)V.push(k.subarray(F,F+4));k=V}for(var U=0;U<k.length;U++){var W=k[U];W=i(W,"uint8");var q=f(W,!1);if(w[q]==null){var X=R.length;w[q]=Math.floor(X/4),R[X]=W[0],R[X+1]=W[1],R[X+2]=W[2],R[X+3]=W[3]}N[U]=w[q]}return!this.tooManyColors&&R.length>O*4&&(this.tooManyColors=!0),this.updatePalette(R),N.length===1?N[0]:N},A.prototype.updatePalette=function(k){if(!this.tooManyColors){var w=this.maxColors,R=this.paletteTexture,O=Math.ceil(k.length*.25/w);if(O>1){k=k.slice();for(var N=k.length*.25%w;N<O*w;N++)k.push(0,0,0,0)}R.height<O&&R.resize(w,O),R.subimage({width:Math.min(k.length*.25,w),height:O,data:k},0,0)}},A.prototype.destroy=function(){return this.groups.forEach(function(k){k.sizeBuffer.destroy(),k.positionBuffer.destroy(),k.positionFractBuffer.destroy(),k.colorBuffer.destroy(),k.activation.forEach(function(w){return w&&w.destroy&&w.destroy()}),k.selectionBuffer.destroy(),k.elements&&k.elements.destroy()}),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach(function(k){return k&&k.destroy&&k.destroy()}),this};var h=Ed(),p=function(k,w){var R=new E(k,w),O=R.render.bind(R);return h(O,{render:O,update:R.update.bind(R),draw:R.draw.bind(R),destroy:R.destroy.bind(R),regl:R.regl,gl:R.gl,canvas:R.gl.canvas,groups:R.groups,markers:R.markerCache,palette:R.palette}),O};$.exports=p}),eV=Ft((Q,$)=>{$.exports=c,$.exports.default=c;function c(H,F,U){U=U||2;var W=F&&F.length,q=W?F[0]*U:H.length,X=g(H,0,q,U,!0),lt=[];if(!X||X.next===X.prev)return lt;var yt,pt,st,tt,dt,rt,at;if(W&&(X=n(H,F,X,U)),H.length>80*U){yt=st=H[0],pt=tt=H[1];for(var vt=U;vt<q;vt+=U)dt=H[vt],rt=H[vt+1],dt<yt&&(yt=dt),rt<pt&&(pt=rt),dt>st&&(st=dt),rt>tt&&(tt=rt);at=Math.max(st-yt,tt-pt),at=at!==0?32767/at:0}return S(X,lt,U,yt,pt,at,0),lt}function g(H,F,U,W,q){var X,lt;if(q===V(H,F,U,W)>0)for(X=F;X<U;X+=W)lt=R(X,H[X],H[X+1],lt);else for(X=U-W;X>=F;X-=W)lt=R(X,H[X],H[X+1],lt);return lt&&C(lt,lt.next)&&(O(lt),lt=lt.next),lt}function P(H,F){if(!H)return H;F||(F=H);var U=H,W;do if(W=!1,!U.steiner&&(C(U,U.next)||_(U.prev,U,U.next)===0)){if(O(U),U=F=U.prev,U===U.next)break;W=!0}else U=U.next;while(W||U!==F);return F}function S(H,F,U,W,q,X,lt){if(H){!lt&&X&&x(H,W,q,X);for(var yt=H,pt,st;H.prev!==H.next;){if(pt=H.prev,st=H.next,X?e(H,W,q,X):t(H)){F.push(pt.i/U|0),F.push(H.i/U|0),F.push(st.i/U|0),O(H),H=st.next,yt=st.next;continue}if(H=st,H===yt){lt?lt===1?(H=r(P(H),F,U),S(H,F,U,W,q,X,2)):lt===2&&a(H,F,U,W,q,X):S(P(H),F,U,W,q,X,1);break}}}}function t(H){var F=H.prev,U=H,W=H.next;if(_(F,U,W)>=0)return!1;for(var q=F.x,X=U.x,lt=W.x,yt=F.y,pt=U.y,st=W.y,tt=q<X?q<lt?q:lt:X<lt?X:lt,dt=yt<pt?yt<st?yt:st:pt<st?pt:st,rt=q>X?q>lt?q:lt:X>lt?X:lt,at=yt>pt?yt>st?yt:st:pt>st?pt:st,vt=W.next;vt!==F;){if(vt.x>=tt&&vt.x<=rt&&vt.y>=dt&&vt.y<=at&&u(q,yt,X,pt,lt,st,vt.x,vt.y)&&_(vt.prev,vt,vt.next)>=0)return!1;vt=vt.next}return!0}function e(H,F,U,W){var q=H.prev,X=H,lt=H.next;if(_(q,X,lt)>=0)return!1;for(var yt=q.x,pt=X.x,st=lt.x,tt=q.y,dt=X.y,rt=lt.y,at=yt<pt?yt<st?yt:st:pt<st?pt:st,vt=tt<dt?tt<rt?tt:rt:dt<rt?dt:rt,it=yt>pt?yt>st?yt:st:pt>st?pt:st,Y=tt>dt?tt>rt?tt:rt:dt>rt?dt:rt,ft=v(at,vt,F,U,W),ut=v(it,Y,F,U,W),wt=H.prevZ,zt=H.nextZ;wt&&wt.z>=ft&&zt&&zt.z<=ut;){if(wt.x>=at&&wt.x<=it&&wt.y>=vt&&wt.y<=Y&&wt!==q&&wt!==lt&&u(yt,tt,pt,dt,st,rt,wt.x,wt.y)&&_(wt.prev,wt,wt.next)>=0||(wt=wt.prevZ,zt.x>=at&&zt.x<=it&&zt.y>=vt&&zt.y<=Y&&zt!==q&&zt!==lt&&u(yt,tt,pt,dt,st,rt,zt.x,zt.y)&&_(zt.prev,zt,zt.next)>=0))return!1;zt=zt.nextZ}for(;wt&&wt.z>=ft;){if(wt.x>=at&&wt.x<=it&&wt.y>=vt&&wt.y<=Y&&wt!==q&&wt!==lt&&u(yt,tt,pt,dt,st,rt,wt.x,wt.y)&&_(wt.prev,wt,wt.next)>=0)return!1;wt=wt.prevZ}for(;zt&&zt.z<=ut;){if(zt.x>=at&&zt.x<=it&&zt.y>=vt&&zt.y<=Y&&zt!==q&&zt!==lt&&u(yt,tt,pt,dt,st,rt,zt.x,zt.y)&&_(zt.prev,zt,zt.next)>=0)return!1;zt=zt.nextZ}return!0}function r(H,F,U){var W=H;do{var q=W.prev,X=W.next.next;!C(q,X)&&M(q,W,W.next,X)&&p(q,X)&&p(X,q)&&(F.push(q.i/U|0),F.push(W.i/U|0),F.push(X.i/U|0),O(W),O(W.next),W=H=X),W=W.next}while(W!==H);return P(W)}function a(H,F,U,W,q,X){var lt=H;do{for(var yt=lt.next.next;yt!==lt.prev;){if(lt.i!==yt.i&&b(lt,yt)){var pt=w(lt,yt);lt=P(lt,lt.next),pt=P(pt,pt.next),S(lt,F,U,W,q,X,0),S(pt,F,U,W,q,X,0);return}yt=yt.next}lt=lt.next}while(lt!==H)}function n(H,F,U,W){var q=[],X,lt,yt,pt,st;for(X=0,lt=F.length;X<lt;X++)yt=F[X]*W,pt=X<lt-1?F[X+1]*W:H.length,st=g(H,yt,pt,W,!1),st===st.next&&(st.steiner=!0),q.push(T(st));for(q.sort(o),X=0;X<q.length;X++)U=i(q[X],U);return U}function o(H,F){return H.x-F.x}function i(H,F){var U=s(H,F);if(!U)return F;var W=w(U,H);return P(W,W.next),P(U,U.next)}function s(H,F){var U=F,W=H.x,q=H.y,X=-1/0,lt;do{if(q<=U.y&&q>=U.next.y&&U.next.y!==U.y){var yt=U.x+(q-U.y)*(U.next.x-U.x)/(U.next.y-U.y);if(yt<=W&&yt>X&&(X=yt,lt=U.x<U.next.x?U:U.next,yt===W))return lt}U=U.next}while(U!==F);if(!lt)return null;var pt=lt,st=lt.x,tt=lt.y,dt=1/0,rt;U=lt;do W>=U.x&&U.x>=st&&W!==U.x&&u(q<tt?W:X,q,st,tt,q<tt?X:W,q,U.x,U.y)&&(rt=Math.abs(q-U.y)/(W-U.x),p(U,H)&&(rt<dt||rt===dt&&(U.x>lt.x||U.x===lt.x&&f(lt,U)))&&(lt=U,dt=rt)),U=U.next;while(U!==pt);return lt}function f(H,F){return _(H.prev,H,F.prev)<0&&_(F.next,H,H.next)<0}function x(H,F,U,W){var q=H;do q.z===0&&(q.z=v(q.x,q.y,F,U,W)),q.prevZ=q.prev,q.nextZ=q.next,q=q.next;while(q!==H);q.prevZ.nextZ=null,q.prevZ=null,y(q)}function y(H){var F,U,W,q,X,lt,yt,pt,st=1;do{for(U=H,H=null,X=null,lt=0;U;){for(lt++,W=U,yt=0,F=0;F<st&&(yt++,W=W.nextZ,!!W);F++);for(pt=st;yt>0||pt>0&&W;)yt!==0&&(pt===0||!W||U.z<=W.z)?(q=U,U=U.nextZ,yt--):(q=W,W=W.nextZ,pt--),X?X.nextZ=q:H=q,q.prevZ=X,X=q;U=W}X.nextZ=null,st*=2}while(lt>1);return H}function v(H,F,U,W,q){return H=(H-U)*q|0,F=(F-W)*q|0,H=(H|H<<8)&16711935,H=(H|H<<4)&252645135,H=(H|H<<2)&858993459,H=(H|H<<1)&1431655765,F=(F|F<<8)&16711935,F=(F|F<<4)&252645135,F=(F|F<<2)&858993459,F=(F|F<<1)&1431655765,H|F<<1}function T(H){var F=H,U=H;do(F.x<U.x||F.x===U.x&&F.y<U.y)&&(U=F),F=F.next;while(F!==H);return U}function u(H,F,U,W,q,X,lt,yt){return(q-lt)*(F-yt)>=(H-lt)*(X-yt)&&(H-lt)*(W-yt)>=(U-lt)*(F-yt)&&(U-lt)*(X-yt)>=(q-lt)*(W-yt)}function b(H,F){return H.next.i!==F.i&&H.prev.i!==F.i&&!h(H,F)&&(p(H,F)&&p(F,H)&&k(H,F)&&(_(H.prev,H,F.prev)||_(H,F.prev,F))||C(H,F)&&_(H.prev,H,H.next)>0&&_(F.prev,F,F.next)>0)}function _(H,F,U){return(F.y-H.y)*(U.x-F.x)-(F.x-H.x)*(U.y-F.y)}function C(H,F){return H.x===F.x&&H.y===F.y}function M(H,F,U,W){var q=A(_(H,F,U)),X=A(_(H,F,W)),lt=A(_(U,W,H)),yt=A(_(U,W,F));return!!(q!==X&&lt!==yt||q===0&&E(H,U,F)||X===0&&E(H,W,F)||lt===0&&E(U,H,W)||yt===0&&E(U,F,W))}function E(H,F,U){return F.x<=Math.max(H.x,U.x)&&F.x>=Math.min(H.x,U.x)&&F.y<=Math.max(H.y,U.y)&&F.y>=Math.min(H.y,U.y)}function A(H){return H>0?1:H<0?-1:0}function h(H,F){var U=H;do{if(U.i!==H.i&&U.next.i!==H.i&&U.i!==F.i&&U.next.i!==F.i&&M(U,U.next,H,F))return!0;U=U.next}while(U!==H);return!1}function p(H,F){return _(H.prev,H,H.next)<0?_(H,F,H.next)>=0&&_(H,H.prev,F)>=0:_(H,F,H.prev)<0||_(H,H.next,F)<0}function k(H,F){var U=H,W=!1,q=(H.x+F.x)/2,X=(H.y+F.y)/2;do U.y>X!=U.next.y>X&&U.next.y!==U.y&&q<(U.next.x-U.x)*(X-U.y)/(U.next.y-U.y)+U.x&&(W=!W),U=U.next;while(U!==H);return W}function w(H,F){var U=new N(H.i,H.x,H.y),W=new N(F.i,F.x,F.y),q=H.next,X=F.prev;return H.next=F,F.prev=H,U.next=q,q.prev=U,W.next=U,U.prev=W,X.next=W,W.prev=X,W}function R(H,F,U,W){var q=new N(H,F,U);return W?(q.next=W.next,q.prev=W,W.next.prev=q,W.next=q):(q.prev=q,q.next=q),q}function O(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 N(H,F,U){this.i=H,this.x=F,this.y=U,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}c.deviation=function(H,F,U,W){var q=F&&F.length,X=q?F[0]*U:H.length,lt=Math.abs(V(H,0,X,U));if(q)for(var yt=0,pt=F.length;yt<pt;yt++){var st=F[yt]*U,tt=yt<pt-1?F[yt+1]*U:H.length;lt-=Math.abs(V(H,st,tt,U))}var dt=0;for(yt=0;yt<W.length;yt+=3){var rt=W[yt]*U,at=W[yt+1]*U,vt=W[yt+2]*U;dt+=Math.abs((H[rt]-H[vt])*(H[at+1]-H[rt+1])-(H[rt]-H[at])*(H[vt+1]-H[rt+1]))}return lt===0&&dt===0?0:Math.abs((dt-lt)/lt)};function V(H,F,U,W){for(var q=0,X=F,lt=U-W;X<U;X+=W)q+=(H[lt]-H[X])*(H[X+1]+H[lt+1]),lt=X;return q}c.flatten=function(H){for(var F=H[0][0].length,U={vertices:[],holes:[],dimensions:F},W=0,q=0;q<H.length;q++){for(var X=0;X<H[q].length;X++)for(var lt=0;lt<F;lt++)U.vertices.push(H[q][X][lt]);q>0&&(W+=H[q-1].length,U.holes.push(W))}return U}}),rV=Ft((Q,$)=>{var c=px();$.exports=g;function g(P,S,t){if(!P||P.length==null)throw Error("Argument should be an array");S==null&&(S=1),t==null&&(t=c(P,S));for(var e=0;e<S;e++){var r=t[S+e],a=t[e],n=e,o=P.length;if(r===1/0&&a===-1/0)for(n=e;n<o;n+=S)P[n]=P[n]===r?1:P[n]===a?0:.5;else if(r===1/0)for(n=e;n<o;n+=S)P[n]=P[n]===r?1:0;else if(a===-1/0)for(n=e;n<o;n+=S)P[n]=P[n]===a?0:1;else{var i=r-a;for(n=e;n<o;n+=S)isNaN(P[n])||(P[n]=i===0?.5:(P[n]-a)/i)}}return P}}),nV=Ft((Q,$)=>{$.exports=function(){var c,g;if(typeof WeakMap!="function")return!1;try{c=new WeakMap([[g={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return!(String(c)!=="[object WeakMap]"||typeof c.set!="function"||c.set({},1)!==c||typeof c.delete!="function"||typeof c.has!="function"||c.get(g)!=="one")}}),iV=Ft((Q,$)=>{$.exports=function(){}}),W1=Ft((Q,$)=>{var c=iV()();$.exports=function(g){return g!==c&&g!==null}}),CS=Ft((Q,$)=>{var c=Object.create,g=Object.getPrototypeOf,P={};$.exports=function(){var S=Object.setPrototypeOf,t=arguments[0]||c;return typeof S!="function"?!1:g(S(t(null),P))===P}}),LS=Ft((Q,$)=>{var c=W1(),g={function:!0,object:!0};$.exports=function(P){return c(P)&&g[typeof P]||!1}}),Mv=Ft((Q,$)=>{var c=W1();$.exports=function(g){if(!c(g))throw new TypeError("Cannot use null or undefined");return g}}),aV=Ft((Q,$)=>{var c=Object.create,g;CS()()||(g=PS()),$.exports=function(){var P,S,t;return!g||g.level!==1?c:(P={},S={},t={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(e){if(e==="__proto__"){S[e]={configurable:!0,enumerable:!1,writable:!0,value:void 0};return}S[e]=t}),Object.defineProperties(P,S),Object.defineProperty(g,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:P}),function(e,r){return c(e===null?P:e,r)})}()}),PS=Ft((Q,$)=>{var c=LS(),g=Mv(),P=Object.prototype.isPrototypeOf,S=Object.defineProperty,t={configurable:!0,enumerable:!1,writable:!0,value:void 0},e;e=function(r,a){if(g(r),a===null||c(a))return r;throw new TypeError("Prototype must be null or an object")},$.exports=function(r){var a,n;return r?(r.level===2?r.set?(n=r.set,a=function(o,i){return n.call(e(o,i),i),o}):a=function(o,i){return e(o,i).__proto__=i,o}:a=function o(i,s){var f;return e(i,s),f=P.call(o.nullPolyfill,i),f&&delete o.nullPolyfill.__proto__,s===null&&(s=o.nullPolyfill),i.__proto__=s,f&&S(o.nullPolyfill,"__proto__",t),i},Object.defineProperty(a,"level",{configurable:!1,enumerable:!1,writable:!1,value:r.level})):null}(function(){var r=Object.create(null),a={},n,o=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(o){try{n=o.set,n.call(r,a)}catch{}if(Object.getPrototypeOf(r)===a)return{set:n,level:2}}return r.__proto__=a,Object.getPrototypeOf(r)===a?{level:2}:(r={},r.__proto__=a,Object.getPrototypeOf(r)===a?{level:1}:!1)}()),aV()}),oT=Ft((Q,$)=>{$.exports=CS()()?Object.setPrototypeOf:PS()}),oV=Ft((Q,$)=>{var c=LS();$.exports=function(g){if(!c(g))throw new TypeError(g+" is not an Object");return g}}),sV=Ft((Q,$)=>{var c=Object.create(null),g=Math.random;$.exports=function(){var P;do P=g().toString(36).slice(2);while(c[P]);return P}}),vx=Ft((Q,$)=>{var c=void 0;$.exports=function(g){return g!==c&&g!==null}}),sT=Ft((Q,$)=>{var c=vx(),g={object:!0,function:!0,undefined:!0};$.exports=function(P){return c(P)?hasOwnProperty.call(g,typeof P):!1}}),lV=Ft((Q,$)=>{var c=sT();$.exports=function(g){if(!c(g))return!1;try{return g.constructor?g.constructor.prototype===g:!1}catch{return!1}}}),uV=Ft((Q,$)=>{var c=lV();$.exports=function(g){if(typeof g!="function"||!hasOwnProperty.call(g,"length"))return!1;try{if(typeof g.length!="number"||typeof g.call!="function"||typeof g.apply!="function")return!1}catch{return!1}return!c(g)}}),zS=Ft((Q,$)=>{var c=uV(),g=/^\s*class[\s{/}]/,P=Function.prototype.toString;$.exports=function(S){return!(!c(S)||g.test(P.call(S)))}}),cV=Ft((Q,$)=>{$.exports=function(){var c=Object.assign,g;return typeof c!="function"?!1:(g={foo:"raz"},c(g,{bar:"dwa"},{trzy:"trzy"}),g.foo+g.bar+g.trzy==="razdwatrzy")}}),hV=Ft((Q,$)=>{$.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}),fV=Ft((Q,$)=>{var c=W1(),g=Object.keys;$.exports=function(P){return g(c(P)?Object(P):P)}}),dV=Ft((Q,$)=>{$.exports=hV()()?Object.keys:fV()}),pV=Ft((Q,$)=>{var c=dV(),g=Mv(),P=Math.max;$.exports=function(S,t){var e,r,a=P(arguments.length,2),n;for(S=Object(g(S)),n=function(o){try{S[o]=t[o]}catch(i){e||(e=i)}},r=1;r<a;++r)t=arguments[r],c(t).forEach(n);if(e!==void 0)throw e;return S}}),lT=Ft((Q,$)=>{$.exports=cV()()?Object.assign:pV()}),IS=Ft((Q,$)=>{var c=W1(),g=Array.prototype.forEach,P=Object.create,S=function(t,e){var r;for(r in t)e[r]=t[r]};$.exports=function(t){var e=P(null);return g.call(arguments,function(r){c(r)&&S(Object(r),e)}),e}}),mV=Ft((Q,$)=>{var c="razdwatrzy";$.exports=function(){return typeof c.contains!="function"?!1:c.contains("dwa")===!0&&c.contains("foo")===!1}}),gV=Ft((Q,$)=>{var c=String.prototype.indexOf;$.exports=function(g){return c.call(this,g,arguments[1])>-1}}),OS=Ft((Q,$)=>{$.exports=mV()()?String.prototype.contains:gV()}),Sv=Ft((Q,$)=>{var c=vx(),g=zS(),P=lT(),S=IS(),t=OS(),e=$.exports=function(r,a){var n,o,i,s,f;return arguments.length<2||typeof r!="string"?(s=a,a=r,r=null):s=arguments[2],c(r)?(n=t.call(r,"c"),o=t.call(r,"e"),i=t.call(r,"w")):(n=i=!0,o=!1),f={value:a,configurable:n,enumerable:o,writable:i},s?P(S(s),f):f};e.gs=function(r,a,n){var o,i,s,f;return typeof r!="string"?(s=n,n=a,a=r,r=null):s=arguments[3],c(a)?g(a)?c(n)?g(n)||(s=n,n=void 0):n=void 0:(s=a,a=n=void 0):a=void 0,c(r)?(o=t.call(r,"c"),i=t.call(r,"e")):(o=!0,i=!1),f={get:a,set:n,configurable:o,enumerable:i},s?P(S(s),f):f}}),_3=Ft((Q,$)=>{var c=Object.prototype.toString,g=c.call(function(){return arguments}());$.exports=function(P){return c.call(P)===g}}),b3=Ft((Q,$)=>{var c=Object.prototype.toString,g=c.call("");$.exports=function(P){return typeof P=="string"||P&&typeof P=="object"&&(P instanceof String||c.call(P)===g)||!1}}),vV=Ft((Q,$)=>{$.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}),yV=Ft((Q,$)=>{var c=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};$.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return c()}try{return __global__||c()}finally{delete Object.prototype.__global__}}()}),w3=Ft((Q,$)=>{$.exports=vV()()?globalThis:yV()}),xV=Ft((Q,$)=>{var c=w3(),g={object:!0,symbol:!0};$.exports=function(){var P=c.Symbol,S;if(typeof P!="function")return!1;S=P("test symbol");try{String(S)}catch{return!1}return!(!g[typeof P.iterator]||!g[typeof P.toPrimitive]||!g[typeof P.toStringTag])}}),_V=Ft((Q,$)=>{$.exports=function(c){return c?typeof c=="symbol"?!0:!c.constructor||c.constructor.name!=="Symbol"?!1:c[c.constructor.toStringTag]==="Symbol":!1}}),DS=Ft((Q,$)=>{var c=_V();$.exports=function(g){if(!c(g))throw new TypeError(g+" is not a symbol");return g}}),bV=Ft((Q,$)=>{var c=Sv(),g=Object.create,P=Object.defineProperty,S=Object.prototype,t=g(null);$.exports=function(e){for(var r=0,a,n;t[e+(r||"")];)++r;return e+=r||"",t[e]=!0,a="@@"+e,P(S,a,c.gs(null,function(o){n||(n=!0,P(this,a,c(o)),n=!1)})),a}}),wV=Ft((Q,$)=>{var c=Sv(),g=w3().Symbol;$.exports=function(P){return Object.defineProperties(P,{hasInstance:c("",g&&g.hasInstance||P("hasInstance")),isConcatSpreadable:c("",g&&g.isConcatSpreadable||P("isConcatSpreadable")),iterator:c("",g&&g.iterator||P("iterator")),match:c("",g&&g.match||P("match")),replace:c("",g&&g.replace||P("replace")),search:c("",g&&g.search||P("search")),species:c("",g&&g.species||P("species")),split:c("",g&&g.split||P("split")),toPrimitive:c("",g&&g.toPrimitive||P("toPrimitive")),toStringTag:c("",g&&g.toStringTag||P("toStringTag")),unscopables:c("",g&&g.unscopables||P("unscopables"))})}}),kV=Ft((Q,$)=>{var c=Sv(),g=DS(),P=Object.create(null);$.exports=function(S){return Object.defineProperties(S,{for:c(function(t){return P[t]?P[t]:P[t]=S(String(t))}),keyFor:c(function(t){var e;g(t);for(e in P)if(P[e]===t)return e})})}}),TV=Ft((Q,$)=>{var c=Sv(),g=DS(),P=w3().Symbol,S=bV(),t=wV(),e=kV(),r=Object.create,a=Object.defineProperties,n=Object.defineProperty,o,i,s;if(typeof P=="function")try{String(P()),s=!0}catch{}else P=null;i=function(f){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return o(f)},$.exports=o=function f(x){var y;if(this instanceof f)throw new TypeError("Symbol is not a constructor");return s?P(x):(y=r(i.prototype),x=x===void 0?"":String(x),a(y,{__description__:c("",x),__name__:c("",S(x))}))},t(o),e(o),a(i.prototype,{constructor:c(o),toString:c("",function(){return this.__name__})}),a(o.prototype,{toString:c(function(){return"Symbol ("+g(this).__description__+")"}),valueOf:c(function(){return g(this)})}),n(o.prototype,o.toPrimitive,c("",function(){var f=g(this);return typeof f=="symbol"?f:f.toString()})),n(o.prototype,o.toStringTag,c("c","Symbol")),n(i.prototype,o.toStringTag,c("c",o.prototype[o.toStringTag])),n(i.prototype,o.toPrimitive,c("c",o.prototype[o.toPrimitive]))}),q1=Ft((Q,$)=>{$.exports=xV()()?w3().Symbol:TV()}),AV=Ft((Q,$)=>{var c=Mv();$.exports=function(){return c(this).length=0,this}}),pb=Ft((Q,$)=>{$.exports=function(c){if(typeof c!="function")throw new TypeError(c+" is not a function");return c}}),MV=Ft((Q,$)=>{var c=vx(),g=sT(),P=Object.prototype.toString;$.exports=function(S){if(!c(S))return null;if(g(S)){var t=S.toString;if(typeof t!="function"||t===P)return null}try{return""+S}catch{return null}}}),SV=Ft((Q,$)=>{$.exports=function(c){try{return c.toString()}catch{try{return String(c)}catch{return null}}}}),EV=Ft((Q,$)=>{var c=SV(),g=/[\n\r\u2028\u2029]/g;$.exports=function(P){var S=c(P);return S===null?"<Non-coercible to string value>":(S.length>100&&(S=S.slice(0,99)+"…"),S=S.replace(g,function(t){switch(t){case`
`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),S)}}),FS=Ft((Q,$)=>{var c=vx(),g=sT(),P=MV(),S=EV(),t=function(e,r){return e.replace("%v",S(r))};$.exports=function(e,r,a){if(!g(a))throw new TypeError(t(r,e));if(!c(e)){if("default"in a)return a.default;if(a.isOptional)return null}var n=P(a.errorMessage);throw c(n)||(n=r),new TypeError(t(n,e))}}),CV=Ft((Q,$)=>{var c=FS(),g=vx();$.exports=function(P){return g(P)?P:c(P,"Cannot use %v",arguments[1])}}),LV=Ft((Q,$)=>{var c=FS(),g=zS();$.exports=function(P){return g(P)?P:c(P,"%v is not a plain function",arguments[1])}}),PV=Ft((Q,$)=>{$.exports=function(){var c=Array.from,g,P;return typeof c!="function"?!1:(g=["raz","dwa"],P=c(g),!!(P&&P!==g&&P[1]==="dwa"))}}),zV=Ft((Q,$)=>{var c=Object.prototype.toString,g=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);$.exports=function(P){return typeof P=="function"&&g(c.call(P))}}),IV=Ft((Q,$)=>{$.exports=function(){var c=Math.sign;return typeof c!="function"?!1:c(10)===1&&c(-20)===-1}}),OV=Ft((Q,$)=>{$.exports=function(c){return c=Number(c),isNaN(c)||c===0?c:c>0?1:-1}}),DV=Ft((Q,$)=>{$.exports=IV()()?Math.sign:OV()}),FV=Ft((Q,$)=>{var c=DV(),g=Math.abs,P=Math.floor;$.exports=function(S){return isNaN(S)?0:(S=Number(S),S===0||!isFinite(S)?S:c(S)*P(g(S)))}}),RV=Ft((Q,$)=>{var c=FV(),g=Math.max;$.exports=function(P){return g(0,c(P))}}),BV=Ft((Q,$)=>{var c=q1().iterator,g=_3(),P=zV(),S=RV(),t=pb(),e=Mv(),r=W1(),a=b3(),n=Array.isArray,o=Function.prototype.call,i={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;$.exports=function(f){var x=arguments[1],y=arguments[2],v,T,u,b,_,C,M,E,A,h;if(f=Object(e(f)),r(x)&&t(x),!this||this===Array||!P(this)){if(!x){if(g(f))return _=f.length,_!==1?Array.apply(null,f):(b=new Array(1),b[0]=f[0],b);if(n(f)){for(b=new Array(_=f.length),T=0;T<_;++T)b[T]=f[T];return b}}b=[]}else v=this;if(!n(f)){if((A=f[c])!==void 0){for(M=t(A).call(f),v&&(b=new v),E=M.next(),T=0;!E.done;)h=x?o.call(x,y,E.value,T):E.value,v?(i.value=h,s(b,T,i)):b[T]=h,E=M.next(),++T;_=T}else if(a(f)){for(_=f.length,v&&(b=new v),T=0,u=0;T<_;++T)h=f[T],T+1<_&&(C=h.charCodeAt(0),C>=55296&&C<=56319&&(h+=f[++T])),h=x?o.call(x,y,h,u):h,v?(i.value=h,s(b,u,i)):b[u]=h,++u;_=u}}if(_===void 0)for(_=S(f.length),v&&(b=new v(_)),T=0;T<_;++T)h=x?o.call(x,y,f[T],T):f[T],v?(i.value=h,s(b,T,i)):b[T]=h;return v&&(i.value=null,b.length=_),b}}),NV=Ft((Q,$)=>{$.exports=PV()()?Array.from:BV()}),jV=Ft((Q,$)=>{var c=NV(),g=lT(),P=Mv();$.exports=function(S){var t=Object(P(S)),e=arguments[1],r=Object(arguments[2]);if(t!==S&&!e)return t;var a={};return e?c(e,function(n){(r.ensure||n in S)&&(a[n]=S[n])}):g(a,S),a}}),UV=Ft((Q,$)=>{var c=pb(),g=Mv(),P=Function.prototype.bind,S=Function.prototype.call,t=Object.keys,e=Object.prototype.propertyIsEnumerable;$.exports=function(r,a){return function(n,o){var i,s=arguments[2],f=arguments[3];return n=Object(g(n)),c(o),i=t(n),f&&i.sort(typeof f=="function"?P.call(f,n):void 0),typeof r!="function"&&(r=i[r]),S.call(r,i,function(x,y){return e.call(n,x)?S.call(o,s,n[x],x,n,y):a})}}}),VV=Ft((Q,$)=>{$.exports=UV()("forEach")}),HV=Ft((Q,$)=>{var c=pb(),g=VV(),P=Function.prototype.call;$.exports=function(S,t){var e={},r=arguments[2];return c(t),g(S,function(a,n,o,i){e[n]=P.call(t,r,a,n,o,i)}),e}}),WV=Ft((Q,$)=>{var c=vx(),g=CV(),P=LV(),S=jV(),t=IS(),e=HV(),r=Function.prototype.bind,a=Object.defineProperty,n=Object.prototype.hasOwnProperty,o;o=function(i,s,f){var x=g(s)&&P(s.value),y;return y=S(s),delete y.writable,delete y.value,y.get=function(){return!f.overwriteDefinition&&n.call(this,i)?x:(s.value=r.call(x,f.resolveContext?f.resolveContext(this):this),a(this,i,s),this[i])},y},$.exports=function(i){var s=t(arguments[1]);return c(s.resolveContext)&&P(s.resolveContext),e(i,function(f,x){return o(x,f,s)})}}),RS=Ft((Q,$)=>{var c=AV(),g=lT(),P=pb(),S=Mv(),t=Sv(),e=WV(),r=q1(),a=Object.defineProperty,n=Object.defineProperties,o;$.exports=o=function(i,s){if(!(this instanceof o))throw new TypeError("Constructor requires 'new'");n(this,{__list__:t("w",S(i)),__context__:t("w",s),__nextIndex__:t("w",0)}),s&&(P(s.on),s.on("_add",this._onAdd),s.on("_delete",this._onDelete),s.on("_clear",this._onClear))},delete o.prototype.constructor,n(o.prototype,g({_next:t(function(){var i;if(this.__list__){if(this.__redo__&&(i=this.__redo__.shift(),i!==void 0))return i;if(this.__nextIndex__<this.__list__.length)return this.__nextIndex__++;this._unBind()}}),next:t(function(){return this._createResult(this._next())}),_createResult:t(function(i){return i===void 0?{done:!0,value:void 0}:{done:!1,value:this._resolve(i)}}),_resolve:t(function(i){return this.__list__[i]}),_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(i){if(!(i>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){a(this,"__redo__",t("c",[i]));return}this.__redo__.forEach(function(s,f){s>=i&&(this.__redo__[f]=++s)},this),this.__redo__.push(i)}}),_onDelete:t(function(i){var s;i>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(i),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(f,x){f>i&&(this.__redo__[x]=--f)},this)))}),_onClear:t(function(){this.__redo__&&c.call(this.__redo__),this.__nextIndex__=0})}))),a(o.prototype,r.iterator,t(function(){return this}))}),qV=Ft((Q,$)=>{var c=oT(),g=OS(),P=Sv(),S=q1(),t=RS(),e=Object.defineProperty,r;r=$.exports=function(a,n){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");t.call(this,a),n?g.call(n,"key+value")?n="key+value":g.call(n,"key")?n="key":n="value":n="value",e(this,"__kind__",P("",n))},c&&c(r,t),delete r.prototype.constructor,r.prototype=Object.create(t.prototype,{_resolve:P(function(a){return this.__kind__==="value"?this.__list__[a]:this.__kind__==="key+value"?[a,this.__list__[a]]:a})}),e(r.prototype,S.toStringTag,P("c","Array Iterator"))}),ZV=Ft((Q,$)=>{var c=oT(),g=Sv(),P=q1(),S=RS(),t=Object.defineProperty,e;e=$.exports=function(r){if(!(this instanceof e))throw new TypeError("Constructor requires 'new'");r=String(r),S.call(this,r),t(this,"__length__",g("",r.length))},c&&c(e,S),delete e.prototype.constructor,e.prototype=Object.create(S.prototype,{_next:g(function(){if(this.__list__){if(this.__nextIndex__<this.__length__)return this.__nextIndex__++;this._unBind()}}),_resolve:g(function(r){var a=this.__list__[r],n;return this.__nextIndex__===this.__length__?a:(n=a.charCodeAt(0),n>=55296&&n<=56319?a+this.__list__[this.__nextIndex__++]:a)})}),t(e.prototype,P.toStringTag,g("c","String Iterator"))}),$V=Ft((Q,$)=>{var c=_3(),g=W1(),P=b3(),S=q1().iterator,t=Array.isArray;$.exports=function(e){return g(e)?t(e)||P(e)||c(e)?!0:typeof e[S]=="function":!1}}),GV=Ft((Q,$)=>{var c=$V();$.exports=function(g){if(!c(g))throw new TypeError(g+" is not iterable");return g}}),BS=Ft((Q,$)=>{var c=_3(),g=b3(),P=qV(),S=ZV(),t=GV(),e=q1().iterator;$.exports=function(r){return typeof t(r)[e]=="function"?r[e]():c(r)?new P(r):g(r)?new S(r):new P(r)}}),YV=Ft((Q,$)=>{var c=_3(),g=pb(),P=b3(),S=BS(),t=Array.isArray,e=Function.prototype.call,r=Array.prototype.some;$.exports=function(a,n){var o,i=arguments[2],s,f,x,y,v,T,u;if(t(a)||c(a)?o="array":P(a)?o="string":a=S(a),g(n),f=function(){x=!0},o==="array"){r.call(a,function(b){return e.call(n,i,b,f),x});return}if(o==="string"){for(v=a.length,y=0;y<v&&(T=a[y],y+1<v&&(u=T.charCodeAt(0),u>=55296&&u<=56319&&(T+=a[++y])),e.call(n,i,T,f),!x);++y);return}for(s=a.next();!s.done;){if(e.call(n,i,s.value,f),x)return;s=a.next()}}}),KV=Ft((Q,$)=>{$.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}),XV=Ft((Q,$)=>{var c=W1(),g=oT(),P=oV(),S=Mv(),t=sV(),e=Sv(),r=BS(),a=YV(),n=q1().toStringTag,o=KV(),i=Array.isArray,s=Object.defineProperty,f=Object.prototype.hasOwnProperty,x=Object.getPrototypeOf,y;$.exports=y=function(){var v=arguments[0],T;if(!(this instanceof y))throw new TypeError("Constructor requires 'new'");return T=o&&g&&WeakMap!==y?g(new WeakMap,x(this)):this,c(v)&&(i(v)||(v=r(v))),s(T,"__weakMapData__",e("c","$weakMap$"+t())),v&&a(v,function(u){S(u),T.set(u[0],u[1])}),T},o&&(g&&g(y,WeakMap),y.prototype=Object.create(WeakMap.prototype,{constructor:e(y)})),Object.defineProperties(y.prototype,{delete:e(function(v){return f.call(P(v),this.__weakMapData__)?(delete v[this.__weakMapData__],!0):!1}),get:e(function(v){if(f.call(P(v),this.__weakMapData__))return v[this.__weakMapData__]}),has:e(function(v){return f.call(P(v),this.__weakMapData__)}),set:e(function(v,T){return s(P(v),this.__weakMapData__,e("c",T)),this}),toString:e(function(){return"[object WeakMap]"})}),s(y.prototype,n,e("c","WeakMap"))}),NS=Ft((Q,$)=>{$.exports=nV()()?WeakMap:XV()}),JV=Ft((Q,$)=>{$.exports=function(c,g,P){if(typeof Array.prototype.findIndex=="function")return c.findIndex(g,P);if(typeof g!="function")throw new TypeError("predicate must be a function");var S=Object(c),t=S.length;if(t===0)return-1;for(var e=0;e<t;e++)if(g.call(P,S[e],e,S))return e;return-1}}),jS=Ft((Q,$)=>{var c=N1(),g=px(),P=Ed(),S=Cg(),t=mx(),e=eV(),r=rV(),{float32:a,fract32:n}=aT(),o=NS(),i=db(),s=JV(),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.;
}
`,x=`
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;
}
`,y=`
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;
}
`,v=`
precision highp float;
varying vec4 fragColor;
void main() {
gl_FragColor = fragColor;
}
`,T=`
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;
}
}
}
`,u=`
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;
}
`;$.exports=b;function b(_,C){if(!(this instanceof b))return new b(_,C);if(typeof _=="function"?(C||(C={}),C.regl=_):C=_,C.length&&(C.positions=C),_=C.regl,!_.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=_._gl,this.regl=_,this.passes=[],this.shaders=b.shaders.has(_)?b.shaders.get(_):b.shaders.set(_,b.createShaders(_)).get(_),this.update(C)}b.dashMult=2,b.maxPatternLength=256,b.precisionThreshold=3e6,b.maxPoints=1e4,b.maxLines=2048,b.shaders=new o,b.createShaders=function(_){let C=_.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),M={primitive:"triangle strip",instances:_.prop("count"),count:4,offset:0,uniforms:{miterMode:(h,p)=>p.join==="round"?2:1,miterLimit:_.prop("miterLimit"),scale:_.prop("scale"),scaleFract:_.prop("scaleFract"),translateFract:_.prop("translateFract"),translate:_.prop("translate"),thickness:_.prop("thickness"),dashTexture:_.prop("dashTexture"),opacity:_.prop("opacity"),pixelRatio:_.context("pixelRatio"),id:_.prop("id"),dashLength:_.prop("dashLength"),viewport:(h,p)=>[p.viewport.x,p.viewport.y,h.viewportWidth,h.viewportHeight],depth:_.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:(h,p)=>!p.overlay},stencil:{enable:!1},scissor:{enable:!0,box:_.prop("viewport")},viewport:_.prop("viewport")},E=_(P({vert:f,frag:x,attributes:{lineEnd:{buffer:C,divisor:0,stride:8,offset:0},lineTop:{buffer:C,divisor:0,stride:8,offset:4},aCoord:{buffer:_.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:_.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:_.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:_.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:_.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},M)),A;try{A=_(P({cull:{enable:!0,face:"back"},vert:T,frag:u,attributes:{lineEnd:{buffer:C,divisor:0,stride:8,offset:0},lineTop:{buffer:C,divisor:0,stride:8,offset:4},aColor:{buffer:_.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:_.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:_.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:_.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:_.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:_.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},M))}catch{A=E}return{fill:_({primitive:"triangle",elements:(h,p)=>p.triangles,offset:0,vert:y,frag:v,uniforms:{scale:_.prop("scale"),color:_.prop("fill"),scaleFract:_.prop("scaleFract"),translateFract:_.prop("translateFract"),translate:_.prop("translate"),opacity:_.prop("opacity"),pixelRatio:_.context("pixelRatio"),id:_.prop("id"),viewport:(h,p)=>[p.viewport.x,p.viewport.y,h.viewportWidth,h.viewportHeight]},attributes:{position:{buffer:_.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:_.prop("positionFractBuffer"),stride:8,offset:8}},blend:M.blend,depth:{enable:!1},scissor:M.scissor,stencil:M.stencil,viewport:M.viewport}),rect:E,miter:A}},b.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},b.prototype.render=function(..._){_.length&&this.update(..._),this.draw()},b.prototype.draw=function(..._){return(_.length?_:this.passes).forEach((C,M)=>{if(C&&Array.isArray(C))return this.draw(...C);typeof C=="number"&&(C=this.passes[C]),C&&C.count>1&&C.opacity&&(this.regl._refresh(),C.fill&&C.triangles&&C.triangles.length>2&&this.shaders.fill(C),C.thickness&&(C.scale[0]*C.viewport.width>b.precisionThreshold||C.scale[1]*C.viewport.height>b.precisionThreshold?this.shaders.rect(C):C.join==="rect"||!C.join&&(C.thickness<=2||C.count>=b.maxPoints)?this.shaders.rect(C):this.shaders.miter(C)))}),this},b.prototype.update=function(_){if(!_)return;_.length!=null?typeof _[0]=="number"&&(_=[{positions:_}]):Array.isArray(_)||(_=[_]);let{regl:C,gl:M}=this;if(_.forEach((A,h)=>{let p=this.passes[h];if(A!==void 0){if(A===null){this.passes[h]=null;return}if(typeof A[0]=="number"&&(A={positions:A}),A=S(A,{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"}),p||(this.passes[h]=p={id:h,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:C.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:C.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:C.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:C.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},A=P({},b.defaults,A)),A.thickness!=null&&(p.thickness=parseFloat(A.thickness)),A.opacity!=null&&(p.opacity=parseFloat(A.opacity)),A.miterLimit!=null&&(p.miterLimit=parseFloat(A.miterLimit)),A.overlay!=null&&(p.overlay=!!A.overlay,h<b.maxLines&&(p.depth=2*(b.maxLines-1-h%b.maxLines)/b.maxLines-1)),A.join!=null&&(p.join=A.join),A.hole!=null&&(p.hole=A.hole),A.fill!=null&&(p.fill=A.fill?c(A.fill,"uint8"):null),A.viewport!=null&&(p.viewport=i(A.viewport)),p.viewport||(p.viewport=i([M.drawingBufferWidth,M.drawingBufferHeight])),A.close!=null&&(p.close=A.close),A.positions===null&&(A.positions=[]),A.positions){let R,O;if(A.positions.x&&A.positions.y){let F=A.positions.x,U=A.positions.y;O=p.count=Math.max(F.length,U.length),R=new Float64Array(O*2);for(let W=0;W<O;W++)R[W*2]=F[W],R[W*2+1]=U[W]}else R=t(A.positions,"float64"),O=p.count=Math.floor(R.length/2);let N=p.bounds=g(R,2);if(p.fill){let F=[],U={},W=0;for(let q=0,X=0,lt=p.count;q<lt;q++){let yt=R[q*2],pt=R[q*2+1];isNaN(yt)||isNaN(pt)||yt==null||pt==null?(yt=R[W*2],pt=R[W*2+1],U[q]=W):W=q,F[X++]=yt,F[X++]=pt}if(A.splitNull){p.count-1 in U||(U[p.count]=p.count-1);let q=Object.keys(U).map(Number).sort((pt,st)=>pt-st),X=[],lt=0,yt=p.hole!=null?p.hole[0]:null;if(yt!=null){let pt=s(q,st=>st>=yt);q=q.slice(0,pt),q.push(yt)}for(let pt=0;pt<q.length;pt++){let st=F.slice(lt*2,q[pt]*2).concat(yt?F.slice(yt*2):[]),tt=(p.hole||[]).map(rt=>rt-yt+(q[pt]-lt)),dt=e(st,tt);dt=dt.map(rt=>rt+lt+(rt+lt<q[pt]?0:yt-q[pt])),X.push(...dt),lt=q[pt]+1}for(let pt=0,st=X.length;pt<st;pt++)U[X[pt]]!=null&&(X[pt]=U[X[pt]]);p.triangles=X}else{let q=e(F,p.hole||[]);for(let X=0,lt=q.length;X<lt;X++)U[q[X]]!=null&&(q[X]=U[q[X]]);p.triangles=q}}let V=new Float64Array(R);r(V,2,N);let H=new Float64Array(O*2+6);p.close?R[0]===R[O*2-2]&&R[1]===R[O*2-1]?(H[0]=V[O*2-4],H[1]=V[O*2-3]):(H[0]=V[O*2-2],H[1]=V[O*2-1]):(H[0]=V[0],H[1]=V[1]),H.set(V,2),p.close?R[0]===R[O*2-2]&&R[1]===R[O*2-1]?(H[O*2+2]=V[2],H[O*2+3]=V[3],p.count-=1):(H[O*2+2]=V[0],H[O*2+3]=V[1],H[O*2+4]=V[2],H[O*2+5]=V[3]):(H[O*2+2]=V[O*2-2],H[O*2+3]=V[O*2-1],H[O*2+4]=V[O*2-2],H[O*2+5]=V[O*2-1]);var k=a(H);p.positionBuffer(k);var w=n(H,k);p.positionFractBuffer(w)}if(A.range?p.range=A.range:p.range||(p.range=p.bounds),(A.range||A.positions)&&p.count){let R=p.bounds,O=R[2]-R[0],N=R[3]-R[1],V=p.range[2]-p.range[0],H=p.range[3]-p.range[1];p.scale=[O/V,N/H],p.translate=[-p.range[0]/V+R[0]/V||0,-p.range[1]/H+R[1]/H||0],p.scaleFract=n(p.scale),p.translateFract=n(p.translate)}if(A.dashes){let R=0,O;if(!A.dashes||A.dashes.length<2)R=1,O=new Uint8Array([255,255,255,255,255,255,255,255]);else{R=0;for(let H=0;H<A.dashes.length;++H)R+=A.dashes[H];O=new Uint8Array(R*b.dashMult);let N=0,V=255;for(let H=0;H<2;H++)for(let F=0;F<A.dashes.length;++F){for(let U=0,W=A.dashes[F]*b.dashMult*.5;U<W;++U)O[N++]=V;V^=255}}p.dashLength=R,p.dashTexture({channels:1,data:O,width:O.length,height:1,mag:"linear",min:"linear"},0,0)}if(A.color){let R=p.count,O=A.color;O||(O="transparent");let N=new Uint8Array(R*4+4);if(!Array.isArray(O)||typeof O[0]=="number"){let V=c(O,"uint8");for(let H=0;H<R+1;H++)N.set(V,H*4)}else{for(let V=0;V<R;V++){let H=c(O[V],"uint8");N.set(H,V*4)}N.set(c(O[0],"uint8"),R*4)}p.colorBuffer({usage:"dynamic",type:"uint8",data:N})}}}),_.length<this.passes.length){for(let A=_.length;A<this.passes.length;A++){let h=this.passes[A];h&&(h.colorBuffer.destroy(),h.positionBuffer.destroy(),h.dashTexture.destroy())}this.passes.length=_.length}let E=[];for(let A=0;A<this.passes.length;A++)this.passes[A]!==null&&E.push(this.passes[A]);return this.passes=E,this},b.prototype.destroy=function(){return this.passes.forEach(_=>{_.colorBuffer.destroy(),_.positionBuffer.destroy(),_.dashTexture.destroy()}),this.passes.length=0,this}}),QV=Ft((Q,$)=>{var c=px(),g=N1(),P=SS(),S=Cg(),t=Ed(),e=mx(),{float32:r,fract32:a}=aT();$.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(i,s){if(typeof i=="function"?(s||(s={}),s.regl=i):s=i,s.length&&(s.positions=s),i=s.regl,!i.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let f=i._gl,x,y,v,T,u,b,_={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},C=[];return T=i.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),y=i.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=i.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),u=i.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),b=i.buffer({usage:"static",type:"float",data:n}),h(s),x=i({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:i.prop("range"),lineWidth:i.prop("lineWidth"),capSize:i.prop("capSize"),opacity:i.prop("opacity"),scale:i.prop("scale"),translate:i.prop("translate"),scaleFract:i.prop("scaleFract"),translateFract:i.prop("translateFract"),viewport:(k,w)=>[w.viewport.x,w.viewport.y,k.viewportWidth,k.viewportHeight]},attributes:{color:{buffer:T,offset:(k,w)=>w.offset*4,divisor:1},position:{buffer:y,offset:(k,w)=>w.offset*8,divisor:1},positionFract:{buffer:v,offset:(k,w)=>w.offset*8,divisor:1},error:{buffer:u,offset:(k,w)=>w.offset*16,divisor:1},direction:{buffer:b,stride:24,offset:0},lineOffset:{buffer:b,stride:24,offset:8},capOffset:{buffer:b,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:i.prop("viewport")},viewport:i.prop("viewport"),stencil:!1,instances:i.prop("count"),count:n.length}),t(M,{update:h,draw:E,destroy:p,regl:i,gl:f,canvas:f.canvas,groups:C}),M;function M(k){k?h(k):k===null&&p(),E()}function E(k){if(typeof k=="number")return A(k);k&&!Array.isArray(k)&&(k=[k]),i._refresh(),C.forEach((w,R)=>{if(w){if(k&&(k[R]?w.draw=!0:w.draw=!1),!w.draw){w.draw=!0;return}A(R)}})}function A(k){typeof k=="number"&&(k=C[k]),k!=null&&k&&k.count&&k.color&&k.opacity&&k.positions&&k.positions.length>1&&(k.scaleRatio=[k.scale[0]*k.viewport.width,k.scale[1]*k.viewport.height],x(k),k.after&&k.after(k))}function h(k){if(!k)return;k.length!=null?typeof k[0]=="number"&&(k=[{positions:k}]):Array.isArray(k)||(k=[k]);let w=0,R=0;if(M.groups=C=k.map((V,H)=>{let F=C[H];if(V)typeof V=="function"?V={after:V}:typeof V[0]=="number"&&(V={positions:V});else return F;return V=S(V,{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"}),F||(C[H]=F={id:H,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},V=t({},_,V)),P(F,V,[{lineWidth:U=>+U*.5,capSize:U=>+U*.5,opacity:parseFloat,errors:U=>(U=e(U),R+=U.length,U),positions:(U,W)=>(U=e(U,"float64"),W.count=Math.floor(U.length/2),W.bounds=c(U,2),W.offset=w,w+=W.count,U)},{color:(U,W)=>{let q=W.count;if(U||(U="transparent"),!Array.isArray(U)||typeof U[0]=="number"){let lt=U;U=Array(q);for(let yt=0;yt<q;yt++)U[yt]=lt}if(U.length<q)throw Error("Not enough colors");let X=new Uint8Array(q*4);for(let lt=0;lt<q;lt++){let yt=g(U[lt],"uint8");X.set(yt,lt*4)}return X},range:(U,W,q)=>{let X=W.bounds;return U||(U=X),W.scale=[1/(U[2]-U[0]),1/(U[3]-U[1])],W.translate=[-U[0],-U[1]],W.scaleFract=a(W.scale),W.translateFract=a(W.translate),U},viewport:U=>{let W;return Array.isArray(U)?W={x:U[0],y:U[1],width:U[2]-U[0],height:U[3]-U[1]}:U?(W={x:U.x||U.left||0,y:U.y||U.top||0},U.right?W.width=U.right-W.x:W.width=U.w||U.width||0,U.bottom?W.height=U.bottom-W.y:W.height=U.h||U.height||0):W={x:0,y:0,width:f.drawingBufferWidth,height:f.drawingBufferHeight},W}}]),F}),w||R){let V=C.reduce((W,q,X)=>W+(q?q.count:0),0),H=new Float64Array(V*2),F=new Uint8Array(V*4),U=new Float32Array(V*4);C.forEach((W,q)=>{if(!W)return;let{positions:X,count:lt,offset:yt,color:pt,errors:st}=W;lt&&(F.set(pt,yt*4),U.set(st,yt*4),H.set(X,yt*2))});var O=r(H);y(O);var N=a(H,O);v(N),T(F),u(U)}}function p(){y.destroy(),v.destroy(),T.destroy(),u.destroy(),b.destroy()}}}),tH=Ft((Q,$)=>{var c=/[\'\"]/;$.exports=function(g){return g?(c.test(g.charAt(0))&&(g=g.substr(1)),c.test(g.charAt(g.length-1))&&(g=g.substr(0,g.length-1)),g):""}}),US=Ft((Q,$)=>{$.exports=["inherit","initial","unset"]}),VS=Ft((Q,$)=>{$.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}),HS=Ft((Q,$)=>{$.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}),WS=Ft((Q,$)=>{$.exports=["normal","italic","oblique"]}),qS=Ft((Q,$)=>{$.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}),eH=Ft((Q,$)=>{function c(S,t){if(typeof S!="string")return[S];var e=[S];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var r=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],a=t.escape||"___",n=!!t.flat;r.forEach(function(s){var f=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),x=[];function y(v,T,u){var b=e.push(v.slice(s[0].length,-s[1].length))-1;return x.push(b),a+b+a}e.forEach(function(v,T){for(var u,b=0;v!=u;)if(u=v,v=v.replace(f,y),b++>1e4)throw Error("References have circular dependency. Please, check them.");e[T]=v}),x=x.reverse(),e=e.map(function(v){return x.forEach(function(T){v=v.replace(new RegExp("(\\"+a+T+"\\"+a+")","g"),s[0]+"$1"+s[1])}),v})});var o=new RegExp("\\"+a+"([0-9]+)\\"+a);function i(s,f,x){for(var y=[],v,T=0;v=o.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");y.push(s.slice(0,v.index)),y.push(i(f[v[1]],f)),s=s.slice(v.index+v[0].length)}return y.push(s),y}return n?e:i(e[0],e)}function g(S,t){if(t&&t.flat){var e=t&&t.escape||"___",r=S[0],a;if(!r)return"";for(var n=new RegExp("\\"+e+"([0-9]+)\\"+e),o=0;r!=a;){if(o++>1e4)throw Error("Circular references in "+S);a=r,r=r.replace(n,i)}return r}return S.reduce(function s(f,x){return Array.isArray(x)&&(x=x.reduce(s,"")),f+x},"");function i(s,f){if(S[f]==null)throw Error("Reference "+f+"is undefined");return S[f]}}function P(S,t){return Array.isArray(S)?g(S,t):c(S,t)}P.parse=c,P.stringify=g,$.exports=P}),rH=Ft((Q,$)=>{var c=eH();$.exports=function(g,P,S){if(g==null)throw Error("First argument should be a string");if(P==null)throw Error("Separator should be a string or a RegExp");S?(typeof S=="string"||Array.isArray(S))&&(S={ignore:S}):S={},S.escape==null&&(S.escape=!0),S.ignore==null?S.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof S.ignore=="string"&&(S.ignore=[S.ignore]),S.ignore=S.ignore.map(function(s){return s.length===1&&(s=s+s),s}));var t=c.parse(g,{flat:!0,brackets:S.ignore}),e=t[0],r=e.split(P);if(S.escape){for(var a=[],n=0;n<r.length;n++){var o=r[n],i=r[n+1];o[o.length-1]==="\\"&&o[o.length-2]!=="\\"?(a.push(o+P+i),n++):a.push(o)}r=a}for(var n=0;n<r.length;n++)t[0]=r[n],r[n]=c.stringify(t,{flat:!0});return r}}),nH=Ft((Q,$)=>{$.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]}),ZS=Ft((Q,$)=>{var c=nH();$.exports={isSize:function(g){return/^[\d\.]/.test(g)||g.indexOf("/")!==-1||c.indexOf(g)!==-1}}}),iH=Ft((Q,$)=>{var c=tH(),g=US(),P=VS(),S=HS(),t=WS(),e=qS(),r=rH(),a=ZS().isSize;$.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(P.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"]},x=r(s,/\s+/),y;y=x.shift();){if(g.indexOf(y)!==-1)return["style","variant","weight","stretch"].forEach(function(T){f[T]=y}),n[s]=f;if(t.indexOf(y)!==-1){f.style=y;continue}if(y==="normal"||y==="small-caps"){f.variant=y;continue}if(e.indexOf(y)!==-1){f.stretch=y;continue}if(S.indexOf(y)!==-1){f.weight=y;continue}if(a(y)){var v=r(y,"/");if(f.size=v[0],v[1]!=null?f.lineHeight=i(v[1]):x[0]==="/"&&(x.shift(),f.lineHeight=i(x.shift())),!x.length)throw new Error("Missing required font-family.");return f.family=r(x.join(" "),/\s*,\s*/).map(c),n[s]=f}throw new Error("Unknown or unsupported font token: "+y)}throw new Error("Missing required font-size.")}function i(s){var f=parseFloat(s);return f.toString()===s?f:s}}),$S=Ft((Q,$)=>{var c=Cg(),g=ZS().isSize,P=s(US()),S=s(VS()),t=s(HS()),e=s(WS()),r=s(qS()),a={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"};$.exports=function(f){if(f=c(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&&i(f.system,S),f.system;if(i(f.style,e),i(f.variant,a),i(f.weight,t),i(f.stretch,r),f.size==null&&(f.size=o.size),typeof f.size=="number"&&(f.size+="px"),!g)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(y){return n[y]?y:'"'+y+'"'}).join(", "));var x=[];return x.push(f.style),f.variant!==f.style&&x.push(f.variant),f.weight!==f.variant&&f.weight!==f.style&&x.push(f.weight),f.stretch!==f.weight&&f.stretch!==f.variant&&f.stretch!==f.style&&x.push(f.stretch),x.push(f.size+(f.lineHeight==null||f.lineHeight==="normal"||f.lineHeight+""=="1"?"":"/"+f.lineHeight)),x.push(f.family),x.filter(Boolean).join(" ")};function i(f,x){if(f&&!x[f]&&!P[f])throw Error("Unknown keyword `"+f+"`");return f}function s(f){for(var x={},y=0;y<f.length;y++)x[f[y]]=1;return x}}),aH=Ft((Q,$)=>{$.exports={parse:iH(),stringify:$S()}}),oH=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?$.exports=g():c.createREGL=g()})(Q,function(){var c=function(_e,kr){for(var Lr=Object.keys(kr),Dn=0;Dn<Lr.length;++Dn)_e[Lr[Dn]]=kr[Lr[Dn]];return _e},g=0,P=0,S=5,t=6;function e(_e,kr){this.id=g++,this.type=_e,this.data=kr}function r(_e){return _e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function a(_e){if(_e.length===0)return[];var kr=_e.charAt(0),Lr=_e.charAt(_e.length-1);if(_e.length>1&&kr===Lr&&(kr==='"'||kr==="'"))return['"'+r(_e.substr(1,_e.length-2))+'"'];var Dn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(_e);if(Dn)return a(_e.substr(0,Dn.index)).concat(a(Dn[1])).concat(a(_e.substr(Dn.index+Dn[0].length)));var oi=_e.split(".");if(oi.length===1)return['"'+r(_e)+'"'];for(var Jn=[],gn=0;gn<oi.length;++gn)Jn=Jn.concat(a(oi[gn]));return Jn}function n(_e){return"["+a(_e).join("][")+"]"}function o(_e,kr){return new e(_e,n(kr+""))}function i(_e){return typeof _e=="function"&&!_e._reglType||_e instanceof e}function s(_e,kr){if(typeof _e=="function")return new e(P,_e);if(typeof _e=="number"||typeof _e=="boolean")return new e(S,_e);if(Array.isArray(_e))return new e(t,_e.map(function(Lr,Dn){return s(Lr)}));if(_e instanceof e)return _e}var f={DynamicVariable:e,define:o,isDynamic:i,unbox:s,accessor:n},x={next:typeof requestAnimationFrame=="function"?function(_e){return requestAnimationFrame(_e)}:function(_e){return setTimeout(_e,16)},cancel:typeof cancelAnimationFrame=="function"?function(_e){return cancelAnimationFrame(_e)}:clearTimeout},y=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function v(){var _e={"":0},kr=[""];return{id:function(Lr){var Dn=_e[Lr];return Dn||(Dn=_e[Lr]=kr.length,kr.push(Lr),Dn)},str:function(Lr){return kr[Lr]}}}function T(_e,kr,Lr){var Dn=document.createElement("canvas");c(Dn.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),_e.appendChild(Dn),_e===document.body&&(Dn.style.position="absolute",c(_e.style,{margin:0,padding:0}));function oi(){var ni=window.innerWidth,Yi=window.innerHeight;if(_e!==document.body){var Ui=Dn.getBoundingClientRect();ni=Ui.right-Ui.left,Yi=Ui.bottom-Ui.top}Dn.width=Lr*ni,Dn.height=Lr*Yi}var Jn;_e!==document.body&&typeof ResizeObserver=="function"?(Jn=new ResizeObserver(function(){setTimeout(oi)}),Jn.observe(_e)):window.addEventListener("resize",oi,!1);function gn(){Jn?Jn.disconnect():window.removeEventListener("resize",oi),_e.removeChild(Dn)}return oi(),{canvas:Dn,onDestroy:gn}}function u(_e,kr){function Lr(Dn){try{return _e.getContext(Dn,kr)}catch{return null}}return Lr("webgl")||Lr("experimental-webgl")||Lr("webgl-experimental")}function b(_e){return typeof _e.nodeName=="string"&&typeof _e.appendChild=="function"&&typeof _e.getBoundingClientRect=="function"}function _(_e){return typeof _e.drawArrays=="function"||typeof _e.drawElements=="function"}function C(_e){return typeof _e=="string"?_e.split():_e}function M(_e){return typeof _e=="string"?document.querySelector(_e):_e}function E(_e){var kr=_e||{},Lr,Dn,oi,Jn,gn={},ni=[],Yi=[],Ui=typeof window>"u"?1:window.devicePixelRatio,va=!1,Za={},Ba=function(hn){},ta=function(){};if(typeof kr=="string"?Lr=document.querySelector(kr):typeof kr=="object"&&(b(kr)?Lr=kr:_(kr)?(Jn=kr,oi=Jn.canvas):("gl"in kr?Jn=kr.gl:"canvas"in kr?oi=M(kr.canvas):"container"in kr&&(Dn=M(kr.container)),"attributes"in kr&&(gn=kr.attributes),"extensions"in kr&&(ni=C(kr.extensions)),"optionalExtensions"in kr&&(Yi=C(kr.optionalExtensions)),"onDone"in kr&&(Ba=kr.onDone),"profile"in kr&&(va=!!kr.profile),"pixelRatio"in kr&&(Ui=+kr.pixelRatio),"cachedCode"in kr&&(Za=kr.cachedCode))),Lr&&(Lr.nodeName.toLowerCase()==="canvas"?oi=Lr:Dn=Lr),!Jn){if(!oi){var wi=T(Dn||document.body,Ba,Ui);if(!wi)return null;oi=wi.canvas,ta=wi.onDestroy}gn.premultipliedAlpha===void 0&&(gn.premultipliedAlpha=!0),Jn=u(oi,gn)}return Jn?{gl:Jn,canvas:oi,container:Dn,extensions:ni,optionalExtensions:Yi,pixelRatio:Ui,profile:va,cachedCode:Za,onDone:Ba,onDestroy:ta}:(ta(),Ba("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function A(_e,kr){var Lr={};function Dn(gn){var ni=gn.toLowerCase(),Yi;try{Yi=Lr[ni]=_e.getExtension(ni)}catch{}return!!Yi}for(var oi=0;oi<kr.extensions.length;++oi){var Jn=kr.extensions[oi];if(!Dn(Jn))return kr.onDestroy(),kr.onDone('"'+Jn+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return kr.optionalExtensions.forEach(Dn),{extensions:Lr,restore:function(){Object.keys(Lr).forEach(function(gn){if(Lr[gn]&&!Dn(gn))throw new Error("(regl): error restoring extension "+gn)})}}}function h(_e,kr){for(var Lr=Array(_e),Dn=0;Dn<_e;++Dn)Lr[Dn]=kr(Dn);return Lr}var p=5120,k=5121,w=5122,R=5123,O=5124,N=5125,V=5126;function H(_e){for(var kr=16;kr<=1<<28;kr*=16)if(_e<=kr)return kr;return 0}function F(_e){var kr,Lr;return kr=(_e>65535)<<4,_e>>>=kr,Lr=(_e>255)<<3,_e>>>=Lr,kr|=Lr,Lr=(_e>15)<<2,_e>>>=Lr,kr|=Lr,Lr=(_e>3)<<1,_e>>>=Lr,kr|=Lr,kr|_e>>1}function U(){var _e=h(8,function(){return[]});function kr(Jn){var gn=H(Jn),ni=_e[F(gn)>>2];return ni.length>0?ni.pop():new ArrayBuffer(gn)}function Lr(Jn){_e[F(Jn.byteLength)>>2].push(Jn)}function Dn(Jn,gn){var ni=null;switch(Jn){case p:ni=new Int8Array(kr(gn),0,gn);break;case k:ni=new Uint8Array(kr(gn),0,gn);break;case w:ni=new Int16Array(kr(2*gn),0,gn);break;case R:ni=new Uint16Array(kr(2*gn),0,gn);break;case O:ni=new Int32Array(kr(4*gn),0,gn);break;case N:ni=new Uint32Array(kr(4*gn),0,gn);break;case V:ni=new Float32Array(kr(4*gn),0,gn);break;default:return null}return ni.length!==gn?ni.subarray(0,gn):ni}function oi(Jn){Lr(Jn.buffer)}return{alloc:kr,free:Lr,allocType:Dn,freeType:oi}}var W=U();W.zero=U();var q=3408,X=3410,lt=3411,yt=3412,pt=3413,st=3414,tt=3415,dt=33901,rt=33902,at=3379,vt=3386,it=34921,Y=36347,ft=36348,ut=35661,wt=35660,zt=34930,Pt=36349,Wt=34076,Ht=34024,Jt=7936,ge=7937,he=7938,de=35724,se=34047,Tt=36063,Lt=34852,Mt=3553,te=34067,ve=34069,oe=33984,Te=6408,He=5126,Ge=5121,cr=36160,ur=36053,jr=36064,Hr=16384,br=function(_e,kr){var Lr=1;kr.ext_texture_filter_anisotropic&&(Lr=_e.getParameter(se));var Dn=1,oi=1;kr.webgl_draw_buffers&&(Dn=_e.getParameter(Lt),oi=_e.getParameter(Tt));var Jn=!!kr.oes_texture_float;if(Jn){var gn=_e.createTexture();_e.bindTexture(Mt,gn),_e.texImage2D(Mt,0,Te,1,1,0,Te,He,null);var ni=_e.createFramebuffer();if(_e.bindFramebuffer(cr,ni),_e.framebufferTexture2D(cr,jr,Mt,gn,0),_e.bindTexture(Mt,null),_e.checkFramebufferStatus(cr)!==ur)Jn=!1;else{_e.viewport(0,0,1,1),_e.clearColor(1,0,0,1),_e.clear(Hr);var Yi=W.allocType(He,4);_e.readPixels(0,0,1,1,Te,He,Yi),_e.getError()?Jn=!1:(_e.deleteFramebuffer(ni),_e.deleteTexture(gn),Jn=Yi[0]===1),W.freeType(Yi)}}var Ui=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),va=!0;if(!Ui){var Za=_e.createTexture(),Ba=W.allocType(Ge,36);_e.activeTexture(oe),_e.bindTexture(te,Za),_e.texImage2D(ve,0,Te,3,3,0,Te,Ge,Ba),W.freeType(Ba),_e.bindTexture(te,null),_e.deleteTexture(Za),va=!_e.getError()}return{colorBits:[_e.getParameter(X),_e.getParameter(lt),_e.getParameter(yt),_e.getParameter(pt)],depthBits:_e.getParameter(st),stencilBits:_e.getParameter(tt),subpixelBits:_e.getParameter(q),extensions:Object.keys(kr).filter(function(ta){return!!kr[ta]}),maxAnisotropic:Lr,maxDrawbuffers:Dn,maxColorAttachments:oi,pointSizeDims:_e.getParameter(dt),lineWidthDims:_e.getParameter(rt),maxViewportDims:_e.getParameter(vt),maxCombinedTextureUnits:_e.getParameter(ut),maxCubeMapSize:_e.getParameter(Wt),maxRenderbufferSize:_e.getParameter(Ht),maxTextureUnits:_e.getParameter(zt),maxTextureSize:_e.getParameter(at),maxAttributes:_e.getParameter(it),maxVertexUniforms:_e.getParameter(Y),maxVertexTextureUnits:_e.getParameter(wt),maxVaryingVectors:_e.getParameter(ft),maxFragmentUniforms:_e.getParameter(Pt),glsl:_e.getParameter(de),renderer:_e.getParameter(ge),vendor:_e.getParameter(Jt),version:_e.getParameter(he),readFloat:Jn,npotTextureCube:va}},Kr=function(_e){return _e instanceof Uint8Array||_e instanceof Uint16Array||_e instanceof Uint32Array||_e instanceof Int8Array||_e instanceof Int16Array||_e instanceof Int32Array||_e instanceof Float32Array||_e instanceof Float64Array||_e instanceof Uint8ClampedArray};function rn(_e){return!!_e&&typeof _e=="object"&&Array.isArray(_e.shape)&&Array.isArray(_e.stride)&&typeof _e.offset=="number"&&_e.shape.length===_e.stride.length&&(Array.isArray(_e.data)||Kr(_e.data))}var Ce=function(_e){return Object.keys(_e).map(function(kr){return _e[kr]})},$t={shape:ee,flatten:Nt};function ne(_e,kr,Lr){for(var Dn=0;Dn<kr;++Dn)Lr[Dn]=_e[Dn]}function Ct(_e,kr,Lr,Dn){for(var oi=0,Jn=0;Jn<kr;++Jn)for(var gn=_e[Jn],ni=0;ni<Lr;++ni)Dn[oi++]=gn[ni]}function gt(_e,kr,Lr,Dn,oi,Jn){for(var gn=Jn,ni=0;ni<kr;++ni)for(var Yi=_e[ni],Ui=0;Ui<Lr;++Ui)for(var va=Yi[Ui],Za=0;Za<Dn;++Za)oi[gn++]=va[Za]}function St(_e,kr,Lr,Dn,oi){for(var Jn=1,gn=Lr+1;gn<kr.length;++gn)Jn*=kr[gn];var ni=kr[Lr];if(kr.length-Lr===4){var Yi=kr[Lr+1],Ui=kr[Lr+2],va=kr[Lr+3];for(gn=0;gn<ni;++gn)gt(_e[gn],Yi,Ui,va,Dn,oi),oi+=Jn}else for(gn=0;gn<ni;++gn)St(_e[gn],kr,Lr+1,Dn,oi),oi+=Jn}function Nt(_e,kr,Lr,Dn){var oi=1;if(kr.length)for(var Jn=0;Jn<kr.length;++Jn)oi*=kr[Jn];else oi=0;var gn=Dn||W.allocType(Lr,oi);switch(kr.length){case 0:break;case 1:ne(_e,kr[0],gn);break;case 2:Ct(_e,kr[0],kr[1],gn);break;case 3:gt(_e,kr[0],kr[1],kr[2],gn,0);break;default:St(_e,kr,0,gn,0)}return gn}function ee(_e){for(var kr=[],Lr=_e;Lr.length;Lr=Lr[0])kr.push(Lr.length);return kr}var le={"[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},we=5120,Ue=5122,qe=5124,ar=5121,Ar=5123,Tr=5125,pr=5126,Jr=5126,Vn={int8:we,int16:Ue,int32:qe,uint8:ar,uint16:Ar,uint32:Tr,float:pr,float32:Jr},Hn=35048,Kn=35040,Ci={dynamic:Hn,stream:Kn,static:35044},ii=$t.flatten,qn=$t.shape,oa=35044,Hi=35040,We=5121,rr=5126,fr=[];fr[5120]=1,fr[5122]=2,fr[5124]=4,fr[5121]=1,fr[5123]=2,fr[5125]=4,fr[5126]=4;function xr(_e){return le[Object.prototype.toString.call(_e)]|0}function Qr(_e,kr){for(var Lr=0;Lr<kr.length;++Lr)_e[Lr]=kr[Lr]}function Cn(_e,kr,Lr,Dn,oi,Jn,gn){for(var ni=0,Yi=0;Yi<Lr;++Yi)for(var Ui=0;Ui<Dn;++Ui)_e[ni++]=kr[oi*Yi+Jn*Ui+gn]}function wn(_e,kr,Lr,Dn){var oi=0,Jn={};function gn(hn){this.id=oi++,this.buffer=_e.createBuffer(),this.type=hn,this.usage=oa,this.byteLength=0,this.dimension=1,this.dtype=We,this.persistentData=null,Lr.profile&&(this.stats={size:0})}gn.prototype.bind=function(){_e.bindBuffer(this.type,this.buffer)},gn.prototype.destroy=function(){Ba(this)};var ni=[];function Yi(hn,Nn){var Oi=ni.pop();return Oi||(Oi=new gn(hn)),Oi.bind(),Za(Oi,Nn,Hi,0,1,!1),Oi}function Ui(hn){ni.push(hn)}function va(hn,Nn,Oi){hn.byteLength=Nn.byteLength,_e.bufferData(hn.type,Nn,Oi)}function Za(hn,Nn,Oi,_i,Qn,Ma){var ca;if(hn.usage=Oi,Array.isArray(Nn)){if(hn.dtype=_i||rr,Nn.length>0){var Ua;if(Array.isArray(Nn[0])){ca=qn(Nn);for(var vi=1,ti=1;ti<ca.length;++ti)vi*=ca[ti];hn.dimension=vi,Ua=ii(Nn,ca,hn.dtype),va(hn,Ua,Oi),Ma?hn.persistentData=Ua:W.freeType(Ua)}else if(typeof Nn[0]=="number"){hn.dimension=Qn;var Sa=W.allocType(hn.dtype,Nn.length);Qr(Sa,Nn),va(hn,Sa,Oi),Ma?hn.persistentData=Sa:W.freeType(Sa)}else Kr(Nn[0])&&(hn.dimension=Nn[0].length,hn.dtype=_i||xr(Nn[0])||rr,Ua=ii(Nn,[Nn.length,Nn[0].length],hn.dtype),va(hn,Ua,Oi),Ma?hn.persistentData=Ua:W.freeType(Ua))}}else if(Kr(Nn))hn.dtype=_i||xr(Nn),hn.dimension=Qn,va(hn,Nn,Oi),Ma&&(hn.persistentData=new Uint8Array(new Uint8Array(Nn.buffer)));else if(rn(Nn)){ca=Nn.shape;var pa=Nn.stride,qi=Nn.offset,$i=0,_a=0,Po=0,wo=0;ca.length===1?($i=ca[0],_a=1,Po=pa[0],wo=0):ca.length===2&&($i=ca[0],_a=ca[1],Po=pa[0],wo=pa[1]),hn.dtype=_i||xr(Nn.data)||rr,hn.dimension=_a;var xa=W.allocType(hn.dtype,$i*_a);Cn(xa,Nn.data,$i,_a,Po,wo,qi),va(hn,xa,Oi),Ma?hn.persistentData=xa:W.freeType(xa)}else Nn instanceof ArrayBuffer&&(hn.dtype=We,hn.dimension=Qn,va(hn,Nn,Oi),Ma&&(hn.persistentData=new Uint8Array(new Uint8Array(Nn))))}function Ba(hn){kr.bufferCount--,Dn(hn);var Nn=hn.buffer;_e.deleteBuffer(Nn),hn.buffer=null,delete Jn[hn.id]}function ta(hn,Nn,Oi,_i){kr.bufferCount++;var Qn=new gn(Nn);Jn[Qn.id]=Qn;function Ma(vi){var ti=oa,Sa=null,pa=0,qi=0,$i=1;return Array.isArray(vi)||Kr(vi)||rn(vi)||vi instanceof ArrayBuffer?Sa=vi:typeof vi=="number"?pa=vi|0:vi&&("data"in vi&&(Sa=vi.data),"usage"in vi&&(ti=Ci[vi.usage]),"type"in vi&&(qi=Vn[vi.type]),"dimension"in vi&&($i=vi.dimension|0),"length"in vi&&(pa=vi.length|0)),Qn.bind(),Sa?Za(Qn,Sa,ti,qi,$i,_i):(pa&&_e.bufferData(Qn.type,pa,ti),Qn.dtype=qi||We,Qn.usage=ti,Qn.dimension=$i,Qn.byteLength=pa),Lr.profile&&(Qn.stats.size=Qn.byteLength*fr[Qn.dtype]),Ma}function ca(vi,ti){_e.bufferSubData(Qn.type,ti,vi)}function Ua(vi,ti){var Sa=(ti||0)|0,pa;if(Qn.bind(),Kr(vi)||vi instanceof ArrayBuffer)ca(vi,Sa);else if(Array.isArray(vi)){if(vi.length>0){if(typeof vi[0]=="number"){var qi=W.allocType(Qn.dtype,vi.length);Qr(qi,vi),ca(qi,Sa),W.freeType(qi)}else if(Array.isArray(vi[0])||Kr(vi[0])){pa=qn(vi);var $i=ii(vi,pa,Qn.dtype);ca($i,Sa),W.freeType($i)}}}else if(rn(vi)){pa=vi.shape;var _a=vi.stride,Po=0,wo=0,xa=0,Oa=0;pa.length===1?(Po=pa[0],wo=1,xa=_a[0],Oa=0):pa.length===2&&(Po=pa[0],wo=pa[1],xa=_a[0],Oa=_a[1]);var ho=Array.isArray(vi.data)?Qn.dtype:xr(vi.data),So=W.allocType(ho,Po*wo);Cn(So,vi.data,Po,wo,xa,Oa,vi.offset),ca(So,Sa),W.freeType(So)}return Ma}return Oi||Ma(hn),Ma._reglType="buffer",Ma._buffer=Qn,Ma.subdata=Ua,Lr.profile&&(Ma.stats=Qn.stats),Ma.destroy=function(){Ba(Qn)},Ma}function wi(){Ce(Jn).forEach(function(hn){hn.buffer=_e.createBuffer(),_e.bindBuffer(hn.type,hn.buffer),_e.bufferData(hn.type,hn.persistentData||hn.byteLength,hn.usage)})}return Lr.profile&&(kr.getTotalBufferSize=function(){var hn=0;return Object.keys(Jn).forEach(function(Nn){hn+=Jn[Nn].stats.size}),hn}),{create:ta,createStream:Yi,destroyStream:Ui,clear:function(){Ce(Jn).forEach(Ba),ni.forEach(Ba)},getBuffer:function(hn){return hn&&hn._buffer instanceof gn?hn._buffer:null},restore:wi,_initBuffer:Za}}var Mn=0,ci=0,xi=1,Pi=1,Di=4,Zi=4,ui={points:Mn,point:ci,lines:xi,line:Pi,triangles:Di,triangle:Zi,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Pa=0,Wa=1,ze=4,Pe=5120,Rr=5121,qr=5122,$r=5123,Br=5124,Gr=5125,dn=34963,an=35040,Ee=35044;function dr(_e,kr,Lr,Dn){var oi={},Jn=0,gn={uint8:Rr,uint16:$r};kr.oes_element_index_uint&&(gn.uint32=Gr);function ni(wi){this.id=Jn++,oi[this.id]=this,this.buffer=wi,this.primType=ze,this.vertCount=0,this.type=0}ni.prototype.bind=function(){this.buffer.bind()};var Yi=[];function Ui(wi){var hn=Yi.pop();return hn||(hn=new ni(Lr.create(null,dn,!0,!1)._buffer)),Za(hn,wi,an,-1,-1,0,0),hn}function va(wi){Yi.push(wi)}function Za(wi,hn,Nn,Oi,_i,Qn,Ma){wi.buffer.bind();var ca;if(hn){var Ua=Ma;!Ma&&(!Kr(hn)||rn(hn)&&!Kr(hn.data))&&(Ua=kr.oes_element_index_uint?Gr:$r),Lr._initBuffer(wi.buffer,hn,Nn,Ua,3)}else _e.bufferData(dn,Qn,Nn),wi.buffer.dtype=ca||Rr,wi.buffer.usage=Nn,wi.buffer.dimension=3,wi.buffer.byteLength=Qn;if(ca=Ma,!Ma){switch(wi.buffer.dtype){case Rr:case Pe:ca=Rr;break;case $r:case qr:ca=$r;break;case Gr:case Br:ca=Gr;break}wi.buffer.dtype=ca}wi.type=ca;var vi=_i;vi<0&&(vi=wi.buffer.byteLength,ca===$r?vi>>=1:ca===Gr&&(vi>>=2)),wi.vertCount=vi;var ti=Oi;if(Oi<0){ti=ze;var Sa=wi.buffer.dimension;Sa===1&&(ti=Pa),Sa===2&&(ti=Wa),Sa===3&&(ti=ze)}wi.primType=ti}function Ba(wi){Dn.elementsCount--,delete oi[wi.id],wi.buffer.destroy(),wi.buffer=null}function ta(wi,hn){var Nn=Lr.create(null,dn,!0),Oi=new ni(Nn._buffer);Dn.elementsCount++;function _i(Qn){if(!Qn)Nn(),Oi.primType=ze,Oi.vertCount=0,Oi.type=Rr;else if(typeof Qn=="number")Nn(Qn),Oi.primType=ze,Oi.vertCount=Qn|0,Oi.type=Rr;else{var Ma=null,ca=Ee,Ua=-1,vi=-1,ti=0,Sa=0;Array.isArray(Qn)||Kr(Qn)||rn(Qn)?Ma=Qn:("data"in Qn&&(Ma=Qn.data),"usage"in Qn&&(ca=Ci[Qn.usage]),"primitive"in Qn&&(Ua=ui[Qn.primitive]),"count"in Qn&&(vi=Qn.count|0),"type"in Qn&&(Sa=gn[Qn.type]),"length"in Qn?ti=Qn.length|0:(ti=vi,Sa===$r||Sa===qr?ti*=2:(Sa===Gr||Sa===Br)&&(ti*=4))),Za(Oi,Ma,ca,Ua,vi,ti,Sa)}return _i}return _i(wi),_i._reglType="elements",_i._elements=Oi,_i.subdata=function(Qn,Ma){return Nn.subdata(Qn,Ma),_i},_i.destroy=function(){Ba(Oi)},_i}return{create:ta,createStream:Ui,destroyStream:va,getElements:function(wi){return typeof wi=="function"&&wi._elements instanceof ni?wi._elements:null},clear:function(){Ce(oi).forEach(Ba)}}}var Vr=new Float32Array(1),yn=new Uint32Array(Vr.buffer),Fn=5123;function Xn(_e){for(var kr=W.allocType(Fn,_e.length),Lr=0;Lr<_e.length;++Lr)if(isNaN(_e[Lr]))kr[Lr]=65535;else if(_e[Lr]===1/0)kr[Lr]=31744;else if(_e[Lr]===-1/0)kr[Lr]=64512;else{Vr[0]=_e[Lr];var Dn=yn[0],oi=Dn>>>31<<15,Jn=(Dn<<1>>>24)-127,gn=Dn>>13&1023;if(Jn<-24)kr[Lr]=oi;else if(Jn<-14){var ni=-14-Jn;kr[Lr]=oi+(gn+1024>>ni)}else Jn>15?kr[Lr]=oi+31744:kr[Lr]=oi+(Jn+15<<10)+gn}return kr}function Pn(_e){return Array.isArray(_e)||Kr(_e)}var En=34467,Zn=3553,Ca=34067,Ri=34069,Ja=6408,Xa=6406,Io=6407,po=6409,Do=6410,Ia=32854,gs=32855,is=36194,ll=32819,Ho=32820,Gs=33635,as=34042,ul=6402,Js=34041,Rl=35904,ls=35906,Cs=36193,Co=33776,ks=33777,kl=33778,Vl=33779,Yl=35986,Ns=35987,La=34798,uo=35840,Hs=35841,Kl=35842,Go=35843,ql=36196,il=5121,Cl=5123,Fu=5125,ao=5126,Ts=10242,Ls=10243,nu=10497,cl=33071,Qo=33648,Mu=10240,Gu=10241,_l=9728,Ol=9729,Xl=9984,tu=9985,ac=9986,ph=9987,Jc=33170,ah=4352,Nf=4353,Sf=4354,Dl=34046,Bc=3317,jf=37440,hc=37441,oc=37443,fc=37444,oh=33984,su=[Xl,ac,tu,ph],sc=[0,po,Do,Io,Ja],el={};el[po]=el[Xa]=el[ul]=1,el[Js]=el[Do]=2,el[Io]=el[Rl]=3,el[Ja]=el[ls]=4;function Zl(_e){return"[object "+_e+"]"}var Mh=Zl("HTMLCanvasElement"),Lc=Zl("OffscreenCanvas"),jh=Zl("CanvasRenderingContext2D"),xu=Zl("ImageBitmap"),Cd=Zl("HTMLImageElement"),Qs=Zl("HTMLVideoElement"),Wd=Object.keys(le).concat([Mh,Lc,jh,xu,Cd,Qs]),Ll=[];Ll[il]=1,Ll[ao]=4,Ll[Cs]=2,Ll[Cl]=2,Ll[Fu]=4;var Jo=[];Jo[Ia]=2,Jo[gs]=2,Jo[is]=2,Jo[Js]=4,Jo[Co]=.5,Jo[ks]=.5,Jo[kl]=1,Jo[Vl]=1,Jo[Yl]=.5,Jo[Ns]=1,Jo[La]=1,Jo[uo]=.5,Jo[Hs]=.25,Jo[Kl]=.5,Jo[Go]=.25,Jo[ql]=.5;function lf(_e){return Array.isArray(_e)&&(_e.length===0||typeof _e[0]=="number")}function sh(_e){if(!Array.isArray(_e))return!1;var kr=_e.length;return!(kr===0||!Pn(_e[0]))}function ec(_e){return Object.prototype.toString.call(_e)}function Uf(_e){return ec(_e)===Mh}function Uh(_e){return ec(_e)===Lc}function yf(_e){return ec(_e)===jh}function lc(_e){return ec(_e)===xu}function hd(_e){return ec(_e)===Cd}function $f(_e){return ec(_e)===Qs}function xf(_e){if(!_e)return!1;var kr=ec(_e);return Wd.indexOf(kr)>=0?!0:lf(_e)||sh(_e)||rn(_e)}function Vh(_e){return le[Object.prototype.toString.call(_e)]|0}function Vf(_e,kr){var Lr=kr.length;switch(_e.type){case il:case Cl:case Fu:case ao:var Dn=W.allocType(_e.type,Lr);Dn.set(kr),_e.data=Dn;break;case Cs:_e.data=Xn(kr);break}}function Hf(_e,kr){return W.allocType(_e.type===Cs?ao:_e.type,kr)}function lh(_e,kr){_e.type===Cs?(_e.data=Xn(kr),W.freeType(kr)):_e.data=kr}function Gf(_e,kr,Lr,Dn,oi,Jn){for(var gn=_e.width,ni=_e.height,Yi=_e.channels,Ui=gn*ni*Yi,va=Hf(_e,Ui),Za=0,Ba=0;Ba<ni;++Ba)for(var ta=0;ta<gn;++ta)for(var wi=0;wi<Yi;++wi)va[Za++]=kr[Lr*ta+Dn*Ba+oi*wi+Jn];lh(_e,va)}function Sh(_e,kr,Lr,Dn,oi,Jn){var gn;if(typeof Jo[_e]<"u"?gn=Jo[_e]:gn=el[_e]*Ll[kr],Jn&&(gn*=6),oi){for(var ni=0,Yi=Lr;Yi>=1;)ni+=gn*Yi*Yi,Yi/=2;return ni}else return gn*Lr*Dn}function mh(_e,kr,Lr,Dn,oi,Jn,gn){var ni={"don't care":ah,"dont care":ah,nice:Sf,fast:Nf},Yi={repeat:nu,clamp:cl,mirror:Qo},Ui={nearest:_l,linear:Ol},va=c({mipmap:ph,"nearest mipmap nearest":Xl,"linear mipmap nearest":tu,"nearest mipmap linear":ac,"linear mipmap linear":ph},Ui),Za={none:0,browser:fc},Ba={uint8:il,rgba4:ll,rgb565:Gs,"rgb5 a1":Ho},ta={alpha:Xa,luminance:po,"luminance alpha":Do,rgb:Io,rgba:Ja,rgba4:Ia,"rgb5 a1":gs,rgb565:is},wi={};kr.ext_srgb&&(ta.srgb=Rl,ta.srgba=ls),kr.oes_texture_float&&(Ba.float32=Ba.float=ao),kr.oes_texture_half_float&&(Ba.float16=Ba["half float"]=Cs),kr.webgl_depth_texture&&(c(ta,{depth:ul,"depth stencil":Js}),c(Ba,{uint16:Cl,uint32:Fu,"depth stencil":as})),kr.webgl_compressed_texture_s3tc&&c(wi,{"rgb s3tc dxt1":Co,"rgba s3tc dxt1":ks,"rgba s3tc dxt3":kl,"rgba s3tc dxt5":Vl}),kr.webgl_compressed_texture_atc&&c(wi,{"rgb atc":Yl,"rgba atc explicit alpha":Ns,"rgba atc interpolated alpha":La}),kr.webgl_compressed_texture_pvrtc&&c(wi,{"rgb pvrtc 4bppv1":uo,"rgb pvrtc 2bppv1":Hs,"rgba pvrtc 4bppv1":Kl,"rgba pvrtc 2bppv1":Go}),kr.webgl_compressed_texture_etc1&&(wi["rgb etc1"]=ql);var hn=Array.prototype.slice.call(_e.getParameter(En));Object.keys(wi).forEach(function(Z){var ot=wi[Z];hn.indexOf(ot)>=0&&(ta[Z]=ot)});var Nn=Object.keys(ta);Lr.textureFormats=Nn;var Oi=[];Object.keys(ta).forEach(function(Z){var ot=ta[Z];Oi[ot]=Z});var _i=[];Object.keys(Ba).forEach(function(Z){var ot=Ba[Z];_i[ot]=Z});var Qn=[];Object.keys(Ui).forEach(function(Z){var ot=Ui[Z];Qn[ot]=Z});var Ma=[];Object.keys(va).forEach(function(Z){var ot=va[Z];Ma[ot]=Z});var ca=[];Object.keys(Yi).forEach(function(Z){var ot=Yi[Z];ca[ot]=Z});var Ua=Nn.reduce(function(Z,ot){var et=ta[ot];return et===po||et===Xa||et===po||et===Do||et===ul||et===Js||kr.ext_srgb&&(et===Rl||et===ls)?Z[et]=et:et===gs||ot.indexOf("rgba")>=0?Z[et]=Ja:Z[et]=Io,Z},{});function vi(){this.internalformat=Ja,this.format=Ja,this.type=il,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=fc,this.width=0,this.height=0,this.channels=0}function ti(Z,ot){Z.internalformat=ot.internalformat,Z.format=ot.format,Z.type=ot.type,Z.compressed=ot.compressed,Z.premultiplyAlpha=ot.premultiplyAlpha,Z.flipY=ot.flipY,Z.unpackAlignment=ot.unpackAlignment,Z.colorSpace=ot.colorSpace,Z.width=ot.width,Z.height=ot.height,Z.channels=ot.channels}function Sa(Z,ot){if(!(typeof ot!="object"||!ot)){if("premultiplyAlpha"in ot&&(Z.premultiplyAlpha=ot.premultiplyAlpha),"flipY"in ot&&(Z.flipY=ot.flipY),"alignment"in ot&&(Z.unpackAlignment=ot.alignment),"colorSpace"in ot&&(Z.colorSpace=Za[ot.colorSpace]),"type"in ot){var et=ot.type;Z.type=Ba[et]}var xt=Z.width,Ut=Z.height,fe=Z.channels,ye=!1;"shape"in ot?(xt=ot.shape[0],Ut=ot.shape[1],ot.shape.length===3&&(fe=ot.shape[2],ye=!0)):("radius"in ot&&(xt=Ut=ot.radius),"width"in ot&&(xt=ot.width),"height"in ot&&(Ut=ot.height),"channels"in ot&&(fe=ot.channels,ye=!0)),Z.width=xt|0,Z.height=Ut|0,Z.channels=fe|0;var Yt=!1;if("format"in ot){var ce=ot.format,Se=Z.internalformat=ta[ce];Z.format=Ua[Se],ce in Ba&&("type"in ot||(Z.type=Ba[ce])),ce in wi&&(Z.compressed=!0),Yt=!0}!ye&&Yt?Z.channels=el[Z.format]:ye&&!Yt&&Z.channels!==sc[Z.format]&&(Z.format=Z.internalformat=sc[Z.channels])}}function pa(Z){_e.pixelStorei(jf,Z.flipY),_e.pixelStorei(hc,Z.premultiplyAlpha),_e.pixelStorei(oc,Z.colorSpace),_e.pixelStorei(Bc,Z.unpackAlignment)}function qi(){vi.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function $i(Z,ot){var et=null;if(xf(ot)?et=ot:ot&&(Sa(Z,ot),"x"in ot&&(Z.xOffset=ot.x|0),"y"in ot&&(Z.yOffset=ot.y|0),xf(ot.data)&&(et=ot.data)),ot.copy){var xt=oi.viewportWidth,Ut=oi.viewportHeight;Z.width=Z.width||xt-Z.xOffset,Z.height=Z.height||Ut-Z.yOffset,Z.needsCopy=!0}else if(!et)Z.width=Z.width||1,Z.height=Z.height||1,Z.channels=Z.channels||4;else if(Kr(et))Z.channels=Z.channels||4,Z.data=et,!("type"in ot)&&Z.type===il&&(Z.type=Vh(et));else if(lf(et))Z.channels=Z.channels||4,Vf(Z,et),Z.alignment=1,Z.needsFree=!0;else if(rn(et)){var fe=et.data;!Array.isArray(fe)&&Z.type===il&&(Z.type=Vh(fe));var ye=et.shape,Yt=et.stride,ce,Se,nr,Ye,tr,lr;ye.length===3?(nr=ye[2],lr=Yt[2]):(nr=1,lr=1),ce=ye[0],Se=ye[1],Ye=Yt[0],tr=Yt[1],Z.alignment=1,Z.width=ce,Z.height=Se,Z.channels=nr,Z.format=Z.internalformat=sc[nr],Z.needsFree=!0,Gf(Z,fe,Ye,tr,lr,et.offset)}else if(Uf(et)||Uh(et)||yf(et))Uf(et)||Uh(et)?Z.element=et:Z.element=et.canvas,Z.width=Z.element.width,Z.height=Z.element.height,Z.channels=4;else if(lc(et))Z.element=et,Z.width=et.width,Z.height=et.height,Z.channels=4;else if(hd(et))Z.element=et,Z.width=et.naturalWidth,Z.height=et.naturalHeight,Z.channels=4;else if($f(et))Z.element=et,Z.width=et.videoWidth,Z.height=et.videoHeight,Z.channels=4;else if(sh(et)){var hr=Z.width||et[0].length,Ve=Z.height||et.length,Xe=Z.channels;Pn(et[0][0])?Xe=Xe||et[0][0].length:Xe=Xe||1;for(var $e=$t.shape(et),Cr=1,on=0;on<$e.length;++on)Cr*=$e[on];var fn=Hf(Z,Cr);$t.flatten(et,$e,"",fn),lh(Z,fn),Z.alignment=1,Z.width=hr,Z.height=Ve,Z.channels=Xe,Z.format=Z.internalformat=sc[Xe],Z.needsFree=!0}Z.type===ao||Z.type}function _a(Z,ot,et){var xt=Z.element,Ut=Z.data,fe=Z.internalformat,ye=Z.format,Yt=Z.type,ce=Z.width,Se=Z.height;pa(Z),xt?_e.texImage2D(ot,et,ye,ye,Yt,xt):Z.compressed?_e.compressedTexImage2D(ot,et,fe,ce,Se,0,Ut):Z.needsCopy?(Dn(),_e.copyTexImage2D(ot,et,ye,Z.xOffset,Z.yOffset,ce,Se,0)):_e.texImage2D(ot,et,ye,ce,Se,0,ye,Yt,Ut||null)}function Po(Z,ot,et,xt,Ut){var fe=Z.element,ye=Z.data,Yt=Z.internalformat,ce=Z.format,Se=Z.type,nr=Z.width,Ye=Z.height;pa(Z),fe?_e.texSubImage2D(ot,Ut,et,xt,ce,Se,fe):Z.compressed?_e.compressedTexSubImage2D(ot,Ut,et,xt,Yt,nr,Ye,ye):Z.needsCopy?(Dn(),_e.copyTexSubImage2D(ot,Ut,et,xt,Z.xOffset,Z.yOffset,nr,Ye)):_e.texSubImage2D(ot,Ut,et,xt,nr,Ye,ce,Se,ye)}var wo=[];function xa(){return wo.pop()||new qi}function Oa(Z){Z.needsFree&&W.freeType(Z.data),qi.call(Z),wo.push(Z)}function ho(){vi.call(this),this.genMipmaps=!1,this.mipmapHint=ah,this.mipmask=0,this.images=Array(16)}function So(Z,ot,et){var xt=Z.images[0]=xa();Z.mipmask=1,xt.width=Z.width=ot,xt.height=Z.height=et,xt.channels=Z.channels=4}function ts(Z,ot){var et=null;if(xf(ot))et=Z.images[0]=xa(),ti(et,Z),$i(et,ot),Z.mipmask=1;else if(Sa(Z,ot),Array.isArray(ot.mipmap))for(var xt=ot.mipmap,Ut=0;Ut<xt.length;++Ut)et=Z.images[Ut]=xa(),ti(et,Z),et.width>>=Ut,et.height>>=Ut,$i(et,xt[Ut]),Z.mipmask|=1<<Ut;else et=Z.images[0]=xa(),ti(et,Z),$i(et,ot),Z.mipmask=1;ti(Z,Z.images[0]),Z.compressed&&(Z.internalformat===Co||Z.internalformat===ks||Z.internalformat===kl||Z.internalformat)}function Nl(Z,ot){for(var et=Z.images,xt=0;xt<et.length;++xt){if(!et[xt])return;_a(et[xt],ot,xt)}}var Al=[];function us(){var Z=Al.pop()||new ho;vi.call(Z),Z.mipmask=0;for(var ot=0;ot<16;++ot)Z.images[ot]=null;return Z}function wu(Z){for(var ot=Z.images,et=0;et<ot.length;++et)ot[et]&&Oa(ot[et]),ot[et]=null;Al.push(Z)}function fl(){this.minFilter=_l,this.magFilter=_l,this.wrapS=cl,this.wrapT=cl,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=ah}function Eu(Z,ot){if("min"in ot){var et=ot.min;Z.minFilter=va[et],su.indexOf(Z.minFilter)>=0&&!("faces"in ot)&&(Z.genMipmaps=!0)}if("mag"in ot){var xt=ot.mag;Z.magFilter=Ui[xt]}var Ut=Z.wrapS,fe=Z.wrapT;if("wrap"in ot){var ye=ot.wrap;typeof ye=="string"?Ut=fe=Yi[ye]:Array.isArray(ye)&&(Ut=Yi[ye[0]],fe=Yi[ye[1]])}else{if("wrapS"in ot){var Yt=ot.wrapS;Ut=Yi[Yt]}if("wrapT"in ot){var ce=ot.wrapT;fe=Yi[ce]}}if(Z.wrapS=Ut,Z.wrapT=fe,"anisotropic"in ot&&(ot.anisotropic,Z.anisotropic=ot.anisotropic),"mipmap"in ot){var Se=!1;switch(typeof ot.mipmap){case"string":Z.mipmapHint=ni[ot.mipmap],Z.genMipmaps=!0,Se=!0;break;case"boolean":Se=Z.genMipmaps=ot.mipmap;break;case"object":Z.genMipmaps=!1,Se=!0;break}Se&&!("min"in ot)&&(Z.minFilter=Xl)}}function pc(Z,ot){_e.texParameteri(ot,Gu,Z.minFilter),_e.texParameteri(ot,Mu,Z.magFilter),_e.texParameteri(ot,Ts,Z.wrapS),_e.texParameteri(ot,Ls,Z.wrapT),kr.ext_texture_filter_anisotropic&&_e.texParameteri(ot,Dl,Z.anisotropic),Z.genMipmaps&&(_e.hint(Jc,Z.mipmapHint),_e.generateMipmap(ot))}var yc=0,yu={},hu=Lr.maxTextureUnits,ku=Array(hu).map(function(){return null});function Bo(Z){vi.call(this),this.mipmask=0,this.internalformat=Ja,this.id=yc++,this.refCount=1,this.target=Z,this.texture=_e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new fl,gn.profile&&(this.stats={size:0})}function Tu(Z){_e.activeTexture(oh),_e.bindTexture(Z.target,Z.texture)}function ol(){var Z=ku[0];Z?_e.bindTexture(Z.target,Z.texture):_e.bindTexture(Zn,null)}function Cu(Z){var ot=Z.texture,et=Z.unit,xt=Z.target;et>=0&&(_e.activeTexture(oh+et),_e.bindTexture(xt,null),ku[et]=null),_e.deleteTexture(ot),Z.texture=null,Z.params=null,Z.pixels=null,Z.refCount=0,delete yu[Z.id],Jn.textureCount--}c(Bo.prototype,{bind:function(){var Z=this;Z.bindCount+=1;var ot=Z.unit;if(ot<0){for(var et=0;et<hu;++et){var xt=ku[et];if(xt){if(xt.bindCount>0)continue;xt.unit=-1}ku[et]=Z,ot=et;break}gn.profile&&Jn.maxTextureUnits<ot+1&&(Jn.maxTextureUnits=ot+1),Z.unit=ot,_e.activeTexture(oh+ot),_e.bindTexture(Z.target,Z.texture)}return ot},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Cu(this)}});function xc(Z,ot){var et=new Bo(Zn);yu[et.id]=et,Jn.textureCount++;function xt(ye,Yt){var ce=et.texInfo;fl.call(ce);var Se=us();return typeof ye=="number"?typeof Yt=="number"?So(Se,ye|0,Yt|0):So(Se,ye|0,ye|0):ye?(Eu(ce,ye),ts(Se,ye)):So(Se,1,1),ce.genMipmaps&&(Se.mipmask=(Se.width<<1)-1),et.mipmask=Se.mipmask,ti(et,Se),et.internalformat=Se.internalformat,xt.width=Se.width,xt.height=Se.height,Tu(et),Nl(Se,Zn),pc(ce,Zn),ol(),wu(Se),gn.profile&&(et.stats.size=Sh(et.internalformat,et.type,Se.width,Se.height,ce.genMipmaps,!1)),xt.format=Oi[et.internalformat],xt.type=_i[et.type],xt.mag=Qn[ce.magFilter],xt.min=Ma[ce.minFilter],xt.wrapS=ca[ce.wrapS],xt.wrapT=ca[ce.wrapT],xt}function Ut(ye,Yt,ce,Se){var nr=Yt|0,Ye=ce|0,tr=Se|0,lr=xa();return ti(lr,et),lr.width=0,lr.height=0,$i(lr,ye),lr.width=lr.width||(et.width>>tr)-nr,lr.height=lr.height||(et.height>>tr)-Ye,Tu(et),Po(lr,Zn,nr,Ye,tr),ol(),Oa(lr),xt}function fe(ye,Yt){var ce=ye|0,Se=Yt|0||ce;if(ce===et.width&&Se===et.height)return xt;xt.width=et.width=ce,xt.height=et.height=Se,Tu(et);for(var nr=0;et.mipmask>>nr;++nr){var Ye=ce>>nr,tr=Se>>nr;if(!Ye||!tr)break;_e.texImage2D(Zn,nr,et.format,Ye,tr,0,et.format,et.type,null)}return ol(),gn.profile&&(et.stats.size=Sh(et.internalformat,et.type,ce,Se,!1,!1)),xt}return xt(Z,ot),xt.subimage=Ut,xt.resize=fe,xt._reglType="texture2d",xt._texture=et,gn.profile&&(xt.stats=et.stats),xt.destroy=function(){et.decRef()},xt}function Eo(Z,ot,et,xt,Ut,fe){var ye=new Bo(Ca);yu[ye.id]=ye,Jn.cubeCount++;var Yt=new Array(6);function ce(Ye,tr,lr,hr,Ve,Xe){var $e,Cr=ye.texInfo;for(fl.call(Cr),$e=0;$e<6;++$e)Yt[$e]=us();if(typeof Ye=="number"||!Ye){var on=Ye|0||1;for($e=0;$e<6;++$e)So(Yt[$e],on,on)}else if(typeof Ye=="object")if(tr)ts(Yt[0],Ye),ts(Yt[1],tr),ts(Yt[2],lr),ts(Yt[3],hr),ts(Yt[4],Ve),ts(Yt[5],Xe);else if(Eu(Cr,Ye),Sa(ye,Ye),"faces"in Ye){var fn=Ye.faces;for($e=0;$e<6;++$e)ti(Yt[$e],ye),ts(Yt[$e],fn[$e])}else for($e=0;$e<6;++$e)ts(Yt[$e],Ye);for(ti(ye,Yt[0]),Cr.genMipmaps?ye.mipmask=(Yt[0].width<<1)-1:ye.mipmask=Yt[0].mipmask,ye.internalformat=Yt[0].internalformat,ce.width=Yt[0].width,ce.height=Yt[0].height,Tu(ye),$e=0;$e<6;++$e)Nl(Yt[$e],Ri+$e);for(pc(Cr,Ca),ol(),gn.profile&&(ye.stats.size=Sh(ye.internalformat,ye.type,ce.width,ce.height,Cr.genMipmaps,!0)),ce.format=Oi[ye.internalformat],ce.type=_i[ye.type],ce.mag=Qn[Cr.magFilter],ce.min=Ma[Cr.minFilter],ce.wrapS=ca[Cr.wrapS],ce.wrapT=ca[Cr.wrapT],$e=0;$e<6;++$e)wu(Yt[$e]);return ce}function Se(Ye,tr,lr,hr,Ve){var Xe=lr|0,$e=hr|0,Cr=Ve|0,on=xa();return ti(on,ye),on.width=0,on.height=0,$i(on,tr),on.width=on.width||(ye.width>>Cr)-Xe,on.height=on.height||(ye.height>>Cr)-$e,Tu(ye),Po(on,Ri+Ye,Xe,$e,Cr),ol(),Oa(on),ce}function nr(Ye){var tr=Ye|0;if(tr!==ye.width){ce.width=ye.width=tr,ce.height=ye.height=tr,Tu(ye);for(var lr=0;lr<6;++lr)for(var hr=0;ye.mipmask>>hr;++hr)_e.texImage2D(Ri+lr,hr,ye.format,tr>>hr,tr>>hr,0,ye.format,ye.type,null);return ol(),gn.profile&&(ye.stats.size=Sh(ye.internalformat,ye.type,ce.width,ce.height,!1,!0)),ce}}return ce(Z,ot,et,xt,Ut,fe),ce.subimage=Se,ce.resize=nr,ce._reglType="textureCube",ce._texture=ye,gn.profile&&(ce.stats=ye.stats),ce.destroy=function(){ye.decRef()},ce}function Ss(){for(var Z=0;Z<hu;++Z)_e.activeTexture(oh+Z),_e.bindTexture(Zn,null),ku[Z]=null;Ce(yu).forEach(Cu),Jn.cubeCount=0,Jn.textureCount=0}gn.profile&&(Jn.getTotalTextureSize=function(){var Z=0;return Object.keys(yu).forEach(function(ot){Z+=yu[ot].stats.size}),Z});function Ml(){for(var Z=0;Z<hu;++Z){var ot=ku[Z];ot&&(ot.bindCount=0,ot.unit=-1,ku[Z]=null)}Ce(yu).forEach(function(et){et.texture=_e.createTexture(),_e.bindTexture(et.target,et.texture);for(var xt=0;xt<32;++xt)if((et.mipmask&1<<xt)!==0)if(et.target===Zn)_e.texImage2D(Zn,xt,et.internalformat,et.width>>xt,et.height>>xt,0,et.internalformat,et.type,null);else for(var Ut=0;Ut<6;++Ut)_e.texImage2D(Ri+Ut,xt,et.internalformat,et.width>>xt,et.height>>xt,0,et.internalformat,et.type,null);pc(et.texInfo,et.target)})}function yl(){for(var Z=0;Z<hu;++Z){var ot=ku[Z];ot&&(ot.bindCount=0,ot.unit=-1,ku[Z]=null),_e.activeTexture(oh+Z),_e.bindTexture(Zn,null),_e.bindTexture(Ca,null)}}return{create2D:xc,createCube:Eo,clear:Ss,getTexture:function(Z){return null},restore:Ml,refresh:yl}}var uc=36161,ef=32854,Wf=32855,Jl=36194,Ef=33189,Ld=36168,Yf=34041,_f=35907,Kf=34836,Nc=34842,Xf=34843,zu=[];zu[ef]=2,zu[Wf]=2,zu[Jl]=2,zu[Ef]=2,zu[Ld]=1,zu[Yf]=4,zu[_f]=4,zu[Kf]=16,zu[Nc]=8,zu[Xf]=6;function jc(_e,kr,Lr){return zu[_e]*kr*Lr}var Hh=function(_e,kr,Lr,Dn,oi){var Jn={rgba4:ef,rgb565:Jl,"rgb5 a1":Wf,depth:Ef,stencil:Ld,"depth stencil":Yf};kr.ext_srgb&&(Jn.srgba=_f),kr.ext_color_buffer_half_float&&(Jn.rgba16f=Nc,Jn.rgb16f=Xf),kr.webgl_color_buffer_float&&(Jn.rgba32f=Kf);var gn=[];Object.keys(Jn).forEach(function(ta){var wi=Jn[ta];gn[wi]=ta});var ni=0,Yi={};function Ui(ta){this.id=ni++,this.refCount=1,this.renderbuffer=ta,this.format=ef,this.width=0,this.height=0,oi.profile&&(this.stats={size:0})}Ui.prototype.decRef=function(){--this.refCount<=0&&va(this)};function va(ta){var wi=ta.renderbuffer;_e.bindRenderbuffer(uc,null),_e.deleteRenderbuffer(wi),ta.renderbuffer=null,ta.refCount=0,delete Yi[ta.id],Dn.renderbufferCount--}function Za(ta,wi){var hn=new Ui(_e.createRenderbuffer());Yi[hn.id]=hn,Dn.renderbufferCount++;function Nn(_i,Qn){var Ma=0,ca=0,Ua=ef;if(typeof _i=="object"&&_i){var vi=_i;if("shape"in vi){var ti=vi.shape;Ma=ti[0]|0,ca=ti[1]|0}else"radius"in vi&&(Ma=ca=vi.radius|0),"width"in vi&&(Ma=vi.width|0),"height"in vi&&(ca=vi.height|0);"format"in vi&&(Ua=Jn[vi.format])}else typeof _i=="number"?(Ma=_i|0,typeof Qn=="number"?ca=Qn|0:ca=Ma):_i||(Ma=ca=1);if(!(Ma===hn.width&&ca===hn.height&&Ua===hn.format))return Nn.width=hn.width=Ma,Nn.height=hn.height=ca,hn.format=Ua,_e.bindRenderbuffer(uc,hn.renderbuffer),_e.renderbufferStorage(uc,Ua,Ma,ca),oi.profile&&(hn.stats.size=jc(hn.format,hn.width,hn.height)),Nn.format=gn[hn.format],Nn}function Oi(_i,Qn){var Ma=_i|0,ca=Qn|0||Ma;return Ma===hn.width&&ca===hn.height||(Nn.width=hn.width=Ma,Nn.height=hn.height=ca,_e.bindRenderbuffer(uc,hn.renderbuffer),_e.renderbufferStorage(uc,hn.format,Ma,ca),oi.profile&&(hn.stats.size=jc(hn.format,hn.width,hn.height))),Nn}return Nn(ta,wi),Nn.resize=Oi,Nn._reglType="renderbuffer",Nn._renderbuffer=hn,oi.profile&&(Nn.stats=hn.stats),Nn.destroy=function(){hn.decRef()},Nn}oi.profile&&(Dn.getTotalRenderbufferSize=function(){var ta=0;return Object.keys(Yi).forEach(function(wi){ta+=Yi[wi].stats.size}),ta});function Ba(){Ce(Yi).forEach(function(ta){ta.renderbuffer=_e.createRenderbuffer(),_e.bindRenderbuffer(uc,ta.renderbuffer),_e.renderbufferStorage(uc,ta.format,ta.width,ta.height)}),_e.bindRenderbuffer(uc,null)}return{create:Za,clear:function(){Ce(Yi).forEach(va)},restore:Ba}},lu=36160,Eh=36161,Sc=3553,Uc=34069,_u=36064,uf=36096,gh=36128,Wh=33306,Cf=36193,Pd=5121,Qd=5126,cf=6407,Lf=6408,wc=[];wc[Lf]=4,wc[cf]=3;var hf=[];hf[Pd]=1,hf[Qd]=4,hf[Cf]=2;function Qc(_e,kr,Lr,Dn,oi,Jn){var gn={cur:null,next:null,dirty:!1,setFBO:null},ni=["rgba"],Yi=["rgba4","rgb565","rgb5 a1"];kr.ext_srgb&&Yi.push("srgba"),kr.ext_color_buffer_half_float&&Yi.push("rgba16f","rgb16f"),kr.webgl_color_buffer_float&&Yi.push("rgba32f");var Ui=["uint8"];kr.oes_texture_half_float&&Ui.push("half float","float16"),kr.oes_texture_float&&Ui.push("float","float32");function va(qi,$i,_a){this.target=qi,this.texture=$i,this.renderbuffer=_a;var Po=0,wo=0;$i?(Po=$i.width,wo=$i.height):_a&&(Po=_a.width,wo=_a.height),this.width=Po,this.height=wo}function Za(qi){qi&&(qi.texture&&qi.texture._texture.decRef(),qi.renderbuffer&&qi.renderbuffer._renderbuffer.decRef())}function Ba(qi,$i,_a){if(qi)if(qi.texture){var Po=qi.texture._texture;Math.max(1,Po.width),Math.max(1,Po.height),Po.refCount+=1}else{var wo=qi.renderbuffer._renderbuffer;wo.refCount+=1}}function ta(qi,$i){$i&&($i.texture?_e.framebufferTexture2D(lu,qi,$i.target,$i.texture._texture.texture,0):_e.framebufferRenderbuffer(lu,qi,Eh,$i.renderbuffer._renderbuffer.renderbuffer))}function wi(qi){var $i=Sc,_a=null,Po=null,wo=qi;typeof qi=="object"&&(wo=qi.data,"target"in qi&&($i=qi.target|0));var xa=wo._reglType;return xa==="texture2d"||xa==="textureCube"?_a=wo:xa==="renderbuffer"&&(Po=wo,$i=Eh),new va($i,_a,Po)}function hn(qi,$i,_a,Po,wo){if(_a){var xa=Dn.create2D({width:qi,height:$i,format:Po,type:wo});return xa._texture.refCount=0,new va(Sc,xa,null)}else{var Oa=oi.create({width:qi,height:$i,format:Po});return Oa._renderbuffer.refCount=0,new va(Eh,null,Oa)}}function Nn(qi){return qi&&(qi.texture||qi.renderbuffer)}function Oi(qi,$i,_a){qi&&(qi.texture?qi.texture.resize($i,_a):qi.renderbuffer&&qi.renderbuffer.resize($i,_a),qi.width=$i,qi.height=_a)}var _i=0,Qn={};function Ma(){this.id=_i++,Qn[this.id]=this,this.framebuffer=_e.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function ca(qi){qi.colorAttachments.forEach(Za),Za(qi.depthAttachment),Za(qi.stencilAttachment),Za(qi.depthStencilAttachment)}function Ua(qi){var $i=qi.framebuffer;_e.deleteFramebuffer($i),qi.framebuffer=null,Jn.framebufferCount--,delete Qn[qi.id]}function vi(qi){var $i;_e.bindFramebuffer(lu,qi.framebuffer);var _a=qi.colorAttachments;for($i=0;$i<_a.length;++$i)ta(_u+$i,_a[$i]);for($i=_a.length;$i<Lr.maxColorAttachments;++$i)_e.framebufferTexture2D(lu,_u+$i,Sc,null,0);_e.framebufferTexture2D(lu,Wh,Sc,null,0),_e.framebufferTexture2D(lu,uf,Sc,null,0),_e.framebufferTexture2D(lu,gh,Sc,null,0),ta(uf,qi.depthAttachment),ta(gh,qi.stencilAttachment),ta(Wh,qi.depthStencilAttachment),_e.checkFramebufferStatus(lu),_e.isContextLost(),_e.bindFramebuffer(lu,gn.next?gn.next.framebuffer:null),gn.cur=gn.next,_e.getError()}function ti(qi,$i){var _a=new Ma;Jn.framebufferCount++;function Po(xa,Oa){var ho,So=0,ts=0,Nl=!0,Al=!0,us=null,wu=!0,fl="rgba",Eu="uint8",pc=1,yc=null,yu=null,hu=null,ku=!1;if(typeof xa=="number")So=xa|0,ts=Oa|0||So;else if(!xa)So=ts=1;else{var Bo=xa;if("shape"in Bo){var Tu=Bo.shape;So=Tu[0],ts=Tu[1]}else"radius"in Bo&&(So=ts=Bo.radius),"width"in Bo&&(So=Bo.width),"height"in Bo&&(ts=Bo.height);("color"in Bo||"colors"in Bo)&&(us=Bo.color||Bo.colors,Array.isArray(us)),us||("colorCount"in Bo&&(pc=Bo.colorCount|0),"colorTexture"in Bo&&(wu=!!Bo.colorTexture,fl="rgba4"),"colorType"in Bo&&(Eu=Bo.colorType,wu||(Eu==="half float"||Eu==="float16"?fl="rgba16f":(Eu==="float"||Eu==="float32")&&(fl="rgba32f"))),"colorFormat"in Bo&&(fl=Bo.colorFormat,ni.indexOf(fl)>=0?wu=!0:Yi.indexOf(fl)>=0&&(wu=!1))),("depthTexture"in Bo||"depthStencilTexture"in Bo)&&(ku=!!(Bo.depthTexture||Bo.depthStencilTexture)),"depth"in Bo&&(typeof Bo.depth=="boolean"?Nl=Bo.depth:(yc=Bo.depth,Al=!1)),"stencil"in Bo&&(typeof Bo.stencil=="boolean"?Al=Bo.stencil:(yu=Bo.stencil,Nl=!1)),"depthStencil"in Bo&&(typeof Bo.depthStencil=="boolean"?Nl=Al=Bo.depthStencil:(hu=Bo.depthStencil,Nl=!1,Al=!1))}var ol=null,Cu=null,xc=null,Eo=null;if(Array.isArray(us))ol=us.map(wi);else if(us)ol=[wi(us)];else for(ol=new Array(pc),ho=0;ho<pc;++ho)ol[ho]=hn(So,ts,wu,fl,Eu);for(So=So||ol[0].width,ts=ts||ol[0].height,yc?Cu=wi(yc):Nl&&!Al&&(Cu=hn(So,ts,ku,"depth","uint32")),yu?xc=wi(yu):Al&&!Nl&&(xc=hn(So,ts,!1,"stencil","uint8")),hu?Eo=wi(hu):!yc&&!yu&&Al&&Nl&&(Eo=hn(So,ts,ku,"depth stencil","depth stencil")),ho=0;ho<ol.length;++ho)Ba(ol[ho]),ol[ho]&&ol[ho].texture&&wc[ol[ho].texture._texture.format]*hf[ol[ho].texture._texture.type];return Ba(Cu),Ba(xc),Ba(Eo),ca(_a),_a.width=So,_a.height=ts,_a.colorAttachments=ol,_a.depthAttachment=Cu,_a.stencilAttachment=xc,_a.depthStencilAttachment=Eo,Po.color=ol.map(Nn),Po.depth=Nn(Cu),Po.stencil=Nn(xc),Po.depthStencil=Nn(Eo),Po.width=_a.width,Po.height=_a.height,vi(_a),Po}function wo(xa,Oa){var ho=Math.max(xa|0,1),So=Math.max(Oa|0||ho,1);if(ho===_a.width&&So===_a.height)return Po;for(var ts=_a.colorAttachments,Nl=0;Nl<ts.length;++Nl)Oi(ts[Nl],ho,So);return Oi(_a.depthAttachment,ho,So),Oi(_a.stencilAttachment,ho,So),Oi(_a.depthStencilAttachment,ho,So),_a.width=Po.width=ho,_a.height=Po.height=So,vi(_a),Po}return Po(qi,$i),c(Po,{resize:wo,_reglType:"framebuffer",_framebuffer:_a,destroy:function(){Ua(_a),ca(_a)},use:function(xa){gn.setFBO({framebuffer:Po},xa)}})}function Sa(qi){var $i=Array(6);function _a(wo){var xa,Oa={color:null},ho=0,So=null,ts="rgba",Nl="uint8",Al=1;if(typeof wo=="number")ho=wo|0;else if(!wo)ho=1;else{var us=wo;if("shape"in us){var wu=us.shape;ho=wu[0]}else"radius"in us&&(ho=us.radius|0),"width"in us?(ho=us.width|0,"height"in us):"height"in us&&(ho=us.height|0);("color"in us||"colors"in us)&&(So=us.color||us.colors,Array.isArray(So)),So||("colorCount"in us&&(Al=us.colorCount|0),"colorType"in us&&(Nl=us.colorType),"colorFormat"in us&&(ts=us.colorFormat)),"depth"in us&&(Oa.depth=us.depth),"stencil"in us&&(Oa.stencil=us.stencil),"depthStencil"in us&&(Oa.depthStencil=us.depthStencil)}var fl;if(So)if(Array.isArray(So))for(fl=[],xa=0;xa<So.length;++xa)fl[xa]=So[xa];else fl=[So];else{fl=Array(Al);var Eu={radius:ho,format:ts,type:Nl};for(xa=0;xa<Al;++xa)fl[xa]=Dn.createCube(Eu)}for(Oa.color=Array(fl.length),xa=0;xa<fl.length;++xa){var pc=fl[xa];ho=ho||pc.width,Oa.color[xa]={target:Uc,data:fl[xa]}}for(xa=0;xa<6;++xa){for(var yc=0;yc<fl.length;++yc)Oa.color[yc].target=Uc+xa;xa>0&&(Oa.depth=$i[0].depth,Oa.stencil=$i[0].stencil,Oa.depthStencil=$i[0].depthStencil),$i[xa]?$i[xa](Oa):$i[xa]=ti(Oa)}return c(_a,{width:ho,height:ho,color:fl})}function Po(wo){var xa,Oa=wo|0;if(Oa===_a.width)return _a;var ho=_a.color;for(xa=0;xa<ho.length;++xa)ho[xa].resize(Oa);for(xa=0;xa<6;++xa)$i[xa].resize(Oa);return _a.width=_a.height=Oa,_a}return _a(qi),c(_a,{faces:$i,resize:Po,_reglType:"framebufferCube",destroy:function(){$i.forEach(function(wo){wo.destroy()})}})}function pa(){gn.cur=null,gn.next=null,gn.dirty=!0,Ce(Qn).forEach(function(qi){qi.framebuffer=_e.createFramebuffer(),vi(qi)})}return c(gn,{getFramebuffer:function(qi){if(typeof qi=="function"&&qi._reglType==="framebuffer"){var $i=qi._framebuffer;if($i instanceof Ma)return $i}return null},create:ti,createCube:Sa,clear:function(){Ce(Qn).forEach(Ua)},restore:pa})}var ff=5126,Pf=34962,vh=34963;function bu(){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=ff,this.offset=0,this.stride=0,this.divisor=0}function Ch(_e,kr,Lr,Dn,oi,Jn,gn){for(var ni=Lr.maxAttributes,Yi=new Array(ni),Ui=0;Ui<ni;++Ui)Yi[Ui]=new bu;var va=0,Za={},Ba={Record:bu,scope:{},state:Yi,currentVAO:null,targetVAO:null,restore:wi()?ca:function(){},createVAO:Ua,getVAO:Nn,destroyBuffer:ta,setVAO:wi()?Oi:_i,clear:wi()?Qn:function(){}};function ta(vi){for(var ti=0;ti<Yi.length;++ti){var Sa=Yi[ti];Sa.buffer===vi&&(_e.disableVertexAttribArray(ti),Sa.buffer=null)}}function wi(){return kr.oes_vertex_array_object}function hn(){return kr.angle_instanced_arrays}function Nn(vi){return typeof vi=="function"&&vi._vao?vi._vao:null}function Oi(vi){if(vi!==Ba.currentVAO){var ti=wi();vi?ti.bindVertexArrayOES(vi.vao):ti.bindVertexArrayOES(null),Ba.currentVAO=vi}}function _i(vi){if(vi!==Ba.currentVAO){if(vi)vi.bindAttrs();else{for(var ti=hn(),Sa=0;Sa<Yi.length;++Sa){var pa=Yi[Sa];pa.buffer?(_e.enableVertexAttribArray(Sa),pa.buffer.bind(),_e.vertexAttribPointer(Sa,pa.size,pa.type,pa.normalized,pa.stride,pa.offfset),ti&&pa.divisor&&ti.vertexAttribDivisorANGLE(Sa,pa.divisor)):(_e.disableVertexAttribArray(Sa),_e.vertexAttrib4f(Sa,pa.x,pa.y,pa.z,pa.w))}gn.elements?_e.bindBuffer(vh,gn.elements.buffer.buffer):_e.bindBuffer(vh,null)}Ba.currentVAO=vi}}function Qn(){Ce(Za).forEach(function(vi){vi.destroy()})}function Ma(){this.id=++va,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var vi=wi();vi?this.vao=vi.createVertexArrayOES():this.vao=null,Za[this.id]=this,this.buffers=[]}Ma.prototype.bindAttrs=function(){for(var vi=hn(),ti=this.attributes,Sa=0;Sa<ti.length;++Sa){var pa=ti[Sa];pa.buffer?(_e.enableVertexAttribArray(Sa),_e.bindBuffer(Pf,pa.buffer.buffer),_e.vertexAttribPointer(Sa,pa.size,pa.type,pa.normalized,pa.stride,pa.offset),vi&&pa.divisor&&vi.vertexAttribDivisorANGLE(Sa,pa.divisor)):(_e.disableVertexAttribArray(Sa),_e.vertexAttrib4f(Sa,pa.x,pa.y,pa.z,pa.w))}for(var qi=ti.length;qi<ni;++qi)_e.disableVertexAttribArray(qi);var $i=Jn.getElements(this.elements);$i?_e.bindBuffer(vh,$i.buffer.buffer):_e.bindBuffer(vh,null)},Ma.prototype.refresh=function(){var vi=wi();vi&&(vi.bindVertexArrayOES(this.vao),this.bindAttrs(),Ba.currentVAO=null,vi.bindVertexArrayOES(null))},Ma.prototype.destroy=function(){if(this.vao){var vi=wi();this===Ba.currentVAO&&(Ba.currentVAO=null,vi.bindVertexArrayOES(null)),vi.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),Za[this.id]&&(delete Za[this.id],Dn.vaoCount-=1)};function ca(){var vi=wi();vi&&Ce(Za).forEach(function(ti){ti.refresh()})}function Ua(vi){var ti=new Ma;Dn.vaoCount+=1;function Sa(pa){var qi;if(Array.isArray(pa))qi=pa,ti.elements&&ti.ownsElements&&ti.elements.destroy(),ti.elements=null,ti.ownsElements=!1,ti.offset=0,ti.count=0,ti.instances=-1,ti.primitive=4;else{if(pa.elements){var $i=pa.elements;ti.ownsElements?typeof $i=="function"&&$i._reglType==="elements"?(ti.elements.destroy(),ti.ownsElements=!1):(ti.elements($i),ti.ownsElements=!1):Jn.getElements(pa.elements)?(ti.elements=pa.elements,ti.ownsElements=!1):(ti.elements=Jn.create(pa.elements),ti.ownsElements=!0)}else ti.elements=null,ti.ownsElements=!1;qi=pa.attributes,ti.offset=0,ti.count=-1,ti.instances=-1,ti.primitive=4,ti.elements&&(ti.count=ti.elements._elements.vertCount,ti.primitive=ti.elements._elements.primType),"offset"in pa&&(ti.offset=pa.offset|0),"count"in pa&&(ti.count=pa.count|0),"instances"in pa&&(ti.instances=pa.instances|0),"primitive"in pa&&(ti.primitive=ui[pa.primitive])}var _a={},Po=ti.attributes;Po.length=qi.length;for(var wo=0;wo<qi.length;++wo){var xa=qi[wo],Oa=Po[wo]=new bu,ho=xa.data||xa;if(Array.isArray(ho)||Kr(ho)||rn(ho)){var So;ti.buffers[wo]&&(So=ti.buffers[wo],Kr(ho)&&So._buffer.byteLength>=ho.byteLength?So.subdata(ho):(So.destroy(),ti.buffers[wo]=null)),ti.buffers[wo]||(So=ti.buffers[wo]=oi.create(xa,Pf,!1,!0)),Oa.buffer=oi.getBuffer(So),Oa.size=Oa.buffer.dimension|0,Oa.normalized=!1,Oa.type=Oa.buffer.dtype,Oa.offset=0,Oa.stride=0,Oa.divisor=0,Oa.state=1,_a[wo]=1}else oi.getBuffer(xa)?(Oa.buffer=oi.getBuffer(xa),Oa.size=Oa.buffer.dimension|0,Oa.normalized=!1,Oa.type=Oa.buffer.dtype,Oa.offset=0,Oa.stride=0,Oa.divisor=0,Oa.state=1):oi.getBuffer(xa.buffer)?(Oa.buffer=oi.getBuffer(xa.buffer),Oa.size=(+xa.size||Oa.buffer.dimension)|0,Oa.normalized=!!xa.normalized||!1,"type"in xa?Oa.type=Vn[xa.type]:Oa.type=Oa.buffer.dtype,Oa.offset=(xa.offset||0)|0,Oa.stride=(xa.stride||0)|0,Oa.divisor=(xa.divisor||0)|0,Oa.state=1):"x"in xa&&(Oa.x=+xa.x||0,Oa.y=+xa.y||0,Oa.z=+xa.z||0,Oa.w=+xa.w||0,Oa.state=2)}for(var ts=0;ts<ti.buffers.length;++ts)!_a[ts]&&ti.buffers[ts]&&(ti.buffers[ts].destroy(),ti.buffers[ts]=null);return ti.refresh(),Sa}return Sa.destroy=function(){for(var pa=0;pa<ti.buffers.length;++pa)ti.buffers[pa]&&ti.buffers[pa].destroy();ti.buffers.length=0,ti.ownsElements&&(ti.elements.destroy(),ti.elements=null,ti.ownsElements=!1),ti.destroy()},Sa._vao=ti,Sa._reglType="vao",Sa(vi)}return Ba}var Vc=35632,fd=35633,vu=35718,bf=35721;function qh(_e,kr,Lr,Dn){var oi={},Jn={};function gn(hn,Nn,Oi,_i){this.name=hn,this.id=Nn,this.location=Oi,this.info=_i}function ni(hn,Nn){for(var Oi=0;Oi<hn.length;++Oi)if(hn[Oi].id===Nn.id){hn[Oi].location=Nn.location;return}hn.push(Nn)}function Yi(hn,Nn,Oi){var _i=hn===Vc?oi:Jn,Qn=_i[Nn];if(!Qn){var Ma=kr.str(Nn);Qn=_e.createShader(hn),_e.shaderSource(Qn,Ma),_e.compileShader(Qn),_i[Nn]=Qn}return Qn}var Ui={},va=[],Za=0;function Ba(hn,Nn){this.id=Za++,this.fragId=hn,this.vertId=Nn,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,Dn.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function ta(hn,Nn,Oi){var _i,Qn,Ma=Yi(Vc,hn.fragId),ca=Yi(fd,hn.vertId),Ua=hn.program=_e.createProgram();if(_e.attachShader(Ua,Ma),_e.attachShader(Ua,ca),Oi)for(_i=0;_i<Oi.length;++_i){var vi=Oi[_i];_e.bindAttribLocation(Ua,vi[0],vi[1])}_e.linkProgram(Ua);var ti=_e.getProgramParameter(Ua,vu);Dn.profile&&(hn.stats.uniformsCount=ti);var Sa=hn.uniforms;for(_i=0;_i<ti;++_i)if(Qn=_e.getActiveUniform(Ua,_i),Qn)if(Qn.size>1)for(var pa=0;pa<Qn.size;++pa){var qi=Qn.name.replace("[0]","["+pa+"]");ni(Sa,new gn(qi,kr.id(qi),_e.getUniformLocation(Ua,qi),Qn))}else ni(Sa,new gn(Qn.name,kr.id(Qn.name),_e.getUniformLocation(Ua,Qn.name),Qn));var $i=_e.getProgramParameter(Ua,bf);Dn.profile&&(hn.stats.attributesCount=$i);var _a=hn.attributes;for(_i=0;_i<$i;++_i)Qn=_e.getActiveAttrib(Ua,_i),Qn&&ni(_a,new gn(Qn.name,kr.id(Qn.name),_e.getAttribLocation(Ua,Qn.name),Qn))}Dn.profile&&(Lr.getMaxUniformsCount=function(){var hn=0;return va.forEach(function(Nn){Nn.stats.uniformsCount>hn&&(hn=Nn.stats.uniformsCount)}),hn},Lr.getMaxAttributesCount=function(){var hn=0;return va.forEach(function(Nn){Nn.stats.attributesCount>hn&&(hn=Nn.stats.attributesCount)}),hn});function wi(){oi={},Jn={};for(var hn=0;hn<va.length;++hn)ta(va[hn],null,va[hn].attributes.map(function(Nn){return[Nn.location,Nn.name]}))}return{clear:function(){var hn=_e.deleteShader.bind(_e);Ce(oi).forEach(hn),oi={},Ce(Jn).forEach(hn),Jn={},va.forEach(function(Nn){_e.deleteProgram(Nn.program)}),va.length=0,Ui={},Lr.shaderCount=0},program:function(hn,Nn,Oi,_i){var Qn=Ui[Nn];Qn||(Qn=Ui[Nn]={});var Ma=Qn[hn];if(Ma&&(Ma.refCount++,!_i))return Ma;var ca=new Ba(Nn,hn);return Lr.shaderCount++,ta(ca,Oi,_i),Ma||(Qn[hn]=ca),va.push(ca),c(ca,{destroy:function(){if(ca.refCount--,ca.refCount<=0){_e.deleteProgram(ca.program);var Ua=va.indexOf(ca);va.splice(Ua,1),Lr.shaderCount--}Qn[ca.vertId].refCount<=0&&(_e.deleteShader(Jn[ca.vertId]),delete Jn[ca.vertId],delete Ui[ca.fragId][ca.vertId]),Object.keys(Ui[ca.fragId]).length||(_e.deleteShader(oi[ca.fragId]),delete oi[ca.fragId],delete Ui[ca.fragId])}})},restore:wi,shader:Yi,frag:-1,vert:-1}}var th=6408,rf=5121,Zh=3333,wf=5126;function zd(_e,kr,Lr,Dn,oi,Jn,gn){function ni(va){var Za;kr.next===null?Za=rf:Za=kr.next.colorAttachments[0].texture._texture.type;var Ba=0,ta=0,wi=Dn.framebufferWidth,hn=Dn.framebufferHeight,Nn=null;Kr(va)?Nn=va:va&&(Ba=va.x|0,ta=va.y|0,wi=(va.width||Dn.framebufferWidth-Ba)|0,hn=(va.height||Dn.framebufferHeight-ta)|0,Nn=va.data||null),Lr();var Oi=wi*hn*4;return Nn||(Za===rf?Nn=new Uint8Array(Oi):Za===wf&&(Nn=Nn||new Float32Array(Oi))),_e.pixelStorei(Zh,4),_e.readPixels(Ba,ta,wi,hn,th,Za,Nn),Nn}function Yi(va){var Za;return kr.setFBO({framebuffer:va.framebuffer},function(){Za=ni(va)}),Za}function Ui(va){return!va||!("framebuffer"in va)?ni(va):Yi(va)}return Ui}function gc(_e){return eh(Jf(Lh(_e)))}function Jf(_e){return Ru(Wn(yh(_e),_e.length*8))}function eh(_e){for(var kr="0123456789abcdef",Lr="",Dn,oi=0;oi<_e.length;oi++)Dn=_e.charCodeAt(oi),Lr+=kr.charAt(Dn>>>4&15)+kr.charAt(Dn&15);return Lr}function Lh(_e){for(var kr="",Lr=-1,Dn,oi;++Lr<_e.length;)Dn=_e.charCodeAt(Lr),oi=Lr+1<_e.length?_e.charCodeAt(Lr+1):0,55296<=Dn&&Dn<=56319&&56320<=oi&&oi<=57343&&(Dn=65536+((Dn&1023)<<10)+(oi&1023),Lr++),Dn<=127?kr+=String.fromCharCode(Dn):Dn<=2047?kr+=String.fromCharCode(192|Dn>>>6&31,128|Dn&63):Dn<=65535?kr+=String.fromCharCode(224|Dn>>>12&15,128|Dn>>>6&63,128|Dn&63):Dn<=2097151&&(kr+=String.fromCharCode(240|Dn>>>18&7,128|Dn>>>12&63,128|Dn>>>6&63,128|Dn&63));return kr}function yh(_e){for(var kr=Array(_e.length>>2),Lr=0;Lr<kr.length;Lr++)kr[Lr]=0;for(var Lr=0;Lr<_e.length*8;Lr+=8)kr[Lr>>5]|=(_e.charCodeAt(Lr/8)&255)<<24-Lr%32;return kr}function Ru(_e){for(var kr="",Lr=0;Lr<_e.length*32;Lr+=8)kr+=String.fromCharCode(_e[Lr>>5]>>>24-Lr%32&255);return kr}function eu(_e,kr){return _e>>>kr|_e<<32-kr}function xh(_e,kr){return _e>>>kr}function df(_e,kr,Lr){return _e&kr^~_e&Lr}function _h(_e,kr,Lr){return _e&kr^_e&Lr^kr&Lr}function qf(_e){return eu(_e,2)^eu(_e,13)^eu(_e,22)}function mr(_e){return eu(_e,6)^eu(_e,11)^eu(_e,25)}function Ur(_e){return eu(_e,7)^eu(_e,18)^xh(_e,3)}function _n(_e){return eu(_e,17)^eu(_e,19)^xh(_e,10)}var cn=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 Wn(_e,kr){var Lr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Dn=new Array(64),oi,Jn,gn,ni,Yi,Ui,va,Za,Ba,ta,wi,hn;for(_e[kr>>5]|=128<<24-kr%32,_e[(kr+64>>9<<4)+15]=kr,Ba=0;Ba<_e.length;Ba+=16){for(oi=Lr[0],Jn=Lr[1],gn=Lr[2],ni=Lr[3],Yi=Lr[4],Ui=Lr[5],va=Lr[6],Za=Lr[7],ta=0;ta<64;ta++)ta<16?Dn[ta]=_e[ta+Ba]:Dn[ta]=hi(hi(hi(_n(Dn[ta-2]),Dn[ta-7]),Ur(Dn[ta-15])),Dn[ta-16]),wi=hi(hi(hi(hi(Za,mr(Yi)),df(Yi,Ui,va)),cn[ta]),Dn[ta]),hn=hi(qf(oi),_h(oi,Jn,gn)),Za=va,va=Ui,Ui=Yi,Yi=hi(ni,wi),ni=gn,gn=Jn,Jn=oi,oi=hi(wi,hn);Lr[0]=hi(oi,Lr[0]),Lr[1]=hi(Jn,Lr[1]),Lr[2]=hi(gn,Lr[2]),Lr[3]=hi(ni,Lr[3]),Lr[4]=hi(Yi,Lr[4]),Lr[5]=hi(Ui,Lr[5]),Lr[6]=hi(va,Lr[6]),Lr[7]=hi(Za,Lr[7])}return Lr}function hi(_e,kr){var Lr=(_e&65535)+(kr&65535),Dn=(_e>>16)+(kr>>16)+(Lr>>16);return Dn<<16|Lr&65535}function ea(_e){return Array.prototype.slice.call(_e)}function ga(_e){return ea(_e).join("")}function Ra(_e){var kr=_e&&_e.cache,Lr=0,Dn=[],oi=[],Jn=[];function gn(wi,hn){var Nn=hn&&hn.stable;if(!Nn){for(var Oi=0;Oi<oi.length;++Oi)if(oi[Oi]===wi&&!Jn[Oi])return Dn[Oi]}var _i="g"+Lr++;return Dn.push(_i),oi.push(wi),Jn.push(Nn),_i}function ni(){var wi=[];function hn(){wi.push.apply(wi,ea(arguments))}var Nn=[];function Oi(){var _i="v"+Lr++;return Nn.push(_i),arguments.length>0&&(wi.push(_i,"="),wi.push.apply(wi,ea(arguments)),wi.push(";")),_i}return c(hn,{def:Oi,toString:function(){return ga([Nn.length>0?"var "+Nn.join(",")+";":"",ga(wi)])}})}function Yi(){var wi=ni(),hn=ni(),Nn=wi.toString,Oi=hn.toString;function _i(Qn,Ma){hn(Qn,Ma,"=",wi.def(Qn,Ma),";")}return c(function(){wi.apply(wi,ea(arguments))},{def:wi.def,entry:wi,exit:hn,save:_i,set:function(Qn,Ma,ca){_i(Qn,Ma),wi(Qn,Ma,"=",ca,";")},toString:function(){return Nn()+Oi()}})}function Ui(){var wi=ga(arguments),hn=Yi(),Nn=Yi(),Oi=hn.toString,_i=Nn.toString;return c(hn,{then:function(){return hn.apply(hn,ea(arguments)),this},else:function(){return Nn.apply(Nn,ea(arguments)),this},toString:function(){var Qn=_i();return Qn&&(Qn="else{"+Qn+"}"),ga(["if(",wi,"){",Oi(),"}",Qn])}})}var va=ni(),Za={};function Ba(wi,hn){var Nn=[];function Oi(){var Ua="a"+Nn.length;return Nn.push(Ua),Ua}hn=hn||0;for(var _i=0;_i<hn;++_i)Oi();var Qn=Yi(),Ma=Qn.toString,ca=Za[wi]=c(Qn,{arg:Oi,toString:function(){return ga(["function(",Nn.join(),"){",Ma(),"}"])}});return ca}function ta(){var wi=['"use strict";',va,"return {"];Object.keys(Za).forEach(function(_i){wi.push('"',_i,'":',Za[_i].toString(),",")}),wi.push("}");var hn=ga(wi).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),Nn;if(kr&&(Nn=gc(hn),kr[Nn]))return kr[Nn].apply(null,oi);var Oi=Function.apply(null,Dn.concat(hn));return kr&&(kr[Nn]=Oi),Oi.apply(null,oi)}return{global:va,link:gn,block:ni,proc:Ba,scope:Yi,cond:Ui,compile:ta}}var $a="xyzw".split(""),ua=5121,za=1,wa=2,Ji=0,eo=1,rs=2,Zo=3,os=4,fs=5,no=6,qa="dither",ds="blend.enable",tl="blend.color",Pl="blend.equation",iu="blend.func",Hl="depth.enable",au="depth.func",ml="depth.range",qu="depth.mask",Lu="colorMask",uu="cull.enable",zo="cull.face",Ms="frontFace",$l="lineWidth",Fl="polygonOffset.enable",vc="polygonOffset.offset",Hc="sample.alpha",Pc="sample.enable",Ph="sample.coverage",Wc="stencil.enable",zh="stencil.mask",Iu="stencil.func",Ih="stencil.opFront",es="stencil.opBack",zs="scissor.enable",qc="scissor.box",Zu="viewport",Zf="profile",qt="framebuffer",I="vert",ht="frag",Et="elements",It="primitive",Vt="count",ke="offset",Oe="instances",Ke="vao",gr="Width",Or="Height",Dr=qt+gr,ln=qt+Or,Sn=Zu+gr,Xt=Zu+Or,ae="drawingBuffer",xe=ae+gr,Ae=ae+Or,je=[iu,Pl,Iu,Ih,es,Ph,Zu,qc,vc],Ie=34962,Ze=34963,wr=2884,Ir=3042,Nr=3024,tn=2960,mn=2929,zn=3089,Bn=32823,ri=32926,Fi=32928,da=5126,ha=35664,ka=35665,io=35666,Ro=5124,Mo=35667,hs=35668,hl=35669,vl=35670,Os=35671,bl=35672,Su=35673,mu=35674,Ws=35675,qs=35676,Yu=35678,dc=35680,Zc=4,At=1028,jt=1029,ue=2304,Me=2305,Le=32775,Be=32776,sr=519,ir=7680,Mr=0,en=1,Xr=32774,vn=513,In=36160,On=36064,Bi={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},Un={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},mi={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ti={cw:ue,ccw:Me};function Ii(_e){return Array.isArray(_e)||Kr(_e)||rn(_e)}function Wi(_e){return _e.sort(function(kr,Lr){return kr===Zu?-1:Lr===Zu?1:kr<Lr?-1:1})}function Yn(_e,kr,Lr,Dn){this.thisDep=_e,this.contextDep=kr,this.propDep=Lr,this.append=Dn}function ja(_e){return _e&&!(_e.thisDep||_e.contextDep||_e.propDep)}function Ha(_e){return new Yn(!1,!1,!1,_e)}function ro(_e,kr){var Lr=_e.type;if(Lr===Ji){var Dn=_e.data.length;return new Yn(!0,Dn>=1,Dn>=2,kr)}else if(Lr===os){var oi=_e.data;return new Yn(oi.thisDep,oi.contextDep,oi.propDep,kr)}else{if(Lr===fs)return new Yn(!1,!1,!1,kr);if(Lr===no){for(var Jn=!1,gn=!1,ni=!1,Yi=0;Yi<_e.data.length;++Yi){var Ui=_e.data[Yi];if(Ui.type===eo)ni=!0;else if(Ui.type===rs)gn=!0;else if(Ui.type===Zo)Jn=!0;else if(Ui.type===Ji){Jn=!0;var va=Ui.data;va>=1&&(gn=!0),va>=2&&(ni=!0)}else Ui.type===os&&(Jn=Jn||Ui.data.thisDep,gn=gn||Ui.data.contextDep,ni=ni||Ui.data.propDep)}return new Yn(Jn,gn,ni,kr)}else return new Yn(Lr===Zo,Lr===rs,Lr===eo,kr)}}var Lo=new Yn(!1,!1,!1,function(){});function Fo(_e,kr,Lr,Dn,oi,Jn,gn,ni,Yi,Ui,va,Za,Ba,ta,wi,hn){var Nn=Ui.Record,Oi={add:32774,subtract:32778,"reverse subtract":32779};Lr.ext_blend_minmax&&(Oi.min=Le,Oi.max=Be);var _i=Lr.angle_instanced_arrays,Qn=Lr.webgl_draw_buffers,Ma=Lr.oes_vertex_array_object,ca={dirty:!0,profile:hn.profile},Ua={},vi=[],ti={},Sa={};function pa(Yt){return Yt.replace(".","_")}function qi(Yt,ce,Se){var nr=pa(Yt);vi.push(Yt),Ua[nr]=ca[nr]=!!Se,ti[nr]=ce}function $i(Yt,ce,Se){var nr=pa(Yt);vi.push(Yt),Array.isArray(Se)?(ca[nr]=Se.slice(),Ua[nr]=Se.slice()):ca[nr]=Ua[nr]=Se,Sa[nr]=ce}function _a(Yt){return!!isNaN(Yt)}qi(qa,Nr),qi(ds,Ir),$i(tl,"blendColor",[0,0,0,0]),$i(Pl,"blendEquationSeparate",[Xr,Xr]),$i(iu,"blendFuncSeparate",[en,Mr,en,Mr]),qi(Hl,mn,!0),$i(au,"depthFunc",vn),$i(ml,"depthRange",[0,1]),$i(qu,"depthMask",!0),$i(Lu,Lu,[!0,!0,!0,!0]),qi(uu,wr),$i(zo,"cullFace",jt),$i(Ms,Ms,Me),$i($l,$l,1),qi(Fl,Bn),$i(vc,"polygonOffset",[0,0]),qi(Hc,ri),qi(Pc,Fi),$i(Ph,"sampleCoverage",[1,!1]),qi(Wc,tn),$i(zh,"stencilMask",-1),$i(Iu,"stencilFunc",[sr,0,-1]),$i(Ih,"stencilOpSeparate",[At,ir,ir,ir]),$i(es,"stencilOpSeparate",[jt,ir,ir,ir]),qi(zs,zn),$i(qc,"scissor",[0,0,_e.drawingBufferWidth,_e.drawingBufferHeight]),$i(Zu,Zu,[0,0,_e.drawingBufferWidth,_e.drawingBufferHeight]);var Po={gl:_e,context:Ba,strings:kr,next:Ua,current:ca,draw:Za,elements:Jn,buffer:oi,shader:va,attributes:Ui.state,vao:Ui,uniforms:Yi,framebuffer:ni,extensions:Lr,timer:ta,isBufferArgs:Ii},wo={primTypes:ui,compareFuncs:Un,blendFuncs:Bi,blendEquations:Oi,stencilOps:mi,glTypes:Vn,orientationType:Ti};Qn&&(wo.backBuffer=[jt],wo.drawBuffer=h(Dn.maxDrawbuffers,function(Yt){return Yt===0?[0]:h(Yt,function(ce){return On+ce})}));var xa=0;function Oa(){var Yt=Ra({cache:wi}),ce=Yt.link,Se=Yt.global;Yt.id=xa++,Yt.batchId="0";var nr=ce(Po),Ye=Yt.shared={props:"a0"};Object.keys(Po).forEach(function(Xe){Ye[Xe]=Se.def(nr,".",Xe)});var tr=Yt.next={},lr=Yt.current={};Object.keys(Sa).forEach(function(Xe){Array.isArray(ca[Xe])&&(tr[Xe]=Se.def(Ye.next,".",Xe),lr[Xe]=Se.def(Ye.current,".",Xe))});var hr=Yt.constants={};Object.keys(wo).forEach(function(Xe){hr[Xe]=Se.def(JSON.stringify(wo[Xe]))}),Yt.invoke=function(Xe,$e){switch($e.type){case Ji:var Cr=["this",Ye.context,Ye.props,Yt.batchId];return Xe.def(ce($e.data),".call(",Cr.slice(0,Math.max($e.data.length+1,4)),")");case eo:return Xe.def(Ye.props,$e.data);case rs:return Xe.def(Ye.context,$e.data);case Zo:return Xe.def("this",$e.data);case os:return $e.data.append(Yt,Xe),$e.data.ref;case fs:return $e.data.toString();case no:return $e.data.map(function(on){return Yt.invoke(Xe,on)})}},Yt.attribCache={};var Ve={};return Yt.scopeAttrib=function(Xe){var $e=kr.id(Xe);if($e in Ve)return Ve[$e];var Cr=Ui.scope[$e];Cr||(Cr=Ui.scope[$e]=new Nn);var on=Ve[$e]=ce(Cr);return on},Yt}function ho(Yt){var ce=Yt.static,Se=Yt.dynamic,nr;if(Zf in ce){var Ye=!!ce[Zf];nr=Ha(function(lr,hr){return Ye}),nr.enable=Ye}else if(Zf in Se){var tr=Se[Zf];nr=ro(tr,function(lr,hr){return lr.invoke(hr,tr)})}return nr}function So(Yt,ce){var Se=Yt.static,nr=Yt.dynamic;if(qt in Se){var Ye=Se[qt];return Ye?(Ye=ni.getFramebuffer(Ye),Ha(function(lr,hr){var Ve=lr.link(Ye),Xe=lr.shared;hr.set(Xe.framebuffer,".next",Ve);var $e=Xe.context;return hr.set($e,"."+Dr,Ve+".width"),hr.set($e,"."+ln,Ve+".height"),Ve})):Ha(function(lr,hr){var Ve=lr.shared;hr.set(Ve.framebuffer,".next","null");var Xe=Ve.context;return hr.set(Xe,"."+Dr,Xe+"."+xe),hr.set(Xe,"."+ln,Xe+"."+Ae),"null"})}else if(qt in nr){var tr=nr[qt];return ro(tr,function(lr,hr){var Ve=lr.invoke(hr,tr),Xe=lr.shared,$e=Xe.framebuffer,Cr=hr.def($e,".getFramebuffer(",Ve,")");hr.set($e,".next",Cr);var on=Xe.context;return hr.set(on,"."+Dr,Cr+"?"+Cr+".width:"+on+"."+xe),hr.set(on,"."+ln,Cr+"?"+Cr+".height:"+on+"."+Ae),Cr})}else return null}function ts(Yt,ce,Se){var nr=Yt.static,Ye=Yt.dynamic;function tr(Ve){if(Ve in nr){var Xe=nr[Ve],$e=!0,Cr=Xe.x|0,on=Xe.y|0,fn,fi;return"width"in Xe?fn=Xe.width|0:$e=!1,"height"in Xe?fi=Xe.height|0:$e=!1,new Yn(!$e&&ce&&ce.thisDep,!$e&&ce&&ce.contextDep,!$e&&ce&&ce.propDep,function(Mi,di){var Ki=Mi.shared.context,Ai=fn;"width"in Xe||(Ai=di.def(Ki,".",Dr,"-",Cr));var Si=fi;return"height"in Xe||(Si=di.def(Ki,".",ln,"-",on)),[Cr,on,Ai,Si]})}else if(Ve in Ye){var si=Ye[Ve],Gn=ro(si,function(Mi,di){var Ki=Mi.invoke(di,si),Ai=Mi.shared.context,Si=di.def(Ki,".x|0"),sa=di.def(Ki,".y|0"),Qa=di.def('"width" in ',Ki,"?",Ki,".width|0:","(",Ai,".",Dr,"-",Si,")"),so=di.def('"height" in ',Ki,"?",Ki,".height|0:","(",Ai,".",ln,"-",sa,")");return[Si,sa,Qa,so]});return ce&&(Gn.thisDep=Gn.thisDep||ce.thisDep,Gn.contextDep=Gn.contextDep||ce.contextDep,Gn.propDep=Gn.propDep||ce.propDep),Gn}else return ce?new Yn(ce.thisDep,ce.contextDep,ce.propDep,function(Mi,di){var Ki=Mi.shared.context;return[0,0,di.def(Ki,".",Dr),di.def(Ki,".",ln)]}):null}var lr=tr(Zu);if(lr){var hr=lr;lr=new Yn(lr.thisDep,lr.contextDep,lr.propDep,function(Ve,Xe){var $e=hr.append(Ve,Xe),Cr=Ve.shared.context;return Xe.set(Cr,"."+Sn,$e[2]),Xe.set(Cr,"."+Xt,$e[3]),$e})}return{viewport:lr,scissor_box:tr(qc)}}function Nl(Yt,ce){var Se=Yt.static,nr=typeof Se[ht]=="string"&&typeof Se[I]=="string";if(nr){if(Object.keys(ce.dynamic).length>0)return null;var Ye=ce.static,tr=Object.keys(Ye);if(tr.length>0&&typeof Ye[tr[0]]=="number"){for(var lr=[],hr=0;hr<tr.length;++hr)lr.push([Ye[tr[hr]]|0,tr[hr]]);return lr}}return null}function Al(Yt,ce,Se){var nr=Yt.static,Ye=Yt.dynamic;function tr($e){if($e in nr){var Cr=kr.id(nr[$e]),on=Ha(function(){return Cr});return on.id=Cr,on}else if($e in Ye){var fn=Ye[$e];return ro(fn,function(fi,si){var Gn=fi.invoke(si,fn),Mi=si.def(fi.shared.strings,".id(",Gn,")");return Mi})}return null}var lr=tr(ht),hr=tr(I),Ve=null,Xe;return ja(lr)&&ja(hr)?(Ve=va.program(hr.id,lr.id,null,Se),Xe=Ha(function($e,Cr){return $e.link(Ve)})):Xe=new Yn(lr&&lr.thisDep||hr&&hr.thisDep,lr&&lr.contextDep||hr&&hr.contextDep,lr&&lr.propDep||hr&&hr.propDep,function($e,Cr){var on=$e.shared.shader,fn;lr?fn=lr.append($e,Cr):fn=Cr.def(on,".",ht);var fi;hr?fi=hr.append($e,Cr):fi=Cr.def(on,".",I);var si=on+".program("+fi+","+fn;return Cr.def(si+")")}),{frag:lr,vert:hr,progVar:Xe,program:Ve}}function us(Yt,ce){var Se=Yt.static,nr=Yt.dynamic,Ye={},tr=!1;function lr(){if(Ke in Se){var di=Se[Ke];return di!==null&&Ui.getVAO(di)===null&&(di=Ui.createVAO(di)),tr=!0,Ye.vao=di,Ha(function(Ai){var Si=Ui.getVAO(di);return Si?Ai.link(Si):"null"})}else if(Ke in nr){tr=!0;var Ki=nr[Ke];return ro(Ki,function(Ai,Si){var sa=Ai.invoke(Si,Ki);return Si.def(Ai.shared.vao+".getVAO("+sa+")")})}return null}var hr=lr(),Ve=!1;function Xe(){if(Et in Se){var di=Se[Et];if(Ye.elements=di,Ii(di)){var Ki=Ye.elements=Jn.create(di,!0);di=Jn.getElements(Ki),Ve=!0}else di&&(di=Jn.getElements(di),Ve=!0);var Ai=Ha(function(sa,Qa){if(di){var so=sa.link(di);return sa.ELEMENTS=so,so}return sa.ELEMENTS=null,null});return Ai.value=di,Ai}else if(Et in nr){Ve=!0;var Si=nr[Et];return ro(Si,function(sa,Qa){var so=sa.shared,Vo=so.isBufferArgs,vs=so.elements,zl=sa.invoke(Qa,Si),jl=Qa.def("null"),dl=Qa.def(Vo,"(",zl,")"),Ul=sa.cond(dl).then(jl,"=",vs,".createStream(",zl,");").else(jl,"=",vs,".getElements(",zl,");");return Qa.entry(Ul),Qa.exit(sa.cond(dl).then(vs,".destroyStream(",jl,");")),sa.ELEMENTS=jl,jl})}else if(tr)return new Yn(hr.thisDep,hr.contextDep,hr.propDep,function(sa,Qa){return Qa.def(sa.shared.vao+".currentVAO?"+sa.shared.elements+".getElements("+sa.shared.vao+".currentVAO.elements):null")});return null}var $e=Xe();function Cr(){if(It in Se){var di=Se[It];return Ye.primitive=di,Ha(function(Ai,Si){return ui[di]})}else if(It in nr){var Ki=nr[It];return ro(Ki,function(Ai,Si){var sa=Ai.constants.primTypes,Qa=Ai.invoke(Si,Ki);return Si.def(sa,"[",Qa,"]")})}else{if(Ve)return ja($e)?$e.value?Ha(function(Ai,Si){return Si.def(Ai.ELEMENTS,".primType")}):Ha(function(){return Zc}):new Yn($e.thisDep,$e.contextDep,$e.propDep,function(Ai,Si){var sa=Ai.ELEMENTS;return Si.def(sa,"?",sa,".primType:",Zc)});if(tr)return new Yn(hr.thisDep,hr.contextDep,hr.propDep,function(Ai,Si){return Si.def(Ai.shared.vao+".currentVAO?"+Ai.shared.vao+".currentVAO.primitive:"+Zc)})}return null}function on(di,Ki){if(di in Se){var Ai=Se[di]|0;return Ki?Ye.offset=Ai:Ye.instances=Ai,Ha(function(sa,Qa){return Ki&&(sa.OFFSET=Ai),Ai})}else if(di in nr){var Si=nr[di];return ro(Si,function(sa,Qa){var so=sa.invoke(Qa,Si);return Ki&&(sa.OFFSET=so),so})}else if(Ki){if(Ve)return Ha(function(sa,Qa){return sa.OFFSET=0,0});if(tr)return new Yn(hr.thisDep,hr.contextDep,hr.propDep,function(sa,Qa){return Qa.def(sa.shared.vao+".currentVAO?"+sa.shared.vao+".currentVAO.offset:0")})}else if(tr)return new Yn(hr.thisDep,hr.contextDep,hr.propDep,function(sa,Qa){return Qa.def(sa.shared.vao+".currentVAO?"+sa.shared.vao+".currentVAO.instances:-1")});return null}var fn=on(ke,!0);function fi(){if(Vt in Se){var di=Se[Vt]|0;return Ye.count=di,Ha(function(){return di})}else if(Vt in nr){var Ki=nr[Vt];return ro(Ki,function(Qa,so){var Vo=Qa.invoke(so,Ki);return Vo})}else if(Ve)if(ja($e)){if($e)return fn?new Yn(fn.thisDep,fn.contextDep,fn.propDep,function(Qa,so){var Vo=so.def(Qa.ELEMENTS,".vertCount-",Qa.OFFSET);return Vo}):Ha(function(Qa,so){return so.def(Qa.ELEMENTS,".vertCount")});var Ai=Ha(function(){return-1});return Ai}else{var Si=new Yn($e.thisDep||fn.thisDep,$e.contextDep||fn.contextDep,$e.propDep||fn.propDep,function(Qa,so){var Vo=Qa.ELEMENTS;return Qa.OFFSET?so.def(Vo,"?",Vo,".vertCount-",Qa.OFFSET,":-1"):so.def(Vo,"?",Vo,".vertCount:-1")});return Si}else if(tr){var sa=new Yn(hr.thisDep,hr.contextDep,hr.propDep,function(Qa,so){return so.def(Qa.shared.vao,".currentVAO?",Qa.shared.vao,".currentVAO.count:-1")});return sa}return null}var si=Cr(),Gn=fi(),Mi=on(Oe,!1);return{elements:$e,primitive:si,count:Gn,instances:Mi,offset:fn,vao:hr,vaoActive:tr,elementsActive:Ve,static:Ye}}function wu(Yt,ce){var Se=Yt.static,nr=Yt.dynamic,Ye={};return vi.forEach(function(tr){var lr=pa(tr);function hr(Ve,Xe){if(tr in Se){var $e=Ve(Se[tr]);Ye[lr]=Ha(function(){return $e})}else if(tr in nr){var Cr=nr[tr];Ye[lr]=ro(Cr,function(on,fn){return Xe(on,fn,on.invoke(fn,Cr))})}}switch(tr){case uu:case ds:case qa:case Wc:case Hl:case zs:case Fl:case Hc:case Pc:case qu:return hr(function(Ve){return Ve},function(Ve,Xe,$e){return $e});case au:return hr(function(Ve){return Un[Ve]},function(Ve,Xe,$e){var Cr=Ve.constants.compareFuncs;return Xe.def(Cr,"[",$e,"]")});case ml:return hr(function(Ve){return Ve},function(Ve,Xe,$e){var Cr=Xe.def("+",$e,"[0]"),on=Xe.def("+",$e,"[1]");return[Cr,on]});case iu:return hr(function(Ve){var Xe="srcRGB"in Ve?Ve.srcRGB:Ve.src,$e="srcAlpha"in Ve?Ve.srcAlpha:Ve.src,Cr="dstRGB"in Ve?Ve.dstRGB:Ve.dst,on="dstAlpha"in Ve?Ve.dstAlpha:Ve.dst;return[Bi[Xe],Bi[Cr],Bi[$e],Bi[on]]},function(Ve,Xe,$e){var Cr=Ve.constants.blendFuncs;function on(Ki,Ai){var Si=Xe.def('"',Ki,Ai,'" in ',$e,"?",$e,".",Ki,Ai,":",$e,".",Ki);return Si}var fn=on("src","RGB"),fi=on("dst","RGB"),si=Xe.def(Cr,"[",fn,"]"),Gn=Xe.def(Cr,"[",on("src","Alpha"),"]"),Mi=Xe.def(Cr,"[",fi,"]"),di=Xe.def(Cr,"[",on("dst","Alpha"),"]");return[si,Mi,Gn,di]});case Pl:return hr(function(Ve){if(typeof Ve=="string")return[Oi[Ve],Oi[Ve]];if(typeof Ve=="object")return[Oi[Ve.rgb],Oi[Ve.alpha]]},function(Ve,Xe,$e){var Cr=Ve.constants.blendEquations,on=Xe.def(),fn=Xe.def(),fi=Ve.cond("typeof ",$e,'==="string"');return fi.then(on,"=",fn,"=",Cr,"[",$e,"];"),fi.else(on,"=",Cr,"[",$e,".rgb];",fn,"=",Cr,"[",$e,".alpha];"),Xe(fi),[on,fn]});case tl:return hr(function(Ve){return h(4,function(Xe){return+Ve[Xe]})},function(Ve,Xe,$e){return h(4,function(Cr){return Xe.def("+",$e,"[",Cr,"]")})});case zh:return hr(function(Ve){return Ve|0},function(Ve,Xe,$e){return Xe.def($e,"|0")});case Iu:return hr(function(Ve){var Xe=Ve.cmp||"keep",$e=Ve.ref||0,Cr="mask"in Ve?Ve.mask:-1;return[Un[Xe],$e,Cr]},function(Ve,Xe,$e){var Cr=Ve.constants.compareFuncs,on=Xe.def('"cmp" in ',$e,"?",Cr,"[",$e,".cmp]",":",ir),fn=Xe.def($e,".ref|0"),fi=Xe.def('"mask" in ',$e,"?",$e,".mask|0:-1");return[on,fn,fi]});case Ih:case es:return hr(function(Ve){var Xe=Ve.fail||"keep",$e=Ve.zfail||"keep",Cr=Ve.zpass||"keep";return[tr===es?jt:At,mi[Xe],mi[$e],mi[Cr]]},function(Ve,Xe,$e){var Cr=Ve.constants.stencilOps;function on(fn){return Xe.def('"',fn,'" in ',$e,"?",Cr,"[",$e,".",fn,"]:",ir)}return[tr===es?jt:At,on("fail"),on("zfail"),on("zpass")]});case vc:return hr(function(Ve){var Xe=Ve.factor|0,$e=Ve.units|0;return[Xe,$e]},function(Ve,Xe,$e){var Cr=Xe.def($e,".factor|0"),on=Xe.def($e,".units|0");return[Cr,on]});case zo:return hr(function(Ve){var Xe=0;return Ve==="front"?Xe=At:Ve==="back"&&(Xe=jt),Xe},function(Ve,Xe,$e){return Xe.def($e,'==="front"?',At,":",jt)});case $l:return hr(function(Ve){return Ve},function(Ve,Xe,$e){return $e});case Ms:return hr(function(Ve){return Ti[Ve]},function(Ve,Xe,$e){return Xe.def($e+'==="cw"?'+ue+":"+Me)});case Lu:return hr(function(Ve){return Ve.map(function(Xe){return!!Xe})},function(Ve,Xe,$e){return h(4,function(Cr){return"!!"+$e+"["+Cr+"]"})});case Ph:return hr(function(Ve){var Xe="value"in Ve?Ve.value:1,$e=!!Ve.invert;return[Xe,$e]},function(Ve,Xe,$e){var Cr=Xe.def('"value" in ',$e,"?+",$e,".value:1"),on=Xe.def("!!",$e,".invert");return[Cr,on]})}}),Ye}function fl(Yt,ce){var Se=Yt.static,nr=Yt.dynamic,Ye={};return Object.keys(Se).forEach(function(tr){var lr=Se[tr],hr;if(typeof lr=="number"||typeof lr=="boolean")hr=Ha(function(){return lr});else if(typeof lr=="function"){var Ve=lr._reglType;Ve==="texture2d"||Ve==="textureCube"?hr=Ha(function(Xe){return Xe.link(lr)}):(Ve==="framebuffer"||Ve==="framebufferCube")&&(hr=Ha(function(Xe){return Xe.link(lr.color[0])}))}else Pn(lr)&&(hr=Ha(function(Xe){var $e=Xe.global.def("[",h(lr.length,function(Cr){return lr[Cr]}),"]");return $e}));hr.value=lr,Ye[tr]=hr}),Object.keys(nr).forEach(function(tr){var lr=nr[tr];Ye[tr]=ro(lr,function(hr,Ve){return hr.invoke(Ve,lr)})}),Ye}function Eu(Yt,ce){var Se=Yt.static,nr=Yt.dynamic,Ye={};return Object.keys(Se).forEach(function(tr){var lr=Se[tr],hr=kr.id(tr),Ve=new Nn;if(Ii(lr))Ve.state=za,Ve.buffer=oi.getBuffer(oi.create(lr,Ie,!1,!0)),Ve.type=0;else{var Xe=oi.getBuffer(lr);if(Xe)Ve.state=za,Ve.buffer=Xe,Ve.type=0;else if("constant"in lr){var $e=lr.constant;Ve.buffer="null",Ve.state=wa,typeof $e=="number"?Ve.x=$e:$a.forEach(function(Mi,di){di<$e.length&&(Ve[Mi]=$e[di])})}else{Ii(lr.buffer)?Xe=oi.getBuffer(oi.create(lr.buffer,Ie,!1,!0)):Xe=oi.getBuffer(lr.buffer);var Cr=lr.offset|0,on=lr.stride|0,fn=lr.size|0,fi=!!lr.normalized,si=0;"type"in lr&&(si=Vn[lr.type]);var Gn=lr.divisor|0;Ve.buffer=Xe,Ve.state=za,Ve.size=fn,Ve.normalized=fi,Ve.type=si||Xe.dtype,Ve.offset=Cr,Ve.stride=on,Ve.divisor=Gn}}Ye[tr]=Ha(function(Mi,di){var Ki=Mi.attribCache;if(hr in Ki)return Ki[hr];var Ai={isStream:!1};return Object.keys(Ve).forEach(function(Si){Ai[Si]=Ve[Si]}),Ve.buffer&&(Ai.buffer=Mi.link(Ve.buffer),Ai.type=Ai.type||Ai.buffer+".dtype"),Ki[hr]=Ai,Ai})}),Object.keys(nr).forEach(function(tr){var lr=nr[tr];function hr(Ve,Xe){var $e=Ve.invoke(Xe,lr),Cr=Ve.shared,on=Ve.constants,fn=Cr.isBufferArgs,fi=Cr.buffer,si={isStream:Xe.def(!1)},Gn=new Nn;Gn.state=za,Object.keys(Gn).forEach(function(Ai){si[Ai]=Xe.def(""+Gn[Ai])});var Mi=si.buffer,di=si.type;Xe("if(",fn,"(",$e,")){",si.isStream,"=true;",Mi,"=",fi,".createStream(",Ie,",",$e,");",di,"=",Mi,".dtype;","}else{",Mi,"=",fi,".getBuffer(",$e,");","if(",Mi,"){",di,"=",Mi,".dtype;",'}else if("constant" in ',$e,"){",si.state,"=",wa,";","if(typeof "+$e+'.constant === "number"){',si[$a[0]],"=",$e,".constant;",$a.slice(1).map(function(Ai){return si[Ai]}).join("="),"=0;","}else{",$a.map(function(Ai,Si){return si[Ai]+"="+$e+".constant.length>"+Si+"?"+$e+".constant["+Si+"]:0;"}).join(""),"}}else{","if(",fn,"(",$e,".buffer)){",Mi,"=",fi,".createStream(",Ie,",",$e,".buffer);","}else{",Mi,"=",fi,".getBuffer(",$e,".buffer);","}",di,'="type" in ',$e,"?",on.glTypes,"[",$e,".type]:",Mi,".dtype;",si.normalized,"=!!",$e,".normalized;");function Ki(Ai){Xe(si[Ai],"=",$e,".",Ai,"|0;")}return Ki("size"),Ki("offset"),Ki("stride"),Ki("divisor"),Xe("}}"),Xe.exit("if(",si.isStream,"){",fi,".destroyStream(",Mi,");","}"),si}Ye[tr]=ro(lr,hr)}),Ye}function pc(Yt){var ce=Yt.static,Se=Yt.dynamic,nr={};return Object.keys(ce).forEach(function(Ye){var tr=ce[Ye];nr[Ye]=Ha(function(lr,hr){return typeof tr=="number"||typeof tr=="boolean"?""+tr:lr.link(tr)})}),Object.keys(Se).forEach(function(Ye){var tr=Se[Ye];nr[Ye]=ro(tr,function(lr,hr){return lr.invoke(hr,tr)})}),nr}function yc(Yt,ce,Se,nr,Ye){Yt.static,Yt.dynamic;var tr=Nl(Yt,ce),lr=So(Yt),hr=ts(Yt,lr),Ve=us(Yt),Xe=wu(Yt),$e=Al(Yt,Ye,tr);function Cr(Mi){var di=hr[Mi];di&&(Xe[Mi]=di)}Cr(Zu),Cr(pa(qc));var on=Object.keys(Xe).length>0,fn={framebuffer:lr,draw:Ve,shader:$e,state:Xe,dirty:on,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(fn.profile=ho(Yt),fn.uniforms=fl(Se),fn.drawVAO=fn.scopeVAO=Ve.vao,!fn.drawVAO&&$e.program&&!tr&&Lr.angle_instanced_arrays&&Ve.static.elements){var fi=!0,si=$e.program.attributes.map(function(Mi){var di=ce.static[Mi];return fi=fi&&!!di,di});if(fi&&si.length>0){var Gn=Ui.getVAO(Ui.createVAO({attributes:si,elements:Ve.static.elements}));fn.drawVAO=new Yn(null,null,null,function(Mi,di){return Mi.link(Gn)}),fn.useVAO=!0}}return tr?fn.useVAO=!0:fn.attributes=Eu(ce),fn.context=pc(nr),fn}function yu(Yt,ce,Se){var nr=Yt.shared,Ye=nr.context,tr=Yt.scope();Object.keys(Se).forEach(function(lr){ce.save(Ye,"."+lr);var hr=Se[lr],Ve=hr.append(Yt,ce);Array.isArray(Ve)?tr(Ye,".",lr,"=[",Ve.join(),"];"):tr(Ye,".",lr,"=",Ve,";")}),ce(tr)}function hu(Yt,ce,Se,nr){var Ye=Yt.shared,tr=Ye.gl,lr=Ye.framebuffer,hr;Qn&&(hr=ce.def(Ye.extensions,".webgl_draw_buffers"));var Ve=Yt.constants,Xe=Ve.drawBuffer,$e=Ve.backBuffer,Cr;Se?Cr=Se.append(Yt,ce):Cr=ce.def(lr,".next"),nr||ce("if(",Cr,"!==",lr,".cur){"),ce("if(",Cr,"){",tr,".bindFramebuffer(",In,",",Cr,".framebuffer);"),Qn&&ce(hr,".drawBuffersWEBGL(",Xe,"[",Cr,".colorAttachments.length]);"),ce("}else{",tr,".bindFramebuffer(",In,",null);"),Qn&&ce(hr,".drawBuffersWEBGL(",$e,");"),ce("}",lr,".cur=",Cr,";"),nr||ce("}")}function ku(Yt,ce,Se){var nr=Yt.shared,Ye=nr.gl,tr=Yt.current,lr=Yt.next,hr=nr.current,Ve=nr.next,Xe=Yt.cond(hr,".dirty");vi.forEach(function($e){var Cr=pa($e);if(!(Cr in Se.state)){var on,fn;if(Cr in lr){on=lr[Cr],fn=tr[Cr];var fi=h(ca[Cr].length,function(Gn){return Xe.def(on,"[",Gn,"]")});Xe(Yt.cond(fi.map(function(Gn,Mi){return Gn+"!=="+fn+"["+Mi+"]"}).join("||")).then(Ye,".",Sa[Cr],"(",fi,");",fi.map(function(Gn,Mi){return fn+"["+Mi+"]="+Gn}).join(";"),";"))}else{on=Xe.def(Ve,".",Cr);var si=Yt.cond(on,"!==",hr,".",Cr);Xe(si),Cr in ti?si(Yt.cond(on).then(Ye,".enable(",ti[Cr],");").else(Ye,".disable(",ti[Cr],");"),hr,".",Cr,"=",on,";"):si(Ye,".",Sa[Cr],"(",on,");",hr,".",Cr,"=",on,";")}}}),Object.keys(Se.state).length===0&&Xe(hr,".dirty=false;"),ce(Xe)}function Bo(Yt,ce,Se,nr){var Ye=Yt.shared,tr=Yt.current,lr=Ye.current,hr=Ye.gl,Ve;Wi(Object.keys(Se)).forEach(function(Xe){var $e=Se[Xe];if(!(nr&&!nr($e))){var Cr=$e.append(Yt,ce);if(ti[Xe]){var on=ti[Xe];ja($e)?(Ve=Yt.link(Cr,{stable:!0}),ce(Yt.cond(Ve).then(hr,".enable(",on,");").else(hr,".disable(",on,");")),ce(lr,".",Xe,"=",Ve,";")):(ce(Yt.cond(Cr).then(hr,".enable(",on,");").else(hr,".disable(",on,");")),ce(lr,".",Xe,"=",Cr,";"))}else if(Pn(Cr)){var fn=tr[Xe];ce(hr,".",Sa[Xe],"(",Cr,");",Cr.map(function(fi,si){return fn+"["+si+"]="+fi}).join(";"),";")}else ja($e)?(Ve=Yt.link(Cr,{stable:!0}),ce(hr,".",Sa[Xe],"(",Ve,");",lr,".",Xe,"=",Ve,";")):ce(hr,".",Sa[Xe],"(",Cr,");",lr,".",Xe,"=",Cr,";")}})}function Tu(Yt,ce){_i&&(Yt.instancing=ce.def(Yt.shared.extensions,".angle_instanced_arrays"))}function ol(Yt,ce,Se,nr,Ye){var tr=Yt.shared,lr=Yt.stats,hr=tr.current,Ve=tr.timer,Xe=Se.profile;function $e(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Cr,on;function fn(Ki){Cr=ce.def(),Ki(Cr,"=",$e(),";"),typeof Ye=="string"?Ki(lr,".count+=",Ye,";"):Ki(lr,".count++;"),ta&&(nr?(on=ce.def(),Ki(on,"=",Ve,".getNumPendingQueries();")):Ki(Ve,".beginQuery(",lr,");"))}function fi(Ki){Ki(lr,".cpuTime+=",$e(),"-",Cr,";"),ta&&(nr?Ki(Ve,".pushScopeStats(",on,",",Ve,".getNumPendingQueries(),",lr,");"):Ki(Ve,".endQuery();"))}function si(Ki){var Ai=ce.def(hr,".profile");ce(hr,".profile=",Ki,";"),ce.exit(hr,".profile=",Ai,";")}var Gn;if(Xe){if(ja(Xe)){Xe.enable?(fn(ce),fi(ce.exit),si("true")):si("false");return}Gn=Xe.append(Yt,ce),si(Gn)}else Gn=ce.def(hr,".profile");var Mi=Yt.block();fn(Mi),ce("if(",Gn,"){",Mi,"}");var di=Yt.block();fi(di),ce.exit("if(",Gn,"){",di,"}")}function Cu(Yt,ce,Se,nr,Ye){var tr=Yt.shared;function lr(Ve){switch(Ve){case ha:case Mo:case Os:return 2;case ka:case hs:case bl:return 3;case io:case hl:case Su:return 4;default:return 1}}function hr(Ve,Xe,$e){var Cr=tr.gl,on=ce.def(Ve,".location"),fn=ce.def(tr.attributes,"[",on,"]"),fi=$e.state,si=$e.buffer,Gn=[$e.x,$e.y,$e.z,$e.w],Mi=["buffer","normalized","offset","stride"];function di(){ce("if(!",fn,".buffer){",Cr,".enableVertexAttribArray(",on,");}");var Ai=$e.type,Si;if($e.size?Si=ce.def($e.size,"||",Xe):Si=Xe,ce("if(",fn,".type!==",Ai,"||",fn,".size!==",Si,"||",Mi.map(function(Qa){return fn+"."+Qa+"!=="+$e[Qa]}).join("||"),"){",Cr,".bindBuffer(",Ie,",",si,".buffer);",Cr,".vertexAttribPointer(",[on,Si,Ai,$e.normalized,$e.stride,$e.offset],");",fn,".type=",Ai,";",fn,".size=",Si,";",Mi.map(function(Qa){return fn+"."+Qa+"="+$e[Qa]+";"}).join(""),"}"),_i){var sa=$e.divisor;ce("if(",fn,".divisor!==",sa,"){",Yt.instancing,".vertexAttribDivisorANGLE(",[on,sa],");",fn,".divisor=",sa,";}")}}function Ki(){ce("if(",fn,".buffer){",Cr,".disableVertexAttribArray(",on,");",fn,".buffer=null;","}if(",$a.map(function(Ai,Si){return fn+"."+Ai+"!=="+Gn[Si]}).join("||"),"){",Cr,".vertexAttrib4f(",on,",",Gn,");",$a.map(function(Ai,Si){return fn+"."+Ai+"="+Gn[Si]+";"}).join(""),"}")}fi===za?di():fi===wa?Ki():(ce("if(",fi,"===",za,"){"),di(),ce("}else{"),Ki(),ce("}"))}nr.forEach(function(Ve){var Xe=Ve.name,$e=Se.attributes[Xe],Cr;if($e){if(!Ye($e))return;Cr=$e.append(Yt,ce)}else{if(!Ye(Lo))return;var on=Yt.scopeAttrib(Xe);Cr={},Object.keys(new Nn).forEach(function(fn){Cr[fn]=ce.def(on,".",fn)})}hr(Yt.link(Ve),lr(Ve.info.type),Cr)})}function xc(Yt,ce,Se,nr,Ye,tr){for(var lr=Yt.shared,hr=lr.gl,Ve,Xe=0;Xe<nr.length;++Xe){var $e=nr[Xe],Cr=$e.name,on=$e.info.type,fn=Se.uniforms[Cr],fi=Yt.link($e),si=fi+".location",Gn;if(fn){if(!Ye(fn))continue;if(ja(fn)){var Mi=fn.value;if(on===Yu||on===dc){var di=Yt.link(Mi._texture||Mi.color[0]._texture);ce(hr,".uniform1i(",si,",",di+".bind());"),ce.exit(di,".unbind();")}else if(on===mu||on===Ws||on===qs){var Ki=Yt.global.def("new Float32Array(["+Array.prototype.slice.call(Mi)+"])"),Ai=2;on===Ws?Ai=3:on===qs&&(Ai=4),ce(hr,".uniformMatrix",Ai,"fv(",si,",false,",Ki,");")}else{switch(on){case da:Ve="1f";break;case ha:Ve="2f";break;case ka:Ve="3f";break;case io:Ve="4f";break;case vl:Ve="1i";break;case Ro:Ve="1i";break;case Os:Ve="2i";break;case Mo:Ve="2i";break;case bl:Ve="3i";break;case hs:Ve="3i";break;case Su:Ve="4i";break;case hl:Ve="4i";break}ce(hr,".uniform",Ve,"(",si,",",Pn(Mi)?Array.prototype.slice.call(Mi):Mi,");")}continue}else Gn=fn.append(Yt,ce)}else{if(!Ye(Lo))continue;Gn=ce.def(lr.uniforms,"[",kr.id(Cr),"]")}on===Yu?ce("if(",Gn,"&&",Gn,'._reglType==="framebuffer"){',Gn,"=",Gn,".color[0];","}"):on===dc&&ce("if(",Gn,"&&",Gn,'._reglType==="framebufferCube"){',Gn,"=",Gn,".color[0];","}");var Si=1;switch(on){case Yu:case dc:var sa=ce.def(Gn,"._texture");ce(hr,".uniform1i(",si,",",sa,".bind());"),ce.exit(sa,".unbind();");continue;case Ro:case vl:Ve="1i";break;case Mo:case Os:Ve="2i",Si=2;break;case hs:case bl:Ve="3i",Si=3;break;case hl:case Su:Ve="4i",Si=4;break;case da:Ve="1f";break;case ha:Ve="2f",Si=2;break;case ka:Ve="3f",Si=3;break;case io:Ve="4f",Si=4;break;case mu:Ve="Matrix2fv";break;case Ws:Ve="Matrix3fv";break;case qs:Ve="Matrix4fv";break}if(Ve.charAt(0)==="M"){ce(hr,".uniform",Ve,"(",si,",");var Qa=Math.pow(on-mu+2,2),so=Yt.global.def("new Float32Array(",Qa,")");Array.isArray(Gn)?ce("false,(",h(Qa,function(dl){return so+"["+dl+"]="+Gn[dl]}),",",so,")"):ce("false,(Array.isArray(",Gn,")||",Gn," instanceof Float32Array)?",Gn,":(",h(Qa,function(dl){return so+"["+dl+"]="+Gn+"["+dl+"]"}),",",so,")"),ce(");")}else if(Si>1){for(var Vo=[],vs=[],zl=0;zl<Si;++zl)Array.isArray(Gn)?vs.push(Gn[zl]):vs.push(ce.def(Gn+"["+zl+"]")),tr&&Vo.push(ce.def());tr&&ce("if(!",Yt.batchId,"||",Vo.map(function(dl,Ul){return dl+"!=="+vs[Ul]}).join("||"),"){",Vo.map(function(dl,Ul){return dl+"="+vs[Ul]+";"}).join("")),ce(hr,".uniform",Ve,"(",si,",",vs.join(","),");"),tr&&ce("}")}else{if(tr){var jl=ce.def();ce("if(!",Yt.batchId,"||",jl,"!==",Gn,"){",jl,"=",Gn,";")}ce(hr,".uniform",Ve,"(",si,",",Gn,");"),tr&&ce("}")}}}function Eo(Yt,ce,Se,nr){var Ye=Yt.shared,tr=Ye.gl,lr=Ye.draw,hr=nr.draw;function Ve(){var Si=hr.elements,sa,Qa=ce;return Si?((Si.contextDep&&nr.contextDynamic||Si.propDep)&&(Qa=Se),sa=Si.append(Yt,Qa),hr.elementsActive&&Qa("if("+sa+")"+tr+".bindBuffer("+Ze+","+sa+".buffer.buffer);")):(sa=Qa.def(),Qa(sa,"=",lr,".",Et,";","if(",sa,"){",tr,".bindBuffer(",Ze,",",sa,".buffer.buffer);}","else if(",Ye.vao,".currentVAO){",sa,"=",Yt.shared.elements+".getElements("+Ye.vao,".currentVAO.elements);",Ma?"":"if("+sa+")"+tr+".bindBuffer("+Ze+","+sa+".buffer.buffer);","}")),sa}function Xe(){var Si=hr.count,sa,Qa=ce;return Si?((Si.contextDep&&nr.contextDynamic||Si.propDep)&&(Qa=Se),sa=Si.append(Yt,Qa)):sa=Qa.def(lr,".",Vt),sa}var $e=Ve();function Cr(Si){var sa=hr[Si];return sa?sa.contextDep&&nr.contextDynamic||sa.propDep?sa.append(Yt,Se):sa.append(Yt,ce):ce.def(lr,".",Si)}var on=Cr(It),fn=Cr(ke),fi=Xe();if(typeof fi=="number"){if(fi===0)return}else Se("if(",fi,"){"),Se.exit("}");var si,Gn;_i&&(si=Cr(Oe),Gn=Yt.instancing);var Mi=$e+".type",di=hr.elements&&ja(hr.elements)&&!hr.vaoActive;function Ki(){function Si(){Se(Gn,".drawElementsInstancedANGLE(",[on,fi,Mi,fn+"<<(("+Mi+"-"+ua+")>>1)",si],");")}function sa(){Se(Gn,".drawArraysInstancedANGLE(",[on,fn,fi,si],");")}$e&&$e!=="null"?di?Si():(Se("if(",$e,"){"),Si(),Se("}else{"),sa(),Se("}")):sa()}function Ai(){function Si(){Se(tr+".drawElements("+[on,fi,Mi,fn+"<<(("+Mi+"-"+ua+")>>1)"]+");")}function sa(){Se(tr+".drawArrays("+[on,fn,fi]+");")}$e&&$e!=="null"?di?Si():(Se("if(",$e,"){"),Si(),Se("}else{"),sa(),Se("}")):sa()}_i&&(typeof si!="number"||si>=0)?typeof si=="string"?(Se("if(",si,">0){"),Ki(),Se("}else if(",si,"<0){"),Ai(),Se("}")):Ki():Ai()}function Ss(Yt,ce,Se,nr,Ye){var tr=Oa(),lr=tr.proc("body",Ye);return _i&&(tr.instancing=lr.def(tr.shared.extensions,".angle_instanced_arrays")),Yt(tr,lr,Se,nr),tr.compile().body}function Ml(Yt,ce,Se,nr){Tu(Yt,ce),Se.useVAO?Se.drawVAO?ce(Yt.shared.vao,".setVAO(",Se.drawVAO.append(Yt,ce),");"):ce(Yt.shared.vao,".setVAO(",Yt.shared.vao,".targetVAO);"):(ce(Yt.shared.vao,".setVAO(null);"),Cu(Yt,ce,Se,nr.attributes,function(){return!0})),xc(Yt,ce,Se,nr.uniforms,function(){return!0},!1),Eo(Yt,ce,ce,Se)}function yl(Yt,ce){var Se=Yt.proc("draw",1);Tu(Yt,Se),yu(Yt,Se,ce.context),hu(Yt,Se,ce.framebuffer),ku(Yt,Se,ce),Bo(Yt,Se,ce.state),ol(Yt,Se,ce,!1,!0);var nr=ce.shader.progVar.append(Yt,Se);if(Se(Yt.shared.gl,".useProgram(",nr,".program);"),ce.shader.program)Ml(Yt,Se,ce,ce.shader.program);else{Se(Yt.shared.vao,".setVAO(null);");var Ye=Yt.global.def("{}"),tr=Se.def(nr,".id"),lr=Se.def(Ye,"[",tr,"]");Se(Yt.cond(lr).then(lr,".call(this,a0);").else(lr,"=",Ye,"[",tr,"]=",Yt.link(function(hr){return Ss(Ml,Yt,ce,hr,1)}),"(",nr,");",lr,".call(this,a0);"))}Object.keys(ce.state).length>0&&Se(Yt.shared.current,".dirty=true;"),Yt.shared.vao&&Se(Yt.shared.vao,".setVAO(null);")}function Z(Yt,ce,Se,nr){Yt.batchId="a1",Tu(Yt,ce);function Ye(){return!0}Cu(Yt,ce,Se,nr.attributes,Ye),xc(Yt,ce,Se,nr.uniforms,Ye,!1),Eo(Yt,ce,ce,Se)}function ot(Yt,ce,Se,nr){Tu(Yt,ce);var Ye=Se.contextDep,tr=ce.def(),lr="a0",hr="a1",Ve=ce.def();Yt.shared.props=Ve,Yt.batchId=tr;var Xe=Yt.scope(),$e=Yt.scope();ce(Xe.entry,"for(",tr,"=0;",tr,"<",hr,";++",tr,"){",Ve,"=",lr,"[",tr,"];",$e,"}",Xe.exit);function Cr(Mi){return Mi.contextDep&&Ye||Mi.propDep}function on(Mi){return!Cr(Mi)}if(Se.needsContext&&yu(Yt,$e,Se.context),Se.needsFramebuffer&&hu(Yt,$e,Se.framebuffer),Bo(Yt,$e,Se.state,Cr),Se.profile&&Cr(Se.profile)&&ol(Yt,$e,Se,!1,!0),nr)Se.useVAO?Se.drawVAO?Cr(Se.drawVAO)?$e(Yt.shared.vao,".setVAO(",Se.drawVAO.append(Yt,$e),");"):Xe(Yt.shared.vao,".setVAO(",Se.drawVAO.append(Yt,Xe),");"):Xe(Yt.shared.vao,".setVAO(",Yt.shared.vao,".targetVAO);"):(Xe(Yt.shared.vao,".setVAO(null);"),Cu(Yt,Xe,Se,nr.attributes,on),Cu(Yt,$e,Se,nr.attributes,Cr)),xc(Yt,Xe,Se,nr.uniforms,on,!1),xc(Yt,$e,Se,nr.uniforms,Cr,!0),Eo(Yt,Xe,$e,Se);else{var fn=Yt.global.def("{}"),fi=Se.shader.progVar.append(Yt,$e),si=$e.def(fi,".id"),Gn=$e.def(fn,"[",si,"]");$e(Yt.shared.gl,".useProgram(",fi,".program);","if(!",Gn,"){",Gn,"=",fn,"[",si,"]=",Yt.link(function(Mi){return Ss(Z,Yt,Se,Mi,2)}),"(",fi,");}",Gn,".call(this,a0[",tr,"],",tr,");")}}function et(Yt,ce){var Se=Yt.proc("batch",2);Yt.batchId="0",Tu(Yt,Se);var nr=!1,Ye=!0;Object.keys(ce.context).forEach(function(fn){nr=nr||ce.context[fn].propDep}),nr||(yu(Yt,Se,ce.context),Ye=!1);var tr=ce.framebuffer,lr=!1;tr?(tr.propDep?nr=lr=!0:tr.contextDep&&nr&&(lr=!0),lr||hu(Yt,Se,tr)):hu(Yt,Se,null),ce.state.viewport&&ce.state.viewport.propDep&&(nr=!0);function hr(fn){return fn.contextDep&&nr||fn.propDep}ku(Yt,Se,ce),Bo(Yt,Se,ce.state,function(fn){return!hr(fn)}),(!ce.profile||!hr(ce.profile))&&ol(Yt,Se,ce,!1,"a1"),ce.contextDep=nr,ce.needsContext=Ye,ce.needsFramebuffer=lr;var Ve=ce.shader.progVar;if(Ve.contextDep&&nr||Ve.propDep)ot(Yt,Se,ce,null);else{var Xe=Ve.append(Yt,Se);if(Se(Yt.shared.gl,".useProgram(",Xe,".program);"),ce.shader.program)ot(Yt,Se,ce,ce.shader.program);else{Se(Yt.shared.vao,".setVAO(null);");var $e=Yt.global.def("{}"),Cr=Se.def(Xe,".id"),on=Se.def($e,"[",Cr,"]");Se(Yt.cond(on).then(on,".call(this,a0,a1);").else(on,"=",$e,"[",Cr,"]=",Yt.link(function(fn){return Ss(ot,Yt,ce,fn,2)}),"(",Xe,");",on,".call(this,a0,a1);"))}}Object.keys(ce.state).length>0&&Se(Yt.shared.current,".dirty=true;"),Yt.shared.vao&&Se(Yt.shared.vao,".setVAO(null);")}function xt(Yt,ce){var Se=Yt.proc("scope",3);Yt.batchId="a2";var nr=Yt.shared,Ye=nr.current;if(yu(Yt,Se,ce.context),ce.framebuffer&&ce.framebuffer.append(Yt,Se),Wi(Object.keys(ce.state)).forEach(function(hr){var Ve=ce.state[hr],Xe=Ve.append(Yt,Se);Pn(Xe)?Xe.forEach(function($e,Cr){_a($e)?Se.set(Yt.next[hr],"["+Cr+"]",$e):Se.set(Yt.next[hr],"["+Cr+"]",Yt.link($e,{stable:!0}))}):ja(Ve)?Se.set(nr.next,"."+hr,Yt.link(Xe,{stable:!0})):Se.set(nr.next,"."+hr,Xe)}),ol(Yt,Se,ce,!0,!0),[Et,ke,Vt,Oe,It].forEach(function(hr){var Ve=ce.draw[hr];if(Ve){var Xe=Ve.append(Yt,Se);_a(Xe)?Se.set(nr.draw,"."+hr,Xe):Se.set(nr.draw,"."+hr,Yt.link(Xe),{stable:!0})}}),Object.keys(ce.uniforms).forEach(function(hr){var Ve=ce.uniforms[hr].append(Yt,Se);Array.isArray(Ve)&&(Ve="["+Ve.map(function(Xe){return _a(Xe)?Xe:Yt.link(Xe,{stable:!0})})+"]"),Se.set(nr.uniforms,"["+Yt.link(kr.id(hr),{stable:!0})+"]",Ve)}),Object.keys(ce.attributes).forEach(function(hr){var Ve=ce.attributes[hr].append(Yt,Se),Xe=Yt.scopeAttrib(hr);Object.keys(new Nn).forEach(function($e){Se.set(Xe,"."+$e,Ve[$e])})}),ce.scopeVAO){var tr=ce.scopeVAO.append(Yt,Se);_a(tr)?Se.set(nr.vao,".targetVAO",tr):Se.set(nr.vao,".targetVAO",Yt.link(tr,{stable:!0}))}function lr(hr){var Ve=ce.shader[hr];if(Ve){var Xe=Ve.append(Yt,Se);_a(Xe)?Se.set(nr.shader,"."+hr,Xe):Se.set(nr.shader,"."+hr,Yt.link(Xe,{stable:!0}))}}lr(I),lr(ht),Object.keys(ce.state).length>0&&(Se(Ye,".dirty=true;"),Se.exit(Ye,".dirty=true;")),Se("a1(",Yt.shared.context,",a0,",Yt.batchId,");")}function Ut(Yt){if(!(typeof Yt!="object"||Pn(Yt))){for(var ce=Object.keys(Yt),Se=0;Se<ce.length;++Se)if(f.isDynamic(Yt[ce[Se]]))return!0;return!1}}function fe(Yt,ce,Se){var nr=ce.static[Se];if(!nr||!Ut(nr))return;var Ye=Yt.global,tr=Object.keys(nr),lr=!1,hr=!1,Ve=!1,Xe=Yt.global.def("{}");tr.forEach(function(Cr){var on=nr[Cr];if(f.isDynamic(on)){typeof on=="function"&&(on=nr[Cr]=f.unbox(on));var fn=ro(on,null);lr=lr||fn.thisDep,Ve=Ve||fn.propDep,hr=hr||fn.contextDep}else{switch(Ye(Xe,".",Cr,"="),typeof on){case"number":Ye(on);break;case"string":Ye('"',on,'"');break;case"object":Array.isArray(on)&&Ye("[",on.join(),"]");break;default:Ye(Yt.link(on));break}Ye(";")}});function $e(Cr,on){tr.forEach(function(fn){var fi=nr[fn];if(f.isDynamic(fi)){var si=Cr.invoke(on,fi);on(Xe,".",fn,"=",si,";")}})}ce.dynamic[Se]=new f.DynamicVariable(os,{thisDep:lr,contextDep:hr,propDep:Ve,ref:Xe,append:$e}),delete ce.static[Se]}function ye(Yt,ce,Se,nr,Ye){var tr=Oa();tr.stats=tr.link(Ye),Object.keys(ce.static).forEach(function(hr){fe(tr,ce,hr)}),je.forEach(function(hr){fe(tr,Yt,hr)});var lr=yc(Yt,ce,Se,nr,tr);return lr.shader.program&&(lr.shader.program.attributes.sort(function(hr,Ve){return hr.name<Ve.name?-1:1}),lr.shader.program.uniforms.sort(function(hr,Ve){return hr.name<Ve.name?-1:1})),yl(tr,lr),xt(tr,lr),et(tr,lr),c(tr.compile(),{destroy:function(){lr.shader.program.destroy()}})}return{next:Ua,current:ca,procs:function(){var Yt=Oa(),ce=Yt.proc("poll"),Se=Yt.proc("refresh"),nr=Yt.block();ce(nr),Se(nr);var Ye=Yt.shared,tr=Ye.gl,lr=Ye.next,hr=Ye.current;nr(hr,".dirty=false;"),hu(Yt,ce),hu(Yt,Se,null,!0);var Ve;_i&&(Ve=Yt.link(_i)),Lr.oes_vertex_array_object&&Se(Yt.link(Lr.oes_vertex_array_object),".bindVertexArrayOES(null);");var Xe=Se.def(Ye.attributes),$e=Se.def(0),Cr=Yt.cond($e,".buffer");Cr.then(tr,".enableVertexAttribArray(i);",tr,".bindBuffer(",Ie,",",$e,".buffer.buffer);",tr,".vertexAttribPointer(i,",$e,".size,",$e,".type,",$e,".normalized,",$e,".stride,",$e,".offset);").else(tr,".disableVertexAttribArray(i);",tr,".vertexAttrib4f(i,",$e,".x,",$e,".y,",$e,".z,",$e,".w);",$e,".buffer=null;");var on=Yt.link(Dn.maxAttributes,{stable:!0});return Se("for(var i=0;i<",on,";++i){",$e,"=",Xe,"[i];",Cr,"}"),_i&&Se("for(var i=0;i<",on,";++i){",Ve,".vertexAttribDivisorANGLE(i,",Xe,"[i].divisor);","}"),Se(Yt.shared.vao,".currentVAO=null;",Yt.shared.vao,".setVAO(",Yt.shared.vao,".targetVAO);"),Object.keys(ti).forEach(function(fn){var fi=ti[fn],si=nr.def(lr,".",fn),Gn=Yt.block();Gn("if(",si,"){",tr,".enable(",fi,")}else{",tr,".disable(",fi,")}",hr,".",fn,"=",si,";"),Se(Gn),ce("if(",si,"!==",hr,".",fn,"){",Gn,"}")}),Object.keys(Sa).forEach(function(fn){var fi=Sa[fn],si=ca[fn],Gn,Mi,di=Yt.block();if(di(tr,".",fi,"("),Pn(si)){var Ki=si.length;Gn=Yt.global.def(lr,".",fn),Mi=Yt.global.def(hr,".",fn),di(h(Ki,function(Ai){return Gn+"["+Ai+"]"}),");",h(Ki,function(Ai){return Mi+"["+Ai+"]="+Gn+"["+Ai+"];"}).join("")),ce("if(",h(Ki,function(Ai){return Gn+"["+Ai+"]!=="+Mi+"["+Ai+"]"}).join("||"),"){",di,"}")}else Gn=nr.def(lr,".",fn),Mi=nr.def(hr,".",fn),di(Gn,");",hr,".",fn,"=",Gn,";"),ce("if(",Gn,"!==",Mi,"){",di,"}");Se(di)}),Yt.compile()}(),compile:ye}}function Uo(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var al=34918,Wo=34919,ps=35007,Tl=function(_e,kr){if(!kr.ext_disjoint_timer_query)return null;var Lr=[];function Dn(){return Lr.pop()||kr.ext_disjoint_timer_query.createQueryEXT()}function oi(Oi){Lr.push(Oi)}var Jn=[];function gn(Oi){var _i=Dn();kr.ext_disjoint_timer_query.beginQueryEXT(ps,_i),Jn.push(_i),ta(Jn.length-1,Jn.length,Oi)}function ni(){kr.ext_disjoint_timer_query.endQueryEXT(ps)}function Yi(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var Ui=[];function va(){return Ui.pop()||new Yi}function Za(Oi){Ui.push(Oi)}var Ba=[];function ta(Oi,_i,Qn){var Ma=va();Ma.startQueryIndex=Oi,Ma.endQueryIndex=_i,Ma.sum=0,Ma.stats=Qn,Ba.push(Ma)}var wi=[],hn=[];function Nn(){var Oi,_i,Qn=Jn.length;if(Qn!==0){hn.length=Math.max(hn.length,Qn+1),wi.length=Math.max(wi.length,Qn+1),wi[0]=0,hn[0]=0;var Ma=0;for(Oi=0,_i=0;_i<Jn.length;++_i){var ca=Jn[_i];kr.ext_disjoint_timer_query.getQueryObjectEXT(ca,Wo)?(Ma+=kr.ext_disjoint_timer_query.getQueryObjectEXT(ca,al),oi(ca)):Jn[Oi++]=ca,wi[_i+1]=Ma,hn[_i+1]=Oi}for(Jn.length=Oi,Oi=0,_i=0;_i<Ba.length;++_i){var Ua=Ba[_i],vi=Ua.startQueryIndex,ti=Ua.endQueryIndex;Ua.sum+=wi[ti]-wi[vi];var Sa=hn[vi],pa=hn[ti];pa===Sa?(Ua.stats.gpuTime+=Ua.sum/1e6,Za(Ua)):(Ua.startQueryIndex=Sa,Ua.endQueryIndex=pa,Ba[Oi++]=Ua)}Ba.length=Oi}}return{beginQuery:gn,endQuery:ni,pushScopeStats:ta,update:Nn,getNumPendingQueries:function(){return Jn.length},clear:function(){Lr.push.apply(Lr,Jn);for(var Oi=0;Oi<Lr.length;Oi++)kr.ext_disjoint_timer_query.deleteQueryEXT(Lr[Oi]);Jn.length=0,Lr.length=0},restore:function(){Jn.length=0,Lr.length=0}}},Ku=16384,cu=256,_o=1024,Zs=34962,rl="webglcontextlost",ou="webglcontextrestored",Gl=1,rh=2,Bl=3;function Ql(_e,kr){for(var Lr=0;Lr<_e.length;++Lr)if(_e[Lr]===kr)return Lr;return-1}function bh(_e){var kr=E(_e);if(!kr)return null;var Lr=kr.gl,Dn=Lr.getContextAttributes();Lr.isContextLost();var oi=A(Lr,kr);if(!oi)return null;var Jn=v(),gn=Uo(),ni=kr.cachedCode||{},Yi=oi.extensions,Ui=Tl(Lr,Yi),va=y(),Za=Lr.drawingBufferWidth,Ba=Lr.drawingBufferHeight,ta={tick:0,time:0,viewportWidth:Za,viewportHeight:Ba,framebufferWidth:Za,framebufferHeight:Ba,drawingBufferWidth:Za,drawingBufferHeight:Ba,pixelRatio:kr.pixelRatio},wi={},hn={elements:null,primitive:4,count:-1,offset:0,instances:-1},Nn=br(Lr,Yi),Oi=wn(Lr,gn,kr,Ma),_i=dr(Lr,Yi,Oi,gn),Qn=Ch(Lr,Yi,Nn,gn,Oi,_i,hn);function Ma(Eo){return Qn.destroyBuffer(Eo)}var ca=qh(Lr,Jn,gn,kr),Ua=mh(Lr,Yi,Nn,function(){Sa.procs.poll()},ta,gn,kr),vi=Hh(Lr,Yi,Nn,gn,kr),ti=Qc(Lr,Yi,Nn,Ua,vi,gn),Sa=Fo(Lr,Jn,Yi,Nn,Oi,_i,Ua,ti,wi,Qn,ca,hn,ta,Ui,ni,kr),pa=zd(Lr,ti,Sa.procs.poll,ta),qi=Sa.next,$i=Lr.canvas,_a=[],Po=[],wo=[],xa=[kr.onDestroy],Oa=null;function ho(){if(_a.length===0){Ui&&Ui.update(),Oa=null;return}Oa=x.next(ho),hu();for(var Eo=_a.length-1;Eo>=0;--Eo){var Ss=_a[Eo];Ss&&Ss(ta,null,0)}Lr.flush(),Ui&&Ui.update()}function So(){!Oa&&_a.length>0&&(Oa=x.next(ho))}function ts(){Oa&&(x.cancel(ho),Oa=null)}function Nl(Eo){Eo.preventDefault(),ts(),Po.forEach(function(Ss){Ss()})}function Al(Eo){Lr.getError(),oi.restore(),ca.restore(),Oi.restore(),Ua.restore(),vi.restore(),ti.restore(),Qn.restore(),Ui&&Ui.restore(),Sa.procs.refresh(),So(),wo.forEach(function(Ss){Ss()})}$i&&($i.addEventListener(rl,Nl,!1),$i.addEventListener(ou,Al,!1));function us(){_a.length=0,ts(),$i&&($i.removeEventListener(rl,Nl),$i.removeEventListener(ou,Al)),ca.clear(),ti.clear(),vi.clear(),Qn.clear(),Ua.clear(),_i.clear(),Oi.clear(),Ui&&Ui.clear(),xa.forEach(function(Eo){Eo()})}function wu(Eo){function Ss(Ye){var tr=c({},Ye);delete tr.uniforms,delete tr.attributes,delete tr.context,delete tr.vao,"stencil"in tr&&tr.stencil.op&&(tr.stencil.opBack=tr.stencil.opFront=tr.stencil.op,delete tr.stencil.op);function lr(hr){if(hr in tr){var Ve=tr[hr];delete tr[hr],Object.keys(Ve).forEach(function(Xe){tr[hr+"."+Xe]=Ve[Xe]})}}return lr("blend"),lr("depth"),lr("cull"),lr("stencil"),lr("polygonOffset"),lr("scissor"),lr("sample"),"vao"in Ye&&(tr.vao=Ye.vao),tr}function Ml(Ye,tr){var lr={},hr={};return Object.keys(Ye).forEach(function(Ve){var Xe=Ye[Ve];if(f.isDynamic(Xe)){hr[Ve]=f.unbox(Xe,Ve);return}else if(tr&&Array.isArray(Xe)){for(var $e=0;$e<Xe.length;++$e)if(f.isDynamic(Xe[$e])){hr[Ve]=f.unbox(Xe,Ve);return}}lr[Ve]=Xe}),{dynamic:hr,static:lr}}var yl=Ml(Eo.context||{},!0),Z=Ml(Eo.uniforms||{},!0),ot=Ml(Eo.attributes||{},!1),et=Ml(Ss(Eo),!1),xt={gpuTime:0,cpuTime:0,count:0},Ut=Sa.compile(et,ot,Z,yl,xt),fe=Ut.draw,ye=Ut.batch,Yt=Ut.scope,ce=[];function Se(Ye){for(;ce.length<Ye;)ce.push(null);return ce}function nr(Ye,tr){var lr;if(typeof Ye=="function")return Yt.call(this,null,Ye,0);if(typeof tr=="function")if(typeof Ye=="number")for(lr=0;lr<Ye;++lr)Yt.call(this,null,tr,lr);else if(Array.isArray(Ye))for(lr=0;lr<Ye.length;++lr)Yt.call(this,Ye[lr],tr,lr);else return Yt.call(this,Ye,tr,0);else if(typeof Ye=="number"){if(Ye>0)return ye.call(this,Se(Ye|0),Ye|0)}else if(Array.isArray(Ye)){if(Ye.length)return ye.call(this,Ye,Ye.length)}else return fe.call(this,Ye)}return c(nr,{stats:xt,destroy:function(){Ut.destroy()}})}var fl=ti.setFBO=wu({framebuffer:f.define.call(null,Gl,"framebuffer")});function Eu(Eo,Ss){var Ml=0;Sa.procs.poll();var yl=Ss.color;yl&&(Lr.clearColor(+yl[0]||0,+yl[1]||0,+yl[2]||0,+yl[3]||0),Ml|=Ku),"depth"in Ss&&(Lr.clearDepth(+Ss.depth),Ml|=cu),"stencil"in Ss&&(Lr.clearStencil(Ss.stencil|0),Ml|=_o),Lr.clear(Ml)}function pc(Eo){if("framebuffer"in Eo)if(Eo.framebuffer&&Eo.framebuffer_reglType==="framebufferCube")for(var Ss=0;Ss<6;++Ss)fl(c({framebuffer:Eo.framebuffer.faces[Ss]},Eo),Eu);else fl(Eo,Eu);else Eu(null,Eo)}function yc(Eo){_a.push(Eo);function Ss(){var Ml=Ql(_a,Eo);function yl(){var Z=Ql(_a,yl);_a[Z]=_a[_a.length-1],_a.length-=1,_a.length<=0&&ts()}_a[Ml]=yl}return So(),{cancel:Ss}}function yu(){var Eo=qi.viewport,Ss=qi.scissor_box;Eo[0]=Eo[1]=Ss[0]=Ss[1]=0,ta.viewportWidth=ta.framebufferWidth=ta.drawingBufferWidth=Eo[2]=Ss[2]=Lr.drawingBufferWidth,ta.viewportHeight=ta.framebufferHeight=ta.drawingBufferHeight=Eo[3]=Ss[3]=Lr.drawingBufferHeight}function hu(){ta.tick+=1,ta.time=Bo(),yu(),Sa.procs.poll()}function ku(){Ua.refresh(),yu(),Sa.procs.refresh(),Ui&&Ui.update()}function Bo(){return(y()-va)/1e3}ku();function Tu(Eo,Ss){var Ml;switch(Eo){case"frame":return yc(Ss);case"lost":Ml=Po;break;case"restore":Ml=wo;break;case"destroy":Ml=xa;break}return Ml.push(Ss),{cancel:function(){for(var yl=0;yl<Ml.length;++yl)if(Ml[yl]===Ss){Ml[yl]=Ml[Ml.length-1],Ml.pop();return}}}}function ol(){return ni}function Cu(Eo){Object.entries(Eo).forEach(function(Ss){ni[Ss[0]]=Ss[1]})}var xc=c(wu,{clear:pc,prop:f.define.bind(null,Gl),context:f.define.bind(null,rh),this:f.define.bind(null,Bl),draw:wu({}),buffer:function(Eo){return Oi.create(Eo,Zs,!1,!1)},elements:function(Eo){return _i.create(Eo,!1)},texture:Ua.create2D,cube:Ua.createCube,renderbuffer:vi.create,framebuffer:ti.create,framebufferCube:ti.createCube,vao:Qn.createVAO,attributes:Dn,frame:yc,on:Tu,limits:Nn,hasExtension:function(Eo){return Nn.extensions.indexOf(Eo.toLowerCase())>=0},read:pa,destroy:us,_gl:Lr,_refresh:ku,poll:function(){hu(),Ui&&Ui.update()},now:Bo,stats:gn,getCachedCode:ol,preloadCachedCode:Cu});return kr.onDone(null,xc),xc}return bh})}),sH=Ft((Q,$)=>{var c=Cg();$.exports=function(r){if(r?typeof r=="string"&&(r={container:r}):r={},P(r)?r={container:r}:S(r)?r={container:r}:t(r)?r={gl:r}:r=c(r,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),r.pixelRatio||(r.pixelRatio=window.pixelRatio||1),r.gl)return r.gl;if(r.canvas&&(r.container=r.canvas.parentNode),r.container){if(typeof r.container=="string"){var a=document.querySelector(r.container);if(!a)throw Error("Element "+r.container+" is not found");r.container=a}P(r.container)?(r.canvas=r.container,r.container=r.canvas.parentNode):r.canvas||(r.canvas=e(),r.container.appendChild(r.canvas),g(r))}else if(!r.canvas)if(typeof document<"u")r.container=document.body||document.documentElement,r.canvas=e(),r.container.appendChild(r.canvas),g(r);else throw Error("Not DOM environment. Use headless-gl.");return r.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(n){try{r.gl=r.canvas.getContext(n,r.attrs)}catch{}return r.gl}),r.gl};function g(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var a=r.container.getBoundingClientRect();r.canvas.width=r.width||a.right-a.left,r.canvas.height=r.height||a.bottom-a.top}}function P(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function S(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}}),lH=Ft((Q,$)=>{var c=$S(),g=[32,126];$.exports=P;function P(S){S=S||{};var t=S.shape?S.shape:S.canvas?[S.canvas.width,S.canvas.height]:[512,512],e=S.canvas||document.createElement("canvas"),r=S.font,a=typeof S.step=="number"?[S.step,S.step]:S.step||[32,32],n=S.chars||g;if(r&&typeof r!="string"&&(r=c(r)),!Array.isArray(n))n=String(n).split("");else if(n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"){for(var o=[],i=n[0],s=0;i<=n[1];i++)o[s++]=String.fromCharCode(i);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 x=a[0]/2,y=a[1]/2,i=0;i<n.length;i++)f.fillText(n[i],x,y),(x+=a[0])>t[0]-a[0]/2&&(x=a[0]/2,y+=a[1]);return e}}),GS=Ft(Q=>{"use restrict";var $=32;Q.INT_BITS=$,Q.INT_MAX=2147483647,Q.INT_MIN=-1<<$-1,Q.sign=function(P){return(P>0)-(P<0)},Q.abs=function(P){var S=P>>$-1;return(P^S)-S},Q.min=function(P,S){return S^(P^S)&-(P<S)},Q.max=function(P,S){return P^(P^S)&-(P<S)},Q.isPow2=function(P){return!(P&P-1)&&!!P},Q.log2=function(P){var S,t;return S=(P>65535)<<4,P>>>=S,t=(P>255)<<3,P>>>=t,S|=t,t=(P>15)<<2,P>>>=t,S|=t,t=(P>3)<<1,P>>>=t,S|=t,S|P>>1},Q.log10=function(P){return P>=1e9?9:P>=1e8?8:P>=1e7?7:P>=1e6?6:P>=1e5?5:P>=1e4?4:P>=1e3?3:P>=100?2:P>=10?1:0},Q.popCount=function(P){return P=P-(P>>>1&1431655765),P=(P&858993459)+(P>>>2&858993459),(P+(P>>>4)&252645135)*16843009>>>24};function c(P){var S=32;return P&=-P,P&&S--,P&65535&&(S-=16),P&16711935&&(S-=8),P&252645135&&(S-=4),P&858993459&&(S-=2),P&1431655765&&(S-=1),S}Q.countTrailingZeros=c,Q.nextPow2=function(P){return P+=P===0,--P,P|=P>>>1,P|=P>>>2,P|=P>>>4,P|=P>>>8,P|=P>>>16,P+1},Q.prevPow2=function(P){return P|=P>>>1,P|=P>>>2,P|=P>>>4,P|=P>>>8,P|=P>>>16,P-(P>>>1)},Q.parity=function(P){return P^=P>>>16,P^=P>>>8,P^=P>>>4,P&=15,27030>>>P&1};var g=new Array(256);(function(P){for(var S=0;S<256;++S){var t=S,e=S,r=7;for(t>>>=1;t;t>>>=1)e<<=1,e|=t&1,--r;P[S]=e<<r&255}})(g),Q.reverse=function(P){return g[P&255]<<24|g[P>>>8&255]<<16|g[P>>>16&255]<<8|g[P>>>24&255]},Q.interleave2=function(P,S){return P&=65535,P=(P|P<<8)&16711935,P=(P|P<<4)&252645135,P=(P|P<<2)&858993459,P=(P|P<<1)&1431655765,S&=65535,S=(S|S<<8)&16711935,S=(S|S<<4)&252645135,S=(S|S<<2)&858993459,S=(S|S<<1)&1431655765,P|S<<1},Q.deinterleave2=function(P,S){return P=P>>>S&1431655765,P=(P|P>>>1)&858993459,P=(P|P>>>2)&252645135,P=(P|P>>>4)&16711935,P=(P|P>>>16)&65535,P<<16>>16},Q.interleave3=function(P,S,t){return P&=1023,P=(P|P<<16)&4278190335,P=(P|P<<8)&251719695,P=(P|P<<4)&3272356035,P=(P|P<<2)&1227133513,S&=1023,S=(S|S<<16)&4278190335,S=(S|S<<8)&251719695,S=(S|S<<4)&3272356035,S=(S|S<<2)&1227133513,P|=S<<1,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,P|t<<2},Q.deinterleave3=function(P,S){return P=P>>>S&1227133513,P=(P|P>>>2)&3272356035,P=(P|P>>>4)&251719695,P=(P|P>>>8)&4278190335,P=(P|P>>>16)&1023,P<<22>>22},Q.nextCombination=function(P){var S=P|P-1;return S+1|(~S&-~S)-1>>>c(P)+1}}),uH=Ft((Q,$)=>{function c(S,t,e){var r=S[e]|0;if(r<=0)return[];var a=new Array(r),n;if(e===S.length-1)for(n=0;n<r;++n)a[n]=t;else for(n=0;n<r;++n)a[n]=c(S,t,e+1);return a}function g(S,t){var e,r;for(e=new Array(S),r=0;r<S;++r)e[r]=t;return e}function P(S,t){switch(typeof t>"u"&&(t=0),typeof S){case"number":if(S>0)return g(S|0,t);break;case"object":if(typeof S.length=="number")return c(S,t,0);break}return[]}$.exports=P}),cH=Ft(Q=>{var $=GS(),c=uH(),g=tx().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:c([32,0]),UINT16:c([32,0]),UINT32:c([32,0]),BIGUINT64:c([32,0]),INT8:c([32,0]),INT16:c([32,0]),INT32:c([32,0]),BIGINT64:c([32,0]),FLOAT:c([32,0]),DOUBLE:c([32,0]),DATA:c([32,0]),UINT8C:c([32,0]),BUFFER:c([32,0])});var P=typeof Uint8ClampedArray<"u",S=typeof BigUint64Array<"u",t=typeof BigInt64Array<"u",e=window.__TYPEDARRAY_POOL;e.UINT8C||(e.UINT8C=c([32,0])),e.BIGUINT64||(e.BIGUINT64=c([32,0])),e.BIGINT64||(e.BIGINT64=c([32,0])),e.BUFFER||(e.BUFFER=c([32,0]));var r=e.DATA,a=e.BUFFER;Q.free=function(h){if(g.isBuffer(h))a[$.log2(h.length)].push(h);else{if(Object.prototype.toString.call(h)!=="[object ArrayBuffer]"&&(h=h.buffer),!h)return;var p=h.length||h.byteLength,k=$.log2(p)|0;r[k].push(h)}};function n(h){if(h){var p=h.length||h.byteLength,k=$.log2(p);r[k].push(h)}}function o(h){n(h.buffer)}Q.freeUint8=Q.freeUint16=Q.freeUint32=Q.freeBigUint64=Q.freeInt8=Q.freeInt16=Q.freeInt32=Q.freeBigInt64=Q.freeFloat32=Q.freeFloat=Q.freeFloat64=Q.freeDouble=Q.freeUint8Clamped=Q.freeDataView=o,Q.freeArrayBuffer=n,Q.freeBuffer=function(h){a[$.log2(h.length)].push(h)},Q.malloc=function(h,p){if(p===void 0||p==="arraybuffer")return i(h);switch(p){case"uint8":return s(h);case"uint16":return f(h);case"uint32":return x(h);case"int8":return y(h);case"int16":return v(h);case"int32":return T(h);case"float":case"float32":return u(h);case"double":case"float64":return b(h);case"uint8_clamped":return _(h);case"bigint64":return M(h);case"biguint64":return C(h);case"buffer":return A(h);case"data":case"dataview":return E(h);default:return null}return null};function i(p){var p=$.nextPow2(p),k=$.log2(p),w=r[k];return w.length>0?w.pop():new ArrayBuffer(p)}Q.mallocArrayBuffer=i;function s(h){return new Uint8Array(i(h),0,h)}Q.mallocUint8=s;function f(h){return new Uint16Array(i(2*h),0,h)}Q.mallocUint16=f;function x(h){return new Uint32Array(i(4*h),0,h)}Q.mallocUint32=x;function y(h){return new Int8Array(i(h),0,h)}Q.mallocInt8=y;function v(h){return new Int16Array(i(2*h),0,h)}Q.mallocInt16=v;function T(h){return new Int32Array(i(4*h),0,h)}Q.mallocInt32=T;function u(h){return new Float32Array(i(4*h),0,h)}Q.mallocFloat32=Q.mallocFloat=u;function b(h){return new Float64Array(i(8*h),0,h)}Q.mallocFloat64=Q.mallocDouble=b;function _(h){return P?new Uint8ClampedArray(i(h),0,h):s(h)}Q.mallocUint8Clamped=_;function C(h){return S?new BigUint64Array(i(8*h),0,h):null}Q.mallocBigUint64=C;function M(h){return t?new BigInt64Array(i(8*h),0,h):null}Q.mallocBigInt64=M;function E(h){return new DataView(i(h),0,h)}Q.mallocDataView=E;function A(h){h=$.nextPow2(h);var p=$.log2(h),k=a[p];return k.length>0?k.pop():new g(h)}Q.mallocBuffer=A,Q.clearCache=function(){for(var h=0;h<32;++h)e.UINT8[h].length=0,e.UINT16[h].length=0,e.UINT32[h].length=0,e.INT8[h].length=0,e.INT16[h].length=0,e.INT32[h].length=0,e.FLOAT[h].length=0,e.DOUBLE[h].length=0,e.BIGUINT64[h].length=0,e.BIGINT64[h].length=0,e.UINT8C[h].length=0,r[h].length=0,a[h].length=0}}),hH=Ft((Q,$)=>{var c=Object.prototype.toString;$.exports=function(g){var P;return c.call(g)==="[object Object]"&&(P=Object.getPrototypeOf(g),P===null||P===Object.getPrototypeOf({}))}}),YS=Ft((Q,$)=>{$.exports=function(c,g){g||(g=[0,""]),c=String(c);var P=parseFloat(c,10);return g[0]=P,g[1]=c.match(/[\d.\-\+]*\s*(.*)/)[1]||"",g}}),fH=Ft((Q,$)=>{var c=YS();$.exports=t;var g=96;function P(e,r){var a=c(getComputedStyle(e).getPropertyValue(r));return a[0]*t(a[1],e)}function S(e,r){var a=document.createElement("div");a.style["font-size"]="128"+e,r.appendChild(a);var n=P(a,"font-size")/128;return r.removeChild(a),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 S(e,r);case"em":return P(r,"font-size");case"rem":return P(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return g;case"cm":return g/2.54;case"mm":return g/25.4;case"pt":return g/72;case"pc":return g/6}return 1}}),dH=Ft((Q,$)=>{$.exports=S;var c=S.canvas=document.createElement("canvas"),g=c.getContext("2d"),P=t([32,126]);S.createPairs=t,S.ascii=P;function S(e,r){Array.isArray(e)&&(e=e.join(", "));var a={},n,o=16,i=.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&&(i=r.threshold))),n||(n=P),g.font=o+"px "+e;for(var s=0;s<n.length;s++){var f=n[s],x=g.measureText(f[0]).width+g.measureText(f[1]).width,y=g.measureText(f).width;if(Math.abs(x-y)>o*i){var v=(y-x)/o;a[f]=v*1e3}}return a}function t(e){for(var r=[],a=e[0];a<=e[1];a++)for(var n=String.fromCharCode(a),o=e[0];o<e[1];o++){var i=String.fromCharCode(o),s=n+i;r.push(s)}return r}}),pH=Ft((Q,$)=>{$.exports=c,c.canvas=document.createElement("canvas"),c.cache={};function c(i,e){e||(e={}),(typeof i=="string"||Array.isArray(i))&&(e.family=i);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var a=e.size||e.fontSize||e.em||48,n=e.weight||e.fontWeight||"",o=e.style||e.fontStyle||"",i=[o,n,a].join(" ")+"px "+r,s=e.origin||"top";if(c.cache[r]&&a<=c.cache[r].em)return g(c.cache[r],s);var f=e.canvas||c.canvas,x=f.getContext("2d"),y={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"},v=Math.ceil(a*1.5);f.height=v,f.width=v*.5,x.font=i;var T="H",u={top:0};x.clearRect(0,0,v,v),x.textBaseline="top",x.fillStyle="black",x.fillText(T,0,0);var b=P(x.getImageData(0,0,v,v));x.clearRect(0,0,v,v),x.textBaseline="bottom",x.fillText(T,0,v);var _=P(x.getImageData(0,0,v,v));u.lineHeight=u.bottom=v-_+b,x.clearRect(0,0,v,v),x.textBaseline="alphabetic",x.fillText(T,0,v);var C=P(x.getImageData(0,0,v,v)),M=v-C-1+b;u.baseline=u.alphabetic=M,x.clearRect(0,0,v,v),x.textBaseline="middle",x.fillText(T,0,v*.5);var E=P(x.getImageData(0,0,v,v));u.median=u.middle=v-E-1+b-v*.5,x.clearRect(0,0,v,v),x.textBaseline="hanging",x.fillText(T,0,v*.5);var A=P(x.getImageData(0,0,v,v));u.hanging=v-A-1+b-v*.5,x.clearRect(0,0,v,v),x.textBaseline="ideographic",x.fillText(T,0,v);var h=P(x.getImageData(0,0,v,v));if(u.ideographic=v-h-1+b,y.upper&&(x.clearRect(0,0,v,v),x.textBaseline="top",x.fillText(y.upper,0,0),u.upper=P(x.getImageData(0,0,v,v)),u.capHeight=u.baseline-u.upper),y.lower&&(x.clearRect(0,0,v,v),x.textBaseline="top",x.fillText(y.lower,0,0),u.lower=P(x.getImageData(0,0,v,v)),u.xHeight=u.baseline-u.lower),y.tittle&&(x.clearRect(0,0,v,v),x.textBaseline="top",x.fillText(y.tittle,0,0),u.tittle=P(x.getImageData(0,0,v,v))),y.ascent&&(x.clearRect(0,0,v,v),x.textBaseline="top",x.fillText(y.ascent,0,0),u.ascent=P(x.getImageData(0,0,v,v))),y.descent&&(x.clearRect(0,0,v,v),x.textBaseline="top",x.fillText(y.descent,0,0),u.descent=S(x.getImageData(0,0,v,v))),y.overshoot){x.clearRect(0,0,v,v),x.textBaseline="top",x.fillText(y.overshoot,0,0);var p=S(x.getImageData(0,0,v,v));u.overshoot=p-M}for(var k in u)u[k]/=a;return u.em=a,c.cache[r]=u,g(u,s)}function g(t,e){var r={};typeof e=="string"&&(e=t[e]);for(var a in t)a!=="em"&&(r[a]=t[a]-e);return r}function P(t){for(var e=t.height,r=t.data,a=3;a<r.length;a+=4)if(r[a]!==0)return Math.floor((a-3)*.25/e)}function S(t){for(var e=t.height,r=t.data,a=r.length-1;a>0;a-=4)if(r[a]!==0)return Math.floor((a-3)*.25/e)}}),mH=Ft((Q,$)=>{var c=aH(),g=Cg(),P=oH(),S=sH(),t=NS(),e=N1(),r=lH(),a=cH(),n=db(),o=hH(),i=YS(),s=fH(),f=dH(),x=Ed(),y=pH(),v=mx(),T=GS(),u=T.nextPow2,b=new t,_=!1;document.body&&(C=document.body.appendChild(document.createElement("div")),C.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(C).fontStretch&&(_=!0),document.body.removeChild(C));var C,M=function(A){E(A)?(A={regl:A},this.gl=A.regl._gl):this.gl=S(A),this.shader=b.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=A.regl||P({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(),b.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(A)?A:{})};M.prototype.createShader=function(){var A=this.regl,h=A({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:A.prop("count"),offset:A.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:A.this("sizeBuffer")},width:{offset:0,stride:8,buffer:A.this("sizeBuffer")},char:A.this("charBuffer"),position:A.this("position")},uniforms:{atlasSize:function(k,w){return[w.atlas.width,w.atlas.height]},atlasDim:function(k,w){return[w.atlas.cols,w.atlas.rows]},atlas:function(k,w){return w.atlas.texture},charStep:function(k,w){return w.atlas.step},em:function(k,w){return w.atlas.em},color:A.prop("color"),opacity:A.prop("opacity"),viewport:A.this("viewportArray"),scale:A.this("scale"),align:A.prop("align"),baseline:A.prop("baseline"),translate:A.this("translate"),positionOffset:A.prop("positionOffset")},primitive:"points",viewport:A.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;
}`}),p={};return{regl:A,draw:h,atlas:p}},M.prototype.update=function(A){var h=this;if(typeof A=="string")A={text:A};else if(!A)return;A=g(A,{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),A.opacity!=null&&(Array.isArray(A.opacity)?this.opacity=A.opacity.map(function(Lt){return parseFloat(Lt)}):this.opacity=parseFloat(A.opacity)),A.viewport!=null&&(this.viewport=n(A.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]),A.kerning!=null&&(this.kerning=A.kerning),A.offset!=null&&(typeof A.offset=="number"&&(A.offset=[A.offset,0]),this.positionOffset=v(A.offset)),A.direction&&(this.direction=A.direction),A.range&&(this.range=A.range,this.scale=[1/(A.range[2]-A.range[0]),1/(A.range[3]-A.range[1])],this.translate=[-A.range[0],-A.range[1]]),A.scale&&(this.scale=A.scale),A.translate&&(this.translate=A.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!A.font&&(A.font=M.baseFontSize+"px sans-serif");var p=!1,k=!1;if(A.font&&(Array.isArray(A.font)?A.font:[A.font]).forEach(function(Lt,Mt){if(typeof Lt=="string")try{Lt=c.parse(Lt)}catch{Lt=c.parse(M.baseFontSize+"px "+Lt)}else{var te=Lt.style,ve=Lt.weight,oe=Lt.stretch,Te=Lt.variant;Lt=c.parse(c.stringify(Lt)),te&&(Lt.style=te),ve&&(Lt.weight=ve),oe&&(Lt.stretch=oe),Te&&(Lt.variant=Te)}var He=c.stringify({size:M.baseFontSize,family:Lt.family,stretch:_?Lt.stretch:void 0,variant:Lt.variant,weight:Lt.weight,style:Lt.style}),Ge=i(Lt.size),cr=Math.round(Ge[0]*s(Ge[1]));if(cr!==h.fontSize[Mt]&&(k=!0,h.fontSize[Mt]=cr),(!h.font[Mt]||He!=h.font[Mt].baseString)&&(p=!0,h.font[Mt]=M.fonts[He],!h.font[Mt])){var ur=Lt.family.join(", "),jr=[Lt.style];Lt.style!=Lt.variant&&jr.push(Lt.variant),Lt.variant!=Lt.weight&&jr.push(Lt.weight),_&&Lt.weight!=Lt.stretch&&jr.push(Lt.stretch),h.font[Mt]={baseString:He,family:ur,weight:Lt.weight,stretch:Lt.stretch,style:Lt.style,variant:Lt.variant,width:{},kerning:{},metrics:y(ur,{origin:"top",fontSize:M.baseFontSize,fontStyle:jr.join(" ")})},M.fonts[He]=h.font[Mt]}}),(p||k)&&this.font.forEach(function(Lt,Mt){var te=c.stringify({size:h.fontSize[Mt],family:Lt.family,stretch:_?Lt.stretch:void 0,variant:Lt.variant,weight:Lt.weight,style:Lt.style});if(h.fontAtlas[Mt]=h.shader.atlas[te],!h.fontAtlas[Mt]){var ve=Lt.metrics;h.shader.atlas[te]=h.fontAtlas[Mt]={fontString:te,step:Math.ceil(h.fontSize[Mt]*ve.bottom*.5)*2,em:h.fontSize[Mt],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:h.regl.texture()}}A.text==null&&(A.text=h.text)}),typeof A.text=="string"&&A.position&&A.position.length>2){for(var w=Array(A.position.length*.5),R=0;R<w.length;R++)w[R]=A.text;A.text=w}var O;if(A.text!=null||p){if(this.textOffsets=[0],Array.isArray(A.text)){this.count=A.text[0].length,this.counts=[this.count];for(var N=1;N<A.text.length;N++)this.textOffsets[N]=this.textOffsets[N-1]+A.text[N-1].length,this.count+=A.text[N].length,this.counts.push(A.text[N].length);this.text=A.text.join("")}else this.text=A.text,this.count=this.text.length,this.counts=[this.count];O=[],this.font.forEach(function(Lt,Mt){M.atlasContext.font=Lt.baseString;for(var te=h.fontAtlas[Mt],ve=0;ve<h.text.length;ve++){var oe=h.text.charAt(ve);if(te.ids[oe]==null&&(te.ids[oe]=te.chars.length,te.chars.push(oe),O.push(oe)),Lt.width[oe]==null&&(Lt.width[oe]=M.atlasContext.measureText(oe).width/M.baseFontSize,h.kerning)){var Te=[];for(var He in Lt.width)Te.push(He+oe,oe+He);x(Lt.kerning,f(Lt.family,{pairs:Te}))}}})}if(A.position)if(A.position.length>2){for(var V=!A.position[0].length,H=a.mallocFloat(this.count*2),F=0,U=0;F<this.counts.length;F++){var W=this.counts[F];if(V)for(var q=0;q<W;q++)H[U++]=A.position[F*2],H[U++]=A.position[F*2+1];else for(var X=0;X<W;X++)H[U++]=A.position[F][0],H[U++]=A.position[F][1]}this.position.call?this.position({type:"float",data:H}):this.position=this.regl.buffer({type:"float",data:H}),a.freeFloat(H)}else this.position.destroy&&this.position.destroy(),this.position={constant:A.position};if(A.text||p){var lt=a.mallocUint8(this.count),yt=a.mallocFloat(this.count*2);this.textWidth=[];for(var pt=0,st=0;pt<this.counts.length;pt++){for(var tt=this.counts[pt],dt=this.font[pt]||this.font[0],rt=this.fontAtlas[pt]||this.fontAtlas[0],at=0;at<tt;at++){var vt=this.text.charAt(st),it=this.text.charAt(st-1);if(lt[st]=rt.ids[vt],yt[st*2]=dt.width[vt],at){var Y=yt[st*2-2],ft=yt[st*2],ut=yt[st*2-1],wt=ut+Y*.5+ft*.5;if(this.kerning){var zt=dt.kerning[it+vt];zt&&(wt+=zt*.001)}yt[st*2+1]=wt}else yt[st*2+1]=yt[st*2]*.5;st++}this.textWidth.push(yt.length?yt[st*2-2]*.5+yt[st*2-1]:0)}A.align||(A.align=this.align),this.charBuffer({data:lt,type:"uint8",usage:"stream"}),this.sizeBuffer({data:yt,type:"float",usage:"stream"}),a.freeUint8(lt),a.freeFloat(yt),O.length&&this.font.forEach(function(Lt,Mt){var te=h.fontAtlas[Mt],ve=te.step,oe=Math.floor(M.maxAtlasSize/ve),Te=Math.min(oe,te.chars.length),He=Math.ceil(te.chars.length/Te),Ge=u(Te*ve),cr=u(He*ve);te.width=Ge,te.height=cr,te.rows=He,te.cols=Te,te.em&&te.texture({data:r({canvas:M.atlasCanvas,font:te.fontString,chars:te.chars,shape:[Ge,cr],step:[ve,ve]})})})}if(A.align&&(this.align=A.align,this.alignOffset=this.textWidth.map(function(Lt,Mt){var te=Array.isArray(h.align)?h.align.length>1?h.align[Mt]:h.align[0]:h.align;if(typeof te=="number")return te;switch(te){case"right":case"end":return-Lt;case"center":case"centre":case"middle":return-Lt*.5}return 0})),this.baseline==null&&A.baseline==null&&(A.baseline=0),A.baseline!=null&&(this.baseline=A.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(Lt,Mt){var te=(h.font[Mt]||h.font[0]).metrics,ve=0;return ve+=te.bottom*.5,typeof Lt=="number"?ve+=Lt-te.baseline:ve+=-te[Lt],ve*=-1,ve})),A.color!=null)if(A.color||(A.color="transparent"),typeof A.color=="string"||!isNaN(A.color))this.color=e(A.color,"uint8");else{var Pt;if(typeof A.color[0]=="number"&&A.color.length>this.counts.length){var Wt=A.color.length;Pt=a.mallocUint8(Wt);for(var Ht=(A.color.subarray||A.color.slice).bind(A.color),Jt=0;Jt<Wt;Jt+=4)Pt.set(e(Ht(Jt,Jt+4),"uint8"),Jt)}else{var ge=A.color.length;Pt=a.mallocUint8(ge*4);for(var he=0;he<ge;he++)Pt.set(e(A.color[he]||0,"uint8"),he*4)}this.color=Pt}if(A.position||A.text||A.color||A.baseline||A.align||A.font||A.offset||A.opacity){var de=this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(de){var se=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(se);for(var Tt=0;Tt<this.batch.length;Tt++)this.batch[Tt]={count:this.counts.length>1?this.counts[Tt]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Tt]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(Tt*4,Tt*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Tt]:this.opacity,baseline:this.baselineOffset[Tt]!=null?this.baselineOffset[Tt]:this.baselineOffset[0],align:this.align?this.alignOffset[Tt]!=null?this.alignOffset[Tt]:this.alignOffset[0]:0,atlas:this.fontAtlas[Tt]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(Tt*2,Tt*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=[]}},M.prototype.destroy=function(){},M.prototype.kerning=!0,M.prototype.position={constant:new Float32Array(2)},M.prototype.translate=null,M.prototype.scale=null,M.prototype.font=null,M.prototype.text="",M.prototype.positionOffset=[0,0],M.prototype.opacity=1,M.prototype.color=new Uint8Array([0,0,0,255]),M.prototype.alignOffset=[0,0],M.maxAtlasSize=1024,M.atlasCanvas=document.createElement("canvas"),M.atlasContext=M.atlasCanvas.getContext("2d",{alpha:!1}),M.baseFontSize=64,M.fonts={};function E(A){return typeof A=="function"&&A._gl&&A.prop&&A.texture&&A.buffer}$.exports=M}),gH=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?$.exports=g():c.createREGL=g()})(Q,function(){var c=function(_e,kr){for(var Lr=Object.keys(kr),Dn=0;Dn<Lr.length;++Dn)_e[Lr[Dn]]=kr[Lr[Dn]];return _e},g=0,P=0,S=5,t=6;function e(_e,kr){this.id=g++,this.type=_e,this.data=kr}function r(_e){return _e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function a(_e){if(_e.length===0)return[];var kr=_e.charAt(0),Lr=_e.charAt(_e.length-1);if(_e.length>1&&kr===Lr&&(kr==='"'||kr==="'"))return['"'+r(_e.substr(1,_e.length-2))+'"'];var Dn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(_e);if(Dn)return a(_e.substr(0,Dn.index)).concat(a(Dn[1])).concat(a(_e.substr(Dn.index+Dn[0].length)));var oi=_e.split(".");if(oi.length===1)return['"'+r(_e)+'"'];for(var Jn=[],gn=0;gn<oi.length;++gn)Jn=Jn.concat(a(oi[gn]));return Jn}function n(_e){return"["+a(_e).join("][")+"]"}function o(_e,kr){return new e(_e,n(kr+""))}function i(_e){return typeof _e=="function"&&!_e._reglType||_e instanceof e}function s(_e,kr){if(typeof _e=="function")return new e(P,_e);if(typeof _e=="number"||typeof _e=="boolean")return new e(S,_e);if(Array.isArray(_e))return new e(t,_e.map(function(Lr,Dn){return s(Lr)}));if(_e instanceof e)return _e}var f={DynamicVariable:e,define:o,isDynamic:i,unbox:s,accessor:n},x={next:typeof requestAnimationFrame=="function"?function(_e){return requestAnimationFrame(_e)}:function(_e){return setTimeout(_e,16)},cancel:typeof cancelAnimationFrame=="function"?function(_e){return cancelAnimationFrame(_e)}:clearTimeout},y=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function v(){var _e={"":0},kr=[""];return{id:function(Lr){var Dn=_e[Lr];return Dn||(Dn=_e[Lr]=kr.length,kr.push(Lr),Dn)},str:function(Lr){return kr[Lr]}}}function T(_e,kr,Lr){var Dn=document.createElement("canvas");c(Dn.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),_e.appendChild(Dn),_e===document.body&&(Dn.style.position="absolute",c(_e.style,{margin:0,padding:0}));function oi(){var ni=window.innerWidth,Yi=window.innerHeight;if(_e!==document.body){var Ui=Dn.getBoundingClientRect();ni=Ui.right-Ui.left,Yi=Ui.bottom-Ui.top}Dn.width=Lr*ni,Dn.height=Lr*Yi}var Jn;_e!==document.body&&typeof ResizeObserver=="function"?(Jn=new ResizeObserver(function(){setTimeout(oi)}),Jn.observe(_e)):window.addEventListener("resize",oi,!1);function gn(){Jn?Jn.disconnect():window.removeEventListener("resize",oi),_e.removeChild(Dn)}return oi(),{canvas:Dn,onDestroy:gn}}function u(_e,kr){function Lr(Dn){try{return _e.getContext(Dn,kr)}catch{return null}}return Lr("webgl")||Lr("experimental-webgl")||Lr("webgl-experimental")}function b(_e){return typeof _e.nodeName=="string"&&typeof _e.appendChild=="function"&&typeof _e.getBoundingClientRect=="function"}function _(_e){return typeof _e.drawArrays=="function"||typeof _e.drawElements=="function"}function C(_e){return typeof _e=="string"?_e.split():_e}function M(_e){return typeof _e=="string"?document.querySelector(_e):_e}function E(_e){var kr=_e||{},Lr,Dn,oi,Jn,gn={},ni=[],Yi=[],Ui=typeof window>"u"?1:window.devicePixelRatio,va=!1,Za={},Ba=function(hn){},ta=function(){};if(typeof kr=="string"?Lr=document.querySelector(kr):typeof kr=="object"&&(b(kr)?Lr=kr:_(kr)?(Jn=kr,oi=Jn.canvas):("gl"in kr?Jn=kr.gl:"canvas"in kr?oi=M(kr.canvas):"container"in kr&&(Dn=M(kr.container)),"attributes"in kr&&(gn=kr.attributes),"extensions"in kr&&(ni=C(kr.extensions)),"optionalExtensions"in kr&&(Yi=C(kr.optionalExtensions)),"onDone"in kr&&(Ba=kr.onDone),"profile"in kr&&(va=!!kr.profile),"pixelRatio"in kr&&(Ui=+kr.pixelRatio),"cachedCode"in kr&&(Za=kr.cachedCode))),Lr&&(Lr.nodeName.toLowerCase()==="canvas"?oi=Lr:Dn=Lr),!Jn){if(!oi){var wi=T(Dn||document.body,Ba,Ui);if(!wi)return null;oi=wi.canvas,ta=wi.onDestroy}gn.premultipliedAlpha===void 0&&(gn.premultipliedAlpha=!0),Jn=u(oi,gn)}return Jn?{gl:Jn,canvas:oi,container:Dn,extensions:ni,optionalExtensions:Yi,pixelRatio:Ui,profile:va,cachedCode:Za,onDone:Ba,onDestroy:ta}:(ta(),Ba("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function A(_e,kr){var Lr={};function Dn(gn){var ni=gn.toLowerCase(),Yi;try{Yi=Lr[ni]=_e.getExtension(ni)}catch{}return!!Yi}for(var oi=0;oi<kr.extensions.length;++oi){var Jn=kr.extensions[oi];if(!Dn(Jn))return kr.onDestroy(),kr.onDone('"'+Jn+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return kr.optionalExtensions.forEach(Dn),{extensions:Lr,restore:function(){Object.keys(Lr).forEach(function(gn){if(Lr[gn]&&!Dn(gn))throw new Error("(regl): error restoring extension "+gn)})}}}function h(_e,kr){for(var Lr=Array(_e),Dn=0;Dn<_e;++Dn)Lr[Dn]=kr(Dn);return Lr}var p=5120,k=5121,w=5122,R=5123,O=5124,N=5125,V=5126;function H(_e){for(var kr=16;kr<=1<<28;kr*=16)if(_e<=kr)return kr;return 0}function F(_e){var kr,Lr;return kr=(_e>65535)<<4,_e>>>=kr,Lr=(_e>255)<<3,_e>>>=Lr,kr|=Lr,Lr=(_e>15)<<2,_e>>>=Lr,kr|=Lr,Lr=(_e>3)<<1,_e>>>=Lr,kr|=Lr,kr|_e>>1}function U(){var _e=h(8,function(){return[]});function kr(Jn){var gn=H(Jn),ni=_e[F(gn)>>2];return ni.length>0?ni.pop():new ArrayBuffer(gn)}function Lr(Jn){_e[F(Jn.byteLength)>>2].push(Jn)}function Dn(Jn,gn){var ni=null;switch(Jn){case p:ni=new Int8Array(kr(gn),0,gn);break;case k:ni=new Uint8Array(kr(gn),0,gn);break;case w:ni=new Int16Array(kr(2*gn),0,gn);break;case R:ni=new Uint16Array(kr(2*gn),0,gn);break;case O:ni=new Int32Array(kr(4*gn),0,gn);break;case N:ni=new Uint32Array(kr(4*gn),0,gn);break;case V:ni=new Float32Array(kr(4*gn),0,gn);break;default:return null}return ni.length!==gn?ni.subarray(0,gn):ni}function oi(Jn){Lr(Jn.buffer)}return{alloc:kr,free:Lr,allocType:Dn,freeType:oi}}var W=U();W.zero=U();var q=3408,X=3410,lt=3411,yt=3412,pt=3413,st=3414,tt=3415,dt=33901,rt=33902,at=3379,vt=3386,it=34921,Y=36347,ft=36348,ut=35661,wt=35660,zt=34930,Pt=36349,Wt=34076,Ht=34024,Jt=7936,ge=7937,he=7938,de=35724,se=34047,Tt=36063,Lt=34852,Mt=3553,te=34067,ve=34069,oe=33984,Te=6408,He=5126,Ge=5121,cr=36160,ur=36053,jr=36064,Hr=16384,br=function(_e,kr){var Lr=1;kr.ext_texture_filter_anisotropic&&(Lr=_e.getParameter(se));var Dn=1,oi=1;kr.webgl_draw_buffers&&(Dn=_e.getParameter(Lt),oi=_e.getParameter(Tt));var Jn=!!kr.oes_texture_float;if(Jn){var gn=_e.createTexture();_e.bindTexture(Mt,gn),_e.texImage2D(Mt,0,Te,1,1,0,Te,He,null);var ni=_e.createFramebuffer();if(_e.bindFramebuffer(cr,ni),_e.framebufferTexture2D(cr,jr,Mt,gn,0),_e.bindTexture(Mt,null),_e.checkFramebufferStatus(cr)!==ur)Jn=!1;else{_e.viewport(0,0,1,1),_e.clearColor(1,0,0,1),_e.clear(Hr);var Yi=W.allocType(He,4);_e.readPixels(0,0,1,1,Te,He,Yi),_e.getError()?Jn=!1:(_e.deleteFramebuffer(ni),_e.deleteTexture(gn),Jn=Yi[0]===1),W.freeType(Yi)}}var Ui=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),va=!0;if(!Ui){var Za=_e.createTexture(),Ba=W.allocType(Ge,36);_e.activeTexture(oe),_e.bindTexture(te,Za),_e.texImage2D(ve,0,Te,3,3,0,Te,Ge,Ba),W.freeType(Ba),_e.bindTexture(te,null),_e.deleteTexture(Za),va=!_e.getError()}return{colorBits:[_e.getParameter(X),_e.getParameter(lt),_e.getParameter(yt),_e.getParameter(pt)],depthBits:_e.getParameter(st),stencilBits:_e.getParameter(tt),subpixelBits:_e.getParameter(q),extensions:Object.keys(kr).filter(function(ta){return!!kr[ta]}),maxAnisotropic:Lr,maxDrawbuffers:Dn,maxColorAttachments:oi,pointSizeDims:_e.getParameter(dt),lineWidthDims:_e.getParameter(rt),maxViewportDims:_e.getParameter(vt),maxCombinedTextureUnits:_e.getParameter(ut),maxCubeMapSize:_e.getParameter(Wt),maxRenderbufferSize:_e.getParameter(Ht),maxTextureUnits:_e.getParameter(zt),maxTextureSize:_e.getParameter(at),maxAttributes:_e.getParameter(it),maxVertexUniforms:_e.getParameter(Y),maxVertexTextureUnits:_e.getParameter(wt),maxVaryingVectors:_e.getParameter(ft),maxFragmentUniforms:_e.getParameter(Pt),glsl:_e.getParameter(de),renderer:_e.getParameter(ge),vendor:_e.getParameter(Jt),version:_e.getParameter(he),readFloat:Jn,npotTextureCube:va}},Kr=function(_e){return _e instanceof Uint8Array||_e instanceof Uint16Array||_e instanceof Uint32Array||_e instanceof Int8Array||_e instanceof Int16Array||_e instanceof Int32Array||_e instanceof Float32Array||_e instanceof Float64Array||_e instanceof Uint8ClampedArray};function rn(_e){return!!_e&&typeof _e=="object"&&Array.isArray(_e.shape)&&Array.isArray(_e.stride)&&typeof _e.offset=="number"&&_e.shape.length===_e.stride.length&&(Array.isArray(_e.data)||Kr(_e.data))}var Ce=function(_e){return Object.keys(_e).map(function(kr){return _e[kr]})},$t={shape:ee,flatten:Nt};function ne(_e,kr,Lr){for(var Dn=0;Dn<kr;++Dn)Lr[Dn]=_e[Dn]}function Ct(_e,kr,Lr,Dn){for(var oi=0,Jn=0;Jn<kr;++Jn)for(var gn=_e[Jn],ni=0;ni<Lr;++ni)Dn[oi++]=gn[ni]}function gt(_e,kr,Lr,Dn,oi,Jn){for(var gn=Jn,ni=0;ni<kr;++ni)for(var Yi=_e[ni],Ui=0;Ui<Lr;++Ui)for(var va=Yi[Ui],Za=0;Za<Dn;++Za)oi[gn++]=va[Za]}function St(_e,kr,Lr,Dn,oi){for(var Jn=1,gn=Lr+1;gn<kr.length;++gn)Jn*=kr[gn];var ni=kr[Lr];if(kr.length-Lr===4){var Yi=kr[Lr+1],Ui=kr[Lr+2],va=kr[Lr+3];for(gn=0;gn<ni;++gn)gt(_e[gn],Yi,Ui,va,Dn,oi),oi+=Jn}else for(gn=0;gn<ni;++gn)St(_e[gn],kr,Lr+1,Dn,oi),oi+=Jn}function Nt(_e,kr,Lr,Dn){var oi=1;if(kr.length)for(var Jn=0;Jn<kr.length;++Jn)oi*=kr[Jn];else oi=0;var gn=Dn||W.allocType(Lr,oi);switch(kr.length){case 0:break;case 1:ne(_e,kr[0],gn);break;case 2:Ct(_e,kr[0],kr[1],gn);break;case 3:gt(_e,kr[0],kr[1],kr[2],gn,0);break;default:St(_e,kr,0,gn,0)}return gn}function ee(_e){for(var kr=[],Lr=_e;Lr.length;Lr=Lr[0])kr.push(Lr.length);return kr}var le={"[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},we=5120,Ue=5122,qe=5124,ar=5121,Ar=5123,Tr=5125,pr=5126,Jr=5126,Vn={int8:we,int16:Ue,int32:qe,uint8:ar,uint16:Ar,uint32:Tr,float:pr,float32:Jr},Hn=35048,Kn=35040,Ci={dynamic:Hn,stream:Kn,static:35044},ii=$t.flatten,qn=$t.shape,oa=35044,Hi=35040,We=5121,rr=5126,fr=[];fr[5120]=1,fr[5122]=2,fr[5124]=4,fr[5121]=1,fr[5123]=2,fr[5125]=4,fr[5126]=4;function xr(_e){return le[Object.prototype.toString.call(_e)]|0}function Qr(_e,kr){for(var Lr=0;Lr<kr.length;++Lr)_e[Lr]=kr[Lr]}function Cn(_e,kr,Lr,Dn,oi,Jn,gn){for(var ni=0,Yi=0;Yi<Lr;++Yi)for(var Ui=0;Ui<Dn;++Ui)_e[ni++]=kr[oi*Yi+Jn*Ui+gn]}function wn(_e,kr,Lr,Dn){var oi=0,Jn={};function gn(hn){this.id=oi++,this.buffer=_e.createBuffer(),this.type=hn,this.usage=oa,this.byteLength=0,this.dimension=1,this.dtype=We,this.persistentData=null,Lr.profile&&(this.stats={size:0})}gn.prototype.bind=function(){_e.bindBuffer(this.type,this.buffer)},gn.prototype.destroy=function(){Ba(this)};var ni=[];function Yi(hn,Nn){var Oi=ni.pop();return Oi||(Oi=new gn(hn)),Oi.bind(),Za(Oi,Nn,Hi,0,1,!1),Oi}function Ui(hn){ni.push(hn)}function va(hn,Nn,Oi){hn.byteLength=Nn.byteLength,_e.bufferData(hn.type,Nn,Oi)}function Za(hn,Nn,Oi,_i,Qn,Ma){var ca;if(hn.usage=Oi,Array.isArray(Nn)){if(hn.dtype=_i||rr,Nn.length>0){var Ua;if(Array.isArray(Nn[0])){ca=qn(Nn);for(var vi=1,ti=1;ti<ca.length;++ti)vi*=ca[ti];hn.dimension=vi,Ua=ii(Nn,ca,hn.dtype),va(hn,Ua,Oi),Ma?hn.persistentData=Ua:W.freeType(Ua)}else if(typeof Nn[0]=="number"){hn.dimension=Qn;var Sa=W.allocType(hn.dtype,Nn.length);Qr(Sa,Nn),va(hn,Sa,Oi),Ma?hn.persistentData=Sa:W.freeType(Sa)}else Kr(Nn[0])&&(hn.dimension=Nn[0].length,hn.dtype=_i||xr(Nn[0])||rr,Ua=ii(Nn,[Nn.length,Nn[0].length],hn.dtype),va(hn,Ua,Oi),Ma?hn.persistentData=Ua:W.freeType(Ua))}}else if(Kr(Nn))hn.dtype=_i||xr(Nn),hn.dimension=Qn,va(hn,Nn,Oi),Ma&&(hn.persistentData=new Uint8Array(new Uint8Array(Nn.buffer)));else if(rn(Nn)){ca=Nn.shape;var pa=Nn.stride,qi=Nn.offset,$i=0,_a=0,Po=0,wo=0;ca.length===1?($i=ca[0],_a=1,Po=pa[0],wo=0):ca.length===2&&($i=ca[0],_a=ca[1],Po=pa[0],wo=pa[1]),hn.dtype=_i||xr(Nn.data)||rr,hn.dimension=_a;var xa=W.allocType(hn.dtype,$i*_a);Cn(xa,Nn.data,$i,_a,Po,wo,qi),va(hn,xa,Oi),Ma?hn.persistentData=xa:W.freeType(xa)}else Nn instanceof ArrayBuffer&&(hn.dtype=We,hn.dimension=Qn,va(hn,Nn,Oi),Ma&&(hn.persistentData=new Uint8Array(new Uint8Array(Nn))))}function Ba(hn){kr.bufferCount--,Dn(hn);var Nn=hn.buffer;_e.deleteBuffer(Nn),hn.buffer=null,delete Jn[hn.id]}function ta(hn,Nn,Oi,_i){kr.bufferCount++;var Qn=new gn(Nn);Jn[Qn.id]=Qn;function Ma(vi){var ti=oa,Sa=null,pa=0,qi=0,$i=1;return Array.isArray(vi)||Kr(vi)||rn(vi)||vi instanceof ArrayBuffer?Sa=vi:typeof vi=="number"?pa=vi|0:vi&&("data"in vi&&(Sa=vi.data),"usage"in vi&&(ti=Ci[vi.usage]),"type"in vi&&(qi=Vn[vi.type]),"dimension"in vi&&($i=vi.dimension|0),"length"in vi&&(pa=vi.length|0)),Qn.bind(),Sa?Za(Qn,Sa,ti,qi,$i,_i):(pa&&_e.bufferData(Qn.type,pa,ti),Qn.dtype=qi||We,Qn.usage=ti,Qn.dimension=$i,Qn.byteLength=pa),Lr.profile&&(Qn.stats.size=Qn.byteLength*fr[Qn.dtype]),Ma}function ca(vi,ti){_e.bufferSubData(Qn.type,ti,vi)}function Ua(vi,ti){var Sa=(ti||0)|0,pa;if(Qn.bind(),Kr(vi)||vi instanceof ArrayBuffer)ca(vi,Sa);else if(Array.isArray(vi)){if(vi.length>0){if(typeof vi[0]=="number"){var qi=W.allocType(Qn.dtype,vi.length);Qr(qi,vi),ca(qi,Sa),W.freeType(qi)}else if(Array.isArray(vi[0])||Kr(vi[0])){pa=qn(vi);var $i=ii(vi,pa,Qn.dtype);ca($i,Sa),W.freeType($i)}}}else if(rn(vi)){pa=vi.shape;var _a=vi.stride,Po=0,wo=0,xa=0,Oa=0;pa.length===1?(Po=pa[0],wo=1,xa=_a[0],Oa=0):pa.length===2&&(Po=pa[0],wo=pa[1],xa=_a[0],Oa=_a[1]);var ho=Array.isArray(vi.data)?Qn.dtype:xr(vi.data),So=W.allocType(ho,Po*wo);Cn(So,vi.data,Po,wo,xa,Oa,vi.offset),ca(So,Sa),W.freeType(So)}return Ma}return Oi||Ma(hn),Ma._reglType="buffer",Ma._buffer=Qn,Ma.subdata=Ua,Lr.profile&&(Ma.stats=Qn.stats),Ma.destroy=function(){Ba(Qn)},Ma}function wi(){Ce(Jn).forEach(function(hn){hn.buffer=_e.createBuffer(),_e.bindBuffer(hn.type,hn.buffer),_e.bufferData(hn.type,hn.persistentData||hn.byteLength,hn.usage)})}return Lr.profile&&(kr.getTotalBufferSize=function(){var hn=0;return Object.keys(Jn).forEach(function(Nn){hn+=Jn[Nn].stats.size}),hn}),{create:ta,createStream:Yi,destroyStream:Ui,clear:function(){Ce(Jn).forEach(Ba),ni.forEach(Ba)},getBuffer:function(hn){return hn&&hn._buffer instanceof gn?hn._buffer:null},restore:wi,_initBuffer:Za}}var Mn=0,ci=0,xi=1,Pi=1,Di=4,Zi=4,ui={points:Mn,point:ci,lines:xi,line:Pi,triangles:Di,triangle:Zi,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Pa=0,Wa=1,ze=4,Pe=5120,Rr=5121,qr=5122,$r=5123,Br=5124,Gr=5125,dn=34963,an=35040,Ee=35044;function dr(_e,kr,Lr,Dn){var oi={},Jn=0,gn={uint8:Rr,uint16:$r};kr.oes_element_index_uint&&(gn.uint32=Gr);function ni(wi){this.id=Jn++,oi[this.id]=this,this.buffer=wi,this.primType=ze,this.vertCount=0,this.type=0}ni.prototype.bind=function(){this.buffer.bind()};var Yi=[];function Ui(wi){var hn=Yi.pop();return hn||(hn=new ni(Lr.create(null,dn,!0,!1)._buffer)),Za(hn,wi,an,-1,-1,0,0),hn}function va(wi){Yi.push(wi)}function Za(wi,hn,Nn,Oi,_i,Qn,Ma){wi.buffer.bind();var ca;if(hn){var Ua=Ma;!Ma&&(!Kr(hn)||rn(hn)&&!Kr(hn.data))&&(Ua=kr.oes_element_index_uint?Gr:$r),Lr._initBuffer(wi.buffer,hn,Nn,Ua,3)}else _e.bufferData(dn,Qn,Nn),wi.buffer.dtype=ca||Rr,wi.buffer.usage=Nn,wi.buffer.dimension=3,wi.buffer.byteLength=Qn;if(ca=Ma,!Ma){switch(wi.buffer.dtype){case Rr:case Pe:ca=Rr;break;case $r:case qr:ca=$r;break;case Gr:case Br:ca=Gr;break}wi.buffer.dtype=ca}wi.type=ca;var vi=_i;vi<0&&(vi=wi.buffer.byteLength,ca===$r?vi>>=1:ca===Gr&&(vi>>=2)),wi.vertCount=vi;var ti=Oi;if(Oi<0){ti=ze;var Sa=wi.buffer.dimension;Sa===1&&(ti=Pa),Sa===2&&(ti=Wa),Sa===3&&(ti=ze)}wi.primType=ti}function Ba(wi){Dn.elementsCount--,delete oi[wi.id],wi.buffer.destroy(),wi.buffer=null}function ta(wi,hn){var Nn=Lr.create(null,dn,!0),Oi=new ni(Nn._buffer);Dn.elementsCount++;function _i(Qn){if(!Qn)Nn(),Oi.primType=ze,Oi.vertCount=0,Oi.type=Rr;else if(typeof Qn=="number")Nn(Qn),Oi.primType=ze,Oi.vertCount=Qn|0,Oi.type=Rr;else{var Ma=null,ca=Ee,Ua=-1,vi=-1,ti=0,Sa=0;Array.isArray(Qn)||Kr(Qn)||rn(Qn)?Ma=Qn:("data"in Qn&&(Ma=Qn.data),"usage"in Qn&&(ca=Ci[Qn.usage]),"primitive"in Qn&&(Ua=ui[Qn.primitive]),"count"in Qn&&(vi=Qn.count|0),"type"in Qn&&(Sa=gn[Qn.type]),"length"in Qn?ti=Qn.length|0:(ti=vi,Sa===$r||Sa===qr?ti*=2:(Sa===Gr||Sa===Br)&&(ti*=4))),Za(Oi,Ma,ca,Ua,vi,ti,Sa)}return _i}return _i(wi),_i._reglType="elements",_i._elements=Oi,_i.subdata=function(Qn,Ma){return Nn.subdata(Qn,Ma),_i},_i.destroy=function(){Ba(Oi)},_i}return{create:ta,createStream:Ui,destroyStream:va,getElements:function(wi){return typeof wi=="function"&&wi._elements instanceof ni?wi._elements:null},clear:function(){Ce(oi).forEach(Ba)}}}var Vr=new Float32Array(1),yn=new Uint32Array(Vr.buffer),Fn=5123;function Xn(_e){for(var kr=W.allocType(Fn,_e.length),Lr=0;Lr<_e.length;++Lr)if(isNaN(_e[Lr]))kr[Lr]=65535;else if(_e[Lr]===1/0)kr[Lr]=31744;else if(_e[Lr]===-1/0)kr[Lr]=64512;else{Vr[0]=_e[Lr];var Dn=yn[0],oi=Dn>>>31<<15,Jn=(Dn<<1>>>24)-127,gn=Dn>>13&1023;if(Jn<-24)kr[Lr]=oi;else if(Jn<-14){var ni=-14-Jn;kr[Lr]=oi+(gn+1024>>ni)}else Jn>15?kr[Lr]=oi+31744:kr[Lr]=oi+(Jn+15<<10)+gn}return kr}function Pn(_e){return Array.isArray(_e)||Kr(_e)}var En=34467,Zn=3553,Ca=34067,Ri=34069,Ja=6408,Xa=6406,Io=6407,po=6409,Do=6410,Ia=32854,gs=32855,is=36194,ll=32819,Ho=32820,Gs=33635,as=34042,ul=6402,Js=34041,Rl=35904,ls=35906,Cs=36193,Co=33776,ks=33777,kl=33778,Vl=33779,Yl=35986,Ns=35987,La=34798,uo=35840,Hs=35841,Kl=35842,Go=35843,ql=36196,il=5121,Cl=5123,Fu=5125,ao=5126,Ts=10242,Ls=10243,nu=10497,cl=33071,Qo=33648,Mu=10240,Gu=10241,_l=9728,Ol=9729,Xl=9984,tu=9985,ac=9986,ph=9987,Jc=33170,ah=4352,Nf=4353,Sf=4354,Dl=34046,Bc=3317,jf=37440,hc=37441,oc=37443,fc=37444,oh=33984,su=[Xl,ac,tu,ph],sc=[0,po,Do,Io,Ja],el={};el[po]=el[Xa]=el[ul]=1,el[Js]=el[Do]=2,el[Io]=el[Rl]=3,el[Ja]=el[ls]=4;function Zl(_e){return"[object "+_e+"]"}var Mh=Zl("HTMLCanvasElement"),Lc=Zl("OffscreenCanvas"),jh=Zl("CanvasRenderingContext2D"),xu=Zl("ImageBitmap"),Cd=Zl("HTMLImageElement"),Qs=Zl("HTMLVideoElement"),Wd=Object.keys(le).concat([Mh,Lc,jh,xu,Cd,Qs]),Ll=[];Ll[il]=1,Ll[ao]=4,Ll[Cs]=2,Ll[Cl]=2,Ll[Fu]=4;var Jo=[];Jo[Ia]=2,Jo[gs]=2,Jo[is]=2,Jo[Js]=4,Jo[Co]=.5,Jo[ks]=.5,Jo[kl]=1,Jo[Vl]=1,Jo[Yl]=.5,Jo[Ns]=1,Jo[La]=1,Jo[uo]=.5,Jo[Hs]=.25,Jo[Kl]=.5,Jo[Go]=.25,Jo[ql]=.5;function lf(_e){return Array.isArray(_e)&&(_e.length===0||typeof _e[0]=="number")}function sh(_e){if(!Array.isArray(_e))return!1;var kr=_e.length;return!(kr===0||!Pn(_e[0]))}function ec(_e){return Object.prototype.toString.call(_e)}function Uf(_e){return ec(_e)===Mh}function Uh(_e){return ec(_e)===Lc}function yf(_e){return ec(_e)===jh}function lc(_e){return ec(_e)===xu}function hd(_e){return ec(_e)===Cd}function $f(_e){return ec(_e)===Qs}function xf(_e){if(!_e)return!1;var kr=ec(_e);return Wd.indexOf(kr)>=0?!0:lf(_e)||sh(_e)||rn(_e)}function Vh(_e){return le[Object.prototype.toString.call(_e)]|0}function Vf(_e,kr){var Lr=kr.length;switch(_e.type){case il:case Cl:case Fu:case ao:var Dn=W.allocType(_e.type,Lr);Dn.set(kr),_e.data=Dn;break;case Cs:_e.data=Xn(kr);break}}function Hf(_e,kr){return W.allocType(_e.type===Cs?ao:_e.type,kr)}function lh(_e,kr){_e.type===Cs?(_e.data=Xn(kr),W.freeType(kr)):_e.data=kr}function Gf(_e,kr,Lr,Dn,oi,Jn){for(var gn=_e.width,ni=_e.height,Yi=_e.channels,Ui=gn*ni*Yi,va=Hf(_e,Ui),Za=0,Ba=0;Ba<ni;++Ba)for(var ta=0;ta<gn;++ta)for(var wi=0;wi<Yi;++wi)va[Za++]=kr[Lr*ta+Dn*Ba+oi*wi+Jn];lh(_e,va)}function Sh(_e,kr,Lr,Dn,oi,Jn){var gn;if(typeof Jo[_e]<"u"?gn=Jo[_e]:gn=el[_e]*Ll[kr],Jn&&(gn*=6),oi){for(var ni=0,Yi=Lr;Yi>=1;)ni+=gn*Yi*Yi,Yi/=2;return ni}else return gn*Lr*Dn}function mh(_e,kr,Lr,Dn,oi,Jn,gn){var ni={"don't care":ah,"dont care":ah,nice:Sf,fast:Nf},Yi={repeat:nu,clamp:cl,mirror:Qo},Ui={nearest:_l,linear:Ol},va=c({mipmap:ph,"nearest mipmap nearest":Xl,"linear mipmap nearest":tu,"nearest mipmap linear":ac,"linear mipmap linear":ph},Ui),Za={none:0,browser:fc},Ba={uint8:il,rgba4:ll,rgb565:Gs,"rgb5 a1":Ho},ta={alpha:Xa,luminance:po,"luminance alpha":Do,rgb:Io,rgba:Ja,rgba4:Ia,"rgb5 a1":gs,rgb565:is},wi={};kr.ext_srgb&&(ta.srgb=Rl,ta.srgba=ls),kr.oes_texture_float&&(Ba.float32=Ba.float=ao),kr.oes_texture_half_float&&(Ba.float16=Ba["half float"]=Cs),kr.webgl_depth_texture&&(c(ta,{depth:ul,"depth stencil":Js}),c(Ba,{uint16:Cl,uint32:Fu,"depth stencil":as})),kr.webgl_compressed_texture_s3tc&&c(wi,{"rgb s3tc dxt1":Co,"rgba s3tc dxt1":ks,"rgba s3tc dxt3":kl,"rgba s3tc dxt5":Vl}),kr.webgl_compressed_texture_atc&&c(wi,{"rgb atc":Yl,"rgba atc explicit alpha":Ns,"rgba atc interpolated alpha":La}),kr.webgl_compressed_texture_pvrtc&&c(wi,{"rgb pvrtc 4bppv1":uo,"rgb pvrtc 2bppv1":Hs,"rgba pvrtc 4bppv1":Kl,"rgba pvrtc 2bppv1":Go}),kr.webgl_compressed_texture_etc1&&(wi["rgb etc1"]=ql);var hn=Array.prototype.slice.call(_e.getParameter(En));Object.keys(wi).forEach(function(Z){var ot=wi[Z];hn.indexOf(ot)>=0&&(ta[Z]=ot)});var Nn=Object.keys(ta);Lr.textureFormats=Nn;var Oi=[];Object.keys(ta).forEach(function(Z){var ot=ta[Z];Oi[ot]=Z});var _i=[];Object.keys(Ba).forEach(function(Z){var ot=Ba[Z];_i[ot]=Z});var Qn=[];Object.keys(Ui).forEach(function(Z){var ot=Ui[Z];Qn[ot]=Z});var Ma=[];Object.keys(va).forEach(function(Z){var ot=va[Z];Ma[ot]=Z});var ca=[];Object.keys(Yi).forEach(function(Z){var ot=Yi[Z];ca[ot]=Z});var Ua=Nn.reduce(function(Z,ot){var et=ta[ot];return et===po||et===Xa||et===po||et===Do||et===ul||et===Js||kr.ext_srgb&&(et===Rl||et===ls)?Z[et]=et:et===gs||ot.indexOf("rgba")>=0?Z[et]=Ja:Z[et]=Io,Z},{});function vi(){this.internalformat=Ja,this.format=Ja,this.type=il,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=fc,this.width=0,this.height=0,this.channels=0}function ti(Z,ot){Z.internalformat=ot.internalformat,Z.format=ot.format,Z.type=ot.type,Z.compressed=ot.compressed,Z.premultiplyAlpha=ot.premultiplyAlpha,Z.flipY=ot.flipY,Z.unpackAlignment=ot.unpackAlignment,Z.colorSpace=ot.colorSpace,Z.width=ot.width,Z.height=ot.height,Z.channels=ot.channels}function Sa(Z,ot){if(!(typeof ot!="object"||!ot)){if("premultiplyAlpha"in ot&&(Z.premultiplyAlpha=ot.premultiplyAlpha),"flipY"in ot&&(Z.flipY=ot.flipY),"alignment"in ot&&(Z.unpackAlignment=ot.alignment),"colorSpace"in ot&&(Z.colorSpace=Za[ot.colorSpace]),"type"in ot){var et=ot.type;Z.type=Ba[et]}var xt=Z.width,Ut=Z.height,fe=Z.channels,ye=!1;"shape"in ot?(xt=ot.shape[0],Ut=ot.shape[1],ot.shape.length===3&&(fe=ot.shape[2],ye=!0)):("radius"in ot&&(xt=Ut=ot.radius),"width"in ot&&(xt=ot.width),"height"in ot&&(Ut=ot.height),"channels"in ot&&(fe=ot.channels,ye=!0)),Z.width=xt|0,Z.height=Ut|0,Z.channels=fe|0;var Yt=!1;if("format"in ot){var ce=ot.format,Se=Z.internalformat=ta[ce];Z.format=Ua[Se],ce in Ba&&("type"in ot||(Z.type=Ba[ce])),ce in wi&&(Z.compressed=!0),Yt=!0}!ye&&Yt?Z.channels=el[Z.format]:ye&&!Yt&&Z.channels!==sc[Z.format]&&(Z.format=Z.internalformat=sc[Z.channels])}}function pa(Z){_e.pixelStorei(jf,Z.flipY),_e.pixelStorei(hc,Z.premultiplyAlpha),_e.pixelStorei(oc,Z.colorSpace),_e.pixelStorei(Bc,Z.unpackAlignment)}function qi(){vi.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function $i(Z,ot){var et=null;if(xf(ot)?et=ot:ot&&(Sa(Z,ot),"x"in ot&&(Z.xOffset=ot.x|0),"y"in ot&&(Z.yOffset=ot.y|0),xf(ot.data)&&(et=ot.data)),ot.copy){var xt=oi.viewportWidth,Ut=oi.viewportHeight;Z.width=Z.width||xt-Z.xOffset,Z.height=Z.height||Ut-Z.yOffset,Z.needsCopy=!0}else if(!et)Z.width=Z.width||1,Z.height=Z.height||1,Z.channels=Z.channels||4;else if(Kr(et))Z.channels=Z.channels||4,Z.data=et,!("type"in ot)&&Z.type===il&&(Z.type=Vh(et));else if(lf(et))Z.channels=Z.channels||4,Vf(Z,et),Z.alignment=1,Z.needsFree=!0;else if(rn(et)){var fe=et.data;!Array.isArray(fe)&&Z.type===il&&(Z.type=Vh(fe));var ye=et.shape,Yt=et.stride,ce,Se,nr,Ye,tr,lr;ye.length===3?(nr=ye[2],lr=Yt[2]):(nr=1,lr=1),ce=ye[0],Se=ye[1],Ye=Yt[0],tr=Yt[1],Z.alignment=1,Z.width=ce,Z.height=Se,Z.channels=nr,Z.format=Z.internalformat=sc[nr],Z.needsFree=!0,Gf(Z,fe,Ye,tr,lr,et.offset)}else if(Uf(et)||Uh(et)||yf(et))Uf(et)||Uh(et)?Z.element=et:Z.element=et.canvas,Z.width=Z.element.width,Z.height=Z.element.height,Z.channels=4;else if(lc(et))Z.element=et,Z.width=et.width,Z.height=et.height,Z.channels=4;else if(hd(et))Z.element=et,Z.width=et.naturalWidth,Z.height=et.naturalHeight,Z.channels=4;else if($f(et))Z.element=et,Z.width=et.videoWidth,Z.height=et.videoHeight,Z.channels=4;else if(sh(et)){var hr=Z.width||et[0].length,Ve=Z.height||et.length,Xe=Z.channels;Pn(et[0][0])?Xe=Xe||et[0][0].length:Xe=Xe||1;for(var $e=$t.shape(et),Cr=1,on=0;on<$e.length;++on)Cr*=$e[on];var fn=Hf(Z,Cr);$t.flatten(et,$e,"",fn),lh(Z,fn),Z.alignment=1,Z.width=hr,Z.height=Ve,Z.channels=Xe,Z.format=Z.internalformat=sc[Xe],Z.needsFree=!0}Z.type===ao||Z.type}function _a(Z,ot,et){var xt=Z.element,Ut=Z.data,fe=Z.internalformat,ye=Z.format,Yt=Z.type,ce=Z.width,Se=Z.height;pa(Z),xt?_e.texImage2D(ot,et,ye,ye,Yt,xt):Z.compressed?_e.compressedTexImage2D(ot,et,fe,ce,Se,0,Ut):Z.needsCopy?(Dn(),_e.copyTexImage2D(ot,et,ye,Z.xOffset,Z.yOffset,ce,Se,0)):_e.texImage2D(ot,et,ye,ce,Se,0,ye,Yt,Ut||null)}function Po(Z,ot,et,xt,Ut){var fe=Z.element,ye=Z.data,Yt=Z.internalformat,ce=Z.format,Se=Z.type,nr=Z.width,Ye=Z.height;pa(Z),fe?_e.texSubImage2D(ot,Ut,et,xt,ce,Se,fe):Z.compressed?_e.compressedTexSubImage2D(ot,Ut,et,xt,Yt,nr,Ye,ye):Z.needsCopy?(Dn(),_e.copyTexSubImage2D(ot,Ut,et,xt,Z.xOffset,Z.yOffset,nr,Ye)):_e.texSubImage2D(ot,Ut,et,xt,nr,Ye,ce,Se,ye)}var wo=[];function xa(){return wo.pop()||new qi}function Oa(Z){Z.needsFree&&W.freeType(Z.data),qi.call(Z),wo.push(Z)}function ho(){vi.call(this),this.genMipmaps=!1,this.mipmapHint=ah,this.mipmask=0,this.images=Array(16)}function So(Z,ot,et){var xt=Z.images[0]=xa();Z.mipmask=1,xt.width=Z.width=ot,xt.height=Z.height=et,xt.channels=Z.channels=4}function ts(Z,ot){var et=null;if(xf(ot))et=Z.images[0]=xa(),ti(et,Z),$i(et,ot),Z.mipmask=1;else if(Sa(Z,ot),Array.isArray(ot.mipmap))for(var xt=ot.mipmap,Ut=0;Ut<xt.length;++Ut)et=Z.images[Ut]=xa(),ti(et,Z),et.width>>=Ut,et.height>>=Ut,$i(et,xt[Ut]),Z.mipmask|=1<<Ut;else et=Z.images[0]=xa(),ti(et,Z),$i(et,ot),Z.mipmask=1;ti(Z,Z.images[0]),Z.compressed&&(Z.internalformat===Co||Z.internalformat===ks||Z.internalformat===kl||Z.internalformat)}function Nl(Z,ot){for(var et=Z.images,xt=0;xt<et.length;++xt){if(!et[xt])return;_a(et[xt],ot,xt)}}var Al=[];function us(){var Z=Al.pop()||new ho;vi.call(Z),Z.mipmask=0;for(var ot=0;ot<16;++ot)Z.images[ot]=null;return Z}function wu(Z){for(var ot=Z.images,et=0;et<ot.length;++et)ot[et]&&Oa(ot[et]),ot[et]=null;Al.push(Z)}function fl(){this.minFilter=_l,this.magFilter=_l,this.wrapS=cl,this.wrapT=cl,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=ah}function Eu(Z,ot){if("min"in ot){var et=ot.min;Z.minFilter=va[et],su.indexOf(Z.minFilter)>=0&&!("faces"in ot)&&(Z.genMipmaps=!0)}if("mag"in ot){var xt=ot.mag;Z.magFilter=Ui[xt]}var Ut=Z.wrapS,fe=Z.wrapT;if("wrap"in ot){var ye=ot.wrap;typeof ye=="string"?Ut=fe=Yi[ye]:Array.isArray(ye)&&(Ut=Yi[ye[0]],fe=Yi[ye[1]])}else{if("wrapS"in ot){var Yt=ot.wrapS;Ut=Yi[Yt]}if("wrapT"in ot){var ce=ot.wrapT;fe=Yi[ce]}}if(Z.wrapS=Ut,Z.wrapT=fe,"anisotropic"in ot&&(ot.anisotropic,Z.anisotropic=ot.anisotropic),"mipmap"in ot){var Se=!1;switch(typeof ot.mipmap){case"string":Z.mipmapHint=ni[ot.mipmap],Z.genMipmaps=!0,Se=!0;break;case"boolean":Se=Z.genMipmaps=ot.mipmap;break;case"object":Z.genMipmaps=!1,Se=!0;break}Se&&!("min"in ot)&&(Z.minFilter=Xl)}}function pc(Z,ot){_e.texParameteri(ot,Gu,Z.minFilter),_e.texParameteri(ot,Mu,Z.magFilter),_e.texParameteri(ot,Ts,Z.wrapS),_e.texParameteri(ot,Ls,Z.wrapT),kr.ext_texture_filter_anisotropic&&_e.texParameteri(ot,Dl,Z.anisotropic),Z.genMipmaps&&(_e.hint(Jc,Z.mipmapHint),_e.generateMipmap(ot))}var yc=0,yu={},hu=Lr.maxTextureUnits,ku=Array(hu).map(function(){return null});function Bo(Z){vi.call(this),this.mipmask=0,this.internalformat=Ja,this.id=yc++,this.refCount=1,this.target=Z,this.texture=_e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new fl,gn.profile&&(this.stats={size:0})}function Tu(Z){_e.activeTexture(oh),_e.bindTexture(Z.target,Z.texture)}function ol(){var Z=ku[0];Z?_e.bindTexture(Z.target,Z.texture):_e.bindTexture(Zn,null)}function Cu(Z){var ot=Z.texture,et=Z.unit,xt=Z.target;et>=0&&(_e.activeTexture(oh+et),_e.bindTexture(xt,null),ku[et]=null),_e.deleteTexture(ot),Z.texture=null,Z.params=null,Z.pixels=null,Z.refCount=0,delete yu[Z.id],Jn.textureCount--}c(Bo.prototype,{bind:function(){var Z=this;Z.bindCount+=1;var ot=Z.unit;if(ot<0){for(var et=0;et<hu;++et){var xt=ku[et];if(xt){if(xt.bindCount>0)continue;xt.unit=-1}ku[et]=Z,ot=et;break}gn.profile&&Jn.maxTextureUnits<ot+1&&(Jn.maxTextureUnits=ot+1),Z.unit=ot,_e.activeTexture(oh+ot),_e.bindTexture(Z.target,Z.texture)}return ot},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Cu(this)}});function xc(Z,ot){var et=new Bo(Zn);yu[et.id]=et,Jn.textureCount++;function xt(ye,Yt){var ce=et.texInfo;fl.call(ce);var Se=us();return typeof ye=="number"?typeof Yt=="number"?So(Se,ye|0,Yt|0):So(Se,ye|0,ye|0):ye?(Eu(ce,ye),ts(Se,ye)):So(Se,1,1),ce.genMipmaps&&(Se.mipmask=(Se.width<<1)-1),et.mipmask=Se.mipmask,ti(et,Se),et.internalformat=Se.internalformat,xt.width=Se.width,xt.height=Se.height,Tu(et),Nl(Se,Zn),pc(ce,Zn),ol(),wu(Se),gn.profile&&(et.stats.size=Sh(et.internalformat,et.type,Se.width,Se.height,ce.genMipmaps,!1)),xt.format=Oi[et.internalformat],xt.type=_i[et.type],xt.mag=Qn[ce.magFilter],xt.min=Ma[ce.minFilter],xt.wrapS=ca[ce.wrapS],xt.wrapT=ca[ce.wrapT],xt}function Ut(ye,Yt,ce,Se){var nr=Yt|0,Ye=ce|0,tr=Se|0,lr=xa();return ti(lr,et),lr.width=0,lr.height=0,$i(lr,ye),lr.width=lr.width||(et.width>>tr)-nr,lr.height=lr.height||(et.height>>tr)-Ye,Tu(et),Po(lr,Zn,nr,Ye,tr),ol(),Oa(lr),xt}function fe(ye,Yt){var ce=ye|0,Se=Yt|0||ce;if(ce===et.width&&Se===et.height)return xt;xt.width=et.width=ce,xt.height=et.height=Se,Tu(et);for(var nr=0;et.mipmask>>nr;++nr){var Ye=ce>>nr,tr=Se>>nr;if(!Ye||!tr)break;_e.texImage2D(Zn,nr,et.format,Ye,tr,0,et.format,et.type,null)}return ol(),gn.profile&&(et.stats.size=Sh(et.internalformat,et.type,ce,Se,!1,!1)),xt}return xt(Z,ot),xt.subimage=Ut,xt.resize=fe,xt._reglType="texture2d",xt._texture=et,gn.profile&&(xt.stats=et.stats),xt.destroy=function(){et.decRef()},xt}function Eo(Z,ot,et,xt,Ut,fe){var ye=new Bo(Ca);yu[ye.id]=ye,Jn.cubeCount++;var Yt=new Array(6);function ce(Ye,tr,lr,hr,Ve,Xe){var $e,Cr=ye.texInfo;for(fl.call(Cr),$e=0;$e<6;++$e)Yt[$e]=us();if(typeof Ye=="number"||!Ye){var on=Ye|0||1;for($e=0;$e<6;++$e)So(Yt[$e],on,on)}else if(typeof Ye=="object")if(tr)ts(Yt[0],Ye),ts(Yt[1],tr),ts(Yt[2],lr),ts(Yt[3],hr),ts(Yt[4],Ve),ts(Yt[5],Xe);else if(Eu(Cr,Ye),Sa(ye,Ye),"faces"in Ye){var fn=Ye.faces;for($e=0;$e<6;++$e)ti(Yt[$e],ye),ts(Yt[$e],fn[$e])}else for($e=0;$e<6;++$e)ts(Yt[$e],Ye);for(ti(ye,Yt[0]),Cr.genMipmaps?ye.mipmask=(Yt[0].width<<1)-1:ye.mipmask=Yt[0].mipmask,ye.internalformat=Yt[0].internalformat,ce.width=Yt[0].width,ce.height=Yt[0].height,Tu(ye),$e=0;$e<6;++$e)Nl(Yt[$e],Ri+$e);for(pc(Cr,Ca),ol(),gn.profile&&(ye.stats.size=Sh(ye.internalformat,ye.type,ce.width,ce.height,Cr.genMipmaps,!0)),ce.format=Oi[ye.internalformat],ce.type=_i[ye.type],ce.mag=Qn[Cr.magFilter],ce.min=Ma[Cr.minFilter],ce.wrapS=ca[Cr.wrapS],ce.wrapT=ca[Cr.wrapT],$e=0;$e<6;++$e)wu(Yt[$e]);return ce}function Se(Ye,tr,lr,hr,Ve){var Xe=lr|0,$e=hr|0,Cr=Ve|0,on=xa();return ti(on,ye),on.width=0,on.height=0,$i(on,tr),on.width=on.width||(ye.width>>Cr)-Xe,on.height=on.height||(ye.height>>Cr)-$e,Tu(ye),Po(on,Ri+Ye,Xe,$e,Cr),ol(),Oa(on),ce}function nr(Ye){var tr=Ye|0;if(tr!==ye.width){ce.width=ye.width=tr,ce.height=ye.height=tr,Tu(ye);for(var lr=0;lr<6;++lr)for(var hr=0;ye.mipmask>>hr;++hr)_e.texImage2D(Ri+lr,hr,ye.format,tr>>hr,tr>>hr,0,ye.format,ye.type,null);return ol(),gn.profile&&(ye.stats.size=Sh(ye.internalformat,ye.type,ce.width,ce.height,!1,!0)),ce}}return ce(Z,ot,et,xt,Ut,fe),ce.subimage=Se,ce.resize=nr,ce._reglType="textureCube",ce._texture=ye,gn.profile&&(ce.stats=ye.stats),ce.destroy=function(){ye.decRef()},ce}function Ss(){for(var Z=0;Z<hu;++Z)_e.activeTexture(oh+Z),_e.bindTexture(Zn,null),ku[Z]=null;Ce(yu).forEach(Cu),Jn.cubeCount=0,Jn.textureCount=0}gn.profile&&(Jn.getTotalTextureSize=function(){var Z=0;return Object.keys(yu).forEach(function(ot){Z+=yu[ot].stats.size}),Z});function Ml(){for(var Z=0;Z<hu;++Z){var ot=ku[Z];ot&&(ot.bindCount=0,ot.unit=-1,ku[Z]=null)}Ce(yu).forEach(function(et){et.texture=_e.createTexture(),_e.bindTexture(et.target,et.texture);for(var xt=0;xt<32;++xt)if((et.mipmask&1<<xt)!==0)if(et.target===Zn)_e.texImage2D(Zn,xt,et.internalformat,et.width>>xt,et.height>>xt,0,et.internalformat,et.type,null);else for(var Ut=0;Ut<6;++Ut)_e.texImage2D(Ri+Ut,xt,et.internalformat,et.width>>xt,et.height>>xt,0,et.internalformat,et.type,null);pc(et.texInfo,et.target)})}function yl(){for(var Z=0;Z<hu;++Z){var ot=ku[Z];ot&&(ot.bindCount=0,ot.unit=-1,ku[Z]=null),_e.activeTexture(oh+Z),_e.bindTexture(Zn,null),_e.bindTexture(Ca,null)}}return{create2D:xc,createCube:Eo,clear:Ss,getTexture:function(Z){return null},restore:Ml,refresh:yl}}var uc=36161,ef=32854,Wf=32855,Jl=36194,Ef=33189,Ld=36168,Yf=34041,_f=35907,Kf=34836,Nc=34842,Xf=34843,zu=[];zu[ef]=2,zu[Wf]=2,zu[Jl]=2,zu[Ef]=2,zu[Ld]=1,zu[Yf]=4,zu[_f]=4,zu[Kf]=16,zu[Nc]=8,zu[Xf]=6;function jc(_e,kr,Lr){return zu[_e]*kr*Lr}var Hh=function(_e,kr,Lr,Dn,oi){var Jn={rgba4:ef,rgb565:Jl,"rgb5 a1":Wf,depth:Ef,stencil:Ld,"depth stencil":Yf};kr.ext_srgb&&(Jn.srgba=_f),kr.ext_color_buffer_half_float&&(Jn.rgba16f=Nc,Jn.rgb16f=Xf),kr.webgl_color_buffer_float&&(Jn.rgba32f=Kf);var gn=[];Object.keys(Jn).forEach(function(ta){var wi=Jn[ta];gn[wi]=ta});var ni=0,Yi={};function Ui(ta){this.id=ni++,this.refCount=1,this.renderbuffer=ta,this.format=ef,this.width=0,this.height=0,oi.profile&&(this.stats={size:0})}Ui.prototype.decRef=function(){--this.refCount<=0&&va(this)};function va(ta){var wi=ta.renderbuffer;_e.bindRenderbuffer(uc,null),_e.deleteRenderbuffer(wi),ta.renderbuffer=null,ta.refCount=0,delete Yi[ta.id],Dn.renderbufferCount--}function Za(ta,wi){var hn=new Ui(_e.createRenderbuffer());Yi[hn.id]=hn,Dn.renderbufferCount++;function Nn(_i,Qn){var Ma=0,ca=0,Ua=ef;if(typeof _i=="object"&&_i){var vi=_i;if("shape"in vi){var ti=vi.shape;Ma=ti[0]|0,ca=ti[1]|0}else"radius"in vi&&(Ma=ca=vi.radius|0),"width"in vi&&(Ma=vi.width|0),"height"in vi&&(ca=vi.height|0);"format"in vi&&(Ua=Jn[vi.format])}else typeof _i=="number"?(Ma=_i|0,typeof Qn=="number"?ca=Qn|0:ca=Ma):_i||(Ma=ca=1);if(!(Ma===hn.width&&ca===hn.height&&Ua===hn.format))return Nn.width=hn.width=Ma,Nn.height=hn.height=ca,hn.format=Ua,_e.bindRenderbuffer(uc,hn.renderbuffer),_e.renderbufferStorage(uc,Ua,Ma,ca),oi.profile&&(hn.stats.size=jc(hn.format,hn.width,hn.height)),Nn.format=gn[hn.format],Nn}function Oi(_i,Qn){var Ma=_i|0,ca=Qn|0||Ma;return Ma===hn.width&&ca===hn.height||(Nn.width=hn.width=Ma,Nn.height=hn.height=ca,_e.bindRenderbuffer(uc,hn.renderbuffer),_e.renderbufferStorage(uc,hn.format,Ma,ca),oi.profile&&(hn.stats.size=jc(hn.format,hn.width,hn.height))),Nn}return Nn(ta,wi),Nn.resize=Oi,Nn._reglType="renderbuffer",Nn._renderbuffer=hn,oi.profile&&(Nn.stats=hn.stats),Nn.destroy=function(){hn.decRef()},Nn}oi.profile&&(Dn.getTotalRenderbufferSize=function(){var ta=0;return Object.keys(Yi).forEach(function(wi){ta+=Yi[wi].stats.size}),ta});function Ba(){Ce(Yi).forEach(function(ta){ta.renderbuffer=_e.createRenderbuffer(),_e.bindRenderbuffer(uc,ta.renderbuffer),_e.renderbufferStorage(uc,ta.format,ta.width,ta.height)}),_e.bindRenderbuffer(uc,null)}return{create:Za,clear:function(){Ce(Yi).forEach(va)},restore:Ba}},lu=36160,Eh=36161,Sc=3553,Uc=34069,_u=36064,uf=36096,gh=36128,Wh=33306,Cf=36193,Pd=5121,Qd=5126,cf=6407,Lf=6408,wc=[];wc[Lf]=4,wc[cf]=3;var hf=[];hf[Pd]=1,hf[Qd]=4,hf[Cf]=2;function Qc(_e,kr,Lr,Dn,oi,Jn){var gn={cur:null,next:null,dirty:!1,setFBO:null},ni=["rgba"],Yi=["rgba4","rgb565","rgb5 a1"];kr.ext_srgb&&Yi.push("srgba"),kr.ext_color_buffer_half_float&&Yi.push("rgba16f","rgb16f"),kr.webgl_color_buffer_float&&Yi.push("rgba32f");var Ui=["uint8"];kr.oes_texture_half_float&&Ui.push("half float","float16"),kr.oes_texture_float&&Ui.push("float","float32");function va(qi,$i,_a){this.target=qi,this.texture=$i,this.renderbuffer=_a;var Po=0,wo=0;$i?(Po=$i.width,wo=$i.height):_a&&(Po=_a.width,wo=_a.height),this.width=Po,this.height=wo}function Za(qi){qi&&(qi.texture&&qi.texture._texture.decRef(),qi.renderbuffer&&qi.renderbuffer._renderbuffer.decRef())}function Ba(qi,$i,_a){if(qi)if(qi.texture){var Po=qi.texture._texture;Math.max(1,Po.width),Math.max(1,Po.height),Po.refCount+=1}else{var wo=qi.renderbuffer._renderbuffer;wo.refCount+=1}}function ta(qi,$i){$i&&($i.texture?_e.framebufferTexture2D(lu,qi,$i.target,$i.texture._texture.texture,0):_e.framebufferRenderbuffer(lu,qi,Eh,$i.renderbuffer._renderbuffer.renderbuffer))}function wi(qi){var $i=Sc,_a=null,Po=null,wo=qi;typeof qi=="object"&&(wo=qi.data,"target"in qi&&($i=qi.target|0));var xa=wo._reglType;return xa==="texture2d"||xa==="textureCube"?_a=wo:xa==="renderbuffer"&&(Po=wo,$i=Eh),new va($i,_a,Po)}function hn(qi,$i,_a,Po,wo){if(_a){var xa=Dn.create2D({width:qi,height:$i,format:Po,type:wo});return xa._texture.refCount=0,new va(Sc,xa,null)}else{var Oa=oi.create({width:qi,height:$i,format:Po});return Oa._renderbuffer.refCount=0,new va(Eh,null,Oa)}}function Nn(qi){return qi&&(qi.texture||qi.renderbuffer)}function Oi(qi,$i,_a){qi&&(qi.texture?qi.texture.resize($i,_a):qi.renderbuffer&&qi.renderbuffer.resize($i,_a),qi.width=$i,qi.height=_a)}var _i=0,Qn={};function Ma(){this.id=_i++,Qn[this.id]=this,this.framebuffer=_e.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function ca(qi){qi.colorAttachments.forEach(Za),Za(qi.depthAttachment),Za(qi.stencilAttachment),Za(qi.depthStencilAttachment)}function Ua(qi){var $i=qi.framebuffer;_e.deleteFramebuffer($i),qi.framebuffer=null,Jn.framebufferCount--,delete Qn[qi.id]}function vi(qi){var $i;_e.bindFramebuffer(lu,qi.framebuffer);var _a=qi.colorAttachments;for($i=0;$i<_a.length;++$i)ta(_u+$i,_a[$i]);for($i=_a.length;$i<Lr.maxColorAttachments;++$i)_e.framebufferTexture2D(lu,_u+$i,Sc,null,0);_e.framebufferTexture2D(lu,Wh,Sc,null,0),_e.framebufferTexture2D(lu,uf,Sc,null,0),_e.framebufferTexture2D(lu,gh,Sc,null,0),ta(uf,qi.depthAttachment),ta(gh,qi.stencilAttachment),ta(Wh,qi.depthStencilAttachment),_e.checkFramebufferStatus(lu),_e.isContextLost(),_e.bindFramebuffer(lu,gn.next?gn.next.framebuffer:null),gn.cur=gn.next,_e.getError()}function ti(qi,$i){var _a=new Ma;Jn.framebufferCount++;function Po(xa,Oa){var ho,So=0,ts=0,Nl=!0,Al=!0,us=null,wu=!0,fl="rgba",Eu="uint8",pc=1,yc=null,yu=null,hu=null,ku=!1;if(typeof xa=="number")So=xa|0,ts=Oa|0||So;else if(!xa)So=ts=1;else{var Bo=xa;if("shape"in Bo){var Tu=Bo.shape;So=Tu[0],ts=Tu[1]}else"radius"in Bo&&(So=ts=Bo.radius),"width"in Bo&&(So=Bo.width),"height"in Bo&&(ts=Bo.height);("color"in Bo||"colors"in Bo)&&(us=Bo.color||Bo.colors,Array.isArray(us)),us||("colorCount"in Bo&&(pc=Bo.colorCount|0),"colorTexture"in Bo&&(wu=!!Bo.colorTexture,fl="rgba4"),"colorType"in Bo&&(Eu=Bo.colorType,wu||(Eu==="half float"||Eu==="float16"?fl="rgba16f":(Eu==="float"||Eu==="float32")&&(fl="rgba32f"))),"colorFormat"in Bo&&(fl=Bo.colorFormat,ni.indexOf(fl)>=0?wu=!0:Yi.indexOf(fl)>=0&&(wu=!1))),("depthTexture"in Bo||"depthStencilTexture"in Bo)&&(ku=!!(Bo.depthTexture||Bo.depthStencilTexture)),"depth"in Bo&&(typeof Bo.depth=="boolean"?Nl=Bo.depth:(yc=Bo.depth,Al=!1)),"stencil"in Bo&&(typeof Bo.stencil=="boolean"?Al=Bo.stencil:(yu=Bo.stencil,Nl=!1)),"depthStencil"in Bo&&(typeof Bo.depthStencil=="boolean"?Nl=Al=Bo.depthStencil:(hu=Bo.depthStencil,Nl=!1,Al=!1))}var ol=null,Cu=null,xc=null,Eo=null;if(Array.isArray(us))ol=us.map(wi);else if(us)ol=[wi(us)];else for(ol=new Array(pc),ho=0;ho<pc;++ho)ol[ho]=hn(So,ts,wu,fl,Eu);for(So=So||ol[0].width,ts=ts||ol[0].height,yc?Cu=wi(yc):Nl&&!Al&&(Cu=hn(So,ts,ku,"depth","uint32")),yu?xc=wi(yu):Al&&!Nl&&(xc=hn(So,ts,!1,"stencil","uint8")),hu?Eo=wi(hu):!yc&&!yu&&Al&&Nl&&(Eo=hn(So,ts,ku,"depth stencil","depth stencil")),ho=0;ho<ol.length;++ho)Ba(ol[ho]),ol[ho]&&ol[ho].texture&&wc[ol[ho].texture._texture.format]*hf[ol[ho].texture._texture.type];return Ba(Cu),Ba(xc),Ba(Eo),ca(_a),_a.width=So,_a.height=ts,_a.colorAttachments=ol,_a.depthAttachment=Cu,_a.stencilAttachment=xc,_a.depthStencilAttachment=Eo,Po.color=ol.map(Nn),Po.depth=Nn(Cu),Po.stencil=Nn(xc),Po.depthStencil=Nn(Eo),Po.width=_a.width,Po.height=_a.height,vi(_a),Po}function wo(xa,Oa){var ho=Math.max(xa|0,1),So=Math.max(Oa|0||ho,1);if(ho===_a.width&&So===_a.height)return Po;for(var ts=_a.colorAttachments,Nl=0;Nl<ts.length;++Nl)Oi(ts[Nl],ho,So);return Oi(_a.depthAttachment,ho,So),Oi(_a.stencilAttachment,ho,So),Oi(_a.depthStencilAttachment,ho,So),_a.width=Po.width=ho,_a.height=Po.height=So,vi(_a),Po}return Po(qi,$i),c(Po,{resize:wo,_reglType:"framebuffer",_framebuffer:_a,destroy:function(){Ua(_a),ca(_a)},use:function(xa){gn.setFBO({framebuffer:Po},xa)}})}function Sa(qi){var $i=Array(6);function _a(wo){var xa,Oa={color:null},ho=0,So=null,ts="rgba",Nl="uint8",Al=1;if(typeof wo=="number")ho=wo|0;else if(!wo)ho=1;else{var us=wo;if("shape"in us){var wu=us.shape;ho=wu[0]}else"radius"in us&&(ho=us.radius|0),"width"in us?(ho=us.width|0,"height"in us):"height"in us&&(ho=us.height|0);("color"in us||"colors"in us)&&(So=us.color||us.colors,Array.isArray(So)),So||("colorCount"in us&&(Al=us.colorCount|0),"colorType"in us&&(Nl=us.colorType),"colorFormat"in us&&(ts=us.colorFormat)),"depth"in us&&(Oa.depth=us.depth),"stencil"in us&&(Oa.stencil=us.stencil),"depthStencil"in us&&(Oa.depthStencil=us.depthStencil)}var fl;if(So)if(Array.isArray(So))for(fl=[],xa=0;xa<So.length;++xa)fl[xa]=So[xa];else fl=[So];else{fl=Array(Al);var Eu={radius:ho,format:ts,type:Nl};for(xa=0;xa<Al;++xa)fl[xa]=Dn.createCube(Eu)}for(Oa.color=Array(fl.length),xa=0;xa<fl.length;++xa){var pc=fl[xa];ho=ho||pc.width,Oa.color[xa]={target:Uc,data:fl[xa]}}for(xa=0;xa<6;++xa){for(var yc=0;yc<fl.length;++yc)Oa.color[yc].target=Uc+xa;xa>0&&(Oa.depth=$i[0].depth,Oa.stencil=$i[0].stencil,Oa.depthStencil=$i[0].depthStencil),$i[xa]?$i[xa](Oa):$i[xa]=ti(Oa)}return c(_a,{width:ho,height:ho,color:fl})}function Po(wo){var xa,Oa=wo|0;if(Oa===_a.width)return _a;var ho=_a.color;for(xa=0;xa<ho.length;++xa)ho[xa].resize(Oa);for(xa=0;xa<6;++xa)$i[xa].resize(Oa);return _a.width=_a.height=Oa,_a}return _a(qi),c(_a,{faces:$i,resize:Po,_reglType:"framebufferCube",destroy:function(){$i.forEach(function(wo){wo.destroy()})}})}function pa(){gn.cur=null,gn.next=null,gn.dirty=!0,Ce(Qn).forEach(function(qi){qi.framebuffer=_e.createFramebuffer(),vi(qi)})}return c(gn,{getFramebuffer:function(qi){if(typeof qi=="function"&&qi._reglType==="framebuffer"){var $i=qi._framebuffer;if($i instanceof Ma)return $i}return null},create:ti,createCube:Sa,clear:function(){Ce(Qn).forEach(Ua)},restore:pa})}var ff=5126,Pf=34962,vh=34963;function bu(){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=ff,this.offset=0,this.stride=0,this.divisor=0}function Ch(_e,kr,Lr,Dn,oi,Jn,gn){for(var ni=Lr.maxAttributes,Yi=new Array(ni),Ui=0;Ui<ni;++Ui)Yi[Ui]=new bu;var va=0,Za={},Ba={Record:bu,scope:{},state:Yi,currentVAO:null,targetVAO:null,restore:wi()?ca:function(){},createVAO:Ua,getVAO:Nn,destroyBuffer:ta,setVAO:wi()?Oi:_i,clear:wi()?Qn:function(){}};function ta(vi){for(var ti=0;ti<Yi.length;++ti){var Sa=Yi[ti];Sa.buffer===vi&&(_e.disableVertexAttribArray(ti),Sa.buffer=null)}}function wi(){return kr.oes_vertex_array_object}function hn(){return kr.angle_instanced_arrays}function Nn(vi){return typeof vi=="function"&&vi._vao?vi._vao:null}function Oi(vi){if(vi!==Ba.currentVAO){var ti=wi();vi?ti.bindVertexArrayOES(vi.vao):ti.bindVertexArrayOES(null),Ba.currentVAO=vi}}function _i(vi){if(vi!==Ba.currentVAO){if(vi)vi.bindAttrs();else{for(var ti=hn(),Sa=0;Sa<Yi.length;++Sa){var pa=Yi[Sa];pa.buffer?(_e.enableVertexAttribArray(Sa),pa.buffer.bind(),_e.vertexAttribPointer(Sa,pa.size,pa.type,pa.normalized,pa.stride,pa.offfset),ti&&pa.divisor&&ti.vertexAttribDivisorANGLE(Sa,pa.divisor)):(_e.disableVertexAttribArray(Sa),_e.vertexAttrib4f(Sa,pa.x,pa.y,pa.z,pa.w))}gn.elements?_e.bindBuffer(vh,gn.elements.buffer.buffer):_e.bindBuffer(vh,null)}Ba.currentVAO=vi}}function Qn(){Ce(Za).forEach(function(vi){vi.destroy()})}function Ma(){this.id=++va,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var vi=wi();vi?this.vao=vi.createVertexArrayOES():this.vao=null,Za[this.id]=this,this.buffers=[]}Ma.prototype.bindAttrs=function(){for(var vi=hn(),ti=this.attributes,Sa=0;Sa<ti.length;++Sa){var pa=ti[Sa];pa.buffer?(_e.enableVertexAttribArray(Sa),_e.bindBuffer(Pf,pa.buffer.buffer),_e.vertexAttribPointer(Sa,pa.size,pa.type,pa.normalized,pa.stride,pa.offset),vi&&pa.divisor&&vi.vertexAttribDivisorANGLE(Sa,pa.divisor)):(_e.disableVertexAttribArray(Sa),_e.vertexAttrib4f(Sa,pa.x,pa.y,pa.z,pa.w))}for(var qi=ti.length;qi<ni;++qi)_e.disableVertexAttribArray(qi);var $i=Jn.getElements(this.elements);$i?_e.bindBuffer(vh,$i.buffer.buffer):_e.bindBuffer(vh,null)},Ma.prototype.refresh=function(){var vi=wi();vi&&(vi.bindVertexArrayOES(this.vao),this.bindAttrs(),Ba.currentVAO=null,vi.bindVertexArrayOES(null))},Ma.prototype.destroy=function(){if(this.vao){var vi=wi();this===Ba.currentVAO&&(Ba.currentVAO=null,vi.bindVertexArrayOES(null)),vi.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),Za[this.id]&&(delete Za[this.id],Dn.vaoCount-=1)};function ca(){var vi=wi();vi&&Ce(Za).forEach(function(ti){ti.refresh()})}function Ua(vi){var ti=new Ma;Dn.vaoCount+=1;function Sa(pa){var qi;if(Array.isArray(pa))qi=pa,ti.elements&&ti.ownsElements&&ti.elements.destroy(),ti.elements=null,ti.ownsElements=!1,ti.offset=0,ti.count=0,ti.instances=-1,ti.primitive=4;else{if(pa.elements){var $i=pa.elements;ti.ownsElements?typeof $i=="function"&&$i._reglType==="elements"?(ti.elements.destroy(),ti.ownsElements=!1):(ti.elements($i),ti.ownsElements=!1):Jn.getElements(pa.elements)?(ti.elements=pa.elements,ti.ownsElements=!1):(ti.elements=Jn.create(pa.elements),ti.ownsElements=!0)}else ti.elements=null,ti.ownsElements=!1;qi=pa.attributes,ti.offset=0,ti.count=-1,ti.instances=-1,ti.primitive=4,ti.elements&&(ti.count=ti.elements._elements.vertCount,ti.primitive=ti.elements._elements.primType),"offset"in pa&&(ti.offset=pa.offset|0),"count"in pa&&(ti.count=pa.count|0),"instances"in pa&&(ti.instances=pa.instances|0),"primitive"in pa&&(ti.primitive=ui[pa.primitive])}var _a={},Po=ti.attributes;Po.length=qi.length;for(var wo=0;wo<qi.length;++wo){var xa=qi[wo],Oa=Po[wo]=new bu,ho=xa.data||xa;if(Array.isArray(ho)||Kr(ho)||rn(ho)){var So;ti.buffers[wo]&&(So=ti.buffers[wo],Kr(ho)&&So._buffer.byteLength>=ho.byteLength?So.subdata(ho):(So.destroy(),ti.buffers[wo]=null)),ti.buffers[wo]||(So=ti.buffers[wo]=oi.create(xa,Pf,!1,!0)),Oa.buffer=oi.getBuffer(So),Oa.size=Oa.buffer.dimension|0,Oa.normalized=!1,Oa.type=Oa.buffer.dtype,Oa.offset=0,Oa.stride=0,Oa.divisor=0,Oa.state=1,_a[wo]=1}else oi.getBuffer(xa)?(Oa.buffer=oi.getBuffer(xa),Oa.size=Oa.buffer.dimension|0,Oa.normalized=!1,Oa.type=Oa.buffer.dtype,Oa.offset=0,Oa.stride=0,Oa.divisor=0,Oa.state=1):oi.getBuffer(xa.buffer)?(Oa.buffer=oi.getBuffer(xa.buffer),Oa.size=(+xa.size||Oa.buffer.dimension)|0,Oa.normalized=!!xa.normalized||!1,"type"in xa?Oa.type=Vn[xa.type]:Oa.type=Oa.buffer.dtype,Oa.offset=(xa.offset||0)|0,Oa.stride=(xa.stride||0)|0,Oa.divisor=(xa.divisor||0)|0,Oa.state=1):"x"in xa&&(Oa.x=+xa.x||0,Oa.y=+xa.y||0,Oa.z=+xa.z||0,Oa.w=+xa.w||0,Oa.state=2)}for(var ts=0;ts<ti.buffers.length;++ts)!_a[ts]&&ti.buffers[ts]&&(ti.buffers[ts].destroy(),ti.buffers[ts]=null);return ti.refresh(),Sa}return Sa.destroy=function(){for(var pa=0;pa<ti.buffers.length;++pa)ti.buffers[pa]&&ti.buffers[pa].destroy();ti.buffers.length=0,ti.ownsElements&&(ti.elements.destroy(),ti.elements=null,ti.ownsElements=!1),ti.destroy()},Sa._vao=ti,Sa._reglType="vao",Sa(vi)}return Ba}var Vc=35632,fd=35633,vu=35718,bf=35721;function qh(_e,kr,Lr,Dn){var oi={},Jn={};function gn(hn,Nn,Oi,_i){this.name=hn,this.id=Nn,this.location=Oi,this.info=_i}function ni(hn,Nn){for(var Oi=0;Oi<hn.length;++Oi)if(hn[Oi].id===Nn.id){hn[Oi].location=Nn.location;return}hn.push(Nn)}function Yi(hn,Nn,Oi){var _i=hn===Vc?oi:Jn,Qn=_i[Nn];if(!Qn){var Ma=kr.str(Nn);Qn=_e.createShader(hn),_e.shaderSource(Qn,Ma),_e.compileShader(Qn),_i[Nn]=Qn}return Qn}var Ui={},va=[],Za=0;function Ba(hn,Nn){this.id=Za++,this.fragId=hn,this.vertId=Nn,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,Dn.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function ta(hn,Nn,Oi){var _i,Qn,Ma=Yi(Vc,hn.fragId),ca=Yi(fd,hn.vertId),Ua=hn.program=_e.createProgram();if(_e.attachShader(Ua,Ma),_e.attachShader(Ua,ca),Oi)for(_i=0;_i<Oi.length;++_i){var vi=Oi[_i];_e.bindAttribLocation(Ua,vi[0],vi[1])}_e.linkProgram(Ua);var ti=_e.getProgramParameter(Ua,vu);Dn.profile&&(hn.stats.uniformsCount=ti);var Sa=hn.uniforms;for(_i=0;_i<ti;++_i)if(Qn=_e.getActiveUniform(Ua,_i),Qn)if(Qn.size>1)for(var pa=0;pa<Qn.size;++pa){var qi=Qn.name.replace("[0]","["+pa+"]");ni(Sa,new gn(qi,kr.id(qi),_e.getUniformLocation(Ua,qi),Qn))}else ni(Sa,new gn(Qn.name,kr.id(Qn.name),_e.getUniformLocation(Ua,Qn.name),Qn));var $i=_e.getProgramParameter(Ua,bf);Dn.profile&&(hn.stats.attributesCount=$i);var _a=hn.attributes;for(_i=0;_i<$i;++_i)Qn=_e.getActiveAttrib(Ua,_i),Qn&&ni(_a,new gn(Qn.name,kr.id(Qn.name),_e.getAttribLocation(Ua,Qn.name),Qn))}Dn.profile&&(Lr.getMaxUniformsCount=function(){var hn=0;return va.forEach(function(Nn){Nn.stats.uniformsCount>hn&&(hn=Nn.stats.uniformsCount)}),hn},Lr.getMaxAttributesCount=function(){var hn=0;return va.forEach(function(Nn){Nn.stats.attributesCount>hn&&(hn=Nn.stats.attributesCount)}),hn});function wi(){oi={},Jn={};for(var hn=0;hn<va.length;++hn)ta(va[hn],null,va[hn].attributes.map(function(Nn){return[Nn.location,Nn.name]}))}return{clear:function(){var hn=_e.deleteShader.bind(_e);Ce(oi).forEach(hn),oi={},Ce(Jn).forEach(hn),Jn={},va.forEach(function(Nn){_e.deleteProgram(Nn.program)}),va.length=0,Ui={},Lr.shaderCount=0},program:function(hn,Nn,Oi,_i){var Qn=Ui[Nn];Qn||(Qn=Ui[Nn]={});var Ma=Qn[hn];if(Ma&&(Ma.refCount++,!_i))return Ma;var ca=new Ba(Nn,hn);return Lr.shaderCount++,ta(ca,Oi,_i),Ma||(Qn[hn]=ca),va.push(ca),c(ca,{destroy:function(){if(ca.refCount--,ca.refCount<=0){_e.deleteProgram(ca.program);var Ua=va.indexOf(ca);va.splice(Ua,1),Lr.shaderCount--}Qn[ca.vertId].refCount<=0&&(_e.deleteShader(Jn[ca.vertId]),delete Jn[ca.vertId],delete Ui[ca.fragId][ca.vertId]),Object.keys(Ui[ca.fragId]).length||(_e.deleteShader(oi[ca.fragId]),delete oi[ca.fragId],delete Ui[ca.fragId])}})},restore:wi,shader:Yi,frag:-1,vert:-1}}var th=6408,rf=5121,Zh=3333,wf=5126;function zd(_e,kr,Lr,Dn,oi,Jn,gn){function ni(va){var Za;kr.next===null?Za=rf:Za=kr.next.colorAttachments[0].texture._texture.type;var Ba=0,ta=0,wi=Dn.framebufferWidth,hn=Dn.framebufferHeight,Nn=null;Kr(va)?Nn=va:va&&(Ba=va.x|0,ta=va.y|0,wi=(va.width||Dn.framebufferWidth-Ba)|0,hn=(va.height||Dn.framebufferHeight-ta)|0,Nn=va.data||null),Lr();var Oi=wi*hn*4;return Nn||(Za===rf?Nn=new Uint8Array(Oi):Za===wf&&(Nn=Nn||new Float32Array(Oi))),_e.pixelStorei(Zh,4),_e.readPixels(Ba,ta,wi,hn,th,Za,Nn),Nn}function Yi(va){var Za;return kr.setFBO({framebuffer:va.framebuffer},function(){Za=ni(va)}),Za}function Ui(va){return!va||!("framebuffer"in va)?ni(va):Yi(va)}return Ui}function gc(_e){return eh(Jf(Lh(_e)))}function Jf(_e){return Ru(Wn(yh(_e),_e.length*8))}function eh(_e){for(var kr="0123456789abcdef",Lr="",Dn,oi=0;oi<_e.length;oi++)Dn=_e.charCodeAt(oi),Lr+=kr.charAt(Dn>>>4&15)+kr.charAt(Dn&15);return Lr}function Lh(_e){for(var kr="",Lr=-1,Dn,oi;++Lr<_e.length;)Dn=_e.charCodeAt(Lr),oi=Lr+1<_e.length?_e.charCodeAt(Lr+1):0,55296<=Dn&&Dn<=56319&&56320<=oi&&oi<=57343&&(Dn=65536+((Dn&1023)<<10)+(oi&1023),Lr++),Dn<=127?kr+=String.fromCharCode(Dn):Dn<=2047?kr+=String.fromCharCode(192|Dn>>>6&31,128|Dn&63):Dn<=65535?kr+=String.fromCharCode(224|Dn>>>12&15,128|Dn>>>6&63,128|Dn&63):Dn<=2097151&&(kr+=String.fromCharCode(240|Dn>>>18&7,128|Dn>>>12&63,128|Dn>>>6&63,128|Dn&63));return kr}function yh(_e){for(var kr=Array(_e.length>>2),Lr=0;Lr<kr.length;Lr++)kr[Lr]=0;for(var Lr=0;Lr<_e.length*8;Lr+=8)kr[Lr>>5]|=(_e.charCodeAt(Lr/8)&255)<<24-Lr%32;return kr}function Ru(_e){for(var kr="",Lr=0;Lr<_e.length*32;Lr+=8)kr+=String.fromCharCode(_e[Lr>>5]>>>24-Lr%32&255);return kr}function eu(_e,kr){return _e>>>kr|_e<<32-kr}function xh(_e,kr){return _e>>>kr}function df(_e,kr,Lr){return _e&kr^~_e&Lr}function _h(_e,kr,Lr){return _e&kr^_e&Lr^kr&Lr}function qf(_e){return eu(_e,2)^eu(_e,13)^eu(_e,22)}function mr(_e){return eu(_e,6)^eu(_e,11)^eu(_e,25)}function Ur(_e){return eu(_e,7)^eu(_e,18)^xh(_e,3)}function _n(_e){return eu(_e,17)^eu(_e,19)^xh(_e,10)}var cn=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 Wn(_e,kr){var Lr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Dn=new Array(64),oi,Jn,gn,ni,Yi,Ui,va,Za,Ba,ta,wi,hn;for(_e[kr>>5]|=128<<24-kr%32,_e[(kr+64>>9<<4)+15]=kr,Ba=0;Ba<_e.length;Ba+=16){for(oi=Lr[0],Jn=Lr[1],gn=Lr[2],ni=Lr[3],Yi=Lr[4],Ui=Lr[5],va=Lr[6],Za=Lr[7],ta=0;ta<64;ta++)ta<16?Dn[ta]=_e[ta+Ba]:Dn[ta]=hi(hi(hi(_n(Dn[ta-2]),Dn[ta-7]),Ur(Dn[ta-15])),Dn[ta-16]),wi=hi(hi(hi(hi(Za,mr(Yi)),df(Yi,Ui,va)),cn[ta]),Dn[ta]),hn=hi(qf(oi),_h(oi,Jn,gn)),Za=va,va=Ui,Ui=Yi,Yi=hi(ni,wi),ni=gn,gn=Jn,Jn=oi,oi=hi(wi,hn);Lr[0]=hi(oi,Lr[0]),Lr[1]=hi(Jn,Lr[1]),Lr[2]=hi(gn,Lr[2]),Lr[3]=hi(ni,Lr[3]),Lr[4]=hi(Yi,Lr[4]),Lr[5]=hi(Ui,Lr[5]),Lr[6]=hi(va,Lr[6]),Lr[7]=hi(Za,Lr[7])}return Lr}function hi(_e,kr){var Lr=(_e&65535)+(kr&65535),Dn=(_e>>16)+(kr>>16)+(Lr>>16);return Dn<<16|Lr&65535}function ea(_e){return Array.prototype.slice.call(_e)}function ga(_e){return ea(_e).join("")}function Ra(_e){var kr=_e&&_e.cache,Lr=0,Dn=[],oi=[],Jn=[];function gn(wi,hn){var Nn=hn&&hn.stable;if(!Nn){for(var Oi=0;Oi<oi.length;++Oi)if(oi[Oi]===wi&&!Jn[Oi])return Dn[Oi]}var _i="g"+Lr++;return Dn.push(_i),oi.push(wi),Jn.push(Nn),_i}function ni(){var wi=[];function hn(){wi.push.apply(wi,ea(arguments))}var Nn=[];function Oi(){var _i="v"+Lr++;return Nn.push(_i),arguments.length>0&&(wi.push(_i,"="),wi.push.apply(wi,ea(arguments)),wi.push(";")),_i}return c(hn,{def:Oi,toString:function(){return ga([Nn.length>0?"var "+Nn.join(",")+";":"",ga(wi)])}})}function Yi(){var wi=ni(),hn=ni(),Nn=wi.toString,Oi=hn.toString;function _i(Qn,Ma){hn(Qn,Ma,"=",wi.def(Qn,Ma),";")}return c(function(){wi.apply(wi,ea(arguments))},{def:wi.def,entry:wi,exit:hn,save:_i,set:function(Qn,Ma,ca){_i(Qn,Ma),wi(Qn,Ma,"=",ca,";")},toString:function(){return Nn()+Oi()}})}function Ui(){var wi=ga(arguments),hn=Yi(),Nn=Yi(),Oi=hn.toString,_i=Nn.toString;return c(hn,{then:function(){return hn.apply(hn,ea(arguments)),this},else:function(){return Nn.apply(Nn,ea(arguments)),this},toString:function(){var Qn=_i();return Qn&&(Qn="else{"+Qn+"}"),ga(["if(",wi,"){",Oi(),"}",Qn])}})}var va=ni(),Za={};function Ba(wi,hn){var Nn=[];function Oi(){var Ua="a"+Nn.length;return Nn.push(Ua),Ua}hn=hn||0;for(var _i=0;_i<hn;++_i)Oi();var Qn=Yi(),Ma=Qn.toString,ca=Za[wi]=c(Qn,{arg:Oi,toString:function(){return ga(["function(",Nn.join(),"){",Ma(),"}"])}});return ca}function ta(){var wi=['"use strict";',va,"return {"];Object.keys(Za).forEach(function(_i){wi.push('"',_i,'":',Za[_i].toString(),",")}),wi.push("}");var hn=ga(wi).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),Nn;if(kr&&(Nn=gc(hn),kr[Nn]))return kr[Nn].apply(null,oi);var Oi=Function.apply(null,Dn.concat(hn));return kr&&(kr[Nn]=Oi),Oi.apply(null,oi)}return{global:va,link:gn,block:ni,proc:Ba,scope:Yi,cond:Ui,compile:ta}}var $a="xyzw".split(""),ua=5121,za=1,wa=2,Ji=0,eo=1,rs=2,Zo=3,os=4,fs=5,no=6,qa="dither",ds="blend.enable",tl="blend.color",Pl="blend.equation",iu="blend.func",Hl="depth.enable",au="depth.func",ml="depth.range",qu="depth.mask",Lu="colorMask",uu="cull.enable",zo="cull.face",Ms="frontFace",$l="lineWidth",Fl="polygonOffset.enable",vc="polygonOffset.offset",Hc="sample.alpha",Pc="sample.enable",Ph="sample.coverage",Wc="stencil.enable",zh="stencil.mask",Iu="stencil.func",Ih="stencil.opFront",es="stencil.opBack",zs="scissor.enable",qc="scissor.box",Zu="viewport",Zf="profile",qt="framebuffer",I="vert",ht="frag",Et="elements",It="primitive",Vt="count",ke="offset",Oe="instances",Ke="vao",gr="Width",Or="Height",Dr=qt+gr,ln=qt+Or,Sn=Zu+gr,Xt=Zu+Or,ae="drawingBuffer",xe=ae+gr,Ae=ae+Or,je=[iu,Pl,Iu,Ih,es,Ph,Zu,qc,vc],Ie=34962,Ze=34963,wr=2884,Ir=3042,Nr=3024,tn=2960,mn=2929,zn=3089,Bn=32823,ri=32926,Fi=32928,da=5126,ha=35664,ka=35665,io=35666,Ro=5124,Mo=35667,hs=35668,hl=35669,vl=35670,Os=35671,bl=35672,Su=35673,mu=35674,Ws=35675,qs=35676,Yu=35678,dc=35680,Zc=4,At=1028,jt=1029,ue=2304,Me=2305,Le=32775,Be=32776,sr=519,ir=7680,Mr=0,en=1,Xr=32774,vn=513,In=36160,On=36064,Bi={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},Un={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},mi={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ti={cw:ue,ccw:Me};function Ii(_e){return Array.isArray(_e)||Kr(_e)||rn(_e)}function Wi(_e){return _e.sort(function(kr,Lr){return kr===Zu?-1:Lr===Zu?1:kr<Lr?-1:1})}function Yn(_e,kr,Lr,Dn){this.thisDep=_e,this.contextDep=kr,this.propDep=Lr,this.append=Dn}function ja(_e){return _e&&!(_e.thisDep||_e.contextDep||_e.propDep)}function Ha(_e){return new Yn(!1,!1,!1,_e)}function ro(_e,kr){var Lr=_e.type;if(Lr===Ji){var Dn=_e.data.length;return new Yn(!0,Dn>=1,Dn>=2,kr)}else if(Lr===os){var oi=_e.data;return new Yn(oi.thisDep,oi.contextDep,oi.propDep,kr)}else{if(Lr===fs)return new Yn(!1,!1,!1,kr);if(Lr===no){for(var Jn=!1,gn=!1,ni=!1,Yi=0;Yi<_e.data.length;++Yi){var Ui=_e.data[Yi];if(Ui.type===eo)ni=!0;else if(Ui.type===rs)gn=!0;else if(Ui.type===Zo)Jn=!0;else if(Ui.type===Ji){Jn=!0;var va=Ui.data;va>=1&&(gn=!0),va>=2&&(ni=!0)}else Ui.type===os&&(Jn=Jn||Ui.data.thisDep,gn=gn||Ui.data.contextDep,ni=ni||Ui.data.propDep)}return new Yn(Jn,gn,ni,kr)}else return new Yn(Lr===Zo,Lr===rs,Lr===eo,kr)}}var Lo=new Yn(!1,!1,!1,function(){});function Fo(_e,kr,Lr,Dn,oi,Jn,gn,ni,Yi,Ui,va,Za,Ba,ta,wi,hn){var Nn=Ui.Record,Oi={add:32774,subtract:32778,"reverse subtract":32779};Lr.ext_blend_minmax&&(Oi.min=Le,Oi.max=Be);var _i=Lr.angle_instanced_arrays,Qn=Lr.webgl_draw_buffers,Ma=Lr.oes_vertex_array_object,ca={dirty:!0,profile:hn.profile},Ua={},vi=[],ti={},Sa={};function pa(Yt){return Yt.replace(".","_")}function qi(Yt,ce,Se){var nr=pa(Yt);vi.push(Yt),Ua[nr]=ca[nr]=!!Se,ti[nr]=ce}function $i(Yt,ce,Se){var nr=pa(Yt);vi.push(Yt),Array.isArray(Se)?(ca[nr]=Se.slice(),Ua[nr]=Se.slice()):ca[nr]=Ua[nr]=Se,Sa[nr]=ce}function _a(Yt){return!!isNaN(Yt)}qi(qa,Nr),qi(ds,Ir),$i(tl,"blendColor",[0,0,0,0]),$i(Pl,"blendEquationSeparate",[Xr,Xr]),$i(iu,"blendFuncSeparate",[en,Mr,en,Mr]),qi(Hl,mn,!0),$i(au,"depthFunc",vn),$i(ml,"depthRange",[0,1]),$i(qu,"depthMask",!0),$i(Lu,Lu,[!0,!0,!0,!0]),qi(uu,wr),$i(zo,"cullFace",jt),$i(Ms,Ms,Me),$i($l,$l,1),qi(Fl,Bn),$i(vc,"polygonOffset",[0,0]),qi(Hc,ri),qi(Pc,Fi),$i(Ph,"sampleCoverage",[1,!1]),qi(Wc,tn),$i(zh,"stencilMask",-1),$i(Iu,"stencilFunc",[sr,0,-1]),$i(Ih,"stencilOpSeparate",[At,ir,ir,ir]),$i(es,"stencilOpSeparate",[jt,ir,ir,ir]),qi(zs,zn),$i(qc,"scissor",[0,0,_e.drawingBufferWidth,_e.drawingBufferHeight]),$i(Zu,Zu,[0,0,_e.drawingBufferWidth,_e.drawingBufferHeight]);var Po={gl:_e,context:Ba,strings:kr,next:Ua,current:ca,draw:Za,elements:Jn,buffer:oi,shader:va,attributes:Ui.state,vao:Ui,uniforms:Yi,framebuffer:ni,extensions:Lr,timer:ta,isBufferArgs:Ii},wo={primTypes:ui,compareFuncs:Un,blendFuncs:Bi,blendEquations:Oi,stencilOps:mi,glTypes:Vn,orientationType:Ti};Qn&&(wo.backBuffer=[jt],wo.drawBuffer=h(Dn.maxDrawbuffers,function(Yt){return Yt===0?[0]:h(Yt,function(ce){return On+ce})}));var xa=0;function Oa(){var Yt=Ra({cache:wi}),ce=Yt.link,Se=Yt.global;Yt.id=xa++,Yt.batchId="0";var nr=ce(Po),Ye=Yt.shared={props:"a0"};Object.keys(Po).forEach(function(Xe){Ye[Xe]=Se.def(nr,".",Xe)});var tr=Yt.next={},lr=Yt.current={};Object.keys(Sa).forEach(function(Xe){Array.isArray(ca[Xe])&&(tr[Xe]=Se.def(Ye.next,".",Xe),lr[Xe]=Se.def(Ye.current,".",Xe))});var hr=Yt.constants={};Object.keys(wo).forEach(function(Xe){hr[Xe]=Se.def(JSON.stringify(wo[Xe]))}),Yt.invoke=function(Xe,$e){switch($e.type){case Ji:var Cr=["this",Ye.context,Ye.props,Yt.batchId];return Xe.def(ce($e.data),".call(",Cr.slice(0,Math.max($e.data.length+1,4)),")");case eo:return Xe.def(Ye.props,$e.data);case rs:return Xe.def(Ye.context,$e.data);case Zo:return Xe.def("this",$e.data);case os:return $e.data.append(Yt,Xe),$e.data.ref;case fs:return $e.data.toString();case no:return $e.data.map(function(on){return Yt.invoke(Xe,on)})}},Yt.attribCache={};var Ve={};return Yt.scopeAttrib=function(Xe){var $e=kr.id(Xe);if($e in Ve)return Ve[$e];var Cr=Ui.scope[$e];Cr||(Cr=Ui.scope[$e]=new Nn);var on=Ve[$e]=ce(Cr);return on},Yt}function ho(Yt){var ce=Yt.static,Se=Yt.dynamic,nr;if(Zf in ce){var Ye=!!ce[Zf];nr=Ha(function(lr,hr){return Ye}),nr.enable=Ye}else if(Zf in Se){var tr=Se[Zf];nr=ro(tr,function(lr,hr){return lr.invoke(hr,tr)})}return nr}function So(Yt,ce){var Se=Yt.static,nr=Yt.dynamic;if(qt in Se){var Ye=Se[qt];return Ye?(Ye=ni.getFramebuffer(Ye),Ha(function(lr,hr){var Ve=lr.link(Ye),Xe=lr.shared;hr.set(Xe.framebuffer,".next",Ve);var $e=Xe.context;return hr.set($e,"."+Dr,Ve+".width"),hr.set($e,"."+ln,Ve+".height"),Ve})):Ha(function(lr,hr){var Ve=lr.shared;hr.set(Ve.framebuffer,".next","null");var Xe=Ve.context;return hr.set(Xe,"."+Dr,Xe+"."+xe),hr.set(Xe,"."+ln,Xe+"."+Ae),"null"})}else if(qt in nr){var tr=nr[qt];return ro(tr,function(lr,hr){var Ve=lr.invoke(hr,tr),Xe=lr.shared,$e=Xe.framebuffer,Cr=hr.def($e,".getFramebuffer(",Ve,")");hr.set($e,".next",Cr);var on=Xe.context;return hr.set(on,"."+Dr,Cr+"?"+Cr+".width:"+on+"."+xe),hr.set(on,"."+ln,Cr+"?"+Cr+".height:"+on+"."+Ae),Cr})}else return null}function ts(Yt,ce,Se){var nr=Yt.static,Ye=Yt.dynamic;function tr(Ve){if(Ve in nr){var Xe=nr[Ve],$e=!0,Cr=Xe.x|0,on=Xe.y|0,fn,fi;return"width"in Xe?fn=Xe.width|0:$e=!1,"height"in Xe?fi=Xe.height|0:$e=!1,new Yn(!$e&&ce&&ce.thisDep,!$e&&ce&&ce.contextDep,!$e&&ce&&ce.propDep,function(Mi,di){var Ki=Mi.shared.context,Ai=fn;"width"in Xe||(Ai=di.def(Ki,".",Dr,"-",Cr));var Si=fi;return"height"in Xe||(Si=di.def(Ki,".",ln,"-",on)),[Cr,on,Ai,Si]})}else if(Ve in Ye){var si=Ye[Ve],Gn=ro(si,function(Mi,di){var Ki=Mi.invoke(di,si),Ai=Mi.shared.context,Si=di.def(Ki,".x|0"),sa=di.def(Ki,".y|0"),Qa=di.def('"width" in ',Ki,"?",Ki,".width|0:","(",Ai,".",Dr,"-",Si,")"),so=di.def('"height" in ',Ki,"?",Ki,".height|0:","(",Ai,".",ln,"-",sa,")");return[Si,sa,Qa,so]});return ce&&(Gn.thisDep=Gn.thisDep||ce.thisDep,Gn.contextDep=Gn.contextDep||ce.contextDep,Gn.propDep=Gn.propDep||ce.propDep),Gn}else return ce?new Yn(ce.thisDep,ce.contextDep,ce.propDep,function(Mi,di){var Ki=Mi.shared.context;return[0,0,di.def(Ki,".",Dr),di.def(Ki,".",ln)]}):null}var lr=tr(Zu);if(lr){var hr=lr;lr=new Yn(lr.thisDep,lr.contextDep,lr.propDep,function(Ve,Xe){var $e=hr.append(Ve,Xe),Cr=Ve.shared.context;return Xe.set(Cr,"."+Sn,$e[2]),Xe.set(Cr,"."+Xt,$e[3]),$e})}return{viewport:lr,scissor_box:tr(qc)}}function Nl(Yt,ce){var Se=Yt.static,nr=typeof Se[ht]=="string"&&typeof Se[I]=="string";if(nr){if(Object.keys(ce.dynamic).length>0)return null;var Ye=ce.static,tr=Object.keys(Ye);if(tr.length>0&&typeof Ye[tr[0]]=="number"){for(var lr=[],hr=0;hr<tr.length;++hr)lr.push([Ye[tr[hr]]|0,tr[hr]]);return lr}}return null}function Al(Yt,ce,Se){var nr=Yt.static,Ye=Yt.dynamic;function tr($e){if($e in nr){var Cr=kr.id(nr[$e]),on=Ha(function(){return Cr});return on.id=Cr,on}else if($e in Ye){var fn=Ye[$e];return ro(fn,function(fi,si){var Gn=fi.invoke(si,fn),Mi=si.def(fi.shared.strings,".id(",Gn,")");return Mi})}return null}var lr=tr(ht),hr=tr(I),Ve=null,Xe;return ja(lr)&&ja(hr)?(Ve=va.program(hr.id,lr.id,null,Se),Xe=Ha(function($e,Cr){return $e.link(Ve)})):Xe=new Yn(lr&&lr.thisDep||hr&&hr.thisDep,lr&&lr.contextDep||hr&&hr.contextDep,lr&&lr.propDep||hr&&hr.propDep,function($e,Cr){var on=$e.shared.shader,fn;lr?fn=lr.append($e,Cr):fn=Cr.def(on,".",ht);var fi;hr?fi=hr.append($e,Cr):fi=Cr.def(on,".",I);var si=on+".program("+fi+","+fn;return Cr.def(si+")")}),{frag:lr,vert:hr,progVar:Xe,program:Ve}}function us(Yt,ce){var Se=Yt.static,nr=Yt.dynamic,Ye={},tr=!1;function lr(){if(Ke in Se){var di=Se[Ke];return di!==null&&Ui.getVAO(di)===null&&(di=Ui.createVAO(di)),tr=!0,Ye.vao=di,Ha(function(Ai){var Si=Ui.getVAO(di);return Si?Ai.link(Si):"null"})}else if(Ke in nr){tr=!0;var Ki=nr[Ke];return ro(Ki,function(Ai,Si){var sa=Ai.invoke(Si,Ki);return Si.def(Ai.shared.vao+".getVAO("+sa+")")})}return null}var hr=lr(),Ve=!1;function Xe(){if(Et in Se){var di=Se[Et];if(Ye.elements=di,Ii(di)){var Ki=Ye.elements=Jn.create(di,!0);di=Jn.getElements(Ki),Ve=!0}else di&&(di=Jn.getElements(di),Ve=!0);var Ai=Ha(function(sa,Qa){if(di){var so=sa.link(di);return sa.ELEMENTS=so,so}return sa.ELEMENTS=null,null});return Ai.value=di,Ai}else if(Et in nr){Ve=!0;var Si=nr[Et];return ro(Si,function(sa,Qa){var so=sa.shared,Vo=so.isBufferArgs,vs=so.elements,zl=sa.invoke(Qa,Si),jl=Qa.def("null"),dl=Qa.def(Vo,"(",zl,")"),Ul=sa.cond(dl).then(jl,"=",vs,".createStream(",zl,");").else(jl,"=",vs,".getElements(",zl,");");return Qa.entry(Ul),Qa.exit(sa.cond(dl).then(vs,".destroyStream(",jl,");")),sa.ELEMENTS=jl,jl})}else if(tr)return new Yn(hr.thisDep,hr.contextDep,hr.propDep,function(sa,Qa){return Qa.def(sa.shared.vao+".currentVAO?"+sa.shared.elements+".getElements("+sa.shared.vao+".currentVAO.elements):null")});return null}var $e=Xe();function Cr(){if(It in Se){var di=Se[It];return Ye.primitive=di,Ha(function(Ai,Si){return ui[di]})}else if(It in nr){var Ki=nr[It];return ro(Ki,function(Ai,Si){var sa=Ai.constants.primTypes,Qa=Ai.invoke(Si,Ki);return Si.def(sa,"[",Qa,"]")})}else{if(Ve)return ja($e)?$e.value?Ha(function(Ai,Si){return Si.def(Ai.ELEMENTS,".primType")}):Ha(function(){return Zc}):new Yn($e.thisDep,$e.contextDep,$e.propDep,function(Ai,Si){var sa=Ai.ELEMENTS;return Si.def(sa,"?",sa,".primType:",Zc)});if(tr)return new Yn(hr.thisDep,hr.contextDep,hr.propDep,function(Ai,Si){return Si.def(Ai.shared.vao+".currentVAO?"+Ai.shared.vao+".currentVAO.primitive:"+Zc)})}return null}function on(di,Ki){if(di in Se){var Ai=Se[di]|0;return Ki?Ye.offset=Ai:Ye.instances=Ai,Ha(function(sa,Qa){return Ki&&(sa.OFFSET=Ai),Ai})}else if(di in nr){var Si=nr[di];return ro(Si,function(sa,Qa){var so=sa.invoke(Qa,Si);return Ki&&(sa.OFFSET=so),so})}else if(Ki){if(Ve)return Ha(function(sa,Qa){return sa.OFFSET=0,0});if(tr)return new Yn(hr.thisDep,hr.contextDep,hr.propDep,function(sa,Qa){return Qa.def(sa.shared.vao+".currentVAO?"+sa.shared.vao+".currentVAO.offset:0")})}else if(tr)return new Yn(hr.thisDep,hr.contextDep,hr.propDep,function(sa,Qa){return Qa.def(sa.shared.vao+".currentVAO?"+sa.shared.vao+".currentVAO.instances:-1")});return null}var fn=on(ke,!0);function fi(){if(Vt in Se){var di=Se[Vt]|0;return Ye.count=di,Ha(function(){return di})}else if(Vt in nr){var Ki=nr[Vt];return ro(Ki,function(Qa,so){var Vo=Qa.invoke(so,Ki);return Vo})}else if(Ve)if(ja($e)){if($e)return fn?new Yn(fn.thisDep,fn.contextDep,fn.propDep,function(Qa,so){var Vo=so.def(Qa.ELEMENTS,".vertCount-",Qa.OFFSET);return Vo}):Ha(function(Qa,so){return so.def(Qa.ELEMENTS,".vertCount")});var Ai=Ha(function(){return-1});return Ai}else{var Si=new Yn($e.thisDep||fn.thisDep,$e.contextDep||fn.contextDep,$e.propDep||fn.propDep,function(Qa,so){var Vo=Qa.ELEMENTS;return Qa.OFFSET?so.def(Vo,"?",Vo,".vertCount-",Qa.OFFSET,":-1"):so.def(Vo,"?",Vo,".vertCount:-1")});return Si}else if(tr){var sa=new Yn(hr.thisDep,hr.contextDep,hr.propDep,function(Qa,so){return so.def(Qa.shared.vao,".currentVAO?",Qa.shared.vao,".currentVAO.count:-1")});return sa}return null}var si=Cr(),Gn=fi(),Mi=on(Oe,!1);return{elements:$e,primitive:si,count:Gn,instances:Mi,offset:fn,vao:hr,vaoActive:tr,elementsActive:Ve,static:Ye}}function wu(Yt,ce){var Se=Yt.static,nr=Yt.dynamic,Ye={};return vi.forEach(function(tr){var lr=pa(tr);function hr(Ve,Xe){if(tr in Se){var $e=Ve(Se[tr]);Ye[lr]=Ha(function(){return $e})}else if(tr in nr){var Cr=nr[tr];Ye[lr]=ro(Cr,function(on,fn){return Xe(on,fn,on.invoke(fn,Cr))})}}switch(tr){case uu:case ds:case qa:case Wc:case Hl:case zs:case Fl:case Hc:case Pc:case qu:return hr(function(Ve){return Ve},function(Ve,Xe,$e){return $e});case au:return hr(function(Ve){return Un[Ve]},function(Ve,Xe,$e){var Cr=Ve.constants.compareFuncs;return Xe.def(Cr,"[",$e,"]")});case ml:return hr(function(Ve){return Ve},function(Ve,Xe,$e){var Cr=Xe.def("+",$e,"[0]"),on=Xe.def("+",$e,"[1]");return[Cr,on]});case iu:return hr(function(Ve){var Xe="srcRGB"in Ve?Ve.srcRGB:Ve.src,$e="srcAlpha"in Ve?Ve.srcAlpha:Ve.src,Cr="dstRGB"in Ve?Ve.dstRGB:Ve.dst,on="dstAlpha"in Ve?Ve.dstAlpha:Ve.dst;return[Bi[Xe],Bi[Cr],Bi[$e],Bi[on]]},function(Ve,Xe,$e){var Cr=Ve.constants.blendFuncs;function on(Ki,Ai){var Si=Xe.def('"',Ki,Ai,'" in ',$e,"?",$e,".",Ki,Ai,":",$e,".",Ki);return Si}var fn=on("src","RGB"),fi=on("dst","RGB"),si=Xe.def(Cr,"[",fn,"]"),Gn=Xe.def(Cr,"[",on("src","Alpha"),"]"),Mi=Xe.def(Cr,"[",fi,"]"),di=Xe.def(Cr,"[",on("dst","Alpha"),"]");return[si,Mi,Gn,di]});case Pl:return hr(function(Ve){if(typeof Ve=="string")return[Oi[Ve],Oi[Ve]];if(typeof Ve=="object")return[Oi[Ve.rgb],Oi[Ve.alpha]]},function(Ve,Xe,$e){var Cr=Ve.constants.blendEquations,on=Xe.def(),fn=Xe.def(),fi=Ve.cond("typeof ",$e,'==="string"');return fi.then(on,"=",fn,"=",Cr,"[",$e,"];"),fi.else(on,"=",Cr,"[",$e,".rgb];",fn,"=",Cr,"[",$e,".alpha];"),Xe(fi),[on,fn]});case tl:return hr(function(Ve){return h(4,function(Xe){return+Ve[Xe]})},function(Ve,Xe,$e){return h(4,function(Cr){return Xe.def("+",$e,"[",Cr,"]")})});case zh:return hr(function(Ve){return Ve|0},function(Ve,Xe,$e){return Xe.def($e,"|0")});case Iu:return hr(function(Ve){var Xe=Ve.cmp||"keep",$e=Ve.ref||0,Cr="mask"in Ve?Ve.mask:-1;return[Un[Xe],$e,Cr]},function(Ve,Xe,$e){var Cr=Ve.constants.compareFuncs,on=Xe.def('"cmp" in ',$e,"?",Cr,"[",$e,".cmp]",":",ir),fn=Xe.def($e,".ref|0"),fi=Xe.def('"mask" in ',$e,"?",$e,".mask|0:-1");return[on,fn,fi]});case Ih:case es:return hr(function(Ve){var Xe=Ve.fail||"keep",$e=Ve.zfail||"keep",Cr=Ve.zpass||"keep";return[tr===es?jt:At,mi[Xe],mi[$e],mi[Cr]]},function(Ve,Xe,$e){var Cr=Ve.constants.stencilOps;function on(fn){return Xe.def('"',fn,'" in ',$e,"?",Cr,"[",$e,".",fn,"]:",ir)}return[tr===es?jt:At,on("fail"),on("zfail"),on("zpass")]});case vc:return hr(function(Ve){var Xe=Ve.factor|0,$e=Ve.units|0;return[Xe,$e]},function(Ve,Xe,$e){var Cr=Xe.def($e,".factor|0"),on=Xe.def($e,".units|0");return[Cr,on]});case zo:return hr(function(Ve){var Xe=0;return Ve==="front"?Xe=At:Ve==="back"&&(Xe=jt),Xe},function(Ve,Xe,$e){return Xe.def($e,'==="front"?',At,":",jt)});case $l:return hr(function(Ve){return Ve},function(Ve,Xe,$e){return $e});case Ms:return hr(function(Ve){return Ti[Ve]},function(Ve,Xe,$e){return Xe.def($e+'==="cw"?'+ue+":"+Me)});case Lu:return hr(function(Ve){return Ve.map(function(Xe){return!!Xe})},function(Ve,Xe,$e){return h(4,function(Cr){return"!!"+$e+"["+Cr+"]"})});case Ph:return hr(function(Ve){var Xe="value"in Ve?Ve.value:1,$e=!!Ve.invert;return[Xe,$e]},function(Ve,Xe,$e){var Cr=Xe.def('"value" in ',$e,"?+",$e,".value:1"),on=Xe.def("!!",$e,".invert");return[Cr,on]})}}),Ye}function fl(Yt,ce){var Se=Yt.static,nr=Yt.dynamic,Ye={};return Object.keys(Se).forEach(function(tr){var lr=Se[tr],hr;if(typeof lr=="number"||typeof lr=="boolean")hr=Ha(function(){return lr});else if(typeof lr=="function"){var Ve=lr._reglType;Ve==="texture2d"||Ve==="textureCube"?hr=Ha(function(Xe){return Xe.link(lr)}):(Ve==="framebuffer"||Ve==="framebufferCube")&&(hr=Ha(function(Xe){return Xe.link(lr.color[0])}))}else Pn(lr)&&(hr=Ha(function(Xe){var $e=Xe.global.def("[",h(lr.length,function(Cr){return lr[Cr]}),"]");return $e}));hr.value=lr,Ye[tr]=hr}),Object.keys(nr).forEach(function(tr){var lr=nr[tr];Ye[tr]=ro(lr,function(hr,Ve){return hr.invoke(Ve,lr)})}),Ye}function Eu(Yt,ce){var Se=Yt.static,nr=Yt.dynamic,Ye={};return Object.keys(Se).forEach(function(tr){var lr=Se[tr],hr=kr.id(tr),Ve=new Nn;if(Ii(lr))Ve.state=za,Ve.buffer=oi.getBuffer(oi.create(lr,Ie,!1,!0)),Ve.type=0;else{var Xe=oi.getBuffer(lr);if(Xe)Ve.state=za,Ve.buffer=Xe,Ve.type=0;else if("constant"in lr){var $e=lr.constant;Ve.buffer="null",Ve.state=wa,typeof $e=="number"?Ve.x=$e:$a.forEach(function(Mi,di){di<$e.length&&(Ve[Mi]=$e[di])})}else{Ii(lr.buffer)?Xe=oi.getBuffer(oi.create(lr.buffer,Ie,!1,!0)):Xe=oi.getBuffer(lr.buffer);var Cr=lr.offset|0,on=lr.stride|0,fn=lr.size|0,fi=!!lr.normalized,si=0;"type"in lr&&(si=Vn[lr.type]);var Gn=lr.divisor|0;Ve.buffer=Xe,Ve.state=za,Ve.size=fn,Ve.normalized=fi,Ve.type=si||Xe.dtype,Ve.offset=Cr,Ve.stride=on,Ve.divisor=Gn}}Ye[tr]=Ha(function(Mi,di){var Ki=Mi.attribCache;if(hr in Ki)return Ki[hr];var Ai={isStream:!1};return Object.keys(Ve).forEach(function(Si){Ai[Si]=Ve[Si]}),Ve.buffer&&(Ai.buffer=Mi.link(Ve.buffer),Ai.type=Ai.type||Ai.buffer+".dtype"),Ki[hr]=Ai,Ai})}),Object.keys(nr).forEach(function(tr){var lr=nr[tr];function hr(Ve,Xe){var $e=Ve.invoke(Xe,lr),Cr=Ve.shared,on=Ve.constants,fn=Cr.isBufferArgs,fi=Cr.buffer,si={isStream:Xe.def(!1)},Gn=new Nn;Gn.state=za,Object.keys(Gn).forEach(function(Ai){si[Ai]=Xe.def(""+Gn[Ai])});var Mi=si.buffer,di=si.type;Xe("if(",fn,"(",$e,")){",si.isStream,"=true;",Mi,"=",fi,".createStream(",Ie,",",$e,");",di,"=",Mi,".dtype;","}else{",Mi,"=",fi,".getBuffer(",$e,");","if(",Mi,"){",di,"=",Mi,".dtype;",'}else if("constant" in ',$e,"){",si.state,"=",wa,";","if(typeof "+$e+'.constant === "number"){',si[$a[0]],"=",$e,".constant;",$a.slice(1).map(function(Ai){return si[Ai]}).join("="),"=0;","}else{",$a.map(function(Ai,Si){return si[Ai]+"="+$e+".constant.length>"+Si+"?"+$e+".constant["+Si+"]:0;"}).join(""),"}}else{","if(",fn,"(",$e,".buffer)){",Mi,"=",fi,".createStream(",Ie,",",$e,".buffer);","}else{",Mi,"=",fi,".getBuffer(",$e,".buffer);","}",di,'="type" in ',$e,"?",on.glTypes,"[",$e,".type]:",Mi,".dtype;",si.normalized,"=!!",$e,".normalized;");function Ki(Ai){Xe(si[Ai],"=",$e,".",Ai,"|0;")}return Ki("size"),Ki("offset"),Ki("stride"),Ki("divisor"),Xe("}}"),Xe.exit("if(",si.isStream,"){",fi,".destroyStream(",Mi,");","}"),si}Ye[tr]=ro(lr,hr)}),Ye}function pc(Yt){var ce=Yt.static,Se=Yt.dynamic,nr={};return Object.keys(ce).forEach(function(Ye){var tr=ce[Ye];nr[Ye]=Ha(function(lr,hr){return typeof tr=="number"||typeof tr=="boolean"?""+tr:lr.link(tr)})}),Object.keys(Se).forEach(function(Ye){var tr=Se[Ye];nr[Ye]=ro(tr,function(lr,hr){return lr.invoke(hr,tr)})}),nr}function yc(Yt,ce,Se,nr,Ye){Yt.static,Yt.dynamic;var tr=Nl(Yt,ce),lr=So(Yt),hr=ts(Yt,lr),Ve=us(Yt),Xe=wu(Yt),$e=Al(Yt,Ye,tr);function Cr(Mi){var di=hr[Mi];di&&(Xe[Mi]=di)}Cr(Zu),Cr(pa(qc));var on=Object.keys(Xe).length>0,fn={framebuffer:lr,draw:Ve,shader:$e,state:Xe,dirty:on,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(fn.profile=ho(Yt),fn.uniforms=fl(Se),fn.drawVAO=fn.scopeVAO=Ve.vao,!fn.drawVAO&&$e.program&&!tr&&Lr.angle_instanced_arrays&&Ve.static.elements){var fi=!0,si=$e.program.attributes.map(function(Mi){var di=ce.static[Mi];return fi=fi&&!!di,di});if(fi&&si.length>0){var Gn=Ui.getVAO(Ui.createVAO({attributes:si,elements:Ve.static.elements}));fn.drawVAO=new Yn(null,null,null,function(Mi,di){return Mi.link(Gn)}),fn.useVAO=!0}}return tr?fn.useVAO=!0:fn.attributes=Eu(ce),fn.context=pc(nr),fn}function yu(Yt,ce,Se){var nr=Yt.shared,Ye=nr.context,tr=Yt.scope();Object.keys(Se).forEach(function(lr){ce.save(Ye,"."+lr);var hr=Se[lr],Ve=hr.append(Yt,ce);Array.isArray(Ve)?tr(Ye,".",lr,"=[",Ve.join(),"];"):tr(Ye,".",lr,"=",Ve,";")}),ce(tr)}function hu(Yt,ce,Se,nr){var Ye=Yt.shared,tr=Ye.gl,lr=Ye.framebuffer,hr;Qn&&(hr=ce.def(Ye.extensions,".webgl_draw_buffers"));var Ve=Yt.constants,Xe=Ve.drawBuffer,$e=Ve.backBuffer,Cr;Se?Cr=Se.append(Yt,ce):Cr=ce.def(lr,".next"),nr||ce("if(",Cr,"!==",lr,".cur){"),ce("if(",Cr,"){",tr,".bindFramebuffer(",In,",",Cr,".framebuffer);"),Qn&&ce(hr,".drawBuffersWEBGL(",Xe,"[",Cr,".colorAttachments.length]);"),ce("}else{",tr,".bindFramebuffer(",In,",null);"),Qn&&ce(hr,".drawBuffersWEBGL(",$e,");"),ce("}",lr,".cur=",Cr,";"),nr||ce("}")}function ku(Yt,ce,Se){var nr=Yt.shared,Ye=nr.gl,tr=Yt.current,lr=Yt.next,hr=nr.current,Ve=nr.next,Xe=Yt.cond(hr,".dirty");vi.forEach(function($e){var Cr=pa($e);if(!(Cr in Se.state)){var on,fn;if(Cr in lr){on=lr[Cr],fn=tr[Cr];var fi=h(ca[Cr].length,function(Gn){return Xe.def(on,"[",Gn,"]")});Xe(Yt.cond(fi.map(function(Gn,Mi){return Gn+"!=="+fn+"["+Mi+"]"}).join("||")).then(Ye,".",Sa[Cr],"(",fi,");",fi.map(function(Gn,Mi){return fn+"["+Mi+"]="+Gn}).join(";"),";"))}else{on=Xe.def(Ve,".",Cr);var si=Yt.cond(on,"!==",hr,".",Cr);Xe(si),Cr in ti?si(Yt.cond(on).then(Ye,".enable(",ti[Cr],");").else(Ye,".disable(",ti[Cr],");"),hr,".",Cr,"=",on,";"):si(Ye,".",Sa[Cr],"(",on,");",hr,".",Cr,"=",on,";")}}}),Object.keys(Se.state).length===0&&Xe(hr,".dirty=false;"),ce(Xe)}function Bo(Yt,ce,Se,nr){var Ye=Yt.shared,tr=Yt.current,lr=Ye.current,hr=Ye.gl,Ve;Wi(Object.keys(Se)).forEach(function(Xe){var $e=Se[Xe];if(!(nr&&!nr($e))){var Cr=$e.append(Yt,ce);if(ti[Xe]){var on=ti[Xe];ja($e)?(Ve=Yt.link(Cr,{stable:!0}),ce(Yt.cond(Ve).then(hr,".enable(",on,");").else(hr,".disable(",on,");")),ce(lr,".",Xe,"=",Ve,";")):(ce(Yt.cond(Cr).then(hr,".enable(",on,");").else(hr,".disable(",on,");")),ce(lr,".",Xe,"=",Cr,";"))}else if(Pn(Cr)){var fn=tr[Xe];ce(hr,".",Sa[Xe],"(",Cr,");",Cr.map(function(fi,si){return fn+"["+si+"]="+fi}).join(";"),";")}else ja($e)?(Ve=Yt.link(Cr,{stable:!0}),ce(hr,".",Sa[Xe],"(",Ve,");",lr,".",Xe,"=",Ve,";")):ce(hr,".",Sa[Xe],"(",Cr,");",lr,".",Xe,"=",Cr,";")}})}function Tu(Yt,ce){_i&&(Yt.instancing=ce.def(Yt.shared.extensions,".angle_instanced_arrays"))}function ol(Yt,ce,Se,nr,Ye){var tr=Yt.shared,lr=Yt.stats,hr=tr.current,Ve=tr.timer,Xe=Se.profile;function $e(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Cr,on;function fn(Ki){Cr=ce.def(),Ki(Cr,"=",$e(),";"),typeof Ye=="string"?Ki(lr,".count+=",Ye,";"):Ki(lr,".count++;"),ta&&(nr?(on=ce.def(),Ki(on,"=",Ve,".getNumPendingQueries();")):Ki(Ve,".beginQuery(",lr,");"))}function fi(Ki){Ki(lr,".cpuTime+=",$e(),"-",Cr,";"),ta&&(nr?Ki(Ve,".pushScopeStats(",on,",",Ve,".getNumPendingQueries(),",lr,");"):Ki(Ve,".endQuery();"))}function si(Ki){var Ai=ce.def(hr,".profile");ce(hr,".profile=",Ki,";"),ce.exit(hr,".profile=",Ai,";")}var Gn;if(Xe){if(ja(Xe)){Xe.enable?(fn(ce),fi(ce.exit),si("true")):si("false");return}Gn=Xe.append(Yt,ce),si(Gn)}else Gn=ce.def(hr,".profile");var Mi=Yt.block();fn(Mi),ce("if(",Gn,"){",Mi,"}");var di=Yt.block();fi(di),ce.exit("if(",Gn,"){",di,"}")}function Cu(Yt,ce,Se,nr,Ye){var tr=Yt.shared;function lr(Ve){switch(Ve){case ha:case Mo:case Os:return 2;case ka:case hs:case bl:return 3;case io:case hl:case Su:return 4;default:return 1}}function hr(Ve,Xe,$e){var Cr=tr.gl,on=ce.def(Ve,".location"),fn=ce.def(tr.attributes,"[",on,"]"),fi=$e.state,si=$e.buffer,Gn=[$e.x,$e.y,$e.z,$e.w],Mi=["buffer","normalized","offset","stride"];function di(){ce("if(!",fn,".buffer){",Cr,".enableVertexAttribArray(",on,");}");var Ai=$e.type,Si;if($e.size?Si=ce.def($e.size,"||",Xe):Si=Xe,ce("if(",fn,".type!==",Ai,"||",fn,".size!==",Si,"||",Mi.map(function(Qa){return fn+"."+Qa+"!=="+$e[Qa]}).join("||"),"){",Cr,".bindBuffer(",Ie,",",si,".buffer);",Cr,".vertexAttribPointer(",[on,Si,Ai,$e.normalized,$e.stride,$e.offset],");",fn,".type=",Ai,";",fn,".size=",Si,";",Mi.map(function(Qa){return fn+"."+Qa+"="+$e[Qa]+";"}).join(""),"}"),_i){var sa=$e.divisor;ce("if(",fn,".divisor!==",sa,"){",Yt.instancing,".vertexAttribDivisorANGLE(",[on,sa],");",fn,".divisor=",sa,";}")}}function Ki(){ce("if(",fn,".buffer){",Cr,".disableVertexAttribArray(",on,");",fn,".buffer=null;","}if(",$a.map(function(Ai,Si){return fn+"."+Ai+"!=="+Gn[Si]}).join("||"),"){",Cr,".vertexAttrib4f(",on,",",Gn,");",$a.map(function(Ai,Si){return fn+"."+Ai+"="+Gn[Si]+";"}).join(""),"}")}fi===za?di():fi===wa?Ki():(ce("if(",fi,"===",za,"){"),di(),ce("}else{"),Ki(),ce("}"))}nr.forEach(function(Ve){var Xe=Ve.name,$e=Se.attributes[Xe],Cr;if($e){if(!Ye($e))return;Cr=$e.append(Yt,ce)}else{if(!Ye(Lo))return;var on=Yt.scopeAttrib(Xe);Cr={},Object.keys(new Nn).forEach(function(fn){Cr[fn]=ce.def(on,".",fn)})}hr(Yt.link(Ve),lr(Ve.info.type),Cr)})}function xc(Yt,ce,Se,nr,Ye,tr){for(var lr=Yt.shared,hr=lr.gl,Ve,Xe=0;Xe<nr.length;++Xe){var $e=nr[Xe],Cr=$e.name,on=$e.info.type,fn=Se.uniforms[Cr],fi=Yt.link($e),si=fi+".location",Gn;if(fn){if(!Ye(fn))continue;if(ja(fn)){var Mi=fn.value;if(on===Yu||on===dc){var di=Yt.link(Mi._texture||Mi.color[0]._texture);ce(hr,".uniform1i(",si,",",di+".bind());"),ce.exit(di,".unbind();")}else if(on===mu||on===Ws||on===qs){var Ki=Yt.global.def("new Float32Array(["+Array.prototype.slice.call(Mi)+"])"),Ai=2;on===Ws?Ai=3:on===qs&&(Ai=4),ce(hr,".uniformMatrix",Ai,"fv(",si,",false,",Ki,");")}else{switch(on){case da:Ve="1f";break;case ha:Ve="2f";break;case ka:Ve="3f";break;case io:Ve="4f";break;case vl:Ve="1i";break;case Ro:Ve="1i";break;case Os:Ve="2i";break;case Mo:Ve="2i";break;case bl:Ve="3i";break;case hs:Ve="3i";break;case Su:Ve="4i";break;case hl:Ve="4i";break}ce(hr,".uniform",Ve,"(",si,",",Pn(Mi)?Array.prototype.slice.call(Mi):Mi,");")}continue}else Gn=fn.append(Yt,ce)}else{if(!Ye(Lo))continue;Gn=ce.def(lr.uniforms,"[",kr.id(Cr),"]")}on===Yu?ce("if(",Gn,"&&",Gn,'._reglType==="framebuffer"){',Gn,"=",Gn,".color[0];","}"):on===dc&&ce("if(",Gn,"&&",Gn,'._reglType==="framebufferCube"){',Gn,"=",Gn,".color[0];","}");var Si=1;switch(on){case Yu:case dc:var sa=ce.def(Gn,"._texture");ce(hr,".uniform1i(",si,",",sa,".bind());"),ce.exit(sa,".unbind();");continue;case Ro:case vl:Ve="1i";break;case Mo:case Os:Ve="2i",Si=2;break;case hs:case bl:Ve="3i",Si=3;break;case hl:case Su:Ve="4i",Si=4;break;case da:Ve="1f";break;case ha:Ve="2f",Si=2;break;case ka:Ve="3f",Si=3;break;case io:Ve="4f",Si=4;break;case mu:Ve="Matrix2fv";break;case Ws:Ve="Matrix3fv";break;case qs:Ve="Matrix4fv";break}if(Ve.charAt(0)==="M"){ce(hr,".uniform",Ve,"(",si,",");var Qa=Math.pow(on-mu+2,2),so=Yt.global.def("new Float32Array(",Qa,")");Array.isArray(Gn)?ce("false,(",h(Qa,function(dl){return so+"["+dl+"]="+Gn[dl]}),",",so,")"):ce("false,(Array.isArray(",Gn,")||",Gn," instanceof Float32Array)?",Gn,":(",h(Qa,function(dl){return so+"["+dl+"]="+Gn+"["+dl+"]"}),",",so,")"),ce(");")}else if(Si>1){for(var Vo=[],vs=[],zl=0;zl<Si;++zl)Array.isArray(Gn)?vs.push(Gn[zl]):vs.push(ce.def(Gn+"["+zl+"]")),tr&&Vo.push(ce.def());tr&&ce("if(!",Yt.batchId,"||",Vo.map(function(dl,Ul){return dl+"!=="+vs[Ul]}).join("||"),"){",Vo.map(function(dl,Ul){return dl+"="+vs[Ul]+";"}).join("")),ce(hr,".uniform",Ve,"(",si,",",vs.join(","),");"),tr&&ce("}")}else{if(tr){var jl=ce.def();ce("if(!",Yt.batchId,"||",jl,"!==",Gn,"){",jl,"=",Gn,";")}ce(hr,".uniform",Ve,"(",si,",",Gn,");"),tr&&ce("}")}}}function Eo(Yt,ce,Se,nr){var Ye=Yt.shared,tr=Ye.gl,lr=Ye.draw,hr=nr.draw;function Ve(){var Si=hr.elements,sa,Qa=ce;return Si?((Si.contextDep&&nr.contextDynamic||Si.propDep)&&(Qa=Se),sa=Si.append(Yt,Qa),hr.elementsActive&&Qa("if("+sa+")"+tr+".bindBuffer("+Ze+","+sa+".buffer.buffer);")):(sa=Qa.def(),Qa(sa,"=",lr,".",Et,";","if(",sa,"){",tr,".bindBuffer(",Ze,",",sa,".buffer.buffer);}","else if(",Ye.vao,".currentVAO){",sa,"=",Yt.shared.elements+".getElements("+Ye.vao,".currentVAO.elements);",Ma?"":"if("+sa+")"+tr+".bindBuffer("+Ze+","+sa+".buffer.buffer);","}")),sa}function Xe(){var Si=hr.count,sa,Qa=ce;return Si?((Si.contextDep&&nr.contextDynamic||Si.propDep)&&(Qa=Se),sa=Si.append(Yt,Qa)):sa=Qa.def(lr,".",Vt),sa}var $e=Ve();function Cr(Si){var sa=hr[Si];return sa?sa.contextDep&&nr.contextDynamic||sa.propDep?sa.append(Yt,Se):sa.append(Yt,ce):ce.def(lr,".",Si)}var on=Cr(It),fn=Cr(ke),fi=Xe();if(typeof fi=="number"){if(fi===0)return}else Se("if(",fi,"){"),Se.exit("}");var si,Gn;_i&&(si=Cr(Oe),Gn=Yt.instancing);var Mi=$e+".type",di=hr.elements&&ja(hr.elements)&&!hr.vaoActive;function Ki(){function Si(){Se(Gn,".drawElementsInstancedANGLE(",[on,fi,Mi,fn+"<<(("+Mi+"-"+ua+")>>1)",si],");")}function sa(){Se(Gn,".drawArraysInstancedANGLE(",[on,fn,fi,si],");")}$e&&$e!=="null"?di?Si():(Se("if(",$e,"){"),Si(),Se("}else{"),sa(),Se("}")):sa()}function Ai(){function Si(){Se(tr+".drawElements("+[on,fi,Mi,fn+"<<(("+Mi+"-"+ua+")>>1)"]+");")}function sa(){Se(tr+".drawArrays("+[on,fn,fi]+");")}$e&&$e!=="null"?di?Si():(Se("if(",$e,"){"),Si(),Se("}else{"),sa(),Se("}")):sa()}_i&&(typeof si!="number"||si>=0)?typeof si=="string"?(Se("if(",si,">0){"),Ki(),Se("}else if(",si,"<0){"),Ai(),Se("}")):Ki():Ai()}function Ss(Yt,ce,Se,nr,Ye){var tr=Oa(),lr=tr.proc("body",Ye);return _i&&(tr.instancing=lr.def(tr.shared.extensions,".angle_instanced_arrays")),Yt(tr,lr,Se,nr),tr.compile().body}function Ml(Yt,ce,Se,nr){Tu(Yt,ce),Se.useVAO?Se.drawVAO?ce(Yt.shared.vao,".setVAO(",Se.drawVAO.append(Yt,ce),");"):ce(Yt.shared.vao,".setVAO(",Yt.shared.vao,".targetVAO);"):(ce(Yt.shared.vao,".setVAO(null);"),Cu(Yt,ce,Se,nr.attributes,function(){return!0})),xc(Yt,ce,Se,nr.uniforms,function(){return!0},!1),Eo(Yt,ce,ce,Se)}function yl(Yt,ce){var Se=Yt.proc("draw",1);Tu(Yt,Se),yu(Yt,Se,ce.context),hu(Yt,Se,ce.framebuffer),ku(Yt,Se,ce),Bo(Yt,Se,ce.state),ol(Yt,Se,ce,!1,!0);var nr=ce.shader.progVar.append(Yt,Se);if(Se(Yt.shared.gl,".useProgram(",nr,".program);"),ce.shader.program)Ml(Yt,Se,ce,ce.shader.program);else{Se(Yt.shared.vao,".setVAO(null);");var Ye=Yt.global.def("{}"),tr=Se.def(nr,".id"),lr=Se.def(Ye,"[",tr,"]");Se(Yt.cond(lr).then(lr,".call(this,a0);").else(lr,"=",Ye,"[",tr,"]=",Yt.link(function(hr){return Ss(Ml,Yt,ce,hr,1)}),"(",nr,");",lr,".call(this,a0);"))}Object.keys(ce.state).length>0&&Se(Yt.shared.current,".dirty=true;"),Yt.shared.vao&&Se(Yt.shared.vao,".setVAO(null);")}function Z(Yt,ce,Se,nr){Yt.batchId="a1",Tu(Yt,ce);function Ye(){return!0}Cu(Yt,ce,Se,nr.attributes,Ye),xc(Yt,ce,Se,nr.uniforms,Ye,!1),Eo(Yt,ce,ce,Se)}function ot(Yt,ce,Se,nr){Tu(Yt,ce);var Ye=Se.contextDep,tr=ce.def(),lr="a0",hr="a1",Ve=ce.def();Yt.shared.props=Ve,Yt.batchId=tr;var Xe=Yt.scope(),$e=Yt.scope();ce(Xe.entry,"for(",tr,"=0;",tr,"<",hr,";++",tr,"){",Ve,"=",lr,"[",tr,"];",$e,"}",Xe.exit);function Cr(Mi){return Mi.contextDep&&Ye||Mi.propDep}function on(Mi){return!Cr(Mi)}if(Se.needsContext&&yu(Yt,$e,Se.context),Se.needsFramebuffer&&hu(Yt,$e,Se.framebuffer),Bo(Yt,$e,Se.state,Cr),Se.profile&&Cr(Se.profile)&&ol(Yt,$e,Se,!1,!0),nr)Se.useVAO?Se.drawVAO?Cr(Se.drawVAO)?$e(Yt.shared.vao,".setVAO(",Se.drawVAO.append(Yt,$e),");"):Xe(Yt.shared.vao,".setVAO(",Se.drawVAO.append(Yt,Xe),");"):Xe(Yt.shared.vao,".setVAO(",Yt.shared.vao,".targetVAO);"):(Xe(Yt.shared.vao,".setVAO(null);"),Cu(Yt,Xe,Se,nr.attributes,on),Cu(Yt,$e,Se,nr.attributes,Cr)),xc(Yt,Xe,Se,nr.uniforms,on,!1),xc(Yt,$e,Se,nr.uniforms,Cr,!0),Eo(Yt,Xe,$e,Se);else{var fn=Yt.global.def("{}"),fi=Se.shader.progVar.append(Yt,$e),si=$e.def(fi,".id"),Gn=$e.def(fn,"[",si,"]");$e(Yt.shared.gl,".useProgram(",fi,".program);","if(!",Gn,"){",Gn,"=",fn,"[",si,"]=",Yt.link(function(Mi){return Ss(Z,Yt,Se,Mi,2)}),"(",fi,");}",Gn,".call(this,a0[",tr,"],",tr,");")}}function et(Yt,ce){var Se=Yt.proc("batch",2);Yt.batchId="0",Tu(Yt,Se);var nr=!1,Ye=!0;Object.keys(ce.context).forEach(function(fn){nr=nr||ce.context[fn].propDep}),nr||(yu(Yt,Se,ce.context),Ye=!1);var tr=ce.framebuffer,lr=!1;tr?(tr.propDep?nr=lr=!0:tr.contextDep&&nr&&(lr=!0),lr||hu(Yt,Se,tr)):hu(Yt,Se,null),ce.state.viewport&&ce.state.viewport.propDep&&(nr=!0);function hr(fn){return fn.contextDep&&nr||fn.propDep}ku(Yt,Se,ce),Bo(Yt,Se,ce.state,function(fn){return!hr(fn)}),(!ce.profile||!hr(ce.profile))&&ol(Yt,Se,ce,!1,"a1"),ce.contextDep=nr,ce.needsContext=Ye,ce.needsFramebuffer=lr;var Ve=ce.shader.progVar;if(Ve.contextDep&&nr||Ve.propDep)ot(Yt,Se,ce,null);else{var Xe=Ve.append(Yt,Se);if(Se(Yt.shared.gl,".useProgram(",Xe,".program);"),ce.shader.program)ot(Yt,Se,ce,ce.shader.program);else{Se(Yt.shared.vao,".setVAO(null);");var $e=Yt.global.def("{}"),Cr=Se.def(Xe,".id"),on=Se.def($e,"[",Cr,"]");Se(Yt.cond(on).then(on,".call(this,a0,a1);").else(on,"=",$e,"[",Cr,"]=",Yt.link(function(fn){return Ss(ot,Yt,ce,fn,2)}),"(",Xe,");",on,".call(this,a0,a1);"))}}Object.keys(ce.state).length>0&&Se(Yt.shared.current,".dirty=true;"),Yt.shared.vao&&Se(Yt.shared.vao,".setVAO(null);")}function xt(Yt,ce){var Se=Yt.proc("scope",3);Yt.batchId="a2";var nr=Yt.shared,Ye=nr.current;if(yu(Yt,Se,ce.context),ce.framebuffer&&ce.framebuffer.append(Yt,Se),Wi(Object.keys(ce.state)).forEach(function(hr){var Ve=ce.state[hr],Xe=Ve.append(Yt,Se);Pn(Xe)?Xe.forEach(function($e,Cr){_a($e)?Se.set(Yt.next[hr],"["+Cr+"]",$e):Se.set(Yt.next[hr],"["+Cr+"]",Yt.link($e,{stable:!0}))}):ja(Ve)?Se.set(nr.next,"."+hr,Yt.link(Xe,{stable:!0})):Se.set(nr.next,"."+hr,Xe)}),ol(Yt,Se,ce,!0,!0),[Et,ke,Vt,Oe,It].forEach(function(hr){var Ve=ce.draw[hr];if(Ve){var Xe=Ve.append(Yt,Se);_a(Xe)?Se.set(nr.draw,"."+hr,Xe):Se.set(nr.draw,"."+hr,Yt.link(Xe),{stable:!0})}}),Object.keys(ce.uniforms).forEach(function(hr){var Ve=ce.uniforms[hr].append(Yt,Se);Array.isArray(Ve)&&(Ve="["+Ve.map(function(Xe){return _a(Xe)?Xe:Yt.link(Xe,{stable:!0})})+"]"),Se.set(nr.uniforms,"["+Yt.link(kr.id(hr),{stable:!0})+"]",Ve)}),Object.keys(ce.attributes).forEach(function(hr){var Ve=ce.attributes[hr].append(Yt,Se),Xe=Yt.scopeAttrib(hr);Object.keys(new Nn).forEach(function($e){Se.set(Xe,"."+$e,Ve[$e])})}),ce.scopeVAO){var tr=ce.scopeVAO.append(Yt,Se);_a(tr)?Se.set(nr.vao,".targetVAO",tr):Se.set(nr.vao,".targetVAO",Yt.link(tr,{stable:!0}))}function lr(hr){var Ve=ce.shader[hr];if(Ve){var Xe=Ve.append(Yt,Se);_a(Xe)?Se.set(nr.shader,"."+hr,Xe):Se.set(nr.shader,"."+hr,Yt.link(Xe,{stable:!0}))}}lr(I),lr(ht),Object.keys(ce.state).length>0&&(Se(Ye,".dirty=true;"),Se.exit(Ye,".dirty=true;")),Se("a1(",Yt.shared.context,",a0,",Yt.batchId,");")}function Ut(Yt){if(!(typeof Yt!="object"||Pn(Yt))){for(var ce=Object.keys(Yt),Se=0;Se<ce.length;++Se)if(f.isDynamic(Yt[ce[Se]]))return!0;return!1}}function fe(Yt,ce,Se){var nr=ce.static[Se];if(!nr||!Ut(nr))return;var Ye=Yt.global,tr=Object.keys(nr),lr=!1,hr=!1,Ve=!1,Xe=Yt.global.def("{}");tr.forEach(function(Cr){var on=nr[Cr];if(f.isDynamic(on)){typeof on=="function"&&(on=nr[Cr]=f.unbox(on));var fn=ro(on,null);lr=lr||fn.thisDep,Ve=Ve||fn.propDep,hr=hr||fn.contextDep}else{switch(Ye(Xe,".",Cr,"="),typeof on){case"number":Ye(on);break;case"string":Ye('"',on,'"');break;case"object":Array.isArray(on)&&Ye("[",on.join(),"]");break;default:Ye(Yt.link(on));break}Ye(";")}});function $e(Cr,on){tr.forEach(function(fn){var fi=nr[fn];if(f.isDynamic(fi)){var si=Cr.invoke(on,fi);on(Xe,".",fn,"=",si,";")}})}ce.dynamic[Se]=new f.DynamicVariable(os,{thisDep:lr,contextDep:hr,propDep:Ve,ref:Xe,append:$e}),delete ce.static[Se]}function ye(Yt,ce,Se,nr,Ye){var tr=Oa();tr.stats=tr.link(Ye),Object.keys(ce.static).forEach(function(hr){fe(tr,ce,hr)}),je.forEach(function(hr){fe(tr,Yt,hr)});var lr=yc(Yt,ce,Se,nr,tr);return lr.shader.program&&(lr.shader.program.attributes.sort(function(hr,Ve){return hr.name<Ve.name?-1:1}),lr.shader.program.uniforms.sort(function(hr,Ve){return hr.name<Ve.name?-1:1})),yl(tr,lr),xt(tr,lr),et(tr,lr),c(tr.compile(),{destroy:function(){lr.shader.program.destroy()}})}return{next:Ua,current:ca,procs:function(){var Yt=Oa(),ce=Yt.proc("poll"),Se=Yt.proc("refresh"),nr=Yt.block();ce(nr),Se(nr);var Ye=Yt.shared,tr=Ye.gl,lr=Ye.next,hr=Ye.current;nr(hr,".dirty=false;"),hu(Yt,ce),hu(Yt,Se,null,!0);var Ve;_i&&(Ve=Yt.link(_i)),Lr.oes_vertex_array_object&&Se(Yt.link(Lr.oes_vertex_array_object),".bindVertexArrayOES(null);");var Xe=Se.def(Ye.attributes),$e=Se.def(0),Cr=Yt.cond($e,".buffer");Cr.then(tr,".enableVertexAttribArray(i);",tr,".bindBuffer(",Ie,",",$e,".buffer.buffer);",tr,".vertexAttribPointer(i,",$e,".size,",$e,".type,",$e,".normalized,",$e,".stride,",$e,".offset);").else(tr,".disableVertexAttribArray(i);",tr,".vertexAttrib4f(i,",$e,".x,",$e,".y,",$e,".z,",$e,".w);",$e,".buffer=null;");var on=Yt.link(Dn.maxAttributes,{stable:!0});return Se("for(var i=0;i<",on,";++i){",$e,"=",Xe,"[i];",Cr,"}"),_i&&Se("for(var i=0;i<",on,";++i){",Ve,".vertexAttribDivisorANGLE(i,",Xe,"[i].divisor);","}"),Se(Yt.shared.vao,".currentVAO=null;",Yt.shared.vao,".setVAO(",Yt.shared.vao,".targetVAO);"),Object.keys(ti).forEach(function(fn){var fi=ti[fn],si=nr.def(lr,".",fn),Gn=Yt.block();Gn("if(",si,"){",tr,".enable(",fi,")}else{",tr,".disable(",fi,")}",hr,".",fn,"=",si,";"),Se(Gn),ce("if(",si,"!==",hr,".",fn,"){",Gn,"}")}),Object.keys(Sa).forEach(function(fn){var fi=Sa[fn],si=ca[fn],Gn,Mi,di=Yt.block();if(di(tr,".",fi,"("),Pn(si)){var Ki=si.length;Gn=Yt.global.def(lr,".",fn),Mi=Yt.global.def(hr,".",fn),di(h(Ki,function(Ai){return Gn+"["+Ai+"]"}),");",h(Ki,function(Ai){return Mi+"["+Ai+"]="+Gn+"["+Ai+"];"}).join("")),ce("if(",h(Ki,function(Ai){return Gn+"["+Ai+"]!=="+Mi+"["+Ai+"]"}).join("||"),"){",di,"}")}else Gn=nr.def(lr,".",fn),Mi=nr.def(hr,".",fn),di(Gn,");",hr,".",fn,"=",Gn,";"),ce("if(",Gn,"!==",Mi,"){",di,"}");Se(di)}),Yt.compile()}(),compile:ye}}function Uo(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var al=34918,Wo=34919,ps=35007,Tl=function(_e,kr){if(!kr.ext_disjoint_timer_query)return null;var Lr=[];function Dn(){return Lr.pop()||kr.ext_disjoint_timer_query.createQueryEXT()}function oi(Oi){Lr.push(Oi)}var Jn=[];function gn(Oi){var _i=Dn();kr.ext_disjoint_timer_query.beginQueryEXT(ps,_i),Jn.push(_i),ta(Jn.length-1,Jn.length,Oi)}function ni(){kr.ext_disjoint_timer_query.endQueryEXT(ps)}function Yi(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var Ui=[];function va(){return Ui.pop()||new Yi}function Za(Oi){Ui.push(Oi)}var Ba=[];function ta(Oi,_i,Qn){var Ma=va();Ma.startQueryIndex=Oi,Ma.endQueryIndex=_i,Ma.sum=0,Ma.stats=Qn,Ba.push(Ma)}var wi=[],hn=[];function Nn(){var Oi,_i,Qn=Jn.length;if(Qn!==0){hn.length=Math.max(hn.length,Qn+1),wi.length=Math.max(wi.length,Qn+1),wi[0]=0,hn[0]=0;var Ma=0;for(Oi=0,_i=0;_i<Jn.length;++_i){var ca=Jn[_i];kr.ext_disjoint_timer_query.getQueryObjectEXT(ca,Wo)?(Ma+=kr.ext_disjoint_timer_query.getQueryObjectEXT(ca,al),oi(ca)):Jn[Oi++]=ca,wi[_i+1]=Ma,hn[_i+1]=Oi}for(Jn.length=Oi,Oi=0,_i=0;_i<Ba.length;++_i){var Ua=Ba[_i],vi=Ua.startQueryIndex,ti=Ua.endQueryIndex;Ua.sum+=wi[ti]-wi[vi];var Sa=hn[vi],pa=hn[ti];pa===Sa?(Ua.stats.gpuTime+=Ua.sum/1e6,Za(Ua)):(Ua.startQueryIndex=Sa,Ua.endQueryIndex=pa,Ba[Oi++]=Ua)}Ba.length=Oi}}return{beginQuery:gn,endQuery:ni,pushScopeStats:ta,update:Nn,getNumPendingQueries:function(){return Jn.length},clear:function(){Lr.push.apply(Lr,Jn);for(var Oi=0;Oi<Lr.length;Oi++)kr.ext_disjoint_timer_query.deleteQueryEXT(Lr[Oi]);Jn.length=0,Lr.length=0},restore:function(){Jn.length=0,Lr.length=0}}},Ku=16384,cu=256,_o=1024,Zs=34962,rl="webglcontextlost",ou="webglcontextrestored",Gl=1,rh=2,Bl=3;function Ql(_e,kr){for(var Lr=0;Lr<_e.length;++Lr)if(_e[Lr]===kr)return Lr;return-1}function bh(_e){var kr=E(_e);if(!kr)return null;var Lr=kr.gl,Dn=Lr.getContextAttributes();Lr.isContextLost();var oi=A(Lr,kr);if(!oi)return null;var Jn=v(),gn=Uo(),ni=kr.cachedCode||{},Yi=oi.extensions,Ui=Tl(Lr,Yi),va=y(),Za=Lr.drawingBufferWidth,Ba=Lr.drawingBufferHeight,ta={tick:0,time:0,viewportWidth:Za,viewportHeight:Ba,framebufferWidth:Za,framebufferHeight:Ba,drawingBufferWidth:Za,drawingBufferHeight:Ba,pixelRatio:kr.pixelRatio},wi={},hn={elements:null,primitive:4,count:-1,offset:0,instances:-1},Nn=br(Lr,Yi),Oi=wn(Lr,gn,kr,Ma),_i=dr(Lr,Yi,Oi,gn),Qn=Ch(Lr,Yi,Nn,gn,Oi,_i,hn);function Ma(Eo){return Qn.destroyBuffer(Eo)}var ca=qh(Lr,Jn,gn,kr),Ua=mh(Lr,Yi,Nn,function(){Sa.procs.poll()},ta,gn,kr),vi=Hh(Lr,Yi,Nn,gn,kr),ti=Qc(Lr,Yi,Nn,Ua,vi,gn),Sa=Fo(Lr,Jn,Yi,Nn,Oi,_i,Ua,ti,wi,Qn,ca,hn,ta,Ui,ni,kr),pa=zd(Lr,ti,Sa.procs.poll,ta),qi=Sa.next,$i=Lr.canvas,_a=[],Po=[],wo=[],xa=[kr.onDestroy],Oa=null;function ho(){if(_a.length===0){Ui&&Ui.update(),Oa=null;return}Oa=x.next(ho),hu();for(var Eo=_a.length-1;Eo>=0;--Eo){var Ss=_a[Eo];Ss&&Ss(ta,null,0)}Lr.flush(),Ui&&Ui.update()}function So(){!Oa&&_a.length>0&&(Oa=x.next(ho))}function ts(){Oa&&(x.cancel(ho),Oa=null)}function Nl(Eo){Eo.preventDefault(),ts(),Po.forEach(function(Ss){Ss()})}function Al(Eo){Lr.getError(),oi.restore(),ca.restore(),Oi.restore(),Ua.restore(),vi.restore(),ti.restore(),Qn.restore(),Ui&&Ui.restore(),Sa.procs.refresh(),So(),wo.forEach(function(Ss){Ss()})}$i&&($i.addEventListener(rl,Nl,!1),$i.addEventListener(ou,Al,!1));function us(){_a.length=0,ts(),$i&&($i.removeEventListener(rl,Nl),$i.removeEventListener(ou,Al)),ca.clear(),ti.clear(),vi.clear(),Qn.clear(),Ua.clear(),_i.clear(),Oi.clear(),Ui&&Ui.clear(),xa.forEach(function(Eo){Eo()})}function wu(Eo){function Ss(Ye){var tr=c({},Ye);delete tr.uniforms,delete tr.attributes,delete tr.context,delete tr.vao,"stencil"in tr&&tr.stencil.op&&(tr.stencil.opBack=tr.stencil.opFront=tr.stencil.op,delete tr.stencil.op);function lr(hr){if(hr in tr){var Ve=tr[hr];delete tr[hr],Object.keys(Ve).forEach(function(Xe){tr[hr+"."+Xe]=Ve[Xe]})}}return lr("blend"),lr("depth"),lr("cull"),lr("stencil"),lr("polygonOffset"),lr("scissor"),lr("sample"),"vao"in Ye&&(tr.vao=Ye.vao),tr}function Ml(Ye,tr){var lr={},hr={};return Object.keys(Ye).forEach(function(Ve){var Xe=Ye[Ve];if(f.isDynamic(Xe)){hr[Ve]=f.unbox(Xe,Ve);return}else if(tr&&Array.isArray(Xe)){for(var $e=0;$e<Xe.length;++$e)if(f.isDynamic(Xe[$e])){hr[Ve]=f.unbox(Xe,Ve);return}}lr[Ve]=Xe}),{dynamic:hr,static:lr}}var yl=Ml(Eo.context||{},!0),Z=Ml(Eo.uniforms||{},!0),ot=Ml(Eo.attributes||{},!1),et=Ml(Ss(Eo),!1),xt={gpuTime:0,cpuTime:0,count:0},Ut=Sa.compile(et,ot,Z,yl,xt),fe=Ut.draw,ye=Ut.batch,Yt=Ut.scope,ce=[];function Se(Ye){for(;ce.length<Ye;)ce.push(null);return ce}function nr(Ye,tr){var lr;if(typeof Ye=="function")return Yt.call(this,null,Ye,0);if(typeof tr=="function")if(typeof Ye=="number")for(lr=0;lr<Ye;++lr)Yt.call(this,null,tr,lr);else if(Array.isArray(Ye))for(lr=0;lr<Ye.length;++lr)Yt.call(this,Ye[lr],tr,lr);else return Yt.call(this,Ye,tr,0);else if(typeof Ye=="number"){if(Ye>0)return ye.call(this,Se(Ye|0),Ye|0)}else if(Array.isArray(Ye)){if(Ye.length)return ye.call(this,Ye,Ye.length)}else return fe.call(this,Ye)}return c(nr,{stats:xt,destroy:function(){Ut.destroy()}})}var fl=ti.setFBO=wu({framebuffer:f.define.call(null,Gl,"framebuffer")});function Eu(Eo,Ss){var Ml=0;Sa.procs.poll();var yl=Ss.color;yl&&(Lr.clearColor(+yl[0]||0,+yl[1]||0,+yl[2]||0,+yl[3]||0),Ml|=Ku),"depth"in Ss&&(Lr.clearDepth(+Ss.depth),Ml|=cu),"stencil"in Ss&&(Lr.clearStencil(Ss.stencil|0),Ml|=_o),Lr.clear(Ml)}function pc(Eo){if("framebuffer"in Eo)if(Eo.framebuffer&&Eo.framebuffer_reglType==="framebufferCube")for(var Ss=0;Ss<6;++Ss)fl(c({framebuffer:Eo.framebuffer.faces[Ss]},Eo),Eu);else fl(Eo,Eu);else Eu(null,Eo)}function yc(Eo){_a.push(Eo);function Ss(){var Ml=Ql(_a,Eo);function yl(){var Z=Ql(_a,yl);_a[Z]=_a[_a.length-1],_a.length-=1,_a.length<=0&&ts()}_a[Ml]=yl}return So(),{cancel:Ss}}function yu(){var Eo=qi.viewport,Ss=qi.scissor_box;Eo[0]=Eo[1]=Ss[0]=Ss[1]=0,ta.viewportWidth=ta.framebufferWidth=ta.drawingBufferWidth=Eo[2]=Ss[2]=Lr.drawingBufferWidth,ta.viewportHeight=ta.framebufferHeight=ta.drawingBufferHeight=Eo[3]=Ss[3]=Lr.drawingBufferHeight}function hu(){ta.tick+=1,ta.time=Bo(),yu(),Sa.procs.poll()}function ku(){Ua.refresh(),yu(),Sa.procs.refresh(),Ui&&Ui.update()}function Bo(){return(y()-va)/1e3}ku();function Tu(Eo,Ss){var Ml;switch(Eo){case"frame":return yc(Ss);case"lost":Ml=Po;break;case"restore":Ml=wo;break;case"destroy":Ml=xa;break}return Ml.push(Ss),{cancel:function(){for(var yl=0;yl<Ml.length;++yl)if(Ml[yl]===Ss){Ml[yl]=Ml[Ml.length-1],Ml.pop();return}}}}function ol(){return ni}function Cu(Eo){Object.entries(Eo).forEach(function(Ss){ni[Ss[0]]=Ss[1]})}var xc=c(wu,{clear:pc,prop:f.define.bind(null,Gl),context:f.define.bind(null,rh),this:f.define.bind(null,Bl),draw:wu({}),buffer:function(Eo){return Oi.create(Eo,Zs,!1,!1)},elements:function(Eo){return _i.create(Eo,!1)},texture:Ua.create2D,cube:Ua.createCube,renderbuffer:vi.create,framebuffer:ti.create,framebufferCube:ti.createCube,vao:Qn.createVAO,attributes:Dn,frame:yc,on:Tu,limits:Nn,hasExtension:function(Eo){return Nn.extensions.indexOf(Eo.toLowerCase())>=0},read:pa,destroy:us,_gl:Lr,_refresh:ku,poll:function(){hu(),Ui&&Ui.update()},now:Bo,stats:gn,getCachedCode:ol,preloadCachedCode:Cu});return kr.onDone(null,xc),xc}return bh})}),uT=Ft((Q,$)=>{var c=oS(),g=gH();$.exports=function(P,S,t){var e=P._fullLayout,r=!0;return e._glcanvas.each(function(a){if(a.regl){a.regl.preloadCachedCode(t);return}if(!(a.pick&&!e._has("parcoords"))){try{a.regl=g({canvas:this,attributes:{antialias:!a.pick,preserveDrawingBuffer:!0},pixelRatio:P._context.plotGlPixelRatio||window.devicePixelRatio,extensions:S||[],cachedCode:t||{}})}catch{r=!1}a.regl||(r=!1),r&&this.addEventListener("webglcontextlost",function(n){P&&P.emit&&P.emit("plotly_webglcontextlost",{event:n,layer:a.key})},!1)}}),r||c({container:e._glcontainer.node()}),r}}),KS=Ft((f,$)=>{var c=ES(),g=jS(),P=QV(),S=mH(),t=bn(),e=v0().selectMode,r=uT(),a=Ac(),n=Na(),o=AS().styleTextSelection,i={};function s(x,y,v,T){var u=x._size,b=x.width*T,_=x.height*T,C=u.l*T,M=u.b*T,E=u.r*T,A=u.t*T,h=u.w*T,p=u.h*T;return[C+y.domain[0]*h,M+v.domain[0]*p,b-E-(1-y.domain[1])*h,_-A-(1-v.domain[1])*p]}var f=$.exports=function(x,y,v){if(v.length){var T=x._fullLayout,u=y._scene,b=y.xaxis,_=y.yaxis,C,M;if(u){var E=r(x,["ANGLE_instanced_arrays","OES_element_index_uint"],i);if(!E){u.init();return}var A=u.count,h=T._glcanvas.data()[0].regl;if(n(x,y,v),u.dirty){if((u.line2d||u.error2d)&&!(u.scatter2d||u.fill2d||u.glText)&&h.clear({color:!0,depth:!0}),u.error2d===!0&&(u.error2d=P(h)),u.line2d===!0&&(u.line2d=g(h)),u.scatter2d===!0&&(u.scatter2d=c(h)),u.fill2d===!0&&(u.fill2d=g(h)),u.glText===!0)for(u.glText=new Array(A),C=0;C<A;C++)u.glText[C]=new S(h);if(u.glText){if(A>u.glText.length){var p=A-u.glText.length;for(C=0;C<p;C++)u.glText.push(new S(h))}else if(A<u.glText.length){var k=u.glText.length-A,w=u.glText.splice(A,k);w.forEach(function(it){it.destroy()})}for(C=0;C<A;C++)u.glText[C].update(u.textOptions[C])}if(u.line2d&&(u.line2d.update(u.lineOptions),u.lineOptions=u.lineOptions.map(function(it){if(it&&it.positions){for(var Y=it.positions,ft=0;ft<Y.length&&(isNaN(Y[ft])||isNaN(Y[ft+1]));)ft+=2;for(var ut=Y.length-2;ut>ft&&(isNaN(Y[ut])||isNaN(Y[ut+1]));)ut-=2;it.positions=Y.slice(ft,ut+2)}return it}),u.line2d.update(u.lineOptions)),u.error2d){var R=(u.errorXOptions||[]).concat(u.errorYOptions||[]);u.error2d.update(R)}u.scatter2d&&u.scatter2d.update(u.markerOptions),u.fillOrder=t.repeat(null,A),u.fill2d&&(u.fillOptions=u.fillOptions.map(function(it,Y){var ft=v[Y];if(!(!it||!ft||!ft[0]||!ft[0].trace)){var ut=ft[0],wt=ut.trace,zt=ut.t,Pt=u.lineOptions[Y],Wt,Ht,Jt=[];wt._ownfill&&Jt.push(Y),wt._nexttrace&&Jt.push(Y+1),Jt.length&&(u.fillOrder[Y]=Jt);var ge=[],he=Pt&&Pt.positions||zt.positions,de,se;if(wt.fill==="tozeroy"){for(de=0;de<he.length&&isNaN(he[de+1]);)de+=2;for(se=he.length-2;se>de&&isNaN(he[se+1]);)se-=2;he[de+1]!==0&&(ge=[he[de],0]),ge=ge.concat(he.slice(de,se+2)),he[se+1]!==0&&(ge=ge.concat([he[se],0]))}else if(wt.fill==="tozerox"){for(de=0;de<he.length&&isNaN(he[de]);)de+=2;for(se=he.length-2;se>de&&isNaN(he[se]);)se-=2;he[de]!==0&&(ge=[0,he[de+1]]),ge=ge.concat(he.slice(de,se+2)),he[se]!==0&&(ge=ge.concat([0,he[se+1]]))}else if(wt.fill==="toself"||wt.fill==="tonext"){for(ge=[],Wt=0,it.splitNull=!0,Ht=0;Ht<he.length;Ht+=2)(isNaN(he[Ht])||isNaN(he[Ht+1]))&&(ge=ge.concat(he.slice(Wt,Ht)),ge.push(he[Wt],he[Wt+1]),ge.push(null,null),Wt=Ht+2);ge=ge.concat(he.slice(Wt)),Wt&&ge.push(he[Wt],he[Wt+1])}else{var Tt=wt._nexttrace;if(Tt){var Lt=u.lineOptions[Y+1];if(Lt){var Mt=Lt.positions;if(wt.fill==="tonexty"){for(ge=he.slice(),Y=Math.floor(Mt.length/2);Y--;){var te=Mt[Y*2],ve=Mt[Y*2+1];isNaN(te)||isNaN(ve)||ge.push(te,ve)}it.fill=Tt.fillcolor}}}}if(wt._prevtrace&&wt._prevtrace.fill==="tonext"){var oe=u.lineOptions[Y-1].positions,Te=ge.length/2;Wt=Te;var He=[Wt];for(Ht=0;Ht<oe.length;Ht+=2)(isNaN(oe[Ht])||isNaN(oe[Ht+1]))&&(He.push(Ht/2+Te+1),Wt=Ht+2);ge=ge.concat(oe),it.hole=He}return it.fillmode=wt.fill,it.opacity=wt.opacity,it.positions=ge,it}}),u.fill2d.update(u.fillOptions))}var O=T.dragmode,N=e(O),V=T.clickmode.indexOf("select")>-1;for(C=0;C<A;C++){var H=v[C][0],F=H.trace,U=H.t,W=U.index,q=F._length,X=U.x,lt=U.y;if(F.selectedpoints||N||V){if(N||(N=!0),F.selectedpoints){var yt=u.selectBatch[W]=t.selIndices2selPoints(F),pt={};for(M=0;M<yt.length;M++)pt[yt[M]]=1;var st=[];for(M=0;M<q;M++)pt[M]||st.push(M);u.unselectBatch[W]=st}var tt=U.xpx=new Array(q),dt=U.ypx=new Array(q);for(M=0;M<q;M++)tt[M]=b.c2p(X[M]),dt[M]=_.c2p(lt[M])}else U.xpx=U.ypx=null}if(N){if(u.select2d||(u.select2d=c(T._glcanvas.data()[1].regl)),u.scatter2d){var rt=new Array(A);for(C=0;C<A;C++)rt[C]=u.selectBatch[C].length||u.unselectBatch[C].length?u.markerUnselectedOptions[C]:{};u.scatter2d.update(rt)}u.select2d&&(u.select2d.update(u.markerOptions),u.select2d.update(u.markerSelectedOptions)),u.glText&&v.forEach(function(it){var Y=((it||[])[0]||{}).trace||{};a.hasText(Y)&&o(it)})}else u.scatter2d&&u.scatter2d.update(u.markerOptions);var at={viewport:s(T,b,_,x._context.plotGlPixelRatio),range:[(b._rl||b.range)[0],(_._rl||_.range)[0],(b._rl||b.range)[1],(_._rl||_.range)[1]]},vt=t.repeat(at,u.count);u.fill2d&&u.fill2d.update(vt),u.line2d&&u.line2d.update(vt),u.error2d&&u.error2d.update(vt.concat(vt)),u.scatter2d&&u.scatter2d.update(vt),u.select2d&&u.select2d.update(vt),u.glText&&u.glText.forEach(function(it){it.update(at)})}}};f.reglPrecompiled=i}),vH=Ft((Q,$)=>{var c=XU();c.plot=KS(),$.exports=c}),yH=Ft((Q,$)=>{$.exports=vH()}),XS=Ft((Q,$)=>{var c=tf(),g=Tc(),P=fh().axisHoverFormat,{hovertemplateAttrs:S,templatefallbackAttrs:t}=$u(),e=x3(),r=ic().idRegex,a=pu().templatedArray,n=Ta().extendFlat,o=c.marker,i=o.line,s=n(g("marker.line",{editTypeOverride:"calc"}),{width:n({},i.width,{editType:"calc"}),editType:"calc"}),f=n(g("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 x(y){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:r[y],editType:"plot"}}}$.exports={dimensions:a("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:S(),hovertemplatefallback:t(),xhoverformat:P("x"),yhoverformat:P("y"),marker:f,xaxes:x("x"),yaxes:x("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}}),cT=Ft((Q,$)=>{$.exports=function(c,g,P,S){S||(S=1/0);var t,e;for(t=0;t<g.length;t++)e=g[t],e.visible&&(S=Math.min(S,e[P].length));for(S===1/0&&(S=0),c._length=S,t=0;t<g.length;t++)e=g[t],e.visible&&(e._length=S);return S}}),xH=Ft((Q,$)=>{var c=bn(),g=Md(),P=XS(),S=Ac(),t=s0(),e=cT(),r=nT().isOpenSymbol;$.exports=function(o,i,s,f){function x(M,E){return c.coerce(o,i,P,M,E)}var y=g(o,i,{name:"dimensions",handleItemDefaults:a}),v=x("diagonal.visible"),T=x("showupperhalf"),u=x("showlowerhalf"),b=e(i,y,"values");if(!b||!v&&!T&&!u){i.visible=!1;return}x("text"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback"),x("xhoverformat"),x("yhoverformat"),t(o,i,s,f,x,{noAngleRef:!0,noStandOff:!0});var _=r(i.marker.symbol),C=S.isBubble(i);x("marker.line.width",_||C?1:0),n(o,i,f,x),c.coerceSelectionMarkerOpacity(i,x)};function a(o,i){function s(x,y){return c.coerce(o,i,P.dimensions,x,y)}s("label");var f=s("values");f&&f.length?s("visible"):i.visible=!1,s("axis.type"),s("axis.matches")}function n(o,i,s,f){var x=i.dimensions,y=x.length,v=i.showupperhalf,T=i.showlowerhalf,u=i.diagonal.visible,b,_,C=new Array(y),M=new Array(y);for(b=0;b<y;b++){var E=b?b+1:"";C[b]="x"+E,M[b]="y"+E}var A=f("xaxes",C),h=f("yaxes",M),p=i._diag=new Array(y);i._xaxes={},i._yaxes={};var k=[],w=[];function R(X,lt,yt,pt){if(X){var st=X.charAt(0),tt=s._splomAxes[st];if(i["_"+st+"axes"][X]=1,pt.push(X),!(X in tt)){var dt=tt[X]={};yt&&(dt.label=yt.label||"",yt.visible&&yt.axis&&(yt.axis.type&&(dt.type=yt.axis.type),yt.axis.matches&&(dt.matches=lt)))}}}var O=!u&&!T,N=!u&&!v;for(i._axesDim={},b=0;b<y;b++){var V=x[b],H=b===0,F=b===y-1,U=H&&O||F&&N?void 0:A[b],W=H&&N||F&&O?void 0:h[b];R(U,W,V,k),R(W,U,V,w),p[b]=[U,W],i._axesDim[U]=b,i._axesDim[W]=b}for(b=0;b<k.length;b++)for(_=0;_<w.length;_++){var q=k[b]+w[_];(b>_&&v||b<_&&T||b===_&&(u||!T||!v))&&(s._splomSubplots[q]=1)}(!T||!u&&v&&T)&&(s._splomGridDflt.xside="bottom",s._splomGridDflt.yside="left")}}),_H=Ft((Q,$)=>{var c=bn();$.exports=function(g,P){var S=g._fullLayout,t=P.uid,e=S._splomScenes;e||(e=S._splomScenes={});var r={dirty:!0,selectBatch:[],unselectBatch:[]},a={matrix:!1,selectBatch:[],unselectBatch:[]},n=e[P.uid];return n||(n=e[t]=c.extendFlat({},r,a),n.draw=function(){n.matrix&&n.matrix.draw&&(n.selectBatch.length||n.unselectBatch.length?n.matrix.draw(n.unselectBatch,n.selectBatch):n.matrix.draw()),n.dirty=!1},n.destroy=function(){n.matrix&&n.matrix.destroy&&n.matrix.destroy(),n.matrixOptions=null,n.selectBatch=null,n.unselectBatch=null,n=null}),n.dirty||c.extendFlat(n,r),n}}),bH=Ft((Q,$)=>{var c=bn(),g=Rc(),P=me().calcMarkerSize,S=me().calcAxisExpansion,t=F0(),e=gx().markerSelection,r=gx().markerStyle,a=_H(),n=Da().BADNUM,o=H1().TOO_MANY_POINTS;$.exports=function(i,s){var f=s.dimensions,x=s._length,y={},v=y.cdata=[],T=y.data=[],u=s._visibleDims=[],b,_,C,M,E;function A(R,O){for(var N=R.makeCalcdata({v:O.values,vcalendar:s.calendar},"v"),V=0;V<N.length;V++)N[V]=N[V]===n?NaN:N[V];v.push(N),T.push(R.type==="log"?c.simpleMap(N,R.c2l):N)}for(b=0;b<f.length;b++)if(C=f[b],C.visible){if(M=g.getFromId(i,s._diag[b][0]),E=g.getFromId(i,s._diag[b][1]),M&&E&&M.type!==E.type){c.log("Skipping splom dimension "+b+" with conflicting axis types");continue}M?(A(M,C),E&&E.type==="category"&&(E._categories=M._categories.slice())):A(E,C),u.push(b)}t(i,s),c.extendFlat(y,r(i,s));var h=v.length,p=h*x>o,k;for(p?k=y.sizeAvg||Math.max(y.size,3):k=P(s,x),_=0;_<u.length;_++)b=u[_],C=f[b],M=g.getFromId(i,s._diag[b][0])||{},E=g.getFromId(i,s._diag[b][1])||{},S(i,s,M,E,v[_],v[_],k);var w=a(i,s);return w.matrix||(w.matrix=!0),w.matrixOptions=y,w.selectedOptions=e(i,s,s.selected),w.unselectedOptions=e(i,s,s.unselected),[{x:!1,y:!1,t:{},trace:s}]}}),wH=Ft((Q,$)=>{(function(){var c,g,P,S,t,e;typeof performance<"u"&&performance!==null&&performance.now?$.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?($.exports=function(){return(c()-t)/1e6},g=process.hrtime,c=function(){var r;return r=g(),r[0]*1e9+r[1]},S=c(),e=process.uptime()*1e9,t=S-e):Date.now?($.exports=function(){return Date.now()-P},P=Date.now()):($.exports=function(){return new Date().getTime()-P},P=new Date().getTime())}).call(Q)}),kH=Ft((Q,$)=>{var c=wH(),g=window,P=["moz","webkit"],S="AnimationFrame",t=g["request"+S],e=g["cancel"+S]||g["cancelRequest"+S];for(r=0;!t&&r<P.length;r++)t=g[P[r]+"Request"+S],e=g[P[r]+"Cancel"+S]||g[P[r]+"CancelRequest"+S];var r;(!t||!e)&&(a=0,n=0,o=[],i=1e3/60,t=function(s){if(o.length===0){var f=c(),x=Math.max(0,i-(f-a));a=x+f,setTimeout(function(){var y=o.slice(0);o.length=0;for(var v=0;v<y.length;v++)if(!y[v].cancelled)try{y[v].callback(a)}catch(T){setTimeout(function(){throw T},0)}},Math.round(x))}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 a,n,o,i;$.exports=function(s){return t.call(g,s)},$.exports.cancel=function(){e.apply(g,arguments)},$.exports.polyfill=function(s){s||(s=g),s.requestAnimationFrame=t,s.cancelAnimationFrame=e}}),TH=Ft((Q,$)=>{$.exports=function(c,g){var P=typeof c=="number",S=typeof g=="number";P&&!S?(g=c,c=0):!P&&!S&&(c=0,g=0),c=c|0,g=g|0;var t=g-c;if(t<0)throw new Error("array length must be positive");for(var e=new Array(t),r=0,a=c;r<t;r++,a++)e[r]=a;return e}}),AH=Ft((Q,$)=>{var c=ES(),g=Cg(),P=px(),S=kH(),t=TH(),e=db(),r=mx();$.exports=a;function a(s,f){if(!(this instanceof a))return new a(s);this.traces=[],this.passes={},this.regl=s,this.scatter=c(s),this.canvas=this.scatter.canvas}a.prototype.render=function(...s){return s.length&&this.update(...s),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=S(()=>{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,S(()=>{this.dirty=!1})),this)},a.prototype.update=function(...s){if(!s.length)return;for(let y=0;y<s.length;y++)this.updateItem(y,s[y]);this.traces=this.traces.filter(Boolean);let f=[],x=0;for(let y=0;y<this.traces.length;y++){let v=this.traces[y],T=this.traces[y].passes;for(let u=0;u<T.length;u++)f.push(this.passes[T[u]]);v.passOffset=x,x+=v.passes.length}return this.scatter.update(...f),this},a.prototype.updateItem=function(s,f){let{regl:x}=this;if(f===null)return this.traces[s]=null,this;if(!f)return this;let y=g(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"}),v=this.traces[s]||(this.traces[s]={id:s,buffer:x.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),color:"black",marker:null,size:12,borderColor:"transparent",borderSize:1,viewport:e([x._gl.drawingBufferWidth,x._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(y.color!=null&&(v.color=y.color),y.size!=null&&(v.size=y.size),y.marker!=null&&(v.marker=y.marker),y.borderColor!=null&&(v.borderColor=y.borderColor),y.borderSize!=null&&(v.borderSize=y.borderSize),y.opacity!=null&&(v.opacity=y.opacity),y.viewport&&(v.viewport=e(y.viewport)),y.diagonal!=null&&(v.diagonal=y.diagonal),y.upper!=null&&(v.upper=y.upper),y.lower!=null&&(v.lower=y.lower),y.data){v.buffer(r(y.data)),v.columns=y.data.length,v.count=y.data[0].length,v.bounds=[];for(let k=0;k<v.columns;k++)v.bounds[k]=P(y.data[k],1)}let T;y.range&&(v.range=y.range,T=v.range&&typeof v.range[0]!="number"),y.domain&&(v.domain=y.domain);let u=!1;y.padding!=null&&(Array.isArray(y.padding)&&y.padding.length===v.columns&&typeof y.padding[y.padding.length-1]=="number"?(v.padding=y.padding.map(i),u=!0):v.padding=i(y.padding));let b=v.columns,_=v.count,C=v.viewport.width,M=v.viewport.height,E=v.viewport.x,A=v.viewport.y,h=C/b,p=M/b;v.passes=[];for(let k=0;k<b;k++)for(let w=0;w<b;w++){if(!v.diagonal&&w===k||!v.upper&&k>w||!v.lower&&k<w)continue;let R=n(v.id,k,w),O=this.passes[R]||(this.passes[R]={});if(y.data&&(y.transpose?O.positions={x:{buffer:v.buffer,offset:w,count:_,stride:b},y:{buffer:v.buffer,offset:k,count:_,stride:b}}:O.positions={x:{buffer:v.buffer,offset:w*_,count:_},y:{buffer:v.buffer,offset:k*_,count:_}},O.bounds=o(v.bounds,k,w)),y.domain||y.viewport||y.data){let N=u?o(v.padding,k,w):v.padding;if(v.domain){let[V,H,F,U]=o(v.domain,k,w);O.viewport=[E+V*C+N[0],A+H*M+N[1],E+F*C-N[2],A+U*M-N[3]]}else O.viewport=[E+w*h+h*N[0],A+k*p+p*N[1],E+(w+1)*h-h*N[2],A+(k+1)*p-p*N[3]]}y.color&&(O.color=v.color),y.size&&(O.size=v.size),y.marker&&(O.marker=v.marker),y.borderSize&&(O.borderSize=v.borderSize),y.borderColor&&(O.borderColor=v.borderColor),y.opacity&&(O.opacity=v.opacity),y.range&&(O.range=T?o(v.range,k,w):v.range||O.bounds),v.passes.push(R)}return this},a.prototype.draw=function(...s){if(!s.length)this.scatter.draw();else{let f=[];for(let x=0;x<s.length;x++)if(typeof s[x]=="number"){let{passes:y,passOffset:v}=this.traces[s[x]];f.push(...t(v,v+y.length))}else if(s[x].length){let y=s[x],{passes:v,passOffset:T}=this.traces[x];v=v.map((u,b)=>{f[T+b]=y})}this.scatter.draw(...f)}return this},a.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,x){let y=s.id!=null?s.id:s,v=f,T=x;return y<<16|(v&255)<<8|T&255}function o(s,f,x){let y,v,T,u,b=s[f],_=s[x];return b.length>2?(b[0],b[2],y=b[1],v=b[3]):b.length?(y=b[0],v=b[1]):(b.x,y=b.y,b.x+b.width,v=b.y+b.height),_.length>2?(T=_[0],u=_[2],_[1],_[3]):_.length?(T=_[0],u=_[1]):(T=_.x,_.y,u=_.x+_.width,_.y+_.height),[T,y,u,v]}function i(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]}}}),MH=Ft((Q,$)=>{var c=AH(),g=bn(),P=Rc(),S=v0().selectMode;$.exports=function(e,r,a){if(a.length)for(var n=0;n<a.length;n++)t(e,a[n][0])};function t(e,r){var a=e._fullLayout,n=a._size,o=r.trace,i=r.t,s=a._splomScenes[o.uid],f=s.matrixOptions,x=f.cdata,y=a._glcanvas.data()[0].regl,v=a.dragmode,T,u,b,_,C;if(x.length!==0){f.lower=o.showupperhalf,f.upper=o.showlowerhalf,f.diagonal=o.diagonal.visible;var M=o._visibleDims,E=x.length,A=s.viewOpts={};for(A.ranges=new Array(E),A.domains=new Array(E),C=0;C<M.length;C++){b=M[C];var h=A.ranges[C]=new Array(4),p=A.domains[C]=new Array(4);T=P.getFromId(e,o._diag[b][0]),T&&(h[0]=T._rl[0],h[2]=T._rl[1],p[0]=T.domain[0],p[2]=T.domain[1]),u=P.getFromId(e,o._diag[b][1]),u&&(h[1]=u._rl[0],h[3]=u._rl[1],p[1]=u.domain[0],p[3]=u.domain[1])}var k=e._context.plotGlPixelRatio,w=n.l*k,R=n.b*k,O=n.w*k,N=n.h*k;A.viewport=[w,R,O+w,N+R],s.matrix===!0&&(s.matrix=c(y));var V=a.clickmode.indexOf("select")>-1,H=S(v)||!!o.selectedpoints||V,F=!0;if(H){var U=o._length;if(o.selectedpoints){s.selectBatch=o.selectedpoints;var W=o.selectedpoints,q={};for(b=0;b<W.length;b++)q[W[b]]=!0;var X=[];for(b=0;b<U;b++)q[b]||X.push(b);s.unselectBatch=X}var lt=i.xpx=new Array(E),yt=i.ypx=new Array(E);for(C=0;C<M.length;C++){if(b=M[C],T=P.getFromId(e,o._diag[b][0]),T)for(lt[C]=new Array(U),_=0;_<U;_++)lt[C][_]=T.c2p(x[C][_]);if(u=P.getFromId(e,o._diag[b][1]),u)for(yt[C]=new Array(U),_=0;_<U;_++)yt[C][_]=u.c2p(x[C][_])}if(s.selectBatch.length||s.unselectBatch.length){var pt=g.extendFlat({},f,s.unselectedOptions,A),st=g.extendFlat({},f,s.selectedOptions,A);s.matrix.update(pt,st),F=!1}}else i.xpx=i.ypx=null;if(F){var tt=g.extendFlat({},f,A);s.matrix.update(tt,null)}}}}),JS=Ft(Q=>{Q.getDimIndex=function($,c){for(var g=c._id,P=g.charAt(0),S={x:0,y:1}[P],t=$._visibleDims,e=0;e<t.length;e++){var r=t[e];if($._diag[r][S]===g)return e}return!1}}),SH=Ft((Q,$)=>{var c=JS(),g=rT().calcHover,P=Es().getFromId,S=Ta().extendFlat;function t(r,a,n,o,i){i||(i={});var s=(o||"").charAt(0)==="x",f=(o||"").charAt(0)==="y",x=e(r,a,n);if((s||f)&&i.hoversubplots==="axis"&&x[0])for(var y=(s?r.xa:r.ya)._subplotsWith,v=i.gd,T=S({},r),u=0;u<y.length;u++){var b=y[u];if(b!==r.xa._id+r.ya._id){f?T.xa=P(v,b,"x"):T.ya=P(v,b,"y");var _=s||f,C=e(T,a,n,_);x=x.concat(C)}}return x}function e(r,a,n,o){var i=r.cd,s=i[0].trace,f=r.scene,x=f.matrixOptions.cdata,y=r.xa,v=r.ya,T=y.c2p(a),u=v.c2p(n),b=r.distance,_=c.getDimIndex(s,y),C=c.getDimIndex(s,v);if(_===!1||C===!1)return[r];for(var M=x[_],E=x[C],A,h,p=b,k=0;k<M.length;k++)if(!(o&&k!==r.index)){var w=M[k],R=E[k],O=y.c2p(w)-T,N=v.c2p(R)-u,V=Math.sqrt(O*O+N*N);(o||V<p)&&(p=h=V,A=k)}return r.index=A,r.distance=p,r.dxy=h,A===void 0?[r]:[g(r,M,E,s)]}$.exports={hoverPoints:t}}),EH=Ft((Q,$)=>{var c=bn(),g=c.pushUnique,P=Ac(),S=JS();$.exports=function(t,e){var r=t.cd,a=r[0].trace,n=r[0].t,o=t.scene,i=o.matrixOptions.cdata,s=t.xaxis,f=t.yaxis,x=[];if(!o)return x;var y=!P.hasMarkers(a)&&!P.hasText(a);if(a.visible!==!0||y)return x;var v=S.getDimIndex(a,s),T=S.getDimIndex(a,f);if(v===!1||T===!1)return x;var u=n.xpx[v],b=n.ypx[T],_=i[v],C=i[T],M=(t.scene.selectBatch||[]).slice(),E=[];if(e!==!1&&!e.degenerate)for(var A=0;A<_.length;A++)e.contains([u[A],b[A]],null,A,t)?(x.push({pointNumber:A,x:_[A],y:C[A]}),g(M,A)):M.indexOf(A)!==-1?g(M,A):E.push(A);var h=o.matrixOptions;return!M.length&&!E.length?o.matrix.update(h,null):!o.selectBatch.length&&!o.unselectBatch.length&&o.matrix.update(o.unselectedOptions,c.extendFlat({},h,o.selectedOptions,o.viewOpts)),o.selectBatch=M,o.unselectBatch=E,x}}),CH=Ft((Q,$)=>{var c=bn(),g=F0(),P=gx().markerStyle;$.exports=function(S,t){var e=t.trace,r=S._fullLayout._splomScenes[e.uid];if(r){g(S,e),c.extendFlat(r.matrixOptions,P(S,e));var a=c.extendFlat({},r.matrixOptions,r.viewOpts);r.matrix.update(a,null)}}}),LH=Ft((Q,$)=>{var c=Xo(),g=LM();$.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:XS(),supplyDefaults:xH(),colorbar:xo(),calc:bH(),plot:MH(),hoverPoints:SH().hoverPoints,selectPoints:EH(),editStyle:CH(),meta:{}},c.register(g)}),PH=Ft((Q,$)=>{var c=jS(),g=Xo(),P=uT(),S=ud().getModuleCalcData,t=Mf(),e=Rc().getFromId,r=Es().shouldShowZeroLine,a="splom",n={};function o(v){var T=v._fullLayout,u=g.getModule(a),b=S(v.calcdata,u)[0],_=P(v,["ANGLE_instanced_arrays","OES_element_index_uint"],n);_&&(T._hasOnlyLargeSploms&&f(v),u.plot(v,{},b))}function i(v){var T=v.calcdata,u=v._fullLayout;u._hasOnlyLargeSploms&&f(v);for(var b=0;b<T.length;b++){var _=T[b][0],C=_.trace,M=u._splomScenes[C.uid];C.type==="splom"&&M&&M.matrix&&s(v,C,M)}}function s(v,T,u){for(var b=u.matrixOptions.data.length,_=T._visibleDims,C=u.viewOpts.ranges=new Array(b),M=0;M<_.length;M++){var E=_[M],A=C[M]=new Array(4),h=e(v,T._diag[E][0]);h&&(A[0]=h.r2l(h.range[0]),A[2]=h.r2l(h.range[1]));var p=e(v,T._diag[E][1]);p&&(A[1]=p.r2l(p.range[0]),A[3]=p.r2l(p.range[1]))}u.selectBatch.length||u.unselectBatch.length?u.matrix.update({ranges:C},{ranges:C}):u.matrix.update({ranges:C})}function f(v){var T=v._fullLayout,u=T._glcanvas.data()[0].regl,b=T._splomGrid;b||(b=T._splomGrid=c(u)),b.update(x(v))}function x(v){var T=v._context.plotGlPixelRatio,u=v._fullLayout,b=u._size,_=[0,0,u.width*T,u.height*T],C={},M;function E(X,lt,yt,pt,st,tt){yt*=T,pt*=T,st*=T,tt*=T;var dt=lt[X+"color"],rt=lt[X+"width"],at=String(dt+rt);at in C?C[at].data.push(NaN,NaN,yt,pt,st,tt):C[at]={data:[yt,pt,st,tt],join:"rect",thickness:rt*T,color:dt,viewport:_,range:_,overlay:!1}}for(M in u._splomSubplots){var A=u._plots[M],h=A.xaxis,p=A.yaxis,k=h._gridVals,w=p._gridVals,R=h._offset,O=h._length,N=p._length,V=b.b+p.domain[0]*b.h,H=-p._m,F=-H*p.r2l(p.range[0],p.calendar),U,W;if(h.showgrid)for(M=0;M<k.length;M++)U=R+h.l2p(k[M].x),E("grid",h,U,V,U,V+N);if(p.showgrid)for(M=0;M<w.length;M++)W=V+F+H*w[M].x,E("grid",p,R,W,R+O,W);r(v,h,p)&&(U=R+h.l2p(0),E("zeroline",h,U,V,U,V+N)),r(v,p,h)&&(W=V+F+0,E("zeroline",p,R,W,R+O,W))}var q=[];for(M in C)q.push(C[M]);return q}function y(v,T,u,b){var _={},C;if(b._splomScenes){for(C=0;C<v.length;C++){var M=v[C];M.type==="splom"&&(_[M.uid]=1)}for(C=0;C<u.length;C++){var E=u[C];if(!_[E.uid]){var A=b._splomScenes[E.uid];A&&A.destroy&&A.destroy(),b._splomScenes[E.uid]=null,delete b._splomScenes[E.uid]}}}Object.keys(b._splomScenes||{}).length===0&&delete b._splomScenes,b._splomGrid&&!T._hasOnlyLargeSploms&&b._hasOnlyLargeSploms&&(b._splomGrid.destroy(),b._splomGrid=null,delete b._splomGrid),t.clean(v,T,u,b)}$.exports={name:a,attr:t.attr,attrRegex:t.attrRegex,layoutAttributes:t.layoutAttributes,supplyLayoutDefaults:t.supplyLayoutDefaults,drawFramework:t.drawFramework,plot:o,drag:i,updateGrid:f,clean:y,updateFx:t.updateFx,toSVG:t.toSVG,reglPrecompiled:n}}),zH=Ft((Q,$)=>{var c=LH();c.basePlotModule=PH(),$.exports=c}),IH=Ft((Q,$)=>{$.exports=zH()}),QS=Ft((Q,$)=>{var c=Tc(),g=Ad(),P=Ea(),S=Nh().attributes,t=Ta().extendFlat,e=pu().templatedArray;$.exports={domain:S({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:P({editType:"plot"}),tickfont:P({autoShadowDflt:!0,editType:"plot"}),rangefont:P({editType:"plot"}),dimensions:e("dimension",{label:{valType:"string",editType:"plot"},tickvals:t({},g.tickvals,{editType:"plot"}),ticktext:t({},g.ticktext,{editType:"plot"}),tickformat:t({},g.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:t({editType:"calc"},c("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}}),k3=Ft((Q,$)=>{$.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"}}}),Lg=Ft((Q,$)=>{var c=_1();function g(P){return[P]}$.exports={keyFun:function(P){return P.key},repeat:g,descend:c,wrap:g,unwrap:function(P){return P[0]}}}),tE=Ft((Q,$)=>{var c=k3(),g=un(),P=Lg().keyFun,S=Lg().repeat,t=bn().sorterAsc,e=bn().strTranslate,r=c.bar.snapRatio;function a(q,X){return q*(1-r)+X*r}var n=c.bar.snapClose;function o(q,X){return q*(1-n)+X*n}function i(q,X,lt,yt){if(s(lt,yt))return lt;var pt=q?-1:1,st=0,tt=X.length-1;if(pt<0){var dt=st;st=tt,tt=dt}for(var rt=X[st],at=rt,vt=st;pt*vt<pt*tt;vt+=pt){var it=vt+pt,Y=X[it];if(pt*lt<pt*o(rt,Y))return a(rt,at);if(pt*lt<pt*Y||it===tt)return a(Y,rt);at=rt,rt=Y}}function s(q,X){for(var lt=0;lt<X.length;lt++)if(q>=X[lt][0]&&q<=X[lt][1])return!0;return!1}function f(q){q.attr("x",-c.bar.captureWidth/2).attr("width",c.bar.captureWidth)}function x(q){q.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function y(q){if(!q.brush.filterSpecified)return"0,"+q.height;for(var X=v(q.brush.filter.getConsolidated(),q.height),lt=[0],yt,pt,st,tt=X.length?X[0][0]:null,dt=0;dt<X.length;dt++)yt=X[dt],pt=yt[1]-yt[0],lt.push(tt),lt.push(pt),st=dt+1,st<X.length&&(tt=X[st][0]-yt[1]);return lt.push(q.height),lt}function v(q,X){return q.map(function(lt){return lt.map(function(yt){return Math.max(0,yt*X)}).sort(t)})}function T(q,X){var lt=c.bar.handleHeight;if(!(X>q[1]+lt||X<q[0]-lt))return X>=.9*q[1]+.1*q[0]?"n":X<=.9*q[0]+.1*q[1]?"s":"ns"}function u(){g.select(document.body).style("cursor",null)}function b(q){q.attr("stroke-dasharray",y)}function _(q,X){var lt=g.select(q).selectAll(".highlight, .highlight-shadow"),yt=X?lt.transition().duration(c.bar.snapDuration).each("end",X):lt;b(yt)}function C(q,X){var lt=q.brush,yt=lt.filterSpecified,pt=NaN,st={},tt;if(yt){var dt=q.height,rt=lt.filter.getConsolidated(),at=v(rt,dt),vt=NaN,it=NaN,Y=NaN;for(tt=0;tt<=at.length;tt++){var ft=at[tt];if(ft&&ft[0]<=X&&X<=ft[1]){vt=tt;break}else if(it=tt?tt-1:NaN,ft&&ft[0]>X){Y=tt;break}}if(pt=vt,isNaN(pt)&&(isNaN(it)||isNaN(Y)?pt=isNaN(it)?Y:it:pt=X-at[it][1]<at[Y][0]-X?it:Y),!isNaN(pt)){var ut=at[pt],wt=T(ut,X);wt&&(st.interval=rt[pt],st.intervalPix=ut,st.region=wt)}}if(q.ordinal&&!st.region){var zt=q.unitTickvals,Pt=q.unitToPaddedPx.invert(X);for(tt=0;tt<zt.length;tt++){var Wt=[zt[Math.max(tt-1,0)]*.25+zt[tt]*.75,zt[Math.min(tt+1,zt.length-1)]*.25+zt[tt]*.75];if(Pt>=Wt[0]&&Pt<=Wt[1]){st.clickableOrdinalRange=Wt;break}}}return st}function M(q,X){g.event.sourceEvent.stopPropagation();var lt=X.height-g.mouse(q)[1]-2*c.verticalPadding,yt=X.unitToPaddedPx.invert(lt),pt=X.brush,st=C(X,lt),tt=st.interval,dt=pt.svgBrush;if(dt.wasDragged=!1,dt.grabbingBar=st.region==="ns",dt.grabbingBar){var rt=tt.map(X.unitToPaddedPx);dt.grabPoint=lt-rt[0]-c.verticalPadding,dt.barLength=rt[1]-rt[0]}dt.clickableOrdinalRange=st.clickableOrdinalRange,dt.stayingIntervals=X.multiselect&&pt.filterSpecified?pt.filter.getConsolidated():[],tt&&(dt.stayingIntervals=dt.stayingIntervals.filter(function(at){return at[0]!==tt[0]&&at[1]!==tt[1]})),dt.startExtent=st.region?tt[st.region==="s"?1:0]:yt,X.parent.inBrushDrag=!0,dt.brushStartCallback()}function E(q,X){g.event.sourceEvent.stopPropagation();var lt=X.height-g.mouse(q)[1]-2*c.verticalPadding,yt=X.brush.svgBrush;yt.wasDragged=!0,yt._dragging=!0,yt.grabbingBar?yt.newExtent=[lt-yt.grabPoint,lt+yt.barLength-yt.grabPoint].map(X.unitToPaddedPx.invert):yt.newExtent=[yt.startExtent,X.unitToPaddedPx.invert(lt)].sort(t),X.brush.filterSpecified=!0,yt.extent=yt.stayingIntervals.concat([yt.newExtent]),yt.brushCallback(X),_(q.parentNode)}function A(q,X){var lt=X.brush,yt=lt.filter,pt=lt.svgBrush;pt._dragging||(h(q,X),E(q,X),X.brush.svgBrush.wasDragged=!1),pt._dragging=!1;var st=g.event;st.sourceEvent.stopPropagation();var tt=pt.grabbingBar;if(pt.grabbingBar=!1,pt.grabLocation=void 0,X.parent.inBrushDrag=!1,u(),!pt.wasDragged){pt.wasDragged=void 0,pt.clickableOrdinalRange?lt.filterSpecified&&X.multiselect?pt.extent.push(pt.clickableOrdinalRange):(pt.extent=[pt.clickableOrdinalRange],lt.filterSpecified=!0):tt?(pt.extent=pt.stayingIntervals,pt.extent.length===0&&N(lt)):N(lt),pt.brushCallback(X),_(q.parentNode),pt.brushEndCallback(lt.filterSpecified?yt.getConsolidated():[]);return}var dt=function(){yt.set(yt.getConsolidated())};if(X.ordinal){var rt=X.unitTickvals;rt[rt.length-1]<rt[0]&&rt.reverse(),pt.newExtent=[i(0,rt,pt.newExtent[0],pt.stayingIntervals),i(1,rt,pt.newExtent[1],pt.stayingIntervals)];var at=pt.newExtent[1]>pt.newExtent[0];pt.extent=pt.stayingIntervals.concat(at?[pt.newExtent]:[]),pt.extent.length||N(lt),pt.brushCallback(X),at?_(q.parentNode,dt):(dt(),_(q.parentNode))}else dt();pt.brushEndCallback(lt.filterSpecified?yt.getConsolidated():[])}function h(q,X){var lt=X.height-g.mouse(q)[1]-2*c.verticalPadding,yt=C(X,lt),pt="crosshair";yt.clickableOrdinalRange?pt="pointer":yt.region&&(pt=yt.region+"-resize"),g.select(document.body).style("cursor",pt)}function p(q){q.on("mousemove",function(X){g.event.preventDefault(),X.parent.inBrushDrag||h(this,X)}).on("mouseleave",function(X){X.parent.inBrushDrag||u()}).call(g.behavior.drag().on("dragstart",function(X){M(this,X)}).on("drag",function(X){E(this,X)}).on("dragend",function(X){A(this,X)}))}function k(q,X){return q[0]-X[0]}function w(q,X,lt){var yt=lt._context.staticPlot,pt=q.selectAll(".background").data(S);pt.enter().append("rect").classed("background",!0).call(f).call(x).style("pointer-events",yt?"none":"auto").attr("transform",e(0,c.verticalPadding)),pt.call(p).attr("height",function(dt){return dt.height-c.verticalPadding});var st=q.selectAll(".highlight-shadow").data(S);st.enter().append("line").classed("highlight-shadow",!0).attr("x",-c.bar.width/2).attr("stroke-width",c.bar.width+c.bar.strokeWidth).attr("stroke",X).attr("opacity",c.bar.strokeOpacity).attr("stroke-linecap","butt"),st.attr("y1",function(dt){return dt.height}).call(b);var tt=q.selectAll(".highlight").data(S);tt.enter().append("line").classed("highlight",!0).attr("x",-c.bar.width/2).attr("stroke-width",c.bar.width-c.bar.strokeWidth).attr("stroke",c.bar.fillColor).attr("opacity",c.bar.fillOpacity).attr("stroke-linecap","butt"),tt.attr("y1",function(dt){return dt.height}).call(b)}function R(q,X,lt){var yt=q.selectAll("."+c.cn.axisBrush).data(S,P);yt.enter().append("g").classed(c.cn.axisBrush,!0),w(yt,X,lt)}function O(q){return q.svgBrush.extent.map(function(X){return X.slice()})}function N(q){q.filterSpecified=!1,q.svgBrush.extent=[[-1/0,1/0]]}function V(q){return function(X){var lt=X.brush,yt=O(lt),pt=yt.slice();lt.filter.set(pt),q()}}function H(q){for(var X=q.slice(),lt=[],yt,pt=X.shift();pt;){for(yt=pt.slice();(pt=X.shift())&&pt[0]<=yt[1];)yt[1]=Math.max(yt[1],pt[1]);lt.push(yt)}return lt.length===1&&lt[0][0]>lt[0][1]&&(lt=[]),lt}function F(){var q=[],X,lt;return{set:function(yt){q=yt.map(function(pt){return pt.slice().sort(t)}).sort(k),q.length===1&&q[0][0]===-1/0&&q[0][1]===1/0&&(q=[[0,-1]]),X=H(q),lt=q.reduce(function(pt,st){return[Math.min(pt[0],st[0]),Math.max(pt[1],st[1])]},[1/0,-1/0])},get:function(){return q.slice()},getConsolidated:function(){return X},getBounds:function(){return lt}}}function U(q,X,lt,yt,pt,st){var tt=F();return tt.set(lt),{filter:tt,filterSpecified:X,svgBrush:{extent:[],brushStartCallback:yt,brushCallback:V(pt),brushEndCallback:st}}}function W(q,X){if(Array.isArray(q[0])?(q=q.map(function(yt){return yt.sort(t)}),X.multiselect?q=H(q.sort(k)):q=[q[0]]):q=[q.sort(t)],X.tickvals){var lt=X.tickvals.slice().sort(t);if(q=q.map(function(yt){var pt=[i(0,lt,yt[0],[]),i(1,lt,yt[1],[])];if(pt[1]>pt[0])return pt}).filter(function(yt){return yt}),!q.length)return}return q.length>1?q:q[0]}$.exports={makeBrush:U,ensureAxisBrush:R,cleanRanges:W}}),OH=Ft((Q,$)=>{var c=bn(),g=Hd().hasColorscale,P=mc(),S=Nh().defaults,t=Md(),e=Es(),r=QS(),a=tE(),n=k3().maxDimensionCount,o=cT();function i(f,x,y,v,T){var u=T("line.color",y);if(g(f,"line")&&c.isArrayOrTypedArray(u)){if(u.length)return T("line.colorscale"),P(f,x,v,T,{prefix:"line.",cLetter:"c"}),u.length;x.line.color=y}return 1/0}function s(f,x,y,v){function T(M,E){return c.coerce(f,x,r.dimensions,M,E)}var u=T("values"),b=T("visible");if(u&&u.length||(b=x.visible=!1),b){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var _=T("range");x._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:_},e.setConvert(x._ax,v.layout),T("multiselect");var C=T("constraintrange");C&&(x.constraintrange=a.cleanRanges(C,x))}}$.exports=function(f,x,y,v){function T(M,E){return c.coerce(f,x,r,M,E)}var u=f.dimensions;Array.isArray(u)&&u.length>n&&(c.log("parcoords traces support up to "+n+" dimensions at the moment"),u.splice(n));var b=t(f,x,{name:"dimensions",layout:v,handleItemDefaults:s}),_=i(f,x,y,v,T);S(x,v,T),(!Array.isArray(b)||!b.length)&&(x.visible=!1),o(x,b,"values",_);var C=c.extendFlat({},v.font,{size:Math.round(v.font.size/1.2)});c.coerceFont(T,"labelfont",C),c.coerceFont(T,"tickfont",C,{autoShadowDflt:!0}),c.coerceFont(T,"rangefont",C),T("labelangle"),T("labelside"),T("unselected.line.color"),T("unselected.line.opacity")}}),DH=Ft((Q,$)=>{var c=bn().isArrayOrTypedArray,g=Xc(),P=Lg().wrap;$.exports=function(t,e){var r,a;return g.hasColorscale(e,"line")&&c(e.line.color)?(r=e.line.color,a=g.extractOpts(e.line).colorscale,g.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=S(e._length),a=[[0,e.line.color],[1,e.line.color]]),P({lineColor:r,cscale:a})};function S(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=.5;return e}});function FH(Q){var $,c,g,P=[],S=1,t;if(typeof Q=="number")return{space:"rgb",values:[Q>>>16,(Q&65280)>>>8,Q&255],alpha:1};if(typeof Q=="number")return{space:"rgb",values:[Q>>>16,(Q&65280)>>>8,Q&255],alpha:1};if(Q=String(Q).toLowerCase(),hT.default[Q])P=hT.default[Q].slice(),t="rgb";else if(Q==="transparent")S=0,t="rgb",P=[0,0,0];else if(Q[0]==="#"){var e=Q.slice(1),r=e.length,a=r<=4;S=1,a?(P=[parseInt(e[0]+e[0],16),parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16)],r===4&&(S=parseInt(e[3]+e[3],16)/255)):(P=[parseInt(e[0]+e[1],16),parseInt(e[2]+e[3],16),parseInt(e[4]+e[5],16)],r===8&&(S=parseInt(e[6]+e[7],16)/255)),P[0]||(P[0]=0),P[1]||(P[1]=0),P[2]||(P[2]=0),t="rgb"}else if(g=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(Q)){var n=g[1];t=n.replace(/a$/,"");var o=t==="cmyk"?4:t==="gray"?1:3;P=g[2].trim().split(/\s*[,\/]\s*|\s+/),t==="color"&&(t=P.shift()),P=P.map(function(i,s){if(i[i.length-1]==="%")return i=parseFloat(i)/100,s===3?i:t==="rgb"?i*255:t[0]==="h"||t[0]==="l"&&!s?i*100:t==="lab"?i*125:t==="lch"?s<2?i*150:i*360:t[0]==="o"&&!s?i:t==="oklab"?i*.4:t==="oklch"?s<2?i*.4:i*360:i;if(t[s]==="h"||s===2&&t[t.length-1]==="h"){if(fT[i]!==void 0)return fT[i];if(i.endsWith("deg"))return parseFloat(i);if(i.endsWith("turn"))return parseFloat(i)*360;if(i.endsWith("grad"))return parseFloat(i)*360/400;if(i.endsWith("rad"))return parseFloat(i)*180/Math.PI}return i==="none"?0:parseFloat(i)}),S=P.length>o?P.pop():1}else/[0-9](?:\s|\/|,)/.test(Q)&&(P=Q.match(/([0-9]+)/g).map(function(i){return parseFloat(i)}),t=((c=($=Q.match(/([a-z])/ig))==null?void 0:$.join(""))==null?void 0:c.toLowerCase())||"rgb");return{space:t,values:P,alpha:S}}var hT,eE,fT,RH=An(()=>{hT=jn(nS()),eE=FH,fT={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}),T3,rE=An(()=>{T3={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}),A3,BH=An(()=>{rE(),A3={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(Q){var $=Q[0]/360,c=Q[1]/100,g=Q[2]/100,P,S,t,e,r,a=0;if(c===0)return r=g*255,[r,r,r];for(S=g<.5?g*(1+c):g+c-g*c,P=2*g-S,e=[0,0,0];a<3;)t=$+1/3*-(a-1),t<0?t++:t>1&&t--,r=6*t<1?P+(S-P)*6*t:2*t<1?S:3*t<2?P+(S-P)*(2/3-t)*6:P,e[a++]=r*255;return e}},T3.hsl=function(Q){var $=Q[0]/255,c=Q[1]/255,g=Q[2]/255,P=Math.min($,c,g),S=Math.max($,c,g),t=S-P,e,r,a;return S===P?e=0:$===S?e=(c-g)/t:c===S?e=2+(g-$)/t:g===S&&(e=4+($-c)/t),e=Math.min(e*60,360),e<0&&(e+=360),a=(P+S)/2,S===P?r=0:a<=.5?r=t/(S+P):r=t/(2-S-P),[e,r*100,a*100]}}),nE={};kn(nE,{default:()=>NH});function NH(Q){Array.isArray(Q)&&Q.raw&&(Q=String.raw(...arguments)),Q instanceof Number&&(Q=+Q);var $,c=eE(Q);if(!c.space)return[];let g=c.space[0]==="h"?A3.min:T3.min,P=c.space[0]==="h"?A3.max:T3.max;return $=Array(3),$[0]=Math.min(Math.max(c.values[0],g[0]),P[0]),$[1]=Math.min(Math.max(c.values[1],g[1]),P[1]),$[2]=Math.min(Math.max(c.values[2],g[2]),P[2]),c.space[0]==="h"&&($=A3.rgb($)),$.push(Math.min(Math.max(c.alpha,0),1)),$}var jH=An(()=>{RH(),rE(),BH()}),iE=Ft(Q=>{var $=bn().isTypedArray;Q.convertTypedArray=function(c){return $(c)?Array.prototype.slice.call(c):c},Q.isOrdinal=function(c){return!!c.tickvals},Q.isVisible=function(c){return c.visible||!("visible"in c)}}),UH=Ft((Q,$)=>{var c=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(`
`),g=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(`
`),P=k3().maxDimensionCount,S=bn(),t=1e-6,e=2048,r=new Uint8Array(4),a=new Uint8Array(4),n={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function o(A){A.read({x:0,y:0,width:1,height:1,data:r})}function i(A,h,p,k,w){var R=A._gl;R.enable(R.SCISSOR_TEST),R.scissor(h,p,k,w),A.clear({color:[0,0,0,0],depth:1})}function s(A,h,p,k,w,R){var O=R.key;function N(V){var H=Math.min(k,w-V*k);V===0&&(window.cancelAnimationFrame(p.currentRafs[O]),delete p.currentRafs[O],i(A,R.scissorX,R.scissorY,R.scissorWidth,R.viewBoxSize[1])),!p.clearOnly&&(R.count=2*H,R.offset=2*V*k,h(R),V*k+H<w&&(p.currentRafs[O]=window.requestAnimationFrame(function(){N(V+1)})),p.drawCompleted=!1)}p.drawCompleted||(o(A),p.drawCompleted=!0),N(0)}function f(A){return Math.max(t,Math.min(1-t,A))}function x(A,h){for(var p=new Array(256),k=0;k<256;k++)p[k]=A(k/255).concat(h);return p}function y(A,h){return(A>>>8*h)%256/255}function v(A,h,p){for(var k=new Array(A*(P+4)),w=0,R=0;R<A;R++){for(var O=0;O<P;O++)k[w++]=O<h.length?h[O].paddedUnitValues[R]:.5;k[w++]=y(R,2),k[w++]=y(R,1),k[w++]=y(R,0),k[w++]=f(p[R])}return k}function T(A,h,p){for(var k=new Array(h*8),w=0,R=0;R<h;R++)for(var O=0;O<2;O++)for(var N=0;N<4;N++){var V=A*4+N,H=p[R*64+V];V===63&&O===0&&(H*=-1),k[w++]=H}return k}function u(A){var h="0"+A;return h.substr(h.length-2)}function b(A){return A<P?"p"+u(A+1)+"_"+u(A+4):"colors"}function _(A,h,p){for(var k=0;k<=P;k+=4)A[b(k)](T(k/4,h,p))}function C(A){for(var h={},p=0;p<=P;p+=4)h[b(p)]=A.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return h}function M(A,h,p,k,w,R,O,N,V,H,F,U,W,q){for(var X=[[],[]],lt=0;lt<64;lt++)X[0][lt]=lt===w?1:0,X[1][lt]=lt===R?1:0;O*=q,N*=q,V*=q,H*=q;var yt=A.lines.canvasOverdrag*q,pt=A.domain,st=A.canvasWidth*q,tt=A.canvasHeight*q,dt=A.pad.l*q,rt=A.pad.b*q,at=A.layoutHeight*q,vt=A.layoutWidth*q,it=A.deselectedLines.color,Y=A.deselectedLines.opacity,ft=S.extendFlat({key:F,resolution:[st,tt],viewBoxPos:[O+yt,N],viewBoxSize:[V,H],i0:w,i1:R,dim0A:X[0].slice(0,16),dim0B:X[0].slice(16,32),dim0C:X[0].slice(32,48),dim0D:X[0].slice(48,64),dim1A:X[1].slice(0,16),dim1B:X[1].slice(16,32),dim1C:X[1].slice(32,48),dim1D:X[1].slice(48,64),drwLayer:U,contextColor:[it[0]/255,it[1]/255,it[2]/255,Y!=="auto"?it[3]*Y:Math.max(1/255,Math.pow(1/A.lines.color.length,1/3))],scissorX:(k===h?0:O+yt)+(dt-yt)+vt*pt.x[0],scissorWidth:(k===p?st-O+yt:V+.5)+(k===h?O+yt:0),scissorY:N+rt+at*pt.y[0],scissorHeight:H,viewportX:dt-yt+vt*pt.x[0],viewportY:rt+at*pt.y[0],viewportWidth:st,viewportHeight:tt},W);return ft}function E(A){var h=e-1,p=Math.max(0,Math.floor(A[0]*h),0),k=Math.min(h,Math.ceil(A[1]*h),h);return[Math.min(p,k),Math.max(p,k)]}$.exports=function(A,h){var p=h.context,k=h.pick,w=h.regl,R=w._gl,O=R.getParameter(R.ALIASED_LINE_WIDTH_RANGE),N=Math.max(O[0],Math.min(O[1],h.viewModel.plotGlPixelRatio)),V={currentRafs:{},drawCompleted:!0,clearOnly:!1},H,F,U,W,q=C(w),X,lt=w.texture(n),yt=[];st(h);var pt=w({profile:!1,blend:{enable:p,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:!p,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:w.prop("scissorX"),y:w.prop("scissorY"),width:w.prop("scissorWidth"),height:w.prop("scissorHeight")}},viewport:{x:w.prop("viewportX"),y:w.prop("viewportY"),width:w.prop("viewportWidth"),height:w.prop("viewportHeight")},dither:!1,vert:c,frag:g,primitive:"lines",lineWidth:N,attributes:q,uniforms:{resolution:w.prop("resolution"),viewBoxPos:w.prop("viewBoxPos"),viewBoxSize:w.prop("viewBoxSize"),dim0A:w.prop("dim0A"),dim1A:w.prop("dim1A"),dim0B:w.prop("dim0B"),dim1B:w.prop("dim1B"),dim0C:w.prop("dim0C"),dim1C:w.prop("dim1C"),dim0D:w.prop("dim0D"),dim1D:w.prop("dim1D"),loA:w.prop("loA"),hiA:w.prop("hiA"),loB:w.prop("loB"),hiB:w.prop("hiB"),loC:w.prop("loC"),hiC:w.prop("hiC"),loD:w.prop("loD"),hiD:w.prop("hiD"),palette:lt,contextColor:w.prop("contextColor"),maskTexture:w.prop("maskTexture"),drwLayer:w.prop("drwLayer"),maskHeight:w.prop("maskHeight")},offset:w.prop("offset"),count:w.prop("count")});function st(it){H=it.model,F=it.viewModel,U=F.dimensions.slice(),W=U[0]?U[0].values.length:0;var Y=H.lines,ft=k?Y.color.map(function(wt,zt){return zt/Y.color.length}):Y.color,ut=v(W,U,ft);_(q,W,ut),!p&&!k&&(lt=w.texture(S.extendFlat({data:x(H.unitToColor,255)},n)))}function tt(it){var Y,ft,ut,wt=[[],[]];for(ut=0;ut<64;ut++){var zt=!it&&ut<U.length?U[ut].brush.filter.getBounds():[-1/0,1/0];wt[0][ut]=zt[0],wt[1][ut]=zt[1]}var Pt=e*8,Wt=new Array(Pt);for(Y=0;Y<Pt;Y++)Wt[Y]=255;if(!it)for(Y=0;Y<U.length;Y++){var Ht=Y%8,Jt=(Y-Ht)/8,ge=Math.pow(2,Ht),he=U[Y],de=he.brush.filter.get();if(!(de.length<2)){var se=E(de[0])[1];for(ft=1;ft<de.length;ft++){var Tt=E(de[ft]);for(ut=se+1;ut<Tt[0];ut++)Wt[ut*8+Jt]&=~ge;se=Math.max(se,Tt[1])}}}var Lt={shape:[8,e],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:Wt};return X?X(Lt):X=w.texture(Lt),{maskTexture:X,maskHeight:e,loA:wt[0].slice(0,16),loB:wt[0].slice(16,32),loC:wt[0].slice(32,48),loD:wt[0].slice(48,64),hiA:wt[1].slice(0,16),hiB:wt[1].slice(16,32),hiC:wt[1].slice(32,48),hiD:wt[1].slice(48,64)}}function dt(it,Y,ft){var ut=it.length,wt,zt,Pt,Wt=1/0,Ht=-1/0;for(wt=0;wt<ut;wt++)it[wt].dim0.canvasX<Wt&&(Wt=it[wt].dim0.canvasX,zt=wt),it[wt].dim1.canvasX>Ht&&(Ht=it[wt].dim1.canvasX,Pt=wt);ut===0&&i(w,0,0,H.canvasWidth,H.canvasHeight);var Jt=tt(p);for(wt=0;wt<ut;wt++){var ge=it[wt],he=ge.dim0.crossfilterDimensionIndex,de=ge.dim1.crossfilterDimensionIndex,se=ge.canvasX,Tt=ge.canvasY,Lt=se+ge.panelSizeX,Mt=ge.plotGlPixelRatio;if(Y||!yt[he]||yt[he][0]!==se||yt[he][1]!==Lt){yt[he]=[se,Lt];var te=M(H,zt,Pt,wt,he,de,se,Tt,ge.panelSizeX,ge.panelSizeY,ge.dim0.crossfilterDimensionIndex,p?0:k?2:1,Jt,Mt);V.clearOnly=ft;var ve=Y?H.lines.blockLineCount:W;s(w,pt,V,ve,W,te)}}}function rt(it,Y){return w.read({x:it,y:Y,width:1,height:1,data:a}),a}function at(it,Y,ft,ut){var wt=new Uint8Array(4*ft*ut);return w.read({x:it,y:Y,width:ft,height:ut,data:wt}),wt}function vt(){A.style["pointer-events"]="none",lt.destroy(),X&&X.destroy();for(var it in q)q[it].destroy()}return{render:dt,readPixel:rt,readPixels:at,destroy:vt,update:st}}}),VH=Ft((Q,$)=>{var c=un(),g=bn(),P=g.isArrayOrTypedArray,S=g.numberFormat,t=(jH(),ai(nE)).default,e=Es(),r=g.strRotate,a=g.strTranslate,n=tc(),o=js(),i=Xc(),s=Lg(),f=s.keyFun,x=s.repeat,y=s.unwrap,v=iE(),T=k3(),u=tE(),b=UH();function _(yt,pt,st){return g.aggNums(yt,null,pt,st)}function C(yt,pt){return E(_(Math.min,yt,pt),_(Math.max,yt,pt))}function M(yt){var pt=yt.range;return pt?E(pt[0],pt[1]):C(yt.values,yt._length)}function E(yt,pt){return(isNaN(yt)||!isFinite(yt))&&(yt=0),(isNaN(pt)||!isFinite(pt))&&(pt=0),yt===pt&&(yt===0?(yt-=1,pt+=1):(yt*=.9,pt*=1.1)),[yt,pt]}function A(yt,pt){return pt?function(st,tt){var dt=pt[tt];return dt??yt(st)}:yt}function h(yt,pt,st,tt,dt){var rt=M(st);return tt?c.scale.ordinal().domain(tt.map(A(S(st.tickformat),dt))).range(tt.map(function(at){var vt=(at-rt[0])/(rt[1]-rt[0]);return yt-pt+vt*(2*pt-yt)})):c.scale.linear().domain(rt).range([yt-pt,pt])}function p(yt,pt){return c.scale.linear().range([pt,yt-pt])}function k(yt,pt){return c.scale.linear().domain(M(yt)).range([pt,1-pt])}function w(yt){if(yt.tickvals){var pt=M(yt);return c.scale.ordinal().domain(yt.tickvals).range(yt.tickvals.map(function(st){return(st-pt[0])/(pt[1]-pt[0])}))}}function R(yt){var pt=yt.map(function(rt){return rt[0]}),st=yt.map(function(rt){var at=t(rt[1]);return c.rgb("rgb("+at[0]+","+at[1]+","+at[2]+")")}),tt=function(rt){return function(at){return at[rt]}},dt="rgb".split("").map(function(rt){return c.scale.linear().clamp(!0).domain(pt).range(st.map(tt(rt)))});return function(rt){return dt.map(function(at){return at(rt)})}}function O(yt){return yt.dimensions.some(function(pt){return pt.brush.filterSpecified})}function N(yt,pt,st){var tt=y(pt),dt=tt.trace,rt=v.convertTypedArray(tt.lineColor),at=dt.line,vt={color:t(dt.unselected.line.color),opacity:dt.unselected.line.opacity},it=i.extractOpts(at),Y=it.reversescale?i.flipScale(tt.cscale):tt.cscale,ft=dt.domain,ut=dt.dimensions,wt=yt.width,zt=dt.labelangle,Pt=dt.labelside,Wt=dt.labelfont,Ht=dt.tickfont,Jt=dt.rangefont,ge=g.extendDeepNoArrays({},at,{color:rt.map(c.scale.linear().domain(M({values:rt,range:[it.min,it.max],_length:dt._length}))),blockLineCount:T.blockLineCount,canvasOverdrag:T.overdrag*T.canvasPixelRatio}),he=Math.floor(wt*(ft.x[1]-ft.x[0])),de=Math.floor(yt.height*(ft.y[1]-ft.y[0])),se=yt.margin||{l:80,r:80,t:100,b:80},Tt=he,Lt=de;return{key:st,colCount:ut.filter(v.isVisible).length,dimensions:ut,tickDistance:T.tickDistance,unitToColor:R(Y),lines:ge,deselectedLines:vt,labelAngle:zt,labelSide:Pt,labelFont:Wt,tickFont:Ht,rangeFont:Jt,layoutWidth:wt,layoutHeight:yt.height,domain:ft,translateX:ft.x[0]*wt,translateY:yt.height-ft.y[1]*yt.height,pad:se,canvasWidth:Tt*T.canvasPixelRatio+2*ge.canvasOverdrag,canvasHeight:Lt*T.canvasPixelRatio,width:Tt,height:Lt,canvasPixelRatio:T.canvasPixelRatio}}function V(yt,pt,st){var tt=st.width,dt=st.height,rt=st.dimensions,at=st.canvasPixelRatio,vt=function(wt){return tt*wt/Math.max(1,st.colCount-1)},it=T.verticalPadding/dt,Y=p(dt,T.verticalPadding),ft={key:st.key,xScale:vt,model:st,inBrushDrag:!1},ut={};return ft.dimensions=rt.filter(v.isVisible).map(function(wt,zt){var Pt=k(wt,it),Wt=ut[wt.label];ut[wt.label]=(Wt||0)+1;var Ht=wt.label+(Wt?"__"+Wt:""),Jt=wt.constraintrange,ge=Jt&&Jt.length;ge&&!P(Jt[0])&&(Jt=[Jt]);var he=ge?Jt.map(function(He){return He.map(Pt)}):[[-1/0,1/0]],de=function(){var He=ft;He.focusLayer&&He.focusLayer.render(He.panels,!0);var Ge=O(He);!yt.contextShown()&&Ge?(He.contextLayer&&He.contextLayer.render(He.panels,!0),yt.contextShown(!0)):yt.contextShown()&&!Ge&&(He.contextLayer&&He.contextLayer.render(He.panels,!0,!0),yt.contextShown(!1))},se=wt.values;se.length>wt._length&&(se=se.slice(0,wt._length));var Tt=wt.tickvals,Lt;function Mt(He,Ge){return{val:He,text:Lt[Ge]}}function te(He,Ge){return He.val-Ge.val}if(P(Tt)&&Tt.length){g.isTypedArray(Tt)&&(Tt=Array.from(Tt)),Lt=wt.ticktext,!P(Lt)||!Lt.length?Lt=Tt.map(S(wt.tickformat)):Lt.length>Tt.length?Lt=Lt.slice(0,Tt.length):Tt.length>Lt.length&&(Tt=Tt.slice(0,Lt.length));for(var ve=1;ve<Tt.length;ve++)if(Tt[ve]<Tt[ve-1]){for(var oe=Tt.map(Mt).sort(te),Te=0;Te<Tt.length;Te++)Tt[Te]=oe[Te].val,Lt[Te]=oe[Te].text;break}}else Tt=void 0;return se=v.convertTypedArray(se),{key:Ht,label:wt.label,tickFormat:wt.tickformat,tickvals:Tt,ticktext:Lt,ordinal:v.isOrdinal(wt),multiselect:wt.multiselect,xIndex:zt,crossfilterDimensionIndex:zt,visibleIndex:wt._index,height:dt,values:se,paddedUnitValues:se.map(Pt),unitTickvals:Tt&&Tt.map(Pt),xScale:vt,x:vt(zt),canvasX:vt(zt)*at,unitToPaddedPx:Y,domainScale:h(dt,T.verticalPadding,wt,Tt,Lt),ordinalScale:w(wt),parent:ft,model:st,brush:u.makeBrush(yt,ge,he,function(){yt.linePickActive(!1)},de,function(He){if(ft.focusLayer.render(ft.panels,!0),ft.pickLayer&&ft.pickLayer.render(ft.panels,!0),yt.linePickActive(!0),pt&&pt.filterChanged){var Ge=Pt.invert,cr=He.map(function(ur){return ur.map(Ge).sort(g.sorterAsc)}).sort(function(ur,jr){return ur[0]-jr[0]});pt.filterChanged(ft.key,wt._index,cr)}})}}),ft}function H(yt){yt.classed(T.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default")}function F(){var yt=!0,pt=!1;return{linePickActive:function(st){return arguments.length?yt=!!st:yt},contextShown:function(st){return arguments.length?pt=!!st:pt}}}function U(yt,pt){var st=pt==="top"?1:-1,tt=yt*Math.PI/180,dt=Math.sin(tt),rt=Math.cos(tt);return{dir:st,dx:dt,dy:rt,degrees:yt}}function W(yt,pt,st){for(var tt=pt.panels||(pt.panels=[]),dt=yt.data(),rt=0;rt<dt.length-1;rt++){var at=tt[rt]||(tt[rt]={}),vt=dt[rt],it=dt[rt+1];at.dim0=vt,at.dim1=it,at.canvasX=vt.canvasX,at.panelSizeX=it.canvasX-vt.canvasX,at.panelSizeY=pt.model.canvasHeight,at.y=0,at.canvasY=0,at.plotGlPixelRatio=st}}function q(yt){for(var pt=0;pt<yt.length;pt++)for(var st=0;st<yt[pt].length;st++)for(var tt=yt[pt][st].trace,dt=tt.dimensions,rt=0;rt<dt.length;rt++){var at=dt[rt].values,vt=dt[rt]._ax;vt&&(vt.range?vt.range=E(vt.range[0],vt.range[1]):vt.range=C(at,tt._length),vt.dtick||(vt.dtick=.01*(Math.abs(vt.range[1]-vt.range[0])||1)),vt.tickformat=dt[rt].tickformat,e.calcTicks(vt),vt.cleanRange())}}function X(yt,pt){return e.tickText(yt._ax,pt,!1).text}function lt(yt,pt){if(yt.ordinal)return"";var st=yt.domainScale.domain(),tt=st[pt?st.length-1:0];return X(yt.model.dimensions[yt.visibleIndex],tt)}$.exports=function(yt,pt,st,tt){var dt=yt._context.staticPlot,rt=yt._fullLayout,at=rt._toppaper,vt=rt._glcontainer,it=yt._context.plotGlPixelRatio,Y=yt._fullLayout.paper_bgcolor;q(pt);var ft=F(),ut=pt.filter(function(oe){return y(oe).trace.visible}).map(N.bind(0,st)).map(V.bind(0,ft,tt));vt.each(function(oe,Te){return g.extendFlat(oe,ut[Te])});var wt=vt.selectAll(".gl-canvas").each(function(oe){oe.viewModel=ut[0],oe.viewModel.plotGlPixelRatio=it,oe.viewModel.paperColor=Y,oe.model=oe.viewModel?oe.viewModel.model:null}),zt=null,Pt=wt.filter(function(oe){return oe.pick});Pt.style("pointer-events",dt?"none":"auto").on("mousemove",function(oe){if(ft.linePickActive()&&oe.lineLayer&&tt&&tt.hover){var Te=c.event,He=this.width,Ge=this.height,cr=c.mouse(this),ur=cr[0],jr=cr[1];if(ur<0||jr<0||ur>=He||jr>=Ge)return;var Hr=oe.lineLayer.readPixel(ur,Ge-1-jr),br=Hr[3]!==0,Kr=br?Hr[2]+256*(Hr[1]+256*Hr[0]):null,rn={x:ur,y:jr,clientX:Te.clientX,clientY:Te.clientY,dataIndex:oe.model.key,curveNumber:Kr};Kr!==zt&&(br?tt.hover(rn):tt.unhover&&tt.unhover(rn),zt=Kr)}}),wt.style("opacity",function(oe){return oe.pick?0:1}),at.style("background","rgba(255, 255, 255, 0)");var Wt=at.selectAll("."+T.cn.parcoords).data(ut,f);Wt.exit().remove(),Wt.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Wt.attr("transform",function(oe){return a(oe.model.translateX,oe.model.translateY)});var Ht=Wt.selectAll("."+T.cn.parcoordsControlView).data(x,f);Ht.enter().append("g").classed(T.cn.parcoordsControlView,!0),Ht.attr("transform",function(oe){return a(oe.model.pad.l,oe.model.pad.t)});var Jt=Ht.selectAll("."+T.cn.yAxis).data(function(oe){return oe.dimensions},f);Jt.enter().append("g").classed(T.cn.yAxis,!0),Ht.each(function(oe){W(Jt,oe,it)}),wt.each(function(oe){if(oe.viewModel){!oe.lineLayer||tt?oe.lineLayer=b(this,oe):oe.lineLayer.update(oe),(oe.key||oe.key===0)&&(oe.viewModel[oe.key]=oe.lineLayer);var Te=!oe.context||tt;oe.lineLayer.render(oe.viewModel.panels,Te)}}),Jt.attr("transform",function(oe){return a(oe.xScale(oe.xIndex),0)}),Jt.call(c.behavior.drag().origin(function(oe){return oe}).on("drag",function(oe){var Te=oe.parent;ft.linePickActive(!1),oe.x=Math.max(-T.overdrag,Math.min(oe.model.width+T.overdrag,c.event.x)),oe.canvasX=oe.x*oe.model.canvasPixelRatio,Jt.sort(function(He,Ge){return He.x-Ge.x}).each(function(He,Ge){He.xIndex=Ge,He.x=oe===He?He.x:He.xScale(He.xIndex),He.canvasX=He.x*He.model.canvasPixelRatio}),W(Jt,Te,it),Jt.filter(function(He){return Math.abs(oe.xIndex-He.xIndex)!==0}).attr("transform",function(He){return a(He.xScale(He.xIndex),0)}),c.select(this).attr("transform",a(oe.x,0)),Jt.each(function(He,Ge,cr){cr===oe.parent.key&&(Te.dimensions[Ge]=He)}),Te.contextLayer&&Te.contextLayer.render(Te.panels,!1,!O(Te)),Te.focusLayer.render&&Te.focusLayer.render(Te.panels)}).on("dragend",function(oe){var Te=oe.parent;oe.x=oe.xScale(oe.xIndex),oe.canvasX=oe.x*oe.model.canvasPixelRatio,W(Jt,Te,it),c.select(this).attr("transform",function(He){return a(He.x,0)}),Te.contextLayer&&Te.contextLayer.render(Te.panels,!1,!O(Te)),Te.focusLayer&&Te.focusLayer.render(Te.panels),Te.pickLayer&&Te.pickLayer.render(Te.panels,!0),ft.linePickActive(!0),tt&&tt.axesMoved&&tt.axesMoved(Te.key,Te.dimensions.map(function(He){return He.crossfilterDimensionIndex}))})),Jt.exit().remove();var ge=Jt.selectAll("."+T.cn.axisOverlays).data(x,f);ge.enter().append("g").classed(T.cn.axisOverlays,!0),ge.selectAll("."+T.cn.axis).remove();var he=ge.selectAll("."+T.cn.axis).data(x,f);he.enter().append("g").classed(T.cn.axis,!0),he.each(function(oe){var Te=oe.model.height/oe.model.tickDistance,He=oe.domainScale,Ge=He.domain();c.select(this).call(c.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Te,oe.tickFormat).tickValues(oe.ordinal?Ge:null).tickFormat(function(cr){return v.isOrdinal(oe)?cr:X(oe.model.dimensions[oe.visibleIndex],cr)}).scale(He)),o.font(he.selectAll("text"),oe.model.tickFont)}),he.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),he.selectAll("text").style("cursor","default");var de=ge.selectAll("."+T.cn.axisHeading).data(x,f);de.enter().append("g").classed(T.cn.axisHeading,!0);var se=de.selectAll("."+T.cn.axisTitle).data(x,f);se.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",dt?"none":"auto"),se.text(function(oe){return oe.label}).each(function(oe){var Te=c.select(this);o.font(Te,oe.model.labelFont),n.convertToTspans(Te,yt)}).attr("transform",function(oe){var Te=U(oe.model.labelAngle,oe.model.labelSide),He=T.axisTitleOffset;return(Te.dir>0?"":a(0,2*He+oe.model.height))+r(Te.degrees)+a(-He*Te.dx,-He*Te.dy)}).attr("text-anchor",function(oe){var Te=U(oe.model.labelAngle,oe.model.labelSide),He=Math.abs(Te.dx),Ge=Math.abs(Te.dy);return 2*He>Ge?Te.dir*Te.dx<0?"start":"end":"middle"});var Tt=ge.selectAll("."+T.cn.axisExtent).data(x,f);Tt.enter().append("g").classed(T.cn.axisExtent,!0);var Lt=Tt.selectAll("."+T.cn.axisExtentTop).data(x,f);Lt.enter().append("g").classed(T.cn.axisExtentTop,!0),Lt.attr("transform",a(0,-T.axisExtentOffset));var Mt=Lt.selectAll("."+T.cn.axisExtentTopText).data(x,f);Mt.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(H),Mt.text(function(oe){return lt(oe,!0)}).each(function(oe){o.font(c.select(this),oe.model.rangeFont)});var te=Tt.selectAll("."+T.cn.axisExtentBottom).data(x,f);te.enter().append("g").classed(T.cn.axisExtentBottom,!0),te.attr("transform",function(oe){return a(0,oe.model.height+T.axisExtentOffset)});var ve=te.selectAll("."+T.cn.axisExtentBottomText).data(x,f);ve.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(H),ve.text(function(oe){return lt(oe,!1)}).each(function(oe){o.font(c.select(this),oe.model.rangeFont)}),u.ensureAxisBrush(ge,Y,yt)}}),aE=Ft((r,$)=>{var c=VH(),g=uT(),P=iE().isVisible,S={};function t(a,n,o){var i=n.indexOf(o),s=a.indexOf(i);return s===-1&&(s+=n.length),s}function e(a,n){return function(o,i){return t(a,n,o)-t(a,n,i)}}var r=$.exports=function(a,n){var o=a._fullLayout,i=g(a,[],S);if(i){var s={},f={},x={},y={},v=o._size;n.forEach(function(C,M){var E=C[0].trace;x[M]=E.index;var A=y[M]=E.index;s[M]=a.data[A].dimensions,f[M]=a.data[A].dimensions.slice()});var T=function(C,M,E){var A=f[C][M],h=E.map(function(N){return N.slice()}),p="dimensions["+M+"].constraintrange",k=o._tracePreGUI[a._fullData[x[C]]._fullInput.uid];if(k[p]===void 0){var w=A.constraintrange;k[p]=w||null}var R=a._fullData[x[C]].dimensions[M];h.length?(h.length===1&&(h=h[0]),A.constraintrange=h,R.constraintrange=h.slice(),h=[h]):(delete A.constraintrange,delete R.constraintrange,h=null);var O={};O[p]=h,a.emit("plotly_restyle",[O,[y[C]]])},u=function(C){a.emit("plotly_hover",C)},b=function(C){a.emit("plotly_unhover",C)},_=function(C,M){var E=e(M,f[C].filter(P));s[C].sort(E),f[C].filter(function(A){return!P(A)}).sort(function(A){return f[C].indexOf(A)}).forEach(function(A){s[C].splice(s[C].indexOf(A),1),s[C].splice(f[C].indexOf(A),0,A)}),a.emit("plotly_restyle",[{dimensions:[s[C]]},[y[C]]])};c(a,n,{width:v.w,height:v.h,margin:{t:v.t,r:v.r,b:v.b,l:v.l}},{filterChanged:T,hover:u,unhover:b,axesMoved:_})}};r.reglPrecompiled=S}),HH=Ft(Q=>{var $=un(),c=ud().getModuleCalcData,g=aE(),P=Op();Q.name="parcoords",Q.plot=function(S){var t=c(S.calcdata,"parcoords")[0];t.length&&g(S,t)},Q.clean=function(S,t,e,r){var a=r._has&&r._has("parcoords"),n=t._has&&t._has("parcoords");a&&!n&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},Q.toSVG=function(S){var t=S._fullLayout._glimages,e=$.select(S).selectAll(".svg-container"),r=e.filter(function(n,o){return o===e.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function a(){var n=this,o=n.toDataURL("image/png"),i=t.append("svg:image");i.attr({xmlns:P.svg,"xlink:href":o,preserveAspectRatio:"none",x:0,y:0,width:n.style.width,height:n.style.height})}r.each(a),window.setTimeout(function(){$.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}),WH=Ft((Q,$)=>{$.exports={attributes:QS(),supplyDefaults:OH(),calc:DH(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:HH(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}),qH=Ft((Q,$)=>{var c=WH();c.plot=aE(),$.exports=c}),ZH=Ft((Q,$)=>{$.exports=qH()}),oE=Ft((Q,$)=>{var c=Ta().extendFlat,g=$o(),P=Ea(),S=Tc(),{hovertemplateAttrs:t,templatefallbackAttrs:e}=$u(),r=Nh().attributes,a=c({editType:"calc"},S("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"})});$.exports={domain:r({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:c({},g.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:t({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),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:P({editType:"calc"}),tickfont:P({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:a,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}}),$H=Ft((Q,$)=>{var c=bn(),g=Hd().hasColorscale,P=mc(),S=Nh().defaults,t=Md(),e=oE(),r=cT(),a=Va().isTypedArraySpec;function n(i,s,f,x,y){y("line.shape"),y("line.hovertemplate"),y("line.hovertemplatefallback");var v=y("line.color",x.colorway[0]);if(g(i,"line")&&c.isArrayOrTypedArray(v)){if(v.length)return y("line.colorscale"),P(i,s,x,y,{prefix:"line.",cLetter:"c"}),v.length;s.line.color=f}return 1/0}function o(i,s){function f(_,C){return c.coerce(i,s,e.dimensions,_,C)}var x=f("values"),y=f("visible");if(x&&x.length||(y=s.visible=!1),y){f("label"),f("displayindex",s._index);var v=i.categoryarray,T=c.isArrayOrTypedArray(v)&&v.length>0||a(v),u;T&&(u="array");var b=f("categoryorder",u);b==="array"?(f("categoryarray"),f("ticktext")):(delete i.categoryarray,delete i.ticktext),!T&&b==="array"&&(s.categoryorder="trace")}}$.exports=function(i,s,f,x){function y(b,_){return c.coerce(i,s,e,b,_)}var v=t(i,s,{name:"dimensions",handleItemDefaults:o}),T=n(i,s,f,x,y);S(s,x,y),(!Array.isArray(v)||!v.length)&&(s.visible=!1),r(s,v,"values",T),y("hoveron"),y("hovertemplate"),y("hovertemplatefallback"),y("arrangement"),y("bundlecolors"),y("sortpaths"),y("counts");var u=x.font;c.coerceFont(y,"labelfont",u,{overrideDflt:{size:Math.round(u.size)}}),c.coerceFont(y,"tickfont",u,{autoShadowDflt:!0,overrideDflt:{size:Math.round(u.size/1.2)}})}}),GH=Ft((Q,$)=>{var c=Lg().wrap,g=Hd().hasColorscale,P=Jd(),S=Cc(),t=js(),e=bn(),r=ra();$.exports=function(u,b){var _=e.filterVisible(b.dimensions);if(_.length===0)return[];var C=_.map(function(st){var tt;if(st.categoryorder==="trace")tt=null;else if(st.categoryorder==="array")tt=st.categoryarray;else{tt=S(st.values);for(var dt=!0,rt=0;rt<tt.length;rt++)if(!r(tt[rt])){dt=!1;break}tt.sort(dt?e.sorterAsc:void 0),st.categoryorder==="category descending"&&(tt=tt.reverse())}return x(st.values,tt)}),M,E,A;e.isArrayOrTypedArray(b.counts)?M=b.counts:M=[b.counts],y(_),_.forEach(function(st,tt){v(st,C[tt])});var h=b.line,p;h?(g(b,"line")&&P(u,b,{vals:b.line.color,containerStr:"line",cLetter:"c"}),p=t.tryColorscale(h)):p=e.identity;function k(st){var tt,dt;return e.isArrayOrTypedArray(h.color)?(tt=h.color[st%h.color.length],dt=tt):tt=h.color,{color:p(tt),rawColor:dt}}var w=_[0].values.length,R={},O=C.map(function(st){return st.inds});A=0;var N,V;for(N=0;N<w;N++){var H=[];for(V=0;V<O.length;V++)H.push(O[V][N]);E=M[N%M.length],A+=E;var F=k(N),U=H+"-"+F.rawColor;R[U]===void 0&&(R[U]=s(H,F.color,F.rawColor)),f(R[U],N,E)}var W=_.map(function(st,tt){return n(tt,st._index,st._displayindex,st.label,A)});for(N=0;N<w;N++)for(E=M[N%M.length],V=0;V<W.length;V++){var q=W[V].containerInd,X=C[V].inds[N],lt=W[V].categories;if(lt[X]===void 0){var yt=b.dimensions[q]._categoryarray[X],pt=b.dimensions[q]._ticktext[X];lt[X]=o(V,X,yt,pt)}i(lt[X],N,E)}return c(a(W,R,A))};function a(u,b,_){var C=u.map(function(M){return M.categories.length}).reduce(function(M,E){return Math.max(M,E)});return{dimensions:u,paths:b,trace:void 0,maxCats:C,count:_}}function n(u,b,_,C,M){return{dimensionInd:u,containerInd:b,displayInd:_,dimensionLabel:C,count:M,categories:[],dragX:null}}function o(u,b,_,C){return{dimensionInd:u,categoryInd:b,categoryValue:_,displayInd:b,categoryLabel:C,valueInds:[],count:0,dragY:null}}function i(u,b,_){u.valueInds.push(b),u.count+=_}function s(u,b,_){return{categoryInds:u,color:b,rawColor:_,valueInds:[],count:0}}function f(u,b,_){u.valueInds.push(b),u.count+=_}function x(u,b){b==null?b=[]:b=b.map(function(k){return k});var _={},C={},M=[];b.forEach(function(k,w){_[k]=0,C[k]=w});for(var E=0;E<u.length;E++){var A=u[E],h;_[A]===void 0?(_[A]=1,h=b.push(A)-1,C[A]=h):(_[A]++,h=C[A]),M.push(h)}var p=b.map(function(k){return _[k]});return{uniqueValues:b,uniqueCounts:p,inds:M}}function y(u){var b=u.map(function(C){return C.displayindex}),_;if(T(b))for(_=0;_<u.length;_++)u[_]._displayindex=u[_].displayindex;else for(_=0;_<u.length;_++)u[_]._displayindex=_}function v(u,b){u._categoryarray=b.uniqueValues,u.ticktext===null||u.ticktext===void 0?u._ticktext=[]:u._ticktext=u.ticktext.slice();for(var _=u._ticktext.length;_<b.uniqueValues.length;_++)u._ticktext.push(b.uniqueValues[_])}function T(u){for(var b=new Array(u.length),_=0;_<u.length;_++){if(u[_]<0||u[_]>=u.length||b[u[_]]!==void 0)return!1;b[u[_]]=!0}return!0}}),YH=Ft((Q,$)=>{var c=un(),g=(hx(),ai(B1)).interpolateNumber,P=W_(),S=Qh(),t=bn(),e=t.strTranslate,r=js(),a=fo(),n=tc();function o(at,vt,it,Y){var ft=vt._context.staticPlot,ut=at.map(pt.bind(0,vt,it)),wt=Y.selectAll("g.parcatslayer").data([null]);wt.enter().append("g").attr("class","parcatslayer").style("pointer-events",ft?"none":"all");var zt=wt.selectAll("g.trace.parcats").data(ut,i),Pt=zt.enter().append("g").attr("class","trace parcats");zt.attr("transform",function(Mt){return e(Mt.x,Mt.y)}),Pt.append("g").attr("class","paths");var Wt=zt.select("g.paths"),Ht=Wt.selectAll("path.path").data(function(Mt){return Mt.paths},i);Ht.attr("fill",function(Mt){return Mt.model.color});var Jt=Ht.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(Mt){return Mt.model.color}).attr("fill-opacity",0);b(Jt),Ht.attr("d",function(Mt){return Mt.svgD}),Jt.empty()||Ht.sort(f),Ht.exit().remove(),Ht.on("mouseover",x).on("mouseout",y).on("click",u),Pt.append("g").attr("class","dimensions");var ge=zt.select("g.dimensions"),he=ge.selectAll("g.dimension").data(function(Mt){return Mt.dimensions},i);he.enter().append("g").attr("class","dimension"),he.attr("transform",function(Mt){return e(Mt.x,0)}),he.exit().remove();var de=he.selectAll("g.category").data(function(Mt){return Mt.categories},i),se=de.enter().append("g").attr("class","category");de.attr("transform",function(Mt){return e(0,Mt.y)}),se.append("rect").attr("class","catrect").attr("pointer-events","none"),de.select("rect.catrect").attr("fill","none").attr("width",function(Mt){return Mt.width}).attr("height",function(Mt){return Mt.height}),M(se);var Tt=de.selectAll("rect.bandrect").data(function(Mt){return Mt.bands},i);Tt.each(function(){t.raiseToTop(this)}),Tt.attr("fill",function(Mt){return Mt.color});var Lt=Tt.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(Mt){return Mt.color}).attr("fill-opacity",0);Tt.attr("fill",function(Mt){return Mt.color}).attr("width",function(Mt){return Mt.width}).attr("height",function(Mt){return Mt.height}).attr("y",function(Mt){return Mt.y}).attr("cursor",function(Mt){return Mt.parcatsViewModel.arrangement==="fixed"?"default":Mt.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),A(Lt),Tt.exit().remove(),se.append("text").attr("class","catlabel").attr("pointer-events","none"),de.select("text.catlabel").attr("text-anchor",function(Mt){return s(Mt)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(Mt){return s(Mt)?Mt.width+5:-5}).attr("y",function(Mt){return Mt.height/2}).text(function(Mt){return Mt.model.categoryLabel}).each(function(Mt){r.font(c.select(this),Mt.parcatsViewModel.categorylabelfont),n.convertToTspans(c.select(this),vt)}),se.append("text").attr("class","dimlabel"),de.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(Mt){return Mt.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(Mt){return Mt.width/2}).attr("y",-5).text(function(Mt,te){return te===0?Mt.parcatsViewModel.model.dimensions[Mt.model.dimensionInd].dimensionLabel:null}).each(function(Mt){r.font(c.select(this),Mt.parcatsViewModel.labelfont)}),de.selectAll("rect.bandrect").on("mouseover",H).on("mouseout",F),de.exit().remove(),he.call(c.behavior.drag().origin(function(Mt){return{x:Mt.x,y:0}}).on("dragstart",U).on("drag",W).on("dragend",q)),zt.each(function(Mt){Mt.traceSelection=c.select(this),Mt.pathSelection=c.select(this).selectAll("g.paths").selectAll("path.path"),Mt.dimensionSelection=c.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),zt.exit().remove()}$.exports=function(at,vt,it,Y){o(it,at,Y,vt)};function i(at){return at.key}function s(at){var vt=at.parcatsViewModel.dimensions.length,it=at.parcatsViewModel.dimensions[vt-1].model.dimensionInd;return at.model.dimensionInd===it}function f(at,vt){return at.model.rawColor>vt.model.rawColor?1:at.model.rawColor<vt.model.rawColor?-1:0}function x(at){if(!at.parcatsViewModel.dragDimension&&at.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){t.raiseToTop(this),_(c.select(this));var vt=v(at),it=T(at);if(at.parcatsViewModel.graphDiv.emit("plotly_hover",{points:vt,event:c.event,constraints:it}),at.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Y=c.mouse(this)[0],ft=at.parcatsViewModel.graphDiv,ut=at.parcatsViewModel.trace,wt=ft._fullLayout,zt=wt._paperdiv.node().getBoundingClientRect(),Pt=at.parcatsViewModel.graphDiv.getBoundingClientRect(),Wt,Ht,Jt;for(Jt=0;Jt<at.leftXs.length-1;Jt++)if(at.leftXs[Jt]+at.dimWidths[Jt]-2<=Y&&Y<=at.leftXs[Jt+1]+2){var ge=at.parcatsViewModel.dimensions[Jt],he=at.parcatsViewModel.dimensions[Jt+1];Wt=(ge.x+ge.width+he.x)/2,Ht=(at.topYs[Jt]+at.topYs[Jt+1]+at.height)/2;break}var de=at.parcatsViewModel.x+Wt,se=at.parcatsViewModel.y+Ht,Tt=a.mostReadable(at.model.color,["black","white"]),Lt=at.model.count,Mt=Lt/at.parcatsViewModel.model.count,te={countLabel:Lt,probabilityLabel:Mt.toFixed(3)},ve=[];at.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&ve.push(["Count:",te.countLabel].join(" ")),at.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&ve.push(["P:",te.probabilityLabel].join(" "));var oe=ve.join("<br>"),Te=c.mouse(ft)[0];S.loneHover({trace:ut,x:de-zt.left+Pt.left,y:se-zt.top+Pt.top,text:oe,color:at.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Tt,idealAlign:Te<de?"right":"left",hovertemplate:(ut.line||{}).hovertemplate,hovertemplateLabels:te,eventData:[{data:ut._input,fullData:ut,count:Lt,probability:Mt}]},{container:wt._hoverlayer.node(),outerContainer:wt._paper.node(),gd:ft})}}}function y(at){if(!at.parcatsViewModel.dragDimension&&(b(c.select(this)),S.loneUnhover(at.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),at.parcatsViewModel.pathSelection.sort(f),at.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1)){var vt=v(at),it=T(at);at.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:vt,event:c.event,constraints:it})}}function v(at){for(var vt=[],it=X(at.parcatsViewModel),Y=0;Y<at.model.valueInds.length;Y++){var ft=at.model.valueInds[Y];vt.push({curveNumber:it,pointNumber:ft})}return vt}function T(at){for(var vt={},it=at.parcatsViewModel.model.dimensions,Y=0;Y<it.length;Y++){var ft=it[Y],ut=ft.categories[at.model.categoryInds[Y]];vt[ft.containerInd]=ut.categoryValue}return at.model.rawColor!==void 0&&(vt.color=at.model.rawColor),vt}function u(at){if(at.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var vt=v(at),it=T(at);at.parcatsViewModel.graphDiv.emit("plotly_click",{points:vt,event:c.event,constraints:it})}}function b(at){at.attr("fill",function(vt){return vt.model.color}).attr("fill-opacity",.6).attr("stroke","lightgray").attr("stroke-width",.2).attr("stroke-opacity",1)}function _(at){at.attr("fill-opacity",.8).attr("stroke",function(vt){return a.mostReadable(vt.model.color,["black","white"])}).attr("stroke-width",.3)}function C(at){at.select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}function M(at){at.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function E(at){at.attr("stroke","black").attr("stroke-width",1.5)}function A(at){at.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function h(at){var vt=at.parcatsViewModel.pathSelection,it=at.categoryViewModel.model.dimensionInd,Y=at.categoryViewModel.model.categoryInd;return vt.filter(function(ft){return ft.model.categoryInds[it]===Y&&ft.model.color===at.color})}function p(at){var vt=c.select(at.parentNode).selectAll("rect.bandrect");vt.each(function(it){var Y=h(it);_(Y),Y.each(function(){t.raiseToTop(this)})}),C(c.select(at.parentNode))}function k(at){var vt=c.select(at).datum(),it=h(vt);_(it),it.each(function(){t.raiseToTop(this)}),c.select(at.parentNode).selectAll("rect.bandrect").filter(function(Y){return Y.color===vt.color}).each(function(){t.raiseToTop(this),E(c.select(this))})}function w(at,vt,it){var Y=c.select(at).datum(),ft=Y.categoryViewModel.model,ut=Y.parcatsViewModel.graphDiv,wt=c.select(at.parentNode).selectAll("rect.bandrect"),zt=[];wt.each(function(Wt){var Ht=h(Wt);Ht.each(function(Jt){Array.prototype.push.apply(zt,v(Jt))})});var Pt={};Pt[ft.dimensionInd]=ft.categoryValue,ut.emit(vt,{points:zt,event:it,constraints:Pt})}function R(at,vt,it){var Y=c.select(at).datum(),ft=Y.categoryViewModel.model,ut=Y.parcatsViewModel.graphDiv,wt=h(Y),zt=[];wt.each(function(Wt){Array.prototype.push.apply(zt,v(Wt))});var Pt={};Pt[ft.dimensionInd]=ft.categoryValue,Y.rawColor!==void 0&&(Pt.color=Y.rawColor),ut.emit(vt,{points:zt,event:it,constraints:Pt})}function O(at,vt,it){at._fullLayout._calcInverseTransform(at);var Y=at._fullLayout._invScaleX,ft=at._fullLayout._invScaleY,ut=c.select(it.parentNode).select("rect.catrect"),wt=ut.node().getBoundingClientRect(),zt=ut.datum(),Pt=zt.parcatsViewModel,Wt=Pt.model.dimensions[zt.model.dimensionInd],Ht=Pt.trace,Jt=wt.top+wt.height/2,ge,he;Pt.dimensions.length>1&&Wt.displayInd===Pt.dimensions.length-1?(ge=wt.left,he="left"):(ge=wt.left+wt.width,he="right");var de=zt.model.count,se=zt.model.categoryLabel,Tt=de/zt.parcatsViewModel.model.count,Lt={countLabel:de,categoryLabel:se,probabilityLabel:Tt.toFixed(3)},Mt=[];zt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Mt.push(["Count:",Lt.countLabel].join(" ")),zt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&Mt.push(["P("+Lt.categoryLabel+"):",Lt.probabilityLabel].join(" "));var te=Mt.join("<br>");return{trace:Ht,x:Y*(ge-vt.left),y:ft*(Jt-vt.top),text:te,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:he,hovertemplate:Ht.hovertemplate,hovertemplateLabels:Lt,eventData:[{data:Ht._input,fullData:Ht,count:de,category:se,probability:Tt}]}}function N(at,vt,it){var Y=[];return c.select(it.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ft=this;Y.push(O(at,vt,ft))}),Y}function V(at,vt,it){at._fullLayout._calcInverseTransform(at);var Y=at._fullLayout._invScaleX,ft=at._fullLayout._invScaleY,ut=it.getBoundingClientRect(),wt=c.select(it).datum(),zt=wt.categoryViewModel,Pt=zt.parcatsViewModel,Wt=Pt.model.dimensions[zt.model.dimensionInd],Ht=Pt.trace,Jt=ut.y+ut.height/2,ge,he;Pt.dimensions.length>1&&Wt.displayInd===Pt.dimensions.length-1?(ge=ut.left,he="left"):(ge=ut.left+ut.width,he="right");var de=zt.model.categoryLabel,se=wt.parcatsViewModel.model.count,Tt=0;wt.categoryViewModel.bands.forEach(function(ur){ur.color===wt.color&&(Tt+=ur.count)});var Lt=zt.model.count,Mt=0;Pt.pathSelection.each(function(ur){ur.model.color===wt.color&&(Mt+=ur.model.count)});var te=Tt/se,ve=Tt/Mt,oe=Tt/Lt,Te={countLabel:Tt,categoryLabel:de,probabilityLabel:te.toFixed(3)},He=[];zt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&He.push(["Count:",Te.countLabel].join(" ")),zt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(He.push("P(color ∩ "+de+"): "+Te.probabilityLabel),He.push("P("+de+" | color): "+ve.toFixed(3)),He.push("P(color | "+de+"): "+oe.toFixed(3)));var Ge=He.join("<br>"),cr=a.mostReadable(wt.color,["black","white"]);return{trace:Ht,x:Y*(ge-vt.left),y:ft*(Jt-vt.top),text:Ge,color:wt.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:cr,fontSize:10,idealAlign:he,hovertemplate:Ht.hovertemplate,hovertemplateLabels:Te,eventData:[{data:Ht._input,fullData:Ht,category:de,count:se,probability:te,categorycount:Lt,colorcount:Mt,bandcolorcount:Tt}]}}function H(at){if(!at.parcatsViewModel.dragDimension&&at.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var vt=c.mouse(this)[1];if(vt<-1)return;var it=at.parcatsViewModel.graphDiv,Y=it._fullLayout,ft=Y._paperdiv.node().getBoundingClientRect(),ut=at.parcatsViewModel.hoveron,wt=this;if(ut==="color"?(k(wt),R(wt,"plotly_hover",c.event)):(p(wt),w(wt,"plotly_hover",c.event)),at.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var zt;ut==="category"?zt=O(it,ft,wt):ut==="color"?zt=V(it,ft,wt):ut==="dimension"&&(zt=N(it,ft,wt)),zt&&S.loneHover(zt,{container:Y._hoverlayer.node(),outerContainer:Y._paper.node(),gd:it})}}}function F(at){var vt=at.parcatsViewModel;if(!vt.dragDimension&&(b(vt.pathSelection),M(vt.dimensionSelection.selectAll("g.category")),A(vt.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),S.loneUnhover(vt.graphDiv._fullLayout._hoverlayer.node()),vt.pathSelection.sort(f),vt.hoverinfoItems.indexOf("skip")===-1)){var it=at.parcatsViewModel.hoveron,Y=this;it==="color"?R(Y,"plotly_unhover",c.event):w(Y,"plotly_unhover",c.event)}}function U(at){at.parcatsViewModel.arrangement!=="fixed"&&(at.dragDimensionDisplayInd=at.model.displayInd,at.initialDragDimensionDisplayInds=at.parcatsViewModel.model.dimensions.map(function(vt){return vt.displayInd}),at.dragHasMoved=!1,at.dragCategoryDisplayInd=null,c.select(this).selectAll("g.category").select("rect.catrect").each(function(vt){var it=c.mouse(this)[0],Y=c.mouse(this)[1];-2<=it&&it<=vt.width+2&&-2<=Y&&Y<=vt.height+2&&(at.dragCategoryDisplayInd=vt.model.displayInd,at.initialDragCategoryDisplayInds=at.model.categories.map(function(ft){return ft.displayInd}),vt.model.dragY=vt.y,t.raiseToTop(this.parentNode),c.select(this.parentNode).selectAll("rect.bandrect").each(function(ft){ft.y<Y&&Y<=ft.y+ft.height&&(at.potentialClickBand=this)}))}),at.parcatsViewModel.dragDimension=at,S.loneUnhover(at.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()))}function W(at){if(at.parcatsViewModel.arrangement!=="fixed"&&(at.dragHasMoved=!0,at.dragDimensionDisplayInd!==null)){var vt=at.dragDimensionDisplayInd,it=vt-1,Y=vt+1,ft=at.parcatsViewModel.dimensions[vt];if(at.dragCategoryDisplayInd!==null){var ut=ft.categories[at.dragCategoryDisplayInd];ut.model.dragY+=c.event.dy;var wt=ut.model.dragY,zt=ut.model.displayInd,Pt=ft.categories,Wt=Pt[zt-1],Ht=Pt[zt+1];Wt!==void 0&&wt<Wt.y+Wt.height/2&&(ut.model.displayInd=Wt.model.displayInd,Wt.model.displayInd=zt),Ht!==void 0&&wt+ut.height>Ht.y+Ht.height/2&&(ut.model.displayInd=Ht.model.displayInd,Ht.model.displayInd=zt),at.dragCategoryDisplayInd=ut.model.displayInd}if(at.dragCategoryDisplayInd===null||at.parcatsViewModel.arrangement==="freeform"){ft.model.dragX=c.event.x;var Jt=at.parcatsViewModel.dimensions[it],ge=at.parcatsViewModel.dimensions[Y];Jt!==void 0&&ft.model.dragX<Jt.x+Jt.width&&(ft.model.displayInd=Jt.model.displayInd,Jt.model.displayInd=vt),ge!==void 0&&ft.model.dragX+ft.width>ge.x&&(ft.model.displayInd=ge.model.displayInd,ge.model.displayInd=at.dragDimensionDisplayInd),at.dragDimensionDisplayInd=ft.model.displayInd}dt(at.parcatsViewModel),tt(at.parcatsViewModel),yt(at.parcatsViewModel),lt(at.parcatsViewModel)}}function q(at){if(at.parcatsViewModel.arrangement!=="fixed"&&at.dragDimensionDisplayInd!==null){c.select(this).selectAll("text").attr("font-weight","normal");var vt={},it=X(at.parcatsViewModel),Y=at.parcatsViewModel.model.dimensions.map(function(ge){return ge.displayInd}),ft=at.initialDragDimensionDisplayInds.some(function(ge,he){return ge!==Y[he]});ft&&Y.forEach(function(ge,he){var de=at.parcatsViewModel.model.dimensions[he].containerInd;vt["dimensions["+de+"].displayindex"]=ge});var ut=!1;if(at.dragCategoryDisplayInd!==null){var wt=at.model.categories.map(function(ge){return ge.displayInd});if(ut=at.initialDragCategoryDisplayInds.some(function(ge,he){return ge!==wt[he]}),ut){var zt=at.model.categories.slice().sort(function(ge,he){return ge.displayInd-he.displayInd}),Pt=zt.map(function(ge){return ge.categoryValue}),Wt=zt.map(function(ge){return ge.categoryLabel});vt["dimensions["+at.model.containerInd+"].categoryarray"]=[Pt],vt["dimensions["+at.model.containerInd+"].ticktext"]=[Wt],vt["dimensions["+at.model.containerInd+"].categoryorder"]="array"}}if(at.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!at.dragHasMoved&&at.potentialClickBand&&(at.parcatsViewModel.hoveron==="color"?R(at.potentialClickBand,"plotly_click",c.event.sourceEvent):w(at.potentialClickBand,"plotly_click",c.event.sourceEvent)),at.model.dragX=null,at.dragCategoryDisplayInd!==null){var Ht=at.parcatsViewModel.dimensions[at.dragDimensionDisplayInd].categories[at.dragCategoryDisplayInd];Ht.model.dragY=null,at.dragCategoryDisplayInd=null}at.dragDimensionDisplayInd=null,at.parcatsViewModel.dragDimension=null,at.dragHasMoved=null,at.potentialClickBand=null,dt(at.parcatsViewModel),tt(at.parcatsViewModel);var Jt=c.transition().duration(300).ease("cubic-in-out");Jt.each(function(){yt(at.parcatsViewModel,!0),lt(at.parcatsViewModel,!0)}).each("end",function(){(ft||ut)&&P.restyle(at.parcatsViewModel.graphDiv,vt,[it])})}}function X(at){for(var vt,it=at.graphDiv._fullData,Y=0;Y<it.length;Y++)if(at.key===it[Y].uid){vt=Y;break}return vt}function lt(at,vt){vt===void 0&&(vt=!1);function it(Y){return vt?Y.transition():Y}at.pathSelection.data(function(Y){return Y.paths},i),it(at.pathSelection).attr("d",function(Y){return Y.svgD})}function yt(at,vt){vt===void 0&&(vt=!1);function it(Pt){return vt?Pt.transition():Pt}at.dimensionSelection.data(function(Pt){return Pt.dimensions},i);var Y=at.dimensionSelection.selectAll("g.category").data(function(Pt){return Pt.categories},i);it(at.dimensionSelection).attr("transform",function(Pt){return e(Pt.x,0)}),it(Y).attr("transform",function(Pt){return e(0,Pt.y)});var ft=Y.select(".dimlabel");ft.text(function(Pt,Wt){return Wt===0?Pt.parcatsViewModel.model.dimensions[Pt.model.dimensionInd].dimensionLabel:null});var ut=Y.select(".catlabel");ut.attr("text-anchor",function(Pt){return s(Pt)?"start":"end"}).attr("x",function(Pt){return s(Pt)?Pt.width+5:-5}).each(function(Pt){var Wt,Ht;s(Pt)?(Wt=Pt.width+5,Ht="start"):(Wt=-5,Ht="end"),c.select(this).selectAll("tspan").attr("x",Wt).attr("text-anchor",Ht)});var wt=Y.selectAll("rect.bandrect").data(function(Pt){return Pt.bands},i),zt=wt.enter().append("rect").attr("class","bandrect").attr("cursor","move").attr("stroke-opacity",0).attr("fill",function(Pt){return Pt.color}).attr("fill-opacity",0);wt.attr("fill",function(Pt){return Pt.color}).attr("width",function(Pt){return Pt.width}).attr("height",function(Pt){return Pt.height}).attr("y",function(Pt){return Pt.y}),A(zt),wt.each(function(){t.raiseToTop(this)}),wt.exit().remove()}function pt(at,vt,it){var Y=it[0],ft=vt.margin||{l:80,r:80,t:100,b:80},ut=Y.trace,wt=ut.domain,zt=vt.width,Pt=vt.height,Wt=Math.floor(zt*(wt.x[1]-wt.x[0])),Ht=Math.floor(Pt*(wt.y[1]-wt.y[0])),Jt=wt.x[0]*zt+ft.l,ge=vt.height-wt.y[1]*vt.height+ft.t,he=ut.line.shape,de;ut.hoverinfo==="all"?de=["count","probability"]:de=(ut.hoverinfo||"").split("+");var se={trace:ut,key:ut.uid,model:Y,x:Jt,y:ge,width:Wt,height:Ht,hoveron:ut.hoveron,hoverinfoItems:de,arrangement:ut.arrangement,bundlecolors:ut.bundlecolors,sortpaths:ut.sortpaths,labelfont:ut.labelfont,categorylabelfont:ut.tickfont,pathShape:he,dragDimension:null,margin:ft,paths:[],dimensions:[],graphDiv:at,traceSelection:null,pathSelection:null,dimensionSelection:null};return Y.dimensions&&(dt(se),tt(se)),se}function st(at,vt,it,Y,ft){var ut=[],wt=[],zt,Pt;for(Pt=0;Pt<it.length-1;Pt++)zt=g(it[Pt]+at[Pt],at[Pt+1]),ut.push(zt(ft)),wt.push(zt(1-ft));var Wt="M "+at[0]+","+vt[0];for(Wt+="l"+it[0]+",0 ",Pt=1;Pt<it.length;Pt++)Wt+="C"+ut[Pt-1]+","+vt[Pt-1]+" "+wt[Pt-1]+","+vt[Pt]+" "+at[Pt]+","+vt[Pt],Wt+="l"+it[Pt]+",0 ";for(Wt+="l0,"+Y+" ",Wt+="l -"+it[it.length-1]+",0 ",Pt=it.length-2;Pt>=0;Pt--)Wt+="C"+wt[Pt]+","+(vt[Pt+1]+Y)+" "+ut[Pt]+","+(vt[Pt]+Y)+" "+(at[Pt]+it[Pt])+","+(vt[Pt]+Y),Wt+="l-"+it[Pt]+",0 ";return Wt+="Z",Wt}function tt(at){var vt=at.dimensions,it=at.model,Y=vt.map(function(br){return br.categories.map(function(Kr){return Kr.y})}),ft=at.model.dimensions.map(function(br){return br.categories.map(function(Kr){return Kr.displayInd})}),ut=at.model.dimensions.map(function(br){return br.displayInd}),wt=at.dimensions.map(function(br){return br.model.dimensionInd}),zt=vt.map(function(br){return br.x}),Pt=vt.map(function(br){return br.width}),Wt=[];for(var Ht in it.paths)it.paths.hasOwnProperty(Ht)&&Wt.push(it.paths[Ht]);function Jt(br){var Kr=br.categoryInds.map(function(Ce,$t){return ft[$t][Ce]}),rn=wt.map(function(Ce){return Kr[Ce]});return rn}Wt.sort(function(br,Kr){var rn=Jt(br),Ce=Jt(Kr);return at.sortpaths==="backward"&&(rn.reverse(),Ce.reverse()),rn.push(br.valueInds[0]),Ce.push(Kr.valueInds[0]),at.bundlecolors&&(rn.unshift(br.rawColor),Ce.unshift(Kr.rawColor)),rn<Ce?-1:rn>Ce?1:0});for(var ge=new Array(Wt.length),he=vt[0].model.count,de=vt[0].categories.map(function(br){return br.height}).reduce(function(br,Kr){return br+Kr}),se=0;se<Wt.length;se++){var Tt=Wt[se],Lt;he>0?Lt=de*(Tt.count/he):Lt=0;for(var Mt=new Array(Y.length),te=0;te<Tt.categoryInds.length;te++){var ve=Tt.categoryInds[te],oe=ft[te][ve],Te=ut[te];Mt[Te]=Y[Te][oe],Y[Te][oe]+=Lt;var He=at.dimensions[Te].categories[oe],Ge=He.bands.length,cr=He.bands[Ge-1];if(cr===void 0||Tt.rawColor!==cr.rawColor){var ur=cr===void 0?0:cr.y+cr.height;He.bands.push({key:ur,color:Tt.color,rawColor:Tt.rawColor,height:Lt,width:He.width,count:Tt.count,y:ur,categoryViewModel:He,parcatsViewModel:at})}else{var jr=He.bands[Ge-1];jr.height+=Lt,jr.count+=Tt.count}}var Hr;at.pathShape==="hspline"?Hr=st(zt,Mt,Pt,Lt,.5):Hr=st(zt,Mt,Pt,Lt,0),ge[se]={key:Tt.valueInds[0],model:Tt,height:Lt,leftXs:zt,topYs:Mt,dimWidths:Pt,svgD:Hr,parcatsViewModel:at}}at.paths=ge}function dt(at){var vt=at.model.dimensions.map(function(wt){return{displayInd:wt.displayInd,dimensionInd:wt.dimensionInd}});vt.sort(function(wt,zt){return wt.displayInd-zt.displayInd});var it=[];for(var Y in vt){var ft=vt[Y].dimensionInd,ut=at.model.dimensions[ft];it.push(rt(at,ut))}at.dimensions=it}function rt(at,vt){var it=40,Y=16,ft=at.model.dimensions.length,ut=vt.displayInd,wt,zt,Pt;ft>1?wt=(at.width-2*it-Y)/(ft-1):wt=0,zt=it,Pt=zt+wt*ut;var Wt=[],Ht=at.model.maxCats,Jt=vt.categories.length,ge=8,he=vt.count,de=at.height-ge*(Ht-1),se,Tt,Lt,Mt,te,ve=(Ht-Jt)*ge/2,oe=vt.categories.map(function(Te){return{displayInd:Te.displayInd,categoryInd:Te.categoryInd}});for(oe.sort(function(Te,He){return Te.displayInd-He.displayInd}),te=0;te<Jt;te++)Mt=oe[te].categoryInd,Tt=vt.categories[Mt],he>0?se=Tt.count/he*de:se=0,Lt={key:Tt.valueInds[0],model:Tt,width:Y,height:se,y:Tt.dragY!==null?Tt.dragY:ve,bands:[],parcatsViewModel:at},ve=ve+se+ge,Wt.push(Lt);return{key:vt.dimensionInd,x:vt.dragX!==null?vt.dragX:Pt,y:0,width:Y,model:vt,categories:Wt,parcatsViewModel:at,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}),sE=Ft((Q,$)=>{var c=YH();$.exports=function(g,P,S,t){var e=g._fullLayout,r=e._paper,a=e._size;c(g,r,P,{width:a.w,height:a.h,margin:{t:a.t,r:a.r,b:a.b,l:a.l}},S,t)}}),KH=Ft(Q=>{var $=ud().getModuleCalcData,c=sE(),g="parcats";Q.name=g,Q.plot=function(P,S,t,e){var r=$(P.calcdata,g);if(r.length){var a=r[0];c(P,a,t,e)}},Q.clean=function(P,S,t,e){var r=e._has&&e._has("parcats"),a=S._has&&S._has("parcats");r&&!a&&e._paperdiv.selectAll(".parcats").remove()}}),XH=Ft((Q,$)=>{$.exports={attributes:oE(),supplyDefaults:$H(),calc:GH(),plot:sE(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:KH(),categories:["noOpacity"],meta:{}}}),JH=Ft((Q,$)=>{$.exports=XH()}),Ev=Ft((Q,$)=>{var c=G0(),g="1.13.4",P='© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',S=['© <a target="_blank" href="https://carto.com/">Carto</a>',P].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:P,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:S,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:S,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"}},a=c(r);$.exports={requiredVersion:g,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:a,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+g+"."].join(`
`),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(`
`),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",a.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')`}}}),M3=Ft((Q,$)=>{var c=bn(),g=li().defaultLine,P=Nh().attributes,S=Ea(),t=tf().textposition,e=Yc().overrideAll,r=pu().templatedArray,a=Ev(),n=S({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var o=$.exports=e({_arrayAttrRegexps:[c.counterRegex("mapbox",".layers",!0)],domain:P({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:a.styleValuesMapbox.concat(a.styleValuesNonMapbox),dflt:a.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:g},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:g}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:c.extendFlat({},t,{arrayOk:!1})}})},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}),dT=Ft((Q,$)=>{var{hovertemplateAttrs:c,texttemplateAttrs:g,templatefallbackAttrs:P}=$u(),S=z0(),t=dx(),e=tf(),r=M3(),a=$o(),n=Tc(),o=Ta().extendFlat,i=Yc().overrideAll,s=M3(),f=t.line,x=t.marker;$.exports=i({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({},x.opacity,{dflt:1})},mode:o({},e.mode,{dflt:"markers"}),text:o({},e.text,{}),texttemplate:g({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:P({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:x.opacity,size:x.size,sizeref:x.sizeref,sizemin:x.sizemin,sizemode:x.sizemode},n("marker")),fill:t.fill,fillcolor:S(),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({},a.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:c(),hovertemplatefallback:P()},"calc","nested")}),lE=Ft((Q,$)=>{var c=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];$.exports={isSupportedFont:function(g){return c.indexOf(g)!==-1}}}),QH=Ft((Q,$)=>{var c=bn(),g=Ac(),P=s0(),S=I0(),t=x0(),e=O0(),r=dT(),a=lE().isSupportedFont;$.exports=function(o,i,s,f){function x(p,k){return c.coerce(o,i,r,p,k)}function y(p,k){return c.coerce2(o,i,r,p,k)}var v=n(o,i,x);if(!v){i.visible=!1;return}if(x("text"),x("texttemplate"),x("texttemplatefallback"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback"),x("mode"),x("below"),g.hasMarkers(i)){P(o,i,s,f,x,{noLine:!0,noAngle:!0}),x("marker.allowoverlap"),x("marker.angle");var T=i.marker;T.symbol!=="circle"&&(c.isArrayOrTypedArray(T.size)&&(T.size=T.size[0]),c.isArrayOrTypedArray(T.color)&&(T.color=T.color[0]))}g.hasLines(i)&&(S(o,i,s,f,x,{noDash:!0}),x("connectgaps"));var u=y("cluster.maxzoom"),b=y("cluster.step"),_=y("cluster.color",i.marker&&i.marker.color||s),C=y("cluster.size"),M=y("cluster.opacity"),E=u!==!1||b!==!1||_!==!1||C!==!1||M!==!1,A=x("cluster.enabled",E);if(A||g.hasText(i)){var h=f.font.family;t(o,i,f,x,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:a(h)?h:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}x("fill"),i.fill!=="none"&&e(o,i,s,x),c.coerceSelectionMarkerOpacity(i,x)};function n(o,i,s){var f=s("lon")||[],x=s("lat")||[],y=Math.min(f.length,x.length);return i._length=y,y}}),uE=Ft((Q,$)=>{var c=Es();$.exports=function(g,P,S){var t={},e=S[P.subplot]._subplot,r=e.mockAxis,a=g.lonlat;return t.lonLabel=c.tickText(r,r.c2l(a[0]),!0).text,t.latLabel=c.tickText(r,r.c2l(a[1]),!0).text,t}}),cE=Ft((Q,$)=>{var c=bn();$.exports=function(g,P){var S=g.split(" "),t=S[0],e=S[1],r=c.isArrayOrTypedArray(P)?c.mean(P):P,a=.5+r/100,n=1.5+r/100,o=["",""],i=[0,0];switch(t){case"top":o[0]="top",i[1]=-n;break;case"bottom":o[0]="bottom",i[1]=n;break}switch(e){case"left":o[1]="right",i[0]=-a;break;case"right":o[1]="left",i[0]=a;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:i}}}),tW=Ft((Q,$)=>{var c=ra(),g=bn(),P=Da().BADNUM,S=U1(),t=Xc(),e=js(),r=yg(),a=Ac(),n=lE().isSupportedFont,o=cE(),i=Dp().appendArrayPointValue,s=tc().NEWLINES,f=tc().BR_TAG_ALL;$.exports=function(M,E){var A=E[0].trace,h=A.visible===!0&&A._length!==0,p=A.fill!=="none",k=a.hasLines(A),w=a.hasMarkers(A),R=a.hasText(A),O=w&&A.marker.symbol==="circle",N=w&&A.marker.symbol!=="circle",V=A.cluster&&A.cluster.enabled,H=x("fill"),F=x("line"),U=x("circle"),W=x("symbol"),q={fill:H,line:F,circle:U,symbol:W};if(!h)return q;var X;if((p||k)&&(X=S.calcTraceToLineCoords(E)),p&&(H.geojson=S.makePolygon(X),H.layout.visibility="visible",g.extendFlat(H.paint,{"fill-color":A.fillcolor})),k&&(F.geojson=S.makeLine(X),F.layout.visibility="visible",g.extendFlat(F.paint,{"line-width":A.line.width,"line-color":A.line.color,"line-opacity":A.opacity})),O){var lt=y(E);U.geojson=lt.geojson,U.layout.visibility="visible",V&&(U.filter=["!",["has","point_count"]],q.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":_(A.cluster.color,A.cluster.step),"circle-radius":_(A.cluster.size,A.cluster.step),"circle-opacity":_(A.cluster.opacity,A.cluster.step)}},q.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":C(A),"text-size":12}}),g.extendFlat(U.paint,{"circle-color":lt.mcc,"circle-radius":lt.mrc,"circle-opacity":lt.mo})}if(O&&V&&(U.filter=["!",["has","point_count"]]),(N||R)&&(W.geojson=v(E,M),g.extendFlat(W.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),N&&(g.extendFlat(W.layout,{"icon-size":A.marker.size/10}),"angle"in A.marker&&A.marker.angle!=="auto"&&g.extendFlat(W.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),W.layout["icon-allow-overlap"]=A.marker.allowoverlap,g.extendFlat(W.paint,{"icon-opacity":A.opacity*A.marker.opacity,"icon-color":A.marker.color})),R)){var yt=(A.marker||{}).size,pt=o(A.textposition,yt);g.extendFlat(W.layout,{"text-size":A.textfont.size,"text-anchor":pt.anchor,"text-offset":pt.offset,"text-font":C(A)}),g.extendFlat(W.paint,{"text-color":A.textfont.color,"text-opacity":A.opacity})}return q};function x(M){return{type:M,geojson:S.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function y(M){var E=M[0].trace,A=E.marker,h=E.selectedpoints,p=g.isArrayOrTypedArray(A.color),k=g.isArrayOrTypedArray(A.size),w=g.isArrayOrTypedArray(A.opacity),R;function O(pt){return E.opacity*pt}function N(pt){return pt/2}var V;p&&(t.hasColorscale(E,"marker")?V=t.makeColorScaleFuncFromTrace(A):V=g.identity);var H;k&&(H=r(E));var F;w&&(F=function(pt){var st=c(pt)?+g.constrain(pt,0,1):0;return O(st)});var U=[];for(R=0;R<M.length;R++){var W=M[R],q=W.lonlat;if(!b(q)){var X={};V&&(X.mcc=W.mcc=V(W.mc)),H&&(X.mrc=W.mrc=H(W.ms)),F&&(X.mo=F(W.mo)),h&&(X.selected=W.selected||0),U.push({type:"Feature",id:R+1,geometry:{type:"Point",coordinates:q},properties:X})}}var lt;if(h)for(lt=e.makeSelectedPointStyleFns(E),R=0;R<U.length;R++){var yt=U[R].properties;lt.selectedOpacityFn&&(yt.mo=O(lt.selectedOpacityFn(yt))),lt.selectedColorFn&&(yt.mcc=lt.selectedColorFn(yt)),lt.selectedSizeFn&&(yt.mrc=lt.selectedSizeFn(yt))}return{geojson:{type:"FeatureCollection",features:U},mcc:p||lt&&lt.selectedColorFn?{type:"identity",property:"mcc"}:A.color,mrc:k||lt&&lt.selectedSizeFn?{type:"identity",property:"mrc"}:N(A.size),mo:w||lt&&lt.selectedOpacityFn?{type:"identity",property:"mo"}:O(A.opacity)}}function v(M,E){for(var A=E._fullLayout,h=M[0].trace,p=h.marker||{},k=p.symbol,w=p.angle,R=k!=="circle"?T(k):u,O=w!=="auto"?T(w,!0):u,N=a.hasText(h)?T(h.text):u,V=[],H=0;H<M.length;H++){var F=M[H];if(!b(F.lonlat)){var U=h.texttemplate,W;if(U){var q=Array.isArray(U)?U[H]||"":U,X=h._module.formatLabels(F,h,A),lt={};i(lt,h,F.i),W=g.texttemplateString({data:[lt,F,h._meta],fallback:h.texttemplatefallback,labels:X,locale:A._d3locale,template:q})}else W=N(H);W&&(W=W.replace(s,"").replace(f,`
`)),V.push({type:"Feature",geometry:{type:"Point",coordinates:F.lonlat},properties:{symbol:R(H),angle:O(H),text:W}})}}return{type:"FeatureCollection",features:V}}function T(M,E){return g.isArrayOrTypedArray(M)?E?function(A){return c(M[A])?+M[A]:0}:function(A){return M[A]}:M?function(){return M}:u}function u(){return""}function b(M){return M[0]===P}function _(M,E){var A;if(g.isArrayOrTypedArray(M)&&g.isArrayOrTypedArray(E)){A=["step",["get","point_count"],M[0]];for(var h=1;h<M.length;h++)A.push(E[h-1],M[h])}else A=M;return A}function C(M){var E=M.textfont,A=E.family,h=E.style,p=E.weight,k=A.split(" "),w=k[k.length-1]==="Italic";w&&k.pop(),w=w||h==="italic";var R=k.join(" ");p==="bold"&&k.indexOf("Bold")===-1?R+=" Bold":p<=1e3&&(k[0]==="Metropolis"?(R="Metropolis",p>850?R+=" Black":p>750?R+=" Extra Bold":p>650?R+=" Bold":p>550?R+=" Semi Bold":p>450?R+=" Medium":p>350?R+=" Regular":p>250?R+=" Light":p>150?R+=" Extra Light":R+=" Thin"):k.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",p>750?R+=" Extrabold":p>650?R+=" Bold":p>550?R+=" Semibold":p>350?R+=" Regular":R+=" Light"):k.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",k[3]==="CJK"&&(R+=" CJK"),R+=p>500?" Bold":" Regular")),w&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),n(R)||(R=A);var O=R.split(", ");return O}}),eW=Ft((Q,$)=>{var c=bn(),g=tW(),P=Ev().traceLayerPrefix,S={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function t(r,a,n,o){this.type="scattermapbox",this.subplot=r,this.uid=a,this.clusterEnabled=n,this.isHidden=o,this.sourceIds={fill:"source-"+a+"-fill",line:"source-"+a+"-line",circle:"source-"+a+"-circle",symbol:"source-"+a+"-symbol",cluster:"source-"+a+"-circle",clusterCount:"source-"+a+"-circle"},this.layerIds={fill:P+a+"-fill",line:P+a+"-line",circle:P+a+"-circle",symbol:P+a+"-symbol",cluster:P+a+"-cluster",clusterCount:P+a+"-cluster-count"},this.below=null}var e=t.prototype;e.addSource=function(r,a,n){var o={type:"geojson",data:a.geojson};n&&n.enabled&&c.extendFlat(o,{cluster:!0,clusterMaxZoom:n.maxzoom});var i=this.subplot.map.getSource(this.sourceIds[r]);i?i.setData(a.geojson):this.subplot.map.addSource(this.sourceIds[r],o)},e.setSourceData=function(r,a){this.subplot.map.getSource(this.sourceIds[r]).setData(a.geojson)},e.addLayer=function(r,a,n){var o={type:a.type,id:this.layerIds[r],source:this.sourceIds[r],layout:a.layout,paint:a.paint};a.filter&&(o.filter=a.filter);for(var i=this.layerIds[r],s,f=this.subplot.getMapLayers(),x=0;x<f.length;x++)if(f[x].id===i){s=!0;break}s?(this.subplot.setOptions(i,"setLayoutProperty",o.layout),o.layout.visibility==="visible"&&this.subplot.setOptions(i,"setPaintProperty",o.paint)):this.subplot.addLayer(o,n)},e.update=function(r){var a=r[0].trace,n=this.subplot,o=n.map,i=g(n.gd,r),s=n.belowLookup["trace-"+this.uid],f=!!(a.cluster&&a.cluster.enabled),x=!!this.clusterEnabled,y=this;function v(h){h||y.addSource("circle",i.circle,a.cluster);for(var p=S.cluster,k=0;k<p.length;k++){var w=p[k],R=i[w];y.addLayer(w,R,s)}}function T(h){for(var p=S.cluster,k=p.length-1;k>=0;k--){var w=p[k];o.removeLayer(y.layerIds[w])}h||o.removeSource(y.sourceIds.circle)}function u(h){for(var p=S.nonCluster,k=0;k<p.length;k++){var w=p[k],R=i[w];h||y.addSource(w,R),y.addLayer(w,R,s)}}function b(h){for(var p=S.nonCluster,k=p.length-1;k>=0;k--){var w=p[k];o.removeLayer(y.layerIds[w]),h||o.removeSource(y.sourceIds[w])}}function _(h){x?T(h):b(h)}function C(h){f?v(h):u(h)}function M(){for(var h=f?S.cluster:S.nonCluster,p=0;p<h.length;p++){var k=h[p],w=i[k];w&&(n.setOptions(y.layerIds[k],"setLayoutProperty",w.layout),w.layout.visibility==="visible"&&(k!=="cluster"&&y.setSourceData(k,w),n.setOptions(y.layerIds[k],"setPaintProperty",w.paint)))}}var E=this.isHidden,A=a.visible!==!0;A?E||_():E?A||C():x!==f?(_(),C()):(this.below!==s&&(_(!0),C(!0)),M()),this.clusterEnabled=f,this.isHidden=A,this.below=s,r[0].trace._glTrace=this},e.dispose=function(){for(var r=this.subplot.map,a=this.clusterEnabled?S.cluster:S.nonCluster,n=a.length-1;n>=0;n--){var o=a[n];r.removeLayer(this.layerIds[o]),r.removeSource(this.sourceIds[o])}},$.exports=function(r,a){var n=a[0].trace,o=n.cluster&&n.cluster.enabled,i=n.visible!==!0,s=new t(r,n.uid,o,i),f=g(r.gd,a),x=s.below=r.belowLookup["trace-"+n.uid],y,v,T;if(o)for(s.addSource("circle",f.circle,n.cluster),y=0;y<S.cluster.length;y++)v=S.cluster[y],T=f[v],s.addLayer(v,T,x);else for(y=0;y<S.nonCluster.length;y++)v=S.nonCluster[y],T=f[v],s.addSource(v,T,n.cluster),s.addLayer(v,T,x);return a[0].trace._glTrace=s,s}}),pT=Ft((Q,$)=>{var c=Qh(),g=bn(),P=Du(),S=g.fillText,t=Da().BADNUM,e=Ev().traceLayerPrefix;function r(n,o,i){var s=n.cd,f=s[0].trace,x=n.xa,y=n.ya,v=n.subplot,T=[],u=e+f.uid+"-circle",b=f.cluster&&f.cluster.enabled;if(b){var _=v.map.queryRenderedFeatures(null,{layers:[u]});T=_.map(function(H){return H.id})}var C=o>=0?Math.floor((o+180)/360):Math.ceil((o-180)/360),M=C*360,E=o-M;function A(H){var F=H.lonlat;if(F[0]===t||b&&T.indexOf(H.i+1)===-1)return 1/0;var U=g.modHalf(F[0],360),W=F[1],q=v.project([U,W]),X=q.x-x.c2p([E,W]),lt=q.y-y.c2p([U,i]),yt=Math.max(3,H.mrc||0);return Math.max(Math.sqrt(X*X+lt*lt)-yt,1-3/yt)}if(c.getClosest(s,A,n),n.index!==!1){var h=s[n.index],p=h.lonlat,k=[g.modHalf(p[0],360)+M,p[1]],w=x.c2p(k),R=y.c2p(k),O=h.mrc||1;n.x0=w-O,n.x1=w+O,n.y0=R-O,n.y1=R+O;var N={};N[f.subplot]={_subplot:v};var V=f._module.formatLabels(h,f,N);return n.lonLabel=V.lonLabel,n.latLabel=V.latLabel,n.color=P(f,h),n.extraText=a(f,h,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function a(n,o,i){if(n.hovertemplate)return;var s=o.hi||n.hoverinfo,f=s.split("+"),x=f.indexOf("all")!==-1,y=f.indexOf("lon")!==-1,v=f.indexOf("lat")!==-1,T=o.lonlat,u=[];function b(_){return _+"°"}return x||y&&v?u.push("("+b(T[1])+", "+b(T[0])+")"):y?u.push(i.lon+b(T[0])):v&&u.push(i.lat+b(T[1])),(x||f.indexOf("text")!==-1)&&S(o,n,u),u.join("<br>")}$.exports={hoverPoints:r,getExtraText:a}}),rW=Ft((Q,$)=>{$.exports=function(c,g){return c.lon=g.lon,c.lat=g.lat,c}}),nW=Ft((Q,$)=>{var c=bn(),g=Ac(),P=Da().BADNUM;$.exports=function(S,t){var e=S.cd,r=S.xaxis,a=S.yaxis,n=[],o=e[0].trace,i;if(!g.hasMarkers(o))return[];if(t===!1)for(i=0;i<e.length;i++)e[i].selected=0;else for(i=0;i<e.length;i++){var s=e[i],f=s.lonlat;if(f[0]!==P){var x=[c.modHalf(f[0],360),f[1]],y=[r.c2p(x),a.c2p(x)];t.contains(y,null,i,S)?(n.push({pointNumber:i,lon:f[0],lat:f[1]}),s.selected=1):s.selected=0}}return n}}),hE=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?$.exports=g():(c=c||self,c.mapboxgl=g())})(Q,function(){var c,g,P;function S(t,e){if(!c)c=e;else if(!g)g=e;else{var r="var sharedChunk = {}; ("+c+")(sharedChunk); ("+g+")(sharedChunk);",a={};c(a),P=e(a),typeof window<"u"&&(P.workerUrl=window.URL.createObjectURL(new Blob([r],{type:"text/javascript"})))}}return S(["exports"],function(t){function e(m,B){return B={exports:{}},m(B,B.exports),B.exports}var r="1.13.4",a=n;function n(m,B,K,bt){this.cx=3*m,this.bx=3*(K-m)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*B,this.by=3*(bt-B)-this.cy,this.ay=1-this.cy-this.by,this.p1x=m,this.p1y=bt,this.p2x=K,this.p2y=bt}n.prototype.sampleCurveX=function(m){return((this.ax*m+this.bx)*m+this.cx)*m},n.prototype.sampleCurveY=function(m){return((this.ay*m+this.by)*m+this.cy)*m},n.prototype.sampleCurveDerivativeX=function(m){return(3*this.ax*m+2*this.bx)*m+this.cx},n.prototype.solveCurveX=function(m,B){typeof B>"u"&&(B=1e-6);var K,bt,Ot,Zt,ie;for(Ot=m,ie=0;ie<8;ie++){if(Zt=this.sampleCurveX(Ot)-m,Math.abs(Zt)<B)return Ot;var De=this.sampleCurveDerivativeX(Ot);if(Math.abs(De)<1e-6)break;Ot=Ot-Zt/De}if(K=0,bt=1,Ot=m,Ot<K)return K;if(Ot>bt)return bt;for(;K<bt;){if(Zt=this.sampleCurveX(Ot),Math.abs(Zt-m)<B)return Ot;m>Zt?K=Ot:bt=Ot,Ot=(bt-K)*.5+K}return Ot},n.prototype.solve=function(m,B){return this.sampleCurveY(this.solveCurveX(m,B))};var o=i;function i(m,B){this.x=m,this.y=B}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(m){return this.clone()._add(m)},sub:function(m){return this.clone()._sub(m)},multByPoint:function(m){return this.clone()._multByPoint(m)},divByPoint:function(m){return this.clone()._divByPoint(m)},mult:function(m){return this.clone()._mult(m)},div:function(m){return this.clone()._div(m)},rotate:function(m){return this.clone()._rotate(m)},rotateAround:function(m,B){return this.clone()._rotateAround(m,B)},matMult:function(m){return this.clone()._matMult(m)},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(m){return this.x===m.x&&this.y===m.y},dist:function(m){return Math.sqrt(this.distSqr(m))},distSqr:function(m){var B=m.x-this.x,K=m.y-this.y;return B*B+K*K},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(m){return Math.atan2(this.y-m.y,this.x-m.x)},angleWith:function(m){return this.angleWithSep(m.x,m.y)},angleWithSep:function(m,B){return Math.atan2(this.x*B-this.y*m,this.x*m+this.y*B)},_matMult:function(m){var B=m[0]*this.x+m[1]*this.y,K=m[2]*this.x+m[3]*this.y;return this.x=B,this.y=K,this},_add:function(m){return this.x+=m.x,this.y+=m.y,this},_sub:function(m){return this.x-=m.x,this.y-=m.y,this},_mult:function(m){return this.x*=m,this.y*=m,this},_div:function(m){return this.x/=m,this.y/=m,this},_multByPoint:function(m){return this.x*=m.x,this.y*=m.y,this},_divByPoint:function(m){return this.x/=m.x,this.y/=m.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var m=this.y;return this.y=this.x,this.x=-m,this},_rotate:function(m){var B=Math.cos(m),K=Math.sin(m),bt=B*this.x-K*this.y,Ot=K*this.x+B*this.y;return this.x=bt,this.y=Ot,this},_rotateAround:function(m,B){var K=Math.cos(m),bt=Math.sin(m),Ot=B.x+K*(this.x-B.x)-bt*(this.y-B.y),Zt=B.y+bt*(this.x-B.x)+K*(this.y-B.y);return this.x=Ot,this.y=Zt,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(m){return m instanceof i?m:Array.isArray(m)?new i(m[0],m[1]):m};var s=typeof self<"u"?self:{};function f(m,B){if(Array.isArray(m)){if(!Array.isArray(B)||m.length!==B.length)return!1;for(var K=0;K<m.length;K++)if(!f(m[K],B[K]))return!1;return!0}if(typeof m=="object"&&m!==null&&B!==null){if(typeof B!="object")return!1;var bt=Object.keys(m);if(bt.length!==Object.keys(B).length)return!1;for(var Ot in m)if(!f(m[Ot],B[Ot]))return!1;return!0}return m===B}var x=Math.pow(2,53)-1;function y(m){if(m<=0)return 0;if(m>=1)return 1;var B=m*m,K=B*m;return 4*(m<.5?K:3*(m-B)+K-.75)}function v(m,B,K,bt){var Ot=new a(m,B,K,bt);return function(Zt){return Ot.solve(Zt)}}var T=v(.25,.1,.25,1);function u(m,B,K){return Math.min(K,Math.max(B,m))}function b(m,B,K){var bt=K-B,Ot=((m-B)%bt+bt)%bt+B;return Ot===B?K:Ot}function _(m,B,K){if(!m.length)return K(null,[]);var bt=m.length,Ot=new Array(m.length),Zt=null;m.forEach(function(ie,De){B(ie,function(Je,vr){Je&&(Zt=Je),Ot[De]=vr,--bt===0&&K(Zt,Ot)})})}function C(m){var B=[];for(var K in m)B.push(m[K]);return B}function M(m,B){var K=[];for(var bt in m)bt in B||K.push(bt);return K}function E(m){for(var B=[],K=arguments.length-1;K-- >0;)B[K]=arguments[K+1];for(var bt=0,Ot=B;bt<Ot.length;bt+=1){var Zt=Ot[bt];for(var ie in Zt)m[ie]=Zt[ie]}return m}function A(m,B){for(var K={},bt=0;bt<B.length;bt++){var Ot=B[bt];Ot in m&&(K[Ot]=m[Ot])}return K}var h=1;function p(){return h++}function k(){function m(B){return B?(B^Math.random()*16>>B/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,m)}return m()}function w(m){return m<=1?1:Math.pow(2,Math.ceil(Math.log(m)/Math.LN2))}function R(m){return m?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(m):!1}function O(m,B){m.forEach(function(K){B[K]&&(B[K]=B[K].bind(B))})}function N(m,B){return m.indexOf(B,m.length-B.length)!==-1}function V(m,B,K){var bt={};for(var Ot in m)bt[Ot]=B.call(K||this,m[Ot],Ot,m);return bt}function H(m,B,K){var bt={};for(var Ot in m)B.call(K||this,m[Ot],Ot,m)&&(bt[Ot]=m[Ot]);return bt}function F(m){return Array.isArray(m)?m.map(F):typeof m=="object"&&m?V(m,F):m}function U(m,B){for(var K=0;K<m.length;K++)if(B.indexOf(m[K])>=0)return!0;return!1}var W={};function q(m){W[m]||(typeof console<"u"&&console.warn(m),W[m]=!0)}function X(m,B,K){return(K.y-m.y)*(B.x-m.x)>(B.y-m.y)*(K.x-m.x)}function lt(m){for(var B=0,K=0,bt=m.length,Ot=bt-1,Zt=void 0,ie=void 0;K<bt;Ot=K++)Zt=m[K],ie=m[Ot],B+=(ie.x-Zt.x)*(Zt.y+ie.y);return B}function yt(m){var B=m[0],K=m[1],bt=m[2];return K+=90,K*=Math.PI/180,bt*=Math.PI/180,{x:B*Math.cos(K)*Math.sin(bt),y:B*Math.sin(K)*Math.sin(bt),z:B*Math.cos(bt)}}function pt(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function st(m){var B=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,K={};if(m.replace(B,function(Ot,Zt,ie,De){var Je=ie||De;return K[Zt]=Je?Je.toLowerCase():!0,""}),K["max-age"]){var bt=parseInt(K["max-age"],10);isNaN(bt)?delete K["max-age"]:K["max-age"]=bt}return K}var tt=null;function dt(m){if(tt==null){var B=m.navigator?m.navigator.userAgent:null;tt=!!m.safari||!!(B&&(/\b(iPad|iPhone|iPod)\b/.test(B)||B.match("Safari")&&!B.match("Chrome")))}return tt}function rt(m){try{var B=s[m];return B.setItem("_mapbox_test_",1),B.removeItem("_mapbox_test_"),!0}catch{return!1}}function at(m){return s.btoa(encodeURIComponent(m).replace(/%([0-9A-F]{2})/g,function(B,K){return String.fromCharCode(+("0x"+K))}))}function vt(m){return decodeURIComponent(s.atob(m).split("").map(function(B){return"%"+("00"+B.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var it=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),Y=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,ft=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,ut,wt,zt={now:it,frame:function(m){var B=Y(m);return{cancel:function(){return ft(B)}}},getImageData:function(m,B){B===void 0&&(B=0);var K=s.document.createElement("canvas"),bt=K.getContext("2d");if(!bt)throw new Error("failed to create canvas 2d context");return K.width=m.width,K.height=m.height,bt.drawImage(m,0,0,m.width,m.height),bt.getImageData(-B,-B,m.width+2*B,m.height+2*B)},resolveURL:function(m){return ut||(ut=s.document.createElement("a")),ut.href=m,ut.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(wt==null&&(wt=s.matchMedia("(prefers-reduced-motion: reduce)")),wt.matches):!1}},Pt={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},Wt={supported:!1,testSupport:de},Ht,Jt=!1,ge,he=!1;s.document&&(ge=s.document.createElement("img"),ge.onload=function(){Ht&&se(Ht),Ht=null,he=!0},ge.onerror=function(){Jt=!0,Ht=null},ge.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function de(m){Jt||!ge||(he?se(m):Ht=m)}function se(m){var B=m.createTexture();m.bindTexture(m.TEXTURE_2D,B);try{if(m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,ge),m.isContextLost())return;Wt.supported=!0}catch{}m.deleteTexture(B),Jt=!0}var Tt="01";function Lt(){for(var m="1",B="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",K="",bt=0;bt<10;bt++)K+=B[Math.floor(Math.random()*62)];var Ot=720*60*1e3,Zt=[m,Tt,K].join(""),ie=Date.now()+Ot;return{token:Zt,tokenExpiresAt:ie}}var Mt=function(m,B){this._transformRequestFn=m,this._customAccessToken=B,this._createSkuToken()};Mt.prototype._createSkuToken=function(){var m=Lt();this._skuToken=m.token,this._skuTokenExpiresAt=m.tokenExpiresAt},Mt.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Mt.prototype.transformRequest=function(m,B){return this._transformRequestFn?this._transformRequestFn(m,B)||{url:m}:{url:m}},Mt.prototype.normalizeStyleURL=function(m,B){if(!te(m))return m;var K=cr(m);return K.path="/styles/v1"+K.path,this._makeAPIURL(K,this._customAccessToken||B)},Mt.prototype.normalizeGlyphsURL=function(m,B){if(!te(m))return m;var K=cr(m);return K.path="/fonts/v1"+K.path,this._makeAPIURL(K,this._customAccessToken||B)},Mt.prototype.normalizeSourceURL=function(m,B){if(!te(m))return m;var K=cr(m);return K.path="/v4/"+K.authority+".json",K.params.push("secure"),this._makeAPIURL(K,this._customAccessToken||B)},Mt.prototype.normalizeSpriteURL=function(m,B,K,bt){var Ot=cr(m);return te(m)?(Ot.path="/styles/v1"+Ot.path+"/sprite"+B+K,this._makeAPIURL(Ot,this._customAccessToken||bt)):(Ot.path+=""+B+K,ur(Ot))},Mt.prototype.normalizeTileURL=function(m,B){if(this._isSkuTokenExpired()&&this._createSkuToken(),m&&!te(m))return m;var K=cr(m),bt=/(\.(png|jpg)\d*)(?=$)/,Ot=/^.+\/v4\//,Zt=zt.devicePixelRatio>=2||B===512?"@2x":"",ie=Wt.supported?".webp":"$1";K.path=K.path.replace(bt,""+Zt+ie),K.path=K.path.replace(Ot,"/"),K.path="/v4"+K.path;var De=this._customAccessToken||He(K.params)||Pt.ACCESS_TOKEN;return Pt.REQUIRE_ACCESS_TOKEN&&De&&this._skuToken&&K.params.push("sku="+this._skuToken),this._makeAPIURL(K,De)},Mt.prototype.canonicalizeTileURL=function(m,B){var K="/v4/",bt=/\.[\w]+$/,Ot=cr(m);if(!Ot.path.match(/(^\/v4\/)/)||!Ot.path.match(bt))return m;var Zt="mapbox://tiles/";Zt+=Ot.path.replace(K,"");var ie=Ot.params;return B&&(ie=ie.filter(function(De){return!De.match(/^access_token=/)})),ie.length&&(Zt+="?"+ie.join("&")),Zt},Mt.prototype.canonicalizeTileset=function(m,B){for(var K=B?te(B):!1,bt=[],Ot=0,Zt=m.tiles||[];Ot<Zt.length;Ot+=1){var ie=Zt[Ot];oe(ie)?bt.push(this.canonicalizeTileURL(ie,K)):bt.push(ie)}return bt},Mt.prototype._makeAPIURL=function(m,B){var K="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",bt=cr(Pt.API_URL);if(m.protocol=bt.protocol,m.authority=bt.authority,m.protocol==="http"){var Ot=m.params.indexOf("secure");Ot>=0&&m.params.splice(Ot,1)}if(bt.path!=="/"&&(m.path=""+bt.path+m.path),!Pt.REQUIRE_ACCESS_TOKEN)return ur(m);if(B=B||Pt.ACCESS_TOKEN,!B)throw new Error("An API access token is required to use Mapbox GL. "+K);if(B[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+K);return m.params=m.params.filter(function(Zt){return Zt.indexOf("access_token")===-1}),m.params.push("access_token="+B),ur(m)};function te(m){return m.indexOf("mapbox:")===0}var ve=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function oe(m){return ve.test(m)}function Te(m){return m.indexOf("sku=")>0&&oe(m)}function He(m){for(var B=0,K=m;B<K.length;B+=1){var bt=K[B],Ot=bt.match(/^access_token=(.*)$/);if(Ot)return Ot[1]}return null}var Ge=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function cr(m){var B=m.match(Ge);if(!B)throw new Error("Unable to parse URL object");return{protocol:B[1],authority:B[2],path:B[3]||"/",params:B[4]?B[4].split("&"):[]}}function ur(m){var B=m.params.length?"?"+m.params.join("&"):"";return m.protocol+"://"+m.authority+m.path+B}var jr="mapbox.eventData";function Hr(m){if(!m)return null;var B=m.split(".");if(!B||B.length!==3)return null;try{var K=JSON.parse(vt(B[1]));return K}catch{return null}}var br=function(m){this.type=m,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};br.prototype.getStorageKey=function(m){var B=Hr(Pt.ACCESS_TOKEN),K="";return B&&B.u?K=at(B.u):K=Pt.ACCESS_TOKEN||"",m?jr+"."+m+":"+K:jr+":"+K},br.prototype.fetchEventData=function(){var m=rt("localStorage"),B=this.getStorageKey(),K=this.getStorageKey("uuid");if(m)try{var bt=s.localStorage.getItem(B);bt&&(this.eventData=JSON.parse(bt));var Ot=s.localStorage.getItem(K);Ot&&(this.anonId=Ot)}catch{q("Unable to read from LocalStorage")}},br.prototype.saveEventData=function(){var m=rt("localStorage"),B=this.getStorageKey(),K=this.getStorageKey("uuid");if(m)try{s.localStorage.setItem(K,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(B,JSON.stringify(this.eventData))}catch{q("Unable to write to LocalStorage")}},br.prototype.processRequests=function(m){},br.prototype.postEvent=function(m,B,K,bt){var Ot=this;if(Pt.EVENTS_URL){var Zt=cr(Pt.EVENTS_URL);Zt.params.push("access_token="+(bt||Pt.ACCESS_TOKEN||""));var ie={event:this.type,created:new Date(m).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Tt,userId:this.anonId},De=B?E(ie,B):ie,Je={url:ur(Zt),headers:{"Content-Type":"text/plain"},body:JSON.stringify([De])};this.pendingRequest=Mn(Je,function(vr){Ot.pendingRequest=null,K(vr),Ot.saveEventData(),Ot.processRequests(bt)})}},br.prototype.queueRequest=function(m,B){this.queue.push(m),this.processRequests(B)};var Kr=function(m){function B(){m.call(this,"map.load"),this.success={},this.skuToken=""}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.postMapLoadEvent=function(K,bt,Ot,Zt){this.skuToken=Ot,(Pt.EVENTS_URL&&Zt||Pt.ACCESS_TOKEN&&Array.isArray(K)&&K.some(function(ie){return te(ie)||oe(ie)}))&&this.queueRequest({id:bt,timestamp:Date.now()},Zt)},B.prototype.processRequests=function(K){var bt=this;if(!(this.pendingRequest||this.queue.length===0)){var Ot=this.queue.shift(),Zt=Ot.id,ie=Ot.timestamp;Zt&&this.success[Zt]||(this.anonId||this.fetchEventData(),R(this.anonId)||(this.anonId=k()),this.postEvent(ie,{skuToken:this.skuToken},function(De){De||Zt&&(bt.success[Zt]=!0)},K))}},B}(br),rn=function(m){function B(K){m.call(this,"appUserTurnstile"),this._customAccessToken=K}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.postTurnstileEvent=function(K,bt){Pt.EVENTS_URL&&Pt.ACCESS_TOKEN&&Array.isArray(K)&&K.some(function(Ot){return te(Ot)||oe(Ot)})&&this.queueRequest(Date.now(),bt)},B.prototype.processRequests=function(K){var bt=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var Ot=Hr(Pt.ACCESS_TOKEN),Zt=Ot?Ot.u:Pt.ACCESS_TOKEN,ie=Zt!==this.eventData.tokenU;R(this.anonId)||(this.anonId=k(),ie=!0);var De=this.queue.shift();if(this.eventData.lastSuccess){var Je=new Date(this.eventData.lastSuccess),vr=new Date(De),Sr=(De-this.eventData.lastSuccess)/(1440*60*1e3);ie=ie||Sr>=1||Sr<-1||Je.getDate()!==vr.getDate()}else ie=!0;if(!ie)return this.processRequests();this.postEvent(De,{"enabled.telemetry":!1},function(Yr){Yr||(bt.eventData.lastSuccess=De,bt.eventData.tokenU=Zt)},K)}},B}(br),Ce=new rn,$t=Ce.postTurnstileEvent.bind(Ce),ne=new Kr,Ct=ne.postMapLoadEvent.bind(ne),gt="mapbox-tiles",St=500,Nt=50,ee=1e3*60*7,le;function we(){s.caches&&!le&&(le=s.caches.open(gt))}var Ue;function qe(m,B){if(Ue===void 0)try{new Response(new ReadableStream),Ue=!0}catch{Ue=!1}Ue?B(m.body):m.blob().then(B)}function ar(m,B,K){if(we(),!!le){var bt={status:B.status,statusText:B.statusText,headers:new s.Headers};B.headers.forEach(function(ie,De){return bt.headers.set(De,ie)});var Ot=st(B.headers.get("Cache-Control")||"");if(!Ot["no-store"]){Ot["max-age"]&&bt.headers.set("Expires",new Date(K+Ot["max-age"]*1e3).toUTCString());var Zt=new Date(bt.headers.get("Expires")).getTime()-K;Zt<ee||qe(B,function(ie){var De=new s.Response(ie,bt);we(),le&&le.then(function(Je){return Je.put(Ar(m.url),De)}).catch(function(Je){return q(Je.message)})})}}}function Ar(m){var B=m.indexOf("?");return B<0?m:m.slice(0,B)}function Tr(m,B){if(we(),!le)return B(null);var K=Ar(m.url);le.then(function(bt){bt.match(K).then(function(Ot){var Zt=pr(Ot);bt.delete(K),Zt&&bt.put(K,Ot.clone()),B(null,Ot,Zt)}).catch(B)}).catch(B)}function pr(m){if(!m)return!1;var B=new Date(m.headers.get("Expires")||0),K=st(m.headers.get("Cache-Control")||"");return B>Date.now()&&!K["no-cache"]}var Jr=1/0;function Vn(m){Jr++,Jr>Nt&&(m.getActor().send("enforceCacheSizeLimit",St),Jr=0)}function Hn(m){we(),le&&le.then(function(B){B.keys().then(function(K){for(var bt=0;bt<K.length-m;bt++)B.delete(K[bt])})})}function Kn(m){var B=s.caches.delete(gt);m&&B.catch(m).then(function(){return m()})}function Ci(m,B){St=m,Nt=B}var ii;function qn(){return ii==null&&(ii=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&typeof s.createImageBitmap=="function"),ii}var oa={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(oa);var Hi=function(m){function B(K,bt,Ot){bt===401&&oe(Ot)&&(K+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),m.call(this,K),this.status=bt,this.url=Ot,this.name=this.constructor.name,this.message=K}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},B}(Error),We=pt()?function(){return self.worker&&self.worker.referrer}:function(){return(s.location.protocol==="blob:"?s.parent:s).location.href},rr=function(m){return/^file:/.test(m)||/^file:/.test(We())&&!/^\w+:/.test(m)};function fr(m,B){var K=new s.AbortController,bt=new s.Request(m.url,{method:m.method||"GET",body:m.body,credentials:m.credentials,headers:m.headers,referrer:We(),signal:K.signal}),Ot=!1,Zt=!1,ie=Te(bt.url);m.type==="json"&&bt.headers.set("Accept","application/json");var De=function(vr,Sr,Yr){if(!Zt){if(vr&&vr.message!=="SecurityError"&&q(vr),Sr&&Yr)return Je(Sr);var nn=Date.now();s.fetch(bt).then(function(pn){if(pn.ok){var Rn=ie?pn.clone():null;return Je(pn,Rn,nn)}else return B(new Hi(pn.statusText,pn.status,m.url))}).catch(function(pn){pn.code!==20&&B(new Error(pn.message))})}},Je=function(vr,Sr,Yr){(m.type==="arrayBuffer"?vr.arrayBuffer():m.type==="json"?vr.json():vr.text()).then(function(nn){Zt||(Sr&&Yr&&ar(bt,Sr,Yr),Ot=!0,B(null,nn,vr.headers.get("Cache-Control"),vr.headers.get("Expires")))}).catch(function(nn){Zt||B(new Error(nn.message))})};return ie?Tr(bt,De):De(null,null),{cancel:function(){Zt=!0,Ot||K.abort()}}}function xr(m,B){var K=new s.XMLHttpRequest;K.open(m.method||"GET",m.url,!0),m.type==="arrayBuffer"&&(K.responseType="arraybuffer");for(var bt in m.headers)K.setRequestHeader(bt,m.headers[bt]);return m.type==="json"&&(K.responseType="text",K.setRequestHeader("Accept","application/json")),K.withCredentials=m.credentials==="include",K.onerror=function(){B(new Error(K.statusText))},K.onload=function(){if((K.status>=200&&K.status<300||K.status===0)&&K.response!==null){var Ot=K.response;if(m.type==="json")try{Ot=JSON.parse(K.response)}catch(Zt){return B(Zt)}B(null,Ot,K.getResponseHeader("Cache-Control"),K.getResponseHeader("Expires"))}else B(new Hi(K.statusText,K.status,m.url))},K.send(m.body),{cancel:function(){return K.abort()}}}var Qr=function(m,B){if(!rr(m.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return fr(m,B);if(pt()&&self.worker&&self.worker.actor){var K=!0;return self.worker.actor.send("getResource",m,B,void 0,K)}}return xr(m,B)},Cn=function(m,B){return Qr(E(m,{type:"json"}),B)},wn=function(m,B){return Qr(E(m,{type:"arrayBuffer"}),B)},Mn=function(m,B){return Qr(E(m,{method:"POST"}),B)};function ci(m){var B=s.document.createElement("a");return B.href=m,B.protocol===s.document.location.protocol&&B.host===s.document.location.host}var xi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Pi(m,B,K,bt){var Ot=new s.Image,Zt=s.URL;Ot.onload=function(){B(null,Ot),Zt.revokeObjectURL(Ot.src),Ot.onload=null,s.requestAnimationFrame(function(){Ot.src=xi})},Ot.onerror=function(){return B(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 ie=new s.Blob([new Uint8Array(m)],{type:"image/png"});Ot.cacheControl=K,Ot.expires=bt,Ot.src=m.byteLength?Zt.createObjectURL(ie):xi}function Di(m,B){var K=new s.Blob([new Uint8Array(m)],{type:"image/png"});s.createImageBitmap(K).then(function(bt){B(null,bt)}).catch(function(bt){B(new Error("Could not load image because of "+bt.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var Zi,ui,Pa=function(){Zi=[],ui=0};Pa();var Wa=function(m,B){if(Wt.supported&&(m.headers||(m.headers={}),m.headers.accept="image/webp,*/*"),ui>=Pt.MAX_PARALLEL_IMAGE_REQUESTS){var K={requestParameters:m,callback:B,cancelled:!1,cancel:function(){this.cancelled=!0}};return Zi.push(K),K}ui++;var bt=!1,Ot=function(){if(!bt)for(bt=!0,ui--;Zi.length&&ui<Pt.MAX_PARALLEL_IMAGE_REQUESTS;){var ie=Zi.shift(),De=ie.requestParameters,Je=ie.callback,vr=ie.cancelled;vr||(ie.cancel=Wa(De,Je).cancel)}},Zt=wn(m,function(ie,De,Je,vr){Ot(),ie?B(ie):De&&(qn()?Di(De,B):Pi(De,B,Je,vr))});return{cancel:function(){Zt.cancel(),Ot()}}},ze=function(m,B){var K=s.document.createElement("video");K.muted=!0,K.onloadstart=function(){B(null,K)};for(var bt=0;bt<m.length;bt++){var Ot=s.document.createElement("source");ci(m[bt])||(K.crossOrigin="Anonymous"),Ot.src=m[bt],K.appendChild(Ot)}return{cancel:function(){}}};function Pe(m,B,K){var bt=K[m]&&K[m].indexOf(B)!==-1;bt||(K[m]=K[m]||[],K[m].push(B))}function Rr(m,B,K){if(K&&K[m]){var bt=K[m].indexOf(B);bt!==-1&&K[m].splice(bt,1)}}var qr=function(m,B){B===void 0&&(B={}),E(this,B),this.type=m},$r=function(m){function B(K,bt){bt===void 0&&(bt={}),m.call(this,"error",E({error:K},bt))}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B}(qr),Br=function(){};Br.prototype.on=function(m,B){return this._listeners=this._listeners||{},Pe(m,B,this._listeners),this},Br.prototype.off=function(m,B){return Rr(m,B,this._listeners),Rr(m,B,this._oneTimeListeners),this},Br.prototype.once=function(m,B){return this._oneTimeListeners=this._oneTimeListeners||{},Pe(m,B,this._oneTimeListeners),this},Br.prototype.fire=function(m,B){typeof m=="string"&&(m=new qr(m,B||{}));var K=m.type;if(this.listens(K)){m.target=this;for(var bt=this._listeners&&this._listeners[K]?this._listeners[K].slice():[],Ot=0,Zt=bt;Ot<Zt.length;Ot+=1){var ie=Zt[Ot];ie.call(this,m)}for(var De=this._oneTimeListeners&&this._oneTimeListeners[K]?this._oneTimeListeners[K].slice():[],Je=0,vr=De;Je<vr.length;Je+=1){var Sr=vr[Je];Rr(K,Sr,this._oneTimeListeners),Sr.call(this,m)}var Yr=this._eventedParent;Yr&&(E(m,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Yr.fire(m))}else m instanceof $r&&console.error(m.error);return this},Br.prototype.listens=function(m){return this._listeners&&this._listeners[m]&&this._listeners[m].length>0||this._oneTimeListeners&&this._oneTimeListeners[m]&&this._oneTimeListeners[m].length>0||this._eventedParent&&this._eventedParent.listens(m)},Br.prototype.setEventedParent=function(m,B){return this._eventedParent=m,this._eventedParentData=B,this};var Gr=8,dn={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"}},an={"*":{type:"source"}},Ee=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],dr={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:"*"}},Vr={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:"*"}},yn={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:"*"}},Fn={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"}},Xn={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"}}},Pn={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"}}},En={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"}},Zn=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Ca={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ri={"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"}},Ja={"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"}},Xa={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Io={"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"}},po={"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"}},Do={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ia={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},gs={type:"array",value:"*"},is={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},ll={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Ho={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Gs={type:"array",value:"*",minimum:1},as={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}},ul=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Js={"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"}},Rl={"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"}},ls={"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"}},Cs={"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"}},Co={"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"}},ks={"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"}},kl={"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"}},Vl={"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"}},Yl={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Ns={"*":{type:"string"}},La={$version:Gr,$root:dn,sources:an,source:Ee,source_vector:dr,source_raster:Vr,source_raster_dem:yn,source_geojson:Fn,source_video:Xn,source_image:Pn,layer:En,layout:Zn,layout_background:Ca,layout_fill:Ri,layout_circle:Ja,layout_heatmap:Xa,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Io,layout_symbol:po,layout_raster:Do,layout_hillshade:Ia,filter:gs,filter_operator:is,geometry_type:ll,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:Ho,expression:Gs,light:as,paint:ul,paint_fill:Js,"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:Rl,paint_circle:ls,paint_heatmap:Cs,paint_symbol:Co,paint_raster:ks,paint_hillshade:kl,paint_background:Vl,transition:Yl,"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:Ns},uo=function(m,B,K,bt){this.message=(m?m+": ":"")+K,bt&&(this.identifier=bt),B!=null&&B.__line__&&(this.line=B.__line__)};function Hs(m){var B=m.key,K=m.value;return K?[new uo(B,K,"constants have been deprecated as of v8")]:[]}function Kl(m){for(var B=[],K=arguments.length-1;K-- >0;)B[K]=arguments[K+1];for(var bt=0,Ot=B;bt<Ot.length;bt+=1){var Zt=Ot[bt];for(var ie in Zt)m[ie]=Zt[ie]}return m}function Go(m){return m instanceof Number||m instanceof String||m instanceof Boolean?m.valueOf():m}function ql(m){if(Array.isArray(m))return m.map(ql);if(m instanceof Object&&!(m instanceof Number||m instanceof String||m instanceof Boolean)){var B={};for(var K in m)B[K]=ql(m[K]);return B}return Go(m)}var il=function(m){function B(K,bt){m.call(this,bt),this.message=bt,this.key=K}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B}(Error),Cl=function(m,B){B===void 0&&(B=[]),this.parent=m,this.bindings={};for(var K=0,bt=B;K<bt.length;K+=1){var Ot=bt[K],Zt=Ot[0],ie=Ot[1];this.bindings[Zt]=ie}};Cl.prototype.concat=function(m){return new Cl(this,m)},Cl.prototype.get=function(m){if(this.bindings[m])return this.bindings[m];if(this.parent)return this.parent.get(m);throw new Error(m+" not found in scope.")},Cl.prototype.has=function(m){return this.bindings[m]?!0:this.parent?this.parent.has(m):!1};var Fu={kind:"null"},ao={kind:"number"},Ts={kind:"string"},Ls={kind:"boolean"},nu={kind:"color"},cl={kind:"object"},Qo={kind:"value"},Mu={kind:"error"},Gu={kind:"collator"},_l={kind:"formatted"},Ol={kind:"resolvedImage"};function Xl(m,B){return{kind:"array",itemType:m,N:B}}function tu(m){if(m.kind==="array"){var B=tu(m.itemType);return typeof m.N=="number"?"array<"+B+", "+m.N+">":m.itemType.kind==="value"?"array":"array<"+B+">"}else return m.kind}var ac=[Fu,ao,Ts,Ls,nu,_l,cl,Xl(Qo),Ol];function ph(m,B){if(B.kind==="error")return null;if(m.kind==="array"){if(B.kind==="array"&&(B.N===0&&B.itemType.kind==="value"||!ph(m.itemType,B.itemType))&&(typeof m.N!="number"||m.N===B.N))return null}else{if(m.kind===B.kind)return null;if(m.kind==="value")for(var K=0,bt=ac;K<bt.length;K+=1){var Ot=bt[K];if(!ph(Ot,B))return null}}return"Expected "+tu(m)+" but found "+tu(B)+" instead."}function Jc(m,B){return B.some(function(K){return K.kind===m.kind})}function ah(m,B){return B.some(function(K){return K==="null"?m===null:K==="array"?Array.isArray(m):K==="object"?m&&!Array.isArray(m)&&typeof m=="object":K===typeof m})}var Nf=e(function(m,B){var K={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 bt(vr){return vr=Math.round(vr),vr<0?0:vr>255?255:vr}function Ot(vr){return vr<0?0:vr>1?1:vr}function Zt(vr){return vr[vr.length-1]==="%"?bt(parseFloat(vr)/100*255):bt(parseInt(vr))}function ie(vr){return vr[vr.length-1]==="%"?Ot(parseFloat(vr)/100):Ot(parseFloat(vr))}function De(vr,Sr,Yr){return Yr<0?Yr+=1:Yr>1&&(Yr-=1),Yr*6<1?vr+(Sr-vr)*Yr*6:Yr*2<1?Sr:Yr*3<2?vr+(Sr-vr)*(2/3-Yr)*6:vr}function Je(vr){var Sr=vr.replace(/ /g,"").toLowerCase();if(Sr in K)return K[Sr].slice();if(Sr[0]==="#"){if(Sr.length===4){var Yr=parseInt(Sr.substr(1),16);return Yr>=0&&Yr<=4095?[(Yr&3840)>>4|(Yr&3840)>>8,Yr&240|(Yr&240)>>4,Yr&15|(Yr&15)<<4,1]:null}else if(Sr.length===7){var Yr=parseInt(Sr.substr(1),16);return Yr>=0&&Yr<=16777215?[(Yr&16711680)>>16,(Yr&65280)>>8,Yr&255,1]:null}return null}var nn=Sr.indexOf("("),pn=Sr.indexOf(")");if(nn!==-1&&pn+1===Sr.length){var Rn=Sr.substr(0,nn),pi=Sr.substr(nn+1,pn-(nn+1)).split(","),la=1;switch(Rn){case"rgba":if(pi.length!==4)return null;la=ie(pi.pop());case"rgb":return pi.length!==3?null:[Zt(pi[0]),Zt(pi[1]),Zt(pi[2]),la];case"hsla":if(pi.length!==4)return null;la=ie(pi.pop());case"hsl":if(pi.length!==3)return null;var na=(parseFloat(pi[0])%360+360)%360/360,ba=ie(pi[1]),Fa=ie(pi[2]),ya=Fa<=.5?Fa*(ba+1):Fa+ba-Fa*ba,Ka=Fa*2-ya;return[bt(De(Ka,ya,na+1/3)*255),bt(De(Ka,ya,na)*255),bt(De(Ka,ya,na-1/3)*255),la];default:return null}}return null}try{B.parseCSSColor=Je}catch{}}),Sf=Nf.parseCSSColor,Dl=function(m,B,K,bt){bt===void 0&&(bt=1),this.r=m,this.g=B,this.b=K,this.a=bt};Dl.parse=function(m){if(m){if(m instanceof Dl)return m;if(typeof m=="string"){var B=Sf(m);if(B)return new Dl(B[0]/255*B[3],B[1]/255*B[3],B[2]/255*B[3],B[3])}}},Dl.prototype.toString=function(){var m=this.toArray(),B=m[0],K=m[1],bt=m[2],Ot=m[3];return"rgba("+Math.round(B)+","+Math.round(K)+","+Math.round(bt)+","+Ot+")"},Dl.prototype.toArray=function(){var m=this,B=m.r,K=m.g,bt=m.b,Ot=m.a;return Ot===0?[0,0,0,0]:[B*255/Ot,K*255/Ot,bt*255/Ot,Ot]},Dl.black=new Dl(0,0,0,1),Dl.white=new Dl(1,1,1,1),Dl.transparent=new Dl(0,0,0,0),Dl.red=new Dl(1,0,0,1);var Bc=function(m,B,K){m?this.sensitivity=B?"variant":"case":this.sensitivity=B?"accent":"base",this.locale=K,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Bc.prototype.compare=function(m,B){return this.collator.compare(m,B)},Bc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var jf=function(m,B,K,bt,Ot){this.text=m,this.image=B,this.scale=K,this.fontStack=bt,this.textColor=Ot},hc=function(m){this.sections=m};hc.fromString=function(m){return new hc([new jf(m,null,null,null,null)])},hc.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(m){return m.text.length!==0||m.image&&m.image.name.length!==0})},hc.factory=function(m){return m instanceof hc?m:hc.fromString(m)},hc.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(m){return m.text}).join("")},hc.prototype.serialize=function(){for(var m=["format"],B=0,K=this.sections;B<K.length;B+=1){var bt=K[B];if(bt.image){m.push(["image",bt.image.name]);continue}m.push(bt.text);var Ot={};bt.fontStack&&(Ot["text-font"]=["literal",bt.fontStack.split(",")]),bt.scale&&(Ot["font-scale"]=bt.scale),bt.textColor&&(Ot["text-color"]=["rgba"].concat(bt.textColor.toArray())),m.push(Ot)}return m};var oc=function(m){this.name=m.name,this.available=m.available};oc.prototype.toString=function(){return this.name},oc.fromString=function(m){return m?new oc({name:m,available:!1}):null},oc.prototype.serialize=function(){return["image",this.name]};function fc(m,B,K,bt){if(!(typeof m=="number"&&m>=0&&m<=255&&typeof B=="number"&&B>=0&&B<=255&&typeof K=="number"&&K>=0&&K<=255)){var Ot=typeof bt=="number"?[m,B,K,bt]:[m,B,K];return"Invalid rgba value ["+Ot.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof bt>"u"||typeof bt=="number"&&bt>=0&&bt<=1?null:"Invalid rgba value ["+[m,B,K,bt].join(", ")+"]: 'a' must be between 0 and 1."}function oh(m){if(m===null||typeof m=="string"||typeof m=="boolean"||typeof m=="number"||m instanceof Dl||m instanceof Bc||m instanceof hc||m instanceof oc)return!0;if(Array.isArray(m)){for(var B=0,K=m;B<K.length;B+=1){var bt=K[B];if(!oh(bt))return!1}return!0}else if(typeof m=="object"){for(var Ot in m)if(!oh(m[Ot]))return!1;return!0}else return!1}function su(m){if(m===null)return Fu;if(typeof m=="string")return Ts;if(typeof m=="boolean")return Ls;if(typeof m=="number")return ao;if(m instanceof Dl)return nu;if(m instanceof Bc)return Gu;if(m instanceof hc)return _l;if(m instanceof oc)return Ol;if(Array.isArray(m)){for(var B=m.length,K,bt=0,Ot=m;bt<Ot.length;bt+=1){var Zt=Ot[bt],ie=su(Zt);if(!K)K=ie;else{if(K===ie)continue;K=Qo;break}}return Xl(K||Qo,B)}else return cl}function sc(m){var B=typeof m;return m===null?"":B==="string"||B==="number"||B==="boolean"?String(m):m instanceof Dl||m instanceof hc||m instanceof oc?m.toString():JSON.stringify(m)}var el=function(m,B){this.type=m,this.value=B};el.parse=function(m,B){if(m.length!==2)return B.error("'literal' expression requires exactly one argument, but found "+(m.length-1)+" instead.");if(!oh(m[1]))return B.error("invalid value");var K=m[1],bt=su(K),Ot=B.expectedType;return bt.kind==="array"&&bt.N===0&&Ot&&Ot.kind==="array"&&(typeof Ot.N!="number"||Ot.N===0)&&(bt=Ot),new el(bt,K)},el.prototype.evaluate=function(){return this.value},el.prototype.eachChild=function(){},el.prototype.outputDefined=function(){return!0},el.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Dl?["rgba"].concat(this.value.toArray()):this.value instanceof hc?this.value.serialize():this.value};var Zl=function(m){this.name="ExpressionEvaluationError",this.message=m};Zl.prototype.toJSON=function(){return this.message};var Mh={string:Ts,number:ao,boolean:Ls,object:cl},Lc=function(m,B){this.type=m,this.args=B};Lc.parse=function(m,B){if(m.length<2)return B.error("Expected at least one argument.");var K=1,bt,Ot=m[0];if(Ot==="array"){var Zt;if(m.length>2){var ie=m[1];if(typeof ie!="string"||!(ie in Mh)||ie==="object")return B.error('The item type argument of "array" must be one of string, number, boolean',1);Zt=Mh[ie],K++}else Zt=Qo;var De;if(m.length>3){if(m[2]!==null&&(typeof m[2]!="number"||m[2]<0||m[2]!==Math.floor(m[2])))return B.error('The length argument to "array" must be a positive integer literal',2);De=m[2],K++}bt=Xl(Zt,De)}else bt=Mh[Ot];for(var Je=[];K<m.length;K++){var vr=B.parse(m[K],K,Qo);if(!vr)return null;Je.push(vr)}return new Lc(bt,Je)},Lc.prototype.evaluate=function(m){for(var B=0;B<this.args.length;B++){var K=this.args[B].evaluate(m),bt=ph(this.type,su(K));if(bt){if(B===this.args.length-1)throw new Zl("Expected value to be of type "+tu(this.type)+", but found "+tu(su(K))+" instead.")}else return K}return null},Lc.prototype.eachChild=function(m){this.args.forEach(m)},Lc.prototype.outputDefined=function(){return this.args.every(function(m){return m.outputDefined()})},Lc.prototype.serialize=function(){var m=this.type,B=[m.kind];if(m.kind==="array"){var K=m.itemType;if(K.kind==="string"||K.kind==="number"||K.kind==="boolean"){B.push(K.kind);var bt=m.N;(typeof bt=="number"||this.args.length>1)&&B.push(bt)}}return B.concat(this.args.map(function(Ot){return Ot.serialize()}))};var jh=function(m){this.type=_l,this.sections=m};jh.parse=function(m,B){if(m.length<2)return B.error("Expected at least one argument.");var K=m[1];if(!Array.isArray(K)&&typeof K=="object")return B.error("First argument must be an image or text section.");for(var bt=[],Ot=!1,Zt=1;Zt<=m.length-1;++Zt){var ie=m[Zt];if(Ot&&typeof ie=="object"&&!Array.isArray(ie)){Ot=!1;var De=null;if(ie["font-scale"]&&(De=B.parse(ie["font-scale"],1,ao),!De))return null;var Je=null;if(ie["text-font"]&&(Je=B.parse(ie["text-font"],1,Xl(Ts)),!Je))return null;var vr=null;if(ie["text-color"]&&(vr=B.parse(ie["text-color"],1,nu),!vr))return null;var Sr=bt[bt.length-1];Sr.scale=De,Sr.font=Je,Sr.textColor=vr}else{var Yr=B.parse(m[Zt],1,Qo);if(!Yr)return null;var nn=Yr.type.kind;if(nn!=="string"&&nn!=="value"&&nn!=="null"&&nn!=="resolvedImage")return B.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Ot=!0,bt.push({content:Yr,scale:null,font:null,textColor:null})}}return new jh(bt)},jh.prototype.evaluate=function(m){var B=function(K){var bt=K.content.evaluate(m);return su(bt)===Ol?new jf("",bt,null,null,null):new jf(sc(bt),null,K.scale?K.scale.evaluate(m):null,K.font?K.font.evaluate(m).join(","):null,K.textColor?K.textColor.evaluate(m):null)};return new hc(this.sections.map(B))},jh.prototype.eachChild=function(m){for(var B=0,K=this.sections;B<K.length;B+=1){var bt=K[B];m(bt.content),bt.scale&&m(bt.scale),bt.font&&m(bt.font),bt.textColor&&m(bt.textColor)}},jh.prototype.outputDefined=function(){return!1},jh.prototype.serialize=function(){for(var m=["format"],B=0,K=this.sections;B<K.length;B+=1){var bt=K[B];m.push(bt.content.serialize());var Ot={};bt.scale&&(Ot["font-scale"]=bt.scale.serialize()),bt.font&&(Ot["text-font"]=bt.font.serialize()),bt.textColor&&(Ot["text-color"]=bt.textColor.serialize()),m.push(Ot)}return m};var xu=function(m){this.type=Ol,this.input=m};xu.parse=function(m,B){if(m.length!==2)return B.error("Expected two arguments.");var K=B.parse(m[1],1,Ts);return K?new xu(K):B.error("No image name provided.")},xu.prototype.evaluate=function(m){var B=this.input.evaluate(m),K=oc.fromString(B);return K&&m.availableImages&&(K.available=m.availableImages.indexOf(B)>-1),K},xu.prototype.eachChild=function(m){m(this.input)},xu.prototype.outputDefined=function(){return!1},xu.prototype.serialize=function(){return["image",this.input.serialize()]};var Cd={"to-boolean":Ls,"to-color":nu,"to-number":ao,"to-string":Ts},Qs=function(m,B){this.type=m,this.args=B};Qs.parse=function(m,B){if(m.length<2)return B.error("Expected at least one argument.");var K=m[0];if((K==="to-boolean"||K==="to-string")&&m.length!==2)return B.error("Expected one argument.");for(var bt=Cd[K],Ot=[],Zt=1;Zt<m.length;Zt++){var ie=B.parse(m[Zt],Zt,Qo);if(!ie)return null;Ot.push(ie)}return new Qs(bt,Ot)},Qs.prototype.evaluate=function(m){if(this.type.kind==="boolean")return!!this.args[0].evaluate(m);if(this.type.kind==="color"){for(var B,K,bt=0,Ot=this.args;bt<Ot.length;bt+=1){var Zt=Ot[bt];if(B=Zt.evaluate(m),K=null,B instanceof Dl)return B;if(typeof B=="string"){var ie=m.parseColor(B);if(ie)return ie}else if(Array.isArray(B)&&(B.length<3||B.length>4?K="Invalid rbga value "+JSON.stringify(B)+": expected an array containing either three or four numeric values.":K=fc(B[0],B[1],B[2],B[3]),!K))return new Dl(B[0]/255,B[1]/255,B[2]/255,B[3])}throw new Zl(K||"Could not parse color from value '"+(typeof B=="string"?B:String(JSON.stringify(B)))+"'")}else if(this.type.kind==="number"){for(var De=null,Je=0,vr=this.args;Je<vr.length;Je+=1){var Sr=vr[Je];if(De=Sr.evaluate(m),De===null)return 0;var Yr=Number(De);if(!isNaN(Yr))return Yr}throw new Zl("Could not convert "+JSON.stringify(De)+" to number.")}else return this.type.kind==="formatted"?hc.fromString(sc(this.args[0].evaluate(m))):this.type.kind==="resolvedImage"?oc.fromString(sc(this.args[0].evaluate(m))):sc(this.args[0].evaluate(m))},Qs.prototype.eachChild=function(m){this.args.forEach(m)},Qs.prototype.outputDefined=function(){return this.args.every(function(m){return m.outputDefined()})},Qs.prototype.serialize=function(){if(this.type.kind==="formatted")return new jh([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new xu(this.args[0]).serialize();var m=["to-"+this.type.kind];return this.eachChild(function(B){m.push(B.serialize())}),m};var Wd=["Unknown","Point","LineString","Polygon"],Ll=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Ll.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Ll.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Wd[this.feature.type]:this.feature.type:null},Ll.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Ll.prototype.canonicalID=function(){return this.canonical},Ll.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Ll.prototype.parseColor=function(m){var B=this._parseColorCache[m];return B||(B=this._parseColorCache[m]=Dl.parse(m)),B};var Jo=function(m,B,K,bt){this.name=m,this.type=B,this._evaluate=K,this.args=bt};Jo.prototype.evaluate=function(m){return this._evaluate(m,this.args)},Jo.prototype.eachChild=function(m){this.args.forEach(m)},Jo.prototype.outputDefined=function(){return!1},Jo.prototype.serialize=function(){return[this.name].concat(this.args.map(function(m){return m.serialize()}))},Jo.parse=function(m,B){var K,bt=m[0],Ot=Jo.definitions[bt];if(!Ot)return B.error('Unknown expression "'+bt+'". If you wanted a literal array, use ["literal", [...]].',0);for(var Zt=Array.isArray(Ot)?Ot[0]:Ot.type,ie=Array.isArray(Ot)?[[Ot[1],Ot[2]]]:Ot.overloads,De=ie.filter(function($s){var sl=$s[0];return!Array.isArray(sl)||sl.length===m.length-1}),Je=null,vr=0,Sr=De;vr<Sr.length;vr+=1){var Yr=Sr[vr],nn=Yr[0],pn=Yr[1];Je=new lu(B.registry,B.path,null,B.scope);for(var Rn=[],pi=!1,la=1;la<m.length;la++){var na=m[la],ba=Array.isArray(nn)?nn[la-1]:nn.type,Fa=Je.parse(na,1+Rn.length,ba);if(!Fa){pi=!0;break}Rn.push(Fa)}if(!pi){if(Array.isArray(nn)&&nn.length!==Rn.length){Je.error("Expected "+nn.length+" arguments, but found "+Rn.length+" instead.");continue}for(var ya=0;ya<Rn.length;ya++){var Ka=Array.isArray(nn)?nn[ya]:nn.type,bo=Rn[ya];Je.concat(ya+1).checkSubtype(Ka,bo.type)}if(Je.errors.length===0)return new Jo(bt,Zt,pn,Rn)}}if(De.length===1)(K=B.errors).push.apply(K,Je.errors);else{for(var No=De.length?De:ie,jo=No.map(function($s){var sl=$s[0];return lf(sl)}).join(" | "),xs=[],_s=1;_s<m.length;_s++){var Fs=B.parse(m[_s],1+xs.length);if(!Fs)return null;xs.push(tu(Fs.type))}B.error("Expected arguments of type "+jo+", but found ("+xs.join(", ")+") instead.")}return null},Jo.register=function(m,B){Jo.definitions=B;for(var K in B)m[K]=Jo};function lf(m){return Array.isArray(m)?"("+m.map(tu).join(", ")+")":"("+tu(m.type)+"...)"}var sh=function(m,B,K){this.type=Gu,this.locale=K,this.caseSensitive=m,this.diacriticSensitive=B};sh.parse=function(m,B){if(m.length!==2)return B.error("Expected one argument.");var K=m[1];if(typeof K!="object"||Array.isArray(K))return B.error("Collator options argument must be an object.");var bt=B.parse(K["case-sensitive"]===void 0?!1:K["case-sensitive"],1,Ls);if(!bt)return null;var Ot=B.parse(K["diacritic-sensitive"]===void 0?!1:K["diacritic-sensitive"],1,Ls);if(!Ot)return null;var Zt=null;return K.locale&&(Zt=B.parse(K.locale,1,Ts),!Zt)?null:new sh(bt,Ot,Zt)},sh.prototype.evaluate=function(m){return new Bc(this.caseSensitive.evaluate(m),this.diacriticSensitive.evaluate(m),this.locale?this.locale.evaluate(m):null)},sh.prototype.eachChild=function(m){m(this.caseSensitive),m(this.diacriticSensitive),this.locale&&m(this.locale)},sh.prototype.outputDefined=function(){return!1},sh.prototype.serialize=function(){var m={};return m["case-sensitive"]=this.caseSensitive.serialize(),m["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(m.locale=this.locale.serialize()),["collator",m]};var ec=8192;function Uf(m,B){m[0]=Math.min(m[0],B[0]),m[1]=Math.min(m[1],B[1]),m[2]=Math.max(m[2],B[0]),m[3]=Math.max(m[3],B[1])}function Uh(m){return(180+m)/360}function yf(m){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+m*Math.PI/360)))/360}function lc(m,B){return!(m[0]<=B[0]||m[2]>=B[2]||m[1]<=B[1]||m[3]>=B[3])}function hd(m,B){var K=Uh(m[0]),bt=yf(m[1]),Ot=Math.pow(2,B.z);return[Math.round(K*Ot*ec),Math.round(bt*Ot*ec)]}function $f(m,B,K){var bt=m[0]-B[0],Ot=m[1]-B[1],Zt=m[0]-K[0],ie=m[1]-K[1];return bt*ie-Zt*Ot===0&&bt*Zt<=0&&Ot*ie<=0}function xf(m,B,K){return B[1]>m[1]!=K[1]>m[1]&&m[0]<(K[0]-B[0])*(m[1]-B[1])/(K[1]-B[1])+B[0]}function Vh(m,B){for(var K=!1,bt=0,Ot=B.length;bt<Ot;bt++)for(var Zt=B[bt],ie=0,De=Zt.length;ie<De-1;ie++){if($f(m,Zt[ie],Zt[ie+1]))return!1;xf(m,Zt[ie],Zt[ie+1])&&(K=!K)}return K}function Vf(m,B){for(var K=0;K<B.length;K++)if(Vh(m,B[K]))return!0;return!1}function Hf(m,B){return m[0]*B[1]-m[1]*B[0]}function lh(m,B,K,bt){var Ot=m[0]-K[0],Zt=m[1]-K[1],ie=B[0]-K[0],De=B[1]-K[1],Je=bt[0]-K[0],vr=bt[1]-K[1],Sr=Ot*vr-Je*Zt,Yr=ie*vr-Je*De;return Sr>0&&Yr<0||Sr<0&&Yr>0}function Gf(m,B,K,bt){var Ot=[B[0]-m[0],B[1]-m[1]],Zt=[bt[0]-K[0],bt[1]-K[1]];return Hf(Zt,Ot)===0?!1:!!(lh(m,B,K,bt)&&lh(K,bt,m,B))}function Sh(m,B,K){for(var bt=0,Ot=K;bt<Ot.length;bt+=1)for(var Zt=Ot[bt],ie=0;ie<Zt.length-1;++ie)if(Gf(m,B,Zt[ie],Zt[ie+1]))return!0;return!1}function mh(m,B){for(var K=0;K<m.length;++K)if(!Vh(m[K],B))return!1;for(var bt=0;bt<m.length-1;++bt)if(Sh(m[bt],m[bt+1],B))return!1;return!0}function uc(m,B){for(var K=0;K<B.length;K++)if(mh(m,B[K]))return!0;return!1}function ef(m,B,K){for(var bt=[],Ot=0;Ot<m.length;Ot++){for(var Zt=[],ie=0;ie<m[Ot].length;ie++){var De=hd(m[Ot][ie],K);Uf(B,De),Zt.push(De)}bt.push(Zt)}return bt}function Wf(m,B,K){for(var bt=[],Ot=0;Ot<m.length;Ot++){var Zt=ef(m[Ot],B,K);bt.push(Zt)}return bt}function Jl(m,B,K,bt){if(m[0]<K[0]||m[0]>K[2]){var Ot=bt*.5,Zt=m[0]-K[0]>Ot?-bt:K[0]-m[0]>Ot?bt:0;Zt===0&&(Zt=m[0]-K[2]>Ot?-bt:K[2]-m[0]>Ot?bt:0),m[0]+=Zt}Uf(B,m)}function Ef(m){m[0]=m[1]=1/0,m[2]=m[3]=-1/0}function Ld(m,B,K,bt){for(var Ot=Math.pow(2,bt.z)*ec,Zt=[bt.x*ec,bt.y*ec],ie=[],De=0,Je=m;De<Je.length;De+=1)for(var vr=Je[De],Sr=0,Yr=vr;Sr<Yr.length;Sr+=1){var nn=Yr[Sr],pn=[nn.x+Zt[0],nn.y+Zt[1]];Jl(pn,B,K,Ot),ie.push(pn)}return ie}function Yf(m,B,K,bt){for(var Ot=Math.pow(2,bt.z)*ec,Zt=[bt.x*ec,bt.y*ec],ie=[],De=0,Je=m;De<Je.length;De+=1){for(var vr=Je[De],Sr=[],Yr=0,nn=vr;Yr<nn.length;Yr+=1){var pn=nn[Yr],Rn=[pn.x+Zt[0],pn.y+Zt[1]];Uf(B,Rn),Sr.push(Rn)}ie.push(Sr)}if(B[2]-B[0]<=Ot/2){Ef(B);for(var pi=0,la=ie;pi<la.length;pi+=1)for(var na=la[pi],ba=0,Fa=na;ba<Fa.length;ba+=1){var ya=Fa[ba];Jl(ya,B,K,Ot)}}return ie}function _f(m,B){var K=[1/0,1/0,-1/0,-1/0],bt=[1/0,1/0,-1/0,-1/0],Ot=m.canonicalID();if(B.type==="Polygon"){var Zt=ef(B.coordinates,bt,Ot),ie=Ld(m.geometry(),K,bt,Ot);if(!lc(K,bt))return!1;for(var De=0,Je=ie;De<Je.length;De+=1){var vr=Je[De];if(!Vh(vr,Zt))return!1}}if(B.type==="MultiPolygon"){var Sr=Wf(B.coordinates,bt,Ot),Yr=Ld(m.geometry(),K,bt,Ot);if(!lc(K,bt))return!1;for(var nn=0,pn=Yr;nn<pn.length;nn+=1){var Rn=pn[nn];if(!Vf(Rn,Sr))return!1}}return!0}function Kf(m,B){var K=[1/0,1/0,-1/0,-1/0],bt=[1/0,1/0,-1/0,-1/0],Ot=m.canonicalID();if(B.type==="Polygon"){var Zt=ef(B.coordinates,bt,Ot),ie=Yf(m.geometry(),K,bt,Ot);if(!lc(K,bt))return!1;for(var De=0,Je=ie;De<Je.length;De+=1){var vr=Je[De];if(!mh(vr,Zt))return!1}}if(B.type==="MultiPolygon"){var Sr=Wf(B.coordinates,bt,Ot),Yr=Yf(m.geometry(),K,bt,Ot);if(!lc(K,bt))return!1;for(var nn=0,pn=Yr;nn<pn.length;nn+=1){var Rn=pn[nn];if(!uc(Rn,Sr))return!1}}return!0}var Nc=function(m,B){this.type=Ls,this.geojson=m,this.geometries=B};Nc.parse=function(m,B){if(m.length!==2)return B.error("'within' expression requires exactly one argument, but found "+(m.length-1)+" instead.");if(oh(m[1])){var K=m[1];if(K.type==="FeatureCollection")for(var bt=0;bt<K.features.length;++bt){var Ot=K.features[bt].geometry.type;if(Ot==="Polygon"||Ot==="MultiPolygon")return new Nc(K,K.features[bt].geometry)}else if(K.type==="Feature"){var Zt=K.geometry.type;if(Zt==="Polygon"||Zt==="MultiPolygon")return new Nc(K,K.geometry)}else if(K.type==="Polygon"||K.type==="MultiPolygon")return new Nc(K,K)}return B.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Nc.prototype.evaluate=function(m){if(m.geometry()!=null&&m.canonicalID()!=null){if(m.geometryType()==="Point")return _f(m,this.geometries);if(m.geometryType()==="LineString")return Kf(m,this.geometries)}return!1},Nc.prototype.eachChild=function(){},Nc.prototype.outputDefined=function(){return!0},Nc.prototype.serialize=function(){return["within",this.geojson]};function Xf(m){if(m instanceof Jo&&(m.name==="get"&&m.args.length===1||m.name==="feature-state"||m.name==="has"&&m.args.length===1||m.name==="properties"||m.name==="geometry-type"||m.name==="id"||/^filter-/.test(m.name))||m instanceof Nc)return!1;var B=!0;return m.eachChild(function(K){B&&!Xf(K)&&(B=!1)}),B}function zu(m){if(m instanceof Jo&&m.name==="feature-state")return!1;var B=!0;return m.eachChild(function(K){B&&!zu(K)&&(B=!1)}),B}function jc(m,B){if(m instanceof Jo&&B.indexOf(m.name)>=0)return!1;var K=!0;return m.eachChild(function(bt){K&&!jc(bt,B)&&(K=!1)}),K}var Hh=function(m,B){this.type=B.type,this.name=m,this.boundExpression=B};Hh.parse=function(m,B){if(m.length!==2||typeof m[1]!="string")return B.error("'var' expression requires exactly one string literal argument.");var K=m[1];return B.scope.has(K)?new Hh(K,B.scope.get(K)):B.error('Unknown variable "'+K+'". Make sure "'+K+'" has been bound in an enclosing "let" expression before using it.',1)},Hh.prototype.evaluate=function(m){return this.boundExpression.evaluate(m)},Hh.prototype.eachChild=function(){},Hh.prototype.outputDefined=function(){return!1},Hh.prototype.serialize=function(){return["var",this.name]};var lu=function(m,B,K,bt,Ot){B===void 0&&(B=[]),bt===void 0&&(bt=new Cl),Ot===void 0&&(Ot=[]),this.registry=m,this.path=B,this.key=B.map(function(Zt){return"["+Zt+"]"}).join(""),this.scope=bt,this.errors=Ot,this.expectedType=K};lu.prototype.parse=function(m,B,K,bt,Ot){return Ot===void 0&&(Ot={}),B?this.concat(B,K,bt)._parse(m,Ot):this._parse(m,Ot)},lu.prototype._parse=function(m,B){(m===null||typeof m=="string"||typeof m=="boolean"||typeof m=="number")&&(m=["literal",m]);function K(vr,Sr,Yr){return Yr==="assert"?new Lc(Sr,[vr]):Yr==="coerce"?new Qs(Sr,[vr]):vr}if(Array.isArray(m)){if(m.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var bt=m[0];if(typeof bt!="string")return this.error("Expression name must be a string, but found "+typeof bt+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var Ot=this.registry[bt];if(Ot){var Zt=Ot.parse(m,this);if(!Zt)return null;if(this.expectedType){var ie=this.expectedType,De=Zt.type;if((ie.kind==="string"||ie.kind==="number"||ie.kind==="boolean"||ie.kind==="object"||ie.kind==="array")&&De.kind==="value")Zt=K(Zt,ie,B.typeAnnotation||"assert");else if((ie.kind==="color"||ie.kind==="formatted"||ie.kind==="resolvedImage")&&(De.kind==="value"||De.kind==="string"))Zt=K(Zt,ie,B.typeAnnotation||"coerce");else if(this.checkSubtype(ie,De))return null}if(!(Zt instanceof el)&&Zt.type.kind!=="resolvedImage"&&Eh(Zt)){var Je=new Ll;try{Zt=new el(Zt.type,Zt.evaluate(Je))}catch(vr){return this.error(vr.message),null}}return Zt}return this.error('Unknown expression "'+bt+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof m>"u"?this.error("'undefined' value invalid. Use null instead."):typeof m=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof m+" instead.")},lu.prototype.concat=function(m,B,K){var bt=typeof m=="number"?this.path.concat(m):this.path,Ot=K?this.scope.concat(K):this.scope;return new lu(this.registry,bt,B||null,Ot,this.errors)},lu.prototype.error=function(m){for(var B=[],K=arguments.length-1;K-- >0;)B[K]=arguments[K+1];var bt=""+this.key+B.map(function(Ot){return"["+Ot+"]"}).join("");this.errors.push(new il(bt,m))},lu.prototype.checkSubtype=function(m,B){var K=ph(m,B);return K&&this.error(K),K};function Eh(m){if(m instanceof Hh)return Eh(m.boundExpression);if(m instanceof Jo&&m.name==="error"||m instanceof sh||m instanceof Nc)return!1;var B=m instanceof Qs||m instanceof Lc,K=!0;return m.eachChild(function(bt){B?K=K&&Eh(bt):K=K&&bt instanceof el}),K?Xf(m)&&jc(m,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Sc(m,B){for(var K=m.length-1,bt=0,Ot=K,Zt=0,ie,De;bt<=Ot;)if(Zt=Math.floor((bt+Ot)/2),ie=m[Zt],De=m[Zt+1],ie<=B){if(Zt===K||B<De)return Zt;bt=Zt+1}else if(ie>B)Ot=Zt-1;else throw new Zl("Input is not a number.");return 0}var Uc=function(m,B,K){this.type=m,this.input=B,this.labels=[],this.outputs=[];for(var bt=0,Ot=K;bt<Ot.length;bt+=1){var Zt=Ot[bt],ie=Zt[0],De=Zt[1];this.labels.push(ie),this.outputs.push(De)}};Uc.parse=function(m,B){if(m.length-1<4)return B.error("Expected at least 4 arguments, but found only "+(m.length-1)+".");if((m.length-1)%2!==0)return B.error("Expected an even number of arguments.");var K=B.parse(m[1],1,ao);if(!K)return null;var bt=[],Ot=null;B.expectedType&&B.expectedType.kind!=="value"&&(Ot=B.expectedType);for(var Zt=1;Zt<m.length;Zt+=2){var ie=Zt===1?-1/0:m[Zt],De=m[Zt+1],Je=Zt,vr=Zt+1;if(typeof ie!="number")return B.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Je);if(bt.length&&bt[bt.length-1][0]>=ie)return B.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Je);var Sr=B.parse(De,vr,Ot);if(!Sr)return null;Ot=Ot||Sr.type,bt.push([ie,Sr])}return new Uc(Ot,K,bt)},Uc.prototype.evaluate=function(m){var B=this.labels,K=this.outputs;if(B.length===1)return K[0].evaluate(m);var bt=this.input.evaluate(m);if(bt<=B[0])return K[0].evaluate(m);var Ot=B.length;if(bt>=B[Ot-1])return K[Ot-1].evaluate(m);var Zt=Sc(B,bt);return K[Zt].evaluate(m)},Uc.prototype.eachChild=function(m){m(this.input);for(var B=0,K=this.outputs;B<K.length;B+=1){var bt=K[B];m(bt)}},Uc.prototype.outputDefined=function(){return this.outputs.every(function(m){return m.outputDefined()})},Uc.prototype.serialize=function(){for(var m=["step",this.input.serialize()],B=0;B<this.labels.length;B++)B>0&&m.push(this.labels[B]),m.push(this.outputs[B].serialize());return m};function _u(m,B,K){return m*(1-K)+B*K}function uf(m,B,K){return new Dl(_u(m.r,B.r,K),_u(m.g,B.g,K),_u(m.b,B.b,K),_u(m.a,B.a,K))}function gh(m,B,K){return m.map(function(bt,Ot){return _u(bt,B[Ot],K)})}var Wh=Object.freeze({__proto__:null,number:_u,color:uf,array:gh}),Cf=.95047,Pd=1,Qd=1.08883,cf=4/29,Lf=6/29,wc=3*Lf*Lf,hf=Lf*Lf*Lf,Qc=Math.PI/180,ff=180/Math.PI;function Pf(m){return m>hf?Math.pow(m,1/3):m/wc+cf}function vh(m){return m>Lf?m*m*m:wc*(m-cf)}function bu(m){return 255*(m<=.0031308?12.92*m:1.055*Math.pow(m,1/2.4)-.055)}function Ch(m){return m/=255,m<=.04045?m/12.92:Math.pow((m+.055)/1.055,2.4)}function Vc(m){var B=Ch(m.r),K=Ch(m.g),bt=Ch(m.b),Ot=Pf((.4124564*B+.3575761*K+.1804375*bt)/Cf),Zt=Pf((.2126729*B+.7151522*K+.072175*bt)/Pd),ie=Pf((.0193339*B+.119192*K+.9503041*bt)/Qd);return{l:116*Zt-16,a:500*(Ot-Zt),b:200*(Zt-ie),alpha:m.a}}function fd(m){var B=(m.l+16)/116,K=isNaN(m.a)?B:B+m.a/500,bt=isNaN(m.b)?B:B-m.b/200;return B=Pd*vh(B),K=Cf*vh(K),bt=Qd*vh(bt),new Dl(bu(3.2404542*K-1.5371385*B-.4985314*bt),bu(-.969266*K+1.8760108*B+.041556*bt),bu(.0556434*K-.2040259*B+1.0572252*bt),m.alpha)}function vu(m,B,K){return{l:_u(m.l,B.l,K),a:_u(m.a,B.a,K),b:_u(m.b,B.b,K),alpha:_u(m.alpha,B.alpha,K)}}function bf(m){var B=Vc(m),K=B.l,bt=B.a,Ot=B.b,Zt=Math.atan2(Ot,bt)*ff;return{h:Zt<0?Zt+360:Zt,c:Math.sqrt(bt*bt+Ot*Ot),l:K,alpha:m.a}}function qh(m){var B=m.h*Qc,K=m.c,bt=m.l;return fd({l:bt,a:Math.cos(B)*K,b:Math.sin(B)*K,alpha:m.alpha})}function th(m,B,K){var bt=B-m;return m+K*(bt>180||bt<-180?bt-360*Math.round(bt/360):bt)}function rf(m,B,K){return{h:th(m.h,B.h,K),c:_u(m.c,B.c,K),l:_u(m.l,B.l,K),alpha:_u(m.alpha,B.alpha,K)}}var Zh={forward:Vc,reverse:fd,interpolate:vu},wf={forward:bf,reverse:qh,interpolate:rf},zd=Object.freeze({__proto__:null,lab:Zh,hcl:wf}),gc=function(m,B,K,bt,Ot){this.type=m,this.operator=B,this.interpolation=K,this.input=bt,this.labels=[],this.outputs=[];for(var Zt=0,ie=Ot;Zt<ie.length;Zt+=1){var De=ie[Zt],Je=De[0],vr=De[1];this.labels.push(Je),this.outputs.push(vr)}};gc.interpolationFactor=function(m,B,K,bt){var Ot=0;if(m.name==="exponential")Ot=Jf(B,m.base,K,bt);else if(m.name==="linear")Ot=Jf(B,1,K,bt);else if(m.name==="cubic-bezier"){var Zt=m.controlPoints,ie=new a(Zt[0],Zt[1],Zt[2],Zt[3]);Ot=ie.solve(Jf(B,1,K,bt))}return Ot},gc.parse=function(m,B){var K=m[0],bt=m[1],Ot=m[2],Zt=m.slice(3);if(!Array.isArray(bt)||bt.length===0)return B.error("Expected an interpolation type expression.",1);if(bt[0]==="linear")bt={name:"linear"};else if(bt[0]==="exponential"){var ie=bt[1];if(typeof ie!="number")return B.error("Exponential interpolation requires a numeric base.",1,1);bt={name:"exponential",base:ie}}else if(bt[0]==="cubic-bezier"){var De=bt.slice(1);if(De.length!==4||De.some(function(la){return typeof la!="number"||la<0||la>1}))return B.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);bt={name:"cubic-bezier",controlPoints:De}}else return B.error("Unknown interpolation type "+String(bt[0]),1,0);if(m.length-1<4)return B.error("Expected at least 4 arguments, but found only "+(m.length-1)+".");if((m.length-1)%2!==0)return B.error("Expected an even number of arguments.");if(Ot=B.parse(Ot,2,ao),!Ot)return null;var Je=[],vr=null;K==="interpolate-hcl"||K==="interpolate-lab"?vr=nu:B.expectedType&&B.expectedType.kind!=="value"&&(vr=B.expectedType);for(var Sr=0;Sr<Zt.length;Sr+=2){var Yr=Zt[Sr],nn=Zt[Sr+1],pn=Sr+3,Rn=Sr+4;if(typeof Yr!="number")return B.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',pn);if(Je.length&&Je[Je.length-1][0]>=Yr)return B.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',pn);var pi=B.parse(nn,Rn,vr);if(!pi)return null;vr=vr||pi.type,Je.push([Yr,pi])}return vr.kind!=="number"&&vr.kind!=="color"&&!(vr.kind==="array"&&vr.itemType.kind==="number"&&typeof vr.N=="number")?B.error("Type "+tu(vr)+" is not interpolatable."):new gc(vr,K,bt,Ot,Je)},gc.prototype.evaluate=function(m){var B=this.labels,K=this.outputs;if(B.length===1)return K[0].evaluate(m);var bt=this.input.evaluate(m);if(bt<=B[0])return K[0].evaluate(m);var Ot=B.length;if(bt>=B[Ot-1])return K[Ot-1].evaluate(m);var Zt=Sc(B,bt),ie=B[Zt],De=B[Zt+1],Je=gc.interpolationFactor(this.interpolation,bt,ie,De),vr=K[Zt].evaluate(m),Sr=K[Zt+1].evaluate(m);return this.operator==="interpolate"?Wh[this.type.kind.toLowerCase()](vr,Sr,Je):this.operator==="interpolate-hcl"?wf.reverse(wf.interpolate(wf.forward(vr),wf.forward(Sr),Je)):Zh.reverse(Zh.interpolate(Zh.forward(vr),Zh.forward(Sr),Je))},gc.prototype.eachChild=function(m){m(this.input);for(var B=0,K=this.outputs;B<K.length;B+=1){var bt=K[B];m(bt)}},gc.prototype.outputDefined=function(){return this.outputs.every(function(m){return m.outputDefined()})},gc.prototype.serialize=function(){var m;this.interpolation.name==="linear"?m=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?m=["linear"]:m=["exponential",this.interpolation.base]:m=["cubic-bezier"].concat(this.interpolation.controlPoints);for(var B=[this.operator,m,this.input.serialize()],K=0;K<this.labels.length;K++)B.push(this.labels[K],this.outputs[K].serialize());return B};function Jf(m,B,K,bt){var Ot=bt-K,Zt=m-K;return Ot===0?0:B===1?Zt/Ot:(Math.pow(B,Zt)-1)/(Math.pow(B,Ot)-1)}var eh=function(m,B){this.type=m,this.args=B};eh.parse=function(m,B){if(m.length<2)return B.error("Expectected at least one argument.");var K=null,bt=B.expectedType;bt&&bt.kind!=="value"&&(K=bt);for(var Ot=[],Zt=0,ie=m.slice(1);Zt<ie.length;Zt+=1){var De=ie[Zt],Je=B.parse(De,1+Ot.length,K,void 0,{typeAnnotation:"omit"});if(!Je)return null;K=K||Je.type,Ot.push(Je)}var vr=bt&&Ot.some(function(Sr){return ph(bt,Sr.type)});return vr?new eh(Qo,Ot):new eh(K,Ot)},eh.prototype.evaluate=function(m){for(var B=null,K=0,bt,Ot=0,Zt=this.args;Ot<Zt.length;Ot+=1){var ie=Zt[Ot];if(K++,B=ie.evaluate(m),B&&B instanceof oc&&!B.available&&(bt||(bt=B.name),B=null,K===this.args.length&&(B=bt)),B!==null)break}return B},eh.prototype.eachChild=function(m){this.args.forEach(m)},eh.prototype.outputDefined=function(){return this.args.every(function(m){return m.outputDefined()})},eh.prototype.serialize=function(){var m=["coalesce"];return this.eachChild(function(B){m.push(B.serialize())}),m};var Lh=function(m,B){this.type=B.type,this.bindings=[].concat(m),this.result=B};Lh.prototype.evaluate=function(m){return this.result.evaluate(m)},Lh.prototype.eachChild=function(m){for(var B=0,K=this.bindings;B<K.length;B+=1){var bt=K[B];m(bt[1])}m(this.result)},Lh.parse=function(m,B){if(m.length<4)return B.error("Expected at least 3 arguments, but found "+(m.length-1)+" instead.");for(var K=[],bt=1;bt<m.length-1;bt+=2){var Ot=m[bt];if(typeof Ot!="string")return B.error("Expected string, but found "+typeof Ot+" instead.",bt);if(/[^a-zA-Z0-9_]/.test(Ot))return B.error("Variable names must contain only alphanumeric characters or '_'.",bt);var Zt=B.parse(m[bt+1],bt+1);if(!Zt)return null;K.push([Ot,Zt])}var ie=B.parse(m[m.length-1],m.length-1,B.expectedType,K);return ie?new Lh(K,ie):null},Lh.prototype.outputDefined=function(){return this.result.outputDefined()},Lh.prototype.serialize=function(){for(var m=["let"],B=0,K=this.bindings;B<K.length;B+=1){var bt=K[B],Ot=bt[0],Zt=bt[1];m.push(Ot,Zt.serialize())}return m.push(this.result.serialize()),m};var yh=function(m,B,K){this.type=m,this.index=B,this.input=K};yh.parse=function(m,B){if(m.length!==3)return B.error("Expected 2 arguments, but found "+(m.length-1)+" instead.");var K=B.parse(m[1],1,ao),bt=B.parse(m[2],2,Xl(B.expectedType||Qo));if(!K||!bt)return null;var Ot=bt.type;return new yh(Ot.itemType,K,bt)},yh.prototype.evaluate=function(m){var B=this.index.evaluate(m),K=this.input.evaluate(m);if(B<0)throw new Zl("Array index out of bounds: "+B+" < 0.");if(B>=K.length)throw new Zl("Array index out of bounds: "+B+" > "+(K.length-1)+".");if(B!==Math.floor(B))throw new Zl("Array index must be an integer, but found "+B+" instead.");return K[B]},yh.prototype.eachChild=function(m){m(this.index),m(this.input)},yh.prototype.outputDefined=function(){return!1},yh.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ru=function(m,B){this.type=Ls,this.needle=m,this.haystack=B};Ru.parse=function(m,B){if(m.length!==3)return B.error("Expected 2 arguments, but found "+(m.length-1)+" instead.");var K=B.parse(m[1],1,Qo),bt=B.parse(m[2],2,Qo);return!K||!bt?null:Jc(K.type,[Ls,Ts,ao,Fu,Qo])?new Ru(K,bt):B.error("Expected first argument to be of type boolean, string, number or null, but found "+tu(K.type)+" instead")},Ru.prototype.evaluate=function(m){var B=this.needle.evaluate(m),K=this.haystack.evaluate(m);if(!K)return!1;if(!ah(B,["boolean","string","number","null"]))throw new Zl("Expected first argument to be of type boolean, string, number or null, but found "+tu(su(B))+" instead.");if(!ah(K,["string","array"]))throw new Zl("Expected second argument to be of type array or string, but found "+tu(su(K))+" instead.");return K.indexOf(B)>=0},Ru.prototype.eachChild=function(m){m(this.needle),m(this.haystack)},Ru.prototype.outputDefined=function(){return!0},Ru.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var eu=function(m,B,K){this.type=ao,this.needle=m,this.haystack=B,this.fromIndex=K};eu.parse=function(m,B){if(m.length<=2||m.length>=5)return B.error("Expected 3 or 4 arguments, but found "+(m.length-1)+" instead.");var K=B.parse(m[1],1,Qo),bt=B.parse(m[2],2,Qo);if(!K||!bt)return null;if(!Jc(K.type,[Ls,Ts,ao,Fu,Qo]))return B.error("Expected first argument to be of type boolean, string, number or null, but found "+tu(K.type)+" instead");if(m.length===4){var Ot=B.parse(m[3],3,ao);return Ot?new eu(K,bt,Ot):null}else return new eu(K,bt)},eu.prototype.evaluate=function(m){var B=this.needle.evaluate(m),K=this.haystack.evaluate(m);if(!ah(B,["boolean","string","number","null"]))throw new Zl("Expected first argument to be of type boolean, string, number or null, but found "+tu(su(B))+" instead.");if(!ah(K,["string","array"]))throw new Zl("Expected second argument to be of type array or string, but found "+tu(su(K))+" instead.");if(this.fromIndex){var bt=this.fromIndex.evaluate(m);return K.indexOf(B,bt)}return K.indexOf(B)},eu.prototype.eachChild=function(m){m(this.needle),m(this.haystack),this.fromIndex&&m(this.fromIndex)},eu.prototype.outputDefined=function(){return!1},eu.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var m=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),m]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var xh=function(m,B,K,bt,Ot,Zt){this.inputType=m,this.type=B,this.input=K,this.cases=bt,this.outputs=Ot,this.otherwise=Zt};xh.parse=function(m,B){if(m.length<5)return B.error("Expected at least 4 arguments, but found only "+(m.length-1)+".");if(m.length%2!==1)return B.error("Expected an even number of arguments.");var K,bt;B.expectedType&&B.expectedType.kind!=="value"&&(bt=B.expectedType);for(var Ot={},Zt=[],ie=2;ie<m.length-1;ie+=2){var De=m[ie],Je=m[ie+1];Array.isArray(De)||(De=[De]);var vr=B.concat(ie);if(De.length===0)return vr.error("Expected at least one branch label.");for(var Sr=0,Yr=De;Sr<Yr.length;Sr+=1){var nn=Yr[Sr];if(typeof nn!="number"&&typeof nn!="string")return vr.error("Branch labels must be numbers or strings.");if(typeof nn=="number"&&Math.abs(nn)>Number.MAX_SAFE_INTEGER)return vr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof nn=="number"&&Math.floor(nn)!==nn)return vr.error("Numeric branch labels must be integer values.");if(!K)K=su(nn);else if(vr.checkSubtype(K,su(nn)))return null;if(typeof Ot[String(nn)]<"u")return vr.error("Branch labels must be unique.");Ot[String(nn)]=Zt.length}var pn=B.parse(Je,ie,bt);if(!pn)return null;bt=bt||pn.type,Zt.push(pn)}var Rn=B.parse(m[1],1,Qo);if(!Rn)return null;var pi=B.parse(m[m.length-1],m.length-1,bt);return!pi||Rn.type.kind!=="value"&&B.concat(1).checkSubtype(K,Rn.type)?null:new xh(K,bt,Rn,Ot,Zt,pi)},xh.prototype.evaluate=function(m){var B=this.input.evaluate(m),K=su(B)===this.inputType&&this.outputs[this.cases[B]]||this.otherwise;return K.evaluate(m)},xh.prototype.eachChild=function(m){m(this.input),this.outputs.forEach(m),m(this.otherwise)},xh.prototype.outputDefined=function(){return this.outputs.every(function(m){return m.outputDefined()})&&this.otherwise.outputDefined()},xh.prototype.serialize=function(){for(var m=this,B=["match",this.input.serialize()],K=Object.keys(this.cases).sort(),bt=[],Ot={},Zt=0,ie=K;Zt<ie.length;Zt+=1){var De=ie[Zt],Je=Ot[this.cases[De]];Je===void 0?(Ot[this.cases[De]]=bt.length,bt.push([this.cases[De],[De]])):bt[Je][1].push(De)}for(var vr=function(Rn){return m.inputType.kind==="number"?Number(Rn):Rn},Sr=0,Yr=bt;Sr<Yr.length;Sr+=1){var nn=Yr[Sr],Je=nn[0],pn=nn[1];pn.length===1?B.push(vr(pn[0])):B.push(pn.map(vr)),B.push(this.outputs[outputIndex$1].serialize())}return B.push(this.otherwise.serialize()),B};var df=function(m,B,K){this.type=m,this.branches=B,this.otherwise=K};df.parse=function(m,B){if(m.length<4)return B.error("Expected at least 3 arguments, but found only "+(m.length-1)+".");if(m.length%2!==0)return B.error("Expected an odd number of arguments.");var K;B.expectedType&&B.expectedType.kind!=="value"&&(K=B.expectedType);for(var bt=[],Ot=1;Ot<m.length-1;Ot+=2){var Zt=B.parse(m[Ot],Ot,Ls);if(!Zt)return null;var ie=B.parse(m[Ot+1],Ot+1,K);if(!ie)return null;bt.push([Zt,ie]),K=K||ie.type}var De=B.parse(m[m.length-1],m.length-1,K);return De?new df(K,bt,De):null},df.prototype.evaluate=function(m){for(var B=0,K=this.branches;B<K.length;B+=1){var bt=K[B],Ot=bt[0],Zt=bt[1];if(Ot.evaluate(m))return Zt.evaluate(m)}return this.otherwise.evaluate(m)},df.prototype.eachChild=function(m){for(var B=0,K=this.branches;B<K.length;B+=1){var bt=K[B],Ot=bt[0],Zt=bt[1];m(Ot),m(Zt)}m(this.otherwise)},df.prototype.outputDefined=function(){return this.branches.every(function(m){m[0];var B=m[1];return B.outputDefined()})&&this.otherwise.outputDefined()},df.prototype.serialize=function(){var m=["case"];return this.eachChild(function(B){m.push(B.serialize())}),m};var _h=function(m,B,K,bt){this.type=m,this.input=B,this.beginIndex=K,this.endIndex=bt};_h.parse=function(m,B){if(m.length<=2||m.length>=5)return B.error("Expected 3 or 4 arguments, but found "+(m.length-1)+" instead.");var K=B.parse(m[1],1,Qo),bt=B.parse(m[2],2,ao);if(!K||!bt)return null;if(!Jc(K.type,[Xl(Qo),Ts,Qo]))return B.error("Expected first argument to be of type array or string, but found "+tu(K.type)+" instead");if(m.length===4){var Ot=B.parse(m[3],3,ao);return Ot?new _h(K.type,K,bt,Ot):null}else return new _h(K.type,K,bt)},_h.prototype.evaluate=function(m){var B=this.input.evaluate(m),K=this.beginIndex.evaluate(m);if(!ah(B,["string","array"]))throw new Zl("Expected first argument to be of type array or string, but found "+tu(su(B))+" instead.");if(this.endIndex){var bt=this.endIndex.evaluate(m);return B.slice(K,bt)}return B.slice(K)},_h.prototype.eachChild=function(m){m(this.input),m(this.beginIndex),this.endIndex&&m(this.endIndex)},_h.prototype.outputDefined=function(){return!1},_h.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var m=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),m]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function qf(m,B){return m==="=="||m==="!="?B.kind==="boolean"||B.kind==="string"||B.kind==="number"||B.kind==="null"||B.kind==="value":B.kind==="string"||B.kind==="number"||B.kind==="value"}function mr(m,B,K){return B===K}function Ur(m,B,K){return B!==K}function _n(m,B,K){return B<K}function cn(m,B,K){return B>K}function Wn(m,B,K){return B<=K}function hi(m,B,K){return B>=K}function ea(m,B,K,bt){return bt.compare(B,K)===0}function ga(m,B,K,bt){return!ea(m,B,K,bt)}function Ra(m,B,K,bt){return bt.compare(B,K)<0}function $a(m,B,K,bt){return bt.compare(B,K)>0}function ua(m,B,K,bt){return bt.compare(B,K)<=0}function za(m,B,K,bt){return bt.compare(B,K)>=0}function wa(m,B,K){var bt=m!=="=="&&m!=="!=";return function(){function Ot(Zt,ie,De){this.type=Ls,this.lhs=Zt,this.rhs=ie,this.collator=De,this.hasUntypedArgument=Zt.type.kind==="value"||ie.type.kind==="value"}return Ot.parse=function(Zt,ie){if(Zt.length!==3&&Zt.length!==4)return ie.error("Expected two or three arguments.");var De=Zt[0],Je=ie.parse(Zt[1],1,Qo);if(!Je)return null;if(!qf(De,Je.type))return ie.concat(1).error('"'+De+`" comparisons are not supported for type '`+tu(Je.type)+"'.");var vr=ie.parse(Zt[2],2,Qo);if(!vr)return null;if(!qf(De,vr.type))return ie.concat(2).error('"'+De+`" comparisons are not supported for type '`+tu(vr.type)+"'.");if(Je.type.kind!==vr.type.kind&&Je.type.kind!=="value"&&vr.type.kind!=="value")return ie.error("Cannot compare types '"+tu(Je.type)+"' and '"+tu(vr.type)+"'.");bt&&(Je.type.kind==="value"&&vr.type.kind!=="value"?Je=new Lc(vr.type,[Je]):Je.type.kind!=="value"&&vr.type.kind==="value"&&(vr=new Lc(Je.type,[vr])));var Sr=null;if(Zt.length===4){if(Je.type.kind!=="string"&&vr.type.kind!=="string"&&Je.type.kind!=="value"&&vr.type.kind!=="value")return ie.error("Cannot use collator to compare non-string types.");if(Sr=ie.parse(Zt[3],3,Gu),!Sr)return null}return new Ot(Je,vr,Sr)},Ot.prototype.evaluate=function(Zt){var ie=this.lhs.evaluate(Zt),De=this.rhs.evaluate(Zt);if(bt&&this.hasUntypedArgument){var Je=su(ie),vr=su(De);if(Je.kind!==vr.kind||!(Je.kind==="string"||Je.kind==="number"))throw new Zl('Expected arguments for "'+m+'" to be (string, string) or (number, number), but found ('+Je.kind+", "+vr.kind+") instead.")}if(this.collator&&!bt&&this.hasUntypedArgument){var Sr=su(ie),Yr=su(De);if(Sr.kind!=="string"||Yr.kind!=="string")return B(Zt,ie,De)}return this.collator?K(Zt,ie,De,this.collator.evaluate(Zt)):B(Zt,ie,De)},Ot.prototype.eachChild=function(Zt){Zt(this.lhs),Zt(this.rhs),this.collator&&Zt(this.collator)},Ot.prototype.outputDefined=function(){return!0},Ot.prototype.serialize=function(){var Zt=[m];return this.eachChild(function(ie){Zt.push(ie.serialize())}),Zt},Ot}()}var Ji=wa("==",mr,ea),eo=wa("!=",Ur,ga),rs=wa("<",_n,Ra),Zo=wa(">",cn,$a),os=wa("<=",Wn,ua),fs=wa(">=",hi,za),no=function(m,B,K,bt,Ot){this.type=Ts,this.number=m,this.locale=B,this.currency=K,this.minFractionDigits=bt,this.maxFractionDigits=Ot};no.parse=function(m,B){if(m.length!==3)return B.error("Expected two arguments.");var K=B.parse(m[1],1,ao);if(!K)return null;var bt=m[2];if(typeof bt!="object"||Array.isArray(bt))return B.error("NumberFormat options argument must be an object.");var Ot=null;if(bt.locale&&(Ot=B.parse(bt.locale,1,Ts),!Ot))return null;var Zt=null;if(bt.currency&&(Zt=B.parse(bt.currency,1,Ts),!Zt))return null;var ie=null;if(bt["min-fraction-digits"]&&(ie=B.parse(bt["min-fraction-digits"],1,ao),!ie))return null;var De=null;return bt["max-fraction-digits"]&&(De=B.parse(bt["max-fraction-digits"],1,ao),!De)?null:new no(K,Ot,Zt,ie,De)},no.prototype.evaluate=function(m){return new Intl.NumberFormat(this.locale?this.locale.evaluate(m):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(m):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(m):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(m):void 0}).format(this.number.evaluate(m))},no.prototype.eachChild=function(m){m(this.number),this.locale&&m(this.locale),this.currency&&m(this.currency),this.minFractionDigits&&m(this.minFractionDigits),this.maxFractionDigits&&m(this.maxFractionDigits)},no.prototype.outputDefined=function(){return!1},no.prototype.serialize=function(){var m={};return this.locale&&(m.locale=this.locale.serialize()),this.currency&&(m.currency=this.currency.serialize()),this.minFractionDigits&&(m["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(m["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),m]};var qa=function(m){this.type=ao,this.input=m};qa.parse=function(m,B){if(m.length!==2)return B.error("Expected 1 argument, but found "+(m.length-1)+" instead.");var K=B.parse(m[1],1);return K?K.type.kind!=="array"&&K.type.kind!=="string"&&K.type.kind!=="value"?B.error("Expected argument of type string or array, but found "+tu(K.type)+" instead."):new qa(K):null},qa.prototype.evaluate=function(m){var B=this.input.evaluate(m);if(typeof B=="string"||Array.isArray(B))return B.length;throw new Zl("Expected value to be of type string or array, but found "+tu(su(B))+" instead.")},qa.prototype.eachChild=function(m){m(this.input)},qa.prototype.outputDefined=function(){return!1},qa.prototype.serialize=function(){var m=["length"];return this.eachChild(function(B){m.push(B.serialize())}),m};var ds={"==":Ji,"!=":eo,">":Zo,"<":rs,">=":fs,"<=":os,array:Lc,at:yh,boolean:Lc,case:df,coalesce:eh,collator:sh,format:jh,image:xu,in:Ru,"index-of":eu,interpolate:gc,"interpolate-hcl":gc,"interpolate-lab":gc,length:qa,let:Lh,literal:el,match:xh,number:Lc,"number-format":no,object:Lc,slice:_h,step:Uc,string:Lc,"to-boolean":Qs,"to-color":Qs,"to-number":Qs,"to-string":Qs,var:Hh,within:Nc};function tl(m,B){var K=B[0],bt=B[1],Ot=B[2],Zt=B[3];K=K.evaluate(m),bt=bt.evaluate(m),Ot=Ot.evaluate(m);var ie=Zt?Zt.evaluate(m):1,De=fc(K,bt,Ot,ie);if(De)throw new Zl(De);return new Dl(K/255*ie,bt/255*ie,Ot/255*ie,ie)}function Pl(m,B){return m in B}function iu(m,B){var K=B[m];return typeof K>"u"?null:K}function Hl(m,B,K,bt){for(;K<=bt;){var Ot=K+bt>>1;if(B[Ot]===m)return!0;B[Ot]>m?bt=Ot-1:K=Ot+1}return!1}function au(m){return{type:m}}Jo.register(ds,{error:[Mu,[Ts],function(m,B){var K=B[0];throw new Zl(K.evaluate(m))}],typeof:[Ts,[Qo],function(m,B){var K=B[0];return tu(su(K.evaluate(m)))}],"to-rgba":[Xl(ao,4),[nu],function(m,B){var K=B[0];return K.evaluate(m).toArray()}],rgb:[nu,[ao,ao,ao],tl],rgba:[nu,[ao,ao,ao,ao],tl],has:{type:Ls,overloads:[[[Ts],function(m,B){var K=B[0];return Pl(K.evaluate(m),m.properties())}],[[Ts,cl],function(m,B){var K=B[0],bt=B[1];return Pl(K.evaluate(m),bt.evaluate(m))}]]},get:{type:Qo,overloads:[[[Ts],function(m,B){var K=B[0];return iu(K.evaluate(m),m.properties())}],[[Ts,cl],function(m,B){var K=B[0],bt=B[1];return iu(K.evaluate(m),bt.evaluate(m))}]]},"feature-state":[Qo,[Ts],function(m,B){var K=B[0];return iu(K.evaluate(m),m.featureState||{})}],properties:[cl,[],function(m){return m.properties()}],"geometry-type":[Ts,[],function(m){return m.geometryType()}],id:[Qo,[],function(m){return m.id()}],zoom:[ao,[],function(m){return m.globals.zoom}],"heatmap-density":[ao,[],function(m){return m.globals.heatmapDensity||0}],"line-progress":[ao,[],function(m){return m.globals.lineProgress||0}],accumulated:[Qo,[],function(m){return m.globals.accumulated===void 0?null:m.globals.accumulated}],"+":[ao,au(ao),function(m,B){for(var K=0,bt=0,Ot=B;bt<Ot.length;bt+=1){var Zt=Ot[bt];K+=Zt.evaluate(m)}return K}],"*":[ao,au(ao),function(m,B){for(var K=1,bt=0,Ot=B;bt<Ot.length;bt+=1){var Zt=Ot[bt];K*=Zt.evaluate(m)}return K}],"-":{type:ao,overloads:[[[ao,ao],function(m,B){var K=B[0],bt=B[1];return K.evaluate(m)-bt.evaluate(m)}],[[ao],function(m,B){var K=B[0];return-K.evaluate(m)}]]},"/":[ao,[ao,ao],function(m,B){var K=B[0],bt=B[1];return K.evaluate(m)/bt.evaluate(m)}],"%":[ao,[ao,ao],function(m,B){var K=B[0],bt=B[1];return K.evaluate(m)%bt.evaluate(m)}],ln2:[ao,[],function(){return Math.LN2}],pi:[ao,[],function(){return Math.PI}],e:[ao,[],function(){return Math.E}],"^":[ao,[ao,ao],function(m,B){var K=B[0],bt=B[1];return Math.pow(K.evaluate(m),bt.evaluate(m))}],sqrt:[ao,[ao],function(m,B){var K=B[0];return Math.sqrt(K.evaluate(m))}],log10:[ao,[ao],function(m,B){var K=B[0];return Math.log(K.evaluate(m))/Math.LN10}],ln:[ao,[ao],function(m,B){var K=B[0];return Math.log(K.evaluate(m))}],log2:[ao,[ao],function(m,B){var K=B[0];return Math.log(K.evaluate(m))/Math.LN2}],sin:[ao,[ao],function(m,B){var K=B[0];return Math.sin(K.evaluate(m))}],cos:[ao,[ao],function(m,B){var K=B[0];return Math.cos(K.evaluate(m))}],tan:[ao,[ao],function(m,B){var K=B[0];return Math.tan(K.evaluate(m))}],asin:[ao,[ao],function(m,B){var K=B[0];return Math.asin(K.evaluate(m))}],acos:[ao,[ao],function(m,B){var K=B[0];return Math.acos(K.evaluate(m))}],atan:[ao,[ao],function(m,B){var K=B[0];return Math.atan(K.evaluate(m))}],min:[ao,au(ao),function(m,B){return Math.min.apply(Math,B.map(function(K){return K.evaluate(m)}))}],max:[ao,au(ao),function(m,B){return Math.max.apply(Math,B.map(function(K){return K.evaluate(m)}))}],abs:[ao,[ao],function(m,B){var K=B[0];return Math.abs(K.evaluate(m))}],round:[ao,[ao],function(m,B){var K=B[0],bt=K.evaluate(m);return bt<0?-Math.round(-bt):Math.round(bt)}],floor:[ao,[ao],function(m,B){var K=B[0];return Math.floor(K.evaluate(m))}],ceil:[ao,[ao],function(m,B){var K=B[0];return Math.ceil(K.evaluate(m))}],"filter-==":[Ls,[Ts,Qo],function(m,B){var K=B[0],bt=B[1];return m.properties()[K.value]===bt.value}],"filter-id-==":[Ls,[Qo],function(m,B){var K=B[0];return m.id()===K.value}],"filter-type-==":[Ls,[Ts],function(m,B){var K=B[0];return m.geometryType()===K.value}],"filter-<":[Ls,[Ts,Qo],function(m,B){var K=B[0],bt=B[1],Ot=m.properties()[K.value],Zt=bt.value;return typeof Ot==typeof Zt&&Ot<Zt}],"filter-id-<":[Ls,[Qo],function(m,B){var K=B[0],bt=m.id(),Ot=K.value;return typeof bt==typeof Ot&&bt<Ot}],"filter->":[Ls,[Ts,Qo],function(m,B){var K=B[0],bt=B[1],Ot=m.properties()[K.value],Zt=bt.value;return typeof Ot==typeof Zt&&Ot>Zt}],"filter-id->":[Ls,[Qo],function(m,B){var K=B[0],bt=m.id(),Ot=K.value;return typeof bt==typeof Ot&&bt>Ot}],"filter-<=":[Ls,[Ts,Qo],function(m,B){var K=B[0],bt=B[1],Ot=m.properties()[K.value],Zt=bt.value;return typeof Ot==typeof Zt&&Ot<=Zt}],"filter-id-<=":[Ls,[Qo],function(m,B){var K=B[0],bt=m.id(),Ot=K.value;return typeof bt==typeof Ot&&bt<=Ot}],"filter->=":[Ls,[Ts,Qo],function(m,B){var K=B[0],bt=B[1],Ot=m.properties()[K.value],Zt=bt.value;return typeof Ot==typeof Zt&&Ot>=Zt}],"filter-id->=":[Ls,[Qo],function(m,B){var K=B[0],bt=m.id(),Ot=K.value;return typeof bt==typeof Ot&&bt>=Ot}],"filter-has":[Ls,[Qo],function(m,B){var K=B[0];return K.value in m.properties()}],"filter-has-id":[Ls,[],function(m){return m.id()!==null&&m.id()!==void 0}],"filter-type-in":[Ls,[Xl(Ts)],function(m,B){var K=B[0];return K.value.indexOf(m.geometryType())>=0}],"filter-id-in":[Ls,[Xl(Qo)],function(m,B){var K=B[0];return K.value.indexOf(m.id())>=0}],"filter-in-small":[Ls,[Ts,Xl(Qo)],function(m,B){var K=B[0],bt=B[1];return bt.value.indexOf(m.properties()[K.value])>=0}],"filter-in-large":[Ls,[Ts,Xl(Qo)],function(m,B){var K=B[0],bt=B[1];return Hl(m.properties()[K.value],bt.value,0,bt.value.length-1)}],all:{type:Ls,overloads:[[[Ls,Ls],function(m,B){var K=B[0],bt=B[1];return K.evaluate(m)&&bt.evaluate(m)}],[au(Ls),function(m,B){for(var K=0,bt=B;K<bt.length;K+=1){var Ot=bt[K];if(!Ot.evaluate(m))return!1}return!0}]]},any:{type:Ls,overloads:[[[Ls,Ls],function(m,B){var K=B[0],bt=B[1];return K.evaluate(m)||bt.evaluate(m)}],[au(Ls),function(m,B){for(var K=0,bt=B;K<bt.length;K+=1){var Ot=bt[K];if(Ot.evaluate(m))return!0}return!1}]]},"!":[Ls,[Ls],function(m,B){var K=B[0];return!K.evaluate(m)}],"is-supported-script":[Ls,[Ts],function(m,B){var K=B[0],bt=m.globals&&m.globals.isSupportedScript;return bt?bt(K.evaluate(m)):!0}],upcase:[Ts,[Ts],function(m,B){var K=B[0];return K.evaluate(m).toUpperCase()}],downcase:[Ts,[Ts],function(m,B){var K=B[0];return K.evaluate(m).toLowerCase()}],concat:[Ts,au(Qo),function(m,B){return B.map(function(K){return sc(K.evaluate(m))}).join("")}],"resolved-locale":[Ts,[Gu],function(m,B){var K=B[0];return K.evaluate(m).resolvedLocale()}]});function ml(m){return{result:"success",value:m}}function qu(m){return{result:"error",value:m}}function Lu(m){return m["property-type"]==="data-driven"||m["property-type"]==="cross-faded-data-driven"}function uu(m){return!!m.expression&&m.expression.parameters.indexOf("zoom")>-1}function zo(m){return!!m.expression&&m.expression.interpolated}function Ms(m){return m instanceof Number?"number":m instanceof String?"string":m instanceof Boolean?"boolean":Array.isArray(m)?"array":m===null?"null":typeof m}function $l(m){return typeof m=="object"&&m!==null&&!Array.isArray(m)}function Fl(m){return m}function vc(m,B){var K=B.type==="color",bt=m.stops&&typeof m.stops[0][0]=="object",Ot=bt||m.property!==void 0,Zt=bt||!Ot,ie=m.type||(zo(B)?"exponential":"interval");if(K&&(m=Kl({},m),m.stops&&(m.stops=m.stops.map(function(jo){return[jo[0],Dl.parse(jo[1])]})),m.default?m.default=Dl.parse(m.default):m.default=Dl.parse(B.default)),m.colorSpace&&m.colorSpace!=="rgb"&&!zd[m.colorSpace])throw new Error("Unknown color space: "+m.colorSpace);var De,Je,vr;if(ie==="exponential")De=Wc;else if(ie==="interval")De=Ph;else if(ie==="categorical"){De=Pc,Je=Object.create(null);for(var Sr=0,Yr=m.stops;Sr<Yr.length;Sr+=1){var nn=Yr[Sr];Je[nn[0]]=nn[1]}vr=typeof m.stops[0][0]}else if(ie==="identity")De=zh;else throw new Error('Unknown function type "'+ie+'"');if(bt){for(var pn={},Rn=[],pi=0;pi<m.stops.length;pi++){var la=m.stops[pi],na=la[0].zoom;pn[na]===void 0&&(pn[na]={zoom:na,type:m.type,property:m.property,default:m.default,stops:[]},Rn.push(na)),pn[na].stops.push([la[0].value,la[1]])}for(var ba=[],Fa=0,ya=Rn;Fa<ya.length;Fa+=1){var Ka=ya[Fa];ba.push([pn[Ka].zoom,vc(pn[Ka],B)])}var bo={name:"linear"};return{kind:"composite",interpolationType:bo,interpolationFactor:gc.interpolationFactor.bind(void 0,bo),zoomStops:ba.map(function(jo){return jo[0]}),evaluate:function(jo,xs){var _s=jo.zoom;return Wc({stops:ba,base:m.base},B,_s).evaluate(_s,xs)}}}else if(Zt){var No=ie==="exponential"?{name:"exponential",base:m.base!==void 0?m.base:1}:null;return{kind:"camera",interpolationType:No,interpolationFactor:gc.interpolationFactor.bind(void 0,No),zoomStops:m.stops.map(function(jo){return jo[0]}),evaluate:function(jo){var xs=jo.zoom;return De(m,B,xs,Je,vr)}}}else return{kind:"source",evaluate:function(jo,xs){var _s=xs&&xs.properties?xs.properties[m.property]:void 0;return _s===void 0?Hc(m.default,B.default):De(m,B,_s,Je,vr)}}}function Hc(m,B,K){if(m!==void 0)return m;if(B!==void 0)return B;if(K!==void 0)return K}function Pc(m,B,K,bt,Ot){var Zt=typeof K===Ot?bt[K]:void 0;return Hc(Zt,m.default,B.default)}function Ph(m,B,K){if(Ms(K)!=="number")return Hc(m.default,B.default);var bt=m.stops.length;if(bt===1||K<=m.stops[0][0])return m.stops[0][1];if(K>=m.stops[bt-1][0])return m.stops[bt-1][1];var Ot=Sc(m.stops.map(function(Zt){return Zt[0]}),K);return m.stops[Ot][1]}function Wc(m,B,K){var bt=m.base!==void 0?m.base:1;if(Ms(K)!=="number")return Hc(m.default,B.default);var Ot=m.stops.length;if(Ot===1||K<=m.stops[0][0])return m.stops[0][1];if(K>=m.stops[Ot-1][0])return m.stops[Ot-1][1];var Zt=Sc(m.stops.map(function(Yr){return Yr[0]}),K),ie=Iu(K,bt,m.stops[Zt][0],m.stops[Zt+1][0]),De=m.stops[Zt][1],Je=m.stops[Zt+1][1],vr=Wh[B.type]||Fl;if(m.colorSpace&&m.colorSpace!=="rgb"){var Sr=zd[m.colorSpace];vr=function(Yr,nn){return Sr.reverse(Sr.interpolate(Sr.forward(Yr),Sr.forward(nn),ie))}}return typeof De.evaluate=="function"?{evaluate:function(){for(var Yr=[],nn=arguments.length;nn--;)Yr[nn]=arguments[nn];var pn=De.evaluate.apply(void 0,Yr),Rn=Je.evaluate.apply(void 0,Yr);if(!(pn===void 0||Rn===void 0))return vr(pn,Rn,ie)}}:vr(De,Je,ie)}function zh(m,B,K){return B.type==="color"?K=Dl.parse(K):B.type==="formatted"?K=hc.fromString(K.toString()):B.type==="resolvedImage"?K=oc.fromString(K.toString()):Ms(K)!==B.type&&(B.type!=="enum"||!B.values[K])&&(K=void 0),Hc(K,m.default,B.default)}function Iu(m,B,K,bt){var Ot=bt-K,Zt=m-K;return Ot===0?0:B===1?Zt/Ot:(Math.pow(B,Zt)-1)/(Math.pow(B,Ot)-1)}var Ih=function(m,B){this.expression=m,this._warningHistory={},this._evaluator=new Ll,this._defaultValue=B?It(B):null,this._enumValues=B&&B.type==="enum"?B.values:null};Ih.prototype.evaluateWithoutErrorHandling=function(m,B,K,bt,Ot,Zt){return this._evaluator.globals=m,this._evaluator.feature=B,this._evaluator.featureState=K,this._evaluator.canonical=bt,this._evaluator.availableImages=Ot||null,this._evaluator.formattedSection=Zt,this.expression.evaluate(this._evaluator)},Ih.prototype.evaluate=function(m,B,K,bt,Ot,Zt){this._evaluator.globals=m,this._evaluator.feature=B||null,this._evaluator.featureState=K||null,this._evaluator.canonical=bt,this._evaluator.availableImages=Ot||null,this._evaluator.formattedSection=Zt||null;try{var ie=this.expression.evaluate(this._evaluator);if(ie==null||typeof ie=="number"&&ie!==ie)return this._defaultValue;if(this._enumValues&&!(ie in this._enumValues))throw new Zl("Expected value to be one of "+Object.keys(this._enumValues).map(function(De){return JSON.stringify(De)}).join(", ")+", but found "+JSON.stringify(ie)+" instead.");return ie}catch(De){return this._warningHistory[De.message]||(this._warningHistory[De.message]=!0,typeof console<"u"&&console.warn(De.message)),this._defaultValue}};function es(m){return Array.isArray(m)&&m.length>0&&typeof m[0]=="string"&&m[0]in ds}function zs(m,B){var K=new lu(ds,[],B?Et(B):void 0),bt=K.parse(m,void 0,void 0,void 0,B&&B.type==="string"?{typeAnnotation:"coerce"}:void 0);return bt?ml(new Ih(bt,B)):qu(K.errors)}var qc=function(m,B){this.kind=m,this._styleExpression=B,this.isStateDependent=m!=="constant"&&!zu(B.expression)};qc.prototype.evaluateWithoutErrorHandling=function(m,B,K,bt,Ot,Zt){return this._styleExpression.evaluateWithoutErrorHandling(m,B,K,bt,Ot,Zt)},qc.prototype.evaluate=function(m,B,K,bt,Ot,Zt){return this._styleExpression.evaluate(m,B,K,bt,Ot,Zt)};var Zu=function(m,B,K,bt){this.kind=m,this.zoomStops=K,this._styleExpression=B,this.isStateDependent=m!=="camera"&&!zu(B.expression),this.interpolationType=bt};Zu.prototype.evaluateWithoutErrorHandling=function(m,B,K,bt,Ot,Zt){return this._styleExpression.evaluateWithoutErrorHandling(m,B,K,bt,Ot,Zt)},Zu.prototype.evaluate=function(m,B,K,bt,Ot,Zt){return this._styleExpression.evaluate(m,B,K,bt,Ot,Zt)},Zu.prototype.interpolationFactor=function(m,B,K){return this.interpolationType?gc.interpolationFactor(this.interpolationType,m,B,K):0};function Zf(m,B){if(m=zs(m,B),m.result==="error")return m;var K=m.value.expression,bt=Xf(K);if(!bt&&!Lu(B))return qu([new il("","data expressions not supported")]);var Ot=jc(K,["zoom"]);if(!Ot&&!uu(B))return qu([new il("","zoom expressions not supported")]);var Zt=ht(K);if(!Zt&&!Ot)return qu([new il("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Zt instanceof il)return qu([Zt]);if(Zt instanceof gc&&!zo(B))return qu([new il("",'"interpolate" expressions cannot be used with this property')]);if(!Zt)return ml(bt?new qc("constant",m.value):new qc("source",m.value));var ie=Zt instanceof gc?Zt.interpolation:void 0;return ml(bt?new Zu("camera",m.value,Zt.labels,ie):new Zu("composite",m.value,Zt.labels,ie))}var qt=function(m,B){this._parameters=m,this._specification=B,Kl(this,vc(this._parameters,this._specification))};qt.deserialize=function(m){return new qt(m._parameters,m._specification)},qt.serialize=function(m){return{_parameters:m._parameters,_specification:m._specification}};function I(m,B){if($l(m))return new qt(m,B);if(es(m)){var K=Zf(m,B);if(K.result==="error")throw new Error(K.value.map(function(Ot){return Ot.key+": "+Ot.message}).join(", "));return K.value}else{var bt=m;return typeof m=="string"&&B.type==="color"&&(bt=Dl.parse(m)),{kind:"constant",evaluate:function(){return bt}}}}function ht(m){var B=null;if(m instanceof Lh)B=ht(m.result);else if(m instanceof eh)for(var K=0,bt=m.args;K<bt.length;K+=1){var Ot=bt[K];if(B=ht(Ot),B)break}else(m instanceof Uc||m instanceof gc)&&m.input instanceof Jo&&m.input.name==="zoom"&&(B=m);return B instanceof il||m.eachChild(function(Zt){var ie=ht(Zt);ie instanceof il?B=ie:!B&&ie?B=new il("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):B&&ie&&B!==ie&&(B=new il("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),B}function Et(m){var B={color:nu,string:Ts,number:ao,enum:Ts,boolean:Ls,formatted:_l,resolvedImage:Ol};return m.type==="array"?Xl(B[m.value]||Qo,m.length):B[m.type]}function It(m){return m.type==="color"&&$l(m.default)?new Dl(0,0,0,0):m.type==="color"?Dl.parse(m.default)||null:m.default===void 0?null:m.default}function Vt(m){var B=m.key,K=m.value,bt=m.valueSpec||{},Ot=m.objectElementValidators||{},Zt=m.style,ie=m.styleSpec,De=[],Je=Ms(K);if(Je!=="object")return[new uo(B,K,"object expected, "+Je+" found")];for(var vr in K){var Sr=vr.split(".")[0],Yr=bt[Sr]||bt["*"],nn=void 0;if(Ot[Sr])nn=Ot[Sr];else if(bt[Sr])nn=vl;else if(Ot["*"])nn=Ot["*"];else if(bt["*"])nn=vl;else{De.push(new uo(B,K[vr],'unknown property "'+vr+'"'));continue}De=De.concat(nn({key:(B&&B+".")+vr,value:K[vr],valueSpec:Yr,style:Zt,styleSpec:ie,object:K,objectKey:vr},K))}for(var pn in bt)Ot[pn]||bt[pn].required&&bt[pn].default===void 0&&K[pn]===void 0&&De.push(new uo(B,K,'missing required property "'+pn+'"'));return De}function ke(m){var B=m.value,K=m.valueSpec,bt=m.style,Ot=m.styleSpec,Zt=m.key,ie=m.arrayElementValidator||vl;if(Ms(B)!=="array")return[new uo(Zt,B,"array expected, "+Ms(B)+" found")];if(K.length&&B.length!==K.length)return[new uo(Zt,B,"array length "+K.length+" expected, length "+B.length+" found")];if(K["min-length"]&&B.length<K["min-length"])return[new uo(Zt,B,"array length at least "+K["min-length"]+" expected, length "+B.length+" found")];var De={type:K.value,values:K.values};Ot.$version<7&&(De.function=K.function),Ms(K.value)==="object"&&(De=K.value);for(var Je=[],vr=0;vr<B.length;vr++)Je=Je.concat(ie({array:B,arrayIndex:vr,value:B[vr],valueSpec:De,style:bt,styleSpec:Ot,key:Zt+"["+vr+"]"}));return Je}function Oe(m){var B=m.key,K=m.value,bt=m.valueSpec,Ot=Ms(K);return Ot==="number"&&K!==K&&(Ot="NaN"),Ot!=="number"?[new uo(B,K,"number expected, "+Ot+" found")]:"minimum"in bt&&K<bt.minimum?[new uo(B,K,K+" is less than the minimum value "+bt.minimum)]:"maximum"in bt&&K>bt.maximum?[new uo(B,K,K+" is greater than the maximum value "+bt.maximum)]:[]}function Ke(m){var B=m.valueSpec,K=Go(m.value.type),bt,Ot={},Zt,ie,De=K!=="categorical"&&m.value.property===void 0,Je=!De,vr=Ms(m.value.stops)==="array"&&Ms(m.value.stops[0])==="array"&&Ms(m.value.stops[0][0])==="object",Sr=Vt({key:m.key,value:m.value,valueSpec:m.styleSpec.function,style:m.style,styleSpec:m.styleSpec,objectElementValidators:{stops:Yr,default:Rn}});return K==="identity"&&De&&Sr.push(new uo(m.key,m.value,'missing required property "property"')),K!=="identity"&&!m.value.stops&&Sr.push(new uo(m.key,m.value,'missing required property "stops"')),K==="exponential"&&m.valueSpec.expression&&!zo(m.valueSpec)&&Sr.push(new uo(m.key,m.value,"exponential functions not supported")),m.styleSpec.$version>=8&&(Je&&!Lu(m.valueSpec)?Sr.push(new uo(m.key,m.value,"property functions not supported")):De&&!uu(m.valueSpec)&&Sr.push(new uo(m.key,m.value,"zoom functions not supported"))),(K==="categorical"||vr)&&m.value.property===void 0&&Sr.push(new uo(m.key,m.value,'"property" property is required')),Sr;function Yr(pi){if(K==="identity")return[new uo(pi.key,pi.value,'identity function may not have a "stops" property')];var la=[],na=pi.value;return la=la.concat(ke({key:pi.key,value:na,valueSpec:pi.valueSpec,style:pi.style,styleSpec:pi.styleSpec,arrayElementValidator:nn})),Ms(na)==="array"&&na.length===0&&la.push(new uo(pi.key,na,"array must have at least one stop")),la}function nn(pi){var la=[],na=pi.value,ba=pi.key;if(Ms(na)!=="array")return[new uo(ba,na,"array expected, "+Ms(na)+" found")];if(na.length!==2)return[new uo(ba,na,"array length 2 expected, length "+na.length+" found")];if(vr){if(Ms(na[0])!=="object")return[new uo(ba,na,"object expected, "+Ms(na[0])+" found")];if(na[0].zoom===void 0)return[new uo(ba,na,"object stop key must have zoom")];if(na[0].value===void 0)return[new uo(ba,na,"object stop key must have value")];if(ie&&ie>Go(na[0].zoom))return[new uo(ba,na[0].zoom,"stop zoom values must appear in ascending order")];Go(na[0].zoom)!==ie&&(ie=Go(na[0].zoom),Zt=void 0,Ot={}),la=la.concat(Vt({key:ba+"[0]",value:na[0],valueSpec:{zoom:{}},style:pi.style,styleSpec:pi.styleSpec,objectElementValidators:{zoom:Oe,value:pn}}))}else la=la.concat(pn({key:ba+"[0]",value:na[0],style:pi.style,styleSpec:pi.styleSpec},na));return es(ql(na[1]))?la.concat([new uo(ba+"[1]",na[1],"expressions are not allowed in function stops.")]):la.concat(vl({key:ba+"[1]",value:na[1],valueSpec:B,style:pi.style,styleSpec:pi.styleSpec}))}function pn(pi,la){var na=Ms(pi.value),ba=Go(pi.value),Fa=pi.value!==null?pi.value:la;if(!bt)bt=na;else if(na!==bt)return[new uo(pi.key,Fa,na+" stop domain type must match previous stop domain type "+bt)];if(na!=="number"&&na!=="string"&&na!=="boolean")return[new uo(pi.key,Fa,"stop domain value must be a number, string, or boolean")];if(na!=="number"&&K!=="categorical"){var ya="number expected, "+na+" found";return Lu(B)&&K===void 0&&(ya+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new uo(pi.key,Fa,ya)]}return K==="categorical"&&na==="number"&&(!isFinite(ba)||Math.floor(ba)!==ba)?[new uo(pi.key,Fa,"integer expected, found "+ba)]:K!=="categorical"&&na==="number"&&Zt!==void 0&&ba<Zt?[new uo(pi.key,Fa,"stop domain values must appear in ascending order")]:(Zt=ba,K==="categorical"&&ba in Ot?[new uo(pi.key,Fa,"stop domain values must be unique")]:(Ot[ba]=!0,[]))}function Rn(pi){return vl({key:pi.key,value:pi.value,valueSpec:B,style:pi.style,styleSpec:pi.styleSpec})}}function gr(m){var B=(m.expressionContext==="property"?Zf:zs)(ql(m.value),m.valueSpec);if(B.result==="error")return B.value.map(function(bt){return new uo(""+m.key+bt.key,m.value,bt.message)});var K=B.value.expression||B.value._styleExpression.expression;if(m.expressionContext==="property"&&m.propertyKey==="text-font"&&!K.outputDefined())return[new uo(m.key,m.value,'Invalid data expression for "'+m.propertyKey+'". Output values must be contained as literals within the expression.')];if(m.expressionContext==="property"&&m.propertyType==="layout"&&!zu(K))return[new uo(m.key,m.value,'"feature-state" data expressions are not supported with layout properties.')];if(m.expressionContext==="filter"&&!zu(K))return[new uo(m.key,m.value,'"feature-state" data expressions are not supported with filters.')];if(m.expressionContext&&m.expressionContext.indexOf("cluster")===0){if(!jc(K,["zoom","feature-state"]))return[new uo(m.key,m.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(m.expressionContext==="cluster-initial"&&!Xf(K))return[new uo(m.key,m.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Or(m){var B=m.value,K=m.key,bt=Ms(B);return bt!=="boolean"?[new uo(K,B,"boolean expected, "+bt+" found")]:[]}function Dr(m){var B=m.key,K=m.value,bt=Ms(K);return bt!=="string"?[new uo(B,K,"color expected, "+bt+" found")]:Sf(K)===null?[new uo(B,K,'color expected, "'+K+'" found')]:[]}function ln(m){var B=m.key,K=m.value,bt=m.valueSpec,Ot=[];return Array.isArray(bt.values)?bt.values.indexOf(Go(K))===-1&&Ot.push(new uo(B,K,"expected one of ["+bt.values.join(", ")+"], "+JSON.stringify(K)+" found")):Object.keys(bt.values).indexOf(Go(K))===-1&&Ot.push(new uo(B,K,"expected one of ["+Object.keys(bt.values).join(", ")+"], "+JSON.stringify(K)+" found")),Ot}function Sn(m){if(m===!0||m===!1)return!0;if(!Array.isArray(m)||m.length===0)return!1;switch(m[0]){case"has":return m.length>=2&&m[1]!=="$id"&&m[1]!=="$type";case"in":return m.length>=3&&(typeof m[1]!="string"||Array.isArray(m[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return m.length!==3||Array.isArray(m[1])||Array.isArray(m[2]);case"any":case"all":for(var B=0,K=m.slice(1);B<K.length;B+=1){var bt=K[B];if(!Sn(bt)&&typeof bt!="boolean")return!1}return!0;default:return!0}}var Xt={type:"boolean",default:!1};function ae(m){if(m==null)return{filter:function(){return!0},needGeometry:!1};Sn(m)||(m=je(m));var B=zs(m,Xt);if(B.result==="error")throw new Error(B.value.map(function(bt){return bt.key+": "+bt.message}).join(", "));var K=Ae(m);return{filter:function(bt,Ot,Zt){return B.value.evaluate(bt,Ot,{},Zt)},needGeometry:K}}function xe(m,B){return m<B?-1:m>B?1:0}function Ae(m){if(!Array.isArray(m))return!1;if(m[0]==="within")return!0;for(var B=1;B<m.length;B++)if(Ae(m[B]))return!0;return!1}function je(m){if(!m)return!0;var B=m[0];if(m.length<=1)return B!=="any";var K=B==="=="?Ie(m[1],m[2],"=="):B==="!="?Nr(Ie(m[1],m[2],"==")):B==="<"||B===">"||B==="<="||B===">="?Ie(m[1],m[2],B):B==="any"?Ze(m.slice(1)):B==="all"?["all"].concat(m.slice(1).map(je)):B==="none"?["all"].concat(m.slice(1).map(je).map(Nr)):B==="in"?wr(m[1],m.slice(2)):B==="!in"?Nr(wr(m[1],m.slice(2))):B==="has"?Ir(m[1]):B==="!has"?Nr(Ir(m[1])):B==="within"?m:!0;return K}function Ie(m,B,K){switch(m){case"$type":return["filter-type-"+K,B];case"$id":return["filter-id-"+K,B];default:return["filter-"+K,m,B]}}function Ze(m){return["any"].concat(m.map(je))}function wr(m,B){if(B.length===0)return!1;switch(m){case"$type":return["filter-type-in",["literal",B]];case"$id":return["filter-id-in",["literal",B]];default:return B.length>200&&!B.some(function(K){return typeof K!=typeof B[0]})?["filter-in-large",m,["literal",B.sort(xe)]]:["filter-in-small",m,["literal",B]]}}function Ir(m){switch(m){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",m]}}function Nr(m){return["!",m]}function tn(m){return Sn(ql(m.value))?gr(Kl({},m,{expressionContext:"filter",valueSpec:{value:"boolean"}})):mn(m)}function mn(m){var B=m.value,K=m.key;if(Ms(B)!=="array")return[new uo(K,B,"array expected, "+Ms(B)+" found")];var bt=m.styleSpec,Ot,Zt=[];if(B.length<1)return[new uo(K,B,"filter array must have at least 1 element")];switch(Zt=Zt.concat(ln({key:K+"[0]",value:B[0],valueSpec:bt.filter_operator,style:m.style,styleSpec:m.styleSpec})),Go(B[0])){case"<":case"<=":case">":case">=":B.length>=2&&Go(B[1])==="$type"&&Zt.push(new uo(K,B,'"$type" cannot be use with operator "'+B[0]+'"'));case"==":case"!=":B.length!==3&&Zt.push(new uo(K,B,'filter array for operator "'+B[0]+'" must have 3 elements'));case"in":case"!in":B.length>=2&&(Ot=Ms(B[1]),Ot!=="string"&&Zt.push(new uo(K+"[1]",B[1],"string expected, "+Ot+" found")));for(var ie=2;ie<B.length;ie++)Ot=Ms(B[ie]),Go(B[1])==="$type"?Zt=Zt.concat(ln({key:K+"["+ie+"]",value:B[ie],valueSpec:bt.geometry_type,style:m.style,styleSpec:m.styleSpec})):Ot!=="string"&&Ot!=="number"&&Ot!=="boolean"&&Zt.push(new uo(K+"["+ie+"]",B[ie],"string, number, or boolean expected, "+Ot+" found"));break;case"any":case"all":case"none":for(var De=1;De<B.length;De++)Zt=Zt.concat(mn({key:K+"["+De+"]",value:B[De],style:m.style,styleSpec:m.styleSpec}));break;case"has":case"!has":Ot=Ms(B[1]),B.length!==2?Zt.push(new uo(K,B,'filter array for "'+B[0]+'" operator must have 2 elements')):Ot!=="string"&&Zt.push(new uo(K+"[1]",B[1],"string expected, "+Ot+" found"));break;case"within":Ot=Ms(B[1]),B.length!==2?Zt.push(new uo(K,B,'filter array for "'+B[0]+'" operator must have 2 elements')):Ot!=="object"&&Zt.push(new uo(K+"[1]",B[1],"object expected, "+Ot+" found"));break}return Zt}function zn(m,B){var K=m.key,bt=m.style,Ot=m.styleSpec,Zt=m.value,ie=m.objectKey,De=Ot[B+"_"+m.layerType];if(!De)return[];var Je=ie.match(/^(.*)-transition$/);if(B==="paint"&&Je&&De[Je[1]]&&De[Je[1]].transition)return vl({key:K,value:Zt,valueSpec:Ot.transition,style:bt,styleSpec:Ot});var vr=m.valueSpec||De[ie];if(!vr)return[new uo(K,Zt,'unknown property "'+ie+'"')];var Sr;if(Ms(Zt)==="string"&&Lu(vr)&&!vr.tokens&&(Sr=/^{([^}]+)}$/.exec(Zt)))return[new uo(K,Zt,'"'+ie+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(Sr[1])+" }`.")];var Yr=[];return m.layerType==="symbol"&&(ie==="text-field"&&bt&&!bt.glyphs&&Yr.push(new uo(K,Zt,'use of "text-field" requires a style "glyphs" property')),ie==="text-font"&&$l(ql(Zt))&&Go(Zt.type)==="identity"&&Yr.push(new uo(K,Zt,'"text-font" does not support identity functions'))),Yr.concat(vl({key:m.key,value:Zt,valueSpec:vr,style:bt,styleSpec:Ot,expressionContext:"property",propertyType:B,propertyKey:ie}))}function Bn(m){return zn(m,"paint")}function ri(m){return zn(m,"layout")}function Fi(m){var B=[],K=m.value,bt=m.key,Ot=m.style,Zt=m.styleSpec;!K.type&&!K.ref&&B.push(new uo(bt,K,'either "type" or "ref" is required'));var ie=Go(K.type),De=Go(K.ref);if(K.id)for(var Je=Go(K.id),vr=0;vr<m.arrayIndex;vr++){var Sr=Ot.layers[vr];Go(Sr.id)===Je&&B.push(new uo(bt,K.id,'duplicate layer id "'+K.id+'", previously used at line '+Sr.id.__line__))}if("ref"in K){["type","source","source-layer","filter","layout"].forEach(function(Rn){Rn in K&&B.push(new uo(bt,K[Rn],'"'+Rn+'" is prohibited for ref layers'))});var Yr;Ot.layers.forEach(function(Rn){Go(Rn.id)===De&&(Yr=Rn)}),Yr?Yr.ref?B.push(new uo(bt,K.ref,"ref cannot reference another ref layer")):ie=Go(Yr.type):B.push(new uo(bt,K.ref,'ref layer "'+De+'" not found'))}else if(ie!=="background")if(!K.source)B.push(new uo(bt,K,'missing required property "source"'));else{var nn=Ot.sources&&Ot.sources[K.source],pn=nn&&Go(nn.type);nn?pn==="vector"&&ie==="raster"?B.push(new uo(bt,K.source,'layer "'+K.id+'" requires a raster source')):pn==="raster"&&ie!=="raster"?B.push(new uo(bt,K.source,'layer "'+K.id+'" requires a vector source')):pn==="vector"&&!K["source-layer"]?B.push(new uo(bt,K,'layer "'+K.id+'" must specify a "source-layer"')):pn==="raster-dem"&&ie!=="hillshade"?B.push(new uo(bt,K.source,"raster-dem source can only be used with layer type 'hillshade'.")):ie==="line"&&K.paint&&K.paint["line-gradient"]&&(pn!=="geojson"||!nn.lineMetrics)&&B.push(new uo(bt,K,'layer "'+K.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):B.push(new uo(bt,K.source,'source "'+K.source+'" not found'))}return B=B.concat(Vt({key:bt,value:K,valueSpec:Zt.layer,style:m.style,styleSpec:m.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return vl({key:bt+".type",value:K.type,valueSpec:Zt.layer.type,style:m.style,styleSpec:m.styleSpec,object:K,objectKey:"type"})},filter:tn,layout:function(Rn){return Vt({layer:K,key:Rn.key,value:Rn.value,style:Rn.style,styleSpec:Rn.styleSpec,objectElementValidators:{"*":function(pi){return ri(Kl({layerType:ie},pi))}}})},paint:function(Rn){return Vt({layer:K,key:Rn.key,value:Rn.value,style:Rn.style,styleSpec:Rn.styleSpec,objectElementValidators:{"*":function(pi){return Bn(Kl({layerType:ie},pi))}}})}}})),B}function da(m){var B=m.value,K=m.key,bt=Ms(B);return bt!=="string"?[new uo(K,B,"string expected, "+bt+" found")]:[]}var ha={promoteId:io};function ka(m){var B=m.value,K=m.key,bt=m.styleSpec,Ot=m.style;if(!B.type)return[new uo(K,B,'"type" is required')];var Zt=Go(B.type),ie;switch(Zt){case"vector":case"raster":case"raster-dem":return ie=Vt({key:K,value:B,valueSpec:bt["source_"+Zt.replace("-","_")],style:m.style,styleSpec:bt,objectElementValidators:ha}),ie;case"geojson":if(ie=Vt({key:K,value:B,valueSpec:bt.source_geojson,style:Ot,styleSpec:bt,objectElementValidators:ha}),B.cluster)for(var De in B.clusterProperties){var Je=B.clusterProperties[De],vr=Je[0],Sr=Je[1],Yr=typeof vr=="string"?[vr,["accumulated"],["get",De]]:vr;ie.push.apply(ie,gr({key:K+"."+De+".map",value:Sr,expressionContext:"cluster-map"})),ie.push.apply(ie,gr({key:K+"."+De+".reduce",value:Yr,expressionContext:"cluster-reduce"}))}return ie;case"video":return Vt({key:K,value:B,valueSpec:bt.source_video,style:Ot,styleSpec:bt});case"image":return Vt({key:K,value:B,valueSpec:bt.source_image,style:Ot,styleSpec:bt});case"canvas":return[new uo(K,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ln({key:K+".type",value:B.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function io(m){var B=m.key,K=m.value;if(Ms(K)==="string")return da({key:B,value:K});var bt=[];for(var Ot in K)bt.push.apply(bt,da({key:B+"."+Ot,value:K[Ot]}));return bt}function Ro(m){var B=m.value,K=m.styleSpec,bt=K.light,Ot=m.style,Zt=[],ie=Ms(B);if(B===void 0)return Zt;if(ie!=="object")return Zt=Zt.concat([new uo("light",B,"object expected, "+ie+" found")]),Zt;for(var De in B){var Je=De.match(/^(.*)-transition$/);Je&&bt[Je[1]]&&bt[Je[1]].transition?Zt=Zt.concat(vl({key:De,value:B[De],valueSpec:K.transition,style:Ot,styleSpec:K})):bt[De]?Zt=Zt.concat(vl({key:De,value:B[De],valueSpec:bt[De],style:Ot,styleSpec:K})):Zt=Zt.concat([new uo(De,B[De],'unknown property "'+De+'"')])}return Zt}function Mo(m){return da(m).length===0?[]:gr(m)}function hs(m){return da(m).length===0?[]:gr(m)}var hl={"*":function(){return[]},array:ke,boolean:Or,number:Oe,color:Dr,constants:Hs,enum:ln,filter:tn,function:Ke,layer:Fi,object:Vt,source:ka,light:Ro,string:da,formatted:Mo,resolvedImage:hs};function vl(m){var B=m.value,K=m.valueSpec,bt=m.styleSpec;if(K.expression&&$l(Go(B)))return Ke(m);if(K.expression&&es(ql(B)))return gr(m);if(K.type&&hl[K.type])return hl[K.type](m);var Ot=Vt(Kl({},m,{valueSpec:K.type?bt[K.type]:K}));return Ot}function Os(m){var B=m.value,K=m.key,bt=da(m);return bt.length||(B.indexOf("{fontstack}")===-1&&bt.push(new uo(K,B,'"glyphs" url must include a "{fontstack}" token')),B.indexOf("{range}")===-1&&bt.push(new uo(K,B,'"glyphs" url must include a "{range}" token'))),bt}function bl(m,B){B===void 0&&(B=La);var K=[];return K=K.concat(vl({key:"",value:m,valueSpec:B.$root,styleSpec:B,style:m,objectElementValidators:{glyphs:Os,"*":function(){return[]}}})),m.constants&&(K=K.concat(Hs({key:"constants",value:m.constants}))),Su(K)}bl.source=mu(ka),bl.light=mu(Ro),bl.layer=mu(Fi),bl.filter=mu(tn),bl.paintProperty=mu(Bn),bl.layoutProperty=mu(ri);function Su(m){return[].concat(m).sort(function(B,K){return B.line-K.line})}function mu(m){return function(){for(var B=[],K=arguments.length;K--;)B[K]=arguments[K];return Su(m.apply(this,B))}}var Ws=bl,qs=Ws.light,Yu=Ws.paintProperty,dc=Ws.layoutProperty;function Zc(m,B){var K=!1;if(B&&B.length)for(var bt=0,Ot=B;bt<Ot.length;bt+=1){var Zt=Ot[bt];m.fire(new $r(new Error(Zt.message))),K=!0}return K}var At=ue,jt=3;function ue(m,B,K){var bt=this.cells=[];if(m instanceof ArrayBuffer){this.arrayBuffer=m;var Ot=new Int32Array(this.arrayBuffer);m=Ot[0],B=Ot[1],K=Ot[2],this.d=B+2*K;for(var Zt=0;Zt<this.d*this.d;Zt++){var ie=Ot[jt+Zt],De=Ot[jt+Zt+1];bt.push(ie===De?null:Ot.subarray(ie,De))}var Je=Ot[jt+bt.length],vr=Ot[jt+bt.length+1];this.keys=Ot.subarray(Je,vr),this.bboxes=Ot.subarray(vr),this.insert=this._insertReadonly}else{this.d=B+2*K;for(var Sr=0;Sr<this.d*this.d;Sr++)bt.push([]);this.keys=[],this.bboxes=[]}this.n=B,this.extent=m,this.padding=K,this.scale=B/m,this.uid=0;var Yr=K/B*m;this.min=-Yr,this.max=m+Yr}ue.prototype.insert=function(m,B,K,bt,Ot){this._forEachCell(B,K,bt,Ot,this._insertCell,this.uid++),this.keys.push(m),this.bboxes.push(B),this.bboxes.push(K),this.bboxes.push(bt),this.bboxes.push(Ot)},ue.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ue.prototype._insertCell=function(m,B,K,bt,Ot,Zt){this.cells[Ot].push(Zt)},ue.prototype.query=function(m,B,K,bt,Ot){var Zt=this.min,ie=this.max;if(m<=Zt&&B<=Zt&&ie<=K&&ie<=bt&&!Ot)return Array.prototype.slice.call(this.keys);var De=[],Je={};return this._forEachCell(m,B,K,bt,this._queryCell,De,Je,Ot),De},ue.prototype._queryCell=function(m,B,K,bt,Ot,Zt,ie,De){var Je=this.cells[Ot];if(Je!==null)for(var vr=this.keys,Sr=this.bboxes,Yr=0;Yr<Je.length;Yr++){var nn=Je[Yr];if(ie[nn]===void 0){var pn=nn*4;(De?De(Sr[pn+0],Sr[pn+1],Sr[pn+2],Sr[pn+3]):m<=Sr[pn+2]&&B<=Sr[pn+3]&&K>=Sr[pn+0]&&bt>=Sr[pn+1])?(ie[nn]=!0,Zt.push(vr[nn])):ie[nn]=!1}}},ue.prototype._forEachCell=function(m,B,K,bt,Ot,Zt,ie,De){for(var Je=this._convertToCellCoord(m),vr=this._convertToCellCoord(B),Sr=this._convertToCellCoord(K),Yr=this._convertToCellCoord(bt),nn=Je;nn<=Sr;nn++)for(var pn=vr;pn<=Yr;pn++){var Rn=this.d*pn+nn;if(!(De&&!De(this._convertFromCellCoord(nn),this._convertFromCellCoord(pn),this._convertFromCellCoord(nn+1),this._convertFromCellCoord(pn+1)))&&Ot.call(this,m,B,K,bt,Rn,Zt,ie,De))return}},ue.prototype._convertFromCellCoord=function(m){return(m-this.padding)/this.scale},ue.prototype._convertToCellCoord=function(m){return Math.max(0,Math.min(this.d-1,Math.floor(m*this.scale)+this.padding))},ue.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var m=this.cells,B=jt+this.cells.length+1+1,K=0,bt=0;bt<this.cells.length;bt++)K+=this.cells[bt].length;var Ot=new Int32Array(B+K+this.keys.length+this.bboxes.length);Ot[0]=this.extent,Ot[1]=this.n,Ot[2]=this.padding;for(var Zt=B,ie=0;ie<m.length;ie++){var De=m[ie];Ot[jt+ie]=Zt,Ot.set(De,Zt),Zt+=De.length}return Ot[jt+m.length]=Zt,Ot.set(this.keys,Zt),Zt+=this.keys.length,Ot[jt+m.length+1]=Zt,Ot.set(this.bboxes,Zt),Zt+=this.bboxes.length,Ot.buffer};var Me=s.ImageData,Le=s.ImageBitmap,Be={};function sr(m,B,K){K===void 0&&(K={}),Object.defineProperty(B,"_classRegistryKey",{value:m,writeable:!1}),Be[m]={klass:B,omit:K.omit||[],shallow:K.shallow||[]}}sr("Object",Object),At.serialize=function(m,B){var K=m.toArrayBuffer();return B&&B.push(K),{buffer:K}},At.deserialize=function(m){return new At(m.buffer)},sr("Grid",At),sr("Color",Dl),sr("Error",Error),sr("ResolvedImage",oc),sr("StylePropertyFunction",qt),sr("StyleExpression",Ih,{omit:["_evaluator"]}),sr("ZoomDependentExpression",Zu),sr("ZoomConstantExpression",qc),sr("CompoundExpression",Jo,{omit:["_evaluate"]});for(var ir in ds)ds[ir]._classRegistryKey||sr("Expression_"+ir,ds[ir]);function Mr(m){return m&&typeof ArrayBuffer<"u"&&(m instanceof ArrayBuffer||m.constructor&&m.constructor.name==="ArrayBuffer")}function en(m){return Le&&m instanceof Le}function Xr(m,B){if(m==null||typeof m=="boolean"||typeof m=="number"||typeof m=="string"||m instanceof Boolean||m instanceof Number||m instanceof String||m instanceof Date||m instanceof RegExp)return m;if(Mr(m)||en(m))return B&&B.push(m),m;if(ArrayBuffer.isView(m)){var K=m;return B&&B.push(K.buffer),K}if(m instanceof Me)return B&&B.push(m.data.buffer),m;if(Array.isArray(m)){for(var bt=[],Ot=0,Zt=m;Ot<Zt.length;Ot+=1){var ie=Zt[Ot];bt.push(Xr(ie,B))}return bt}if(typeof m=="object"){var De=m.constructor,Je=De._classRegistryKey;if(!Je)throw new Error("can't serialize object of unregistered class");var vr=De.serialize?De.serialize(m,B):{};if(!De.serialize){for(var Sr in m)if(m.hasOwnProperty(Sr)&&!(Be[Je].omit.indexOf(Sr)>=0)){var Yr=m[Sr];vr[Sr]=Be[Je].shallow.indexOf(Sr)>=0?Yr:Xr(Yr,B)}m instanceof Error&&(vr.message=m.message)}if(vr.$name)throw new Error("$name property is reserved for worker serialization logic.");return Je!=="Object"&&(vr.$name=Je),vr}throw new Error("can't serialize object of type "+typeof m)}function vn(m){if(m==null||typeof m=="boolean"||typeof m=="number"||typeof m=="string"||m instanceof Boolean||m instanceof Number||m instanceof String||m instanceof Date||m instanceof RegExp||Mr(m)||en(m)||ArrayBuffer.isView(m)||m instanceof Me)return m;if(Array.isArray(m))return m.map(vn);if(typeof m=="object"){var B=m.$name||"Object",K=Be[B],bt=K.klass;if(!bt)throw new Error("can't deserialize unregistered class "+B);if(bt.deserialize)return bt.deserialize(m);for(var Ot=Object.create(bt.prototype),Zt=0,ie=Object.keys(m);Zt<ie.length;Zt+=1){var De=ie[Zt];if(De!=="$name"){var Je=m[De];Ot[De]=Be[B].shallow.indexOf(De)>=0?Je:vn(Je)}}return Ot}throw new Error("can't deserialize object of type "+typeof m)}var In=function(){this.first=!0};In.prototype.update=function(m,B){var K=Math.floor(m);return this.first?(this.first=!1,this.lastIntegerZoom=K,this.lastIntegerZoomTime=0,this.lastZoom=m,this.lastFloorZoom=K,!0):(this.lastFloorZoom>K?(this.lastIntegerZoom=K+1,this.lastIntegerZoomTime=B):this.lastFloorZoom<K&&(this.lastIntegerZoom=K,this.lastIntegerZoomTime=B),m!==this.lastZoom?(this.lastZoom=m,this.lastFloorZoom=K,!0):!1)};var On={"Latin-1 Supplement":function(m){return m>=128&&m<=255},Arabic:function(m){return m>=1536&&m<=1791},"Arabic Supplement":function(m){return m>=1872&&m<=1919},"Arabic Extended-A":function(m){return m>=2208&&m<=2303},"Hangul Jamo":function(m){return m>=4352&&m<=4607},"Unified Canadian Aboriginal Syllabics":function(m){return m>=5120&&m<=5759},Khmer:function(m){return m>=6016&&m<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(m){return m>=6320&&m<=6399},"General Punctuation":function(m){return m>=8192&&m<=8303},"Letterlike Symbols":function(m){return m>=8448&&m<=8527},"Number Forms":function(m){return m>=8528&&m<=8591},"Miscellaneous Technical":function(m){return m>=8960&&m<=9215},"Control Pictures":function(m){return m>=9216&&m<=9279},"Optical Character Recognition":function(m){return m>=9280&&m<=9311},"Enclosed Alphanumerics":function(m){return m>=9312&&m<=9471},"Geometric Shapes":function(m){return m>=9632&&m<=9727},"Miscellaneous Symbols":function(m){return m>=9728&&m<=9983},"Miscellaneous Symbols and Arrows":function(m){return m>=11008&&m<=11263},"CJK Radicals Supplement":function(m){return m>=11904&&m<=12031},"Kangxi Radicals":function(m){return m>=12032&&m<=12255},"Ideographic Description Characters":function(m){return m>=12272&&m<=12287},"CJK Symbols and Punctuation":function(m){return m>=12288&&m<=12351},Hiragana:function(m){return m>=12352&&m<=12447},Katakana:function(m){return m>=12448&&m<=12543},Bopomofo:function(m){return m>=12544&&m<=12591},"Hangul Compatibility Jamo":function(m){return m>=12592&&m<=12687},Kanbun:function(m){return m>=12688&&m<=12703},"Bopomofo Extended":function(m){return m>=12704&&m<=12735},"CJK Strokes":function(m){return m>=12736&&m<=12783},"Katakana Phonetic Extensions":function(m){return m>=12784&&m<=12799},"Enclosed CJK Letters and Months":function(m){return m>=12800&&m<=13055},"CJK Compatibility":function(m){return m>=13056&&m<=13311},"CJK Unified Ideographs Extension A":function(m){return m>=13312&&m<=19903},"Yijing Hexagram Symbols":function(m){return m>=19904&&m<=19967},"CJK Unified Ideographs":function(m){return m>=19968&&m<=40959},"Yi Syllables":function(m){return m>=40960&&m<=42127},"Yi Radicals":function(m){return m>=42128&&m<=42191},"Hangul Jamo Extended-A":function(m){return m>=43360&&m<=43391},"Hangul Syllables":function(m){return m>=44032&&m<=55215},"Hangul Jamo Extended-B":function(m){return m>=55216&&m<=55295},"Private Use Area":function(m){return m>=57344&&m<=63743},"CJK Compatibility Ideographs":function(m){return m>=63744&&m<=64255},"Arabic Presentation Forms-A":function(m){return m>=64336&&m<=65023},"Vertical Forms":function(m){return m>=65040&&m<=65055},"CJK Compatibility Forms":function(m){return m>=65072&&m<=65103},"Small Form Variants":function(m){return m>=65104&&m<=65135},"Arabic Presentation Forms-B":function(m){return m>=65136&&m<=65279},"Halfwidth and Fullwidth Forms":function(m){return m>=65280&&m<=65519}};function Bi(m){for(var B=0,K=m;B<K.length;B+=1){var bt=K[B];if(Ii(bt.charCodeAt(0)))return!0}return!1}function Un(m){for(var B=0,K=m;B<K.length;B+=1){var bt=K[B];if(!mi(bt.charCodeAt(0)))return!1}return!0}function mi(m){return!(On.Arabic(m)||On["Arabic Supplement"](m)||On["Arabic Extended-A"](m)||On["Arabic Presentation Forms-A"](m)||On["Arabic Presentation Forms-B"](m))}function Ti(m){return m<11904?!1:!!(On["Bopomofo Extended"](m)||On.Bopomofo(m)||On["CJK Compatibility Forms"](m)||On["CJK Compatibility Ideographs"](m)||On["CJK Compatibility"](m)||On["CJK Radicals Supplement"](m)||On["CJK Strokes"](m)||On["CJK Symbols and Punctuation"](m)||On["CJK Unified Ideographs Extension A"](m)||On["CJK Unified Ideographs"](m)||On["Enclosed CJK Letters and Months"](m)||On["Halfwidth and Fullwidth Forms"](m)||On.Hiragana(m)||On["Ideographic Description Characters"](m)||On["Kangxi Radicals"](m)||On["Katakana Phonetic Extensions"](m)||On.Katakana(m)||On["Vertical Forms"](m)||On["Yi Radicals"](m)||On["Yi Syllables"](m))}function Ii(m){return m===746||m===747?!0:m<4352?!1:!!(On["Bopomofo Extended"](m)||On.Bopomofo(m)||On["CJK Compatibility Forms"](m)&&!(m>=65097&&m<=65103)||On["CJK Compatibility Ideographs"](m)||On["CJK Compatibility"](m)||On["CJK Radicals Supplement"](m)||On["CJK Strokes"](m)||On["CJK Symbols and Punctuation"](m)&&!(m>=12296&&m<=12305)&&!(m>=12308&&m<=12319)&&m!==12336||On["CJK Unified Ideographs Extension A"](m)||On["CJK Unified Ideographs"](m)||On["Enclosed CJK Letters and Months"](m)||On["Hangul Compatibility Jamo"](m)||On["Hangul Jamo Extended-A"](m)||On["Hangul Jamo Extended-B"](m)||On["Hangul Jamo"](m)||On["Hangul Syllables"](m)||On.Hiragana(m)||On["Ideographic Description Characters"](m)||On.Kanbun(m)||On["Kangxi Radicals"](m)||On["Katakana Phonetic Extensions"](m)||On.Katakana(m)&&m!==12540||On["Halfwidth and Fullwidth Forms"](m)&&m!==65288&&m!==65289&&m!==65293&&!(m>=65306&&m<=65310)&&m!==65339&&m!==65341&&m!==65343&&!(m>=65371&&m<=65503)&&m!==65507&&!(m>=65512&&m<=65519)||On["Small Form Variants"](m)&&!(m>=65112&&m<=65118)&&!(m>=65123&&m<=65126)||On["Unified Canadian Aboriginal Syllabics"](m)||On["Unified Canadian Aboriginal Syllabics Extended"](m)||On["Vertical Forms"](m)||On["Yijing Hexagram Symbols"](m)||On["Yi Syllables"](m)||On["Yi Radicals"](m))}function Wi(m){return!!(On["Latin-1 Supplement"](m)&&(m===167||m===169||m===174||m===177||m===188||m===189||m===190||m===215||m===247)||On["General Punctuation"](m)&&(m===8214||m===8224||m===8225||m===8240||m===8241||m===8251||m===8252||m===8258||m===8263||m===8264||m===8265||m===8273)||On["Letterlike Symbols"](m)||On["Number Forms"](m)||On["Miscellaneous Technical"](m)&&(m>=8960&&m<=8967||m>=8972&&m<=8991||m>=8996&&m<=9e3||m===9003||m>=9085&&m<=9114||m>=9150&&m<=9165||m===9167||m>=9169&&m<=9179||m>=9186&&m<=9215)||On["Control Pictures"](m)&&m!==9251||On["Optical Character Recognition"](m)||On["Enclosed Alphanumerics"](m)||On["Geometric Shapes"](m)||On["Miscellaneous Symbols"](m)&&!(m>=9754&&m<=9759)||On["Miscellaneous Symbols and Arrows"](m)&&(m>=11026&&m<=11055||m>=11088&&m<=11097||m>=11192&&m<=11243)||On["CJK Symbols and Punctuation"](m)||On.Katakana(m)||On["Private Use Area"](m)||On["CJK Compatibility Forms"](m)||On["Small Form Variants"](m)||On["Halfwidth and Fullwidth Forms"](m)||m===8734||m===8756||m===8757||m>=9984&&m<=10087||m>=10102&&m<=10131||m===65532||m===65533)}function Yn(m){return!(Ii(m)||Wi(m))}function ja(m){return On.Arabic(m)||On["Arabic Supplement"](m)||On["Arabic Extended-A"](m)||On["Arabic Presentation Forms-A"](m)||On["Arabic Presentation Forms-B"](m)}function Ha(m){return m>=1424&&m<=2303||On["Arabic Presentation Forms-A"](m)||On["Arabic Presentation Forms-B"](m)}function ro(m,B){return!(!B&&Ha(m)||m>=2304&&m<=3583||m>=3840&&m<=4255||On.Khmer(m))}function Lo(m){for(var B=0,K=m;B<K.length;B+=1){var bt=K[B];if(Ha(bt.charCodeAt(0)))return!0}return!1}function Fo(m,B){for(var K=0,bt=m;K<bt.length;K+=1){var Ot=bt[K];if(!ro(Ot.charCodeAt(0),B))return!1}return!0}var Uo={unavailable:"unavailable",deferred:"deferred",loading:"loading",loaded:"loaded",error:"error"},al=null,Wo=Uo.unavailable,ps=null,Tl=function(m){m&&typeof m=="string"&&m.indexOf("NetworkError")>-1&&(Wo=Uo.error),al&&al(m)};function Ku(){cu.fire(new qr("pluginStateChange",{pluginStatus:Wo,pluginURL:ps}))}var cu=new Br,_o=function(){return Wo},Zs=function(m){return m({pluginStatus:Wo,pluginURL:ps}),cu.on("pluginStateChange",m),m},rl=function(m,B,K){if(K===void 0&&(K=!1),Wo===Uo.deferred||Wo===Uo.loading||Wo===Uo.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");ps=zt.resolveURL(m),Wo=Uo.deferred,al=B,Ku(),K||ou()},ou=function(){if(Wo!==Uo.deferred||!ps)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Wo=Uo.loading,Ku(),ps&&wn({url:ps},function(m){m?Tl(m):(Wo=Uo.loaded,Ku())})},Gl={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Wo===Uo.loaded||Gl.applyArabicShaping!=null},isLoading:function(){return Wo===Uo.loading},setState:function(m){Wo=m.pluginStatus,ps=m.pluginURL},isParsed:function(){return Gl.applyArabicShaping!=null&&Gl.processBidirectionalText!=null&&Gl.processStyledBidirectionalText!=null},getPluginURL:function(){return ps}},rh=function(){!Gl.isLoading()&&!Gl.isLoaded()&&_o()==="deferred"&&ou()},Bl=function(m,B){this.zoom=m,B?(this.now=B.now,this.fadeDuration=B.fadeDuration,this.zoomHistory=B.zoomHistory,this.transition=B.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new In,this.transition={})};Bl.prototype.isSupportedScript=function(m){return Fo(m,Gl.isLoaded())},Bl.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Bl.prototype.getCrossfadeParameters=function(){var m=this.zoom,B=m-Math.floor(m),K=this.crossFadingFactor();return m>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:B+(1-B)*K}:{fromScale:.5,toScale:1,t:1-(1-K)*B}};var Ql=function(m,B){this.property=m,this.value=B,this.expression=I(B===void 0?m.specification.default:B,m.specification)};Ql.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Ql.prototype.possiblyEvaluate=function(m,B,K){return this.property.possiblyEvaluate(this,m,B,K)};var bh=function(m){this.property=m,this.value=new Ql(m,void 0)};bh.prototype.transitioned=function(m,B){return new kr(this.property,this.value,B,E({},m.transition,this.transition),m.now)},bh.prototype.untransitioned=function(){return new kr(this.property,this.value,null,{},0)};var _e=function(m){this._properties=m,this._values=Object.create(m.defaultTransitionablePropertyValues)};_e.prototype.getValue=function(m){return F(this._values[m].value.value)},_e.prototype.setValue=function(m,B){this._values.hasOwnProperty(m)||(this._values[m]=new bh(this._values[m].property)),this._values[m].value=new Ql(this._values[m].property,B===null?void 0:F(B))},_e.prototype.getTransition=function(m){return F(this._values[m].transition)},_e.prototype.setTransition=function(m,B){this._values.hasOwnProperty(m)||(this._values[m]=new bh(this._values[m].property)),this._values[m].transition=F(B)||void 0},_e.prototype.serialize=function(){for(var m={},B=0,K=Object.keys(this._values);B<K.length;B+=1){var bt=K[B],Ot=this.getValue(bt);Ot!==void 0&&(m[bt]=Ot);var Zt=this.getTransition(bt);Zt!==void 0&&(m[bt+"-transition"]=Zt)}return m},_e.prototype.transitioned=function(m,B){for(var K=new Lr(this._properties),bt=0,Ot=Object.keys(this._values);bt<Ot.length;bt+=1){var Zt=Ot[bt];K._values[Zt]=this._values[Zt].transitioned(m,B._values[Zt])}return K},_e.prototype.untransitioned=function(){for(var m=new Lr(this._properties),B=0,K=Object.keys(this._values);B<K.length;B+=1){var bt=K[B];m._values[bt]=this._values[bt].untransitioned()}return m};var kr=function(m,B,K,bt,Ot){this.property=m,this.value=B,this.begin=Ot+bt.delay||0,this.end=this.begin+bt.duration||0,m.specification.transition&&(bt.delay||bt.duration)&&(this.prior=K)};kr.prototype.possiblyEvaluate=function(m,B,K){var bt=m.now||0,Ot=this.value.possiblyEvaluate(m,B,K),Zt=this.prior;if(Zt){if(bt>this.end)return this.prior=null,Ot;if(this.value.isDataDriven())return this.prior=null,Ot;if(bt<this.begin)return Zt.possiblyEvaluate(m,B,K);var ie=(bt-this.begin)/(this.end-this.begin);return this.property.interpolate(Zt.possiblyEvaluate(m,B,K),Ot,y(ie))}else return Ot};var Lr=function(m){this._properties=m,this._values=Object.create(m.defaultTransitioningPropertyValues)};Lr.prototype.possiblyEvaluate=function(m,B,K){for(var bt=new Jn(this._properties),Ot=0,Zt=Object.keys(this._values);Ot<Zt.length;Ot+=1){var ie=Zt[Ot];bt._values[ie]=this._values[ie].possiblyEvaluate(m,B,K)}return bt},Lr.prototype.hasTransition=function(){for(var m=0,B=Object.keys(this._values);m<B.length;m+=1){var K=B[m];if(this._values[K].prior)return!0}return!1};var Dn=function(m){this._properties=m,this._values=Object.create(m.defaultPropertyValues)};Dn.prototype.getValue=function(m){return F(this._values[m].value)},Dn.prototype.setValue=function(m,B){this._values[m]=new Ql(this._values[m].property,B===null?void 0:F(B))},Dn.prototype.serialize=function(){for(var m={},B=0,K=Object.keys(this._values);B<K.length;B+=1){var bt=K[B],Ot=this.getValue(bt);Ot!==void 0&&(m[bt]=Ot)}return m},Dn.prototype.possiblyEvaluate=function(m,B,K){for(var bt=new Jn(this._properties),Ot=0,Zt=Object.keys(this._values);Ot<Zt.length;Ot+=1){var ie=Zt[Ot];bt._values[ie]=this._values[ie].possiblyEvaluate(m,B,K)}return bt};var oi=function(m,B,K){this.property=m,this.value=B,this.parameters=K};oi.prototype.isConstant=function(){return this.value.kind==="constant"},oi.prototype.constantOr=function(m){return this.value.kind==="constant"?this.value.value:m},oi.prototype.evaluate=function(m,B,K,bt){return this.property.evaluate(this.value,this.parameters,m,B,K,bt)};var Jn=function(m){this._properties=m,this._values=Object.create(m.defaultPossiblyEvaluatedValues)};Jn.prototype.get=function(m){return this._values[m]};var gn=function(m){this.specification=m};gn.prototype.possiblyEvaluate=function(m,B){return m.expression.evaluate(B)},gn.prototype.interpolate=function(m,B,K){var bt=Wh[this.specification.type];return bt?bt(m,B,K):m};var ni=function(m,B){this.specification=m,this.overrides=B};ni.prototype.possiblyEvaluate=function(m,B,K,bt){return m.expression.kind==="constant"||m.expression.kind==="camera"?new oi(this,{kind:"constant",value:m.expression.evaluate(B,null,{},K,bt)},B):new oi(this,m.expression,B)},ni.prototype.interpolate=function(m,B,K){if(m.value.kind!=="constant"||B.value.kind!=="constant")return m;if(m.value.value===void 0||B.value.value===void 0)return new oi(this,{kind:"constant",value:void 0},m.parameters);var bt=Wh[this.specification.type];return bt?new oi(this,{kind:"constant",value:bt(m.value.value,B.value.value,K)},m.parameters):m},ni.prototype.evaluate=function(m,B,K,bt,Ot,Zt){return m.kind==="constant"?m.value:m.evaluate(B,K,bt,Ot,Zt)};var Yi=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.possiblyEvaluate=function(K,bt,Ot,Zt){if(K.value===void 0)return new oi(this,{kind:"constant",value:void 0},bt);if(K.expression.kind==="constant"){var ie=K.expression.evaluate(bt,null,{},Ot,Zt),De=K.property.specification.type==="resolvedImage",Je=De&&typeof ie!="string"?ie.name:ie,vr=this._calculate(Je,Je,Je,bt);return new oi(this,{kind:"constant",value:vr},bt)}else if(K.expression.kind==="camera"){var Sr=this._calculate(K.expression.evaluate({zoom:bt.zoom-1}),K.expression.evaluate({zoom:bt.zoom}),K.expression.evaluate({zoom:bt.zoom+1}),bt);return new oi(this,{kind:"constant",value:Sr},bt)}else return new oi(this,K.expression,bt)},B.prototype.evaluate=function(K,bt,Ot,Zt,ie,De){if(K.kind==="source"){var Je=K.evaluate(bt,Ot,Zt,ie,De);return this._calculate(Je,Je,Je,bt)}else return K.kind==="composite"?this._calculate(K.evaluate({zoom:Math.floor(bt.zoom)-1},Ot,Zt),K.evaluate({zoom:Math.floor(bt.zoom)},Ot,Zt),K.evaluate({zoom:Math.floor(bt.zoom)+1},Ot,Zt),bt):K.value},B.prototype._calculate=function(K,bt,Ot,Zt){var ie=Zt.zoom;return ie>Zt.zoomHistory.lastIntegerZoom?{from:K,to:bt}:{from:Ot,to:bt}},B.prototype.interpolate=function(K){return K},B}(ni),Ui=function(m){this.specification=m};Ui.prototype.possiblyEvaluate=function(m,B,K,bt){if(m.value!==void 0)if(m.expression.kind==="constant"){var Ot=m.expression.evaluate(B,null,{},K,bt);return this._calculate(Ot,Ot,Ot,B)}else return this._calculate(m.expression.evaluate(new Bl(Math.floor(B.zoom-1),B)),m.expression.evaluate(new Bl(Math.floor(B.zoom),B)),m.expression.evaluate(new Bl(Math.floor(B.zoom+1),B)),B)},Ui.prototype._calculate=function(m,B,K,bt){var Ot=bt.zoom;return Ot>bt.zoomHistory.lastIntegerZoom?{from:m,to:B}:{from:K,to:B}},Ui.prototype.interpolate=function(m){return m};var va=function(m){this.specification=m};va.prototype.possiblyEvaluate=function(m,B,K,bt){return!!m.expression.evaluate(B,null,{},K,bt)},va.prototype.interpolate=function(){return!1};var Za=function(m){this.properties=m,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var B in m){var K=m[B];K.specification.overridable&&this.overridableProperties.push(B);var bt=this.defaultPropertyValues[B]=new Ql(K,void 0),Ot=this.defaultTransitionablePropertyValues[B]=new bh(K);this.defaultTransitioningPropertyValues[B]=Ot.untransitioned(),this.defaultPossiblyEvaluatedValues[B]=bt.possiblyEvaluate({})}};sr("DataDrivenProperty",ni),sr("DataConstantProperty",gn),sr("CrossFadedDataDrivenProperty",Yi),sr("CrossFadedProperty",Ui),sr("ColorRampProperty",va);var Ba="-transition",ta=function(m){function B(K,bt){if(m.call(this),this.id=K.id,this.type=K.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},K.type!=="custom"&&(K=K,this.metadata=K.metadata,this.minzoom=K.minzoom,this.maxzoom=K.maxzoom,K.type!=="background"&&(this.source=K.source,this.sourceLayer=K["source-layer"],this.filter=K.filter),bt.layout&&(this._unevaluatedLayout=new Dn(bt.layout)),bt.paint)){this._transitionablePaint=new _e(bt.paint);for(var Ot in K.paint)this.setPaintProperty(Ot,K.paint[Ot],{validate:!1});for(var Zt in K.layout)this.setLayoutProperty(Zt,K.layout[Zt],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Jn(bt.paint)}}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},B.prototype.getLayoutProperty=function(K){return K==="visibility"?this.visibility:this._unevaluatedLayout.getValue(K)},B.prototype.setLayoutProperty=function(K,bt,Ot){if(Ot===void 0&&(Ot={}),bt!=null){var Zt="layers."+this.id+".layout."+K;if(this._validate(dc,Zt,K,bt,Ot))return}if(K==="visibility"){this.visibility=bt;return}this._unevaluatedLayout.setValue(K,bt)},B.prototype.getPaintProperty=function(K){return N(K,Ba)?this._transitionablePaint.getTransition(K.slice(0,-Ba.length)):this._transitionablePaint.getValue(K)},B.prototype.setPaintProperty=function(K,bt,Ot){if(Ot===void 0&&(Ot={}),bt!=null){var Zt="layers."+this.id+".paint."+K;if(this._validate(Yu,Zt,K,bt,Ot))return!1}if(N(K,Ba))return this._transitionablePaint.setTransition(K.slice(0,-Ba.length),bt||void 0),!1;var ie=this._transitionablePaint._values[K],De=ie.property.specification["property-type"]==="cross-faded-data-driven",Je=ie.value.isDataDriven(),vr=ie.value;this._transitionablePaint.setValue(K,bt),this._handleSpecialPaintPropertyUpdate(K);var Sr=this._transitionablePaint._values[K].value,Yr=Sr.isDataDriven();return Yr||Je||De||this._handleOverridablePaintPropertyUpdate(K,vr,Sr)},B.prototype._handleSpecialPaintPropertyUpdate=function(K){},B.prototype._handleOverridablePaintPropertyUpdate=function(K,bt,Ot){return!1},B.prototype.isHidden=function(K){return this.minzoom&&K<this.minzoom||this.maxzoom&&K>=this.maxzoom?!0:this.visibility==="none"},B.prototype.updateTransitions=function(K){this._transitioningPaint=this._transitionablePaint.transitioned(K,this._transitioningPaint)},B.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},B.prototype.recalculate=function(K,bt){K.getCrossfadeParameters&&(this._crossfadeParameters=K.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(K,void 0,bt)),this.paint=this._transitioningPaint.possiblyEvaluate(K,void 0,bt)},B.prototype.serialize=function(){var K={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&&(K.layout=K.layout||{},K.layout.visibility=this.visibility),H(K,function(bt,Ot){return bt!==void 0&&!(Ot==="layout"&&!Object.keys(bt).length)&&!(Ot==="paint"&&!Object.keys(bt).length)})},B.prototype._validate=function(K,bt,Ot,Zt,ie){return ie===void 0&&(ie={}),ie&&ie.validate===!1?!1:Zc(this,K.call(Ws,{key:bt,layerType:this.type,objectKey:Ot,value:Zt,styleSpec:La,style:{glyphs:!0,sprite:!0}}))},B.prototype.is3D=function(){return!1},B.prototype.isTileClipped=function(){return!1},B.prototype.hasOffscreenPass=function(){return!1},B.prototype.resize=function(){},B.prototype.isStateDependent=function(){for(var K in this.paint._values){var bt=this.paint.get(K);if(!(!(bt instanceof oi)||!Lu(bt.property.specification))&&(bt.value.kind==="source"||bt.value.kind==="composite")&&bt.value.isStateDependent)return!0}return!1},B}(Br),wi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},hn=function(m,B){this._structArray=m,this._pos1=B*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Nn=128,Oi=5,_i=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};_i.serialize=function(m,B){return m._trim(),B&&(m.isTransferred=!0,B.push(m.arrayBuffer)),{length:m.length,arrayBuffer:m.arrayBuffer}},_i.deserialize=function(m){var B=Object.create(this.prototype);return B.arrayBuffer=m.arrayBuffer,B.length=m.length,B.capacity=m.arrayBuffer.byteLength/B.bytesPerElement,B._refreshViews(),B},_i.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},_i.prototype.clear=function(){this.length=0},_i.prototype.resize=function(m){this.reserve(m),this.length=m},_i.prototype.reserve=function(m){if(m>this.capacity){this.capacity=Math.max(m,Math.floor(this.capacity*Oi),Nn),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var B=this.uint8;this._refreshViews(),B&&this.uint8.set(B)}},_i.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function Qn(m,B){B===void 0&&(B=1);var K=0,bt=0,Ot=m.map(function(ie){var De=Ma(ie.type),Je=K=ca(K,Math.max(B,De)),vr=ie.components||1;return bt=Math.max(bt,De),K+=De*vr,{name:ie.name,type:ie.type,components:vr,offset:Je}}),Zt=ca(K,Math.max(bt,B));return{members:Ot,size:Zt,alignment:B}}function Ma(m){return wi[m].BYTES_PER_ELEMENT}function ca(m,B){return Math.ceil(m/B)*B}var Ua=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,K,bt)},B.prototype.emplace=function(K,bt,Ot){var Zt=K*2;return this.int16[Zt+0]=bt,this.int16[Zt+1]=Ot,K},B}(_i);Ua.prototype.bytesPerElement=4,sr("StructArrayLayout2i4",Ua);var vi=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot,Zt){var ie=this.length;return this.resize(ie+1),this.emplace(ie,K,bt,Ot,Zt)},B.prototype.emplace=function(K,bt,Ot,Zt,ie){var De=K*4;return this.int16[De+0]=bt,this.int16[De+1]=Ot,this.int16[De+2]=Zt,this.int16[De+3]=ie,K},B}(_i);vi.prototype.bytesPerElement=8,sr("StructArrayLayout4i8",vi);var ti=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot,Zt,ie,De){var Je=this.length;return this.resize(Je+1),this.emplace(Je,K,bt,Ot,Zt,ie,De)},B.prototype.emplace=function(K,bt,Ot,Zt,ie,De,Je){var vr=K*6;return this.int16[vr+0]=bt,this.int16[vr+1]=Ot,this.int16[vr+2]=Zt,this.int16[vr+3]=ie,this.int16[vr+4]=De,this.int16[vr+5]=Je,K},B}(_i);ti.prototype.bytesPerElement=12,sr("StructArrayLayout2i4i12",ti);var Sa=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot,Zt,ie,De){var Je=this.length;return this.resize(Je+1),this.emplace(Je,K,bt,Ot,Zt,ie,De)},B.prototype.emplace=function(K,bt,Ot,Zt,ie,De,Je){var vr=K*4,Sr=K*8;return this.int16[vr+0]=bt,this.int16[vr+1]=Ot,this.uint8[Sr+4]=Zt,this.uint8[Sr+5]=ie,this.uint8[Sr+6]=De,this.uint8[Sr+7]=Je,K},B}(_i);Sa.prototype.bytesPerElement=8,sr("StructArrayLayout2i4ub8",Sa);var pa=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,K,bt)},B.prototype.emplace=function(K,bt,Ot){var Zt=K*2;return this.float32[Zt+0]=bt,this.float32[Zt+1]=Ot,K},B}(_i);pa.prototype.bytesPerElement=8,sr("StructArrayLayout2f8",pa);var qi=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr){var nn=this.length;return this.resize(nn+1),this.emplace(nn,K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr)},B.prototype.emplace=function(K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn){var pn=K*10;return this.uint16[pn+0]=bt,this.uint16[pn+1]=Ot,this.uint16[pn+2]=Zt,this.uint16[pn+3]=ie,this.uint16[pn+4]=De,this.uint16[pn+5]=Je,this.uint16[pn+6]=vr,this.uint16[pn+7]=Sr,this.uint16[pn+8]=Yr,this.uint16[pn+9]=nn,K},B}(_i);qi.prototype.bytesPerElement=20,sr("StructArrayLayout10ui20",qi);var $i=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn){var Rn=this.length;return this.resize(Rn+1),this.emplace(Rn,K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn)},B.prototype.emplace=function(K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn,Rn){var pi=K*12;return this.int16[pi+0]=bt,this.int16[pi+1]=Ot,this.int16[pi+2]=Zt,this.int16[pi+3]=ie,this.uint16[pi+4]=De,this.uint16[pi+5]=Je,this.uint16[pi+6]=vr,this.uint16[pi+7]=Sr,this.int16[pi+8]=Yr,this.int16[pi+9]=nn,this.int16[pi+10]=pn,this.int16[pi+11]=Rn,K},B}(_i);$i.prototype.bytesPerElement=24,sr("StructArrayLayout4i4ui4i24",$i);var _a=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot){var Zt=this.length;return this.resize(Zt+1),this.emplace(Zt,K,bt,Ot)},B.prototype.emplace=function(K,bt,Ot,Zt){var ie=K*3;return this.float32[ie+0]=bt,this.float32[ie+1]=Ot,this.float32[ie+2]=Zt,K},B}(_i);_a.prototype.bytesPerElement=12,sr("StructArrayLayout3f12",_a);var Po=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K){var bt=this.length;return this.resize(bt+1),this.emplace(bt,K)},B.prototype.emplace=function(K,bt){var Ot=K*1;return this.uint32[Ot+0]=bt,K},B}(_i);Po.prototype.bytesPerElement=4,sr("StructArrayLayout1ul4",Po);var wo=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.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)},B.prototype.emplaceBack=function(K,bt,Ot,Zt,ie,De,Je,vr,Sr){var Yr=this.length;return this.resize(Yr+1),this.emplace(Yr,K,bt,Ot,Zt,ie,De,Je,vr,Sr)},B.prototype.emplace=function(K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr){var nn=K*10,pn=K*5;return this.int16[nn+0]=bt,this.int16[nn+1]=Ot,this.int16[nn+2]=Zt,this.int16[nn+3]=ie,this.int16[nn+4]=De,this.int16[nn+5]=Je,this.uint32[pn+3]=vr,this.uint16[nn+8]=Sr,this.uint16[nn+9]=Yr,K},B}(_i);wo.prototype.bytesPerElement=20,sr("StructArrayLayout6i1ul2ui20",wo);var xa=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot,Zt,ie,De){var Je=this.length;return this.resize(Je+1),this.emplace(Je,K,bt,Ot,Zt,ie,De)},B.prototype.emplace=function(K,bt,Ot,Zt,ie,De,Je){var vr=K*6;return this.int16[vr+0]=bt,this.int16[vr+1]=Ot,this.int16[vr+2]=Zt,this.int16[vr+3]=ie,this.int16[vr+4]=De,this.int16[vr+5]=Je,K},B}(_i);xa.prototype.bytesPerElement=12,sr("StructArrayLayout2i2i2i12",xa);var Oa=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot,Zt,ie){var De=this.length;return this.resize(De+1),this.emplace(De,K,bt,Ot,Zt,ie)},B.prototype.emplace=function(K,bt,Ot,Zt,ie,De){var Je=K*4,vr=K*8;return this.float32[Je+0]=bt,this.float32[Je+1]=Ot,this.float32[Je+2]=Zt,this.int16[vr+6]=ie,this.int16[vr+7]=De,K},B}(_i);Oa.prototype.bytesPerElement=16,sr("StructArrayLayout2f1f2i16",Oa);var ho=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot,Zt){var ie=this.length;return this.resize(ie+1),this.emplace(ie,K,bt,Ot,Zt)},B.prototype.emplace=function(K,bt,Ot,Zt,ie){var De=K*12,Je=K*3;return this.uint8[De+0]=bt,this.uint8[De+1]=Ot,this.float32[Je+1]=Zt,this.float32[Je+2]=ie,K},B}(_i);ho.prototype.bytesPerElement=12,sr("StructArrayLayout2ub2f12",ho);var So=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot){var Zt=this.length;return this.resize(Zt+1),this.emplace(Zt,K,bt,Ot)},B.prototype.emplace=function(K,bt,Ot,Zt){var ie=K*3;return this.uint16[ie+0]=bt,this.uint16[ie+1]=Ot,this.uint16[ie+2]=Zt,K},B}(_i);So.prototype.bytesPerElement=6,sr("StructArrayLayout3ui6",So);var ts=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.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)},B.prototype.emplaceBack=function(K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn,Rn,pi,la,na,ba){var Fa=this.length;return this.resize(Fa+1),this.emplace(Fa,K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn,Rn,pi,la,na,ba)},B.prototype.emplace=function(K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn,Rn,pi,la,na,ba,Fa){var ya=K*24,Ka=K*12,bo=K*48;return this.int16[ya+0]=bt,this.int16[ya+1]=Ot,this.uint16[ya+2]=Zt,this.uint16[ya+3]=ie,this.uint32[Ka+2]=De,this.uint32[Ka+3]=Je,this.uint32[Ka+4]=vr,this.uint16[ya+10]=Sr,this.uint16[ya+11]=Yr,this.uint16[ya+12]=nn,this.float32[Ka+7]=pn,this.float32[Ka+8]=Rn,this.uint8[bo+36]=pi,this.uint8[bo+37]=la,this.uint8[bo+38]=na,this.uint32[Ka+10]=ba,this.int16[ya+22]=Fa,K},B}(_i);ts.prototype.bytesPerElement=48,sr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ts);var Nl=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.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)},B.prototype.emplaceBack=function(K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn,Rn,pi,la,na,ba,Fa,ya,Ka,bo,No,jo,xs,_s,Fs,$s,sl){var Rs=this.length;return this.resize(Rs+1),this.emplace(Rs,K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn,Rn,pi,la,na,ba,Fa,ya,Ka,bo,No,jo,xs,_s,Fs,$s,sl)},B.prototype.emplace=function(K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn,Rn,pi,la,na,ba,Fa,ya,Ka,bo,No,jo,xs,_s,Fs,$s,sl,Rs){var Us=K*34,Bu=K*17;return this.int16[Us+0]=bt,this.int16[Us+1]=Ot,this.int16[Us+2]=Zt,this.int16[Us+3]=ie,this.int16[Us+4]=De,this.int16[Us+5]=Je,this.int16[Us+6]=vr,this.int16[Us+7]=Sr,this.uint16[Us+8]=Yr,this.uint16[Us+9]=nn,this.uint16[Us+10]=pn,this.uint16[Us+11]=Rn,this.uint16[Us+12]=pi,this.uint16[Us+13]=la,this.uint16[Us+14]=na,this.uint16[Us+15]=ba,this.uint16[Us+16]=Fa,this.uint16[Us+17]=ya,this.uint16[Us+18]=Ka,this.uint16[Us+19]=bo,this.uint16[Us+20]=No,this.uint16[Us+21]=jo,this.uint16[Us+22]=xs,this.uint32[Bu+12]=_s,this.float32[Bu+13]=Fs,this.float32[Bu+14]=$s,this.float32[Bu+15]=sl,this.float32[Bu+16]=Rs,K},B}(_i);Nl.prototype.bytesPerElement=68,sr("StructArrayLayout8i15ui1ul4f68",Nl);var Al=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K){var bt=this.length;return this.resize(bt+1),this.emplace(bt,K)},B.prototype.emplace=function(K,bt){var Ot=K*1;return this.float32[Ot+0]=bt,K},B}(_i);Al.prototype.bytesPerElement=4,sr("StructArrayLayout1f4",Al);var us=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot){var Zt=this.length;return this.resize(Zt+1),this.emplace(Zt,K,bt,Ot)},B.prototype.emplace=function(K,bt,Ot,Zt){var ie=K*3;return this.int16[ie+0]=bt,this.int16[ie+1]=Ot,this.int16[ie+2]=Zt,K},B}(_i);us.prototype.bytesPerElement=6,sr("StructArrayLayout3i6",us);var wu=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot){var Zt=this.length;return this.resize(Zt+1),this.emplace(Zt,K,bt,Ot)},B.prototype.emplace=function(K,bt,Ot,Zt){var ie=K*2,De=K*4;return this.uint32[ie+0]=bt,this.uint16[De+2]=Ot,this.uint16[De+3]=Zt,K},B}(_i);wu.prototype.bytesPerElement=8,sr("StructArrayLayout1ul2ui8",wu);var fl=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,K,bt)},B.prototype.emplace=function(K,bt,Ot){var Zt=K*2;return this.uint16[Zt+0]=bt,this.uint16[Zt+1]=Ot,K},B}(_i);fl.prototype.bytesPerElement=4,sr("StructArrayLayout2ui4",fl);var Eu=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K){var bt=this.length;return this.resize(bt+1),this.emplace(bt,K)},B.prototype.emplace=function(K,bt){var Ot=K*1;return this.uint16[Ot+0]=bt,K},B}(_i);Eu.prototype.bytesPerElement=2,sr("StructArrayLayout1ui2",Eu);var pc=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},B.prototype.emplaceBack=function(K,bt,Ot,Zt){var ie=this.length;return this.resize(ie+1),this.emplace(ie,K,bt,Ot,Zt)},B.prototype.emplace=function(K,bt,Ot,Zt,ie){var De=K*4;return this.float32[De+0]=bt,this.float32[De+1]=Ot,this.float32[De+2]=Zt,this.float32[De+3]=ie,K},B}(_i);pc.prototype.bytesPerElement=16,sr("StructArrayLayout4f16",pc);var yc=function(m){function B(){m.apply(this,arguments)}m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B;var K={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 K.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},K.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},K.x1.get=function(){return this._structArray.int16[this._pos2+2]},K.y1.get=function(){return this._structArray.int16[this._pos2+3]},K.x2.get=function(){return this._structArray.int16[this._pos2+4]},K.y2.get=function(){return this._structArray.int16[this._pos2+5]},K.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},K.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},K.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},K.anchorPoint.get=function(){return new o(this.anchorPointX,this.anchorPointY)},Object.defineProperties(B.prototype,K),B}(hn);yc.prototype.size=20;var yu=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.get=function(K){return new yc(this,K)},B}(wo);sr("CollisionBoxArray",yu);var hu=function(m){function B(){m.apply(this,arguments)}m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B;var K={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 K.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},K.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},K.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},K.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},K.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},K.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},K.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},K.segment.get=function(){return this._structArray.uint16[this._pos2+10]},K.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},K.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},K.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},K.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},K.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},K.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},K.placedOrientation.set=function(bt){this._structArray.uint8[this._pos1+37]=bt},K.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},K.hidden.set=function(bt){this._structArray.uint8[this._pos1+38]=bt},K.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},K.crossTileID.set=function(bt){this._structArray.uint32[this._pos4+10]=bt},K.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(B.prototype,K),B}(hn);hu.prototype.size=48;var ku=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.get=function(K){return new hu(this,K)},B}(ts);sr("PlacedSymbolArray",ku);var Bo=function(m){function B(){m.apply(this,arguments)}m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B;var K={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 K.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},K.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},K.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},K.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},K.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},K.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},K.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},K.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},K.key.get=function(){return this._structArray.uint16[this._pos2+8]},K.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},K.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},K.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},K.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},K.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},K.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},K.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},K.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},K.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},K.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},K.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},K.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},K.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},K.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},K.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},K.crossTileID.set=function(bt){this._structArray.uint32[this._pos4+12]=bt},K.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},K.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},K.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},K.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(B.prototype,K),B}(hn);Bo.prototype.size=68;var Tu=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.get=function(K){return new Bo(this,K)},B}(Nl);sr("SymbolInstanceArray",Tu);var ol=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.getoffsetX=function(K){return this.float32[K*1+0]},B}(Al);sr("GlyphOffsetArray",ol);var Cu=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.getx=function(K){return this.int16[K*3+0]},B.prototype.gety=function(K){return this.int16[K*3+1]},B.prototype.gettileUnitDistanceFromAnchor=function(K){return this.int16[K*3+2]},B}(us);sr("SymbolLineVertexArray",Cu);var xc=function(m){function B(){m.apply(this,arguments)}m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B;var K={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return K.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},K.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},K.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(B.prototype,K),B}(hn);xc.prototype.size=8;var Eo=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.get=function(K){return new xc(this,K)},B}(wu);sr("FeatureIndexArray",Eo);var Ss=Qn([{name:"a_pos",components:2,type:"Int16"}],4),Ml=Ss.members,yl=function(m){m===void 0&&(m=[]),this.segments=m};yl.prototype.prepareSegment=function(m,B,K,bt){var Ot=this.segments[this.segments.length-1];return m>yl.MAX_VERTEX_ARRAY_LENGTH&&q("Max vertices per segment is "+yl.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+m),(!Ot||Ot.vertexLength+m>yl.MAX_VERTEX_ARRAY_LENGTH||Ot.sortKey!==bt)&&(Ot={vertexOffset:B.length,primitiveOffset:K.length,vertexLength:0,primitiveLength:0},bt!==void 0&&(Ot.sortKey=bt),this.segments.push(Ot)),Ot},yl.prototype.get=function(){return this.segments},yl.prototype.destroy=function(){for(var m=0,B=this.segments;m<B.length;m+=1){var K=B[m];for(var bt in K.vaos)K.vaos[bt].destroy()}},yl.simpleSegment=function(m,B,K,bt){return new yl([{vertexOffset:m,primitiveOffset:B,vertexLength:K,primitiveLength:bt,vaos:{},sortKey:0}])},yl.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,sr("SegmentVector",yl);function Z(m,B){return m=u(Math.floor(m),0,255),B=u(Math.floor(B),0,255),256*m+B}var ot=Qn([{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"}]),et=e(function(m){function B(K,bt){var Ot,Zt,ie,De,Je,vr,Sr,Yr;for(Ot=K.length&3,Zt=K.length-Ot,ie=bt,Je=3432918353,vr=461845907,Yr=0;Yr<Zt;)Sr=K.charCodeAt(Yr)&255|(K.charCodeAt(++Yr)&255)<<8|(K.charCodeAt(++Yr)&255)<<16|(K.charCodeAt(++Yr)&255)<<24,++Yr,Sr=(Sr&65535)*Je+(((Sr>>>16)*Je&65535)<<16)&4294967295,Sr=Sr<<15|Sr>>>17,Sr=(Sr&65535)*vr+(((Sr>>>16)*vr&65535)<<16)&4294967295,ie^=Sr,ie=ie<<13|ie>>>19,De=(ie&65535)*5+(((ie>>>16)*5&65535)<<16)&4294967295,ie=(De&65535)+27492+(((De>>>16)+58964&65535)<<16);switch(Sr=0,Ot){case 3:Sr^=(K.charCodeAt(Yr+2)&255)<<16;case 2:Sr^=(K.charCodeAt(Yr+1)&255)<<8;case 1:Sr^=K.charCodeAt(Yr)&255,Sr=(Sr&65535)*Je+(((Sr>>>16)*Je&65535)<<16)&4294967295,Sr=Sr<<15|Sr>>>17,Sr=(Sr&65535)*vr+(((Sr>>>16)*vr&65535)<<16)&4294967295,ie^=Sr}return ie^=K.length,ie^=ie>>>16,ie=(ie&65535)*2246822507+(((ie>>>16)*2246822507&65535)<<16)&4294967295,ie^=ie>>>13,ie=(ie&65535)*3266489909+(((ie>>>16)*3266489909&65535)<<16)&4294967295,ie^=ie>>>16,ie>>>0}m.exports=B}),xt=e(function(m){function B(K,bt){for(var Ot=K.length,Zt=bt^Ot,ie=0,De;Ot>=4;)De=K.charCodeAt(ie)&255|(K.charCodeAt(++ie)&255)<<8|(K.charCodeAt(++ie)&255)<<16|(K.charCodeAt(++ie)&255)<<24,De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16),De^=De>>>24,De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16),Zt=(Zt&65535)*1540483477+(((Zt>>>16)*1540483477&65535)<<16)^De,Ot-=4,++ie;switch(Ot){case 3:Zt^=(K.charCodeAt(ie+2)&255)<<16;case 2:Zt^=(K.charCodeAt(ie+1)&255)<<8;case 1:Zt^=K.charCodeAt(ie)&255,Zt=(Zt&65535)*1540483477+(((Zt>>>16)*1540483477&65535)<<16)}return Zt^=Zt>>>13,Zt=(Zt&65535)*1540483477+(((Zt>>>16)*1540483477&65535)<<16),Zt^=Zt>>>15,Zt>>>0}m.exports=B}),Ut=et,fe=et,ye=xt;Ut.murmur3=fe,Ut.murmur2=ye;var Yt=function(){this.ids=[],this.positions=[],this.indexed=!1};Yt.prototype.add=function(m,B,K,bt){this.ids.push(Se(m)),this.positions.push(B,K,bt)},Yt.prototype.getPositions=function(m){for(var B=Se(m),K=0,bt=this.ids.length-1;K<bt;){var Ot=K+bt>>1;this.ids[Ot]>=B?bt=Ot:K=Ot+1}for(var Zt=[];this.ids[K]===B;){var ie=this.positions[3*K],De=this.positions[3*K+1],Je=this.positions[3*K+2];Zt.push({index:ie,start:De,end:Je}),K++}return Zt},Yt.serialize=function(m,B){var K=new Float64Array(m.ids),bt=new Uint32Array(m.positions);return nr(K,bt,0,K.length-1),B&&B.push(K.buffer,bt.buffer),{ids:K,positions:bt}},Yt.deserialize=function(m){var B=new Yt;return B.ids=m.ids,B.positions=m.positions,B.indexed=!0,B};var ce=Math.pow(2,53)-1;function Se(m){var B=+m;return!isNaN(B)&&B<=ce?B:Ut(String(m))}function nr(m,B,K,bt){for(;K<bt;){for(var Ot=m[K+bt>>1],Zt=K-1,ie=bt+1;;){do Zt++;while(m[Zt]<Ot);do ie--;while(m[ie]>Ot);if(Zt>=ie)break;Ye(m,Zt,ie),Ye(B,3*Zt,3*ie),Ye(B,3*Zt+1,3*ie+1),Ye(B,3*Zt+2,3*ie+2)}ie-K<bt-ie?(nr(m,B,K,ie),K=ie+1):(nr(m,B,ie+1,bt),bt=ie)}}function Ye(m,B,K){var bt=m[B];m[B]=m[K],m[K]=bt}sr("FeaturePositionMap",Yt);var tr=function(m,B){this.gl=m.gl,this.location=B},lr=function(m){function B(K,bt){m.call(this,K,bt),this.current=0}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.set=function(K){this.current!==K&&(this.current=K,this.gl.uniform1i(this.location,K))},B}(tr),hr=function(m){function B(K,bt){m.call(this,K,bt),this.current=0}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.set=function(K){this.current!==K&&(this.current=K,this.gl.uniform1f(this.location,K))},B}(tr),Ve=function(m){function B(K,bt){m.call(this,K,bt),this.current=[0,0]}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.set=function(K){(K[0]!==this.current[0]||K[1]!==this.current[1])&&(this.current=K,this.gl.uniform2f(this.location,K[0],K[1]))},B}(tr),Xe=function(m){function B(K,bt){m.call(this,K,bt),this.current=[0,0,0]}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.set=function(K){(K[0]!==this.current[0]||K[1]!==this.current[1]||K[2]!==this.current[2])&&(this.current=K,this.gl.uniform3f(this.location,K[0],K[1],K[2]))},B}(tr),$e=function(m){function B(K,bt){m.call(this,K,bt),this.current=[0,0,0,0]}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.set=function(K){(K[0]!==this.current[0]||K[1]!==this.current[1]||K[2]!==this.current[2]||K[3]!==this.current[3])&&(this.current=K,this.gl.uniform4f(this.location,K[0],K[1],K[2],K[3]))},B}(tr),Cr=function(m){function B(K,bt){m.call(this,K,bt),this.current=Dl.transparent}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.set=function(K){(K.r!==this.current.r||K.g!==this.current.g||K.b!==this.current.b||K.a!==this.current.a)&&(this.current=K,this.gl.uniform4f(this.location,K.r,K.g,K.b,K.a))},B}(tr),on=new Float32Array(16),fn=function(m){function B(K,bt){m.call(this,K,bt),this.current=on}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.set=function(K){if(K[12]!==this.current[12]||K[0]!==this.current[0]){this.current=K,this.gl.uniformMatrix4fv(this.location,!1,K);return}for(var bt=1;bt<16;bt++)if(K[bt]!==this.current[bt]){this.current=K,this.gl.uniformMatrix4fv(this.location,!1,K);break}},B}(tr);function fi(m){return[Z(255*m.r,255*m.g),Z(255*m.b,255*m.a)]}var si=function(m,B,K){this.value=m,this.uniformNames=B.map(function(bt){return"u_"+bt}),this.type=K};si.prototype.setUniform=function(m,B,K){m.set(K.constantOr(this.value))},si.prototype.getBinding=function(m,B,K){return this.type==="color"?new Cr(m,B):new hr(m,B)};var Gn=function(m,B){this.uniformNames=B.map(function(K){return"u_"+K}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Gn.prototype.setConstantPatternPositions=function(m,B){this.pixelRatioFrom=B.pixelRatio,this.pixelRatioTo=m.pixelRatio,this.patternFrom=B.tlbr,this.patternTo=m.tlbr},Gn.prototype.setUniform=function(m,B,K,bt){var Ot=bt==="u_pattern_to"?this.patternTo:bt==="u_pattern_from"?this.patternFrom:bt==="u_pixel_ratio_to"?this.pixelRatioTo:bt==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Ot&&m.set(Ot)},Gn.prototype.getBinding=function(m,B,K){return K.substr(0,9)==="u_pattern"?new $e(m,B):new hr(m,B)};var Mi=function(m,B,K,bt){this.expression=m,this.type=K,this.maxValue=0,this.paintVertexAttributes=B.map(function(Ot){return{name:"a_"+Ot,type:"Float32",components:K==="color"?2:1,offset:0}}),this.paintVertexArray=new bt};Mi.prototype.populatePaintArray=function(m,B,K,bt,Ot){var Zt=this.paintVertexArray.length,ie=this.expression.evaluate(new Bl(0),B,{},bt,[],Ot);this.paintVertexArray.resize(m),this._setPaintValue(Zt,m,ie)},Mi.prototype.updatePaintArray=function(m,B,K,bt){var Ot=this.expression.evaluate({zoom:0},K,bt);this._setPaintValue(m,B,Ot)},Mi.prototype._setPaintValue=function(m,B,K){if(this.type==="color")for(var bt=fi(K),Ot=m;Ot<B;Ot++)this.paintVertexArray.emplace(Ot,bt[0],bt[1]);else{for(var Zt=m;Zt<B;Zt++)this.paintVertexArray.emplace(Zt,K);this.maxValue=Math.max(this.maxValue,Math.abs(K))}},Mi.prototype.upload=function(m){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=m.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Mi.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var di=function(m,B,K,bt,Ot,Zt){this.expression=m,this.uniformNames=B.map(function(ie){return"u_"+ie+"_t"}),this.type=K,this.useIntegerZoom=bt,this.zoom=Ot,this.maxValue=0,this.paintVertexAttributes=B.map(function(ie){return{name:"a_"+ie,type:"Float32",components:K==="color"?4:2,offset:0}}),this.paintVertexArray=new Zt};di.prototype.populatePaintArray=function(m,B,K,bt,Ot){var Zt=this.expression.evaluate(new Bl(this.zoom),B,{},bt,[],Ot),ie=this.expression.evaluate(new Bl(this.zoom+1),B,{},bt,[],Ot),De=this.paintVertexArray.length;this.paintVertexArray.resize(m),this._setPaintValue(De,m,Zt,ie)},di.prototype.updatePaintArray=function(m,B,K,bt){var Ot=this.expression.evaluate({zoom:this.zoom},K,bt),Zt=this.expression.evaluate({zoom:this.zoom+1},K,bt);this._setPaintValue(m,B,Ot,Zt)},di.prototype._setPaintValue=function(m,B,K,bt){if(this.type==="color")for(var Ot=fi(K),Zt=fi(bt),ie=m;ie<B;ie++)this.paintVertexArray.emplace(ie,Ot[0],Ot[1],Zt[0],Zt[1]);else{for(var De=m;De<B;De++)this.paintVertexArray.emplace(De,K,bt);this.maxValue=Math.max(this.maxValue,Math.abs(K),Math.abs(bt))}},di.prototype.upload=function(m){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=m.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},di.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},di.prototype.setUniform=function(m,B){var K=this.useIntegerZoom?Math.floor(B.zoom):B.zoom,bt=u(this.expression.interpolationFactor(K,this.zoom,this.zoom+1),0,1);m.set(bt)},di.prototype.getBinding=function(m,B,K){return new hr(m,B)};var Ki=function(m,B,K,bt,Ot,Zt){this.expression=m,this.type=B,this.useIntegerZoom=K,this.zoom=bt,this.layerId=Zt,this.zoomInPaintVertexArray=new Ot,this.zoomOutPaintVertexArray=new Ot};Ki.prototype.populatePaintArray=function(m,B,K){var bt=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(m),this.zoomOutPaintVertexArray.resize(m),this._setPaintValues(bt,m,B.patterns&&B.patterns[this.layerId],K)},Ki.prototype.updatePaintArray=function(m,B,K,bt,Ot){this._setPaintValues(m,B,K.patterns&&K.patterns[this.layerId],Ot)},Ki.prototype._setPaintValues=function(m,B,K,bt){if(!(!bt||!K)){var Ot=K.min,Zt=K.mid,ie=K.max,De=bt[Ot],Je=bt[Zt],vr=bt[ie];if(!(!De||!Je||!vr))for(var Sr=m;Sr<B;Sr++)this.zoomInPaintVertexArray.emplace(Sr,Je.tl[0],Je.tl[1],Je.br[0],Je.br[1],De.tl[0],De.tl[1],De.br[0],De.br[1],Je.pixelRatio,De.pixelRatio),this.zoomOutPaintVertexArray.emplace(Sr,Je.tl[0],Je.tl[1],Je.br[0],Je.br[1],vr.tl[0],vr.tl[1],vr.br[0],vr.br[1],Je.pixelRatio,vr.pixelRatio)}},Ki.prototype.upload=function(m){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=m.createVertexBuffer(this.zoomInPaintVertexArray,ot.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=m.createVertexBuffer(this.zoomOutPaintVertexArray,ot.members,this.expression.isStateDependent))},Ki.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Ai=function(m,B,K){this.binders={},this._buffers=[];var bt=[];for(var Ot in m.paint._values)if(K(Ot)){var Zt=m.paint.get(Ot);if(!(!(Zt instanceof oi)||!Lu(Zt.property.specification))){var ie=sa(Ot,m.type),De=Zt.value,Je=Zt.property.specification.type,vr=Zt.property.useIntegerZoom,Sr=Zt.property.specification["property-type"],Yr=Sr==="cross-faded"||Sr==="cross-faded-data-driven";if(De.kind==="constant")this.binders[Ot]=Yr?new Gn(De.value,ie):new si(De.value,ie,Je),bt.push("/u_"+Ot);else if(De.kind==="source"||Yr){var nn=so(Ot,Je,"source");this.binders[Ot]=Yr?new Ki(De,Je,vr,B,nn,m.id):new Mi(De,ie,Je,nn),bt.push("/a_"+Ot)}else{var pn=so(Ot,Je,"composite");this.binders[Ot]=new di(De,ie,Je,vr,B,pn),bt.push("/z_"+Ot)}}}this.cacheKey=bt.sort().join("")};Ai.prototype.getMaxValue=function(m){var B=this.binders[m];return B instanceof Mi||B instanceof di?B.maxValue:0},Ai.prototype.populatePaintArrays=function(m,B,K,bt,Ot){for(var Zt in this.binders){var ie=this.binders[Zt];(ie instanceof Mi||ie instanceof di||ie instanceof Ki)&&ie.populatePaintArray(m,B,K,bt,Ot)}},Ai.prototype.setConstantPatternPositions=function(m,B){for(var K in this.binders){var bt=this.binders[K];bt instanceof Gn&&bt.setConstantPatternPositions(m,B)}},Ai.prototype.updatePaintArrays=function(m,B,K,bt,Ot){var Zt=!1;for(var ie in m)for(var De=B.getPositions(ie),Je=0,vr=De;Je<vr.length;Je+=1){var Sr=vr[Je],Yr=K.feature(Sr.index);for(var nn in this.binders){var pn=this.binders[nn];if((pn instanceof Mi||pn instanceof di||pn instanceof Ki)&&pn.expression.isStateDependent===!0){var Rn=bt.paint.get(nn);pn.expression=Rn.value,pn.updatePaintArray(Sr.start,Sr.end,Yr,m[ie],Ot),Zt=!0}}}return Zt},Ai.prototype.defines=function(){var m=[];for(var B in this.binders){var K=this.binders[B];(K instanceof si||K instanceof Gn)&&m.push.apply(m,K.uniformNames.map(function(bt){return"#define HAS_UNIFORM_"+bt}))}return m},Ai.prototype.getBinderAttributes=function(){var m=[];for(var B in this.binders){var K=this.binders[B];if(K instanceof Mi||K instanceof di)for(var bt=0;bt<K.paintVertexAttributes.length;bt++)m.push(K.paintVertexAttributes[bt].name);else if(K instanceof Ki)for(var Ot=0;Ot<ot.members.length;Ot++)m.push(ot.members[Ot].name)}return m},Ai.prototype.getBinderUniforms=function(){var m=[];for(var B in this.binders){var K=this.binders[B];if(K instanceof si||K instanceof Gn||K instanceof di)for(var bt=0,Ot=K.uniformNames;bt<Ot.length;bt+=1){var Zt=Ot[bt];m.push(Zt)}}return m},Ai.prototype.getPaintVertexBuffers=function(){return this._buffers},Ai.prototype.getUniforms=function(m,B){var K=[];for(var bt in this.binders){var Ot=this.binders[bt];if(Ot instanceof si||Ot instanceof Gn||Ot instanceof di)for(var Zt=0,ie=Ot.uniformNames;Zt<ie.length;Zt+=1){var De=ie[Zt];if(B[De]){var Je=Ot.getBinding(m,B[De],De);K.push({name:De,property:bt,binding:Je})}}}return K},Ai.prototype.setUniforms=function(m,B,K,bt){for(var Ot=0,Zt=B;Ot<Zt.length;Ot+=1){var ie=Zt[Ot],De=ie.name,Je=ie.property,vr=ie.binding;this.binders[Je].setUniform(vr,bt,K.get(Je),De)}},Ai.prototype.updatePaintBuffers=function(m){this._buffers=[];for(var B in this.binders){var K=this.binders[B];if(m&&K instanceof Ki){var bt=m.fromScale===2?K.zoomInPaintVertexBuffer:K.zoomOutPaintVertexBuffer;bt&&this._buffers.push(bt)}else(K instanceof Mi||K instanceof di)&&K.paintVertexBuffer&&this._buffers.push(K.paintVertexBuffer)}},Ai.prototype.upload=function(m){for(var B in this.binders){var K=this.binders[B];(K instanceof Mi||K instanceof di||K instanceof Ki)&&K.upload(m)}this.updatePaintBuffers()},Ai.prototype.destroy=function(){for(var m in this.binders){var B=this.binders[m];(B instanceof Mi||B instanceof di||B instanceof Ki)&&B.destroy()}};var Si=function(m,B,K){K===void 0&&(K=function(){return!0}),this.programConfigurations={};for(var bt=0,Ot=m;bt<Ot.length;bt+=1){var Zt=Ot[bt];this.programConfigurations[Zt.id]=new Ai(Zt,B,K)}this.needsUpload=!1,this._featureMap=new Yt,this._bufferOffset=0};Si.prototype.populatePaintArrays=function(m,B,K,bt,Ot,Zt){for(var ie in this.programConfigurations)this.programConfigurations[ie].populatePaintArrays(m,B,bt,Ot,Zt);B.id!==void 0&&this._featureMap.add(B.id,K,this._bufferOffset,m),this._bufferOffset=m,this.needsUpload=!0},Si.prototype.updatePaintArrays=function(m,B,K,bt){for(var Ot=0,Zt=K;Ot<Zt.length;Ot+=1){var ie=Zt[Ot];this.needsUpload=this.programConfigurations[ie.id].updatePaintArrays(m,this._featureMap,B,ie,bt)||this.needsUpload}},Si.prototype.get=function(m){return this.programConfigurations[m]},Si.prototype.upload=function(m){if(this.needsUpload){for(var B in this.programConfigurations)this.programConfigurations[B].upload(m);this.needsUpload=!1}},Si.prototype.destroy=function(){for(var m in this.programConfigurations)this.programConfigurations[m].destroy()};function sa(m,B){var K={"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 K[m]||[m.replace(B+"-","").replace(/-/g,"_")]}function Qa(m){var B={"line-pattern":{source:qi,composite:qi},"fill-pattern":{source:qi,composite:qi},"fill-extrusion-pattern":{source:qi,composite:qi}};return B[m]}function so(m,B,K){var bt={color:{source:pa,composite:pc},number:{source:Al,composite:pa}},Ot=Qa(m);return Ot&&Ot[K]||bt[B][K]}sr("ConstantBinder",si),sr("CrossFadedConstantBinder",Gn),sr("SourceExpressionBinder",Mi),sr("CrossFadedCompositeBinder",Ki),sr("CompositeExpressionBinder",di),sr("ProgramConfiguration",Ai,{omit:["_buffers"]}),sr("ProgramConfigurationSet",Si);var Vo=8192,vs=15,zl=Math.pow(2,vs-1)-1,jl=-zl-1;function dl(m){for(var B=Vo/m.extent,K=m.loadGeometry(),bt=0;bt<K.length;bt++)for(var Ot=K[bt],Zt=0;Zt<Ot.length;Zt++){var ie=Ot[Zt],De=Math.round(ie.x*B),Je=Math.round(ie.y*B);ie.x=u(De,jl,zl),ie.y=u(Je,jl,zl),(De<ie.x||De>ie.x+1||Je<ie.y||Je>ie.y+1)&&q("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return K}function Ul(m,B){return{type:m.type,id:m.id,properties:m.properties,geometry:B?dl(m):[]}}function _c(m,B,K,bt,Ot){m.emplaceBack(B*2+(bt+1)/2,K*2+(Ot+1)/2)}var Ds=function(m){this.zoom=m.zoom,this.overscaling=m.overscaling,this.layers=m.layers,this.layerIds=this.layers.map(function(B){return B.id}),this.index=m.index,this.hasPattern=!1,this.layoutVertexArray=new Ua,this.indexArray=new So,this.segments=new yl,this.programConfigurations=new Si(m.layers,m.zoom),this.stateDependentLayerIds=this.layers.filter(function(B){return B.isStateDependent()}).map(function(B){return B.id})};Ds.prototype.populate=function(m,B,K){var bt=this.layers[0],Ot=[],Zt=null;bt.type==="circle"&&(Zt=bt.layout.get("circle-sort-key"));for(var ie=0,De=m;ie<De.length;ie+=1){var Je=De[ie],vr=Je.feature,Sr=Je.id,Yr=Je.index,nn=Je.sourceLayerIndex,pn=this.layers[0]._featureFilter.needGeometry,Rn=Ul(vr,pn);if(this.layers[0]._featureFilter.filter(new Bl(this.zoom),Rn,K)){var pi=Zt?Zt.evaluate(Rn,{},K):void 0,la={id:Sr,properties:vr.properties,type:vr.type,sourceLayerIndex:nn,index:Yr,geometry:pn?Rn.geometry:dl(vr),patterns:{},sortKey:pi};Ot.push(la)}}Zt&&Ot.sort(function(xs,_s){return xs.sortKey-_s.sortKey});for(var na=0,ba=Ot;na<ba.length;na+=1){var Fa=ba[na],ya=Fa,Ka=ya.geometry,bo=ya.index,No=ya.sourceLayerIndex,jo=m[bo].feature;this.addFeature(Fa,Ka,bo,K),B.featureIndex.insert(jo,Ka,bo,No,this.index)}},Ds.prototype.update=function(m,B,K){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(m,B,this.stateDependentLayers,K)},Ds.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Ds.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ds.prototype.upload=function(m){this.uploaded||(this.layoutVertexBuffer=m.createVertexBuffer(this.layoutVertexArray,Ml),this.indexBuffer=m.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(m),this.uploaded=!0},Ds.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ds.prototype.addFeature=function(m,B,K,bt){for(var Ot=0,Zt=B;Ot<Zt.length;Ot+=1)for(var ie=Zt[Ot],De=0,Je=ie;De<Je.length;De+=1){var vr=Je[De],Sr=vr.x,Yr=vr.y;if(!(Sr<0||Sr>=Vo||Yr<0||Yr>=Vo)){var nn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,m.sortKey),pn=nn.vertexLength;_c(this.layoutVertexArray,Sr,Yr,-1,-1),_c(this.layoutVertexArray,Sr,Yr,1,-1),_c(this.layoutVertexArray,Sr,Yr,1,1),_c(this.layoutVertexArray,Sr,Yr,-1,1),this.indexArray.emplaceBack(pn,pn+1,pn+2),this.indexArray.emplaceBack(pn,pn+3,pn+2),nn.vertexLength+=4,nn.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,m,K,{},bt)},sr("CircleBucket",Ds,{omit:["layers"]});function Au(m,B){for(var K=0;K<m.length;K++)if(qd(B,m[K]))return!0;for(var bt=0;bt<B.length;bt++)if(qd(m,B[bt]))return!0;return!!kp(m,B)}function nf(m,B,K){return!!(qd(m,B)||R0(B,m,K))}function zf(m,B){if(m.length===1)return Ap(B,m[0]);for(var K=0;K<B.length;K++)for(var bt=B[K],Ot=0;Ot<bt.length;Ot++)if(qd(m,bt[Ot]))return!0;for(var Zt=0;Zt<m.length;Zt++)if(Ap(B,m[Zt]))return!0;for(var ie=0;ie<B.length;ie++)if(kp(m,B[ie]))return!0;return!1}function Np(m,B,K){for(var bt=0;bt<B.length;bt++){var Ot=B[bt];if(m.length>=3){for(var Zt=0;Zt<Ot.length;Zt++)if(qd(m,Ot[Zt]))return!0}if(b0(m,Ot,K))return!0}return!1}function b0(m,B,K){if(m.length>1){if(kp(m,B))return!0;for(var bt=0;bt<B.length;bt++)if(R0(B[bt],m,K))return!0}for(var Ot=0;Ot<m.length;Ot++)if(R0(m[Ot],B,K))return!0;return!1}function kp(m,B){if(m.length===0||B.length===0)return!1;for(var K=0;K<m.length-1;K++)for(var bt=m[K],Ot=m[K+1],Zt=0;Zt<B.length-1;Zt++){var ie=B[Zt],De=B[Zt+1];if(Tp(bt,Ot,ie,De))return!0}return!1}function Tp(m,B,K,bt){return X(m,K,bt)!==X(B,K,bt)&&X(m,B,K)!==X(m,B,bt)}function R0(m,B,K){var bt=K*K;if(B.length===1)return m.distSqr(B[0])<bt;for(var Ot=1;Ot<B.length;Ot++){var Zt=B[Ot-1],ie=B[Ot];if(tp(m,Zt,ie)<bt)return!0}return!1}function tp(m,B,K){var bt=B.distSqr(K);if(bt===0)return m.distSqr(B);var Ot=((m.x-B.x)*(K.x-B.x)+(m.y-B.y)*(K.y-B.y))/bt;return Ot<0?m.distSqr(B):Ot>1?m.distSqr(K):m.distSqr(K.sub(B)._mult(Ot)._add(B))}function Ap(m,B){for(var K=!1,bt,Ot,Zt,ie=0;ie<m.length;ie++){bt=m[ie];for(var De=0,Je=bt.length-1;De<bt.length;Je=De++)Ot=bt[De],Zt=bt[Je],Ot.y>B.y!=Zt.y>B.y&&B.x<(Zt.x-Ot.x)*(B.y-Ot.y)/(Zt.y-Ot.y)+Ot.x&&(K=!K)}return K}function qd(m,B){for(var K=!1,bt=0,Ot=m.length-1;bt<m.length;Ot=bt++){var Zt=m[bt],ie=m[Ot];Zt.y>B.y!=ie.y>B.y&&B.x<(ie.x-Zt.x)*(B.y-Zt.y)/(ie.y-Zt.y)+Zt.x&&(K=!K)}return K}function Q0(m,B,K,bt,Ot){for(var Zt=0,ie=m;Zt<ie.length;Zt+=1){var De=ie[Zt];if(B<=De.x&&K<=De.y&&bt>=De.x&&Ot>=De.y)return!0}var Je=[new o(B,K),new o(B,Ot),new o(bt,Ot),new o(bt,K)];if(m.length>2)for(var vr=0,Sr=Je;vr<Sr.length;vr+=1){var Yr=Sr[vr];if(qd(m,Yr))return!0}for(var nn=0;nn<m.length-1;nn++){var pn=m[nn],Rn=m[nn+1];if(Hm(pn,Rn,Je))return!0}return!1}function Hm(m,B,K){var bt=K[0],Ot=K[2];if(m.x<bt.x&&B.x<bt.x||m.x>Ot.x&&B.x>Ot.x||m.y<bt.y&&B.y<bt.y||m.y>Ot.y&&B.y>Ot.y)return!1;var Zt=X(m,B,K[0]);return Zt!==X(m,B,K[1])||Zt!==X(m,B,K[2])||Zt!==X(m,B,K[3])}function Mp(m,B,K){var bt=B.paint.get(m).value;return bt.kind==="constant"?bt.value:K.programConfigurations.get(B.id).getMaxValue(m)}function Sp(m){return Math.sqrt(m[0]*m[0]+m[1]*m[1])}function ep(m,B,K,bt,Ot){if(!B[0]&&!B[1])return m;var Zt=o.convert(B)._mult(Ot);K==="viewport"&&Zt._rotate(-bt);for(var ie=[],De=0;De<m.length;De++){var Je=m[De];ie.push(Je.sub(Zt))}return ie}var Wm=new Za({"circle-sort-key":new ni(La.layout_circle["circle-sort-key"])}),Pg=new Za({"circle-radius":new ni(La.paint_circle["circle-radius"]),"circle-color":new ni(La.paint_circle["circle-color"]),"circle-blur":new ni(La.paint_circle["circle-blur"]),"circle-opacity":new ni(La.paint_circle["circle-opacity"]),"circle-translate":new gn(La.paint_circle["circle-translate"]),"circle-translate-anchor":new gn(La.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new gn(La.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new gn(La.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ni(La.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ni(La.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ni(La.paint_circle["circle-stroke-opacity"])}),qm={paint:Pg,layout:Wm},dd=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var m=arguments,B=0,K=arguments.length;K--;)B+=m[K]*m[K];return Math.sqrt(B)});function wm(){var m=new dd(4);return dd!=Float32Array&&(m[1]=0,m[2]=0),m[0]=1,m[3]=1,m}function zg(m,B,K){var bt=B[0],Ot=B[1],Zt=B[2],ie=B[3],De=Math.sin(K),Je=Math.cos(K);return m[0]=bt*Je+Zt*De,m[1]=Ot*Je+ie*De,m[2]=bt*-De+Zt*Je,m[3]=Ot*-De+ie*Je,m}function pd(){var m=new dd(9);return dd!=Float32Array&&(m[1]=0,m[2]=0,m[3]=0,m[5]=0,m[6]=0,m[7]=0),m[0]=1,m[4]=1,m[8]=1,m}function Zm(m,B){var K=Math.sin(B),bt=Math.cos(B);return m[0]=bt,m[1]=K,m[2]=0,m[3]=-K,m[4]=bt,m[5]=0,m[6]=0,m[7]=0,m[8]=1,m}function Cv(){var m=new dd(16);return dd!=Float32Array&&(m[1]=0,m[2]=0,m[3]=0,m[4]=0,m[6]=0,m[7]=0,m[8]=0,m[9]=0,m[11]=0,m[12]=0,m[13]=0,m[14]=0),m[0]=1,m[5]=1,m[10]=1,m[15]=1,m}function Lv(m){var B=new dd(16);return B[0]=m[0],B[1]=m[1],B[2]=m[2],B[3]=m[3],B[4]=m[4],B[5]=m[5],B[6]=m[6],B[7]=m[7],B[8]=m[8],B[9]=m[9],B[10]=m[10],B[11]=m[11],B[12]=m[12],B[13]=m[13],B[14]=m[14],B[15]=m[15],B}function B0(m){return m[0]=1,m[1]=0,m[2]=0,m[3]=0,m[4]=0,m[5]=1,m[6]=0,m[7]=0,m[8]=0,m[9]=0,m[10]=1,m[11]=0,m[12]=0,m[13]=0,m[14]=0,m[15]=1,m}function Ig(m,B){var K=B[0],bt=B[1],Ot=B[2],Zt=B[3],ie=B[4],De=B[5],Je=B[6],vr=B[7],Sr=B[8],Yr=B[9],nn=B[10],pn=B[11],Rn=B[12],pi=B[13],la=B[14],na=B[15],ba=K*De-bt*ie,Fa=K*Je-Ot*ie,ya=K*vr-Zt*ie,Ka=bt*Je-Ot*De,bo=bt*vr-Zt*De,No=Ot*vr-Zt*Je,jo=Sr*pi-Yr*Rn,xs=Sr*la-nn*Rn,_s=Sr*na-pn*Rn,Fs=Yr*la-nn*pi,$s=Yr*na-pn*pi,sl=nn*na-pn*la,Rs=ba*sl-Fa*$s+ya*Fs+Ka*_s-bo*xs+No*jo;return Rs?(Rs=1/Rs,m[0]=(De*sl-Je*$s+vr*Fs)*Rs,m[1]=(Ot*$s-bt*sl-Zt*Fs)*Rs,m[2]=(pi*No-la*bo+na*Ka)*Rs,m[3]=(nn*bo-Yr*No-pn*Ka)*Rs,m[4]=(Je*_s-ie*sl-vr*xs)*Rs,m[5]=(K*sl-Ot*_s+Zt*xs)*Rs,m[6]=(la*ya-Rn*No-na*Fa)*Rs,m[7]=(Sr*No-nn*ya+pn*Fa)*Rs,m[8]=(ie*$s-De*_s+vr*jo)*Rs,m[9]=(bt*_s-K*$s-Zt*jo)*Rs,m[10]=(Rn*bo-pi*ya+na*ba)*Rs,m[11]=(Yr*ya-Sr*bo-pn*ba)*Rs,m[12]=(De*xs-ie*Fs-Je*jo)*Rs,m[13]=(K*Fs-bt*xs+Ot*jo)*Rs,m[14]=(pi*Fa-Rn*Ka-la*ba)*Rs,m[15]=(Sr*Ka-Yr*Fa+nn*ba)*Rs,m):null}function af(m,B,K){var bt=B[0],Ot=B[1],Zt=B[2],ie=B[3],De=B[4],Je=B[5],vr=B[6],Sr=B[7],Yr=B[8],nn=B[9],pn=B[10],Rn=B[11],pi=B[12],la=B[13],na=B[14],ba=B[15],Fa=K[0],ya=K[1],Ka=K[2],bo=K[3];return m[0]=Fa*bt+ya*De+Ka*Yr+bo*pi,m[1]=Fa*Ot+ya*Je+Ka*nn+bo*la,m[2]=Fa*Zt+ya*vr+Ka*pn+bo*na,m[3]=Fa*ie+ya*Sr+Ka*Rn+bo*ba,Fa=K[4],ya=K[5],Ka=K[6],bo=K[7],m[4]=Fa*bt+ya*De+Ka*Yr+bo*pi,m[5]=Fa*Ot+ya*Je+Ka*nn+bo*la,m[6]=Fa*Zt+ya*vr+Ka*pn+bo*na,m[7]=Fa*ie+ya*Sr+Ka*Rn+bo*ba,Fa=K[8],ya=K[9],Ka=K[10],bo=K[11],m[8]=Fa*bt+ya*De+Ka*Yr+bo*pi,m[9]=Fa*Ot+ya*Je+Ka*nn+bo*la,m[10]=Fa*Zt+ya*vr+Ka*pn+bo*na,m[11]=Fa*ie+ya*Sr+Ka*Rn+bo*ba,Fa=K[12],ya=K[13],Ka=K[14],bo=K[15],m[12]=Fa*bt+ya*De+Ka*Yr+bo*pi,m[13]=Fa*Ot+ya*Je+Ka*nn+bo*la,m[14]=Fa*Zt+ya*vr+Ka*pn+bo*na,m[15]=Fa*ie+ya*Sr+Ka*Rn+bo*ba,m}function md(m,B,K){var bt=K[0],Ot=K[1],Zt=K[2],ie,De,Je,vr,Sr,Yr,nn,pn,Rn,pi,la,na;return B===m?(m[12]=B[0]*bt+B[4]*Ot+B[8]*Zt+B[12],m[13]=B[1]*bt+B[5]*Ot+B[9]*Zt+B[13],m[14]=B[2]*bt+B[6]*Ot+B[10]*Zt+B[14],m[15]=B[3]*bt+B[7]*Ot+B[11]*Zt+B[15]):(ie=B[0],De=B[1],Je=B[2],vr=B[3],Sr=B[4],Yr=B[5],nn=B[6],pn=B[7],Rn=B[8],pi=B[9],la=B[10],na=B[11],m[0]=ie,m[1]=De,m[2]=Je,m[3]=vr,m[4]=Sr,m[5]=Yr,m[6]=nn,m[7]=pn,m[8]=Rn,m[9]=pi,m[10]=la,m[11]=na,m[12]=ie*bt+Sr*Ot+Rn*Zt+B[12],m[13]=De*bt+Yr*Ot+pi*Zt+B[13],m[14]=Je*bt+nn*Ot+la*Zt+B[14],m[15]=vr*bt+pn*Ot+na*Zt+B[15]),m}function bc(m,B,K){var bt=K[0],Ot=K[1],Zt=K[2];return m[0]=B[0]*bt,m[1]=B[1]*bt,m[2]=B[2]*bt,m[3]=B[3]*bt,m[4]=B[4]*Ot,m[5]=B[5]*Ot,m[6]=B[6]*Ot,m[7]=B[7]*Ot,m[8]=B[8]*Zt,m[9]=B[9]*Zt,m[10]=B[10]*Zt,m[11]=B[11]*Zt,m[12]=B[12],m[13]=B[13],m[14]=B[14],m[15]=B[15],m}function Og(m,B,K){var bt=Math.sin(K),Ot=Math.cos(K),Zt=B[4],ie=B[5],De=B[6],Je=B[7],vr=B[8],Sr=B[9],Yr=B[10],nn=B[11];return B!==m&&(m[0]=B[0],m[1]=B[1],m[2]=B[2],m[3]=B[3],m[12]=B[12],m[13]=B[13],m[14]=B[14],m[15]=B[15]),m[4]=Zt*Ot+vr*bt,m[5]=ie*Ot+Sr*bt,m[6]=De*Ot+Yr*bt,m[7]=Je*Ot+nn*bt,m[8]=vr*Ot-Zt*bt,m[9]=Sr*Ot-ie*bt,m[10]=Yr*Ot-De*bt,m[11]=nn*Ot-Je*bt,m}function Pv(m,B,K){var bt=Math.sin(K),Ot=Math.cos(K),Zt=B[0],ie=B[1],De=B[2],Je=B[3],vr=B[4],Sr=B[5],Yr=B[6],nn=B[7];return B!==m&&(m[8]=B[8],m[9]=B[9],m[10]=B[10],m[11]=B[11],m[12]=B[12],m[13]=B[13],m[14]=B[14],m[15]=B[15]),m[0]=Zt*Ot+vr*bt,m[1]=ie*Ot+Sr*bt,m[2]=De*Ot+Yr*bt,m[3]=Je*Ot+nn*bt,m[4]=vr*Ot-Zt*bt,m[5]=Sr*Ot-ie*bt,m[6]=Yr*Ot-De*bt,m[7]=nn*Ot-Je*bt,m}function yx(m,B,K,bt,Ot){var Zt=1/Math.tan(B/2),ie;return m[0]=Zt/K,m[1]=0,m[2]=0,m[3]=0,m[4]=0,m[5]=Zt,m[6]=0,m[7]=0,m[8]=0,m[9]=0,m[11]=-1,m[12]=0,m[13]=0,m[15]=0,Ot!=null&&Ot!==1/0?(ie=1/(bt-Ot),m[10]=(Ot+bt)*ie,m[14]=2*Ot*bt*ie):(m[10]=-1,m[14]=-2*bt),m}function zc(m,B,K,bt,Ot,Zt,ie){var De=1/(B-K),Je=1/(bt-Ot),vr=1/(Zt-ie);return m[0]=-2*De,m[1]=0,m[2]=0,m[3]=0,m[4]=0,m[5]=-2*Je,m[6]=0,m[7]=0,m[8]=0,m[9]=0,m[10]=2*vr,m[11]=0,m[12]=(B+K)*De,m[13]=(Ot+bt)*Je,m[14]=(ie+Zt)*vr,m[15]=1,m}var km=af;function xx(){var m=new dd(3);return dd!=Float32Array&&(m[0]=0,m[1]=0,m[2]=0),m}function Dg(m){var B=new dd(3);return B[0]=m[0],B[1]=m[1],B[2]=m[2],B}function N0(m,B,K){return m[0]=B[0]+K[0],m[1]=B[1]+K[1],m[2]=B[2]+K[2],m}function mb(m,B,K){return m[0]=B[0]-K[0],m[1]=B[1]-K[1],m[2]=B[2]-K[2],m}function zv(m,B,K){return m[0]=B[0]*K,m[1]=B[1]*K,m[2]=B[2]*K,m}function CT(m,B){var K=B[0],bt=B[1],Ot=B[2],Zt=K*K+bt*bt+Ot*Ot;return Zt>0&&(Zt=1/Math.sqrt(Zt)),m[0]=B[0]*Zt,m[1]=B[1]*Zt,m[2]=B[2]*Zt,m}function LT(m,B){return m[0]*B[0]+m[1]*B[1]+m[2]*B[2]}function PT(m,B,K){var bt=B[0],Ot=B[1],Zt=B[2],ie=K[0],De=K[1],Je=K[2];return m[0]=Ot*Je-Zt*De,m[1]=Zt*ie-bt*Je,m[2]=bt*De-Ot*ie,m}function zT(m,B,K){var bt=B[0],Ot=B[1],Zt=B[2];return m[0]=bt*K[0]+Ot*K[3]+Zt*K[6],m[1]=bt*K[1]+Ot*K[4]+Zt*K[7],m[2]=bt*K[2]+Ot*K[5]+Zt*K[8],m}var IT=mb;(function(){var m=xx();return function(B,K,bt,Ot,Zt,ie){var De,Je;for(K||(K=3),bt||(bt=0),Ot?Je=Math.min(Ot*K+bt,B.length):Je=B.length,De=bt;De<Je;De+=K)m[0]=B[De],m[1]=B[De+1],m[2]=B[De+2],Zt(m,m,ie),B[De]=m[0],B[De+1]=m[1],B[De+2]=m[2];return B}})();function OT(){var m=new dd(4);return dd!=Float32Array&&(m[0]=0,m[1]=0,m[2]=0,m[3]=0),m}function DT(m,B,K){return m[0]=B[0]*K,m[1]=B[1]*K,m[2]=B[2]*K,m[3]=B[3]*K,m}function FT(m,B){return m[0]*B[0]+m[1]*B[1]+m[2]*B[2]+m[3]*B[3]}function _x(m,B,K){var bt=B[0],Ot=B[1],Zt=B[2],ie=B[3];return m[0]=K[0]*bt+K[4]*Ot+K[8]*Zt+K[12]*ie,m[1]=K[1]*bt+K[5]*Ot+K[9]*Zt+K[13]*ie,m[2]=K[2]*bt+K[6]*Ot+K[10]*Zt+K[14]*ie,m[3]=K[3]*bt+K[7]*Ot+K[11]*Zt+K[15]*ie,m}(function(){var m=OT();return function(B,K,bt,Ot,Zt,ie){var De,Je;for(K||(K=4),bt||(bt=0),Ot?Je=Math.min(Ot*K+bt,B.length):Je=B.length,De=bt;De<Je;De+=K)m[0]=B[De],m[1]=B[De+1],m[2]=B[De+2],m[3]=B[De+3],Zt(m,m,ie),B[De]=m[0],B[De+1]=m[1],B[De+2]=m[2],B[De+3]=m[3];return B}})();function bx(){var m=new dd(2);return dd!=Float32Array&&(m[0]=0,m[1]=0),m}function Iv(m){var B=m[0],K=m[1];return B*B+K*K}var C3=Iv;(function(){var m=bx();return function(B,K,bt,Ot,Zt,ie){var De,Je;for(K||(K=2),bt||(bt=0),Ot?Je=Math.min(Ot*K+bt,B.length):Je=B.length,De=bt;De<Je;De+=K)m[0]=B[De],m[1]=B[De+1],Zt(m,m,ie),B[De]=m[0],B[De+1]=m[1];return B}})();var gb=function(m){function B(K){m.call(this,K,qm)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.createBucket=function(K){return new Ds(K)},B.prototype.queryRadius=function(K){var bt=K;return Mp("circle-radius",this,bt)+Mp("circle-stroke-width",this,bt)+Sp(this.paint.get("circle-translate"))},B.prototype.queryIntersectsFeature=function(K,bt,Ot,Zt,ie,De,Je,vr){for(var Sr=ep(K,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),De.angle,Je),Yr=this.paint.get("circle-radius").evaluate(bt,Ot),nn=this.paint.get("circle-stroke-width").evaluate(bt,Ot),pn=Yr+nn,Rn=this.paint.get("circle-pitch-alignment")==="map",pi=Rn?Sr:RT(Sr,vr),la=Rn?pn*Je:pn,na=0,ba=Zt;na<ba.length;na+=1)for(var Fa=ba[na],ya=0,Ka=Fa;ya<Ka.length;ya+=1){var bo=Ka[ya],No=Rn?bo:wx(bo,vr),jo=la,xs=_x([],[bo.x,bo.y,0,1],vr);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?jo*=xs[3]/De.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(jo*=De.cameraToCenterDistance/xs[3]),nf(pi,No,jo))return!0}return!1},B}(ta);function wx(m,B){var K=_x([],[m.x,m.y,0,1],B);return new o(K[0]/K[3],K[1]/K[3])}function RT(m,B){return m.map(function(K){return wx(K,B)})}var L3=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B}(Ds);sr("HeatmapBucket",L3,{omit:["layers"]});function vb(m,B,K,bt){var Ot=B.width,Zt=B.height;if(!bt)bt=new Uint8Array(Ot*Zt*K);else if(bt instanceof Uint8ClampedArray)bt=new Uint8Array(bt.buffer);else if(bt.length!==Ot*Zt*K)throw new RangeError("mismatched image size");return m.width=Ot,m.height=Zt,m.data=bt,m}function yb(m,B,K){var bt=B.width,Ot=B.height;if(!(bt===m.width&&Ot===m.height)){var Zt=vb({},{width:bt,height:Ot},K);kx(m,Zt,{x:0,y:0},{x:0,y:0},{width:Math.min(m.width,bt),height:Math.min(m.height,Ot)},K),m.width=bt,m.height=Ot,m.data=Zt.data}}function kx(m,B,K,bt,Ot,Zt){if(Ot.width===0||Ot.height===0)return B;if(Ot.width>m.width||Ot.height>m.height||K.x>m.width-Ot.width||K.y>m.height-Ot.height)throw new RangeError("out of range source coordinates for image copy");if(Ot.width>B.width||Ot.height>B.height||bt.x>B.width-Ot.width||bt.y>B.height-Ot.height)throw new RangeError("out of range destination coordinates for image copy");for(var ie=m.data,De=B.data,Je=0;Je<Ot.height;Je++)for(var vr=((K.y+Je)*m.width+K.x)*Zt,Sr=((bt.y+Je)*B.width+bt.x)*Zt,Yr=0;Yr<Ot.width*Zt;Yr++)De[Sr+Yr]=ie[vr+Yr];return B}var Qf=function(m,B){vb(this,m,1,B)};Qf.prototype.resize=function(m){yb(this,m,1)},Qf.prototype.clone=function(){return new Qf({width:this.width,height:this.height},new Uint8Array(this.data))},Qf.copy=function(m,B,K,bt,Ot){kx(m,B,K,bt,Ot,1)};var Zd=function(m,B){vb(this,m,4,B)};Zd.prototype.resize=function(m){yb(this,m,4)},Zd.prototype.replace=function(m,B){B?this.data.set(m):m instanceof Uint8ClampedArray?this.data=new Uint8Array(m.buffer):this.data=m},Zd.prototype.clone=function(){return new Zd({width:this.width,height:this.height},new Uint8Array(this.data))},Zd.copy=function(m,B,K,bt,Ot){kx(m,B,K,bt,Ot,4)},sr("AlphaImage",Qf),sr("RGBAImage",Zd);var P3=new Za({"heatmap-radius":new ni(La.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ni(La.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new gn(La.paint_heatmap["heatmap-intensity"]),"heatmap-color":new va(La.paint_heatmap["heatmap-color"]),"heatmap-opacity":new gn(La.paint_heatmap["heatmap-opacity"])}),$m={paint:P3};function Ov(m){var B={},K=m.resolution||256,bt=m.clips?m.clips.length:1,Ot=m.image||new Zd({width:K,height:bt}),Zt=function(ba,Fa,ya){B[m.evaluationKey]=ya;var Ka=m.expression.evaluate(B);Ot.data[ba+Fa+0]=Math.floor(Ka.r*255/Ka.a),Ot.data[ba+Fa+1]=Math.floor(Ka.g*255/Ka.a),Ot.data[ba+Fa+2]=Math.floor(Ka.b*255/Ka.a),Ot.data[ba+Fa+3]=Math.floor(Ka.a*255)};if(m.clips)for(var ie=0,De=0;ie<bt;++ie,De+=K*4)for(var Je=0,vr=0;Je<K;Je++,vr+=4){var Sr=Je/(K-1),Yr=m.clips[ie],nn=Yr.start,pn=Yr.end,Rn=nn*(1-Sr)+pn*Sr;Zt(De,vr,Rn)}else for(var pi=0,la=0;pi<K;pi++,la+=4){var na=pi/(K-1);Zt(0,la,na)}return Ot}var $1=function(m){function B(K){m.call(this,K,$m),this._updateColorRamp()}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.createBucket=function(K){return new L3(K)},B.prototype._handleSpecialPaintPropertyUpdate=function(K){K==="heatmap-color"&&this._updateColorRamp()},B.prototype._updateColorRamp=function(){var K=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Ov({expression:K,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},B.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},B.prototype.queryRadius=function(){return 0},B.prototype.queryIntersectsFeature=function(){return!1},B.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},B}(ta),Dv=new Za({"hillshade-illumination-direction":new gn(La.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new gn(La.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new gn(La.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new gn(La.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new gn(La.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new gn(La.paint_hillshade["hillshade-accent-color"])}),Tx={paint:Dv},Ax=function(m){function B(K){m.call(this,K,Tx)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},B}(ta),BT=Qn([{name:"a_pos",components:2,type:"Int16"}],4),NT=BT.members,Mx=Sx,z3=Sx;function Sx(m,B,K){K=K||2;var bt=B&&B.length,Ot=bt?B[0]*K:m.length,Zt=xb(m,0,Ot,K,!0),ie=[];if(!Zt||Zt.next===Zt.prev)return ie;var De,Je,vr,Sr,Yr,nn,pn;if(bt&&(Zt=O3(m,B,Zt,K)),m.length>80*K){De=vr=m[0],Je=Sr=m[1];for(var Rn=K;Rn<Ot;Rn+=K)Yr=m[Rn],nn=m[Rn+1],Yr<De&&(De=Yr),nn<Je&&(Je=nn),Yr>vr&&(vr=Yr),nn>Sr&&(Sr=nn);pn=Math.max(vr-De,Sr-Je),pn=pn!==0?1/pn:0}return Fg(Zt,ie,K,De,Je,pn),ie}function xb(m,B,K,bt,Ot){var Zt,ie;if(Ot===Ab(m,B,K,bt)>0)for(Zt=B;Zt<K;Zt+=bt)ie=F3(Zt,m[Zt],m[Zt+1],ie);else for(Zt=K-bt;Zt>=B;Zt-=bt)ie=F3(Zt,m[Zt],m[Zt+1],ie);return ie&&Fv(ie,ie.next)&&(X1(ie),ie=ie.next),ie}function Tm(m,B){if(!m)return m;B||(B=m);var K=m,bt;do if(bt=!1,!K.steiner&&(Fv(K,K.next)||pf(K.prev,K,K.next)===0)){if(X1(K),K=B=K.prev,K===K.next)break;bt=!0}else K=K.next;while(bt||K!==B);return B}function Fg(m,B,K,bt,Ot,Zt,ie){if(m){!ie&&Zt&&bb(m,bt,Ot,Zt);for(var De=m,Je,vr;m.prev!==m.next;){if(Je=m.prev,vr=m.next,Zt?jT(m,bt,Ot,Zt):_b(m)){B.push(Je.i/K),B.push(m.i/K),B.push(vr.i/K),X1(m),m=vr.next,De=vr.next;continue}if(m=vr,m===De){ie?ie===1?(m=UT(Tm(m),B,K),Fg(m,B,K,bt,Ot,Zt,2)):ie===2&&I3(m,B,K,bt,Ot,Zt):Fg(Tm(m),B,K,bt,Ot,Zt,1);break}}}}function _b(m){var B=m.prev,K=m,bt=m.next;if(pf(B,K,bt)>=0)return!1;for(var Ot=m.next.next;Ot!==m.prev;){if(Ym(B.x,B.y,K.x,K.y,bt.x,bt.y,Ot.x,Ot.y)&&pf(Ot.prev,Ot,Ot.next)>=0)return!1;Ot=Ot.next}return!0}function jT(m,B,K,bt){var Ot=m.prev,Zt=m,ie=m.next;if(pf(Ot,Zt,ie)>=0)return!1;for(var De=Ot.x<Zt.x?Ot.x<ie.x?Ot.x:ie.x:Zt.x<ie.x?Zt.x:ie.x,Je=Ot.y<Zt.y?Ot.y<ie.y?Ot.y:ie.y:Zt.y<ie.y?Zt.y:ie.y,vr=Ot.x>Zt.x?Ot.x>ie.x?Ot.x:ie.x:Zt.x>ie.x?Zt.x:ie.x,Sr=Ot.y>Zt.y?Ot.y>ie.y?Ot.y:ie.y:Zt.y>ie.y?Zt.y:ie.y,Yr=wb(De,Je,B,K,bt),nn=wb(vr,Sr,B,K,bt),pn=m.prevZ,Rn=m.nextZ;pn&&pn.z>=Yr&&Rn&&Rn.z<=nn;){if(pn!==m.prev&&pn!==m.next&&Ym(Ot.x,Ot.y,Zt.x,Zt.y,ie.x,ie.y,pn.x,pn.y)&&pf(pn.prev,pn,pn.next)>=0||(pn=pn.prevZ,Rn!==m.prev&&Rn!==m.next&&Ym(Ot.x,Ot.y,Zt.x,Zt.y,ie.x,ie.y,Rn.x,Rn.y)&&pf(Rn.prev,Rn,Rn.next)>=0))return!1;Rn=Rn.nextZ}for(;pn&&pn.z>=Yr;){if(pn!==m.prev&&pn!==m.next&&Ym(Ot.x,Ot.y,Zt.x,Zt.y,ie.x,ie.y,pn.x,pn.y)&&pf(pn.prev,pn,pn.next)>=0)return!1;pn=pn.prevZ}for(;Rn&&Rn.z<=nn;){if(Rn!==m.prev&&Rn!==m.next&&Ym(Ot.x,Ot.y,Zt.x,Zt.y,ie.x,ie.y,Rn.x,Rn.y)&&pf(Rn.prev,Rn,Rn.next)>=0)return!1;Rn=Rn.nextZ}return!0}function UT(m,B,K){var bt=m;do{var Ot=bt.prev,Zt=bt.next.next;!Fv(Ot,Zt)&&Rg(Ot,bt,bt.next,Zt)&&Rv(Ot,Zt)&&Rv(Zt,Ot)&&(B.push(Ot.i/K),B.push(bt.i/K),B.push(Zt.i/K),X1(bt),X1(bt.next),bt=m=Zt),bt=bt.next}while(bt!==m);return Tm(bt)}function I3(m,B,K,bt,Ot,Zt){var ie=m;do{for(var De=ie.next.next;De!==ie.prev;){if(ie.i!==De.i&&HT(ie,De)){var Je=Tb(ie,De);ie=Tm(ie,ie.next),Je=Tm(Je,Je.next),Fg(ie,B,K,bt,Ot,Zt),Fg(Je,B,K,bt,Ot,Zt);return}De=De.next}ie=ie.next}while(ie!==m)}function O3(m,B,K,bt){var Ot=[],Zt,ie,De,Je,vr;for(Zt=0,ie=B.length;Zt<ie;Zt++)De=B[Zt]*bt,Je=Zt<ie-1?B[Zt+1]*bt:m.length,vr=xb(m,De,Je,bt,!1),vr===vr.next&&(vr.steiner=!0),Ot.push(Ex(vr));for(Ot.sort(G1),Zt=0;Zt<Ot.length;Zt++)tm(Ot[Zt],K),K=Tm(K,K.next);return K}function G1(m,B){return m.x-B.x}function tm(m,B){if(B=Gm(m,B),B){var K=Tb(B,m);Tm(B,B.next),Tm(K,K.next)}}function Gm(m,B){var K=B,bt=m.x,Ot=m.y,Zt=-1/0,ie;do{if(Ot<=K.y&&Ot>=K.next.y&&K.next.y!==K.y){var De=K.x+(Ot-K.y)*(K.next.x-K.x)/(K.next.y-K.y);if(De<=bt&&De>Zt){if(Zt=De,De===bt){if(Ot===K.y)return K;if(Ot===K.next.y)return K.next}ie=K.x<K.next.x?K:K.next}}K=K.next}while(K!==B);if(!ie)return null;if(bt===Zt)return ie;var Je=ie,vr=ie.x,Sr=ie.y,Yr=1/0,nn;K=ie;do bt>=K.x&&K.x>=vr&&bt!==K.x&&Ym(Ot<Sr?bt:Zt,Ot,vr,Sr,Ot<Sr?Zt:bt,Ot,K.x,K.y)&&(nn=Math.abs(Ot-K.y)/(bt-K.x),Rv(K,m)&&(nn<Yr||nn===Yr&&(K.x>ie.x||K.x===ie.x&&D3(ie,K)))&&(ie=K,Yr=nn)),K=K.next;while(K!==Je);return ie}function D3(m,B){return pf(m.prev,m,B.prev)<0&&pf(B.next,m,m.next)<0}function bb(m,B,K,bt){var Ot=m;do Ot.z===null&&(Ot.z=wb(Ot.x,Ot.y,B,K,bt)),Ot.prevZ=Ot.prev,Ot.nextZ=Ot.next,Ot=Ot.next;while(Ot!==m);Ot.prevZ.nextZ=null,Ot.prevZ=null,VT(Ot)}function VT(m){var B,K,bt,Ot,Zt,ie,De,Je,vr=1;do{for(K=m,m=null,Zt=null,ie=0;K;){for(ie++,bt=K,De=0,B=0;B<vr&&(De++,bt=bt.nextZ,!!bt);B++);for(Je=vr;De>0||Je>0&&bt;)De!==0&&(Je===0||!bt||K.z<=bt.z)?(Ot=K,K=K.nextZ,De--):(Ot=bt,bt=bt.nextZ,Je--),Zt?Zt.nextZ=Ot:m=Ot,Ot.prevZ=Zt,Zt=Ot;K=bt}Zt.nextZ=null,vr*=2}while(ie>1);return m}function wb(m,B,K,bt,Ot){return m=32767*(m-K)*Ot,B=32767*(B-bt)*Ot,m=(m|m<<8)&16711935,m=(m|m<<4)&252645135,m=(m|m<<2)&858993459,m=(m|m<<1)&1431655765,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,m|B<<1}function Ex(m){var B=m,K=m;do(B.x<K.x||B.x===K.x&&B.y<K.y)&&(K=B),B=B.next;while(B!==m);return K}function Ym(m,B,K,bt,Ot,Zt,ie,De){return(Ot-ie)*(B-De)-(m-ie)*(Zt-De)>=0&&(m-ie)*(bt-De)-(K-ie)*(B-De)>=0&&(K-ie)*(Zt-De)-(Ot-ie)*(bt-De)>=0}function HT(m,B){return m.next.i!==B.i&&m.prev.i!==B.i&&!kb(m,B)&&(Rv(m,B)&&Rv(B,m)&&Cx(m,B)&&(pf(m.prev,m,B.prev)||pf(m,B.prev,B))||Fv(m,B)&&pf(m.prev,m,m.next)>0&&pf(B.prev,B,B.next)>0)}function pf(m,B,K){return(B.y-m.y)*(K.x-B.x)-(B.x-m.x)*(K.y-B.y)}function Fv(m,B){return m.x===B.x&&m.y===B.y}function Rg(m,B,K,bt){var Ot=K1(pf(m,B,K)),Zt=K1(pf(m,B,bt)),ie=K1(pf(K,bt,m)),De=K1(pf(K,bt,B));return!!(Ot!==Zt&&ie!==De||Ot===0&&Y1(m,K,B)||Zt===0&&Y1(m,bt,B)||ie===0&&Y1(K,m,bt)||De===0&&Y1(K,B,bt))}function Y1(m,B,K){return B.x<=Math.max(m.x,K.x)&&B.x>=Math.min(m.x,K.x)&&B.y<=Math.max(m.y,K.y)&&B.y>=Math.min(m.y,K.y)}function K1(m){return m>0?1:m<0?-1:0}function kb(m,B){var K=m;do{if(K.i!==m.i&&K.next.i!==m.i&&K.i!==B.i&&K.next.i!==B.i&&Rg(K,K.next,m,B))return!0;K=K.next}while(K!==m);return!1}function Rv(m,B){return pf(m.prev,m,m.next)<0?pf(m,B,m.next)>=0&&pf(m,m.prev,B)>=0:pf(m,B,m.prev)<0||pf(m,m.next,B)<0}function Cx(m,B){var K=m,bt=!1,Ot=(m.x+B.x)/2,Zt=(m.y+B.y)/2;do K.y>Zt!=K.next.y>Zt&&K.next.y!==K.y&&Ot<(K.next.x-K.x)*(Zt-K.y)/(K.next.y-K.y)+K.x&&(bt=!bt),K=K.next;while(K!==m);return bt}function Tb(m,B){var K=new Lx(m.i,m.x,m.y),bt=new Lx(B.i,B.x,B.y),Ot=m.next,Zt=B.prev;return m.next=B,B.prev=m,K.next=Ot,Ot.prev=K,bt.next=K,K.prev=bt,Zt.next=bt,bt.prev=Zt,bt}function F3(m,B,K,bt){var Ot=new Lx(m,B,K);return bt?(Ot.next=bt.next,Ot.prev=bt,bt.next.prev=Ot,bt.next=Ot):(Ot.prev=Ot,Ot.next=Ot),Ot}function X1(m){m.next.prev=m.prev,m.prev.next=m.next,m.prevZ&&(m.prevZ.nextZ=m.nextZ),m.nextZ&&(m.nextZ.prevZ=m.prevZ)}function Lx(m,B,K){this.i=m,this.x=B,this.y=K,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Sx.deviation=function(m,B,K,bt){var Ot=B&&B.length,Zt=Ot?B[0]*K:m.length,ie=Math.abs(Ab(m,0,Zt,K));if(Ot)for(var De=0,Je=B.length;De<Je;De++){var vr=B[De]*K,Sr=De<Je-1?B[De+1]*K:m.length;ie-=Math.abs(Ab(m,vr,Sr,K))}var Yr=0;for(De=0;De<bt.length;De+=3){var nn=bt[De]*K,pn=bt[De+1]*K,Rn=bt[De+2]*K;Yr+=Math.abs((m[nn]-m[Rn])*(m[pn+1]-m[nn+1])-(m[nn]-m[pn])*(m[Rn+1]-m[nn+1]))}return ie===0&&Yr===0?0:Math.abs((Yr-ie)/ie)};function Ab(m,B,K,bt){for(var Ot=0,Zt=B,ie=K-bt;Zt<K;Zt+=bt)Ot+=(m[ie]-m[Zt])*(m[Zt+1]+m[ie+1]),ie=Zt;return Ot}Sx.flatten=function(m){for(var B=m[0][0].length,K={vertices:[],holes:[],dimensions:B},bt=0,Ot=0;Ot<m.length;Ot++){for(var Zt=0;Zt<m[Ot].length;Zt++)for(var ie=0;ie<B;ie++)K.vertices.push(m[Ot][Zt][ie]);Ot>0&&(bt+=m[Ot-1].length,K.holes.push(bt))}return K},Mx.default=z3;function WT(m,B,K,bt,Ot){R3(m,B,K,bt||m.length-1,Ot||Mb)}function R3(m,B,K,bt,Ot){for(;bt>K;){if(bt-K>600){var Zt=bt-K+1,ie=B-K+1,De=Math.log(Zt),Je=.5*Math.exp(2*De/3),vr=.5*Math.sqrt(De*Je*(Zt-Je)/Zt)*(ie-Zt/2<0?-1:1),Sr=Math.max(K,Math.floor(B-ie*Je/Zt+vr)),Yr=Math.min(bt,Math.floor(B+(Zt-ie)*Je/Zt+vr));R3(m,B,Sr,Yr,Ot)}var nn=m[B],pn=K,Rn=bt;for(J1(m,K,B),Ot(m[bt],nn)>0&&J1(m,K,bt);pn<Rn;){for(J1(m,pn,Rn),pn++,Rn--;Ot(m[pn],nn)<0;)pn++;for(;Ot(m[Rn],nn)>0;)Rn--}Ot(m[K],nn)===0?J1(m,K,Rn):(Rn++,J1(m,Rn,bt)),Rn<=B&&(K=Rn+1),B<=Rn&&(bt=Rn-1)}}function J1(m,B,K){var bt=m[B];m[B]=m[K],m[K]=bt}function Mb(m,B){return m<B?-1:m>B?1:0}function em(m,B){var K=m.length;if(K<=1)return[m];for(var bt=[],Ot,Zt,ie=0;ie<K;ie++){var De=lt(m[ie]);De!==0&&(m[ie].area=Math.abs(De),Zt===void 0&&(Zt=De<0),Zt===De<0?(Ot&&bt.push(Ot),Ot=[m[ie]]):Ot.push(m[ie]))}if(Ot&&bt.push(Ot),B>1)for(var Je=0;Je<bt.length;Je++)bt[Je].length<=B||(WT(bt[Je],B,1,bt[Je].length-1,B3),bt[Je]=bt[Je].slice(0,B));return bt}function B3(m,B){return B.area-m.area}function Px(m,B,K){for(var bt=K.patternDependencies,Ot=!1,Zt=0,ie=B;Zt<ie.length;Zt+=1){var De=ie[Zt],Je=De.paint.get(m+"-pattern");Je.isConstant()||(Ot=!0);var vr=Je.constantOr(null);vr&&(Ot=!0,bt[vr.to]=!0,bt[vr.from]=!0)}return Ot}function zx(m,B,K,bt,Ot){for(var Zt=Ot.patternDependencies,ie=0,De=B;ie<De.length;ie+=1){var Je=De[ie],vr=Je.paint.get(m+"-pattern"),Sr=vr.value;if(Sr.kind!=="constant"){var Yr=Sr.evaluate({zoom:bt-1},K,{},Ot.availableImages),nn=Sr.evaluate({zoom:bt},K,{},Ot.availableImages),pn=Sr.evaluate({zoom:bt+1},K,{},Ot.availableImages);Yr=Yr&&Yr.name?Yr.name:Yr,nn=nn&&nn.name?nn.name:nn,pn=pn&&pn.name?pn.name:pn,Zt[Yr]=!0,Zt[nn]=!0,Zt[pn]=!0,K.patterns[Je.id]={min:Yr,mid:nn,max:pn}}}return K}var N3=500,w0=function(m){this.zoom=m.zoom,this.overscaling=m.overscaling,this.layers=m.layers,this.layerIds=this.layers.map(function(B){return B.id}),this.index=m.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ua,this.indexArray=new So,this.indexArray2=new fl,this.programConfigurations=new Si(m.layers,m.zoom),this.segments=new yl,this.segments2=new yl,this.stateDependentLayerIds=this.layers.filter(function(B){return B.isStateDependent()}).map(function(B){return B.id})};w0.prototype.populate=function(m,B,K){this.hasPattern=Px("fill",this.layers,B);for(var bt=this.layers[0].layout.get("fill-sort-key"),Ot=[],Zt=0,ie=m;Zt<ie.length;Zt+=1){var De=ie[Zt],Je=De.feature,vr=De.id,Sr=De.index,Yr=De.sourceLayerIndex,nn=this.layers[0]._featureFilter.needGeometry,pn=Ul(Je,nn);if(this.layers[0]._featureFilter.filter(new Bl(this.zoom),pn,K)){var Rn=bt?bt.evaluate(pn,{},K,B.availableImages):void 0,pi={id:vr,properties:Je.properties,type:Je.type,sourceLayerIndex:Yr,index:Sr,geometry:nn?pn.geometry:dl(Je),patterns:{},sortKey:Rn};Ot.push(pi)}}bt&&Ot.sort(function(xs,_s){return xs.sortKey-_s.sortKey});for(var la=0,na=Ot;la<na.length;la+=1){var ba=na[la],Fa=ba,ya=Fa.geometry,Ka=Fa.index,bo=Fa.sourceLayerIndex;if(this.hasPattern){var No=zx("fill",this.layers,ba,this.zoom,B);this.patternFeatures.push(No)}else this.addFeature(ba,ya,Ka,K,{});var jo=m[Ka].feature;B.featureIndex.insert(jo,ya,Ka,bo,this.index)}},w0.prototype.update=function(m,B,K){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(m,B,this.stateDependentLayers,K)},w0.prototype.addFeatures=function(m,B,K){for(var bt=0,Ot=this.patternFeatures;bt<Ot.length;bt+=1){var Zt=Ot[bt];this.addFeature(Zt,Zt.geometry,Zt.index,B,K)}},w0.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},w0.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},w0.prototype.upload=function(m){this.uploaded||(this.layoutVertexBuffer=m.createVertexBuffer(this.layoutVertexArray,NT),this.indexBuffer=m.createIndexBuffer(this.indexArray),this.indexBuffer2=m.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(m),this.uploaded=!0},w0.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},w0.prototype.addFeature=function(m,B,K,bt,Ot){for(var Zt=0,ie=em(B,N3);Zt<ie.length;Zt+=1){for(var De=ie[Zt],Je=0,vr=0,Sr=De;vr<Sr.length;vr+=1){var Yr=Sr[vr];Je+=Yr.length}for(var nn=this.segments.prepareSegment(Je,this.layoutVertexArray,this.indexArray),pn=nn.vertexLength,Rn=[],pi=[],la=0,na=De;la<na.length;la+=1){var ba=na[la];if(ba.length!==0){ba!==De[0]&&pi.push(Rn.length/2);var Fa=this.segments2.prepareSegment(ba.length,this.layoutVertexArray,this.indexArray2),ya=Fa.vertexLength;this.layoutVertexArray.emplaceBack(ba[0].x,ba[0].y),this.indexArray2.emplaceBack(ya+ba.length-1,ya),Rn.push(ba[0].x),Rn.push(ba[0].y);for(var Ka=1;Ka<ba.length;Ka++)this.layoutVertexArray.emplaceBack(ba[Ka].x,ba[Ka].y),this.indexArray2.emplaceBack(ya+Ka-1,ya+Ka),Rn.push(ba[Ka].x),Rn.push(ba[Ka].y);Fa.vertexLength+=ba.length,Fa.primitiveLength+=ba.length}}for(var bo=Mx(Rn,pi),No=0;No<bo.length;No+=3)this.indexArray.emplaceBack(pn+bo[No],pn+bo[No+1],pn+bo[No+2]);nn.vertexLength+=Je,nn.primitiveLength+=bo.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,m,K,Ot,bt)},sr("FillBucket",w0,{omit:["layers","patternFeatures"]});var Sb=new Za({"fill-sort-key":new ni(La.layout_fill["fill-sort-key"])}),Q1=new Za({"fill-antialias":new gn(La.paint_fill["fill-antialias"]),"fill-opacity":new ni(La.paint_fill["fill-opacity"]),"fill-color":new ni(La.paint_fill["fill-color"]),"fill-outline-color":new ni(La.paint_fill["fill-outline-color"]),"fill-translate":new gn(La.paint_fill["fill-translate"]),"fill-translate-anchor":new gn(La.paint_fill["fill-translate-anchor"]),"fill-pattern":new Yi(La.paint_fill["fill-pattern"])}),j3={paint:Q1,layout:Sb},Eb=function(m){function B(K){m.call(this,K,j3)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.recalculate=function(K,bt){m.prototype.recalculate.call(this,K,bt);var Ot=this.paint._values["fill-outline-color"];Ot.value.kind==="constant"&&Ot.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},B.prototype.createBucket=function(K){return new w0(K)},B.prototype.queryRadius=function(){return Sp(this.paint.get("fill-translate"))},B.prototype.queryIntersectsFeature=function(K,bt,Ot,Zt,ie,De,Je){var vr=ep(K,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),De.angle,Je);return zf(vr,Zt)},B.prototype.isTileClipped=function(){return!0},B}(ta),U3=Qn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),l0=U3.members,Bv=Bg;function Bg(m,B,K,bt,Ot){this.properties={},this.extent=K,this.type=0,this._pbf=m,this._geometry=-1,this._keys=bt,this._values=Ot,m.readFields(V3,this,B)}function V3(m,B,K){m==1?B.id=K.readVarint():m==2?H3(K,B):m==3?B.type=K.readVarint():m==4&&(B._geometry=K.pos)}function H3(m,B){for(var K=m.readVarint()+m.pos;m.pos<K;){var bt=B._keys[m.readVarint()],Ot=B._values[m.readVarint()];B.properties[bt]=Ot}}Bg.types=["Unknown","Point","LineString","Polygon"],Bg.prototype.loadGeometry=function(){var m=this._pbf;m.pos=this._geometry;for(var B=m.readVarint()+m.pos,K=1,bt=0,Ot=0,Zt=0,ie=[],De;m.pos<B;){if(bt<=0){var Je=m.readVarint();K=Je&7,bt=Je>>3}if(bt--,K===1||K===2)Ot+=m.readSVarint(),Zt+=m.readSVarint(),K===1&&(De&&ie.push(De),De=[]),De.push(new o(Ot,Zt));else if(K===7)De&&De.push(De[0].clone());else throw new Error("unknown command "+K)}return De&&ie.push(De),ie},Bg.prototype.bbox=function(){var m=this._pbf;m.pos=this._geometry;for(var B=m.readVarint()+m.pos,K=1,bt=0,Ot=0,Zt=0,ie=1/0,De=-1/0,Je=1/0,vr=-1/0;m.pos<B;){if(bt<=0){var Sr=m.readVarint();K=Sr&7,bt=Sr>>3}if(bt--,K===1||K===2)Ot+=m.readSVarint(),Zt+=m.readSVarint(),Ot<ie&&(ie=Ot),Ot>De&&(De=Ot),Zt<Je&&(Je=Zt),Zt>vr&&(vr=Zt);else if(K!==7)throw new Error("unknown command "+K)}return[ie,Je,De,vr]},Bg.prototype.toGeoJSON=function(m,B,K){var bt=this.extent*Math.pow(2,K),Ot=this.extent*m,Zt=this.extent*B,ie=this.loadGeometry(),De=Bg.types[this.type],Je,vr;function Sr(pn){for(var Rn=0;Rn<pn.length;Rn++){var pi=pn[Rn],la=180-(pi.y+Zt)*360/bt;pn[Rn]=[(pi.x+Ot)*360/bt-180,360/Math.PI*Math.atan(Math.exp(la*Math.PI/180))-90]}}switch(this.type){case 1:var Yr=[];for(Je=0;Je<ie.length;Je++)Yr[Je]=ie[Je][0];ie=Yr,Sr(ie);break;case 2:for(Je=0;Je<ie.length;Je++)Sr(ie[Je]);break;case 3:for(ie=W3(ie),Je=0;Je<ie.length;Je++)for(vr=0;vr<ie[Je].length;vr++)Sr(ie[Je][vr]);break}ie.length===1?ie=ie[0]:De="Multi"+De;var nn={type:"Feature",geometry:{type:De,coordinates:ie},properties:this.properties};return"id"in this&&(nn.id=this.id),nn};function W3(m){var B=m.length;if(B<=1)return[m];for(var K=[],bt,Ot,Zt=0;Zt<B;Zt++){var ie=q3(m[Zt]);ie!==0&&(Ot===void 0&&(Ot=ie<0),Ot===ie<0?(bt&&K.push(bt),bt=[m[Zt]]):bt.push(m[Zt]))}return bt&&K.push(bt),K}function q3(m){for(var B=0,K=0,bt=m.length,Ot=bt-1,Zt,ie;K<bt;Ot=K++)Zt=m[K],ie=m[Ot],B+=(ie.x-Zt.x)*(Zt.y+ie.y);return B}var Cb=Z3;function Z3(m,B){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=m,this._keys=[],this._values=[],this._features=[],m.readFields($3,this,B),this.length=this._features.length}function $3(m,B,K){m===15?B.version=K.readVarint():m===1?B.name=K.readString():m===5?B.extent=K.readVarint():m===2?B._features.push(K.pos):m===3?B._keys.push(K.readString()):m===4&&B._values.push(Km(K))}function Km(m){for(var B=null,K=m.readVarint()+m.pos;m.pos<K;){var bt=m.readVarint()>>3;B=bt===1?m.readString():bt===2?m.readFloat():bt===3?m.readDouble():bt===4?m.readVarint64():bt===5?m.readVarint():bt===6?m.readSVarint():bt===7?m.readBoolean():null}return B}Z3.prototype.feature=function(m){if(m<0||m>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[m];var B=this._pbf.readVarint()+this._pbf.pos;return new Bv(this._pbf,B,this.extent,this._keys,this._values)};var G3=Y3;function Y3(m,B){this.layers=m.readFields(K3,{},B)}function K3(m,B,K){if(m===3){var bt=new Cb(K,K.readVarint()+K.pos);bt.length&&(B[bt.name]=bt)}}var X3=G3,qT=Bv,ZT=Cb,Ng={VectorTile:X3,VectorTileFeature:qT,VectorTileLayer:ZT},Nv=Ng.VectorTileFeature.types,J3=500,jv=Math.pow(2,13);function Uv(m,B,K,bt,Ot,Zt,ie,De){m.emplaceBack(B,K,Math.floor(bt*jv)*2+ie,Ot*jv*2,Zt*jv*2,Math.round(De))}var jp=function(m){this.zoom=m.zoom,this.overscaling=m.overscaling,this.layers=m.layers,this.layerIds=this.layers.map(function(B){return B.id}),this.index=m.index,this.hasPattern=!1,this.layoutVertexArray=new ti,this.indexArray=new So,this.programConfigurations=new Si(m.layers,m.zoom),this.segments=new yl,this.stateDependentLayerIds=this.layers.filter(function(B){return B.isStateDependent()}).map(function(B){return B.id})};jp.prototype.populate=function(m,B,K){this.features=[],this.hasPattern=Px("fill-extrusion",this.layers,B);for(var bt=0,Ot=m;bt<Ot.length;bt+=1){var Zt=Ot[bt],ie=Zt.feature,De=Zt.id,Je=Zt.index,vr=Zt.sourceLayerIndex,Sr=this.layers[0]._featureFilter.needGeometry,Yr=Ul(ie,Sr);if(this.layers[0]._featureFilter.filter(new Bl(this.zoom),Yr,K)){var nn={id:De,sourceLayerIndex:vr,index:Je,geometry:Sr?Yr.geometry:dl(ie),properties:ie.properties,type:ie.type,patterns:{}};this.hasPattern?this.features.push(zx("fill-extrusion",this.layers,nn,this.zoom,B)):this.addFeature(nn,nn.geometry,Je,K,{}),B.featureIndex.insert(ie,nn.geometry,Je,vr,this.index,!0)}}},jp.prototype.addFeatures=function(m,B,K){for(var bt=0,Ot=this.features;bt<Ot.length;bt+=1){var Zt=Ot[bt],ie=Zt.geometry;this.addFeature(Zt,ie,Zt.index,B,K)}},jp.prototype.update=function(m,B,K){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(m,B,this.stateDependentLayers,K)},jp.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},jp.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},jp.prototype.upload=function(m){this.uploaded||(this.layoutVertexBuffer=m.createVertexBuffer(this.layoutVertexArray,l0),this.indexBuffer=m.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(m),this.uploaded=!0},jp.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},jp.prototype.addFeature=function(m,B,K,bt,Ot){for(var Zt=0,ie=em(B,J3);Zt<ie.length;Zt+=1){for(var De=ie[Zt],Je=0,vr=0,Sr=De;vr<Sr.length;vr+=1){var Yr=Sr[vr];Je+=Yr.length}for(var nn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),pn=0,Rn=De;pn<Rn.length;pn+=1){var pi=Rn[pn];if(pi.length!==0&&!Ox(pi))for(var la=0,na=0;na<pi.length;na++){var ba=pi[na];if(na>=1){var Fa=pi[na-1];if(!Ix(ba,Fa)){nn.vertexLength+4>yl.MAX_VERTEX_ARRAY_LENGTH&&(nn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var ya=ba.sub(Fa)._perp()._unit(),Ka=Fa.dist(ba);la+Ka>32768&&(la=0),Uv(this.layoutVertexArray,ba.x,ba.y,ya.x,ya.y,0,0,la),Uv(this.layoutVertexArray,ba.x,ba.y,ya.x,ya.y,0,1,la),la+=Ka,Uv(this.layoutVertexArray,Fa.x,Fa.y,ya.x,ya.y,0,0,la),Uv(this.layoutVertexArray,Fa.x,Fa.y,ya.x,ya.y,0,1,la);var bo=nn.vertexLength;this.indexArray.emplaceBack(bo,bo+2,bo+1),this.indexArray.emplaceBack(bo+1,bo+2,bo+3),nn.vertexLength+=4,nn.primitiveLength+=2}}}}if(nn.vertexLength+Je>yl.MAX_VERTEX_ARRAY_LENGTH&&(nn=this.segments.prepareSegment(Je,this.layoutVertexArray,this.indexArray)),Nv[m.type]==="Polygon"){for(var No=[],jo=[],xs=nn.vertexLength,_s=0,Fs=De;_s<Fs.length;_s+=1){var $s=Fs[_s];if($s.length!==0){$s!==De[0]&&jo.push(No.length/2);for(var sl=0;sl<$s.length;sl++){var Rs=$s[sl];Uv(this.layoutVertexArray,Rs.x,Rs.y,0,0,1,1,0),No.push(Rs.x),No.push(Rs.y)}}}for(var Us=Mx(No,jo),Bu=0;Bu<Us.length;Bu+=3)this.indexArray.emplaceBack(xs+Us[Bu],xs+Us[Bu+2],xs+Us[Bu+1]);nn.primitiveLength+=Us.length/3,nn.vertexLength+=Je}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,m,K,Ot,bt)},sr("FillExtrusionBucket",jp,{omit:["layers","features"]});function Ix(m,B){return m.x===B.x&&(m.x<0||m.x>Vo)||m.y===B.y&&(m.y<0||m.y>Vo)}function Ox(m){return m.every(function(B){return B.x<0})||m.every(function(B){return B.x>Vo})||m.every(function(B){return B.y<0})||m.every(function(B){return B.y>Vo})}var $T=new Za({"fill-extrusion-opacity":new gn(La["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ni(La["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new gn(La["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new gn(La["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Yi(La["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ni(La["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ni(La["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new gn(La["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),GT={paint:$T},YT=function(m){function B(K){m.call(this,K,GT)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.createBucket=function(K){return new jp(K)},B.prototype.queryRadius=function(){return Sp(this.paint.get("fill-extrusion-translate"))},B.prototype.is3D=function(){return!0},B.prototype.queryIntersectsFeature=function(K,bt,Ot,Zt,ie,De,Je,vr){var Sr=ep(K,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),De.angle,Je),Yr=this.paint.get("fill-extrusion-height").evaluate(bt,Ot),nn=this.paint.get("fill-extrusion-base").evaluate(bt,Ot),pn=Q3(Sr,vr,De,0),Rn=Lb(Zt,nn,Yr,vr),pi=Rn[0],la=Rn[1];return Xm(pi,la,pn)},B}(ta);function rm(m,B){return m.x*B.x+m.y*B.y}function Id(m,B){if(m.length===1){for(var K=0,bt=B[K++],Ot;!Ot||bt.equals(Ot);)if(Ot=B[K++],!Ot)return 1/0;for(;K<B.length;K++){var Zt=B[K],ie=m[0],De=Ot.sub(bt),Je=Zt.sub(bt),vr=ie.sub(bt),Sr=rm(De,De),Yr=rm(De,Je),nn=rm(Je,Je),pn=rm(vr,De),Rn=rm(vr,Je),pi=Sr*nn-Yr*Yr,la=(nn*pn-Yr*Rn)/pi,na=(Sr*Rn-Yr*pn)/pi,ba=1-la-na,Fa=bt.z*ba+Ot.z*la+Zt.z*na;if(isFinite(Fa))return Fa}return 1/0}else{for(var ya=1/0,Ka=0,bo=B;Ka<bo.length;Ka+=1){var No=bo[Ka];ya=Math.min(ya,No.z)}return ya}}function Xm(m,B,K){var bt=1/0;zf(K,B)&&(bt=Id(K,B[0]));for(var Ot=0;Ot<B.length;Ot++)for(var Zt=B[Ot],ie=m[Ot],De=0;De<Zt.length-1;De++){var Je=Zt[De],vr=Zt[De+1],Sr=ie[De],Yr=ie[De+1],nn=[Je,vr,Yr,Sr,Je];Au(K,nn)&&(bt=Math.min(bt,Id(K,nn)))}return bt===1/0?!1:bt}function Lb(m,B,K,bt){for(var Ot=[],Zt=[],ie=bt[8]*B,De=bt[9]*B,Je=bt[10]*B,vr=bt[11]*B,Sr=bt[8]*K,Yr=bt[9]*K,nn=bt[10]*K,pn=bt[11]*K,Rn=0,pi=m;Rn<pi.length;Rn+=1){for(var la=pi[Rn],na=[],ba=[],Fa=0,ya=la;Fa<ya.length;Fa+=1){var Ka=ya[Fa],bo=Ka.x,No=Ka.y,jo=bt[0]*bo+bt[4]*No+bt[12],xs=bt[1]*bo+bt[5]*No+bt[13],_s=bt[2]*bo+bt[6]*No+bt[14],Fs=bt[3]*bo+bt[7]*No+bt[15],$s=jo+ie,sl=xs+De,Rs=_s+Je,Us=Fs+vr,Bu=jo+Sr,Oc=xs+Yr,hh=_s+nn,Xu=Fs+pn,Dc=new o($s/Us,sl/Us);Dc.z=Rs/Us,na.push(Dc);var Nu=new o(Bu/Xu,Oc/Xu);Nu.z=hh/Xu,ba.push(Nu)}Ot.push(na),Zt.push(ba)}return[Ot,Zt]}function Q3(m,B,K,bt){for(var Ot=[],Zt=0,ie=m;Zt<ie.length;Zt+=1){var De=ie[Zt],Je=[De.x,De.y,bt,1];_x(Je,Je,B),Ot.push(new o(Je[0]/Je[3],Je[1]/Je[3]))}return Ot}var t5=Qn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),Pb=t5.members,KT=Qn([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),e5=KT.members,r5=Ng.VectorTileFeature.types,n5=63,i5=Math.cos(75/2*(Math.PI/180)),zb=15,Ib=20,a5=15,Vv=1/2,Dx=Math.pow(2,a5-1)/Vv,$d=function(m){var B=this;this.zoom=m.zoom,this.overscaling=m.overscaling,this.layers=m.layers,this.layerIds=this.layers.map(function(K){return K.id}),this.index=m.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(K){B.gradients[K.id]={}}),this.layoutVertexArray=new Sa,this.layoutVertexArray2=new pa,this.indexArray=new So,this.programConfigurations=new Si(m.layers,m.zoom),this.segments=new yl,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(K){return K.isStateDependent()}).map(function(K){return K.id})};$d.prototype.populate=function(m,B,K){this.hasPattern=Px("line",this.layers,B);for(var bt=this.layers[0].layout.get("line-sort-key"),Ot=[],Zt=0,ie=m;Zt<ie.length;Zt+=1){var De=ie[Zt],Je=De.feature,vr=De.id,Sr=De.index,Yr=De.sourceLayerIndex,nn=this.layers[0]._featureFilter.needGeometry,pn=Ul(Je,nn);if(this.layers[0]._featureFilter.filter(new Bl(this.zoom),pn,K)){var Rn=bt?bt.evaluate(pn,{},K):void 0,pi={id:vr,properties:Je.properties,type:Je.type,sourceLayerIndex:Yr,index:Sr,geometry:nn?pn.geometry:dl(Je),patterns:{},sortKey:Rn};Ot.push(pi)}}bt&&Ot.sort(function(xs,_s){return xs.sortKey-_s.sortKey});for(var la=0,na=Ot;la<na.length;la+=1){var ba=na[la],Fa=ba,ya=Fa.geometry,Ka=Fa.index,bo=Fa.sourceLayerIndex;if(this.hasPattern){var No=zx("line",this.layers,ba,this.zoom,B);this.patternFeatures.push(No)}else this.addFeature(ba,ya,Ka,K,{});var jo=m[Ka].feature;B.featureIndex.insert(jo,ya,Ka,bo,this.index)}},$d.prototype.update=function(m,B,K){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(m,B,this.stateDependentLayers,K)},$d.prototype.addFeatures=function(m,B,K){for(var bt=0,Ot=this.patternFeatures;bt<Ot.length;bt+=1){var Zt=Ot[bt];this.addFeature(Zt,Zt.geometry,Zt.index,B,K)}},$d.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},$d.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},$d.prototype.upload=function(m){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=m.createVertexBuffer(this.layoutVertexArray2,e5)),this.layoutVertexBuffer=m.createVertexBuffer(this.layoutVertexArray,Pb),this.indexBuffer=m.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(m),this.uploaded=!0},$d.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},$d.prototype.lineFeatureClips=function(m){if(m.properties&&m.properties.hasOwnProperty("mapbox_clip_start")&&m.properties.hasOwnProperty("mapbox_clip_end")){var B=+m.properties.mapbox_clip_start,K=+m.properties.mapbox_clip_end;return{start:B,end:K}}},$d.prototype.addFeature=function(m,B,K,bt,Ot){var Zt=this.layers[0].layout,ie=Zt.get("line-join").evaluate(m,{}),De=Zt.get("line-cap"),Je=Zt.get("line-miter-limit"),vr=Zt.get("line-round-limit");this.lineClips=this.lineFeatureClips(m);for(var Sr=0,Yr=B;Sr<Yr.length;Sr+=1){var nn=Yr[Sr];this.addLine(nn,m,ie,De,Je,vr)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,m,K,Ot,bt)},$d.prototype.addLine=function(m,B,K,bt,Ot,Zt){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var ie=0;ie<m.length-1;ie++)this.totalDistance+=m[ie].dist(m[ie+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var De=r5[B.type]==="Polygon",Je=m.length;Je>=2&&m[Je-1].equals(m[Je-2]);)Je--;for(var vr=0;vr<Je-1&&m[vr].equals(m[vr+1]);)vr++;if(!(Je<(De?3:2))){K==="bevel"&&(Ot=1.05);var Sr=this.overscaling<=16?zb*Vo/(512*this.overscaling):0,Yr=this.segments.prepareSegment(Je*10,this.layoutVertexArray,this.indexArray),nn,pn=void 0,Rn=void 0,pi=void 0,la=void 0;this.e1=this.e2=-1,De&&(nn=m[Je-2],la=m[vr].sub(nn)._unit()._perp());for(var na=vr;na<Je;na++)if(Rn=na===Je-1?De?m[vr+1]:void 0:m[na+1],!(Rn&&m[na].equals(Rn))){la&&(pi=la),nn&&(pn=nn),nn=m[na],la=Rn?Rn.sub(nn)._unit()._perp():pi,pi=pi||la;var ba=pi.add(la);(ba.x!==0||ba.y!==0)&&ba._unit();var Fa=pi.x*la.x+pi.y*la.y,ya=ba.x*la.x+ba.y*la.y,Ka=ya!==0?1/ya:1/0,bo=2*Math.sqrt(2-2*ya),No=ya<i5&&pn&&Rn,jo=pi.x*la.y-pi.y*la.x>0;if(No&&na>vr){var xs=nn.dist(pn);if(xs>2*Sr){var _s=nn.sub(nn.sub(pn)._mult(Sr/xs)._round());this.updateDistance(pn,_s),this.addCurrentVertex(_s,pi,0,0,Yr),pn=_s}}var Fs=pn&&Rn,$s=Fs?K:De?"butt":bt;if(Fs&&$s==="round"&&(Ka<Zt?$s="miter":Ka<=2&&($s="fakeround")),$s==="miter"&&Ka>Ot&&($s="bevel"),$s==="bevel"&&(Ka>2&&($s="flipbevel"),Ka<Ot&&($s="miter")),pn&&this.updateDistance(pn,nn),$s==="miter")ba._mult(Ka),this.addCurrentVertex(nn,ba,0,0,Yr);else if($s==="flipbevel"){if(Ka>100)ba=la.mult(-1);else{var sl=Ka*pi.add(la).mag()/pi.sub(la).mag();ba._perp()._mult(sl*(jo?-1:1))}this.addCurrentVertex(nn,ba,0,0,Yr),this.addCurrentVertex(nn,ba.mult(-1),0,0,Yr)}else if($s==="bevel"||$s==="fakeround"){var Rs=-Math.sqrt(Ka*Ka-1),Us=jo?Rs:0,Bu=jo?0:Rs;if(pn&&this.addCurrentVertex(nn,pi,Us,Bu,Yr),$s==="fakeround")for(var Oc=Math.round(bo*180/Math.PI/Ib),hh=1;hh<Oc;hh++){var Xu=hh/Oc;if(Xu!==.5){var Dc=Xu-.5,Nu=1.0904+Fa*(-3.2452+Fa*(3.55645-Fa*1.43519)),Oh=.848013+Fa*(-1.06021+Fa*.215638);Xu=Xu+Xu*Dc*(Xu-1)*(Nu*Dc*Dc+Oh)}var ih=la.sub(pi)._mult(Xu)._add(pi)._unit()._mult(jo?-1:1);this.addHalfVertex(nn,ih.x,ih.y,!1,jo,0,Yr)}Rn&&this.addCurrentVertex(nn,la,-Us,-Bu,Yr)}else if($s==="butt")this.addCurrentVertex(nn,ba,0,0,Yr);else if($s==="square"){var Of=pn?1:-1;this.addCurrentVertex(nn,ba,Of,Of,Yr)}else $s==="round"&&(pn&&(this.addCurrentVertex(nn,pi,0,0,Yr),this.addCurrentVertex(nn,pi,1,1,Yr,!0)),Rn&&(this.addCurrentVertex(nn,la,-1,-1,Yr,!0),this.addCurrentVertex(nn,la,0,0,Yr)));if(No&&na<Je-1){var Kd=nn.dist(Rn);if(Kd>2*Sr){var id=nn.add(Rn.sub(nn)._mult(Sr/Kd)._round());this.updateDistance(nn,id),this.addCurrentVertex(id,la,0,0,Yr),nn=id}}}}},$d.prototype.addCurrentVertex=function(m,B,K,bt,Ot,Zt){Zt===void 0&&(Zt=!1);var ie=B.x+B.y*K,De=B.y-B.x*K,Je=-B.x+B.y*bt,vr=-B.y-B.x*bt;this.addHalfVertex(m,ie,De,Zt,!1,K,Ot),this.addHalfVertex(m,Je,vr,Zt,!0,-bt,Ot),this.distance>Dx/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(m,B,K,bt,Ot,Zt))},$d.prototype.addHalfVertex=function(m,B,K,bt,Ot,Zt,ie){var De=m.x,Je=m.y,vr=this.lineClips?this.scaledDistance*(Dx-1):this.scaledDistance,Sr=vr*Vv;if(this.layoutVertexArray.emplaceBack((De<<1)+(bt?1:0),(Je<<1)+(Ot?1:0),Math.round(n5*B)+128,Math.round(n5*K)+128,(Zt===0?0:Zt<0?-1:1)+1|(Sr&63)<<2,Sr>>6),this.lineClips){var Yr=this.scaledDistance-this.lineClips.start,nn=this.lineClips.end-this.lineClips.start,pn=Yr/nn;this.layoutVertexArray2.emplaceBack(pn,this.lineClipsArray.length)}var Rn=ie.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Rn),ie.primitiveLength++),Ot?this.e2=Rn:this.e1=Rn},$d.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},$d.prototype.updateDistance=function(m,B){this.distance+=m.dist(B),this.updateScaledDistance()},sr("LineBucket",$d,{omit:["layers","patternFeatures"]});var Ob=new Za({"line-cap":new gn(La.layout_line["line-cap"]),"line-join":new ni(La.layout_line["line-join"]),"line-miter-limit":new gn(La.layout_line["line-miter-limit"]),"line-round-limit":new gn(La.layout_line["line-round-limit"]),"line-sort-key":new ni(La.layout_line["line-sort-key"])}),Fx=new Za({"line-opacity":new ni(La.paint_line["line-opacity"]),"line-color":new ni(La.paint_line["line-color"]),"line-translate":new gn(La.paint_line["line-translate"]),"line-translate-anchor":new gn(La.paint_line["line-translate-anchor"]),"line-width":new ni(La.paint_line["line-width"]),"line-gap-width":new ni(La.paint_line["line-gap-width"]),"line-offset":new ni(La.paint_line["line-offset"]),"line-blur":new ni(La.paint_line["line-blur"]),"line-dasharray":new Ui(La.paint_line["line-dasharray"]),"line-pattern":new Yi(La.paint_line["line-pattern"]),"line-gradient":new va(La.paint_line["line-gradient"])}),Hv={paint:Fx,layout:Ob},Db=function(m){function B(){m.apply(this,arguments)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.possiblyEvaluate=function(K,bt){return bt=new Bl(Math.floor(bt.zoom),{now:bt.now,fadeDuration:bt.fadeDuration,zoomHistory:bt.zoomHistory,transition:bt.transition}),m.prototype.possiblyEvaluate.call(this,K,bt)},B.prototype.evaluate=function(K,bt,Ot,Zt){return bt=E({},bt,{zoom:Math.floor(bt.zoom)}),m.prototype.evaluate.call(this,K,bt,Ot,Zt)},B}(ni),Rx=new Db(Hv.paint.properties["line-width"].specification);Rx.useIntegerZoom=!0;var Fb=function(m){function B(K){m.call(this,K,Hv),this.gradientVersion=0}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype._handleSpecialPaintPropertyUpdate=function(K){if(K==="line-gradient"){var bt=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=bt._styleExpression.expression instanceof Uc,this.gradientVersion=(this.gradientVersion+1)%x}},B.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},B.prototype.recalculate=function(K,bt){m.prototype.recalculate.call(this,K,bt),this.paint._values["line-floorwidth"]=Rx.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,K)},B.prototype.createBucket=function(K){return new $d(K)},B.prototype.queryRadius=function(K){var bt=K,Ot=o5(Mp("line-width",this,bt),Mp("line-gap-width",this,bt)),Zt=Mp("line-offset",this,bt);return Ot/2+Math.abs(Zt)+Sp(this.paint.get("line-translate"))},B.prototype.queryIntersectsFeature=function(K,bt,Ot,Zt,ie,De,Je){var vr=ep(K,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),De.angle,Je),Sr=Je/2*o5(this.paint.get("line-width").evaluate(bt,Ot),this.paint.get("line-gap-width").evaluate(bt,Ot)),Yr=this.paint.get("line-offset").evaluate(bt,Ot);return Yr&&(Zt=G(Zt,Yr*Je)),Np(vr,Zt,Sr)},B.prototype.isTileClipped=function(){return!0},B}(ta);function o5(m,B){return B>0?B+2*m:m}function G(m,B){for(var K=[],bt=new o(0,0),Ot=0;Ot<m.length;Ot++){for(var Zt=m[Ot],ie=[],De=0;De<Zt.length;De++){var Je=Zt[De-1],vr=Zt[De],Sr=Zt[De+1],Yr=De===0?bt:vr.sub(Je)._unit()._perp(),nn=De===Zt.length-1?bt:Sr.sub(vr)._unit()._perp(),pn=Yr._add(nn)._unit(),Rn=pn.x*nn.x+pn.y*nn.y;pn._mult(1/Rn),ie.push(pn._mult(B)._add(vr))}K.push(ie)}return K}var D=Qn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),nt=Qn([{name:"a_projected_pos",components:3,type:"Float32"}],4);Qn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var _t=Qn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Qn([{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 Rt=Qn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Kt=Qn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Qn([{name:"triangle",components:3,type:"Uint16"}]),Qn([{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"}]),Qn([{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"}]),Qn([{type:"Float32",name:"offsetX"}]),Qn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function Qt(m,B,K){var bt=B.layout.get("text-transform").evaluate(K,{});return bt==="uppercase"?m=m.toLocaleUpperCase():bt==="lowercase"&&(m=m.toLocaleLowerCase()),Gl.applyArabicShaping&&(m=Gl.applyArabicShaping(m)),m}function be(m,B,K){return m.sections.forEach(function(bt){bt.text=Qt(bt.text,B,K)}),m}function Fe(m){var B={},K={},bt=[],Ot=0;function Zt(na){bt.push(m[na]),Ot++}function ie(na,ba,Fa){var ya=K[na];return delete K[na],K[ba]=ya,bt[ya].geometry[0].pop(),bt[ya].geometry[0]=bt[ya].geometry[0].concat(Fa[0]),ya}function De(na,ba,Fa){var ya=B[ba];return delete B[ba],B[na]=ya,bt[ya].geometry[0].shift(),bt[ya].geometry[0]=Fa[0].concat(bt[ya].geometry[0]),ya}function Je(na,ba,Fa){var ya=Fa?ba[0][ba[0].length-1]:ba[0][0];return na+":"+ya.x+":"+ya.y}for(var vr=0;vr<m.length;vr++){var Sr=m[vr],Yr=Sr.geometry,nn=Sr.text?Sr.text.toString():null;if(!nn){Zt(vr);continue}var pn=Je(nn,Yr),Rn=Je(nn,Yr,!0);if(pn in K&&Rn in B&&K[pn]!==B[Rn]){var pi=De(pn,Rn,Yr),la=ie(pn,Rn,bt[pi].geometry);delete B[pn],delete K[Rn],K[Je(nn,bt[la].geometry,!0)]=la,bt[pi].geometry=null}else pn in K?ie(pn,Rn,Yr):Rn in B?De(pn,Rn,Yr):(Zt(vr),B[pn]=Ot-1,K[Rn]=Ot-1)}return bt.filter(function(na){return na.geometry})}var er={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function yr(m){for(var B="",K=0;K<m.length;K++){var bt=m.charCodeAt(K+1)||null,Ot=m.charCodeAt(K-1)||null,Zt=(!bt||!Yn(bt)||er[m[K+1]])&&(!Ot||!Yn(Ot)||er[m[K-1]]);Zt&&er[m[K]]?B+=er[m[K]]:B+=m[K]}return B}var Er=24,Zr=function(m,B,K,bt,Ot){var Zt,ie,De=Ot*8-bt-1,Je=(1<<De)-1,vr=Je>>1,Sr=-7,Yr=K?Ot-1:0,nn=K?-1:1,pn=m[B+Yr];for(Yr+=nn,Zt=pn&(1<<-Sr)-1,pn>>=-Sr,Sr+=De;Sr>0;Zt=Zt*256+m[B+Yr],Yr+=nn,Sr-=8);for(ie=Zt&(1<<-Sr)-1,Zt>>=-Sr,Sr+=bt;Sr>0;ie=ie*256+m[B+Yr],Yr+=nn,Sr-=8);if(Zt===0)Zt=1-vr;else{if(Zt===Je)return ie?NaN:(pn?-1:1)*(1/0);ie=ie+Math.pow(2,bt),Zt=Zt-vr}return(pn?-1:1)*ie*Math.pow(2,Zt-bt)},sn=function(m,B,K,bt,Ot,Zt){var ie,De,Je,vr=Zt*8-Ot-1,Sr=(1<<vr)-1,Yr=Sr>>1,nn=Ot===23?Math.pow(2,-24)-Math.pow(2,-77):0,pn=bt?0:Zt-1,Rn=bt?1:-1,pi=B<0||B===0&&1/B<0?1:0;for(B=Math.abs(B),isNaN(B)||B===1/0?(De=isNaN(B)?1:0,ie=Sr):(ie=Math.floor(Math.log(B)/Math.LN2),B*(Je=Math.pow(2,-ie))<1&&(ie--,Je*=2),ie+Yr>=1?B+=nn/Je:B+=nn*Math.pow(2,1-Yr),B*Je>=2&&(ie++,Je/=2),ie+Yr>=Sr?(De=0,ie=Sr):ie+Yr>=1?(De=(B*Je-1)*Math.pow(2,Ot),ie=ie+Yr):(De=B*Math.pow(2,Yr-1)*Math.pow(2,Ot),ie=0));Ot>=8;m[K+pn]=De&255,pn+=Rn,De/=256,Ot-=8);for(ie=ie<<Ot|De,vr+=Ot;vr>0;m[K+pn]=ie&255,pn+=Rn,ie/=256,vr-=8);m[K+pn-Rn]|=pi*128},xn={read:Zr,write:sn},Ln=$n;function $n(m){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(m)?m:new Uint8Array(m||0),this.pos=0,this.type=0,this.length=this.buf.length}$n.Varint=0,$n.Fixed64=1,$n.Bytes=2,$n.Fixed32=5;var ki=65536*65536,Aa=1/ki,Xi=12,ma=typeof TextDecoder>"u"?null:new TextDecoder("utf8");$n.prototype={destroy:function(){this.buf=null},readFields:function(m,B,K){for(K=K||this.length;this.pos<K;){var bt=this.readVarint(),Ot=bt>>3,Zt=this.pos;this.type=bt&7,m(Ot,B,this),this.pos===Zt&&this.skip(bt)}return B},readMessage:function(m,B){return this.readFields(m,B,this.readVarint()+this.pos)},readFixed32:function(){var m=Ep(this.buf,this.pos);return this.pos+=4,m},readSFixed32:function(){var m=td(this.buf,this.pos);return this.pos+=4,m},readFixed64:function(){var m=Ep(this.buf,this.pos)+Ep(this.buf,this.pos+4)*ki;return this.pos+=8,m},readSFixed64:function(){var m=Ep(this.buf,this.pos)+td(this.buf,this.pos+4)*ki;return this.pos+=8,m},readFloat:function(){var m=xn.read(this.buf,this.pos,!0,23,4);return this.pos+=4,m},readDouble:function(){var m=xn.read(this.buf,this.pos,!0,52,8);return this.pos+=8,m},readVarint:function(m){var B=this.buf,K,bt;return bt=B[this.pos++],K=bt&127,bt<128||(bt=B[this.pos++],K|=(bt&127)<<7,bt<128)||(bt=B[this.pos++],K|=(bt&127)<<14,bt<128)||(bt=B[this.pos++],K|=(bt&127)<<21,bt<128)?K:(bt=B[this.pos],K|=(bt&15)<<28,Ga(K,m,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var m=this.readVarint();return m%2===1?(m+1)/-2:m/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var m=this.readVarint()+this.pos,B=this.pos;return this.pos=m,m-B>=Xi&&ma?pp(this.buf,B,m):dp(this.buf,B,m)},readBytes:function(){var m=this.readVarint()+this.pos,B=this.buf.subarray(this.pos,m);return this.pos=m,B},readPackedVarint:function(m,B){if(this.type!==$n.Bytes)return m.push(this.readVarint(B));var K=To(this);for(m=m||[];this.pos<K;)m.push(this.readVarint(B));return m},readPackedSVarint:function(m){if(this.type!==$n.Bytes)return m.push(this.readSVarint());var B=To(this);for(m=m||[];this.pos<B;)m.push(this.readSVarint());return m},readPackedBoolean:function(m){if(this.type!==$n.Bytes)return m.push(this.readBoolean());var B=To(this);for(m=m||[];this.pos<B;)m.push(this.readBoolean());return m},readPackedFloat:function(m){if(this.type!==$n.Bytes)return m.push(this.readFloat());var B=To(this);for(m=m||[];this.pos<B;)m.push(this.readFloat());return m},readPackedDouble:function(m){if(this.type!==$n.Bytes)return m.push(this.readDouble());var B=To(this);for(m=m||[];this.pos<B;)m.push(this.readDouble());return m},readPackedFixed32:function(m){if(this.type!==$n.Bytes)return m.push(this.readFixed32());var B=To(this);for(m=m||[];this.pos<B;)m.push(this.readFixed32());return m},readPackedSFixed32:function(m){if(this.type!==$n.Bytes)return m.push(this.readSFixed32());var B=To(this);for(m=m||[];this.pos<B;)m.push(this.readSFixed32());return m},readPackedFixed64:function(m){if(this.type!==$n.Bytes)return m.push(this.readFixed64());var B=To(this);for(m=m||[];this.pos<B;)m.push(this.readFixed64());return m},readPackedSFixed64:function(m){if(this.type!==$n.Bytes)return m.push(this.readSFixed64());var B=To(this);for(m=m||[];this.pos<B;)m.push(this.readSFixed64());return m},skip:function(m){var B=m&7;if(B===$n.Varint)for(;this.buf[this.pos++]>127;);else if(B===$n.Bytes)this.pos=this.readVarint()+this.pos;else if(B===$n.Fixed32)this.pos+=4;else if(B===$n.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+B)},writeTag:function(m,B){this.writeVarint(m<<3|B)},realloc:function(m){for(var B=this.length||16;B<this.pos+m;)B*=2;if(B!==this.length){var K=new Uint8Array(B);K.set(this.buf),this.buf=K,this.length=B}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(m){this.realloc(4),If(this.buf,m,this.pos),this.pos+=4},writeSFixed32:function(m){this.realloc(4),If(this.buf,m,this.pos),this.pos+=4},writeFixed64:function(m){this.realloc(8),If(this.buf,m&-1,this.pos),If(this.buf,Math.floor(m*Aa),this.pos+4),this.pos+=8},writeSFixed64:function(m){this.realloc(8),If(this.buf,m&-1,this.pos),If(this.buf,Math.floor(m*Aa),this.pos+4),this.pos+=8},writeVarint:function(m){if(m=+m||0,m>268435455||m<0){Sl(m,this);return}this.realloc(4),this.buf[this.pos++]=m&127|(m>127?128:0),!(m<=127)&&(this.buf[this.pos++]=(m>>>=7)&127|(m>127?128:0),!(m<=127)&&(this.buf[this.pos++]=(m>>>=7)&127|(m>127?128:0),!(m<=127)&&(this.buf[this.pos++]=m>>>7&127)))},writeSVarint:function(m){this.writeVarint(m<0?-m*2-1:m*2)},writeBoolean:function(m){this.writeVarint(!!m)},writeString:function(m){m=String(m),this.realloc(m.length*4),this.pos++;var B=this.pos;this.pos=mp(this.buf,m,this.pos);var K=this.pos-B;K>=128&&Ys(B,K,this),this.pos=B-1,this.writeVarint(K),this.pos+=K},writeFloat:function(m){this.realloc(4),xn.write(this.buf,m,this.pos,!0,23,4),this.pos+=4},writeDouble:function(m){this.realloc(8),xn.write(this.buf,m,this.pos,!0,52,8),this.pos+=8},writeBytes:function(m){var B=m.length;this.writeVarint(B),this.realloc(B);for(var K=0;K<B;K++)this.buf[this.pos++]=m[K]},writeRawMessage:function(m,B){this.pos++;var K=this.pos;m(B,this);var bt=this.pos-K;bt>=128&&Ys(K,bt,this),this.pos=K-1,this.writeVarint(bt),this.pos+=bt},writeMessage:function(m,B,K){this.writeTag(m,$n.Bytes),this.writeRawMessage(B,K)},writePackedVarint:function(m,B){B.length&&this.writeMessage(m,Bs,B)},writePackedSVarint:function(m,B){B.length&&this.writeMessage(m,Is,B)},writePackedBoolean:function(m,B){B.length&&this.writeMessage(m,Ks,B)},writePackedFloat:function(m,B){B.length&&this.writeMessage(m,oo,B)},writePackedDouble:function(m,B){B.length&&this.writeMessage(m,nl,B)},writePackedFixed32:function(m,B){B.length&&this.writeMessage(m,Wl,B)},writePackedSFixed32:function(m,B){B.length&&this.writeMessage(m,uh,B)},writePackedFixed64:function(m,B){B.length&&this.writeMessage(m,nh,B)},writePackedSFixed64:function(m,B){B.length&&this.writeMessage(m,gd,B)},writeBytesField:function(m,B){this.writeTag(m,$n.Bytes),this.writeBytes(B)},writeFixed32Field:function(m,B){this.writeTag(m,$n.Fixed32),this.writeFixed32(B)},writeSFixed32Field:function(m,B){this.writeTag(m,$n.Fixed32),this.writeSFixed32(B)},writeFixed64Field:function(m,B){this.writeTag(m,$n.Fixed64),this.writeFixed64(B)},writeSFixed64Field:function(m,B){this.writeTag(m,$n.Fixed64),this.writeSFixed64(B)},writeVarintField:function(m,B){this.writeTag(m,$n.Varint),this.writeVarint(B)},writeSVarintField:function(m,B){this.writeTag(m,$n.Varint),this.writeSVarint(B)},writeStringField:function(m,B){this.writeTag(m,$n.Bytes),this.writeString(B)},writeFloatField:function(m,B){this.writeTag(m,$n.Fixed32),this.writeFloat(B)},writeDoubleField:function(m,B){this.writeTag(m,$n.Fixed64),this.writeDouble(B)},writeBooleanField:function(m,B){this.writeVarintField(m,!!B)}};function Ga(m,B,K){var bt=K.buf,Ot,Zt;if(Zt=bt[K.pos++],Ot=(Zt&112)>>4,Zt<128||(Zt=bt[K.pos++],Ot|=(Zt&127)<<3,Zt<128)||(Zt=bt[K.pos++],Ot|=(Zt&127)<<10,Zt<128)||(Zt=bt[K.pos++],Ot|=(Zt&127)<<17,Zt<128)||(Zt=bt[K.pos++],Ot|=(Zt&127)<<24,Zt<128)||(Zt=bt[K.pos++],Ot|=(Zt&1)<<31,Zt<128))return As(m,Ot,B);throw new Error("Expected varint not more than 10 bytes")}function To(m){return m.type===$n.Bytes?m.readVarint()+m.pos:m.pos+1}function As(m,B,K){return K?B*4294967296+(m>>>0):(B>>>0)*4294967296+(m>>>0)}function Sl(m,B){var K,bt;if(m>=0?(K=m%4294967296|0,bt=m/4294967296|0):(K=~(-m%4294967296),bt=~(-m/4294967296),K^4294967295?K=K+1|0:(K=0,bt=bt+1|0)),m>=18446744073709552e3||m<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");B.realloc(10),ys(K,bt,B),cs(bt,B)}function ys(m,B,K){K.buf[K.pos++]=m&127|128,m>>>=7,K.buf[K.pos++]=m&127|128,m>>>=7,K.buf[K.pos++]=m&127|128,m>>>=7,K.buf[K.pos++]=m&127|128,m>>>=7,K.buf[K.pos]=m&127}function cs(m,B){var K=(m&7)<<4;B.buf[B.pos++]|=K|((m>>>=3)?128:0),m&&(B.buf[B.pos++]=m&127|((m>>>=7)?128:0),m&&(B.buf[B.pos++]=m&127|((m>>>=7)?128:0),m&&(B.buf[B.pos++]=m&127|((m>>>=7)?128:0),m&&(B.buf[B.pos++]=m&127|((m>>>=7)?128:0),m&&(B.buf[B.pos++]=m&127)))))}function Ys(m,B,K){var bt=B<=16383?1:B<=2097151?2:B<=268435455?3:Math.floor(Math.log(B)/(Math.LN2*7));K.realloc(bt);for(var Ot=K.pos-1;Ot>=m;Ot--)K.buf[Ot+bt]=K.buf[Ot]}function Bs(m,B){for(var K=0;K<m.length;K++)B.writeVarint(m[K])}function Is(m,B){for(var K=0;K<m.length;K++)B.writeSVarint(m[K])}function oo(m,B){for(var K=0;K<m.length;K++)B.writeFloat(m[K])}function nl(m,B){for(var K=0;K<m.length;K++)B.writeDouble(m[K])}function Ks(m,B){for(var K=0;K<m.length;K++)B.writeBoolean(m[K])}function Wl(m,B){for(var K=0;K<m.length;K++)B.writeFixed32(m[K])}function uh(m,B){for(var K=0;K<m.length;K++)B.writeSFixed32(m[K])}function nh(m,B){for(var K=0;K<m.length;K++)B.writeFixed64(m[K])}function gd(m,B){for(var K=0;K<m.length;K++)B.writeSFixed64(m[K])}function Ep(m,B){return(m[B]|m[B+1]<<8|m[B+2]<<16)+m[B+3]*16777216}function If(m,B,K){m[K]=B,m[K+1]=B>>>8,m[K+2]=B>>>16,m[K+3]=B>>>24}function td(m,B){return(m[B]|m[B+1]<<8|m[B+2]<<16)+(m[B+3]<<24)}function dp(m,B,K){for(var bt="",Ot=B;Ot<K;){var Zt=m[Ot],ie=null,De=Zt>239?4:Zt>223?3:Zt>191?2:1;if(Ot+De>K)break;var Je,vr,Sr;De===1?Zt<128&&(ie=Zt):De===2?(Je=m[Ot+1],(Je&192)===128&&(ie=(Zt&31)<<6|Je&63,ie<=127&&(ie=null))):De===3?(Je=m[Ot+1],vr=m[Ot+2],(Je&192)===128&&(vr&192)===128&&(ie=(Zt&15)<<12|(Je&63)<<6|vr&63,(ie<=2047||ie>=55296&&ie<=57343)&&(ie=null))):De===4&&(Je=m[Ot+1],vr=m[Ot+2],Sr=m[Ot+3],(Je&192)===128&&(vr&192)===128&&(Sr&192)===128&&(ie=(Zt&15)<<18|(Je&63)<<12|(vr&63)<<6|Sr&63,(ie<=65535||ie>=1114112)&&(ie=null))),ie===null?(ie=65533,De=1):ie>65535&&(ie-=65536,bt+=String.fromCharCode(ie>>>10&1023|55296),ie=56320|ie&1023),bt+=String.fromCharCode(ie),Ot+=De}return bt}function pp(m,B,K){return ma.decode(m.subarray(B,K))}function mp(m,B,K){for(var bt=0,Ot,Zt;bt<B.length;bt++){if(Ot=B.charCodeAt(bt),Ot>55295&&Ot<57344)if(Zt)if(Ot<56320){m[K++]=239,m[K++]=191,m[K++]=189,Zt=Ot;continue}else Ot=Zt-55296<<10|Ot-56320|65536,Zt=null;else{Ot>56319||bt+1===B.length?(m[K++]=239,m[K++]=191,m[K++]=189):Zt=Ot;continue}else Zt&&(m[K++]=239,m[K++]=191,m[K++]=189,Zt=null);Ot<128?m[K++]=Ot:(Ot<2048?m[K++]=Ot>>6|192:(Ot<65536?m[K++]=Ot>>12|224:(m[K++]=Ot>>18|240,m[K++]=Ot>>12&63|128),m[K++]=Ot>>6&63|128),m[K++]=Ot&63|128)}return K}var of=3;function vd(m,B,K){m===1&&K.readMessage(rp,B)}function rp(m,B,K){if(m===3){var bt=K.readMessage(Gd,{}),Ot=bt.id,Zt=bt.bitmap,ie=bt.width,De=bt.height,Je=bt.left,vr=bt.top,Sr=bt.advance;B.push({id:Ot,bitmap:new Qf({width:ie+2*of,height:De+2*of},Zt),metrics:{width:ie,height:De,left:Je,top:vr,advance:Sr}})}}function Gd(m,B,K){m===1?B.id=K.readVarint():m===2?B.bitmap=K.readBytes():m===3?B.width=K.readVarint():m===4?B.height=K.readVarint():m===5?B.left=K.readSVarint():m===6?B.top=K.readSVarint():m===7&&(B.advance=K.readVarint())}function gp(m){return new Ln(m).readFields(vd,[])}var Od=of;function Up(m){for(var B=0,K=0,bt=0,Ot=m;bt<Ot.length;bt+=1){var Zt=Ot[bt];B+=Zt.w*Zt.h,K=Math.max(K,Zt.w)}m.sort(function(la,na){return na.h-la.h});for(var ie=Math.max(Math.ceil(Math.sqrt(B/.95)),K),De=[{x:0,y:0,w:ie,h:1/0}],Je=0,vr=0,Sr=0,Yr=m;Sr<Yr.length;Sr+=1)for(var nn=Yr[Sr],pn=De.length-1;pn>=0;pn--){var Rn=De[pn];if(!(nn.w>Rn.w||nn.h>Rn.h)){if(nn.x=Rn.x,nn.y=Rn.y,vr=Math.max(vr,nn.y+nn.h),Je=Math.max(Je,nn.x+nn.w),nn.w===Rn.w&&nn.h===Rn.h){var pi=De.pop();pn<De.length&&(De[pn]=pi)}else nn.h===Rn.h?(Rn.x+=nn.w,Rn.w-=nn.w):nn.w===Rn.w?(Rn.y+=nn.h,Rn.h-=nn.h):(De.push({x:Rn.x+nn.w,y:Rn.y,w:Rn.w-nn.w,h:nn.h}),Rn.y+=nn.h,Rn.h-=nn.h);break}}return{w:Je,h:vr,fill:B/(Je*vr)||0}}var wh=1,rc=function(m,B){var K=B.pixelRatio,bt=B.version,Ot=B.stretchX,Zt=B.stretchY,ie=B.content;this.paddedRect=m,this.pixelRatio=K,this.stretchX=Ot,this.stretchY=Zt,this.content=ie,this.version=bt},Ic={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Ic.tl.get=function(){return[this.paddedRect.x+wh,this.paddedRect.y+wh]},Ic.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-wh,this.paddedRect.y+this.paddedRect.h-wh]},Ic.tlbr.get=function(){return this.tl.concat(this.br)},Ic.displaySize.get=function(){return[(this.paddedRect.w-wh*2)/this.pixelRatio,(this.paddedRect.h-wh*2)/this.pixelRatio]},Object.defineProperties(rc.prototype,Ic);var $c=function(m,B){var K={},bt={};this.haveRenderCallbacks=[];var Ot=[];this.addImages(m,K,Ot),this.addImages(B,bt,Ot);var Zt=Up(Ot),ie=Zt.w,De=Zt.h,Je=new Zd({width:ie||1,height:De||1});for(var vr in m){var Sr=m[vr],Yr=K[vr].paddedRect;Zd.copy(Sr.data,Je,{x:0,y:0},{x:Yr.x+wh,y:Yr.y+wh},Sr.data)}for(var nn in B){var pn=B[nn],Rn=bt[nn].paddedRect,pi=Rn.x+wh,la=Rn.y+wh,na=pn.data.width,ba=pn.data.height;Zd.copy(pn.data,Je,{x:0,y:0},{x:pi,y:la},pn.data),Zd.copy(pn.data,Je,{x:0,y:ba-1},{x:pi,y:la-1},{width:na,height:1}),Zd.copy(pn.data,Je,{x:0,y:0},{x:pi,y:la+ba},{width:na,height:1}),Zd.copy(pn.data,Je,{x:na-1,y:0},{x:pi-1,y:la},{width:1,height:ba}),Zd.copy(pn.data,Je,{x:0,y:0},{x:pi+na,y:la},{width:1,height:ba})}this.image=Je,this.iconPositions=K,this.patternPositions=bt};$c.prototype.addImages=function(m,B,K){for(var bt in m){var Ot=m[bt],Zt={x:0,y:0,w:Ot.data.width+2*wh,h:Ot.data.height+2*wh};K.push(Zt),B[bt]=new rc(Zt,Ot),Ot.hasRenderCallback&&this.haveRenderCallbacks.push(bt)}},$c.prototype.patchUpdatedImages=function(m,B){m.dispatchRenderCallbacks(this.haveRenderCallbacks);for(var K in m.updatedImages)this.patchUpdatedImage(this.iconPositions[K],m.getImage(K),B),this.patchUpdatedImage(this.patternPositions[K],m.getImage(K),B)},$c.prototype.patchUpdatedImage=function(m,B,K){if(!(!m||!B)&&m.version!==B.version){m.version=B.version;var bt=m.tl,Ot=bt[0],Zt=bt[1];K.update(B.data,void 0,{x:Ot,y:Zt})}},sr("ImagePosition",rc),sr("ImageAtlas",$c);var $h={horizontal:1,vertical:2,horizontalOnly:3},kh=-17;function Wv(m){for(var B=0,K=m;B<K.length;B+=1){var bt=K[B];if(bt.positionedGlyphs.length!==0)return!1}return!0}var j0=57344,U0=63743,np=function(){this.scale=1,this.fontStack="",this.imageName=null};np.forText=function(m,B){var K=new np;return K.scale=m||1,K.fontStack=B,K},np.forImage=function(m){var B=new np;return B.imageName=m,B};var ch=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};ch.fromFeature=function(m,B){for(var K=new ch,bt=0;bt<m.sections.length;bt++){var Ot=m.sections[bt];Ot.image?K.addImageSection(Ot):K.addTextSection(Ot,B)}return K},ch.prototype.length=function(){return this.text.length},ch.prototype.getSection=function(m){return this.sections[this.sectionIndex[m]]},ch.prototype.getSectionIndex=function(m){return this.sectionIndex[m]},ch.prototype.getCharCode=function(m){return this.text.charCodeAt(m)},ch.prototype.verticalizePunctuation=function(){this.text=yr(this.text)},ch.prototype.trim=function(){for(var m=0,B=0;B<this.text.length&&Vp[this.text.charCodeAt(B)];B++)m++;for(var K=this.text.length,bt=this.text.length-1;bt>=0&&bt>=m&&Vp[this.text.charCodeAt(bt)];bt--)K--;this.text=this.text.substring(m,K),this.sectionIndex=this.sectionIndex.slice(m,K)},ch.prototype.substring=function(m,B){var K=new ch;return K.text=this.text.substring(m,B),K.sectionIndex=this.sectionIndex.slice(m,B),K.sections=this.sections,K},ch.prototype.toString=function(){return this.text},ch.prototype.getMaxScale=function(){var m=this;return this.sectionIndex.reduce(function(B,K){return Math.max(B,m.sections[K].scale)},0)},ch.prototype.addTextSection=function(m,B){this.text+=m.text,this.sections.push(np.forText(m.scale,m.fontStack||B));for(var K=this.sections.length-1,bt=0;bt<m.text.length;++bt)this.sectionIndex.push(K)},ch.prototype.addImageSection=function(m){var B=m.image?m.image.name:"";if(B.length===0){q("Can't add FormattedSection with an empty image.");return}var K=this.getNextImageSectionCharCode();if(!K){q("Reached maximum number of images "+(U0-j0+2));return}this.text+=String.fromCharCode(K),this.sections.push(np.forImage(B)),this.sectionIndex.push(this.sections.length-1)},ch.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=U0?null:++this.imageSectionID:(this.imageSectionID=j0,this.imageSectionID)};function Dd(m,B){for(var K=[],bt=m.text,Ot=0,Zt=0,ie=B;Zt<ie.length;Zt+=1){var De=ie[Zt];K.push(m.substring(Ot,De)),Ot=De}return Ot<bt.length&&K.push(m.substring(Ot,bt.length)),K}function k0(m,B,K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn,Rn,pi){var la=ch.fromFeature(m,Ot);Yr===$h.vertical&&la.verticalizePunctuation();var na,ba=Gl.processBidirectionalText,Fa=Gl.processStyledBidirectionalText;if(ba&&la.sections.length===1){na=[];for(var ya=ba(la.toString(),Ub(la,vr,Zt,B,bt,pn,Rn)),Ka=0,bo=ya;Ka<bo.length;Ka+=1){var No=bo[Ka],jo=new ch;jo.text=No,jo.sections=la.sections;for(var xs=0;xs<No.length;xs++)jo.sectionIndex.push(0);na.push(jo)}}else if(Fa){na=[];for(var _s=Fa(la.text,la.sectionIndex,Ub(la,vr,Zt,B,bt,pn,Rn)),Fs=0,$s=_s;Fs<$s.length;Fs+=1){var sl=$s[Fs],Rs=new ch;Rs.text=sl[0],Rs.sectionIndex=sl[1],Rs.sections=la.sections,na.push(Rs)}}else na=Dd(la,Ub(la,vr,Zt,B,bt,pn,Rn));var Us=[],Bu={positionedLines:Us,text:la.toString(),top:Sr[1],bottom:Sr[1],left:Sr[0],right:Sr[0],writingMode:Yr,iconsInText:!1,verticalizable:!1};return XT(Bu,B,K,bt,na,ie,De,Je,Yr,vr,nn,pi),Wv(Us)?!1:Bu}var Vp={};Vp[9]=!0,Vp[10]=!0,Vp[11]=!0,Vp[12]=!0,Vp[13]=!0,Vp[32]=!0;var vp={};vp[10]=!0,vp[32]=!0,vp[38]=!0,vp[40]=!0,vp[41]=!0,vp[43]=!0,vp[45]=!0,vp[47]=!0,vp[173]=!0,vp[183]=!0,vp[8203]=!0,vp[8208]=!0,vp[8211]=!0,vp[8231]=!0;function Rb(m,B,K,bt,Ot,Zt){if(B.imageName){var ie=bt[B.imageName];return ie?ie.displaySize[0]*B.scale*Er/Zt+Ot:0}else{var De=K[B.fontStack],Je=De&&De[m];return Je?Je.metrics.advance*B.scale+Ot:0}}function Bb(m,B,K,bt,Ot,Zt){for(var ie=0,De=0;De<m.length();De++){var Je=m.getSection(De);ie+=Rb(m.getCharCode(De),Je,bt,Ot,B,Zt)}var vr=Math.max(1,Math.ceil(ie/K));return ie/vr}function Bx(m,B,K,bt){var Ot=Math.pow(m-B,2);return bt?m<B?Ot/2:Ot*2:Ot+Math.abs(K)*K}function Am(m,B,K){var bt=0;return m===10&&(bt-=1e4),K&&(bt+=150),(m===40||m===65288)&&(bt+=50),(B===41||B===65289)&&(bt+=50),bt}function Nb(m,B,K,bt,Ot,Zt){for(var ie=null,De=Bx(B,K,Ot,Zt),Je=0,vr=bt;Je<vr.length;Je+=1){var Sr=vr[Je],Yr=B-Sr.x,nn=Bx(Yr,K,Ot,Zt)+Sr.badness;nn<=De&&(ie=Sr,De=nn)}return{index:m,x:B,priorBreak:ie,badness:De}}function jb(m){return m?jb(m.priorBreak).concat(m.index):[]}function Ub(m,B,K,bt,Ot,Zt,ie){if(Zt!=="point")return[];if(!m)return[];for(var De=[],Je=Bb(m,B,K,bt,Ot,ie),vr=m.text.indexOf("")>=0,Sr=0,Yr=0;Yr<m.length();Yr++){var nn=m.getSection(Yr),pn=m.getCharCode(Yr);if(Vp[pn]||(Sr+=Rb(pn,nn,bt,Ot,B,ie)),Yr<m.length()-1){var Rn=Ti(pn);(vp[pn]||Rn||nn.imageName)&&De.push(Nb(Yr+1,Sr,Je,De,Am(pn,m.getCharCode(Yr+1),Rn&&vr),!1))}}return jb(Nb(m.length(),Sr,Je,De,0,!0))}function Vb(m){var B=.5,K=.5;switch(m){case"right":case"top-right":case"bottom-right":B=1;break;case"left":case"top-left":case"bottom-left":B=0;break}switch(m){case"bottom":case"bottom-right":case"bottom-left":K=1;break;case"top":case"top-right":case"top-left":K=0;break}return{horizontalAlign:B,verticalAlign:K}}function XT(m,B,K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr){for(var nn=0,pn=kh,Rn=0,pi=0,la=De==="right"?1:De==="left"?0:.5,na=0,ba=0,Fa=Ot;ba<Fa.length;ba+=1){var ya=Fa[ba];ya.trim();var Ka=ya.getMaxScale(),bo=(Ka-1)*Er,No={positionedGlyphs:[],lineOffset:0};m.positionedLines[na]=No;var jo=No.positionedGlyphs,xs=0;if(!ya.length()){pn+=Zt,++na;continue}for(var _s=0;_s<ya.length();_s++){var Fs=ya.getSection(_s),$s=ya.getSectionIndex(_s),sl=ya.getCharCode(_s),Rs=0,Us=null,Bu=null,Oc=null,hh=Er,Xu=!(Je===$h.horizontal||!Sr&&!Ii(sl)||Sr&&(Vp[sl]||ja(sl)));if(Fs.imageName){var Dc=bt[Fs.imageName];if(!Dc)continue;Oc=Fs.imageName,m.iconsInText=m.iconsInText||!0,Bu=Dc.paddedRect;var Nu=Dc.displaySize;Fs.scale=Fs.scale*Er/Yr,Us={width:Nu[0],height:Nu[1],left:wh,top:-Od,advance:Xu?Nu[1]:Nu[0]};var Oh=Er-Nu[1]*Fs.scale;Rs=bo+Oh,hh=Us.advance;var ih=Xu?Nu[0]*Fs.scale-Er*Ka:Nu[1]*Fs.scale-Er*Ka;ih>0&&ih>xs&&(xs=ih)}else{var Of=K[Fs.fontStack],Kd=Of&&Of[sl];if(Kd&&Kd.rect)Bu=Kd.rect,Us=Kd.metrics;else{var id=B[Fs.fontStack],yp=id&&id[sl];if(!yp)continue;Us=yp.metrics}Rs=(Ka-Fs.scale)*Er}Xu?(m.verticalizable=!0,jo.push({glyph:sl,imageName:Oc,x:nn,y:pn+Rs,vertical:Xu,scale:Fs.scale,fontStack:Fs.fontStack,sectionIndex:$s,metrics:Us,rect:Bu}),nn+=hh*Fs.scale+vr):(jo.push({glyph:sl,imageName:Oc,x:nn,y:pn+Rs,vertical:Xu,scale:Fs.scale,fontStack:Fs.fontStack,sectionIndex:$s,metrics:Us,rect:Bu}),nn+=Us.advance*Fs.scale+vr)}if(jo.length!==0){var xp=nn-vr;Rn=Math.max(xp,Rn),JT(jo,0,jo.length-1,la,xs)}nn=0;var _p=Zt*Ka+xs;No.lineOffset=Math.max(xs,bo),pn+=_p,pi=Math.max(_p,pi),++na}var Rd=pn-kh,Cp=Vb(ie),Lp=Cp.horizontalAlign,yd=Cp.verticalAlign;QT(m.positionedLines,la,Lp,yd,Rn,pi,Zt,Rd,Ot.length),m.top+=-yd*Rd,m.bottom=m.top+Rd,m.left+=-Lp*Rn,m.right=m.left+Rn}function JT(m,B,K,bt,Ot){if(!(!bt&&!Ot))for(var Zt=m[K],ie=Zt.metrics.advance*Zt.scale,De=(m[K].x+ie)*bt,Je=B;Je<=K;Je++)m[Je].x-=De,m[Je].y+=Ot}function QT(m,B,K,bt,Ot,Zt,ie,De,Je){var vr=(B-K)*Ot,Sr=0;Zt!==ie?Sr=-De*bt-kh:Sr=(-bt*Je+.5)*ie;for(var Yr=0,nn=m;Yr<nn.length;Yr+=1)for(var pn=nn[Yr],Rn=0,pi=pn.positionedGlyphs;Rn<pi.length;Rn+=1){var la=pi[Rn];la.x+=vr,la.y+=Sr}}function t8(m,B,K){var bt=Vb(K),Ot=bt.horizontalAlign,Zt=bt.verticalAlign,ie=B[0],De=B[1],Je=ie-m.displaySize[0]*Ot,vr=Je+m.displaySize[0],Sr=De-m.displaySize[1]*Zt,Yr=Sr+m.displaySize[1];return{image:m,top:Sr,bottom:Yr,left:Je,right:vr}}function s5(m,B,K,bt,Ot,Zt){var ie=m.image,De;if(ie.content){var Je=ie.content,vr=ie.pixelRatio||1;De=[Je[0]/vr,Je[1]/vr,ie.displaySize[0]-Je[2]/vr,ie.displaySize[1]-Je[3]/vr]}var Sr=B.left*Zt,Yr=B.right*Zt,nn,pn,Rn,pi;K==="width"||K==="both"?(pi=Ot[0]+Sr-bt[3],pn=Ot[0]+Yr+bt[1]):(pi=Ot[0]+(Sr+Yr-ie.displaySize[0])/2,pn=pi+ie.displaySize[0]);var la=B.top*Zt,na=B.bottom*Zt;return K==="height"||K==="both"?(nn=Ot[1]+la-bt[0],Rn=Ot[1]+na+bt[2]):(nn=Ot[1]+(la+na-ie.displaySize[1])/2,Rn=nn+ie.displaySize[1]),{image:ie,top:nn,right:pn,bottom:Rn,left:pi,collisionPadding:De}}var qv=function(m){function B(K,bt,Ot,Zt){m.call(this,K,bt),this.angle=Ot,Zt!==void 0&&(this.segment=Zt)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.clone=function(){return new B(this.x,this.y,this.angle,this.segment)},B}(o);sr("Anchor",qv);var ed=128;function Zv(m,B){var K=B.expression;if(K.kind==="constant"){var bt=K.evaluate(new Bl(m+1));return{kind:"constant",layoutSize:bt}}else{if(K.kind==="source")return{kind:"source"};for(var Ot=K.zoomStops,Zt=K.interpolationType,ie=0;ie<Ot.length&&Ot[ie]<=m;)ie++;ie=Math.max(0,ie-1);for(var De=ie;De<Ot.length&&Ot[De]<m+1;)De++;De=Math.min(Ot.length-1,De);var Je=Ot[ie],vr=Ot[De];if(K.kind==="composite")return{kind:"composite",minZoom:Je,maxZoom:vr,interpolationType:Zt};var Sr=K.evaluate(new Bl(Je)),Yr=K.evaluate(new Bl(vr));return{kind:"camera",minZoom:Je,maxZoom:vr,minSize:Sr,maxSize:Yr,interpolationType:Zt}}}function Hb(m,B,K){var bt=B.uSize,Ot=B.uSizeT,Zt=K.lowerSize,ie=K.upperSize;return m.kind==="source"?Zt/ed:m.kind==="composite"?_u(Zt/ed,ie/ed,Ot):bt}function l5(m,B){var K=0,bt=0;if(m.kind==="constant")bt=m.layoutSize;else if(m.kind!=="source"){var Ot=m.interpolationType,Zt=m.minZoom,ie=m.maxZoom,De=Ot?u(gc.interpolationFactor(Ot,B,Zt,ie),0,1):0;m.kind==="camera"?bt=_u(m.minSize,m.maxSize,De):K=De}return{uSizeT:K,uSize:bt}}var e8=Object.freeze({__proto__:null,getSizeData:Zv,evaluateSizeForFeature:Hb,evaluateSizeForZoom:l5,SIZE_PACK_FACTOR:ed});function u5(m,B,K,bt,Ot){if(B.segment===void 0)return!0;for(var Zt=B,ie=B.segment+1,De=0;De>-K/2;){if(ie--,ie<0)return!1;De-=m[ie].dist(Zt),Zt=m[ie]}De+=m[ie].dist(m[ie+1]),ie++;for(var Je=[],vr=0;De<K/2;){var Sr=m[ie-1],Yr=m[ie],nn=m[ie+1];if(!nn)return!1;var pn=Sr.angleTo(Yr)-Yr.angleTo(nn);for(pn=Math.abs((pn+3*Math.PI)%(Math.PI*2)-Math.PI),Je.push({distance:De,angleDelta:pn}),vr+=pn;De-Je[0].distance>bt;)vr-=Je.shift().angleDelta;if(vr>Ot)return!1;ie++,De+=Yr.dist(nn)}return!0}function Yd(m){for(var B=0,K=0;K<m.length-1;K++)B+=m[K].dist(m[K+1]);return B}function Hp(m,B,K){return m?3/5*B*K:0}function Jm(m,B){return Math.max(m?m.right-m.left:0,B?B.right-B.left:0)}function V0(m,B,K,bt,Ot,Zt){for(var ie=Hp(K,Ot,Zt),De=Jm(K,bt)*Zt,Je=0,vr=Yd(m)/2,Sr=0;Sr<m.length-1;Sr++){var Yr=m[Sr],nn=m[Sr+1],pn=Yr.dist(nn);if(Je+pn>vr){var Rn=(vr-Je)/pn,pi=_u(Yr.x,nn.x,Rn),la=_u(Yr.y,nn.y,Rn),na=new qv(pi,la,nn.angleTo(Yr),Sr);return na._round(),!ie||u5(m,na,De,ie,B)?na:void 0}Je+=pn}}function jg(m,B,K,bt,Ot,Zt,ie,De,Je){var vr=Hp(bt,Zt,ie),Sr=Jm(bt,Ot),Yr=Sr*ie,nn=m[0].x===0||m[0].x===Je||m[0].y===0||m[0].y===Je;B-Yr<B/4&&(B=Yr+B/4);var pn=Zt*2,Rn=nn?B/2*De%B:(Sr/2+pn)*ie*De%B;return H0(m,Rn,B,vr,K,Yr,nn,!1,Je)}function H0(m,B,K,bt,Ot,Zt,ie,De,Je){for(var vr=Zt/2,Sr=Yd(m),Yr=0,nn=B-K,pn=[],Rn=0;Rn<m.length-1;Rn++){for(var pi=m[Rn],la=m[Rn+1],na=pi.dist(la),ba=la.angleTo(pi);nn+K<Yr+na;){nn+=K;var Fa=(nn-Yr)/na,ya=_u(pi.x,la.x,Fa),Ka=_u(pi.y,la.y,Fa);if(ya>=0&&ya<Je&&Ka>=0&&Ka<Je&&nn-vr>=0&&nn+vr<=Sr){var bo=new qv(ya,Ka,ba,Rn);bo._round(),(!bt||u5(m,bo,Zt,bt,Ot))&&pn.push(bo)}}Yr+=na}return!De&&!pn.length&&!ie&&(pn=H0(m,Yr/2,K,bt,Ot,Zt,ie,!0,Je)),pn}function JE(m,B,K,bt,Ot){for(var Zt=[],ie=0;ie<m.length;ie++)for(var De=m[ie],Je=void 0,vr=0;vr<De.length-1;vr++){var Sr=De[vr],Yr=De[vr+1];Sr.x<B&&Yr.x<B||(Sr.x<B?Sr=new o(B,Sr.y+(Yr.y-Sr.y)*((B-Sr.x)/(Yr.x-Sr.x)))._round():Yr.x<B&&(Yr=new o(B,Sr.y+(Yr.y-Sr.y)*((B-Sr.x)/(Yr.x-Sr.x)))._round()),!(Sr.y<K&&Yr.y<K)&&(Sr.y<K?Sr=new o(Sr.x+(Yr.x-Sr.x)*((K-Sr.y)/(Yr.y-Sr.y)),K)._round():Yr.y<K&&(Yr=new o(Sr.x+(Yr.x-Sr.x)*((K-Sr.y)/(Yr.y-Sr.y)),K)._round()),!(Sr.x>=bt&&Yr.x>=bt)&&(Sr.x>=bt?Sr=new o(bt,Sr.y+(Yr.y-Sr.y)*((bt-Sr.x)/(Yr.x-Sr.x)))._round():Yr.x>=bt&&(Yr=new o(bt,Sr.y+(Yr.y-Sr.y)*((bt-Sr.x)/(Yr.x-Sr.x)))._round()),!(Sr.y>=Ot&&Yr.y>=Ot)&&(Sr.y>=Ot?Sr=new o(Sr.x+(Yr.x-Sr.x)*((Ot-Sr.y)/(Yr.y-Sr.y)),Ot)._round():Yr.y>=Ot&&(Yr=new o(Sr.x+(Yr.x-Sr.x)*((Ot-Sr.y)/(Yr.y-Sr.y)),Ot)._round()),(!Je||!Sr.equals(Je[Je.length-1]))&&(Je=[Sr],Zt.push(Je)),Je.push(Yr)))))}return Zt}var Nx=wh;function QE(m,B,K,bt){var Ot=[],Zt=m.image,ie=Zt.pixelRatio,De=Zt.paddedRect.w-2*Nx,Je=Zt.paddedRect.h-2*Nx,vr=m.right-m.left,Sr=m.bottom-m.top,Yr=Zt.stretchX||[[0,De]],nn=Zt.stretchY||[[0,Je]],pn=function(Dc,Nu){return Dc+Nu[1]-Nu[0]},Rn=Yr.reduce(pn,0),pi=nn.reduce(pn,0),la=De-Rn,na=Je-pi,ba=0,Fa=Rn,ya=0,Ka=pi,bo=0,No=la,jo=0,xs=na;if(Zt.content&&bt){var _s=Zt.content;ba=c5(Yr,0,_s[0]),ya=c5(nn,0,_s[1]),Fa=c5(Yr,_s[0],_s[2]),Ka=c5(nn,_s[1],_s[3]),bo=_s[0]-ba,jo=_s[1]-ya,No=_s[2]-_s[0]-Fa,xs=_s[3]-_s[1]-Ka}var Fs=function(Dc,Nu,Oh,ih){var Of=h5(Dc.stretch-ba,Fa,vr,m.left),Kd=f5(Dc.fixed-bo,No,Dc.stretch,Rn),id=h5(Nu.stretch-ya,Ka,Sr,m.top),yp=f5(Nu.fixed-jo,xs,Nu.stretch,pi),xp=h5(Oh.stretch-ba,Fa,vr,m.left),_p=f5(Oh.fixed-bo,No,Oh.stretch,Rn),Rd=h5(ih.stretch-ya,Ka,Sr,m.top),Cp=f5(ih.fixed-jo,xs,ih.stretch,pi),Lp=new o(Of,id),yd=new o(xp,id),Pp=new o(xp,Rd),T0=new o(Of,Rd),Hg=new o(Kd/ie,yp/ie),Yv=new o(_p/ie,Cp/ie),Kv=B*Math.PI/180;if(Kv){var Xv=Math.sin(Kv),$x=Math.cos(Kv),nm=[$x,-Xv,Xv,$x];Lp._matMult(nm),yd._matMult(nm),T0._matMult(nm),Pp._matMult(nm)}var y5=Dc.stretch+Dc.fixed,u8=Oh.stretch+Oh.fixed,x5=Nu.stretch+Nu.fixed,c8=ih.stretch+ih.fixed,W0={x:Zt.paddedRect.x+Nx+y5,y:Zt.paddedRect.y+Nx+x5,w:u8-y5,h:c8-x5},Gx=No/ie/vr,_5=xs/ie/Sr;return{tl:Lp,tr:yd,bl:T0,br:Pp,tex:W0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Hg,pixelOffsetBR:Yv,minFontScaleX:Gx,minFontScaleY:_5,isSDF:K}};if(!bt||!Zt.stretchX&&!Zt.stretchY)Ot.push(Fs({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:De+1},{fixed:0,stretch:Je+1}));else for(var $s=tC(Yr,la,Rn),sl=tC(nn,na,pi),Rs=0;Rs<$s.length-1;Rs++)for(var Us=$s[Rs],Bu=$s[Rs+1],Oc=0;Oc<sl.length-1;Oc++){var hh=sl[Oc],Xu=sl[Oc+1];Ot.push(Fs(Us,hh,Bu,Xu))}return Ot}function c5(m,B,K){for(var bt=0,Ot=0,Zt=m;Ot<Zt.length;Ot+=1){var ie=Zt[Ot];bt+=Math.max(B,Math.min(K,ie[1]))-Math.max(B,Math.min(K,ie[0]))}return bt}function tC(m,B,K){for(var bt=[{fixed:-Nx,stretch:0}],Ot=0,Zt=m;Ot<Zt.length;Ot+=1){var ie=Zt[Ot],De=ie[0],Je=ie[1],vr=bt[bt.length-1];bt.push({fixed:De-vr.stretch,stretch:vr.stretch}),bt.push({fixed:De-vr.stretch,stretch:vr.stretch+(Je-De)})}return bt.push({fixed:B+Nx,stretch:K}),bt}function h5(m,B,K,bt){return m/B*K+bt}function f5(m,B,K,bt){return m-B*K/bt}function i$(m,B,K,bt,Ot,Zt,ie,De){for(var Je=bt.layout.get("text-rotate").evaluate(Zt,{})*Math.PI/180,vr=[],Sr=0,Yr=B.positionedLines;Sr<Yr.length;Sr+=1)for(var nn=Yr[Sr],pn=0,Rn=nn.positionedGlyphs;pn<Rn.length;pn+=1){var pi=Rn[pn];if(pi.rect){var la=pi.rect||{},na=1,ba=Od+na,Fa=!0,ya=1,Ka=0,bo=(Ot||De)&&pi.vertical,No=pi.metrics.advance*pi.scale/2;if(De&&B.verticalizable){var jo=(pi.scale-1)*Er,xs=(Er-pi.metrics.width*pi.scale)/2;Ka=nn.lineOffset/2-(pi.imageName?-xs:jo)}if(pi.imageName){var _s=ie[pi.imageName];Fa=_s.sdf,ya=_s.pixelRatio,ba=wh/ya}var Fs=Ot?[pi.x+No,pi.y]:[0,0],$s=Ot?[0,0]:[pi.x+No+K[0],pi.y+K[1]-Ka],sl=[0,0];bo&&(sl=$s,$s=[0,0]);var Rs=(pi.metrics.left-ba)*pi.scale-No+$s[0],Us=(-pi.metrics.top-ba)*pi.scale+$s[1],Bu=Rs+la.w*pi.scale/ya,Oc=Us+la.h*pi.scale/ya,hh=new o(Rs,Us),Xu=new o(Bu,Us),Dc=new o(Rs,Oc),Nu=new o(Bu,Oc);if(bo){var Oh=new o(-No,No-kh),ih=-Math.PI/2,Of=Er/2-No,Kd=pi.imageName?Of:0,id=new o(5-kh-Of,-Kd),yp=new(Function.prototype.bind.apply(o,[null].concat(sl)));hh._rotateAround(ih,Oh)._add(id)._add(yp),Xu._rotateAround(ih,Oh)._add(id)._add(yp),Dc._rotateAround(ih,Oh)._add(id)._add(yp),Nu._rotateAround(ih,Oh)._add(id)._add(yp)}if(Je){var xp=Math.sin(Je),_p=Math.cos(Je),Rd=[_p,-xp,xp,_p];hh._matMult(Rd),Xu._matMult(Rd),Dc._matMult(Rd),Nu._matMult(Rd)}var Cp=new o(0,0),Lp=new o(0,0),yd=0,Pp=0;vr.push({tl:hh,tr:Xu,bl:Dc,br:Nu,tex:la,writingMode:B.writingMode,glyphOffset:Fs,sectionIndex:pi.sectionIndex,isSDF:Fa,pixelOffsetTL:Cp,pixelOffsetBR:Lp,minFontScaleX:yd,minFontScaleY:Pp})}}return vr}var d5=function(m,B,K,bt,Ot,Zt,ie,De,Je,vr){if(this.boxStartIndex=m.length,Je){var Sr=Zt.top,Yr=Zt.bottom,nn=Zt.collisionPadding;nn&&(Sr-=nn[1],Yr+=nn[3]);var pn=Yr-Sr;pn>0&&(pn=Math.max(10,pn),this.circleDiameter=pn)}else{var Rn=Zt.top*ie-De,pi=Zt.bottom*ie+De,la=Zt.left*ie-De,na=Zt.right*ie+De,ba=Zt.collisionPadding;if(ba&&(la-=ba[0]*ie,Rn-=ba[1]*ie,na+=ba[2]*ie,pi+=ba[3]*ie),vr){var Fa=new o(la,Rn),ya=new o(na,Rn),Ka=new o(la,pi),bo=new o(na,pi),No=vr*Math.PI/180;Fa._rotate(No),ya._rotate(No),Ka._rotate(No),bo._rotate(No),la=Math.min(Fa.x,ya.x,Ka.x,bo.x),na=Math.max(Fa.x,ya.x,Ka.x,bo.x),Rn=Math.min(Fa.y,ya.y,Ka.y,bo.y),pi=Math.max(Fa.y,ya.y,Ka.y,bo.y)}m.emplaceBack(B.x,B.y,la,Rn,na,pi,K,bt,Ot)}this.boxEndIndex=m.length},jx=function(m,B){if(m===void 0&&(m=[]),B===void 0&&(B=a$),this.data=m,this.length=this.data.length,this.compare=B,this.length>0)for(var K=(this.length>>1)-1;K>=0;K--)this._down(K)};jx.prototype.push=function(m){this.data.push(m),this.length++,this._up(this.length-1)},jx.prototype.pop=function(){if(this.length!==0){var m=this.data[0],B=this.data.pop();return this.length--,this.length>0&&(this.data[0]=B,this._down(0)),m}},jx.prototype.peek=function(){return this.data[0]},jx.prototype._up=function(m){for(var B=this,K=B.data,bt=B.compare,Ot=K[m];m>0;){var Zt=m-1>>1,ie=K[Zt];if(bt(Ot,ie)>=0)break;K[m]=ie,m=Zt}K[m]=Ot},jx.prototype._down=function(m){for(var B=this,K=B.data,bt=B.compare,Ot=this.length>>1,Zt=K[m];m<Ot;){var ie=(m<<1)+1,De=K[ie],Je=ie+1;if(Je<this.length&&bt(K[Je],De)<0&&(ie=Je,De=K[Je]),bt(De,Zt)>=0)break;K[m]=De,m=ie}K[m]=Zt};function a$(m,B){return m<B?-1:m>B?1:0}function o$(m,B,K){K===void 0&&(K=!1);for(var bt=1/0,Ot=1/0,Zt=-1/0,ie=-1/0,De=m[0],Je=0;Je<De.length;Je++){var vr=De[Je];(!Je||vr.x<bt)&&(bt=vr.x),(!Je||vr.y<Ot)&&(Ot=vr.y),(!Je||vr.x>Zt)&&(Zt=vr.x),(!Je||vr.y>ie)&&(ie=vr.y)}var Sr=Zt-bt,Yr=ie-Ot,nn=Math.min(Sr,Yr),pn=nn/2,Rn=new jx([],s$);if(nn===0)return new o(bt,Ot);for(var pi=bt;pi<Zt;pi+=nn)for(var la=Ot;la<ie;la+=nn)Rn.push(new Ux(pi+pn,la+pn,pn,m));for(var na=u$(m),ba=Rn.length;Rn.length;){var Fa=Rn.pop();(Fa.d>na.d||!na.d)&&(na=Fa,K&&console.log("found best %d after %d probes",Math.round(1e4*Fa.d)/1e4,ba)),!(Fa.max-na.d<=B)&&(pn=Fa.h/2,Rn.push(new Ux(Fa.p.x-pn,Fa.p.y-pn,pn,m)),Rn.push(new Ux(Fa.p.x+pn,Fa.p.y-pn,pn,m)),Rn.push(new Ux(Fa.p.x-pn,Fa.p.y+pn,pn,m)),Rn.push(new Ux(Fa.p.x+pn,Fa.p.y+pn,pn,m)),ba+=4)}return K&&(console.log("num probes: "+ba),console.log("best distance: "+na.d)),na.p}function s$(m,B){return B.max-m.max}function Ux(m,B,K,bt){this.p=new o(m,B),this.h=K,this.d=l$(this.p,bt),this.max=this.d+this.h*Math.SQRT2}function l$(m,B){for(var K=!1,bt=1/0,Ot=0;Ot<B.length;Ot++)for(var Zt=B[Ot],ie=0,De=Zt.length,Je=De-1;ie<De;Je=ie++){var vr=Zt[ie],Sr=Zt[Je];vr.y>m.y!=Sr.y>m.y&&m.x<(Sr.x-vr.x)*(m.y-vr.y)/(Sr.y-vr.y)+vr.x&&(K=!K),bt=Math.min(bt,tp(m,vr,Sr))}return(K?1:-1)*Math.sqrt(bt)}function u$(m){for(var B=0,K=0,bt=0,Ot=m[0],Zt=0,ie=Ot.length,De=ie-1;Zt<ie;De=Zt++){var Je=Ot[Zt],vr=Ot[De],Sr=Je.x*vr.y-vr.x*Je.y;K+=(Je.x+vr.x)*Sr,bt+=(Je.y+vr.y)*Sr,B+=Sr*3}return new Ux(K/B,bt/B,0,m)}var Vx=7,r8=Number.POSITIVE_INFINITY;function eC(m,B){function K(Ot,Zt){var ie=0,De=0;Zt<0&&(Zt=0);var Je=Zt/Math.sqrt(2);switch(Ot){case"top-right":case"top-left":De=Je-Vx;break;case"bottom-right":case"bottom-left":De=-Je+Vx;break;case"bottom":De=-Zt+Vx;break;case"top":De=Zt-Vx;break}switch(Ot){case"top-right":case"bottom-right":ie=-Je;break;case"top-left":case"bottom-left":ie=Je;break;case"left":ie=Zt;break;case"right":ie=-Zt;break}return[ie,De]}function bt(Ot,Zt,ie){var De=0,Je=0;switch(Zt=Math.abs(Zt),ie=Math.abs(ie),Ot){case"top-right":case"top-left":case"top":Je=ie-Vx;break;case"bottom-right":case"bottom-left":case"bottom":Je=-ie+Vx;break}switch(Ot){case"top-right":case"bottom-right":case"right":De=-Zt;break;case"top-left":case"bottom-left":case"left":De=Zt;break}return[De,Je]}return B[1]!==r8?bt(m,B[0],B[1]):K(m,B[0])}function c$(m,B,K,bt,Ot,Zt,ie){m.createArrays();var De=512*m.overscaling;m.tilePixelRatio=Vo/De,m.compareText={},m.iconsNeedLinear=!1;var Je=m.layers[0].layout,vr=m.layers[0]._unevaluatedLayout._values,Sr={};if(m.textSizeData.kind==="composite"){var Yr=m.textSizeData,nn=Yr.minZoom,pn=Yr.maxZoom;Sr.compositeTextSizes=[vr["text-size"].possiblyEvaluate(new Bl(nn),ie),vr["text-size"].possiblyEvaluate(new Bl(pn),ie)]}if(m.iconSizeData.kind==="composite"){var Rn=m.iconSizeData,pi=Rn.minZoom,la=Rn.maxZoom;Sr.compositeIconSizes=[vr["icon-size"].possiblyEvaluate(new Bl(pi),ie),vr["icon-size"].possiblyEvaluate(new Bl(la),ie)]}Sr.layoutTextSize=vr["text-size"].possiblyEvaluate(new Bl(m.zoom+1),ie),Sr.layoutIconSize=vr["icon-size"].possiblyEvaluate(new Bl(m.zoom+1),ie),Sr.textMaxSize=vr["text-size"].possiblyEvaluate(new Bl(18));for(var na=Je.get("text-line-height")*Er,ba=Je.get("text-rotation-alignment")==="map"&&Je.get("symbol-placement")!=="point",Fa=Je.get("text-keep-upright"),ya=Je.get("text-size"),Ka=function(){var jo=No[bo],xs=Je.get("text-font").evaluate(jo,{},ie).join(","),_s=ya.evaluate(jo,{},ie),Fs=Sr.layoutTextSize.evaluate(jo,{},ie),$s=Sr.layoutIconSize.evaluate(jo,{},ie),sl={horizontal:{},vertical:void 0},Rs=jo.text,Us=[0,0];if(Rs){var Bu=Rs.toString(),Oc=Je.get("text-letter-spacing").evaluate(jo,{},ie)*Er,hh=Un(Bu)?Oc:0,Xu=Je.get("text-anchor").evaluate(jo,{},ie),Dc=Je.get("text-variable-anchor");if(!Dc){var Nu=Je.get("text-radial-offset").evaluate(jo,{},ie);Nu?Us=eC(Xu,[Nu*Er,r8]):Us=Je.get("text-offset").evaluate(jo,{},ie).map(function(Hg){return Hg*Er})}var Oh=ba?"center":Je.get("text-justify").evaluate(jo,{},ie),ih=Je.get("symbol-placement"),Of=ih==="point"?Je.get("text-max-width").evaluate(jo,{},ie)*Er:0,Kd=function(){m.allowVerticalPlacement&&Bi(Bu)&&(sl.vertical=k0(Rs,B,K,Ot,xs,Of,na,Xu,"left",hh,Us,$h.vertical,!0,ih,Fs,_s))};if(!ba&&Dc){for(var id=Oh==="auto"?Dc.map(function(Hg){return n8(Hg)}):[Oh],yp=!1,xp=0;xp<id.length;xp++){var _p=id[xp];if(!sl.horizontal[_p])if(yp)sl.horizontal[_p]=sl.horizontal[0];else{var Rd=k0(Rs,B,K,Ot,xs,Of,na,"center",_p,hh,Us,$h.horizontal,!1,ih,Fs,_s);Rd&&(sl.horizontal[_p]=Rd,yp=Rd.positionedLines.length===1)}}Kd()}else{Oh==="auto"&&(Oh=n8(Xu));var Cp=k0(Rs,B,K,Ot,xs,Of,na,Xu,Oh,hh,Us,$h.horizontal,!1,ih,Fs,_s);Cp&&(sl.horizontal[Oh]=Cp),Kd(),Bi(Bu)&&ba&&Fa&&(sl.vertical=k0(Rs,B,K,Ot,xs,Of,na,Xu,Oh,hh,Us,$h.vertical,!1,ih,Fs,_s))}}var Lp=void 0,yd=!1;if(jo.icon&&jo.icon.name){var Pp=bt[jo.icon.name];Pp&&(Lp=t8(Ot[jo.icon.name],Je.get("icon-offset").evaluate(jo,{},ie),Je.get("icon-anchor").evaluate(jo,{},ie)),yd=Pp.sdf,m.sdfIcons===void 0?m.sdfIcons=Pp.sdf:m.sdfIcons!==Pp.sdf&&q("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Pp.pixelRatio!==m.pixelRatio||Je.get("icon-rotate").constantOr(1)!==0)&&(m.iconsNeedLinear=!0))}var T0=nC(sl.horizontal)||sl.vertical;m.iconsInText=T0?T0.iconsInText:!1,(T0||Lp)&&h$(m,jo,sl,Lp,bt,Sr,Fs,$s,Us,yd,ie)},bo=0,No=m.features;bo<No.length;bo+=1)Ka();Zt&&m.generateCollisionDebugBuffers()}function n8(m){switch(m){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function h$(m,B,K,bt,Ot,Zt,ie,De,Je,vr,Sr){var Yr=Zt.textMaxSize.evaluate(B,{});Yr===void 0&&(Yr=ie);var nn=m.layers[0].layout,pn=nn.get("icon-offset").evaluate(B,{},Sr),Rn=nC(K.horizontal),pi=24,la=ie/pi,na=m.tilePixelRatio*la,ba=m.tilePixelRatio*Yr/pi,Fa=m.tilePixelRatio*De,ya=m.tilePixelRatio*nn.get("symbol-spacing"),Ka=nn.get("text-padding")*m.tilePixelRatio,bo=nn.get("icon-padding")*m.tilePixelRatio,No=nn.get("text-max-angle")/180*Math.PI,jo=nn.get("text-rotation-alignment")==="map"&&nn.get("symbol-placement")!=="point",xs=nn.get("icon-rotation-alignment")==="map"&&nn.get("symbol-placement")!=="point",_s=nn.get("symbol-placement"),Fs=ya/2,$s=nn.get("icon-text-fit"),sl;bt&&$s!=="none"&&(m.allowVerticalPlacement&&K.vertical&&(sl=s5(bt,K.vertical,$s,nn.get("icon-text-fit-padding"),pn,la)),Rn&&(bt=s5(bt,Rn,$s,nn.get("icon-text-fit-padding"),pn,la)));var Rs=function($x,nm){nm.x<0||nm.x>=Vo||nm.y<0||nm.y>=Vo||f$(m,nm,$x,K,bt,Ot,sl,m.layers[0],m.collisionBoxArray,B.index,B.sourceLayerIndex,m.index,na,Ka,jo,Je,Fa,bo,xs,pn,B,Zt,vr,Sr,ie)};if(_s==="line")for(var Us=0,Bu=JE(B.geometry,0,0,Vo,Vo);Us<Bu.length;Us+=1)for(var Oc=Bu[Us],hh=jg(Oc,ya,No,K.vertical||Rn,bt,pi,ba,m.overscaling,Vo),Xu=0,Dc=hh;Xu<Dc.length;Xu+=1){var Nu=Dc[Xu],Oh=Rn;(!Oh||!d$(m,Oh.text,Fs,Nu))&&Rs(Oc,Nu)}else if(_s==="line-center")for(var ih=0,Of=B.geometry;ih<Of.length;ih+=1){var Kd=Of[ih];if(Kd.length>1){var id=V0(Kd,No,K.vertical||Rn,bt,pi,ba);id&&Rs(Kd,id)}}else if(B.type==="Polygon")for(var yp=0,xp=em(B.geometry,0);yp<xp.length;yp+=1){var _p=xp[yp],Rd=o$(_p,16);Rs(_p[0],new qv(Rd.x,Rd.y,0))}else if(B.type==="LineString")for(var Cp=0,Lp=B.geometry;Cp<Lp.length;Cp+=1){var yd=Lp[Cp];Rs(yd,new qv(yd[0].x,yd[0].y,0))}else if(B.type==="Point")for(var Pp=0,T0=B.geometry;Pp<T0.length;Pp+=1)for(var Hg=T0[Pp],Yv=0,Kv=Hg;Yv<Kv.length;Yv+=1){var Xv=Kv[Yv];Rs([Xv],new qv(Xv.x,Xv.y,0))}}var Wb=255,$v=Wb*ed;function rC(m,B,K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn,Rn){var pi=i$(B,K,De,Ot,Zt,ie,bt,m.allowVerticalPlacement),la=m.textSizeData,na=null;la.kind==="source"?(na=[ed*Ot.layout.get("text-size").evaluate(ie,{})],na[0]>$v&&q(m.layerIds[0]+': Value for "text-size" is >= '+Wb+'. Reduce your "text-size".')):la.kind==="composite"&&(na=[ed*pn.compositeTextSizes[0].evaluate(ie,{},Rn),ed*pn.compositeTextSizes[1].evaluate(ie,{},Rn)],(na[0]>$v||na[1]>$v)&&q(m.layerIds[0]+': Value for "text-size" is >= '+Wb+'. Reduce your "text-size".')),m.addSymbols(m.text,pi,na,De,Zt,ie,vr,B,Je.lineStartIndex,Je.lineLength,nn,Rn);for(var ba=0,Fa=Sr;ba<Fa.length;ba+=1){var ya=Fa[ba];Yr[ya]=m.text.placedSymbolArray.length-1}return pi.length*4}function nC(m){for(var B in m)return m[B];return null}function f$(m,B,K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn,pn,Rn,pi,la,na,ba,Fa,ya,Ka,bo,No,jo){var xs,_s=m.addToLineVertexArray(B,K),Fs,$s,sl,Rs,Us=0,Bu=0,Oc=0,hh=0,Xu=-1,Dc=-1,Nu={},Oh=Ut(""),ih=0,Of=0;if(De._unevaluatedLayout.getValue("text-radial-offset")===void 0?(xs=De.layout.get("text-offset").evaluate(ya,{},No).map(function($b){return $b*Er}),ih=xs[0],Of=xs[1]):(ih=De.layout.get("text-radial-offset").evaluate(ya,{},No)*Er,Of=r8),m.allowVerticalPlacement&&bt.vertical){var Kd=De.layout.get("text-rotate").evaluate(ya,{},No),id=Kd+90,yp=bt.vertical;sl=new d5(Je,B,vr,Sr,Yr,yp,nn,pn,Rn,id),ie&&(Rs=new d5(Je,B,vr,Sr,Yr,ie,la,na,Rn,id))}if(Ot){var xp=De.layout.get("icon-rotate").evaluate(ya,{}),_p=De.layout.get("icon-text-fit")!=="none",Rd=QE(Ot,xp,bo,_p),Cp=ie?QE(ie,xp,bo,_p):void 0;$s=new d5(Je,B,vr,Sr,Yr,Ot,la,na,!1,xp),Us=Rd.length*4;var Lp=m.iconSizeData,yd=null;Lp.kind==="source"?(yd=[ed*De.layout.get("icon-size").evaluate(ya,{})],yd[0]>$v&&q(m.layerIds[0]+': Value for "icon-size" is >= '+Wb+'. Reduce your "icon-size".')):Lp.kind==="composite"&&(yd=[ed*Ka.compositeIconSizes[0].evaluate(ya,{},No),ed*Ka.compositeIconSizes[1].evaluate(ya,{},No)],(yd[0]>$v||yd[1]>$v)&&q(m.layerIds[0]+': Value for "icon-size" is >= '+Wb+'. Reduce your "icon-size".')),m.addSymbols(m.icon,Rd,yd,Fa,ba,ya,!1,B,_s.lineStartIndex,_s.lineLength,-1,No),Xu=m.icon.placedSymbolArray.length-1,Cp&&(Bu=Cp.length*4,m.addSymbols(m.icon,Cp,yd,Fa,ba,ya,$h.vertical,B,_s.lineStartIndex,_s.lineLength,-1,No),Dc=m.icon.placedSymbolArray.length-1)}for(var Pp in bt.horizontal){var T0=bt.horizontal[Pp];if(!Fs){Oh=Ut(T0.text);var Hg=De.layout.get("text-rotate").evaluate(ya,{},No);Fs=new d5(Je,B,vr,Sr,Yr,T0,nn,pn,Rn,Hg)}var Yv=T0.positionedLines.length===1;if(Oc+=rC(m,B,T0,Zt,De,Rn,ya,pi,_s,bt.vertical?$h.horizontal:$h.horizontalOnly,Yv?Object.keys(bt.horizontal):[Pp],Nu,Xu,Ka,No),Yv)break}bt.vertical&&(hh+=rC(m,B,bt.vertical,Zt,De,Rn,ya,pi,_s,$h.vertical,["vertical"],Nu,Dc,Ka,No));var Kv=Fs?Fs.boxStartIndex:m.collisionBoxArray.length,Xv=Fs?Fs.boxEndIndex:m.collisionBoxArray.length,$x=sl?sl.boxStartIndex:m.collisionBoxArray.length,nm=sl?sl.boxEndIndex:m.collisionBoxArray.length,y5=$s?$s.boxStartIndex:m.collisionBoxArray.length,u8=$s?$s.boxEndIndex:m.collisionBoxArray.length,x5=Rs?Rs.boxStartIndex:m.collisionBoxArray.length,c8=Rs?Rs.boxEndIndex:m.collisionBoxArray.length,W0=-1,Gx=function($b,xC){return $b&&$b.circleDiameter?Math.max($b.circleDiameter,xC):xC};W0=Gx(Fs,W0),W0=Gx(sl,W0),W0=Gx($s,W0),W0=Gx(Rs,W0);var _5=W0>-1?1:0;_5&&(W0*=jo/Er),m.glyphOffsetArray.length>=Gc.MAX_GLYPHS&&q("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ya.sortKey!==void 0&&m.addToSortKeyRanges(m.symbolInstances.length,ya.sortKey),m.symbolInstances.emplaceBack(B.x,B.y,Nu.right>=0?Nu.right:-1,Nu.center>=0?Nu.center:-1,Nu.left>=0?Nu.left:-1,Nu.vertical||-1,Xu,Dc,Oh,Kv,Xv,$x,nm,y5,u8,x5,c8,vr,Oc,hh,Us,Bu,_5,0,nn,ih,Of,W0)}function d$(m,B,K,bt){var Ot=m.compareText;if(!(B in Ot))Ot[B]=[];else for(var Zt=Ot[B],ie=Zt.length-1;ie>=0;ie--)if(bt.dist(Zt[ie])<K)return!0;return Ot[B].push(bt),!1}var p$=Ng.VectorTileFeature.types,m$=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function p5(m,B,K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr,nn){var pn=De?Math.min($v,Math.round(De[0])):0,Rn=De?Math.min($v,Math.round(De[1])):0;m.emplaceBack(B,K,Math.round(bt*32),Math.round(Ot*32),Zt,ie,(pn<<1)+(Je?1:0),Rn,vr*16,Sr*16,Yr*256,nn*256)}function i8(m,B,K){m.emplaceBack(B.x,B.y,K),m.emplaceBack(B.x,B.y,K),m.emplaceBack(B.x,B.y,K),m.emplaceBack(B.x,B.y,K)}function g$(m){for(var B=0,K=m.sections;B<K.length;B+=1){var bt=K[B];if(Lo(bt.text))return!0}return!1}var Hx=function(m){this.layoutVertexArray=new $i,this.indexArray=new So,this.programConfigurations=m,this.segments=new yl,this.dynamicLayoutVertexArray=new _a,this.opacityVertexArray=new Po,this.placedSymbolArray=new ku};Hx.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},Hx.prototype.upload=function(m,B,K,bt){this.isEmpty()||(K&&(this.layoutVertexBuffer=m.createVertexBuffer(this.layoutVertexArray,D.members),this.indexBuffer=m.createIndexBuffer(this.indexArray,B),this.dynamicLayoutVertexBuffer=m.createVertexBuffer(this.dynamicLayoutVertexArray,nt.members,!0),this.opacityVertexBuffer=m.createVertexBuffer(this.opacityVertexArray,m$,!0),this.opacityVertexBuffer.itemSize=1),(K||bt)&&this.programConfigurations.upload(m))},Hx.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},sr("SymbolBuffers",Hx);var qb=function(m,B,K){this.layoutVertexArray=new m,this.layoutAttributes=B,this.indexArray=new K,this.segments=new yl,this.collisionVertexArray=new ho};qb.prototype.upload=function(m){this.layoutVertexBuffer=m.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=m.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=m.createVertexBuffer(this.collisionVertexArray,_t.members,!0)},qb.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},sr("CollisionBuffers",qb);var Gc=function(m){this.collisionBoxArray=m.collisionBoxArray,this.zoom=m.zoom,this.overscaling=m.overscaling,this.layers=m.layers,this.layerIds=this.layers.map(function(De){return De.id}),this.index=m.index,this.pixelRatio=m.pixelRatio,this.sourceLayerIndex=m.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=B0([]),this.placementViewportMatrix=B0([]);var B=this.layers[0],K=B._unevaluatedLayout._values;this.textSizeData=Zv(this.zoom,K["text-size"]),this.iconSizeData=Zv(this.zoom,K["icon-size"]);var bt=this.layers[0].layout,Ot=bt.get("symbol-sort-key"),Zt=bt.get("symbol-z-order");this.canOverlap=bt.get("text-allow-overlap")||bt.get("icon-allow-overlap")||bt.get("text-ignore-placement")||bt.get("icon-ignore-placement"),this.sortFeaturesByKey=Zt!=="viewport-y"&&Ot.constantOr(1)!==void 0;var ie=Zt==="viewport-y"||Zt==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=ie&&this.canOverlap,bt.get("symbol-placement")==="point"&&(this.writingModes=bt.get("text-writing-mode").map(function(De){return $h[De]})),this.stateDependentLayerIds=this.layers.filter(function(De){return De.isStateDependent()}).map(function(De){return De.id}),this.sourceID=m.sourceID};Gc.prototype.createArrays=function(){this.text=new Hx(new Si(this.layers,this.zoom,function(m){return/^text/.test(m)})),this.icon=new Hx(new Si(this.layers,this.zoom,function(m){return/^icon/.test(m)})),this.glyphOffsetArray=new ol,this.lineVertexArray=new Cu,this.symbolInstances=new Tu},Gc.prototype.calculateGlyphDependencies=function(m,B,K,bt,Ot){for(var Zt=0;Zt<m.length;Zt++)if(B[m.charCodeAt(Zt)]=!0,(K||bt)&&Ot){var ie=er[m.charAt(Zt)];ie&&(B[ie.charCodeAt(0)]=!0)}},Gc.prototype.populate=function(m,B,K){var bt=this.layers[0],Ot=bt.layout,Zt=Ot.get("text-font"),ie=Ot.get("text-field"),De=Ot.get("icon-image"),Je=(ie.value.kind!=="constant"||ie.value.value instanceof hc&&!ie.value.value.isEmpty()||ie.value.value.toString().length>0)&&(Zt.value.kind!=="constant"||Zt.value.value.length>0),vr=De.value.kind!=="constant"||!!De.value.value||Object.keys(De.parameters).length>0,Sr=Ot.get("symbol-sort-key");if(this.features=[],!(!Je&&!vr)){for(var Yr=B.iconDependencies,nn=B.glyphDependencies,pn=B.availableImages,Rn=new Bl(this.zoom),pi=0,la=m;pi<la.length;pi+=1){var na=la[pi],ba=na.feature,Fa=na.id,ya=na.index,Ka=na.sourceLayerIndex,bo=bt._featureFilter.needGeometry,No=Ul(ba,bo);if(bt._featureFilter.filter(Rn,No,K)){bo||(No.geometry=dl(ba));var jo=void 0;if(Je){var xs=bt.getValueAndResolveTokens("text-field",No,K,pn),_s=hc.factory(xs);g$(_s)&&(this.hasRTLText=!0),(!this.hasRTLText||_o()==="unavailable"||this.hasRTLText&&Gl.isParsed())&&(jo=be(_s,bt,No))}var Fs=void 0;if(vr){var $s=bt.getValueAndResolveTokens("icon-image",No,K,pn);$s instanceof oc?Fs=$s:Fs=oc.fromString($s)}if(!(!jo&&!Fs)){var sl=this.sortFeaturesByKey?Sr.evaluate(No,{},K):void 0,Rs={id:Fa,text:jo,icon:Fs,index:ya,sourceLayerIndex:Ka,geometry:No.geometry,properties:ba.properties,type:p$[ba.type],sortKey:sl};if(this.features.push(Rs),Fs&&(Yr[Fs.name]=!0),jo){var Us=Zt.evaluate(No,{},K).join(","),Bu=Ot.get("text-rotation-alignment")==="map"&&Ot.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf($h.vertical)>=0;for(var Oc=0,hh=jo.sections;Oc<hh.length;Oc+=1){var Xu=hh[Oc];if(Xu.image)Yr[Xu.image.name]=!0;else{var Dc=Bi(jo.toString()),Nu=Xu.fontStack||Us,Oh=nn[Nu]=nn[Nu]||{};this.calculateGlyphDependencies(Xu.text,Oh,Bu,this.allowVerticalPlacement,Dc)}}}}}}Ot.get("symbol-placement")==="line"&&(this.features=Fe(this.features)),this.sortFeaturesByKey&&this.features.sort(function(ih,Of){return ih.sortKey-Of.sortKey})}},Gc.prototype.update=function(m,B,K){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(m,B,this.layers,K),this.icon.programConfigurations.updatePaintArrays(m,B,this.layers,K))},Gc.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Gc.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Gc.prototype.upload=function(m){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(m),this.iconCollisionBox.upload(m)),this.text.upload(m,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(m,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Gc.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Gc.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Gc.prototype.addToLineVertexArray=function(m,B){var K=this.lineVertexArray.length;if(m.segment!==void 0){for(var bt=m.dist(B[m.segment+1]),Ot=m.dist(B[m.segment]),Zt={},ie=m.segment+1;ie<B.length;ie++)Zt[ie]={x:B[ie].x,y:B[ie].y,tileUnitDistanceFromAnchor:bt},ie<B.length-1&&(bt+=B[ie+1].dist(B[ie]));for(var De=m.segment||0;De>=0;De--)Zt[De]={x:B[De].x,y:B[De].y,tileUnitDistanceFromAnchor:Ot},De>0&&(Ot+=B[De-1].dist(B[De]));for(var Je=0;Je<B.length;Je++){var vr=Zt[Je];this.lineVertexArray.emplaceBack(vr.x,vr.y,vr.tileUnitDistanceFromAnchor)}}return{lineStartIndex:K,lineLength:this.lineVertexArray.length-K}},Gc.prototype.addSymbols=function(m,B,K,bt,Ot,Zt,ie,De,Je,vr,Sr,Yr){for(var nn=m.indexArray,pn=m.layoutVertexArray,Rn=m.segments.prepareSegment(4*B.length,pn,nn,this.canOverlap?Zt.sortKey:void 0),pi=this.glyphOffsetArray.length,la=Rn.vertexLength,na=this.allowVerticalPlacement&&ie===$h.vertical?Math.PI/2:0,ba=Zt.text&&Zt.text.sections,Fa=0;Fa<B.length;Fa++){var ya=B[Fa],Ka=ya.tl,bo=ya.tr,No=ya.bl,jo=ya.br,xs=ya.tex,_s=ya.pixelOffsetTL,Fs=ya.pixelOffsetBR,$s=ya.minFontScaleX,sl=ya.minFontScaleY,Rs=ya.glyphOffset,Us=ya.isSDF,Bu=ya.sectionIndex,Oc=Rn.vertexLength,hh=Rs[1];p5(pn,De.x,De.y,Ka.x,hh+Ka.y,xs.x,xs.y,K,Us,_s.x,_s.y,$s,sl),p5(pn,De.x,De.y,bo.x,hh+bo.y,xs.x+xs.w,xs.y,K,Us,Fs.x,_s.y,$s,sl),p5(pn,De.x,De.y,No.x,hh+No.y,xs.x,xs.y+xs.h,K,Us,_s.x,Fs.y,$s,sl),p5(pn,De.x,De.y,jo.x,hh+jo.y,xs.x+xs.w,xs.y+xs.h,K,Us,Fs.x,Fs.y,$s,sl),i8(m.dynamicLayoutVertexArray,De,na),nn.emplaceBack(Oc,Oc+1,Oc+2),nn.emplaceBack(Oc+1,Oc+2,Oc+3),Rn.vertexLength+=4,Rn.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Rs[0]),(Fa===B.length-1||Bu!==B[Fa+1].sectionIndex)&&m.programConfigurations.populatePaintArrays(pn.length,Zt,Zt.index,{},Yr,ba&&ba[Bu])}m.placedSymbolArray.emplaceBack(De.x,De.y,pi,this.glyphOffsetArray.length-pi,la,Je,vr,De.segment,K?K[0]:0,K?K[1]:0,bt[0],bt[1],ie,0,!1,0,Sr)},Gc.prototype._addCollisionDebugVertex=function(m,B,K,bt,Ot,Zt){return B.emplaceBack(0,0),m.emplaceBack(K.x,K.y,bt,Ot,Math.round(Zt.x),Math.round(Zt.y))},Gc.prototype.addCollisionDebugVertices=function(m,B,K,bt,Ot,Zt,ie){var De=Ot.segments.prepareSegment(4,Ot.layoutVertexArray,Ot.indexArray),Je=De.vertexLength,vr=Ot.layoutVertexArray,Sr=Ot.collisionVertexArray,Yr=ie.anchorX,nn=ie.anchorY;this._addCollisionDebugVertex(vr,Sr,Zt,Yr,nn,new o(m,B)),this._addCollisionDebugVertex(vr,Sr,Zt,Yr,nn,new o(K,B)),this._addCollisionDebugVertex(vr,Sr,Zt,Yr,nn,new o(K,bt)),this._addCollisionDebugVertex(vr,Sr,Zt,Yr,nn,new o(m,bt)),De.vertexLength+=4;var pn=Ot.indexArray;pn.emplaceBack(Je,Je+1),pn.emplaceBack(Je+1,Je+2),pn.emplaceBack(Je+2,Je+3),pn.emplaceBack(Je+3,Je),De.primitiveLength+=4},Gc.prototype.addDebugCollisionBoxes=function(m,B,K,bt){for(var Ot=m;Ot<B;Ot++){var Zt=this.collisionBoxArray.get(Ot),ie=Zt.x1,De=Zt.y1,Je=Zt.x2,vr=Zt.y2;this.addCollisionDebugVertices(ie,De,Je,vr,bt?this.textCollisionBox:this.iconCollisionBox,Zt.anchorPoint,K)}},Gc.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new qb(xa,Rt.members,fl),this.iconCollisionBox=new qb(xa,Rt.members,fl);for(var m=0;m<this.symbolInstances.length;m++){var B=this.symbolInstances.get(m);this.addDebugCollisionBoxes(B.textBoxStartIndex,B.textBoxEndIndex,B,!0),this.addDebugCollisionBoxes(B.verticalTextBoxStartIndex,B.verticalTextBoxEndIndex,B,!0),this.addDebugCollisionBoxes(B.iconBoxStartIndex,B.iconBoxEndIndex,B,!1),this.addDebugCollisionBoxes(B.verticalIconBoxStartIndex,B.verticalIconBoxEndIndex,B,!1)}},Gc.prototype._deserializeCollisionBoxesForSymbol=function(m,B,K,bt,Ot,Zt,ie,De,Je){for(var vr={},Sr=B;Sr<K;Sr++){var Yr=m.get(Sr);vr.textBox={x1:Yr.x1,y1:Yr.y1,x2:Yr.x2,y2:Yr.y2,anchorPointX:Yr.anchorPointX,anchorPointY:Yr.anchorPointY},vr.textFeatureIndex=Yr.featureIndex;break}for(var nn=bt;nn<Ot;nn++){var pn=m.get(nn);vr.verticalTextBox={x1:pn.x1,y1:pn.y1,x2:pn.x2,y2:pn.y2,anchorPointX:pn.anchorPointX,anchorPointY:pn.anchorPointY},vr.verticalTextFeatureIndex=pn.featureIndex;break}for(var Rn=Zt;Rn<ie;Rn++){var pi=m.get(Rn);vr.iconBox={x1:pi.x1,y1:pi.y1,x2:pi.x2,y2:pi.y2,anchorPointX:pi.anchorPointX,anchorPointY:pi.anchorPointY},vr.iconFeatureIndex=pi.featureIndex;break}for(var la=De;la<Je;la++){var na=m.get(la);vr.verticalIconBox={x1:na.x1,y1:na.y1,x2:na.x2,y2:na.y2,anchorPointX:na.anchorPointX,anchorPointY:na.anchorPointY},vr.verticalIconFeatureIndex=na.featureIndex;break}return vr},Gc.prototype.deserializeCollisionBoxes=function(m){this.collisionArrays=[];for(var B=0;B<this.symbolInstances.length;B++){var K=this.symbolInstances.get(B);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(m,K.textBoxStartIndex,K.textBoxEndIndex,K.verticalTextBoxStartIndex,K.verticalTextBoxEndIndex,K.iconBoxStartIndex,K.iconBoxEndIndex,K.verticalIconBoxStartIndex,K.verticalIconBoxEndIndex))}},Gc.prototype.hasTextData=function(){return this.text.segments.get().length>0},Gc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Gc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Gc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Gc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Gc.prototype.addIndicesForPlacedSymbol=function(m,B){for(var K=m.placedSymbolArray.get(B),bt=K.vertexStartIndex+K.numGlyphs*4,Ot=K.vertexStartIndex;Ot<bt;Ot+=4)m.indexArray.emplaceBack(Ot,Ot+1,Ot+2),m.indexArray.emplaceBack(Ot+1,Ot+2,Ot+3)},Gc.prototype.getSortedSymbolIndexes=function(m){if(this.sortedAngle===m&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var B=Math.sin(m),K=Math.cos(m),bt=[],Ot=[],Zt=[],ie=0;ie<this.symbolInstances.length;++ie){Zt.push(ie);var De=this.symbolInstances.get(ie);bt.push(Math.round(B*De.anchorX+K*De.anchorY)|0),Ot.push(De.featureIndex)}return Zt.sort(function(Je,vr){return bt[Je]-bt[vr]||Ot[vr]-Ot[Je]}),Zt},Gc.prototype.addToSortKeyRanges=function(m,B){var K=this.sortKeyRanges[this.sortKeyRanges.length-1];K&&K.sortKey===B?K.symbolInstanceEnd=m+1:this.sortKeyRanges.push({sortKey:B,symbolInstanceStart:m,symbolInstanceEnd:m+1})},Gc.prototype.sortFeatures=function(m){var B=this;if(this.sortFeaturesByY&&this.sortedAngle!==m&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(m),this.sortedAngle=m,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var K=0,bt=this.symbolInstanceIndexes;K<bt.length;K+=1){var Ot=bt[K],Zt=this.symbolInstances.get(Ot);this.featureSortOrder.push(Zt.featureIndex),[Zt.rightJustifiedTextSymbolIndex,Zt.centerJustifiedTextSymbolIndex,Zt.leftJustifiedTextSymbolIndex].forEach(function(ie,De,Je){ie>=0&&Je.indexOf(ie)===De&&B.addIndicesForPlacedSymbol(B.text,ie)}),Zt.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Zt.verticalPlacedTextSymbolIndex),Zt.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Zt.placedIconSymbolIndex),Zt.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Zt.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},sr("SymbolBucket",Gc,{omit:["layers","collisionBoxArray","features","compareText"]}),Gc.MAX_GLYPHS=65535,Gc.addDynamicAttributes=i8;function v$(m,B){return B.replace(/{([^{}]+)}/g,function(K,bt){return bt in m?String(m[bt]):""})}var y$=new Za({"symbol-placement":new gn(La.layout_symbol["symbol-placement"]),"symbol-spacing":new gn(La.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new gn(La.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ni(La.layout_symbol["symbol-sort-key"]),"symbol-z-order":new gn(La.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new gn(La.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new gn(La.layout_symbol["icon-ignore-placement"]),"icon-optional":new gn(La.layout_symbol["icon-optional"]),"icon-rotation-alignment":new gn(La.layout_symbol["icon-rotation-alignment"]),"icon-size":new ni(La.layout_symbol["icon-size"]),"icon-text-fit":new gn(La.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new gn(La.layout_symbol["icon-text-fit-padding"]),"icon-image":new ni(La.layout_symbol["icon-image"]),"icon-rotate":new ni(La.layout_symbol["icon-rotate"]),"icon-padding":new gn(La.layout_symbol["icon-padding"]),"icon-keep-upright":new gn(La.layout_symbol["icon-keep-upright"]),"icon-offset":new ni(La.layout_symbol["icon-offset"]),"icon-anchor":new ni(La.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new gn(La.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new gn(La.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new gn(La.layout_symbol["text-rotation-alignment"]),"text-field":new ni(La.layout_symbol["text-field"]),"text-font":new ni(La.layout_symbol["text-font"]),"text-size":new ni(La.layout_symbol["text-size"]),"text-max-width":new ni(La.layout_symbol["text-max-width"]),"text-line-height":new gn(La.layout_symbol["text-line-height"]),"text-letter-spacing":new ni(La.layout_symbol["text-letter-spacing"]),"text-justify":new ni(La.layout_symbol["text-justify"]),"text-radial-offset":new ni(La.layout_symbol["text-radial-offset"]),"text-variable-anchor":new gn(La.layout_symbol["text-variable-anchor"]),"text-anchor":new ni(La.layout_symbol["text-anchor"]),"text-max-angle":new gn(La.layout_symbol["text-max-angle"]),"text-writing-mode":new gn(La.layout_symbol["text-writing-mode"]),"text-rotate":new ni(La.layout_symbol["text-rotate"]),"text-padding":new gn(La.layout_symbol["text-padding"]),"text-keep-upright":new gn(La.layout_symbol["text-keep-upright"]),"text-transform":new ni(La.layout_symbol["text-transform"]),"text-offset":new ni(La.layout_symbol["text-offset"]),"text-allow-overlap":new gn(La.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new gn(La.layout_symbol["text-ignore-placement"]),"text-optional":new gn(La.layout_symbol["text-optional"])}),x$=new Za({"icon-opacity":new ni(La.paint_symbol["icon-opacity"]),"icon-color":new ni(La.paint_symbol["icon-color"]),"icon-halo-color":new ni(La.paint_symbol["icon-halo-color"]),"icon-halo-width":new ni(La.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ni(La.paint_symbol["icon-halo-blur"]),"icon-translate":new gn(La.paint_symbol["icon-translate"]),"icon-translate-anchor":new gn(La.paint_symbol["icon-translate-anchor"]),"text-opacity":new ni(La.paint_symbol["text-opacity"]),"text-color":new ni(La.paint_symbol["text-color"],{runtimeType:nu,getOverride:function(m){return m.textColor},hasOverride:function(m){return!!m.textColor}}),"text-halo-color":new ni(La.paint_symbol["text-halo-color"]),"text-halo-width":new ni(La.paint_symbol["text-halo-width"]),"text-halo-blur":new ni(La.paint_symbol["text-halo-blur"]),"text-translate":new gn(La.paint_symbol["text-translate"]),"text-translate-anchor":new gn(La.paint_symbol["text-translate-anchor"])}),a8={paint:x$,layout:y$},Wx=function(m){this.type=m.property.overrides?m.property.overrides.runtimeType:Fu,this.defaultValue=m};Wx.prototype.evaluate=function(m){if(m.formattedSection){var B=this.defaultValue.property.overrides;if(B&&B.hasOverride(m.formattedSection))return B.getOverride(m.formattedSection)}return m.feature&&m.featureState?this.defaultValue.evaluate(m.feature,m.featureState):this.defaultValue.property.specification.default},Wx.prototype.eachChild=function(m){if(!this.defaultValue.isConstant()){var B=this.defaultValue.value;m(B._styleExpression.expression)}},Wx.prototype.outputDefined=function(){return!1},Wx.prototype.serialize=function(){return null},sr("FormatSectionOverride",Wx,{omit:["defaultValue"]});var _$=function(m){function B(K){m.call(this,K,a8)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.recalculate=function(K,bt){if(m.prototype.recalculate.call(this,K,bt),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 Ot=this.layout.get("text-writing-mode");if(Ot){for(var Zt=[],ie=0,De=Ot;ie<De.length;ie+=1){var Je=De[ie];Zt.indexOf(Je)<0&&Zt.push(Je)}this.layout._values["text-writing-mode"]=Zt}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},B.prototype.getValueAndResolveTokens=function(K,bt,Ot,Zt){var ie=this.layout.get(K).evaluate(bt,{},Ot,Zt),De=this._unevaluatedLayout._values[K];return!De.isDataDriven()&&!es(De.value)&&ie?v$(bt.properties,ie):ie},B.prototype.createBucket=function(K){return new Gc(K)},B.prototype.queryRadius=function(){return 0},B.prototype.queryIntersectsFeature=function(){return!1},B.prototype._setPaintOverrides=function(){for(var K=0,bt=a8.paint.overridableProperties;K<bt.length;K+=1){var Ot=bt[K];if(B.hasPaintOverride(this.layout,Ot)){var Zt=this.paint.get(Ot),ie=new Wx(Zt),De=new Ih(ie,Zt.property.specification),Je=null;Zt.value.kind==="constant"||Zt.value.kind==="source"?Je=new qc("source",De):Je=new Zu("composite",De,Zt.value.zoomStops,Zt.value._interpolationType),this.paint._values[Ot]=new oi(Zt.property,Je,Zt.parameters)}}},B.prototype._handleOverridablePaintPropertyUpdate=function(K,bt,Ot){return!this.layout||bt.isDataDriven()||Ot.isDataDriven()?!1:B.hasPaintOverride(this.layout,K)},B.hasPaintOverride=function(K,bt){var Ot=K.get("text-field"),Zt=a8.paint.properties[bt],ie=!1,De=function(Sr){for(var Yr=0,nn=Sr;Yr<nn.length;Yr+=1){var pn=nn[Yr];if(Zt.overrides&&Zt.overrides.hasOverride(pn)){ie=!0;return}}};if(Ot.value.kind==="constant"&&Ot.value.value instanceof hc)De(Ot.value.value.sections);else if(Ot.value.kind==="source"){var Je=function(Sr){if(!ie)if(Sr instanceof el&&su(Sr.value)===_l){var Yr=Sr.value;De(Yr.sections)}else Sr instanceof jh?De(Sr.sections):Sr.eachChild(Je)},vr=Ot.value;vr._styleExpression&&Je(vr._styleExpression.expression)}return ie},B}(ta),b$=new Za({"background-color":new gn(La.paint_background["background-color"]),"background-pattern":new Ui(La.paint_background["background-pattern"]),"background-opacity":new gn(La.paint_background["background-opacity"])}),w$={paint:b$},k$=function(m){function B(K){m.call(this,K,w$)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B}(ta),T$=new Za({"raster-opacity":new gn(La.paint_raster["raster-opacity"]),"raster-hue-rotate":new gn(La.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new gn(La.paint_raster["raster-brightness-min"]),"raster-brightness-max":new gn(La.paint_raster["raster-brightness-max"]),"raster-saturation":new gn(La.paint_raster["raster-saturation"]),"raster-contrast":new gn(La.paint_raster["raster-contrast"]),"raster-resampling":new gn(La.paint_raster["raster-resampling"]),"raster-fade-duration":new gn(La.paint_raster["raster-fade-duration"])}),A$={paint:T$},M$=function(m){function B(K){m.call(this,K,A$)}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B}(ta);function S$(m){var B=[],K=m.id;return K===void 0&&B.push({message:"layers."+K+': missing required property "id"'}),m.render===void 0&&B.push({message:"layers."+K+': missing required method "render"'}),m.renderingMode&&m.renderingMode!=="2d"&&m.renderingMode!=="3d"&&B.push({message:"layers."+K+': property "renderingMode" must be either "2d" or "3d"'}),B}var E$=function(m){function B(K){m.call(this,K,{}),this.implementation=K}return m&&(B.__proto__=m),B.prototype=Object.create(m&&m.prototype),B.prototype.constructor=B,B.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},B.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},B.prototype.recalculate=function(){},B.prototype.updateTransitions=function(){},B.prototype.hasTransition=function(){},B.prototype.serialize=function(){},B.prototype.onAdd=function(K){this.implementation.onAdd&&this.implementation.onAdd(K,K.painter.context.gl)},B.prototype.onRemove=function(K){this.implementation.onRemove&&this.implementation.onRemove(K,K.painter.context.gl)},B}(ta),C$={circle:gb,heatmap:$1,hillshade:Ax,fill:Eb,"fill-extrusion":YT,line:Fb,symbol:_$,background:k$,raster:M$};function L$(m){return m.type==="custom"?new E$(m):new C$[m.type](m)}var iC=s.HTMLImageElement,aC=s.HTMLCanvasElement,oC=s.HTMLVideoElement,sC=s.ImageData,m5=s.ImageBitmap,ty=function(m,B,K,bt){this.context=m,this.format=K,this.texture=m.gl.createTexture(),this.update(B,bt)};ty.prototype.update=function(m,B,K){var bt=m.width,Ot=m.height,Zt=(!this.size||this.size[0]!==bt||this.size[1]!==Ot)&&!K,ie=this,De=ie.context,Je=De.gl;if(this.useMipmap=!!(B&&B.useMipmap),Je.bindTexture(Je.TEXTURE_2D,this.texture),De.pixelStoreUnpackFlipY.set(!1),De.pixelStoreUnpack.set(1),De.pixelStoreUnpackPremultiplyAlpha.set(this.format===Je.RGBA&&(!B||B.premultiply!==!1)),Zt)this.size=[bt,Ot],m instanceof iC||m instanceof aC||m instanceof oC||m instanceof sC||m5&&m instanceof m5?Je.texImage2D(Je.TEXTURE_2D,0,this.format,this.format,Je.UNSIGNED_BYTE,m):Je.texImage2D(Je.TEXTURE_2D,0,this.format,bt,Ot,0,this.format,Je.UNSIGNED_BYTE,m.data);else{var vr=K||{x:0,y:0},Sr=vr.x,Yr=vr.y;m instanceof iC||m instanceof aC||m instanceof oC||m instanceof sC||m5&&m instanceof m5?Je.texSubImage2D(Je.TEXTURE_2D,0,Sr,Yr,Je.RGBA,Je.UNSIGNED_BYTE,m):Je.texSubImage2D(Je.TEXTURE_2D,0,Sr,Yr,bt,Ot,Je.RGBA,Je.UNSIGNED_BYTE,m.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Je.generateMipmap(Je.TEXTURE_2D)},ty.prototype.bind=function(m,B,K){var bt=this,Ot=bt.context,Zt=Ot.gl;Zt.bindTexture(Zt.TEXTURE_2D,this.texture),K===Zt.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(K=Zt.LINEAR),m!==this.filter&&(Zt.texParameteri(Zt.TEXTURE_2D,Zt.TEXTURE_MAG_FILTER,m),Zt.texParameteri(Zt.TEXTURE_2D,Zt.TEXTURE_MIN_FILTER,K||m),this.filter=m),B!==this.wrap&&(Zt.texParameteri(Zt.TEXTURE_2D,Zt.TEXTURE_WRAP_S,B),Zt.texParameteri(Zt.TEXTURE_2D,Zt.TEXTURE_WRAP_T,B),this.wrap=B)},ty.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0},ty.prototype.destroy=function(){var m=this.context,B=m.gl;B.deleteTexture(this.texture),this.texture=null};var o8=function(m){var B=this;this._callback=m,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){B._triggered=!1,B._callback()})};o8.prototype.trigger=function(){var m=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){m._triggered=!1,m._callback()},0))},o8.prototype.remove=function(){delete this._channel,this._callback=function(){}};var qx=function(m,B,K){this.target=m,this.parent=B,this.mapId=K,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},O(["receive","process"],this),this.invoker=new o8(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=pt()?m:s};qx.prototype.send=function(m,B,K,bt,Ot){var Zt=this;Ot===void 0&&(Ot=!1);var ie=Math.round(Math.random()*1e18).toString(36).substring(0,10);K&&(this.callbacks[ie]=K);var De=dt(this.globalScope)?void 0:[];return this.target.postMessage({id:ie,type:m,hasCallback:!!K,targetMapId:bt,mustQueue:Ot,sourceMapId:this.mapId,data:Xr(B,De)},De),{cancel:function(){K&&delete Zt.callbacks[ie],Zt.target.postMessage({id:ie,type:"<cancel>",targetMapId:bt,sourceMapId:Zt.mapId})}}},qx.prototype.receive=function(m){var B=m.data,K=B.id;if(K&&!(B.targetMapId&&this.mapId!==B.targetMapId))if(B.type==="<cancel>"){delete this.tasks[K];var bt=this.cancelCallbacks[K];delete this.cancelCallbacks[K],bt&&bt()}else pt()||B.mustQueue?(this.tasks[K]=B,this.taskQueue.push(K),this.invoker.trigger()):this.processTask(K,B)},qx.prototype.process=function(){if(this.taskQueue.length){var m=this.taskQueue.shift(),B=this.tasks[m];delete this.tasks[m],this.taskQueue.length&&this.invoker.trigger(),B&&this.processTask(m,B)}},qx.prototype.processTask=function(m,B){var K=this;if(B.type==="<response>"){var bt=this.callbacks[m];delete this.callbacks[m],bt&&(B.error?bt(vn(B.error)):bt(null,vn(B.data)))}else{var Ot=!1,Zt=dt(this.globalScope)?void 0:[],ie=B.hasCallback?function(Yr,nn){Ot=!0,delete K.cancelCallbacks[m],K.target.postMessage({id:m,type:"<response>",sourceMapId:K.mapId,error:Yr?Xr(Yr):null,data:Xr(nn,Zt)},Zt)}:function(Yr){Ot=!0},De=null,Je=vn(B.data);if(this.parent[B.type])De=this.parent[B.type](B.sourceMapId,Je,ie);else if(this.parent.getWorkerSource){var vr=B.type.split("."),Sr=this.parent.getWorkerSource(B.sourceMapId,vr[0],Je.source);De=Sr[vr[1]](Je,ie)}else ie(new Error("Could not find function "+B.type));!Ot&&De&&De.cancel&&(this.cancelCallbacks[m]=De.cancel)}},qx.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function P$(m,B,K){B=Math.pow(2,K)-B-1;var bt=lC(m*256,B*256,K),Ot=lC((m+1)*256,(B+1)*256,K);return bt[0]+","+bt[1]+","+Ot[0]+","+Ot[1]}function lC(m,B,K){var bt=2*Math.PI*6378137/256/Math.pow(2,K),Ot=m*bt-2*Math.PI*6378137/2,Zt=B*bt-2*Math.PI*6378137/2;return[Ot,Zt]}var rd=function(m,B){m&&(B?this.setSouthWest(m).setNorthEast(B):m.length===4?this.setSouthWest([m[0],m[1]]).setNorthEast([m[2],m[3]]):this.setSouthWest(m[0]).setNorthEast(m[1]))};rd.prototype.setNorthEast=function(m){return this._ne=m instanceof Gh?new Gh(m.lng,m.lat):Gh.convert(m),this},rd.prototype.setSouthWest=function(m){return this._sw=m instanceof Gh?new Gh(m.lng,m.lat):Gh.convert(m),this},rd.prototype.extend=function(m){var B=this._sw,K=this._ne,bt,Ot;if(m instanceof Gh)bt=m,Ot=m;else if(m instanceof rd){if(bt=m._sw,Ot=m._ne,!bt||!Ot)return this}else{if(Array.isArray(m))if(m.length===4||m.every(Array.isArray)){var Zt=m;return this.extend(rd.convert(Zt))}else{var ie=m;return this.extend(Gh.convert(ie))}return this}return!B&&!K?(this._sw=new Gh(bt.lng,bt.lat),this._ne=new Gh(Ot.lng,Ot.lat)):(B.lng=Math.min(bt.lng,B.lng),B.lat=Math.min(bt.lat,B.lat),K.lng=Math.max(Ot.lng,K.lng),K.lat=Math.max(Ot.lat,K.lat)),this},rd.prototype.getCenter=function(){return new Gh((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},rd.prototype.getSouthWest=function(){return this._sw},rd.prototype.getNorthEast=function(){return this._ne},rd.prototype.getNorthWest=function(){return new Gh(this.getWest(),this.getNorth())},rd.prototype.getSouthEast=function(){return new Gh(this.getEast(),this.getSouth())},rd.prototype.getWest=function(){return this._sw.lng},rd.prototype.getSouth=function(){return this._sw.lat},rd.prototype.getEast=function(){return this._ne.lng},rd.prototype.getNorth=function(){return this._ne.lat},rd.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},rd.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},rd.prototype.isEmpty=function(){return!(this._sw&&this._ne)},rd.prototype.contains=function(m){var B=Gh.convert(m),K=B.lng,bt=B.lat,Ot=this._sw.lat<=bt&&bt<=this._ne.lat,Zt=this._sw.lng<=K&&K<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Zt=this._sw.lng>=K&&K>=this._ne.lng),Ot&&Zt},rd.convert=function(m){return!m||m instanceof rd?m:new rd(m)};var uC=63710088e-1,Gh=function(m,B){if(isNaN(m)||isNaN(B))throw new Error("Invalid LngLat object: ("+m+", "+B+")");if(this.lng=+m,this.lat=+B,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Gh.prototype.wrap=function(){return new Gh(b(this.lng,-180,180),this.lat)},Gh.prototype.toArray=function(){return[this.lng,this.lat]},Gh.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Gh.prototype.distanceTo=function(m){var B=Math.PI/180,K=this.lat*B,bt=m.lat*B,Ot=Math.sin(K)*Math.sin(bt)+Math.cos(K)*Math.cos(bt)*Math.cos((m.lng-this.lng)*B),Zt=uC*Math.acos(Math.min(Ot,1));return Zt},Gh.prototype.toBounds=function(m){m===void 0&&(m=0);var B=40075017,K=360*m/B,bt=K/Math.cos(Math.PI/180*this.lat);return new rd(new Gh(this.lng-bt,this.lat-K),new Gh(this.lng+bt,this.lat+K))},Gh.convert=function(m){if(m instanceof Gh)return m;if(Array.isArray(m)&&(m.length===2||m.length===3))return new Gh(Number(m[0]),Number(m[1]));if(!Array.isArray(m)&&typeof m=="object"&&m!==null)return new Gh(Number("lng"in m?m.lng:m.lon),Number(m.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 cC=2*Math.PI*uC;function hC(m){return cC*Math.cos(m*Math.PI/180)}function fC(m){return(180+m)/360}function dC(m){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+m*Math.PI/360)))/360}function pC(m,B){return m/hC(B)}function z$(m){return m*360-180}function s8(m){var B=180-m*360;return 360/Math.PI*Math.atan(Math.exp(B*Math.PI/180))-90}function I$(m,B){return m*hC(s8(B))}function O$(m){return 1/Math.cos(m*Math.PI/180)}var ey=function(m,B,K){K===void 0&&(K=0),this.x=+m,this.y=+B,this.z=+K};ey.fromLngLat=function(m,B){B===void 0&&(B=0);var K=Gh.convert(m);return new ey(fC(K.lng),dC(K.lat),pC(B,K.lat))},ey.prototype.toLngLat=function(){return new Gh(z$(this.x),s8(this.y))},ey.prototype.toAltitude=function(){return I$(this.z,this.y)},ey.prototype.meterInMercatorCoordinateUnits=function(){return 1/cC*O$(s8(this.y))};var ry=function(m,B,K){this.z=m,this.x=B,this.y=K,this.key=Zb(0,m,m,B,K)};ry.prototype.equals=function(m){return this.z===m.z&&this.x===m.x&&this.y===m.y},ry.prototype.url=function(m,B){var K=P$(this.x,this.y,this.z),bt=D$(this.z,this.x,this.y);return m[(this.x+this.y)%m.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(B==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",bt).replace("{bbox-epsg-3857}",K)},ry.prototype.getTilePoint=function(m){var B=Math.pow(2,this.z);return new o((m.x*B-this.x)*Vo,(m.y*B-this.y)*Vo)},ry.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var mC=function(m,B){this.wrap=m,this.canonical=B,this.key=Zb(m,B.z,B.z,B.x,B.y)},nd=function(m,B,K,bt,Ot){this.overscaledZ=m,this.wrap=B,this.canonical=new ry(K,+bt,+Ot),this.key=Zb(B,m,K,bt,Ot)};nd.prototype.equals=function(m){return this.overscaledZ===m.overscaledZ&&this.wrap===m.wrap&&this.canonical.equals(m.canonical)},nd.prototype.scaledTo=function(m){var B=this.canonical.z-m;return m>this.canonical.z?new nd(m,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new nd(m,this.wrap,m,this.canonical.x>>B,this.canonical.y>>B)},nd.prototype.calculateScaledKey=function(m,B){var K=this.canonical.z-m;return m>this.canonical.z?Zb(this.wrap*+B,m,this.canonical.z,this.canonical.x,this.canonical.y):Zb(this.wrap*+B,m,m,this.canonical.x>>K,this.canonical.y>>K)},nd.prototype.isChildOf=function(m){if(m.wrap!==this.wrap)return!1;var B=this.canonical.z-m.canonical.z;return m.overscaledZ===0||m.overscaledZ<this.overscaledZ&&m.canonical.x===this.canonical.x>>B&&m.canonical.y===this.canonical.y>>B},nd.prototype.children=function(m){if(this.overscaledZ>=m)return[new nd(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var B=this.canonical.z+1,K=this.canonical.x*2,bt=this.canonical.y*2;return[new nd(B,this.wrap,B,K,bt),new nd(B,this.wrap,B,K+1,bt),new nd(B,this.wrap,B,K,bt+1),new nd(B,this.wrap,B,K+1,bt+1)]},nd.prototype.isLessThan=function(m){return this.wrap<m.wrap?!0:this.wrap>m.wrap?!1:this.overscaledZ<m.overscaledZ?!0:this.overscaledZ>m.overscaledZ?!1:this.canonical.x<m.canonical.x?!0:this.canonical.x>m.canonical.x?!1:this.canonical.y<m.canonical.y},nd.prototype.wrapped=function(){return new nd(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},nd.prototype.unwrapTo=function(m){return new nd(this.overscaledZ,m,this.canonical.z,this.canonical.x,this.canonical.y)},nd.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},nd.prototype.toUnwrapped=function(){return new mC(this.wrap,this.canonical)},nd.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},nd.prototype.getTilePoint=function(m){return this.canonical.getTilePoint(new ey(m.x-this.wrap,m.y))};function Zb(m,B,K,bt,Ot){m*=2,m<0&&(m=m*-1-1);var Zt=1<<K;return(Zt*Zt*m+Zt*Ot+bt).toString(36)+K.toString(36)+B.toString(36)}function D$(m,B,K){for(var bt="",Ot,Zt=m;Zt>0;Zt--)Ot=1<<Zt-1,bt+=(B&Ot?1:0)+(K&Ot?2:0);return bt}sr("CanonicalTileID",ry),sr("OverscaledTileID",nd,{omit:["posMatrix"]});var Ug=function(m,B,K){if(this.uid=m,B.height!==B.width)throw new RangeError("DEM tiles must be square");if(K&&K!=="mapbox"&&K!=="terrarium")return q('"'+K+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=B.height;var bt=this.dim=B.height-2;this.data=new Uint32Array(B.data.buffer),this.encoding=K||"mapbox";for(var Ot=0;Ot<bt;Ot++)this.data[this._idx(-1,Ot)]=this.data[this._idx(0,Ot)],this.data[this._idx(bt,Ot)]=this.data[this._idx(bt-1,Ot)],this.data[this._idx(Ot,-1)]=this.data[this._idx(Ot,0)],this.data[this._idx(Ot,bt)]=this.data[this._idx(Ot,bt-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(bt,-1)]=this.data[this._idx(bt-1,0)],this.data[this._idx(-1,bt)]=this.data[this._idx(0,bt-1)],this.data[this._idx(bt,bt)]=this.data[this._idx(bt-1,bt-1)]};Ug.prototype.get=function(m,B){var K=new Uint8Array(this.data.buffer),bt=this._idx(m,B)*4,Ot=this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox;return Ot(K[bt],K[bt+1],K[bt+2])},Ug.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Ug.prototype._idx=function(m,B){if(m<-1||m>=this.dim+1||B<-1||B>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(B+1)*this.stride+(m+1)},Ug.prototype._unpackMapbox=function(m,B,K){return(m*256*256+B*256+K)/10-1e4},Ug.prototype._unpackTerrarium=function(m,B,K){return m*256+B+K/256-32768},Ug.prototype.getPixels=function(){return new Zd({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Ug.prototype.backfillBorder=function(m,B,K){if(this.dim!==m.dim)throw new Error("dem dimension mismatch");var bt=B*this.dim,Ot=B*this.dim+this.dim,Zt=K*this.dim,ie=K*this.dim+this.dim;switch(B){case-1:bt=Ot-1;break;case 1:Ot=bt+1;break}switch(K){case-1:Zt=ie-1;break;case 1:ie=Zt+1;break}for(var De=-B*this.dim,Je=-K*this.dim,vr=Zt;vr<ie;vr++)for(var Sr=bt;Sr<Ot;Sr++)this.data[this._idx(Sr,vr)]=m.data[this._idx(Sr+De,vr+Je)]},sr("DEMData",Ug);function F$(m,B){var K={};if(!B)return K;for(var bt=function(){var ie=Zt[Ot],De=ie.layerIds.map(function(Yr){return B.getLayer(Yr)}).filter(Boolean);if(De.length!==0){ie.layers=De,ie.stateDependentLayerIds&&(ie.stateDependentLayers=ie.stateDependentLayerIds.map(function(Yr){return De.filter(function(nn){return nn.id===Yr})[0]}));for(var Je=0,vr=De;Je<vr.length;Je+=1){var Sr=vr[Je];K[Sr.id]=ie}}},Ot=0,Zt=m;Ot<Zt.length;Ot+=1)bt();return K}var g5=function(m){this._stringToNumber={},this._numberToString=[];for(var B=0;B<m.length;B++){var K=m[B];this._stringToNumber[K]=B,this._numberToString[B]=K}};g5.prototype.encode=function(m){return this._stringToNumber[m]},g5.prototype.decode=function(m){return this._numberToString[m]};var v5=function(m,B,K,bt,Ot){this.type="Feature",this._vectorTileFeature=m,m._z=B,m._x=K,m._y=bt,this.properties=m.properties,this.id=Ot},l8={geometry:{configurable:!0}};l8.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},l8.geometry.set=function(m){this._geometry=m},v5.prototype.toJSON=function(){var m={geometry:this.geometry};for(var B in this)B==="_geometry"||B==="_vectorTileFeature"||(m[B]=this[B]);return m},Object.defineProperties(v5.prototype,l8);var Zx=function(){this.state={},this.stateChanges={},this.deletedStates={}};Zx.prototype.updateState=function(m,B,K){var bt=String(B);if(this.stateChanges[m]=this.stateChanges[m]||{},this.stateChanges[m][bt]=this.stateChanges[m][bt]||{},E(this.stateChanges[m][bt],K),this.deletedStates[m]===null){this.deletedStates[m]={};for(var Ot in this.state[m])Ot!==bt&&(this.deletedStates[m][Ot]=null)}else{var Zt=this.deletedStates[m]&&this.deletedStates[m][bt]===null;if(Zt){this.deletedStates[m][bt]={};for(var ie in this.state[m][bt])K[ie]||(this.deletedStates[m][bt][ie]=null)}else for(var De in K){var Je=this.deletedStates[m]&&this.deletedStates[m][bt]&&this.deletedStates[m][bt][De]===null;Je&&delete this.deletedStates[m][bt][De]}}},Zx.prototype.removeFeatureState=function(m,B,K){var bt=this.deletedStates[m]===null;if(!bt){var Ot=String(B);if(this.deletedStates[m]=this.deletedStates[m]||{},K&&B!==void 0)this.deletedStates[m][Ot]!==null&&(this.deletedStates[m][Ot]=this.deletedStates[m][Ot]||{},this.deletedStates[m][Ot][K]=null);else if(B!==void 0){var Zt=this.stateChanges[m]&&this.stateChanges[m][Ot];if(Zt){this.deletedStates[m][Ot]={};for(K in this.stateChanges[m][Ot])this.deletedStates[m][Ot][K]=null}else this.deletedStates[m][Ot]=null}else this.deletedStates[m]=null}},Zx.prototype.getState=function(m,B){var K=String(B),bt=this.state[m]||{},Ot=this.stateChanges[m]||{},Zt=E({},bt[K],Ot[K]);if(this.deletedStates[m]===null)return{};if(this.deletedStates[m]){var ie=this.deletedStates[m][B];if(ie===null)return{};for(var De in ie)delete Zt[De]}return Zt},Zx.prototype.initializeTileState=function(m,B){m.setFeatureState(this.state,B)},Zx.prototype.coalesceChanges=function(m,B){var K={};for(var bt in this.stateChanges){this.state[bt]=this.state[bt]||{};var Ot={};for(var Zt in this.stateChanges[bt])this.state[bt][Zt]||(this.state[bt][Zt]={}),E(this.state[bt][Zt],this.stateChanges[bt][Zt]),Ot[Zt]=this.state[bt][Zt];K[bt]=Ot}for(var ie in this.deletedStates){this.state[ie]=this.state[ie]||{};var De={};if(this.deletedStates[ie]===null)for(var Je in this.state[ie])De[Je]={},this.state[ie][Je]={};else for(var vr in this.deletedStates[ie]){var Sr=this.deletedStates[ie][vr]===null;if(Sr)this.state[ie][vr]={};else for(var Yr=0,nn=Object.keys(this.deletedStates[ie][vr]);Yr<nn.length;Yr+=1){var pn=nn[Yr];delete this.state[ie][vr][pn]}De[vr]=this.state[ie][vr]}K[ie]=K[ie]||{},E(K[ie],De)}if(this.stateChanges={},this.deletedStates={},Object.keys(K).length!==0)for(var Rn in m){var pi=m[Rn];pi.setFeatureState(K,B)}};var Vg=function(m,B){this.tileID=m,this.x=m.canonical.x,this.y=m.canonical.y,this.z=m.canonical.z,this.grid=new At(Vo,16,0),this.grid3D=new At(Vo,16,0),this.featureIndexArray=new Eo,this.promoteId=B};Vg.prototype.insert=function(m,B,K,bt,Ot,Zt){var ie=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(K,bt,Ot);for(var De=Zt?this.grid3D:this.grid,Je=0;Je<B.length;Je++){for(var vr=B[Je],Sr=[1/0,1/0,-1/0,-1/0],Yr=0;Yr<vr.length;Yr++){var nn=vr[Yr];Sr[0]=Math.min(Sr[0],nn.x),Sr[1]=Math.min(Sr[1],nn.y),Sr[2]=Math.max(Sr[2],nn.x),Sr[3]=Math.max(Sr[3],nn.y)}Sr[0]<Vo&&Sr[1]<Vo&&Sr[2]>=0&&Sr[3]>=0&&De.insert(ie,Sr[0],Sr[1],Sr[2],Sr[3])}},Vg.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ng.VectorTile(new Ln(this.rawTileData)).layers,this.sourceLayerCoder=new g5(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Vg.prototype.query=function(m,B,K,bt){var Ot=this;this.loadVTLayers();for(var Zt=m.params||{},ie=Vo/m.tileSize/m.scale,De=ae(Zt.filter),Je=m.queryGeometry,vr=m.queryPadding*ie,Sr=vC(Je),Yr=this.grid.query(Sr.minX-vr,Sr.minY-vr,Sr.maxX+vr,Sr.maxY+vr),nn=vC(m.cameraQueryGeometry),pn=this.grid3D.query(nn.minX-vr,nn.minY-vr,nn.maxX+vr,nn.maxY+vr,function(Ka,bo,No,jo){return Q0(m.cameraQueryGeometry,Ka-vr,bo-vr,No+vr,jo+vr)}),Rn=0,pi=pn;Rn<pi.length;Rn+=1){var la=pi[Rn];Yr.push(la)}Yr.sort(R$);for(var na={},ba,Fa=function(Ka){var bo=Yr[Ka];if(bo!==ba){ba=bo;var No=Ot.featureIndexArray.get(bo),jo=null;Ot.loadMatchingFeature(na,No.bucketIndex,No.sourceLayerIndex,No.featureIndex,De,Zt.layers,Zt.availableImages,B,K,bt,function(xs,_s,Fs){return jo||(jo=dl(xs)),_s.queryIntersectsFeature(Je,xs,Fs,jo,Ot.z,m.transform,ie,m.pixelPosMatrix)})}},ya=0;ya<Yr.length;ya++)Fa(ya);return na},Vg.prototype.loadMatchingFeature=function(m,B,K,bt,Ot,Zt,ie,De,Je,vr,Sr){var Yr=this.bucketLayerIDs[B];if(!(Zt&&!U(Zt,Yr))){var nn=this.sourceLayerCoder.decode(K),pn=this.vtLayers[nn],Rn=pn.feature(bt);if(Ot.needGeometry){var pi=Ul(Rn,!0);if(!Ot.filter(new Bl(this.tileID.overscaledZ),pi,this.tileID.canonical))return}else if(!Ot.filter(new Bl(this.tileID.overscaledZ),Rn))return;for(var la=this.getId(Rn,nn),na=0;na<Yr.length;na++){var ba=Yr[na];if(!(Zt&&Zt.indexOf(ba)<0)){var Fa=De[ba];if(Fa){var ya={};la!==void 0&&vr&&(ya=vr.getState(Fa.sourceLayer||"_geojsonTileLayer",la));var Ka=E({},Je[ba]);Ka.paint=gC(Ka.paint,Fa.paint,Rn,ya,ie),Ka.layout=gC(Ka.layout,Fa.layout,Rn,ya,ie);var bo=!Sr||Sr(Rn,Fa,ya);if(bo){var No=new v5(Rn,this.z,this.x,this.y,la);No.layer=Ka;var jo=m[ba];jo===void 0&&(jo=m[ba]=[]),jo.push({featureIndex:bt,feature:No,intersectionZ:bo})}}}}}},Vg.prototype.lookupSymbolFeatures=function(m,B,K,bt,Ot,Zt,ie,De){var Je={};this.loadVTLayers();for(var vr=ae(Ot),Sr=0,Yr=m;Sr<Yr.length;Sr+=1){var nn=Yr[Sr];this.loadMatchingFeature(Je,K,bt,nn,vr,Zt,ie,De,B)}return Je},Vg.prototype.hasLayer=function(m){for(var B=0,K=this.bucketLayerIDs;B<K.length;B+=1)for(var bt=K[B],Ot=0,Zt=bt;Ot<Zt.length;Ot+=1){var ie=Zt[Ot];if(m===ie)return!0}return!1},Vg.prototype.getId=function(m,B){var K=m.id;if(this.promoteId){var bt=typeof this.promoteId=="string"?this.promoteId:this.promoteId[B];K=m.properties[bt],typeof K=="boolean"&&(K=Number(K))}return K},sr("FeatureIndex",Vg,{omit:["rawTileData","sourceLayerCoder"]});function gC(m,B,K,bt,Ot){return V(m,function(Zt,ie){var De=B instanceof Jn?B.get(ie):null;return De&&De.evaluate?De.evaluate(K,bt,Ot):De})}function vC(m){for(var B=1/0,K=1/0,bt=-1/0,Ot=-1/0,Zt=0,ie=m;Zt<ie.length;Zt+=1){var De=ie[Zt];B=Math.min(B,De.x),K=Math.min(K,De.y),bt=Math.max(bt,De.x),Ot=Math.max(Ot,De.y)}return{minX:B,minY:K,maxX:bt,maxY:Ot}}function R$(m,B){return B-m}var B$=3e4,Fd=function(m,B){this.tileID=m,this.uid=p(),this.uses=0,this.tileSize=B,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Fd.prototype.registerFadeDuration=function(m){var B=m+this.timeAdded;B<zt.now()||this.fadeEndTime&&B<this.fadeEndTime||(this.fadeEndTime=B)},Fd.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},Fd.prototype.loadVectorData=function(m,B,K){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!m){this.collisionBoxArray=new yu;return}m.featureIndex&&(this.latestFeatureIndex=m.featureIndex,m.rawTileData?(this.latestRawTileData=m.rawTileData,this.latestFeatureIndex.rawTileData=m.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=m.collisionBoxArray,this.buckets=F$(m.buckets,B.style),this.hasSymbolBuckets=!1;for(var bt in this.buckets){var Ot=this.buckets[bt];if(Ot instanceof Gc)if(this.hasSymbolBuckets=!0,K)Ot.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var Zt in this.buckets){var ie=this.buckets[Zt];if(ie instanceof Gc&&ie.hasRTLText){this.hasRTLText=!0,rh();break}}this.queryPadding=0;for(var De in this.buckets){var Je=this.buckets[De];this.queryPadding=Math.max(this.queryPadding,B.style.getLayer(De).queryRadius(Je))}m.imageAtlas&&(this.imageAtlas=m.imageAtlas),m.glyphAtlasImage&&(this.glyphAtlasImage=m.glyphAtlasImage)},Fd.prototype.unloadVectorData=function(){for(var m in this.buckets)this.buckets[m].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Fd.prototype.getBucket=function(m){return this.buckets[m.id]},Fd.prototype.upload=function(m){for(var B in this.buckets){var K=this.buckets[B];K.uploadPending()&&K.upload(m)}var bt=m.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new ty(m,this.imageAtlas.image,bt.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new ty(m,this.glyphAtlasImage,bt.ALPHA),this.glyphAtlasImage=null)},Fd.prototype.prepare=function(m){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(m,this.imageAtlasTexture)},Fd.prototype.queryRenderedFeatures=function(m,B,K,bt,Ot,Zt,ie,De,Je,vr){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:bt,cameraQueryGeometry:Ot,scale:Zt,tileSize:this.tileSize,pixelPosMatrix:vr,transform:De,params:ie,queryPadding:this.queryPadding*Je},m,B,K)},Fd.prototype.querySourceFeatures=function(m,B){var K=this.latestFeatureIndex;if(!(!K||!K.rawTileData)){var bt=K.loadVTLayers(),Ot=B?B.sourceLayer:"",Zt=bt._geojsonTileLayer||bt[Ot];if(Zt)for(var ie=ae(B&&B.filter),De=this.tileID.canonical,Je=De.z,vr=De.x,Sr=De.y,Yr={z:Je,x:vr,y:Sr},nn=0;nn<Zt.length;nn++){var pn=Zt.feature(nn);if(ie.needGeometry){var Rn=Ul(pn,!0);if(!ie.filter(new Bl(this.tileID.overscaledZ),Rn,this.tileID.canonical))continue}else if(!ie.filter(new Bl(this.tileID.overscaledZ),pn))continue;var pi=K.getId(pn,Ot),la=new v5(pn,Je,vr,Sr,pi);la.tile=Yr,m.push(la)}}},Fd.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},Fd.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Fd.prototype.setExpiryData=function(m){var B=this.expirationTime;if(m.cacheControl){var K=st(m.cacheControl);K["max-age"]&&(this.expirationTime=Date.now()+K["max-age"]*1e3)}else m.expires&&(this.expirationTime=new Date(m.expires).getTime());if(this.expirationTime){var bt=Date.now(),Ot=!1;if(this.expirationTime>bt)Ot=!1;else if(!B)Ot=!0;else if(this.expirationTime<B)Ot=!0;else{var Zt=this.expirationTime-B;Zt?this.expirationTime=bt+Math.max(Zt,B$):Ot=!0}Ot?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Fd.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)},Fd.prototype.setFeatureState=function(m,B){if(!(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(m).length===0)){var K=this.latestFeatureIndex.loadVTLayers();for(var bt in this.buckets)if(B.style.hasLayer(bt)){var Ot=this.buckets[bt],Zt=Ot.layers[0].sourceLayer||"_geojsonTileLayer",ie=K[Zt],De=m[Zt];if(!(!ie||!De||Object.keys(De).length===0)){Ot.update(De,ie,this.imageAtlas&&this.imageAtlas.patternPositions||{});var Je=B&&B.style&&B.style.getLayer(bt);Je&&(this.queryPadding=Math.max(this.queryPadding,Je.queryRadius(Ot)))}}}},Fd.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},Fd.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<zt.now()},Fd.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Fd.prototype.setHoldDuration=function(m){this.symbolFadeHoldUntil=zt.now()+m},Fd.prototype.setDependencies=function(m,B){for(var K={},bt=0,Ot=B;bt<Ot.length;bt+=1){var Zt=Ot[bt];K[Zt]=!0}this.dependencies[m]=K},Fd.prototype.hasDependency=function(m,B){for(var K=0,bt=m;K<bt.length;K+=1){var Ot=bt[K],Zt=this.dependencies[Ot];if(Zt)for(var ie=0,De=B;ie<De.length;ie+=1){var Je=De[ie];if(Zt[Je])return!0}}return!1};var N$=["type","source","source-layer","minzoom","maxzoom","filter","layout"],Gv=s.performance,yC=function(m){this._marks={start:[m.url,"start"].join("#"),end:[m.url,"end"].join("#"),measure:m.url.toString()},Gv.mark(this._marks.start)};yC.prototype.finish=function(){Gv.mark(this._marks.end);var m=Gv.getEntriesByName(this._marks.measure);return m.length===0&&(Gv.measure(this._marks.measure,this._marks.start,this._marks.end),m=Gv.getEntriesByName(this._marks.measure),Gv.clearMarks(this._marks.start),Gv.clearMarks(this._marks.end),Gv.clearMeasures(this._marks.measure)),m},t.Actor=qx,t.AlphaImage=Qf,t.CanonicalTileID=ry,t.CollisionBoxArray=yu,t.Color=Dl,t.DEMData=Ug,t.DataConstantProperty=gn,t.DictionaryCoder=g5,t.EXTENT=Vo,t.ErrorEvent=$r,t.EvaluationParameters=Bl,t.Event=qr,t.Evented=Br,t.FeatureIndex=Vg,t.FillBucket=w0,t.FillExtrusionBucket=jp,t.ImageAtlas=$c,t.ImagePosition=rc,t.LineBucket=$d,t.LngLat=Gh,t.LngLatBounds=rd,t.MercatorCoordinate=ey,t.ONE_EM=Er,t.OverscaledTileID=nd,t.Point=o,t.Point$1=o,t.Properties=Za,t.Protobuf=Ln,t.RGBAImage=Zd,t.RequestManager=Mt,t.RequestPerformance=yC,t.ResourceType=oa,t.SegmentVector=yl,t.SourceFeatureState=Zx,t.StructArrayLayout1ui2=Eu,t.StructArrayLayout2f1f2i16=Oa,t.StructArrayLayout2i4=Ua,t.StructArrayLayout3ui6=So,t.StructArrayLayout4i8=vi,t.SymbolBucket=Gc,t.Texture=ty,t.Tile=Fd,t.Transitionable=_e,t.Uniform1f=hr,t.Uniform1i=lr,t.Uniform2f=Ve,t.Uniform3f=Xe,t.Uniform4f=$e,t.UniformColor=Cr,t.UniformMatrix4f=fn,t.UnwrappedTileID=mC,t.ValidationError=uo,t.WritingMode=$h,t.ZoomHistory=In,t.add=N0,t.addDynamicAttributes=i8,t.asyncAll=_,t.bezier=v,t.bindAll=O,t.browser=zt,t.cacheEntryPossiblyAdded=Vn,t.clamp=u,t.clearTileCache=Kn,t.clipLine=JE,t.clone=Lv,t.clone$1=F,t.clone$2=Dg,t.collisionCircleLayout=Kt,t.config=Pt,t.create=Cv,t.create$1=pd,t.create$2=wm,t.createCommonjsModule=e,t.createExpression=zs,t.createLayout=Qn,t.createStyleLayer=L$,t.cross=PT,t.deepEqual=f,t.dot=LT,t.dot$1=FT,t.ease=T,t.emitValidationErrors=Zc,t.endsWith=N,t.enforceCacheSizeLimit=Hn,t.evaluateSizeForFeature=Hb,t.evaluateSizeForZoom=l5,t.evaluateVariableOffset=eC,t.evented=cu,t.extend=E,t.featureFilter=ae,t.filterObject=H,t.fromRotation=Zm,t.getAnchorAlignment=Vb,t.getAnchorJustification=n8,t.getArrayBuffer=wn,t.getImage=Wa,t.getJSON=Cn,t.getRTLTextPluginStatus=_o,t.getReferrer=We,t.getVideo=ze,t.identity=B0,t.invert=Ig,t.isChar=On,t.isMapboxURL=te,t.keysDifference=M,t.makeRequest=Qr,t.mapObject=V,t.mercatorXfromLng=fC,t.mercatorYfromLat=dC,t.mercatorZfromAltitude=pC,t.mul=km,t.multiply=af,t.mvt=Ng,t.nextPowerOfTwo=w,t.normalize=CT,t.number=_u,t.offscreenCanvasSupported=qn,t.ortho=zc,t.parseGlyphPBF=gp,t.pbf=Ln,t.performSymbolLayout=c$,t.perspective=yx,t.pick=A,t.plugin=Gl,t.polygonIntersectsPolygon=Au,t.postMapLoadEvent=Ct,t.postTurnstileEvent=$t,t.potpack=Up,t.refProperties=N$,t.register=sr,t.registerForPluginStateChange=Zs,t.renderColorRamp=Ov,t.rotate=zg,t.rotateX=Og,t.rotateZ=Pv,t.scale=bc,t.scale$1=DT,t.scale$2=zv,t.setCacheLimits=Ci,t.setRTLTextPlugin=rl,t.sphericalToCartesian=yt,t.sqrLen=C3,t.styleSpec=La,t.sub=IT,t.symbolSize=e8,t.transformMat3=zT,t.transformMat4=_x,t.translate=md,t.triggerPluginCompletionEvent=Tl,t.uniqueId=p,t.validateCustomStyleLayer=S$,t.validateLight=qs,t.validateStyle=Ws,t.values=C,t.vectorTile=Ng,t.version=r,t.warnOnce=q,t.webpSupported=Wt,t.window=s,t.wrap=b}),S(["./shared"],function(t){function e(We){var rr=typeof We;if(rr==="number"||rr==="boolean"||rr==="string"||We===void 0||We===null)return JSON.stringify(We);if(Array.isArray(We)){for(var fr="[",xr=0,Qr=We;xr<Qr.length;xr+=1){var Cn=Qr[xr];fr+=e(Cn)+","}return fr+"]"}for(var wn=Object.keys(We).sort(),Mn="{",ci=0;ci<wn.length;ci++)Mn+=JSON.stringify(wn[ci])+":"+e(We[wn[ci]])+",";return Mn+"}"}function r(We){for(var rr="",fr=0,xr=t.refProperties;fr<xr.length;fr+=1){var Qr=xr[fr];rr+="/"+e(We[Qr])}return rr}function a(We,rr){for(var fr={},xr=0;xr<We.length;xr++){var Qr=rr&&rr[We[xr].id]||r(We[xr]);rr&&(rr[We[xr].id]=Qr);var Cn=fr[Qr];Cn||(Cn=fr[Qr]=[]),Cn.push(We[xr])}var wn=[];for(var Mn in fr)wn.push(fr[Mn]);return wn}var n=function(We){this.keyCache={},We&&this.replace(We)};n.prototype.replace=function(We){this._layerConfigs={},this._layers={},this.update(We,[])},n.prototype.update=function(We,rr){for(var fr=this,xr=0,Qr=We;xr<Qr.length;xr+=1){var Cn=Qr[xr];this._layerConfigs[Cn.id]=Cn;var wn=this._layers[Cn.id]=t.createStyleLayer(Cn);wn._featureFilter=t.featureFilter(wn.filter),this.keyCache[Cn.id]&&delete this.keyCache[Cn.id]}for(var Mn=0,ci=rr;Mn<ci.length;Mn+=1){var xi=ci[Mn];delete this.keyCache[xi],delete this._layerConfigs[xi],delete this._layers[xi]}this.familiesBySource={};for(var Pi=a(t.values(this._layerConfigs),this.keyCache),Di=0,Zi=Pi;Di<Zi.length;Di+=1){var ui=Zi[Di],Pa=ui.map(function($r){return fr._layers[$r.id]}),Wa=Pa[0];if(Wa.visibility!=="none"){var ze=Wa.source||"",Pe=this.familiesBySource[ze];Pe||(Pe=this.familiesBySource[ze]={});var Rr=Wa.sourceLayer||"_geojsonTileLayer",qr=Pe[Rr];qr||(qr=Pe[Rr]=[]),qr.push(Pa)}}};var o=1,i=function(We){var rr={},fr=[];for(var xr in We){var Qr=We[xr],Cn=rr[xr]={};for(var wn in Qr){var Mn=Qr[+wn];if(!(!Mn||Mn.bitmap.width===0||Mn.bitmap.height===0)){var ci={x:0,y:0,w:Mn.bitmap.width+2*o,h:Mn.bitmap.height+2*o};fr.push(ci),Cn[wn]={rect:ci,metrics:Mn.metrics}}}}var xi=t.potpack(fr),Pi=xi.w,Di=xi.h,Zi=new t.AlphaImage({width:Pi||1,height:Di||1});for(var ui in We){var Pa=We[ui];for(var Wa in Pa){var ze=Pa[+Wa];if(!(!ze||ze.bitmap.width===0||ze.bitmap.height===0)){var Pe=rr[ui][Wa].rect;t.AlphaImage.copy(ze.bitmap,Zi,{x:0,y:0},{x:Pe.x+o,y:Pe.y+o},ze.bitmap)}}}this.image=Zi,this.positions=rr};t.register("GlyphAtlas",i);var s=function(We){this.tileID=new t.OverscaledTileID(We.tileID.overscaledZ,We.tileID.wrap,We.tileID.canonical.z,We.tileID.canonical.x,We.tileID.canonical.y),this.uid=We.uid,this.zoom=We.zoom,this.pixelRatio=We.pixelRatio,this.tileSize=We.tileSize,this.source=We.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=We.showCollisionBoxes,this.collectResourceTiming=!!We.collectResourceTiming,this.returnDependencies=!!We.returnDependencies,this.promoteId=We.promoteId};s.prototype.parse=function(We,rr,fr,xr,Qr){var Cn=this;this.status="parsing",this.data=We,this.collisionBoxArray=new t.CollisionBoxArray;var wn=new t.DictionaryCoder(Object.keys(We.layers).sort()),Mn=new t.FeatureIndex(this.tileID,this.promoteId);Mn.bucketLayerIDs=[];var ci={},xi={featureIndex:Mn,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:fr},Pi=rr.familiesBySource[this.source];for(var Di in Pi){var Zi=We.layers[Di];if(Zi){Zi.version===1&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+Di+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var ui=wn.encode(Di),Pa=[],Wa=0;Wa<Zi.length;Wa++){var ze=Zi.feature(Wa),Pe=Mn.getId(ze,Di);Pa.push({feature:ze,id:Pe,index:Wa,sourceLayerIndex:ui})}for(var Rr=0,qr=Pi[Di];Rr<qr.length;Rr+=1){var $r=qr[Rr],Br=$r[0];if(!(Br.minzoom&&this.zoom<Math.floor(Br.minzoom))&&!(Br.maxzoom&&this.zoom>=Br.maxzoom)&&Br.visibility!=="none"){f($r,this.zoom,fr);var Gr=ci[Br.id]=Br.createBucket({index:Mn.bucketLayerIDs.length,layers:$r,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ui,sourceID:this.source});Gr.populate(Pa,xi,this.tileID.canonical),Mn.bucketLayerIDs.push($r.map(function(Pn){return Pn.id}))}}}}var dn,an,Ee,dr,Vr=t.mapObject(xi.glyphDependencies,function(Pn){return Object.keys(Pn).map(Number)});Object.keys(Vr).length?xr.send("getGlyphs",{uid:this.uid,stacks:Vr},function(Pn,En){dn||(dn=Pn,an=En,Xn.call(Cn))}):an={};var yn=Object.keys(xi.iconDependencies);yn.length?xr.send("getImages",{icons:yn,source:this.source,tileID:this.tileID,type:"icons"},function(Pn,En){dn||(dn=Pn,Ee=En,Xn.call(Cn))}):Ee={};var Fn=Object.keys(xi.patternDependencies);Fn.length?xr.send("getImages",{icons:Fn,source:this.source,tileID:this.tileID,type:"patterns"},function(Pn,En){dn||(dn=Pn,dr=En,Xn.call(Cn))}):dr={},Xn.call(this);function Xn(){if(dn)return Qr(dn);if(an&&Ee&&dr){var Pn=new i(an),En=new t.ImageAtlas(Ee,dr);for(var Zn in ci){var Ca=ci[Zn];Ca instanceof t.SymbolBucket?(f(Ca.layers,this.zoom,fr),t.performSymbolLayout(Ca,an,Pn.positions,Ee,En.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ca.hasPattern&&(Ca instanceof t.LineBucket||Ca instanceof t.FillBucket||Ca instanceof t.FillExtrusionBucket)&&(f(Ca.layers,this.zoom,fr),Ca.addFeatures(xi,this.tileID.canonical,En.patternPositions))}this.status="done",Qr(null,{buckets:t.values(ci).filter(function(Ri){return!Ri.isEmpty()}),featureIndex:Mn,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Pn.image,imageAtlas:En,glyphMap:this.returnDependencies?an:null,iconMap:this.returnDependencies?Ee:null,glyphPositions:this.returnDependencies?Pn.positions:null})}}};function f(We,rr,fr){for(var xr=new t.EvaluationParameters(rr),Qr=0,Cn=We;Qr<Cn.length;Qr+=1){var wn=Cn[Qr];wn.recalculate(xr,fr)}}function x(We,rr){var fr=t.getArrayBuffer(We.request,function(xr,Qr,Cn,wn){xr?rr(xr):Qr&&rr(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(Qr)),rawData:Qr,cacheControl:Cn,expires:wn})});return function(){fr.cancel(),rr()}}var y=function(We,rr,fr,xr){this.actor=We,this.layerIndex=rr,this.availableImages=fr,this.loadVectorData=xr||x,this.loading={},this.loaded={}};y.prototype.loadTile=function(We,rr){var fr=this,xr=We.uid;this.loading||(this.loading={});var Qr=We&&We.request&&We.request.collectResourceTiming?new t.RequestPerformance(We.request):!1,Cn=this.loading[xr]=new s(We);Cn.abort=this.loadVectorData(We,function(wn,Mn){if(delete fr.loading[xr],wn||!Mn)return Cn.status="done",fr.loaded[xr]=Cn,rr(wn);var ci=Mn.rawData,xi={};Mn.expires&&(xi.expires=Mn.expires),Mn.cacheControl&&(xi.cacheControl=Mn.cacheControl);var Pi={};if(Qr){var Di=Qr.finish();Di&&(Pi.resourceTiming=JSON.parse(JSON.stringify(Di)))}Cn.vectorTile=Mn.vectorTile,Cn.parse(Mn.vectorTile,fr.layerIndex,fr.availableImages,fr.actor,function(Zi,ui){if(Zi||!ui)return rr(Zi);rr(null,t.extend({rawTileData:ci.slice(0)},ui,xi,Pi))}),fr.loaded=fr.loaded||{},fr.loaded[xr]=Cn})},y.prototype.reloadTile=function(We,rr){var fr=this,xr=this.loaded,Qr=We.uid,Cn=this;if(xr&&xr[Qr]){var wn=xr[Qr];wn.showCollisionBoxes=We.showCollisionBoxes;var Mn=function(ci,xi){var Pi=wn.reloadCallback;Pi&&(delete wn.reloadCallback,wn.parse(wn.vectorTile,Cn.layerIndex,fr.availableImages,Cn.actor,Pi)),rr(ci,xi)};wn.status==="parsing"?wn.reloadCallback=Mn:wn.status==="done"&&(wn.vectorTile?wn.parse(wn.vectorTile,this.layerIndex,this.availableImages,this.actor,Mn):Mn())}},y.prototype.abortTile=function(We,rr){var fr=this.loading,xr=We.uid;fr&&fr[xr]&&fr[xr].abort&&(fr[xr].abort(),delete fr[xr]),rr()},y.prototype.removeTile=function(We,rr){var fr=this.loaded,xr=We.uid;fr&&fr[xr]&&delete fr[xr],rr()};var v=t.window.ImageBitmap,T=function(){this.loaded={}};T.prototype.loadTile=function(We,rr){var fr=We.uid,xr=We.encoding,Qr=We.rawImageData,Cn=v&&Qr instanceof v?this.getImageData(Qr):Qr,wn=new t.DEMData(fr,Cn,xr);this.loaded=this.loaded||{},this.loaded[fr]=wn,rr(null,wn)},T.prototype.getImageData=function(We){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(We.width,We.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=We.width,this.offscreenCanvas.height=We.height,this.offscreenCanvasContext.drawImage(We,0,0,We.width,We.height);var rr=this.offscreenCanvasContext.getImageData(-1,-1,We.width+2,We.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:rr.width,height:rr.height},rr.data)},T.prototype.removeTile=function(We){var rr=this.loaded,fr=We.uid;rr&&rr[fr]&&delete rr[fr]};var u=b;function b(We,rr){var fr=We&&We.type,xr;if(fr==="FeatureCollection")for(xr=0;xr<We.features.length;xr++)b(We.features[xr],rr);else if(fr==="GeometryCollection")for(xr=0;xr<We.geometries.length;xr++)b(We.geometries[xr],rr);else if(fr==="Feature")b(We.geometry,rr);else if(fr==="Polygon")_(We.coordinates,rr);else if(fr==="MultiPolygon")for(xr=0;xr<We.coordinates.length;xr++)_(We.coordinates[xr],rr);return We}function _(We,rr){if(We.length!==0){C(We[0],rr);for(var fr=1;fr<We.length;fr++)C(We[fr],!rr)}}function C(We,rr){for(var fr=0,xr=0,Qr=We.length,Cn=Qr-1;xr<Qr;Cn=xr++)fr+=(We[xr][0]-We[Cn][0])*(We[Cn][1]+We[xr][1]);fr>=0!=!!rr&&We.reverse()}var M=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,E=function(We){this._feature=We,this.extent=t.EXTENT,this.type=We.type,this.properties=We.tags,"id"in We&&!isNaN(We.id)&&(this.id=parseInt(We.id,10))};E.prototype.loadGeometry=function(){if(this._feature.type===1){for(var We=[],rr=0,fr=this._feature.geometry;rr<fr.length;rr+=1){var xr=fr[rr];We.push([new t.Point$1(xr[0],xr[1])])}return We}else{for(var Qr=[],Cn=0,wn=this._feature.geometry;Cn<wn.length;Cn+=1){for(var Mn=wn[Cn],ci=[],xi=0,Pi=Mn;xi<Pi.length;xi+=1){var Di=Pi[xi];ci.push(new t.Point$1(Di[0],Di[1]))}Qr.push(ci)}return Qr}},E.prototype.toGeoJSON=function(We,rr,fr){return M.call(this,We,rr,fr)};var A=function(We){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=We.length,this._features=We};A.prototype.feature=function(We){return new E(this._features[We])};var h=t.vectorTile.VectorTileFeature,p=k;function k(We,rr){this.options=rr||{},this.features=We,this.length=We.length}k.prototype.feature=function(We){return new w(this.features[We],this.options.extent)};function w(We,rr){this.id=typeof We.id=="number"?We.id:void 0,this.type=We.type,this.rawGeometry=We.type===1?[We.geometry]:We.geometry,this.properties=We.tags,this.extent=rr||4096}w.prototype.loadGeometry=function(){var We=this.rawGeometry;this.geometry=[];for(var rr=0;rr<We.length;rr++){for(var fr=We[rr],xr=[],Qr=0;Qr<fr.length;Qr++)xr.push(new t.Point$1(fr[Qr][0],fr[Qr][1]));this.geometry.push(xr)}return this.geometry},w.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var We=this.geometry,rr=1/0,fr=-1/0,xr=1/0,Qr=-1/0,Cn=0;Cn<We.length;Cn++)for(var wn=We[Cn],Mn=0;Mn<wn.length;Mn++){var ci=wn[Mn];rr=Math.min(rr,ci.x),fr=Math.max(fr,ci.x),xr=Math.min(xr,ci.y),Qr=Math.max(Qr,ci.y)}return[rr,xr,fr,Qr]},w.prototype.toGeoJSON=h.prototype.toGeoJSON;var R=H,O=H,N=F,V=p;function H(We){var rr=new t.pbf;return U(We,rr),rr.finish()}function F(We,rr){rr=rr||{};var fr={};for(var xr in We)fr[xr]=new p(We[xr].features,rr),fr[xr].name=xr,fr[xr].version=rr.version,fr[xr].extent=rr.extent;return H({layers:fr})}function U(We,rr){for(var fr in We.layers)rr.writeMessage(3,W,We.layers[fr])}function W(We,rr){rr.writeVarintField(15,We.version||1),rr.writeStringField(1,We.name||""),rr.writeVarintField(5,We.extent||4096);var fr,xr={keys:[],values:[],keycache:{},valuecache:{}};for(fr=0;fr<We.length;fr++)xr.feature=We.feature(fr),rr.writeMessage(2,q,xr);var Qr=xr.keys;for(fr=0;fr<Qr.length;fr++)rr.writeStringField(3,Qr[fr]);var Cn=xr.values;for(fr=0;fr<Cn.length;fr++)rr.writeMessage(4,st,Cn[fr])}function q(We,rr){var fr=We.feature;fr.id!==void 0&&rr.writeVarintField(1,fr.id),rr.writeMessage(2,X,We),rr.writeVarintField(3,fr.type),rr.writeMessage(4,pt,fr)}function X(We,rr){var fr=We.feature,xr=We.keys,Qr=We.values,Cn=We.keycache,wn=We.valuecache;for(var Mn in fr.properties){var ci=Cn[Mn];typeof ci>"u"&&(xr.push(Mn),ci=xr.length-1,Cn[Mn]=ci),rr.writeVarint(ci);var xi=fr.properties[Mn],Pi=typeof xi;Pi!=="string"&&Pi!=="boolean"&&Pi!=="number"&&(xi=JSON.stringify(xi));var Di=Pi+":"+xi,Zi=wn[Di];typeof Zi>"u"&&(Qr.push(xi),Zi=Qr.length-1,wn[Di]=Zi),rr.writeVarint(Zi)}}function lt(We,rr){return(rr<<3)+(We&7)}function yt(We){return We<<1^We>>31}function pt(We,rr){for(var fr=We.loadGeometry(),xr=We.type,Qr=0,Cn=0,wn=fr.length,Mn=0;Mn<wn;Mn++){var ci=fr[Mn],xi=1;xr===1&&(xi=ci.length),rr.writeVarint(lt(1,xi));for(var Pi=xr===3?ci.length-1:ci.length,Di=0;Di<Pi;Di++){Di===1&&xr!==1&&rr.writeVarint(lt(2,Pi-1));var Zi=ci[Di].x-Qr,ui=ci[Di].y-Cn;rr.writeVarint(yt(Zi)),rr.writeVarint(yt(ui)),Qr+=Zi,Cn+=ui}xr===3&&rr.writeVarint(lt(7,1))}}function st(We,rr){var fr=typeof We;fr==="string"?rr.writeStringField(1,We):fr==="boolean"?rr.writeBooleanField(7,We):fr==="number"&&(We%1!==0?rr.writeDoubleField(3,We):We<0?rr.writeSVarintField(6,We):rr.writeVarintField(5,We))}R.fromVectorTileJs=O,R.fromGeojsonVt=N,R.GeoJSONWrapper=V;function tt(We,rr,fr,xr,Qr,Cn){if(!(Qr-xr<=fr)){var wn=xr+Qr>>1;dt(We,rr,wn,xr,Qr,Cn%2),tt(We,rr,fr,xr,wn-1,Cn+1),tt(We,rr,fr,wn+1,Qr,Cn+1)}}function dt(We,rr,fr,xr,Qr,Cn){for(;Qr>xr;){if(Qr-xr>600){var wn=Qr-xr+1,Mn=fr-xr+1,ci=Math.log(wn),xi=.5*Math.exp(2*ci/3),Pi=.5*Math.sqrt(ci*xi*(wn-xi)/wn)*(Mn-wn/2<0?-1:1),Di=Math.max(xr,Math.floor(fr-Mn*xi/wn+Pi)),Zi=Math.min(Qr,Math.floor(fr+(wn-Mn)*xi/wn+Pi));dt(We,rr,fr,Di,Zi,Cn)}var ui=rr[2*fr+Cn],Pa=xr,Wa=Qr;for(rt(We,rr,xr,fr),rr[2*Qr+Cn]>ui&&rt(We,rr,xr,Qr);Pa<Wa;){for(rt(We,rr,Pa,Wa),Pa++,Wa--;rr[2*Pa+Cn]<ui;)Pa++;for(;rr[2*Wa+Cn]>ui;)Wa--}rr[2*xr+Cn]===ui?rt(We,rr,xr,Wa):(Wa++,rt(We,rr,Wa,Qr)),Wa<=fr&&(xr=Wa+1),fr<=Wa&&(Qr=Wa-1)}}function rt(We,rr,fr,xr){at(We,fr,xr),at(rr,2*fr,2*xr),at(rr,2*fr+1,2*xr+1)}function at(We,rr,fr){var xr=We[rr];We[rr]=We[fr],We[fr]=xr}function vt(We,rr,fr,xr,Qr,Cn,wn){for(var Mn=[0,We.length-1,0],ci=[],xi,Pi;Mn.length;){var Di=Mn.pop(),Zi=Mn.pop(),ui=Mn.pop();if(Zi-ui<=wn){for(var Pa=ui;Pa<=Zi;Pa++)xi=rr[2*Pa],Pi=rr[2*Pa+1],xi>=fr&&xi<=Qr&&Pi>=xr&&Pi<=Cn&&ci.push(We[Pa]);continue}var Wa=Math.floor((ui+Zi)/2);xi=rr[2*Wa],Pi=rr[2*Wa+1],xi>=fr&&xi<=Qr&&Pi>=xr&&Pi<=Cn&&ci.push(We[Wa]);var ze=(Di+1)%2;(Di===0?fr<=xi:xr<=Pi)&&(Mn.push(ui),Mn.push(Wa-1),Mn.push(ze)),(Di===0?Qr>=xi:Cn>=Pi)&&(Mn.push(Wa+1),Mn.push(Zi),Mn.push(ze))}return ci}function it(We,rr,fr,xr,Qr,Cn){for(var wn=[0,We.length-1,0],Mn=[],ci=Qr*Qr;wn.length;){var xi=wn.pop(),Pi=wn.pop(),Di=wn.pop();if(Pi-Di<=Cn){for(var Zi=Di;Zi<=Pi;Zi++)Y(rr[2*Zi],rr[2*Zi+1],fr,xr)<=ci&&Mn.push(We[Zi]);continue}var ui=Math.floor((Di+Pi)/2),Pa=rr[2*ui],Wa=rr[2*ui+1];Y(Pa,Wa,fr,xr)<=ci&&Mn.push(We[ui]);var ze=(xi+1)%2;(xi===0?fr-Qr<=Pa:xr-Qr<=Wa)&&(wn.push(Di),wn.push(ui-1),wn.push(ze)),(xi===0?fr+Qr>=Pa:xr+Qr>=Wa)&&(wn.push(ui+1),wn.push(Pi),wn.push(ze))}return Mn}function Y(We,rr,fr,xr){var Qr=We-fr,Cn=rr-xr;return Qr*Qr+Cn*Cn}var ft=function(We){return We[0]},ut=function(We){return We[1]},wt=function(We,rr,fr,xr,Qr){rr===void 0&&(rr=ft),fr===void 0&&(fr=ut),xr===void 0&&(xr=64),Qr===void 0&&(Qr=Float64Array),this.nodeSize=xr,this.points=We;for(var Cn=We.length<65536?Uint16Array:Uint32Array,wn=this.ids=new Cn(We.length),Mn=this.coords=new Qr(We.length*2),ci=0;ci<We.length;ci++)wn[ci]=ci,Mn[2*ci]=rr(We[ci]),Mn[2*ci+1]=fr(We[ci]);tt(wn,Mn,xr,0,wn.length-1,0)};wt.prototype.range=function(We,rr,fr,xr){return vt(this.ids,this.coords,We,rr,fr,xr,this.nodeSize)},wt.prototype.within=function(We,rr,fr){return it(this.ids,this.coords,We,rr,fr,this.nodeSize)};var zt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(We){return We}},Pt=function(We){this.options=Lt(Object.create(zt),We),this.trees=new Array(this.options.maxZoom+1)};Pt.prototype.load=function(We){var rr=this.options,fr=rr.log,xr=rr.minZoom,Qr=rr.maxZoom,Cn=rr.nodeSize;fr&&console.time("total time");var wn="prepare "+We.length+" points";fr&&console.time(wn),this.points=We;for(var Mn=[],ci=0;ci<We.length;ci++)We[ci].geometry&&Mn.push(Ht(We[ci],ci));this.trees[Qr+1]=new wt(Mn,Mt,te,Cn,Float32Array),fr&&console.timeEnd(wn);for(var xi=Qr;xi>=xr;xi--){var Pi=+Date.now();Mn=this._cluster(Mn,xi),this.trees[xi]=new wt(Mn,Mt,te,Cn,Float32Array),fr&&console.log("z%d: %d clusters in %dms",xi,Mn.length,+Date.now()-Pi)}return fr&&console.timeEnd("total time"),this},Pt.prototype.getClusters=function(We,rr){var fr=((We[0]+180)%360+360)%360-180,xr=Math.max(-90,Math.min(90,We[1])),Qr=We[2]===180?180:((We[2]+180)%360+360)%360-180,Cn=Math.max(-90,Math.min(90,We[3]));if(We[2]-We[0]>=360)fr=-180,Qr=180;else if(fr>Qr){var wn=this.getClusters([fr,xr,180,Cn],rr),Mn=this.getClusters([-180,xr,Qr,Cn],rr);return wn.concat(Mn)}for(var ci=this.trees[this._limitZoom(rr)],xi=ci.range(he(fr),de(Cn),he(Qr),de(xr)),Pi=[],Di=0,Zi=xi;Di<Zi.length;Di+=1){var ui=Zi[Di],Pa=ci.points[ui];Pi.push(Pa.numPoints?Jt(Pa):this.points[Pa.index])}return Pi},Pt.prototype.getChildren=function(We){var rr=this._getOriginId(We),fr=this._getOriginZoom(We),xr="No cluster with the specified id.",Qr=this.trees[fr];if(!Qr)throw new Error(xr);var Cn=Qr.points[rr];if(!Cn)throw new Error(xr);for(var wn=this.options.radius/(this.options.extent*Math.pow(2,fr-1)),Mn=Qr.within(Cn.x,Cn.y,wn),ci=[],xi=0,Pi=Mn;xi<Pi.length;xi+=1){var Di=Pi[xi],Zi=Qr.points[Di];Zi.parentId===We&&ci.push(Zi.numPoints?Jt(Zi):this.points[Zi.index])}if(ci.length===0)throw new Error(xr);return ci},Pt.prototype.getLeaves=function(We,rr,fr){rr=rr||10,fr=fr||0;var xr=[];return this._appendLeaves(xr,We,rr,fr,0),xr},Pt.prototype.getTile=function(We,rr,fr){var xr=this.trees[this._limitZoom(We)],Qr=Math.pow(2,We),Cn=this.options,wn=Cn.extent,Mn=Cn.radius,ci=Mn/wn,xi=(fr-ci)/Qr,Pi=(fr+1+ci)/Qr,Di={features:[]};return this._addTileFeatures(xr.range((rr-ci)/Qr,xi,(rr+1+ci)/Qr,Pi),xr.points,rr,fr,Qr,Di),rr===0&&this._addTileFeatures(xr.range(1-ci/Qr,xi,1,Pi),xr.points,Qr,fr,Qr,Di),rr===Qr-1&&this._addTileFeatures(xr.range(0,xi,ci/Qr,Pi),xr.points,-1,fr,Qr,Di),Di.features.length?Di:null},Pt.prototype.getClusterExpansionZoom=function(We){for(var rr=this._getOriginZoom(We)-1;rr<=this.options.maxZoom;){var fr=this.getChildren(We);if(rr++,fr.length!==1)break;We=fr[0].properties.cluster_id}return rr},Pt.prototype._appendLeaves=function(We,rr,fr,xr,Qr){for(var Cn=this.getChildren(rr),wn=0,Mn=Cn;wn<Mn.length;wn+=1){var ci=Mn[wn],xi=ci.properties;if(xi&&xi.cluster?Qr+xi.point_count<=xr?Qr+=xi.point_count:Qr=this._appendLeaves(We,xi.cluster_id,fr,xr,Qr):Qr<xr?Qr++:We.push(ci),We.length===fr)break}return Qr},Pt.prototype._addTileFeatures=function(We,rr,fr,xr,Qr,Cn){for(var wn=0,Mn=We;wn<Mn.length;wn+=1){var ci=Mn[wn],xi=rr[ci],Pi=xi.numPoints,Di={type:1,geometry:[[Math.round(this.options.extent*(xi.x*Qr-fr)),Math.round(this.options.extent*(xi.y*Qr-xr))]],tags:Pi?ge(xi):this.points[xi.index].properties},Zi=void 0;Pi?Zi=xi.id:this.options.generateId?Zi=xi.index:this.points[xi.index].id&&(Zi=this.points[xi.index].id),Zi!==void 0&&(Di.id=Zi),Cn.features.push(Di)}},Pt.prototype._limitZoom=function(We){return Math.max(this.options.minZoom,Math.min(+We,this.options.maxZoom+1))},Pt.prototype._cluster=function(We,rr){for(var fr=[],xr=this.options,Qr=xr.radius,Cn=xr.extent,wn=xr.reduce,Mn=xr.minPoints,ci=Qr/(Cn*Math.pow(2,rr)),xi=0;xi<We.length;xi++){var Pi=We[xi];if(!(Pi.zoom<=rr)){Pi.zoom=rr;for(var Di=this.trees[rr+1],Zi=Di.within(Pi.x,Pi.y,ci),ui=Pi.numPoints||1,Pa=ui,Wa=0,ze=Zi;Wa<ze.length;Wa+=1){var Pe=ze[Wa],Rr=Di.points[Pe];Rr.zoom>rr&&(Pa+=Rr.numPoints||1)}if(Pa>=Mn){for(var qr=Pi.x*ui,$r=Pi.y*ui,Br=wn&&ui>1?this._map(Pi,!0):null,Gr=(xi<<5)+(rr+1)+this.points.length,dn=0,an=Zi;dn<an.length;dn+=1){var Ee=an[dn],dr=Di.points[Ee];if(!(dr.zoom<=rr)){dr.zoom=rr;var Vr=dr.numPoints||1;qr+=dr.x*Vr,$r+=dr.y*Vr,dr.parentId=Gr,wn&&(Br||(Br=this._map(Pi,!0)),wn(Br,this._map(dr)))}}Pi.parentId=Gr,fr.push(Wt(qr/Pa,$r/Pa,Gr,Pa,Br))}else if(fr.push(Pi),Pa>1)for(var yn=0,Fn=Zi;yn<Fn.length;yn+=1){var Xn=Fn[yn],Pn=Di.points[Xn];Pn.zoom<=rr||(Pn.zoom=rr,fr.push(Pn))}}}return fr},Pt.prototype._getOriginId=function(We){return We-this.points.length>>5},Pt.prototype._getOriginZoom=function(We){return(We-this.points.length)%32},Pt.prototype._map=function(We,rr){if(We.numPoints)return rr?Lt({},We.properties):We.properties;var fr=this.points[We.index].properties,xr=this.options.map(fr);return rr&&xr===fr?Lt({},xr):xr};function Wt(We,rr,fr,xr,Qr){return{x:We,y:rr,zoom:1/0,id:fr,parentId:-1,numPoints:xr,properties:Qr}}function Ht(We,rr){var fr=We.geometry.coordinates,xr=fr[0],Qr=fr[1];return{x:he(xr),y:de(Qr),zoom:1/0,index:rr,parentId:-1}}function Jt(We){return{type:"Feature",id:We.id,properties:ge(We),geometry:{type:"Point",coordinates:[se(We.x),Tt(We.y)]}}}function ge(We){var rr=We.numPoints,fr=rr>=1e4?Math.round(rr/1e3)+"k":rr>=1e3?Math.round(rr/100)/10+"k":rr;return Lt(Lt({},We.properties),{cluster:!0,cluster_id:We.id,point_count:rr,point_count_abbreviated:fr})}function he(We){return We/360+.5}function de(We){var rr=Math.sin(We*Math.PI/180),fr=.5-.25*Math.log((1+rr)/(1-rr))/Math.PI;return fr<0?0:fr>1?1:fr}function se(We){return(We-.5)*360}function Tt(We){var rr=(180-We*360)*Math.PI/180;return 360*Math.atan(Math.exp(rr))/Math.PI-90}function Lt(We,rr){for(var fr in rr)We[fr]=rr[fr];return We}function Mt(We){return We.x}function te(We){return We.y}function ve(We,rr,fr,xr){for(var Qr=xr,Cn=fr-rr>>1,wn=fr-rr,Mn,ci=We[rr],xi=We[rr+1],Pi=We[fr],Di=We[fr+1],Zi=rr+3;Zi<fr;Zi+=3){var ui=oe(We[Zi],We[Zi+1],ci,xi,Pi,Di);if(ui>Qr)Mn=Zi,Qr=ui;else if(ui===Qr){var Pa=Math.abs(Zi-Cn);Pa<wn&&(Mn=Zi,wn=Pa)}}Qr>xr&&(Mn-rr>3&&ve(We,rr,Mn,xr),We[Mn+2]=Qr,fr-Mn>3&&ve(We,Mn,fr,xr))}function oe(We,rr,fr,xr,Qr,Cn){var wn=Qr-fr,Mn=Cn-xr;if(wn!==0||Mn!==0){var ci=((We-fr)*wn+(rr-xr)*Mn)/(wn*wn+Mn*Mn);ci>1?(fr=Qr,xr=Cn):ci>0&&(fr+=wn*ci,xr+=Mn*ci)}return wn=We-fr,Mn=rr-xr,wn*wn+Mn*Mn}function Te(We,rr,fr,xr){var Qr={id:typeof We>"u"?null:We,type:rr,geometry:fr,tags:xr,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return He(Qr),Qr}function He(We){var rr=We.geometry,fr=We.type;if(fr==="Point"||fr==="MultiPoint"||fr==="LineString")Ge(We,rr);else if(fr==="Polygon"||fr==="MultiLineString")for(var xr=0;xr<rr.length;xr++)Ge(We,rr[xr]);else if(fr==="MultiPolygon")for(xr=0;xr<rr.length;xr++)for(var Qr=0;Qr<rr[xr].length;Qr++)Ge(We,rr[xr][Qr])}function Ge(We,rr){for(var fr=0;fr<rr.length;fr+=3)We.minX=Math.min(We.minX,rr[fr]),We.minY=Math.min(We.minY,rr[fr+1]),We.maxX=Math.max(We.maxX,rr[fr]),We.maxY=Math.max(We.maxY,rr[fr+1])}function cr(We,rr){var fr=[];if(We.type==="FeatureCollection")for(var xr=0;xr<We.features.length;xr++)ur(fr,We.features[xr],rr,xr);else We.type==="Feature"?ur(fr,We,rr):ur(fr,{geometry:We},rr);return fr}function ur(We,rr,fr,xr){if(rr.geometry){var Qr=rr.geometry.coordinates,Cn=rr.geometry.type,wn=Math.pow(fr.tolerance/((1<<fr.maxZoom)*fr.extent),2),Mn=[],ci=rr.id;if(fr.promoteId?ci=rr.properties[fr.promoteId]:fr.generateId&&(ci=xr||0),Cn==="Point")jr(Qr,Mn);else if(Cn==="MultiPoint")for(var xi=0;xi<Qr.length;xi++)jr(Qr[xi],Mn);else if(Cn==="LineString")Hr(Qr,Mn,wn,!1);else if(Cn==="MultiLineString")if(fr.lineMetrics){for(xi=0;xi<Qr.length;xi++)Mn=[],Hr(Qr[xi],Mn,wn,!1),We.push(Te(ci,"LineString",Mn,rr.properties));return}else br(Qr,Mn,wn,!1);else if(Cn==="Polygon")br(Qr,Mn,wn,!0);else if(Cn==="MultiPolygon")for(xi=0;xi<Qr.length;xi++){var Pi=[];br(Qr[xi],Pi,wn,!0),Mn.push(Pi)}else if(Cn==="GeometryCollection"){for(xi=0;xi<rr.geometry.geometries.length;xi++)ur(We,{id:ci,geometry:rr.geometry.geometries[xi],properties:rr.properties},fr,xr);return}else throw new Error("Input data is not a valid GeoJSON object.");We.push(Te(ci,Cn,Mn,rr.properties))}}function jr(We,rr){rr.push(Kr(We[0])),rr.push(rn(We[1])),rr.push(0)}function Hr(We,rr,fr,xr){for(var Qr,Cn,wn=0,Mn=0;Mn<We.length;Mn++){var ci=Kr(We[Mn][0]),xi=rn(We[Mn][1]);rr.push(ci),rr.push(xi),rr.push(0),Mn>0&&(xr?wn+=(Qr*xi-ci*Cn)/2:wn+=Math.sqrt(Math.pow(ci-Qr,2)+Math.pow(xi-Cn,2))),Qr=ci,Cn=xi}var Pi=rr.length-3;rr[2]=1,ve(rr,0,Pi,fr),rr[Pi+2]=1,rr.size=Math.abs(wn),rr.start=0,rr.end=rr.size}function br(We,rr,fr,xr){for(var Qr=0;Qr<We.length;Qr++){var Cn=[];Hr(We[Qr],Cn,fr,xr),rr.push(Cn)}}function Kr(We){return We/360+.5}function rn(We){var rr=Math.sin(We*Math.PI/180),fr=.5-.25*Math.log((1+rr)/(1-rr))/Math.PI;return fr<0?0:fr>1?1:fr}function Ce(We,rr,fr,xr,Qr,Cn,wn,Mn){if(fr/=rr,xr/=rr,Cn>=fr&&wn<xr)return We;if(wn<fr||Cn>=xr)return null;for(var ci=[],xi=0;xi<We.length;xi++){var Pi=We[xi],Di=Pi.geometry,Zi=Pi.type,ui=Qr===0?Pi.minX:Pi.minY,Pa=Qr===0?Pi.maxX:Pi.maxY;if(ui>=fr&&Pa<xr){ci.push(Pi);continue}else if(Pa<fr||ui>=xr)continue;var Wa=[];if(Zi==="Point"||Zi==="MultiPoint")$t(Di,Wa,fr,xr,Qr);else if(Zi==="LineString")ne(Di,Wa,fr,xr,Qr,!1,Mn.lineMetrics);else if(Zi==="MultiLineString")gt(Di,Wa,fr,xr,Qr,!1);else if(Zi==="Polygon")gt(Di,Wa,fr,xr,Qr,!0);else if(Zi==="MultiPolygon")for(var ze=0;ze<Di.length;ze++){var Pe=[];gt(Di[ze],Pe,fr,xr,Qr,!0),Pe.length&&Wa.push(Pe)}if(Wa.length){if(Mn.lineMetrics&&Zi==="LineString"){for(ze=0;ze<Wa.length;ze++)ci.push(Te(Pi.id,Zi,Wa[ze],Pi.tags));continue}(Zi==="LineString"||Zi==="MultiLineString")&&(Wa.length===1?(Zi="LineString",Wa=Wa[0]):Zi="MultiLineString"),(Zi==="Point"||Zi==="MultiPoint")&&(Zi=Wa.length===3?"Point":"MultiPoint"),ci.push(Te(Pi.id,Zi,Wa,Pi.tags))}}return ci.length?ci:null}function $t(We,rr,fr,xr,Qr){for(var Cn=0;Cn<We.length;Cn+=3){var wn=We[Cn+Qr];wn>=fr&&wn<=xr&&(rr.push(We[Cn]),rr.push(We[Cn+1]),rr.push(We[Cn+2]))}}function ne(We,rr,fr,xr,Qr,Cn,wn){for(var Mn=Ct(We),ci=Qr===0?Nt:ee,xi=We.start,Pi,Di,Zi=0;Zi<We.length-3;Zi+=3){var ui=We[Zi],Pa=We[Zi+1],Wa=We[Zi+2],ze=We[Zi+3],Pe=We[Zi+4],Rr=Qr===0?ui:Pa,qr=Qr===0?ze:Pe,$r=!1;wn&&(Pi=Math.sqrt(Math.pow(ui-ze,2)+Math.pow(Pa-Pe,2))),Rr<fr?qr>fr&&(Di=ci(Mn,ui,Pa,ze,Pe,fr),wn&&(Mn.start=xi+Pi*Di)):Rr>xr?qr<xr&&(Di=ci(Mn,ui,Pa,ze,Pe,xr),wn&&(Mn.start=xi+Pi*Di)):St(Mn,ui,Pa,Wa),qr<fr&&Rr>=fr&&(Di=ci(Mn,ui,Pa,ze,Pe,fr),$r=!0),qr>xr&&Rr<=xr&&(Di=ci(Mn,ui,Pa,ze,Pe,xr),$r=!0),!Cn&&$r&&(wn&&(Mn.end=xi+Pi*Di),rr.push(Mn),Mn=Ct(We)),wn&&(xi+=Pi)}var Br=We.length-3;ui=We[Br],Pa=We[Br+1],Wa=We[Br+2],Rr=Qr===0?ui:Pa,Rr>=fr&&Rr<=xr&&St(Mn,ui,Pa,Wa),Br=Mn.length-3,Cn&&Br>=3&&(Mn[Br]!==Mn[0]||Mn[Br+1]!==Mn[1])&&St(Mn,Mn[0],Mn[1],Mn[2]),Mn.length&&rr.push(Mn)}function Ct(We){var rr=[];return rr.size=We.size,rr.start=We.start,rr.end=We.end,rr}function gt(We,rr,fr,xr,Qr,Cn){for(var wn=0;wn<We.length;wn++)ne(We[wn],rr,fr,xr,Qr,Cn,!1)}function St(We,rr,fr,xr){We.push(rr),We.push(fr),We.push(xr)}function Nt(We,rr,fr,xr,Qr,Cn){var wn=(Cn-rr)/(xr-rr);return We.push(Cn),We.push(fr+(Qr-fr)*wn),We.push(1),wn}function ee(We,rr,fr,xr,Qr,Cn){var wn=(Cn-fr)/(Qr-fr);return We.push(rr+(xr-rr)*wn),We.push(Cn),We.push(1),wn}function le(We,rr){var fr=rr.buffer/rr.extent,xr=We,Qr=Ce(We,1,-1-fr,fr,0,-1,2,rr),Cn=Ce(We,1,1-fr,2+fr,0,-1,2,rr);return(Qr||Cn)&&(xr=Ce(We,1,-fr,1+fr,0,-1,2,rr)||[],Qr&&(xr=we(Qr,1).concat(xr)),Cn&&(xr=xr.concat(we(Cn,-1)))),xr}function we(We,rr){for(var fr=[],xr=0;xr<We.length;xr++){var Qr=We[xr],Cn=Qr.type,wn;if(Cn==="Point"||Cn==="MultiPoint"||Cn==="LineString")wn=Ue(Qr.geometry,rr);else if(Cn==="MultiLineString"||Cn==="Polygon"){wn=[];for(var Mn=0;Mn<Qr.geometry.length;Mn++)wn.push(Ue(Qr.geometry[Mn],rr))}else if(Cn==="MultiPolygon")for(wn=[],Mn=0;Mn<Qr.geometry.length;Mn++){for(var ci=[],xi=0;xi<Qr.geometry[Mn].length;xi++)ci.push(Ue(Qr.geometry[Mn][xi],rr));wn.push(ci)}fr.push(Te(Qr.id,Cn,wn,Qr.tags))}return fr}function Ue(We,rr){var fr=[];fr.size=We.size,We.start!==void 0&&(fr.start=We.start,fr.end=We.end);for(var xr=0;xr<We.length;xr+=3)fr.push(We[xr]+rr,We[xr+1],We[xr+2]);return fr}function qe(We,rr){if(We.transformed)return We;var fr=1<<We.z,xr=We.x,Qr=We.y,Cn,wn,Mn;for(Cn=0;Cn<We.features.length;Cn++){var ci=We.features[Cn],xi=ci.geometry,Pi=ci.type;if(ci.geometry=[],Pi===1)for(wn=0;wn<xi.length;wn+=2)ci.geometry.push(ar(xi[wn],xi[wn+1],rr,fr,xr,Qr));else for(wn=0;wn<xi.length;wn++){var Di=[];for(Mn=0;Mn<xi[wn].length;Mn+=2)Di.push(ar(xi[wn][Mn],xi[wn][Mn+1],rr,fr,xr,Qr));ci.geometry.push(Di)}}return We.transformed=!0,We}function ar(We,rr,fr,xr,Qr,Cn){return[Math.round(fr*(We*xr-Qr)),Math.round(fr*(rr*xr-Cn))]}function Ar(We,rr,fr,xr,Qr){for(var Cn=rr===Qr.maxZoom?0:Qr.tolerance/((1<<rr)*Qr.extent),wn={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:fr,y:xr,z:rr,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Mn=0;Mn<We.length;Mn++){wn.numFeatures++,Tr(wn,We[Mn],Cn,Qr);var ci=We[Mn].minX,xi=We[Mn].minY,Pi=We[Mn].maxX,Di=We[Mn].maxY;ci<wn.minX&&(wn.minX=ci),xi<wn.minY&&(wn.minY=xi),Pi>wn.maxX&&(wn.maxX=Pi),Di>wn.maxY&&(wn.maxY=Di)}return wn}function Tr(We,rr,fr,xr){var Qr=rr.geometry,Cn=rr.type,wn=[];if(Cn==="Point"||Cn==="MultiPoint")for(var Mn=0;Mn<Qr.length;Mn+=3)wn.push(Qr[Mn]),wn.push(Qr[Mn+1]),We.numPoints++,We.numSimplified++;else if(Cn==="LineString")pr(wn,Qr,We,fr,!1,!1);else if(Cn==="MultiLineString"||Cn==="Polygon")for(Mn=0;Mn<Qr.length;Mn++)pr(wn,Qr[Mn],We,fr,Cn==="Polygon",Mn===0);else if(Cn==="MultiPolygon")for(var ci=0;ci<Qr.length;ci++){var xi=Qr[ci];for(Mn=0;Mn<xi.length;Mn++)pr(wn,xi[Mn],We,fr,!0,Mn===0)}if(wn.length){var Pi=rr.tags||null;if(Cn==="LineString"&&xr.lineMetrics){Pi={};for(var Di in rr.tags)Pi[Di]=rr.tags[Di];Pi.mapbox_clip_start=Qr.start/Qr.size,Pi.mapbox_clip_end=Qr.end/Qr.size}var Zi={geometry:wn,type:Cn==="Polygon"||Cn==="MultiPolygon"?3:Cn==="LineString"||Cn==="MultiLineString"?2:1,tags:Pi};rr.id!==null&&(Zi.id=rr.id),We.features.push(Zi)}}function pr(We,rr,fr,xr,Qr,Cn){var wn=xr*xr;if(xr>0&&rr.size<(Qr?wn:xr)){fr.numPoints+=rr.length/3;return}for(var Mn=[],ci=0;ci<rr.length;ci+=3)(xr===0||rr[ci+2]>wn)&&(fr.numSimplified++,Mn.push(rr[ci]),Mn.push(rr[ci+1])),fr.numPoints++;Qr&&Jr(Mn,Cn),We.push(Mn)}function Jr(We,rr){for(var fr=0,xr=0,Qr=We.length,Cn=Qr-2;xr<Qr;Cn=xr,xr+=2)fr+=(We[xr]-We[Cn])*(We[xr+1]+We[Cn+1]);if(fr>0===rr)for(xr=0,Qr=We.length;xr<Qr/2;xr+=2){var wn=We[xr],Mn=We[xr+1];We[xr]=We[Qr-2-xr],We[xr+1]=We[Qr-1-xr],We[Qr-2-xr]=wn,We[Qr-1-xr]=Mn}}function Vn(We,rr){return new Hn(We,rr)}function Hn(We,rr){rr=this.options=Ci(Object.create(this.options),rr);var fr=rr.debug;if(fr&&console.time("preprocess data"),rr.maxZoom<0||rr.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(rr.promoteId&&rr.generateId)throw new Error("promoteId and generateId cannot be used together.");var xr=cr(We,rr);this.tiles={},this.tileCoords=[],fr&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",rr.indexMaxZoom,rr.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),xr=le(xr,rr),xr.length&&this.splitTile(xr,0,0,0),fr&&(xr.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)))}Hn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Hn.prototype.splitTile=function(We,rr,fr,xr,Qr,Cn,wn){for(var Mn=[We,rr,fr,xr],ci=this.options,xi=ci.debug;Mn.length;){xr=Mn.pop(),fr=Mn.pop(),rr=Mn.pop(),We=Mn.pop();var Pi=1<<rr,Di=Kn(rr,fr,xr),Zi=this.tiles[Di];if(!Zi&&(xi>1&&console.time("creation"),Zi=this.tiles[Di]=Ar(We,rr,fr,xr,ci),this.tileCoords.push({z:rr,x:fr,y:xr}),xi)){xi>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",rr,fr,xr,Zi.numFeatures,Zi.numPoints,Zi.numSimplified),console.timeEnd("creation"));var ui="z"+rr;this.stats[ui]=(this.stats[ui]||0)+1,this.total++}if(Zi.source=We,Qr){if(rr===ci.maxZoom||rr===Qr)continue;var Pa=1<<Qr-rr;if(fr!==Math.floor(Cn/Pa)||xr!==Math.floor(wn/Pa))continue}else if(rr===ci.indexMaxZoom||Zi.numPoints<=ci.indexMaxPoints)continue;if(Zi.source=null,We.length!==0){xi>1&&console.time("clipping");var Wa=.5*ci.buffer/ci.extent,ze=.5-Wa,Pe=.5+Wa,Rr=1+Wa,qr,$r,Br,Gr,dn,an;qr=$r=Br=Gr=null,dn=Ce(We,Pi,fr-Wa,fr+Pe,0,Zi.minX,Zi.maxX,ci),an=Ce(We,Pi,fr+ze,fr+Rr,0,Zi.minX,Zi.maxX,ci),We=null,dn&&(qr=Ce(dn,Pi,xr-Wa,xr+Pe,1,Zi.minY,Zi.maxY,ci),$r=Ce(dn,Pi,xr+ze,xr+Rr,1,Zi.minY,Zi.maxY,ci),dn=null),an&&(Br=Ce(an,Pi,xr-Wa,xr+Pe,1,Zi.minY,Zi.maxY,ci),Gr=Ce(an,Pi,xr+ze,xr+Rr,1,Zi.minY,Zi.maxY,ci),an=null),xi>1&&console.timeEnd("clipping"),Mn.push(qr||[],rr+1,fr*2,xr*2),Mn.push($r||[],rr+1,fr*2,xr*2+1),Mn.push(Br||[],rr+1,fr*2+1,xr*2),Mn.push(Gr||[],rr+1,fr*2+1,xr*2+1)}}},Hn.prototype.getTile=function(We,rr,fr){var xr=this.options,Qr=xr.extent,Cn=xr.debug;if(We<0||We>24)return null;var wn=1<<We;rr=(rr%wn+wn)%wn;var Mn=Kn(We,rr,fr);if(this.tiles[Mn])return qe(this.tiles[Mn],Qr);Cn>1&&console.log("drilling down to z%d-%d-%d",We,rr,fr);for(var ci=We,xi=rr,Pi=fr,Di;!Di&&ci>0;)ci--,xi=Math.floor(xi/2),Pi=Math.floor(Pi/2),Di=this.tiles[Kn(ci,xi,Pi)];return!Di||!Di.source?null:(Cn>1&&console.log("found parent tile z%d-%d-%d",ci,xi,Pi),Cn>1&&console.time("drilling down"),this.splitTile(Di.source,ci,xi,Pi,We,rr,fr),Cn>1&&console.timeEnd("drilling down"),this.tiles[Mn]?qe(this.tiles[Mn],Qr):null)};function Kn(We,rr,fr){return((1<<We)*fr+rr)*32+We}function Ci(We,rr){for(var fr in rr)We[fr]=rr[fr];return We}function ii(We,rr){var fr=We.tileID.canonical;if(!this._geoJSONIndex)return rr(null,null);var xr=this._geoJSONIndex.getTile(fr.z,fr.x,fr.y);if(!xr)return rr(null,null);var Qr=new A(xr.features),Cn=R(Qr);(Cn.byteOffset!==0||Cn.byteLength!==Cn.buffer.byteLength)&&(Cn=new Uint8Array(Cn)),rr(null,{vectorTile:Qr,rawData:Cn.buffer})}var qn=function(We){function rr(fr,xr,Qr,Cn){We.call(this,fr,xr,Qr,ii),Cn&&(this.loadGeoJSON=Cn)}return We&&(rr.__proto__=We),rr.prototype=Object.create(We&&We.prototype),rr.prototype.constructor=rr,rr.prototype.loadData=function(fr,xr){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=xr,this._pendingLoadDataParams=fr,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},rr.prototype._loadData=function(){var fr=this;if(!(!this._pendingCallback||!this._pendingLoadDataParams)){var xr=this._pendingCallback,Qr=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var Cn=Qr&&Qr.request&&Qr.request.collectResourceTiming?new t.RequestPerformance(Qr.request):!1;this.loadGeoJSON(Qr,function(wn,Mn){if(wn||!Mn)return xr(wn);if(typeof Mn!="object")return xr(new Error("Input data given to '"+Qr.source+"' is not a valid GeoJSON object."));u(Mn,!0);try{if(Qr.filter){var ci=t.createExpression(Qr.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ci.result==="error")throw new Error(ci.value.map(function(Zi){return Zi.key+": "+Zi.message}).join(", "));var xi=Mn.features.filter(function(Zi){return ci.value.evaluate({zoom:0},Zi)});Mn={type:"FeatureCollection",features:xi}}fr._geoJSONIndex=Qr.cluster?new Pt(oa(Qr)).load(Mn.features):Vn(Mn,Qr.geojsonVtOptions)}catch(Zi){return xr(Zi)}fr.loaded={};var Pi={};if(Cn){var Di=Cn.finish();Di&&(Pi.resourceTiming={},Pi.resourceTiming[Qr.source]=JSON.parse(JSON.stringify(Di)))}xr(null,Pi)})}},rr.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},rr.prototype.reloadTile=function(fr,xr){var Qr=this.loaded,Cn=fr.uid;return Qr&&Qr[Cn]?We.prototype.reloadTile.call(this,fr,xr):this.loadTile(fr,xr)},rr.prototype.loadGeoJSON=function(fr,xr){if(fr.request)t.getJSON(fr.request,xr);else if(typeof fr.data=="string")try{return xr(null,JSON.parse(fr.data))}catch{return xr(new Error("Input data given to '"+fr.source+"' is not a valid GeoJSON object."))}else return xr(new Error("Input data given to '"+fr.source+"' is not a valid GeoJSON object."))},rr.prototype.removeSource=function(fr,xr){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),xr()},rr.prototype.getClusterExpansionZoom=function(fr,xr){try{xr(null,this._geoJSONIndex.getClusterExpansionZoom(fr.clusterId))}catch(Qr){xr(Qr)}},rr.prototype.getClusterChildren=function(fr,xr){try{xr(null,this._geoJSONIndex.getChildren(fr.clusterId))}catch(Qr){xr(Qr)}},rr.prototype.getClusterLeaves=function(fr,xr){try{xr(null,this._geoJSONIndex.getLeaves(fr.clusterId,fr.limit,fr.offset))}catch(Qr){xr(Qr)}},rr}(y);function oa(We){var rr=We.superclusterOptions,fr=We.clusterProperties;if(!fr||!rr)return rr;for(var xr={},Qr={},Cn={accumulated:null,zoom:0},wn={properties:null},Mn=Object.keys(fr),ci=0,xi=Mn;ci<xi.length;ci+=1){var Pi=xi[ci],Di=fr[Pi],Zi=Di[0],ui=Di[1],Pa=t.createExpression(ui),Wa=t.createExpression(typeof Zi=="string"?[Zi,["accumulated"],["get",Pi]]:Zi);xr[Pi]=Pa.value,Qr[Pi]=Wa.value}return rr.map=function(ze){wn.properties=ze;for(var Pe={},Rr=0,qr=Mn;Rr<qr.length;Rr+=1){var $r=qr[Rr];Pe[$r]=xr[$r].evaluate(Cn,wn)}return Pe},rr.reduce=function(ze,Pe){wn.properties=Pe;for(var Rr=0,qr=Mn;Rr<qr.length;Rr+=1){var $r=qr[Rr];Cn.accumulated=ze[$r],ze[$r]=Qr[$r].evaluate(Cn,wn)}},rr}var Hi=function(We){var rr=this;this.self=We,this.actor=new t.Actor(We,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:y,geojson:qn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(fr,xr){if(rr.workerSourceTypes[fr])throw new Error('Worker source with name "'+fr+'" already registered.');rr.workerSourceTypes[fr]=xr},this.self.registerRTLTextPlugin=function(fr){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=fr.applyArabicShaping,t.plugin.processBidirectionalText=fr.processBidirectionalText,t.plugin.processStyledBidirectionalText=fr.processStyledBidirectionalText}};return Hi.prototype.setReferrer=function(We,rr){this.referrer=rr},Hi.prototype.setImages=function(We,rr,fr){this.availableImages[We]=rr;for(var xr in this.workerSources[We]){var Qr=this.workerSources[We][xr];for(var Cn in Qr)Qr[Cn].availableImages=rr}fr()},Hi.prototype.setLayers=function(We,rr,fr){this.getLayerIndex(We).replace(rr),fr()},Hi.prototype.updateLayers=function(We,rr,fr){this.getLayerIndex(We).update(rr.layers,rr.removedIds),fr()},Hi.prototype.loadTile=function(We,rr,fr){this.getWorkerSource(We,rr.type,rr.source).loadTile(rr,fr)},Hi.prototype.loadDEMTile=function(We,rr,fr){this.getDEMWorkerSource(We,rr.source).loadTile(rr,fr)},Hi.prototype.reloadTile=function(We,rr,fr){this.getWorkerSource(We,rr.type,rr.source).reloadTile(rr,fr)},Hi.prototype.abortTile=function(We,rr,fr){this.getWorkerSource(We,rr.type,rr.source).abortTile(rr,fr)},Hi.prototype.removeTile=function(We,rr,fr){this.getWorkerSource(We,rr.type,rr.source).removeTile(rr,fr)},Hi.prototype.removeDEMTile=function(We,rr){this.getDEMWorkerSource(We,rr.source).removeTile(rr)},Hi.prototype.removeSource=function(We,rr,fr){if(!(!this.workerSources[We]||!this.workerSources[We][rr.type]||!this.workerSources[We][rr.type][rr.source])){var xr=this.workerSources[We][rr.type][rr.source];delete this.workerSources[We][rr.type][rr.source],xr.removeSource!==void 0?xr.removeSource(rr,fr):fr()}},Hi.prototype.loadWorkerSource=function(We,rr,fr){try{this.self.importScripts(rr.url),fr()}catch(xr){fr(xr.toString())}},Hi.prototype.syncRTLPluginState=function(We,rr,fr){try{t.plugin.setState(rr);var xr=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&xr!=null){this.self.importScripts(xr);var Qr=t.plugin.isParsed(),Cn=Qr?void 0:new Error("RTL Text Plugin failed to import scripts from "+xr);fr(Cn,Qr)}}catch(wn){fr(wn.toString())}},Hi.prototype.getAvailableImages=function(We){var rr=this.availableImages[We];return rr||(rr=[]),rr},Hi.prototype.getLayerIndex=function(We){var rr=this.layerIndexes[We];return rr||(rr=this.layerIndexes[We]=new n),rr},Hi.prototype.getWorkerSource=function(We,rr,fr){var xr=this;if(this.workerSources[We]||(this.workerSources[We]={}),this.workerSources[We][rr]||(this.workerSources[We][rr]={}),!this.workerSources[We][rr][fr]){var Qr={send:function(Cn,wn,Mn){xr.actor.send(Cn,wn,Mn,We)}};this.workerSources[We][rr][fr]=new this.workerSourceTypes[rr](Qr,this.getLayerIndex(We),this.getAvailableImages(We))}return this.workerSources[We][rr][fr]},Hi.prototype.getDEMWorkerSource=function(We,rr){return this.demWorkerSources[We]||(this.demWorkerSources[We]={}),this.demWorkerSources[We][rr]||(this.demWorkerSources[We][rr]=new T),this.demWorkerSources[We][rr]},Hi.prototype.enforceCacheSizeLimit=function(We,rr){t.enforceCacheSizeLimit(rr)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new Hi(self)),Hi}),S(["./shared"],function(t){var e=t.createCommonjsModule(function(Z){Z.exports?Z.exports=ot:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=ot,window.mapboxgl.notSupportedReason=et);function ot(Xe){return!et(Xe)}function et(Xe){if(!xt())return"not a browser";if(!Ut())return"insufficent Array support";if(!fe())return"insufficient Function support";if(!ye())return"insufficient Object support";if(!Yt())return"insufficient JSON support";if(!ce())return"insufficient worker support";if(!Se())return"insufficient Uint8ClampedArray support";if(!nr())return"insufficient ArrayBuffer support";if(!Ye())return"insufficient Canvas/getImageData support";if(!lr(Xe&&Xe.failIfMajorPerformanceCaveat))return"insufficient WebGL support"}function xt(){return typeof window<"u"&&typeof document<"u"}function Ut(){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 fe(){return Function.prototype&&Function.prototype.bind}function ye(){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 Yt(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function ce(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var Xe=new Blob([""],{type:"text/javascript"}),$e=URL.createObjectURL(Xe),Cr,on;try{on=new Worker($e),Cr=!0}catch{Cr=!1}return on&&on.terminate(),URL.revokeObjectURL($e),Cr}function Se(){return"Uint8ClampedArray"in window}function nr(){return ArrayBuffer.isView}function Ye(){var Xe=document.createElement("canvas");Xe.width=Xe.height=1;var $e=Xe.getContext("2d");if(!$e)return!1;var Cr=$e.getImageData(0,0,1,1);return Cr&&Cr.width===Xe.width}var tr={};function lr(Xe){return tr[Xe]===void 0&&(tr[Xe]=Ve(Xe)),tr[Xe]}ot.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function hr(Xe){var $e=document.createElement("canvas"),Cr=Object.create(ot.webGLContextAttributes);return Cr.failIfMajorPerformanceCaveat=Xe,$e.probablySupportsContext?$e.probablySupportsContext("webgl",Cr)||$e.probablySupportsContext("experimental-webgl",Cr):$e.supportsContext?$e.supportsContext("webgl",Cr)||$e.supportsContext("experimental-webgl",Cr):$e.getContext("webgl",Cr)||$e.getContext("experimental-webgl",Cr)}function Ve(Xe){var $e=hr(Xe);if(!$e)return!1;var Cr=$e.createShader($e.VERTEX_SHADER);return!Cr||$e.isContextLost()?!1:($e.shaderSource(Cr,"void main() {}"),$e.compileShader(Cr),$e.getShaderParameter(Cr,$e.COMPILE_STATUS)===!0)}}),r={};r.create=function(Z,ot,et){var xt=t.window.document.createElement(Z);return ot!==void 0&&(xt.className=ot),et&&et.appendChild(xt),xt},r.createNS=function(Z,ot){var et=t.window.document.createElementNS(Z,ot);return et};var a=t.window.document&&t.window.document.documentElement.style;function n(Z){if(!a)return Z[0];for(var ot=0;ot<Z.length;ot++)if(Z[ot]in a)return Z[ot];return Z[0]}var o=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),i;r.disableDrag=function(){a&&o&&(i=a[o],a[o]="none")},r.enableDrag=function(){a&&o&&(a[o]=i)};var s=n(["transform","WebkitTransform"]);r.setTransform=function(Z,ot){Z.style[s]=ot};var f=!1;try{var x=Object.defineProperty({},"passive",{get:function(){f=!0}});t.window.addEventListener("test",x,x),t.window.removeEventListener("test",x,x)}catch{f=!1}r.addEventListener=function(Z,ot,et,xt){xt===void 0&&(xt={}),"passive"in xt&&f?Z.addEventListener(ot,et,xt):Z.addEventListener(ot,et,xt.capture)},r.removeEventListener=function(Z,ot,et,xt){xt===void 0&&(xt={}),"passive"in xt&&f?Z.removeEventListener(ot,et,xt):Z.removeEventListener(ot,et,xt.capture)};var y=function(Z){Z.preventDefault(),Z.stopPropagation(),t.window.removeEventListener("click",y,!0)};r.suppressClick=function(){t.window.addEventListener("click",y,!0),t.window.setTimeout(function(){t.window.removeEventListener("click",y,!0)},0)},r.mousePos=function(Z,ot){var et=Z.getBoundingClientRect();return new t.Point(ot.clientX-et.left-Z.clientLeft,ot.clientY-et.top-Z.clientTop)},r.touchPos=function(Z,ot){for(var et=Z.getBoundingClientRect(),xt=[],Ut=0;Ut<ot.length;Ut++)xt.push(new t.Point(ot[Ut].clientX-et.left-Z.clientLeft,ot[Ut].clientY-et.top-Z.clientTop));return xt},r.mouseButton=function(Z){return typeof t.window.InstallTrigger<"u"&&Z.button===2&&Z.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:Z.button},r.remove=function(Z){Z.parentNode&&Z.parentNode.removeChild(Z)};function v(Z,ot,et){var xt,Ut,fe,ye=t.browser.devicePixelRatio>1?"@2x":"",Yt=t.getJSON(ot.transformRequest(ot.normalizeSpriteURL(Z,ye,".json"),t.ResourceType.SpriteJSON),function(nr,Ye){Yt=null,fe||(fe=nr,xt=Ye,Se())}),ce=t.getImage(ot.transformRequest(ot.normalizeSpriteURL(Z,ye,".png"),t.ResourceType.SpriteImage),function(nr,Ye){ce=null,fe||(fe=nr,Ut=Ye,Se())});function Se(){if(fe)et(fe);else if(xt&&Ut){var nr=t.browser.getImageData(Ut),Ye={};for(var tr in xt){var lr=xt[tr],hr=lr.width,Ve=lr.height,Xe=lr.x,$e=lr.y,Cr=lr.sdf,on=lr.pixelRatio,fn=lr.stretchX,fi=lr.stretchY,si=lr.content,Gn=new t.RGBAImage({width:hr,height:Ve});t.RGBAImage.copy(nr,Gn,{x:Xe,y:$e},{x:0,y:0},{width:hr,height:Ve}),Ye[tr]={data:Gn,pixelRatio:on,sdf:Cr,stretchX:fn,stretchY:fi,content:si}}et(null,Ye)}}return{cancel:function(){Yt&&(Yt.cancel(),Yt=null),ce&&(ce.cancel(),ce=null)}}}function T(Z){var ot=Z.userImage;if(ot&&ot.render){var et=ot.render();if(et)return Z.data.replace(new Uint8Array(ot.data.buffer)),!0}return!1}var u=1,b=function(Z){function ot(){Z.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 Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.isLoaded=function(){return this.loaded},ot.prototype.setLoaded=function(et){if(this.loaded!==et&&(this.loaded=et,et)){for(var xt=0,Ut=this.requestors;xt<Ut.length;xt+=1){var fe=Ut[xt],ye=fe.ids,Yt=fe.callback;this._notify(ye,Yt)}this.requestors=[]}},ot.prototype.getImage=function(et){return this.images[et]},ot.prototype.addImage=function(et,xt){this._validate(et,xt)&&(this.images[et]=xt)},ot.prototype._validate=function(et,xt){var Ut=!0;return this._validateStretch(xt.stretchX,xt.data&&xt.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+et+'" has invalid "stretchX" value'))),Ut=!1),this._validateStretch(xt.stretchY,xt.data&&xt.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+et+'" has invalid "stretchY" value'))),Ut=!1),this._validateContent(xt.content,xt)||(this.fire(new t.ErrorEvent(new Error('Image "'+et+'" has invalid "content" value'))),Ut=!1),Ut},ot.prototype._validateStretch=function(et,xt){if(!et)return!0;for(var Ut=0,fe=0,ye=et;fe<ye.length;fe+=1){var Yt=ye[fe];if(Yt[0]<Ut||Yt[1]<Yt[0]||xt<Yt[1])return!1;Ut=Yt[1]}return!0},ot.prototype._validateContent=function(et,xt){return et?!(et.length!==4||et[0]<0||xt.data.width<et[0]||et[1]<0||xt.data.height<et[1]||et[2]<0||xt.data.width<et[2]||et[3]<0||xt.data.height<et[3]||et[2]<et[0]||et[3]<et[1]):!0},ot.prototype.updateImage=function(et,xt){var Ut=this.images[et];xt.version=Ut.version+1,this.images[et]=xt,this.updatedImages[et]=!0},ot.prototype.removeImage=function(et){var xt=this.images[et];delete this.images[et],delete this.patterns[et],xt.userImage&&xt.userImage.onRemove&&xt.userImage.onRemove()},ot.prototype.listImages=function(){return Object.keys(this.images)},ot.prototype.getImages=function(et,xt){var Ut=!0;if(!this.isLoaded())for(var fe=0,ye=et;fe<ye.length;fe+=1){var Yt=ye[fe];this.images[Yt]||(Ut=!1)}this.isLoaded()||Ut?this._notify(et,xt):this.requestors.push({ids:et,callback:xt})},ot.prototype._notify=function(et,xt){for(var Ut={},fe=0,ye=et;fe<ye.length;fe+=1){var Yt=ye[fe];this.images[Yt]||this.fire(new t.Event("styleimagemissing",{id:Yt}));var ce=this.images[Yt];ce?Ut[Yt]={data:ce.data.clone(),pixelRatio:ce.pixelRatio,sdf:ce.sdf,version:ce.version,stretchX:ce.stretchX,stretchY:ce.stretchY,content:ce.content,hasRenderCallback:!!(ce.userImage&&ce.userImage.render)}:t.warnOnce('Image "'+Yt+'" 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.')}xt(null,Ut)},ot.prototype.getPixelSize=function(){var et=this.atlasImage,xt=et.width,Ut=et.height;return{width:xt,height:Ut}},ot.prototype.getPattern=function(et){var xt=this.patterns[et],Ut=this.getImage(et);if(!Ut)return null;if(xt&&xt.position.version===Ut.version)return xt.position;if(xt)xt.position.version=Ut.version;else{var fe=Ut.data.width+u*2,ye=Ut.data.height+u*2,Yt={w:fe,h:ye,x:0,y:0},ce=new t.ImagePosition(Yt,Ut);this.patterns[et]={bin:Yt,position:ce}}return this._updatePatternAtlas(),this.patterns[et].position},ot.prototype.bind=function(et){var xt=et.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(et,this.atlasImage,xt.RGBA),this.atlasTexture.bind(xt.LINEAR,xt.CLAMP_TO_EDGE)},ot.prototype._updatePatternAtlas=function(){var et=[];for(var xt in this.patterns)et.push(this.patterns[xt].bin);var Ut=t.potpack(et),fe=Ut.w,ye=Ut.h,Yt=this.atlasImage;Yt.resize({width:fe||1,height:ye||1});for(var ce in this.patterns){var Se=this.patterns[ce],nr=Se.bin,Ye=nr.x+u,tr=nr.y+u,lr=this.images[ce].data,hr=lr.width,Ve=lr.height;t.RGBAImage.copy(lr,Yt,{x:0,y:0},{x:Ye,y:tr},{width:hr,height:Ve}),t.RGBAImage.copy(lr,Yt,{x:0,y:Ve-1},{x:Ye,y:tr-1},{width:hr,height:1}),t.RGBAImage.copy(lr,Yt,{x:0,y:0},{x:Ye,y:tr+Ve},{width:hr,height:1}),t.RGBAImage.copy(lr,Yt,{x:hr-1,y:0},{x:Ye-1,y:tr},{width:1,height:Ve}),t.RGBAImage.copy(lr,Yt,{x:0,y:0},{x:Ye+hr,y:tr},{width:1,height:Ve})}this.dirty=!0},ot.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},ot.prototype.dispatchRenderCallbacks=function(et){for(var xt=0,Ut=et;xt<Ut.length;xt+=1){var fe=Ut[xt];if(!this.callbackDispatchedThisFrame[fe]){this.callbackDispatchedThisFrame[fe]=!0;var ye=this.images[fe],Yt=T(ye);Yt&&this.updateImage(fe,ye)}}},ot}(t.Evented);function _(Z,ot,et,xt,Ut){var fe=ot*256,ye=fe+255,Yt=xt.transformRequest(xt.normalizeGlyphsURL(et).replace("{fontstack}",Z).replace("{range}",fe+"-"+ye),t.ResourceType.Glyphs);t.getArrayBuffer(Yt,function(ce,Se){if(ce)Ut(ce);else if(Se){for(var nr={},Ye=0,tr=t.parseGlyphPBF(Se);Ye<tr.length;Ye+=1){var lr=tr[Ye];nr[lr.id]=lr}Ut(null,nr)}})}var C=A,M=A,E=1e20;function A(Z,ot,et,xt,Ut,fe){this.fontSize=Z||24,this.buffer=ot===void 0?3:ot,this.cutoff=xt||.25,this.fontFamily=Ut||"sans-serif",this.fontWeight=fe||"normal",this.radius=et||8;var ye=this.size=this.fontSize+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=ye,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(ye*ye),this.gridInner=new Float64Array(ye*ye),this.f=new Float64Array(ye),this.d=new Float64Array(ye),this.z=new Float64Array(ye+1),this.v=new Int16Array(ye),this.middle=Math.round(ye/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}A.prototype.draw=function(Z){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(Z,this.buffer,this.middle);for(var ot=this.ctx.getImageData(0,0,this.size,this.size),et=new Uint8ClampedArray(this.size*this.size),xt=0;xt<this.size*this.size;xt++){var Ut=ot.data[xt*4+3]/255;this.gridOuter[xt]=Ut===1?0:Ut===0?E:Math.pow(Math.max(0,.5-Ut),2),this.gridInner[xt]=Ut===1?E:Ut===0?0:Math.pow(Math.max(0,Ut-.5),2)}for(h(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),h(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),xt=0;xt<this.size*this.size;xt++){var fe=this.gridOuter[xt]-this.gridInner[xt];et[xt]=Math.max(0,Math.min(255,Math.round(255-255*(fe/this.radius+this.cutoff))))}return et};function h(Z,ot,et,xt,Ut,fe,ye){for(var Yt=0;Yt<ot;Yt++){for(var ce=0;ce<et;ce++)xt[ce]=Z[ce*ot+Yt];for(p(xt,Ut,fe,ye,et),ce=0;ce<et;ce++)Z[ce*ot+Yt]=Ut[ce]}for(ce=0;ce<et;ce++){for(Yt=0;Yt<ot;Yt++)xt[Yt]=Z[ce*ot+Yt];for(p(xt,Ut,fe,ye,ot),Yt=0;Yt<ot;Yt++)Z[ce*ot+Yt]=Math.sqrt(Ut[Yt])}}function p(Z,ot,et,xt,Ut){et[0]=0,xt[0]=-E,xt[1]=+E;for(var fe=1,ye=0;fe<Ut;fe++){for(var Yt=(Z[fe]+fe*fe-(Z[et[ye]]+et[ye]*et[ye]))/(2*fe-2*et[ye]);Yt<=xt[ye];)ye--,Yt=(Z[fe]+fe*fe-(Z[et[ye]]+et[ye]*et[ye]))/(2*fe-2*et[ye]);ye++,et[ye]=fe,xt[ye]=Yt,xt[ye+1]=+E}for(fe=0,ye=0;fe<Ut;fe++){for(;xt[ye+1]<fe;)ye++;ot[fe]=(fe-et[ye])*(fe-et[ye])+Z[et[ye]]}}C.default=M;var k=function(Z,ot){this.requestManager=Z,this.localIdeographFontFamily=ot,this.entries={}};k.prototype.setURL=function(Z){this.url=Z},k.prototype.getGlyphs=function(Z,ot){var et=this,xt=[];for(var Ut in Z)for(var fe=0,ye=Z[Ut];fe<ye.length;fe+=1){var Yt=ye[fe];xt.push({stack:Ut,id:Yt})}t.asyncAll(xt,function(ce,Se){var nr=ce.stack,Ye=ce.id,tr=et.entries[nr];tr||(tr=et.entries[nr]={glyphs:{},requests:{},ranges:{}});var lr=tr.glyphs[Ye];if(lr!==void 0){Se(null,{stack:nr,id:Ye,glyph:lr});return}if(lr=et._tinySDF(tr,nr,Ye),lr){tr.glyphs[Ye]=lr,Se(null,{stack:nr,id:Ye,glyph:lr});return}var hr=Math.floor(Ye/256);if(hr*256>65535){Se(new Error("glyphs > 65535 not supported"));return}if(tr.ranges[hr]){Se(null,{stack:nr,id:Ye,glyph:lr});return}var Ve=tr.requests[hr];Ve||(Ve=tr.requests[hr]=[],k.loadGlyphRange(nr,hr,et.url,et.requestManager,function(Xe,$e){if($e){for(var Cr in $e)et._doesCharSupportLocalGlyph(+Cr)||(tr.glyphs[+Cr]=$e[+Cr]);tr.ranges[hr]=!0}for(var on=0,fn=Ve;on<fn.length;on+=1){var fi=fn[on];fi(Xe,$e)}delete tr.requests[hr]})),Ve.push(function(Xe,$e){Xe?Se(Xe):$e&&Se(null,{stack:nr,id:Ye,glyph:$e[Ye]||null})})},function(ce,Se){if(ce)ot(ce);else if(Se){for(var nr={},Ye=0,tr=Se;Ye<tr.length;Ye+=1){var lr=tr[Ye],hr=lr.stack,Ve=lr.id,Xe=lr.glyph;(nr[hr]||(nr[hr]={}))[Ve]=Xe&&{id:Xe.id,bitmap:Xe.bitmap.clone(),metrics:Xe.metrics}}ot(null,nr)}})},k.prototype._doesCharSupportLocalGlyph=function(Z){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](Z)||t.isChar["Hangul Syllables"](Z)||t.isChar.Hiragana(Z)||t.isChar.Katakana(Z))},k.prototype._tinySDF=function(Z,ot,et){var xt=this.localIdeographFontFamily;if(xt&&this._doesCharSupportLocalGlyph(et)){var Ut=Z.tinySDF;if(!Ut){var fe="400";/bold/i.test(ot)?fe="900":/medium/i.test(ot)?fe="500":/light/i.test(ot)&&(fe="200"),Ut=Z.tinySDF=new k.TinySDF(24,3,8,.25,xt,fe)}return{id:et,bitmap:new t.AlphaImage({width:30,height:30},Ut.draw(String.fromCharCode(et))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},k.loadGlyphRange=_,k.TinySDF=C;var w=function(){this.specification=t.styleSpec.light.position};w.prototype.possiblyEvaluate=function(Z,ot){return t.sphericalToCartesian(Z.expression.evaluate(ot))},w.prototype.interpolate=function(Z,ot,et){return{x:t.number(Z.x,ot.x,et),y:t.number(Z.y,ot.y,et),z:t.number(Z.z,ot.z,et)}};var R=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new w,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),O="-transition",N=function(Z){function ot(et){Z.call(this),this._transitionable=new t.Transitionable(R),this.setLight(et),this._transitioning=this._transitionable.untransitioned()}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getLight=function(){return this._transitionable.serialize()},ot.prototype.setLight=function(et,xt){if(xt===void 0&&(xt={}),!this._validate(t.validateLight,et,xt))for(var Ut in et){var fe=et[Ut];t.endsWith(Ut,O)?this._transitionable.setTransition(Ut.slice(0,-O.length),fe):this._transitionable.setValue(Ut,fe)}},ot.prototype.updateTransitions=function(et){this._transitioning=this._transitionable.transitioned(et,this._transitioning)},ot.prototype.hasTransition=function(){return this._transitioning.hasTransition()},ot.prototype.recalculate=function(et){this.properties=this._transitioning.possiblyEvaluate(et)},ot.prototype._validate=function(et,xt,Ut){return Ut&&Ut.validate===!1?!1:t.emitValidationErrors(this,et.call(t.validateStyle,t.extend({value:xt,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},ot}(t.Evented),V=function(Z,ot){this.width=Z,this.height=ot,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};V.prototype.getDash=function(Z,ot){var et=Z.join(",")+String(ot);return this.dashEntry[et]||(this.dashEntry[et]=this.addDash(Z,ot)),this.dashEntry[et]},V.prototype.getDashRanges=function(Z,ot,et){var xt=Z.length%2===1,Ut=[],fe=xt?-Z[Z.length-1]*et:0,ye=Z[0]*et,Yt=!0;Ut.push({left:fe,right:ye,isDash:Yt,zeroLength:Z[0]===0});for(var ce=Z[0],Se=1;Se<Z.length;Se++){Yt=!Yt;var nr=Z[Se];fe=ce*et,ce+=nr,ye=ce*et,Ut.push({left:fe,right:ye,isDash:Yt,zeroLength:nr===0})}return Ut},V.prototype.addRoundDash=function(Z,ot,et){for(var xt=ot/2,Ut=-et;Ut<=et;Ut++)for(var fe=this.nextRow+et+Ut,ye=this.width*fe,Yt=0,ce=Z[Yt],Se=0;Se<this.width;Se++){Se/ce.right>1&&(ce=Z[++Yt]);var nr=Math.abs(Se-ce.left),Ye=Math.abs(Se-ce.right),tr=Math.min(nr,Ye),lr=void 0,hr=Ut/et*(xt+1);if(ce.isDash){var Ve=xt-Math.abs(hr);lr=Math.sqrt(tr*tr+Ve*Ve)}else lr=xt-Math.sqrt(tr*tr+hr*hr);this.data[ye+Se]=Math.max(0,Math.min(255,lr+128))}},V.prototype.addRegularDash=function(Z){for(var ot=Z.length-1;ot>=0;--ot){var et=Z[ot],xt=Z[ot+1];et.zeroLength?Z.splice(ot,1):xt&&xt.isDash===et.isDash&&(xt.left=et.left,Z.splice(ot,1))}var Ut=Z[0],fe=Z[Z.length-1];Ut.isDash===fe.isDash&&(Ut.left=fe.left-this.width,fe.right=Ut.right+this.width);for(var ye=this.width*this.nextRow,Yt=0,ce=Z[Yt],Se=0;Se<this.width;Se++){Se/ce.right>1&&(ce=Z[++Yt]);var nr=Math.abs(Se-ce.left),Ye=Math.abs(Se-ce.right),tr=Math.min(nr,Ye),lr=ce.isDash?tr:-tr;this.data[ye+Se]=Math.max(0,Math.min(255,lr+128))}},V.prototype.addDash=function(Z,ot){var et=ot?7:0,xt=2*et+1;if(this.nextRow+xt>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var Ut=0,fe=0;fe<Z.length;fe++)Ut+=Z[fe];if(Ut!==0){var ye=this.width/Ut,Yt=this.getDashRanges(Z,this.width,ye);ot?this.addRoundDash(Yt,ye,et):this.addRegularDash(Yt)}var ce={y:(this.nextRow+et+.5)/this.height,height:2*et/this.height,width:Ut};return this.nextRow+=xt,this.dirty=!0,ce},V.prototype.bind=function(Z){var ot=Z.gl;this.texture?(ot.bindTexture(ot.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,ot.texSubImage2D(ot.TEXTURE_2D,0,0,0,this.width,this.height,ot.ALPHA,ot.UNSIGNED_BYTE,this.data))):(this.texture=ot.createTexture(),ot.bindTexture(ot.TEXTURE_2D,this.texture),ot.texParameteri(ot.TEXTURE_2D,ot.TEXTURE_WRAP_S,ot.REPEAT),ot.texParameteri(ot.TEXTURE_2D,ot.TEXTURE_WRAP_T,ot.REPEAT),ot.texParameteri(ot.TEXTURE_2D,ot.TEXTURE_MIN_FILTER,ot.LINEAR),ot.texParameteri(ot.TEXTURE_2D,ot.TEXTURE_MAG_FILTER,ot.LINEAR),ot.texImage2D(ot.TEXTURE_2D,0,ot.ALPHA,this.width,this.height,0,ot.ALPHA,ot.UNSIGNED_BYTE,this.data))};var H=function Z(ot,et){this.workerPool=ot,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var xt=this.workerPool.acquire(this.id),Ut=0;Ut<xt.length;Ut++){var fe=xt[Ut],ye=new Z.Actor(fe,et,this.id);ye.name="Worker "+Ut,this.actors.push(ye)}};H.prototype.broadcast=function(Z,ot,et){et=et||function(){},t.asyncAll(this.actors,function(xt,Ut){xt.send(Z,ot,Ut)},et)},H.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},H.prototype.remove=function(){this.actors.forEach(function(Z){Z.remove()}),this.actors=[],this.workerPool.release(this.id)},H.Actor=t.Actor;function F(Z,ot,et){var xt=function(Ut,fe){if(Ut)return et(Ut);if(fe){var ye=t.pick(t.extend(fe,Z),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);fe.vector_layers&&(ye.vectorLayers=fe.vector_layers,ye.vectorLayerIds=ye.vectorLayers.map(function(Yt){return Yt.id})),ye.tiles=ot.canonicalizeTileset(ye,Z.url),et(null,ye)}};return Z.url?t.getJSON(ot.transformRequest(ot.normalizeSourceURL(Z.url),t.ResourceType.Source),xt):t.browser.frame(function(){return xt(null,Z)})}var U=function(Z,ot,et){this.bounds=t.LngLatBounds.convert(this.validateBounds(Z)),this.minzoom=ot||0,this.maxzoom=et||24};U.prototype.validateBounds=function(Z){return!Array.isArray(Z)||Z.length!==4?[-180,-90,180,90]:[Math.max(-180,Z[0]),Math.max(-90,Z[1]),Math.min(180,Z[2]),Math.min(90,Z[3])]},U.prototype.contains=function(Z){var ot=Math.pow(2,Z.z),et={minX:Math.floor(t.mercatorXfromLng(this.bounds.getWest())*ot),minY:Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*ot),maxX:Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*ot),maxY:Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*ot)},xt=Z.x>=et.minX&&Z.x<et.maxX&&Z.y>=et.minY&&Z.y<et.maxY;return xt};var W=function(Z){function ot(et,xt,Ut,fe){if(Z.call(this),this.id=et,this.dispatcher=Ut,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(xt,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},xt),this._collectResourceTiming=xt.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(fe)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.load=function(){var et=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=F(this._options,this.map._requestManager,function(xt,Ut){et._tileJSONRequest=null,et._loaded=!0,xt?et.fire(new t.ErrorEvent(xt)):Ut&&(t.extend(et,Ut),Ut.bounds&&(et.tileBounds=new U(Ut.bounds,et.minzoom,et.maxzoom)),t.postTurnstileEvent(Ut.tiles,et.map._requestManager._customAccessToken),t.postMapLoadEvent(Ut.tiles,et.map._getMapId(),et.map._requestManager._skuToken,et.map._requestManager._customAccessToken),et.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),et.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},ot.prototype.loaded=function(){return this._loaded},ot.prototype.hasTile=function(et){return!this.tileBounds||this.tileBounds.contains(et.canonical)},ot.prototype.onAdd=function(et){this.map=et,this.load()},ot.prototype.setSourceProperty=function(et){this._tileJSONRequest&&this._tileJSONRequest.cancel(),et();var xt=this.map.style.sourceCaches[this.id];xt.clearTiles(),this.load()},ot.prototype.setTiles=function(et){var xt=this;return this.setSourceProperty(function(){xt._options.tiles=et}),this},ot.prototype.setUrl=function(et){var xt=this;return this.setSourceProperty(function(){xt.url=et,xt._options.url=et}),this},ot.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},ot.prototype.serialize=function(){return t.extend({},this._options)},ot.prototype.loadTile=function(et,xt){var Ut=this.map._requestManager.normalizeTileURL(et.tileID.canonical.url(this.tiles,this.scheme)),fe={request:this.map._requestManager.transformRequest(Ut,t.ResourceType.Tile),uid:et.uid,tileID:et.tileID,zoom:et.tileID.overscaledZ,tileSize:this.tileSize*et.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};fe.request.collectResourceTiming=this._collectResourceTiming,!et.actor||et.state==="expired"?(et.actor=this.dispatcher.getActor(),et.request=et.actor.send("loadTile",fe,ye.bind(this))):et.state==="loading"?et.reloadCallback=xt:et.request=et.actor.send("reloadTile",fe,ye.bind(this));function ye(Yt,ce){if(delete et.request,et.aborted)return xt(null);if(Yt&&Yt.status!==404)return xt(Yt);ce&&ce.resourceTiming&&(et.resourceTiming=ce.resourceTiming),this.map._refreshExpiredTiles&&ce&&et.setExpiryData(ce),et.loadVectorData(ce,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),xt(null),et.reloadCallback&&(this.loadTile(et,et.reloadCallback),et.reloadCallback=null)}},ot.prototype.abortTile=function(et){et.request&&(et.request.cancel(),delete et.request),et.actor&&et.actor.send("abortTile",{uid:et.uid,type:this.type,source:this.id},void 0)},ot.prototype.unloadTile=function(et){et.unloadVectorData(),et.actor&&et.actor.send("removeTile",{uid:et.uid,type:this.type,source:this.id},void 0)},ot.prototype.hasTransition=function(){return!1},ot}(t.Evented),q=function(Z){function ot(et,xt,Ut,fe){Z.call(this),this.id=et,this.dispatcher=Ut,this.setEventedParent(fe),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"},xt),t.extend(this,t.pick(xt,["url","scheme","tileSize"]))}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.load=function(){var et=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=F(this._options,this.map._requestManager,function(xt,Ut){et._tileJSONRequest=null,et._loaded=!0,xt?et.fire(new t.ErrorEvent(xt)):Ut&&(t.extend(et,Ut),Ut.bounds&&(et.tileBounds=new U(Ut.bounds,et.minzoom,et.maxzoom)),t.postTurnstileEvent(Ut.tiles),t.postMapLoadEvent(Ut.tiles,et.map._getMapId(),et.map._requestManager._skuToken),et.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),et.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},ot.prototype.loaded=function(){return this._loaded},ot.prototype.onAdd=function(et){this.map=et,this.load()},ot.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},ot.prototype.serialize=function(){return t.extend({},this._options)},ot.prototype.hasTile=function(et){return!this.tileBounds||this.tileBounds.contains(et.canonical)},ot.prototype.loadTile=function(et,xt){var Ut=this,fe=this.map._requestManager.normalizeTileURL(et.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);et.request=t.getImage(this.map._requestManager.transformRequest(fe,t.ResourceType.Tile),function(ye,Yt){if(delete et.request,et.aborted)et.state="unloaded",xt(null);else if(ye)et.state="errored",xt(ye);else if(Yt){Ut.map._refreshExpiredTiles&&et.setExpiryData(Yt),delete Yt.cacheControl,delete Yt.expires;var ce=Ut.map.painter.context,Se=ce.gl;et.texture=Ut.map.painter.getTileTexture(Yt.width),et.texture?et.texture.update(Yt,{useMipmap:!0}):(et.texture=new t.Texture(ce,Yt,Se.RGBA,{useMipmap:!0}),et.texture.bind(Se.LINEAR,Se.CLAMP_TO_EDGE,Se.LINEAR_MIPMAP_NEAREST),ce.extTextureFilterAnisotropic&&Se.texParameterf(Se.TEXTURE_2D,ce.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ce.extTextureFilterAnisotropicMax)),et.state="loaded",t.cacheEntryPossiblyAdded(Ut.dispatcher),xt(null)}})},ot.prototype.abortTile=function(et,xt){et.request&&(et.request.cancel(),delete et.request),xt()},ot.prototype.unloadTile=function(et,xt){et.texture&&this.map.painter.saveTileTexture(et.texture),xt()},ot.prototype.hasTransition=function(){return!1},ot}(t.Evented),X=function(Z){function ot(et,xt,Ut,fe){Z.call(this,et,xt,Ut,fe),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},xt),this.encoding=xt.encoding||"mapbox"}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},ot.prototype.loadTile=function(et,xt){var Ut=this.map._requestManager.normalizeTileURL(et.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);et.request=t.getImage(this.map._requestManager.transformRequest(Ut,t.ResourceType.Tile),fe.bind(this)),et.neighboringTiles=this._getNeighboringTiles(et.tileID);function fe(Yt,ce){if(delete et.request,et.aborted)et.state="unloaded",xt(null);else if(Yt)et.state="errored",xt(Yt);else if(ce){this.map._refreshExpiredTiles&&et.setExpiryData(ce),delete ce.cacheControl,delete ce.expires;var Se=t.window.ImageBitmap&&ce instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported(),nr=Se?ce:t.browser.getImageData(ce,1),Ye={uid:et.uid,coord:et.tileID,source:this.id,rawImageData:nr,encoding:this.encoding};(!et.actor||et.state==="expired")&&(et.actor=this.dispatcher.getActor(),et.actor.send("loadDEMTile",Ye,ye.bind(this)))}}function ye(Yt,ce){Yt&&(et.state="errored",xt(Yt)),ce&&(et.dem=ce,et.needsHillshadePrepare=!0,et.state="loaded",xt(null))}},ot.prototype._getNeighboringTiles=function(et){var xt=et.canonical,Ut=Math.pow(2,xt.z),fe=(xt.x-1+Ut)%Ut,ye=xt.x===0?et.wrap-1:et.wrap,Yt=(xt.x+1+Ut)%Ut,ce=xt.x+1===Ut?et.wrap+1:et.wrap,Se={};return Se[new t.OverscaledTileID(et.overscaledZ,ye,xt.z,fe,xt.y).key]={backfilled:!1},Se[new t.OverscaledTileID(et.overscaledZ,ce,xt.z,Yt,xt.y).key]={backfilled:!1},xt.y>0&&(Se[new t.OverscaledTileID(et.overscaledZ,ye,xt.z,fe,xt.y-1).key]={backfilled:!1},Se[new t.OverscaledTileID(et.overscaledZ,et.wrap,xt.z,xt.x,xt.y-1).key]={backfilled:!1},Se[new t.OverscaledTileID(et.overscaledZ,ce,xt.z,Yt,xt.y-1).key]={backfilled:!1}),xt.y+1<Ut&&(Se[new t.OverscaledTileID(et.overscaledZ,ye,xt.z,fe,xt.y+1).key]={backfilled:!1},Se[new t.OverscaledTileID(et.overscaledZ,et.wrap,xt.z,xt.x,xt.y+1).key]={backfilled:!1},Se[new t.OverscaledTileID(et.overscaledZ,ce,xt.z,Yt,xt.y+1).key]={backfilled:!1}),Se},ot.prototype.unloadTile=function(et){et.demTexture&&this.map.painter.saveTileTexture(et.demTexture),et.fbo&&(et.fbo.destroy(),delete et.fbo),et.dem&&delete et.dem,delete et.neighboringTiles,et.state="unloaded",et.actor&&et.actor.send("removeDEMTile",{uid:et.uid,source:this.id})},ot}(q),lt=function(Z){function ot(et,xt,Ut,fe){Z.call(this),this.id=et,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=Ut.getActor(),this.setEventedParent(fe),this._data=xt.data,this._options=t.extend({},xt),this._collectResourceTiming=xt.collectResourceTiming,this._resourceTiming=[],xt.maxzoom!==void 0&&(this.maxzoom=xt.maxzoom),xt.type&&(this.type=xt.type),xt.attribution&&(this.attribution=xt.attribution),this.promoteId=xt.promoteId;var ye=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:xt.cluster||!1,geojsonVtOptions:{buffer:(xt.buffer!==void 0?xt.buffer:128)*ye,tolerance:(xt.tolerance!==void 0?xt.tolerance:.375)*ye,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:xt.lineMetrics||!1,generateId:xt.generateId||!1},superclusterOptions:{maxZoom:xt.clusterMaxZoom!==void 0?Math.min(xt.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,xt.clusterMinPoints||2),extent:t.EXTENT,radius:(xt.clusterRadius||50)*ye,log:!1,generateId:xt.generateId||!1},clusterProperties:xt.clusterProperties,filter:xt.filter},xt.workerOptions)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.load=function(){var et=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(xt){if(xt){et.fire(new t.ErrorEvent(xt));return}var Ut={dataType:"source",sourceDataType:"metadata"};et._collectResourceTiming&&et._resourceTiming&&et._resourceTiming.length>0&&(Ut.resourceTiming=et._resourceTiming,et._resourceTiming=[]),et.fire(new t.Event("data",Ut))})},ot.prototype.onAdd=function(et){this.map=et,this.load()},ot.prototype.setData=function(et){var xt=this;return this._data=et,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Ut){if(Ut){xt.fire(new t.ErrorEvent(Ut));return}var fe={dataType:"source",sourceDataType:"content"};xt._collectResourceTiming&&xt._resourceTiming&&xt._resourceTiming.length>0&&(fe.resourceTiming=xt._resourceTiming,xt._resourceTiming=[]),xt.fire(new t.Event("data",fe))}),this},ot.prototype.getClusterExpansionZoom=function(et,xt){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:et,source:this.id},xt),this},ot.prototype.getClusterChildren=function(et,xt){return this.actor.send("geojson.getClusterChildren",{clusterId:et,source:this.id},xt),this},ot.prototype.getClusterLeaves=function(et,xt,Ut,fe){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:et,limit:xt,offset:Ut},fe),this},ot.prototype._updateWorkerData=function(et){var xt=this;this._loaded=!1;var Ut=t.extend({},this.workerOptions),fe=this._data;typeof fe=="string"?(Ut.request=this.map._requestManager.transformRequest(t.browser.resolveURL(fe),t.ResourceType.Source),Ut.request.collectResourceTiming=this._collectResourceTiming):Ut.data=JSON.stringify(fe),this.actor.send(this.type+".loadData",Ut,function(ye,Yt){xt._removed||Yt&&Yt.abandoned||(xt._loaded=!0,Yt&&Yt.resourceTiming&&Yt.resourceTiming[xt.id]&&(xt._resourceTiming=Yt.resourceTiming[xt.id].slice(0)),xt.actor.send(xt.type+".coalesce",{source:Ut.source},null),et(ye))})},ot.prototype.loaded=function(){return this._loaded},ot.prototype.loadTile=function(et,xt){var Ut=this,fe=et.actor?"reloadTile":"loadTile";et.actor=this.actor;var ye={type:this.type,uid:et.uid,tileID:et.tileID,zoom:et.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};et.request=this.actor.send(fe,ye,function(Yt,ce){return delete et.request,et.unloadVectorData(),et.aborted?xt(null):Yt?xt(Yt):(et.loadVectorData(ce,Ut.map.painter,fe==="reloadTile"),xt(null))})},ot.prototype.abortTile=function(et){et.request&&(et.request.cancel(),delete et.request),et.aborted=!0},ot.prototype.unloadTile=function(et){et.unloadVectorData(),this.actor.send("removeTile",{uid:et.uid,type:this.type,source:this.id})},ot.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},ot.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},ot.prototype.hasTransition=function(){return!1},ot}(t.Evented),yt=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),pt=function(Z){function ot(et,xt,Ut,fe){Z.call(this),this.id=et,this.dispatcher=Ut,this.coordinates=xt.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(fe),this.options=xt}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.load=function(et,xt){var Ut=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(fe,ye){Ut._loaded=!0,fe?Ut.fire(new t.ErrorEvent(fe)):ye&&(Ut.image=ye,et&&(Ut.coordinates=et),xt&&xt(),Ut._finishLoading())})},ot.prototype.loaded=function(){return this._loaded},ot.prototype.updateImage=function(et){var xt=this;return!this.image||!et.url?this:(this.options.url=et.url,this.load(et.coordinates,function(){xt.texture=null}),this)},ot.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},ot.prototype.onAdd=function(et){this.map=et,this.load()},ot.prototype.setCoordinates=function(et){var xt=this;this.coordinates=et;var Ut=et.map(t.MercatorCoordinate.fromLngLat);this.tileID=st(Ut),this.minzoom=this.maxzoom=this.tileID.z;var fe=Ut.map(function(ye){return xt.tileID.getTilePoint(ye)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(fe[0].x,fe[0].y,0,0),this._boundsArray.emplaceBack(fe[1].x,fe[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(fe[3].x,fe[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(fe[2].x,fe[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},ot.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var et=this.map.painter.context,xt=et.gl;this.boundsBuffer||(this.boundsBuffer=et.createVertexBuffer(this._boundsArray,yt.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(et,this.image,xt.RGBA),this.texture.bind(xt.LINEAR,xt.CLAMP_TO_EDGE));for(var Ut in this.tiles){var fe=this.tiles[Ut];fe.state!=="loaded"&&(fe.state="loaded",fe.texture=this.texture)}}},ot.prototype.loadTile=function(et,xt){this.tileID&&this.tileID.equals(et.tileID.canonical)?(this.tiles[String(et.tileID.wrap)]=et,et.buckets={},xt(null)):(et.state="errored",xt(null))},ot.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},ot.prototype.hasTransition=function(){return!1},ot}(t.Evented);function st(Z){for(var ot=1/0,et=1/0,xt=-1/0,Ut=-1/0,fe=0,ye=Z;fe<ye.length;fe+=1){var Yt=ye[fe];ot=Math.min(ot,Yt.x),et=Math.min(et,Yt.y),xt=Math.max(xt,Yt.x),Ut=Math.max(Ut,Yt.y)}var ce=xt-ot,Se=Ut-et,nr=Math.max(ce,Se),Ye=Math.max(0,Math.floor(-Math.log(nr)/Math.LN2)),tr=Math.pow(2,Ye);return new t.CanonicalTileID(Ye,Math.floor((ot+xt)/2*tr),Math.floor((et+Ut)/2*tr))}var tt=function(Z){function ot(et,xt,Ut,fe){Z.call(this,et,xt,Ut,fe),this.roundZoom=!0,this.type="video",this.options=xt}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.load=function(){var et=this;this._loaded=!1;var xt=this.options;this.urls=[];for(var Ut=0,fe=xt.urls;Ut<fe.length;Ut+=1){var ye=fe[Ut];this.urls.push(this.map._requestManager.transformRequest(ye,t.ResourceType.Source).url)}t.getVideo(this.urls,function(Yt,ce){et._loaded=!0,Yt?et.fire(new t.ErrorEvent(Yt)):ce&&(et.video=ce,et.video.loop=!0,et.video.addEventListener("playing",function(){et.map.triggerRepaint()}),et.map&&et.video.play(),et._finishLoading())})},ot.prototype.pause=function(){this.video&&this.video.pause()},ot.prototype.play=function(){this.video&&this.video.play()},ot.prototype.seek=function(et){if(this.video){var xt=this.video.seekable;et<xt.start(0)||et>xt.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+xt.start(0)+" and "+xt.end(0)+"-second mark."))):this.video.currentTime=et}},ot.prototype.getVideo=function(){return this.video},ot.prototype.onAdd=function(et){this.map||(this.map=et,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},ot.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var et=this.map.painter.context,xt=et.gl;this.boundsBuffer||(this.boundsBuffer=et.createVertexBuffer(this._boundsArray,yt.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(xt.LINEAR,xt.CLAMP_TO_EDGE),xt.texSubImage2D(xt.TEXTURE_2D,0,0,0,xt.RGBA,xt.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(et,this.video,xt.RGBA),this.texture.bind(xt.LINEAR,xt.CLAMP_TO_EDGE));for(var Ut in this.tiles){var fe=this.tiles[Ut];fe.state!=="loaded"&&(fe.state="loaded",fe.texture=this.texture)}}},ot.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},ot.prototype.hasTransition=function(){return this.video&&!this.video.paused},ot}(pt),dt=function(Z){function ot(et,xt,Ut,fe){Z.call(this,et,xt,Ut,fe),xt.coordinates?(!Array.isArray(xt.coordinates)||xt.coordinates.length!==4||xt.coordinates.some(function(ye){return!Array.isArray(ye)||ye.length!==2||ye.some(function(Yt){return typeof Yt!="number"})}))&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+et,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+et,null,'missing required property "coordinates"'))),xt.animate&&typeof xt.animate!="boolean"&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+et,null,'optional "animate" property must be a boolean value'))),xt.canvas?typeof xt.canvas!="string"&&!(xt.canvas instanceof t.window.HTMLCanvasElement)&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+et,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."+et,null,'missing required property "canvas"'))),this.options=xt,this.animate=xt.animate!==void 0?xt.animate:!0}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.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()},ot.prototype.getCanvas=function(){return this.canvas},ot.prototype.onAdd=function(et){this.map=et,this.load(),this.canvas&&this.animate&&this.play()},ot.prototype.onRemove=function(){this.pause()},ot.prototype.prepare=function(){var et=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,et=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,et=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var xt=this.map.painter.context,Ut=xt.gl;this.boundsBuffer||(this.boundsBuffer=xt.createVertexBuffer(this._boundsArray,yt.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(et||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(xt,this.canvas,Ut.RGBA,{premultiply:!0});for(var fe in this.tiles){var ye=this.tiles[fe];ye.state!=="loaded"&&(ye.state="loaded",ye.texture=this.texture)}}},ot.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},ot.prototype.hasTransition=function(){return this._playing},ot.prototype._hasInvalidDimensions=function(){for(var et=0,xt=[this.canvas.width,this.canvas.height];et<xt.length;et+=1){var Ut=xt[et];if(isNaN(Ut)||Ut<=0)return!0}return!1},ot}(pt),rt={vector:W,raster:q,"raster-dem":X,geojson:lt,video:tt,image:pt,canvas:dt},at=function(Z,ot,et,xt){var Ut=new rt[ot.type](Z,ot,et,xt);if(Ut.id!==Z)throw new Error("Expected Source id to be "+Z+" instead of "+Ut.id);return t.bindAll(["load","abort","unload","serialize","prepare"],Ut),Ut},vt=function(Z){return rt[Z]},it=function(Z,ot){rt[Z]=ot};function Y(Z,ot){var et=t.identity([]);return t.translate(et,et,[1,1,0]),t.scale(et,et,[Z.width*.5,Z.height*.5,1]),t.multiply(et,et,Z.calculatePosMatrix(ot.toUnwrapped()))}function ft(Z,ot,et){if(Z)for(var xt=0,Ut=Z;xt<Ut.length;xt+=1){var fe=Ut[xt],ye=ot[fe];if(ye&&ye.source===et&&ye.type==="fill-extrusion")return!0}else for(var Yt in ot){var ce=ot[Yt];if(ce.source===et&&ce.type==="fill-extrusion")return!0}return!1}function ut(Z,ot,et,xt,Ut,fe){var ye=ft(Ut&&Ut.layers,ot,Z.id),Yt=fe.maxPitchScaleFactor(),ce=Z.tilesIn(xt,Yt,ye);ce.sort(Pt);for(var Se=[],nr=0,Ye=ce;nr<Ye.length;nr+=1){var tr=Ye[nr];Se.push({wrappedTileID:tr.tileID.wrapped().key,queryResults:tr.tile.queryRenderedFeatures(ot,et,Z._state,tr.queryGeometry,tr.cameraQueryGeometry,tr.scale,Ut,fe,Yt,Y(Z.transform,tr.tileID))})}var lr=Wt(Se);for(var hr in lr)lr[hr].forEach(function(Ve){var Xe=Ve.feature,$e=Z.getFeatureState(Xe.layer["source-layer"],Xe.id);Xe.source=Xe.layer.source,Xe.layer["source-layer"]&&(Xe.sourceLayer=Xe.layer["source-layer"]),Xe.state=$e});return lr}function wt(Z,ot,et,xt,Ut,fe,ye){for(var Yt={},ce=fe.queryRenderedSymbols(xt),Se=[],nr=0,Ye=Object.keys(ce).map(Number);nr<Ye.length;nr+=1){var tr=Ye[nr];Se.push(ye[tr])}Se.sort(Pt);for(var lr=function(){var Cr=Ve[hr],on=Cr.featureIndex.lookupSymbolFeatures(ce[Cr.bucketInstanceId],ot,Cr.bucketIndex,Cr.sourceLayerIndex,Ut.filter,Ut.layers,Ut.availableImages,Z);for(var fn in on){var fi=Yt[fn]=Yt[fn]||[],si=on[fn];si.sort(function(Ki,Ai){var Si=Cr.featureSortOrder;if(Si){var sa=Si.indexOf(Ki.featureIndex),Qa=Si.indexOf(Ai.featureIndex);return Qa-sa}else return Ai.featureIndex-Ki.featureIndex});for(var Gn=0,Mi=si;Gn<Mi.length;Gn+=1){var di=Mi[Gn];fi.push(di)}}},hr=0,Ve=Se;hr<Ve.length;hr+=1)lr();var Xe=function(Cr){Yt[Cr].forEach(function(on){var fn=on.feature,fi=Z[Cr],si=et[fi.source],Gn=si.getFeatureState(fn.layer["source-layer"],fn.id);fn.source=fn.layer.source,fn.layer["source-layer"]&&(fn.sourceLayer=fn.layer["source-layer"]),fn.state=Gn})};for(var $e in Yt)Xe($e);return Yt}function zt(Z,ot){for(var et=Z.getRenderableIds().map(function(ce){return Z.getTileByID(ce)}),xt=[],Ut={},fe=0;fe<et.length;fe++){var ye=et[fe],Yt=ye.tileID.canonical.key;Ut[Yt]||(Ut[Yt]=!0,ye.querySourceFeatures(xt,ot))}return xt}function Pt(Z,ot){var et=Z.tileID,xt=ot.tileID;return et.overscaledZ-xt.overscaledZ||et.canonical.y-xt.canonical.y||et.wrap-xt.wrap||et.canonical.x-xt.canonical.x}function Wt(Z){for(var ot={},et={},xt=0,Ut=Z;xt<Ut.length;xt+=1){var fe=Ut[xt],ye=fe.queryResults,Yt=fe.wrappedTileID,ce=et[Yt]=et[Yt]||{};for(var Se in ye)for(var nr=ye[Se],Ye=ce[Se]=ce[Se]||{},tr=ot[Se]=ot[Se]||[],lr=0,hr=nr;lr<hr.length;lr+=1){var Ve=hr[lr];Ye[Ve.featureIndex]||(Ye[Ve.featureIndex]=!0,tr.push(Ve))}}return ot}var Ht=function(Z,ot){this.max=Z,this.onRemove=ot,this.reset()};Ht.prototype.reset=function(){for(var Z in this.data)for(var ot=0,et=this.data[Z];ot<et.length;ot+=1){var xt=et[ot];xt.timeout&&clearTimeout(xt.timeout),this.onRemove(xt.value)}return this.data={},this.order=[],this},Ht.prototype.add=function(Z,ot,et){var xt=this,Ut=Z.wrapped().key;this.data[Ut]===void 0&&(this.data[Ut]=[]);var fe={value:ot,timeout:void 0};if(et!==void 0&&(fe.timeout=setTimeout(function(){xt.remove(Z,fe)},et)),this.data[Ut].push(fe),this.order.push(Ut),this.order.length>this.max){var ye=this._getAndRemoveByKey(this.order[0]);ye&&this.onRemove(ye)}return this},Ht.prototype.has=function(Z){return Z.wrapped().key in this.data},Ht.prototype.getAndRemove=function(Z){return this.has(Z)?this._getAndRemoveByKey(Z.wrapped().key):null},Ht.prototype._getAndRemoveByKey=function(Z){var ot=this.data[Z].shift();return ot.timeout&&clearTimeout(ot.timeout),this.data[Z].length===0&&delete this.data[Z],this.order.splice(this.order.indexOf(Z),1),ot.value},Ht.prototype.getByKey=function(Z){var ot=this.data[Z];return ot?ot[0].value:null},Ht.prototype.get=function(Z){if(!this.has(Z))return null;var ot=this.data[Z.wrapped().key][0];return ot.value},Ht.prototype.remove=function(Z,ot){if(!this.has(Z))return this;var et=Z.wrapped().key,xt=ot===void 0?0:this.data[et].indexOf(ot),Ut=this.data[et][xt];return this.data[et].splice(xt,1),Ut.timeout&&clearTimeout(Ut.timeout),this.data[et].length===0&&delete this.data[et],this.onRemove(Ut.value),this.order.splice(this.order.indexOf(et),1),this},Ht.prototype.setMaxSize=function(Z){for(this.max=Z;this.order.length>this.max;){var ot=this._getAndRemoveByKey(this.order[0]);ot&&this.onRemove(ot)}return this},Ht.prototype.filter=function(Z){var ot=[];for(var et in this.data)for(var xt=0,Ut=this.data[et];xt<Ut.length;xt+=1){var fe=Ut[xt];Z(fe.value)||ot.push(fe)}for(var ye=0,Yt=ot;ye<Yt.length;ye+=1){var ce=Yt[ye];this.remove(ce.value.tileID,ce)}};var Jt=function(Z,ot,et){this.context=Z;var xt=Z.gl;this.buffer=xt.createBuffer(),this.dynamicDraw=!!et,this.context.unbindVAO(),Z.bindElementBuffer.set(this.buffer),xt.bufferData(xt.ELEMENT_ARRAY_BUFFER,ot.arrayBuffer,this.dynamicDraw?xt.DYNAMIC_DRAW:xt.STATIC_DRAW),this.dynamicDraw||delete ot.arrayBuffer};Jt.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Jt.prototype.updateData=function(Z){var ot=this.context.gl;this.context.unbindVAO(),this.bind(),ot.bufferSubData(ot.ELEMENT_ARRAY_BUFFER,0,Z.arrayBuffer)},Jt.prototype.destroy=function(){var Z=this.context.gl;this.buffer&&(Z.deleteBuffer(this.buffer),delete this.buffer)};var ge={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},he=function(Z,ot,et,xt){this.length=ot.length,this.attributes=et,this.itemSize=ot.bytesPerElement,this.dynamicDraw=xt,this.context=Z;var Ut=Z.gl;this.buffer=Ut.createBuffer(),Z.bindVertexBuffer.set(this.buffer),Ut.bufferData(Ut.ARRAY_BUFFER,ot.arrayBuffer,this.dynamicDraw?Ut.DYNAMIC_DRAW:Ut.STATIC_DRAW),this.dynamicDraw||delete ot.arrayBuffer};he.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},he.prototype.updateData=function(Z){var ot=this.context.gl;this.bind(),ot.bufferSubData(ot.ARRAY_BUFFER,0,Z.arrayBuffer)},he.prototype.enableAttributes=function(Z,ot){for(var et=0;et<this.attributes.length;et++){var xt=this.attributes[et],Ut=ot.attributes[xt.name];Ut!==void 0&&Z.enableVertexAttribArray(Ut)}},he.prototype.setVertexAttribPointers=function(Z,ot,et){for(var xt=0;xt<this.attributes.length;xt++){var Ut=this.attributes[xt],fe=ot.attributes[Ut.name];fe!==void 0&&Z.vertexAttribPointer(fe,Ut.components,Z[ge[Ut.type]],!1,this.itemSize,Ut.offset+this.itemSize*(et||0))}},he.prototype.destroy=function(){var Z=this.context.gl;this.buffer&&(Z.deleteBuffer(this.buffer),delete this.buffer)};var de=function(Z){this.gl=Z.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};de.prototype.get=function(){return this.current},de.prototype.set=function(Z){},de.prototype.getDefault=function(){return this.default},de.prototype.setDefault=function(){this.set(this.default)};var se=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return t.Color.transparent},ot.prototype.set=function(et){var xt=this.current;et.r===xt.r&&et.g===xt.g&&et.b===xt.b&&et.a===xt.a&&!this.dirty||(this.gl.clearColor(et.r,et.g,et.b,et.a),this.current=et,this.dirty=!1)},ot}(de),Tt=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return 1},ot.prototype.set=function(et){et===this.current&&!this.dirty||(this.gl.clearDepth(et),this.current=et,this.dirty=!1)},ot}(de),Lt=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return 0},ot.prototype.set=function(et){et===this.current&&!this.dirty||(this.gl.clearStencil(et),this.current=et,this.dirty=!1)},ot}(de),Mt=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return[!0,!0,!0,!0]},ot.prototype.set=function(et){var xt=this.current;et[0]===xt[0]&&et[1]===xt[1]&&et[2]===xt[2]&&et[3]===xt[3]&&!this.dirty||(this.gl.colorMask(et[0],et[1],et[2],et[3]),this.current=et,this.dirty=!1)},ot}(de),te=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return!0},ot.prototype.set=function(et){et===this.current&&!this.dirty||(this.gl.depthMask(et),this.current=et,this.dirty=!1)},ot}(de),ve=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return 255},ot.prototype.set=function(et){et===this.current&&!this.dirty||(this.gl.stencilMask(et),this.current=et,this.dirty=!1)},ot}(de),oe=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},ot.prototype.set=function(et){var xt=this.current;et.func===xt.func&&et.ref===xt.ref&&et.mask===xt.mask&&!this.dirty||(this.gl.stencilFunc(et.func,et.ref,et.mask),this.current=et,this.dirty=!1)},ot}(de),Te=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){var et=this.gl;return[et.KEEP,et.KEEP,et.KEEP]},ot.prototype.set=function(et){var xt=this.current;et[0]===xt[0]&&et[1]===xt[1]&&et[2]===xt[2]&&!this.dirty||(this.gl.stencilOp(et[0],et[1],et[2]),this.current=et,this.dirty=!1)},ot}(de),He=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return!1},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;et?xt.enable(xt.STENCIL_TEST):xt.disable(xt.STENCIL_TEST),this.current=et,this.dirty=!1}},ot}(de),Ge=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return[0,1]},ot.prototype.set=function(et){var xt=this.current;et[0]===xt[0]&&et[1]===xt[1]&&!this.dirty||(this.gl.depthRange(et[0],et[1]),this.current=et,this.dirty=!1)},ot}(de),cr=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return!1},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;et?xt.enable(xt.DEPTH_TEST):xt.disable(xt.DEPTH_TEST),this.current=et,this.dirty=!1}},ot}(de),ur=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return this.gl.LESS},ot.prototype.set=function(et){et===this.current&&!this.dirty||(this.gl.depthFunc(et),this.current=et,this.dirty=!1)},ot}(de),jr=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return!1},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;et?xt.enable(xt.BLEND):xt.disable(xt.BLEND),this.current=et,this.dirty=!1}},ot}(de),Hr=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){var et=this.gl;return[et.ONE,et.ZERO]},ot.prototype.set=function(et){var xt=this.current;et[0]===xt[0]&&et[1]===xt[1]&&!this.dirty||(this.gl.blendFunc(et[0],et[1]),this.current=et,this.dirty=!1)},ot}(de),br=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return t.Color.transparent},ot.prototype.set=function(et){var xt=this.current;et.r===xt.r&&et.g===xt.g&&et.b===xt.b&&et.a===xt.a&&!this.dirty||(this.gl.blendColor(et.r,et.g,et.b,et.a),this.current=et,this.dirty=!1)},ot}(de),Kr=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return this.gl.FUNC_ADD},ot.prototype.set=function(et){et===this.current&&!this.dirty||(this.gl.blendEquation(et),this.current=et,this.dirty=!1)},ot}(de),rn=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return!1},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;et?xt.enable(xt.CULL_FACE):xt.disable(xt.CULL_FACE),this.current=et,this.dirty=!1}},ot}(de),Ce=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return this.gl.BACK},ot.prototype.set=function(et){et===this.current&&!this.dirty||(this.gl.cullFace(et),this.current=et,this.dirty=!1)},ot}(de),$t=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return this.gl.CCW},ot.prototype.set=function(et){et===this.current&&!this.dirty||(this.gl.frontFace(et),this.current=et,this.dirty=!1)},ot}(de),ne=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return null},ot.prototype.set=function(et){et===this.current&&!this.dirty||(this.gl.useProgram(et),this.current=et,this.dirty=!1)},ot}(de),Ct=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return this.gl.TEXTURE0},ot.prototype.set=function(et){et===this.current&&!this.dirty||(this.gl.activeTexture(et),this.current=et,this.dirty=!1)},ot}(de),gt=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){var et=this.gl;return[0,0,et.drawingBufferWidth,et.drawingBufferHeight]},ot.prototype.set=function(et){var xt=this.current;et[0]===xt[0]&&et[1]===xt[1]&&et[2]===xt[2]&&et[3]===xt[3]&&!this.dirty||(this.gl.viewport(et[0],et[1],et[2],et[3]),this.current=et,this.dirty=!1)},ot}(de),St=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return null},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;xt.bindFramebuffer(xt.FRAMEBUFFER,et),this.current=et,this.dirty=!1}},ot}(de),Nt=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return null},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;xt.bindRenderbuffer(xt.RENDERBUFFER,et),this.current=et,this.dirty=!1}},ot}(de),ee=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return null},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;xt.bindTexture(xt.TEXTURE_2D,et),this.current=et,this.dirty=!1}},ot}(de),le=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return null},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;xt.bindBuffer(xt.ARRAY_BUFFER,et),this.current=et,this.dirty=!1}},ot}(de),we=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return null},ot.prototype.set=function(et){var xt=this.gl;xt.bindBuffer(xt.ELEMENT_ARRAY_BUFFER,et),this.current=et,this.dirty=!1},ot}(de),Ue=function(Z){function ot(et){Z.call(this,et),this.vao=et.extVertexArrayObject}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return null},ot.prototype.set=function(et){!this.vao||et===this.current&&!this.dirty||(this.vao.bindVertexArrayOES(et),this.current=et,this.dirty=!1)},ot}(de),qe=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return 4},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;xt.pixelStorei(xt.UNPACK_ALIGNMENT,et),this.current=et,this.dirty=!1}},ot}(de),ar=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return!1},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;xt.pixelStorei(xt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,et),this.current=et,this.dirty=!1}},ot}(de),Ar=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return!1},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){var xt=this.gl;xt.pixelStorei(xt.UNPACK_FLIP_Y_WEBGL,et),this.current=et,this.dirty=!1}},ot}(de),Tr=function(Z){function ot(et,xt){Z.call(this,et),this.context=et,this.parent=xt}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getDefault=function(){return null},ot}(de),pr=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.setDirty=function(){this.dirty=!0},ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var xt=this.gl;xt.framebufferTexture2D(xt.FRAMEBUFFER,xt.COLOR_ATTACHMENT0,xt.TEXTURE_2D,et,0),this.current=et,this.dirty=!1}},ot}(Tr),Jr=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.set=function(et){if(!(et===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var xt=this.gl;xt.framebufferRenderbuffer(xt.FRAMEBUFFER,xt.DEPTH_ATTACHMENT,xt.RENDERBUFFER,et),this.current=et,this.dirty=!1}},ot}(Tr),Vn=function(Z,ot,et,xt){this.context=Z,this.width=ot,this.height=et;var Ut=Z.gl,fe=this.framebuffer=Ut.createFramebuffer();this.colorAttachment=new pr(Z,fe),xt&&(this.depthAttachment=new Jr(Z,fe))};Vn.prototype.destroy=function(){var Z=this.context.gl,ot=this.colorAttachment.get();if(ot&&Z.deleteTexture(ot),this.depthAttachment){var et=this.depthAttachment.get();et&&Z.deleteRenderbuffer(et)}Z.deleteFramebuffer(this.framebuffer)};var Hn=519,Kn=function(Z,ot,et){this.func=Z,this.mask=ot,this.range=et};Kn.ReadOnly=!1,Kn.ReadWrite=!0,Kn.disabled=new Kn(Hn,Kn.ReadOnly,[0,1]);var Ci=519,ii=7680,qn=function(Z,ot,et,xt,Ut,fe){this.test=Z,this.ref=ot,this.mask=et,this.fail=xt,this.depthFail=Ut,this.pass=fe};qn.disabled=new qn({func:Ci,mask:0},0,0,ii,ii,ii);var oa=0,Hi=1,We=771,rr=function(Z,ot,et){this.blendFunction=Z,this.blendColor=ot,this.mask=et};rr.Replace=[Hi,oa],rr.disabled=new rr(rr.Replace,t.Color.transparent,[!1,!1,!1,!1]),rr.unblended=new rr(rr.Replace,t.Color.transparent,[!0,!0,!0,!0]),rr.alphaBlended=new rr([Hi,We],t.Color.transparent,[!0,!0,!0,!0]);var fr=1029,xr=2305,Qr=function(Z,ot,et){this.enable=Z,this.mode=ot,this.frontFace=et};Qr.disabled=new Qr(!1,fr,xr),Qr.backCCW=new Qr(!0,fr,xr);var Cn=function(Z){this.gl=Z,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new se(this),this.clearDepth=new Tt(this),this.clearStencil=new Lt(this),this.colorMask=new Mt(this),this.depthMask=new te(this),this.stencilMask=new ve(this),this.stencilFunc=new oe(this),this.stencilOp=new Te(this),this.stencilTest=new He(this),this.depthRange=new Ge(this),this.depthTest=new cr(this),this.depthFunc=new ur(this),this.blend=new jr(this),this.blendFunc=new Hr(this),this.blendColor=new br(this),this.blendEquation=new Kr(this),this.cullFace=new rn(this),this.cullFaceSide=new Ce(this),this.frontFace=new $t(this),this.program=new ne(this),this.activeTexture=new Ct(this),this.viewport=new gt(this),this.bindFramebuffer=new St(this),this.bindRenderbuffer=new Nt(this),this.bindTexture=new ee(this),this.bindVertexBuffer=new le(this),this.bindElementBuffer=new we(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Ue(this),this.pixelStoreUnpack=new qe(this),this.pixelStoreUnpackPremultiplyAlpha=new ar(this),this.pixelStoreUnpackFlipY=new Ar(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.extTextureHalfFloat=Z.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(Z.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=Z.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=Z.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=Z.getParameter(Z.MAX_TEXTURE_SIZE)};Cn.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()},Cn.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},Cn.prototype.createIndexBuffer=function(Z,ot){return new Jt(this,Z,ot)},Cn.prototype.createVertexBuffer=function(Z,ot,et){return new he(this,Z,ot,et)},Cn.prototype.createRenderbuffer=function(Z,ot,et){var xt=this.gl,Ut=xt.createRenderbuffer();return this.bindRenderbuffer.set(Ut),xt.renderbufferStorage(xt.RENDERBUFFER,Z,ot,et),this.bindRenderbuffer.set(null),Ut},Cn.prototype.createFramebuffer=function(Z,ot,et){return new Vn(this,Z,ot,et)},Cn.prototype.clear=function(Z){var ot=Z.color,et=Z.depth,xt=this.gl,Ut=0;ot&&(Ut|=xt.COLOR_BUFFER_BIT,this.clearColor.set(ot),this.colorMask.set([!0,!0,!0,!0])),typeof et<"u"&&(Ut|=xt.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(et),this.depthMask.set(!0)),xt.clear(Ut)},Cn.prototype.setCullFace=function(Z){Z.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(Z.mode),this.frontFace.set(Z.frontFace))},Cn.prototype.setDepthMode=function(Z){Z.func===this.gl.ALWAYS&&!Z.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(Z.func),this.depthMask.set(Z.mask),this.depthRange.set(Z.range))},Cn.prototype.setStencilMode=function(Z){Z.test.func===this.gl.ALWAYS&&!Z.mask?this.stencilTest.set(!1):(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}))},Cn.prototype.setColorMode=function(Z){t.deepEqual(Z.blendFunction,rr.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(Z.blendFunction),this.blendColor.set(Z.blendColor)),this.colorMask.set(Z.mask)},Cn.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var wn=function(Z){function ot(et,xt,Ut){var fe=this;Z.call(this),this.id=et,this.dispatcher=Ut,this.on("data",function(ye){ye.dataType==="source"&&ye.sourceDataType==="metadata"&&(fe._sourceLoaded=!0),fe._sourceLoaded&&!fe._paused&&ye.dataType==="source"&&ye.sourceDataType==="content"&&(fe.reload(),fe.transform&&fe.update(fe.transform))}),this.on("error",function(){fe._sourceErrored=!0}),this._source=at(et,xt,Ut,this),this._tiles={},this._cache=new Ht(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.onAdd=function(et){this.map=et,this._maxTileCacheSize=et?et._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(et)},ot.prototype.onRemove=function(et){this._source&&this._source.onRemove&&this._source.onRemove(et)},ot.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var et in this._tiles){var xt=this._tiles[et];if(xt.state!=="loaded"&&xt.state!=="errored")return!1}return!0},ot.prototype.getSource=function(){return this._source},ot.prototype.pause=function(){this._paused=!0},ot.prototype.resume=function(){if(this._paused){var et=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,et&&this.reload(),this.transform&&this.update(this.transform)}},ot.prototype._loadTile=function(et,xt){return this._source.loadTile(et,xt)},ot.prototype._unloadTile=function(et){if(this._source.unloadTile)return this._source.unloadTile(et,function(){})},ot.prototype._abortTile=function(et){if(this._source.abortTile)return this._source.abortTile(et,function(){})},ot.prototype.serialize=function(){return this._source.serialize()},ot.prototype.prepare=function(et){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(var xt in this._tiles){var Ut=this._tiles[xt];Ut.upload(et),Ut.prepare(this.map.style.imageManager)}},ot.prototype.getIds=function(){return t.values(this._tiles).map(function(et){return et.tileID}).sort(Mn).map(function(et){return et.key})},ot.prototype.getRenderableIds=function(et){var xt=this,Ut=[];for(var fe in this._tiles)this._isIdRenderable(fe,et)&&Ut.push(this._tiles[fe]);return et?Ut.sort(function(ye,Yt){var ce=ye.tileID,Se=Yt.tileID,nr=new t.Point(ce.canonical.x,ce.canonical.y)._rotate(xt.transform.angle),Ye=new t.Point(Se.canonical.x,Se.canonical.y)._rotate(xt.transform.angle);return ce.overscaledZ-Se.overscaledZ||Ye.y-nr.y||Ye.x-nr.x}).map(function(ye){return ye.tileID.key}):Ut.map(function(ye){return ye.tileID}).sort(Mn).map(function(ye){return ye.key})},ot.prototype.hasRenderableParent=function(et){var xt=this.findLoadedParent(et,0);return xt?this._isIdRenderable(xt.tileID.key):!1},ot.prototype._isIdRenderable=function(et,xt){return this._tiles[et]&&this._tiles[et].hasData()&&!this._coveredTiles[et]&&(xt||!this._tiles[et].holdingForFade())},ot.prototype.reload=function(){if(this._paused){this._shouldReloadOnResume=!0;return}this._cache.reset();for(var et in this._tiles)this._tiles[et].state!=="errored"&&this._reloadTile(et,"reloading")},ot.prototype._reloadTile=function(et,xt){var Ut=this._tiles[et];Ut&&(Ut.state!=="loading"&&(Ut.state=xt),this._loadTile(Ut,this._tileLoaded.bind(this,Ut,et,xt)))},ot.prototype._tileLoaded=function(et,xt,Ut,fe){if(fe){et.state="errored",fe.status!==404?this._source.fire(new t.ErrorEvent(fe,{tile:et})):this.update(this.transform);return}et.timeAdded=t.browser.now(),Ut==="expired"&&(et.refreshedUponExpiration=!0),this._setTileReloadTimer(xt,et),this.getSource().type==="raster-dem"&&et.dem&&this._backfillDEM(et),this._state.initializeTileState(et,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:et,coord:et.tileID}))},ot.prototype._backfillDEM=function(et){for(var xt=this.getRenderableIds(),Ut=0;Ut<xt.length;Ut++){var fe=xt[Ut];if(et.neighboringTiles&&et.neighboringTiles[fe]){var ye=this.getTileByID(fe);Yt(et,ye),Yt(ye,et)}}function Yt(ce,Se){ce.needsHillshadePrepare=!0;var nr=Se.tileID.canonical.x-ce.tileID.canonical.x,Ye=Se.tileID.canonical.y-ce.tileID.canonical.y,tr=Math.pow(2,ce.tileID.canonical.z),lr=Se.tileID.key;nr===0&&Ye===0||Math.abs(Ye)>1||(Math.abs(nr)>1&&(Math.abs(nr+tr)===1?nr+=tr:Math.abs(nr-tr)===1&&(nr-=tr)),!(!Se.dem||!ce.dem)&&(ce.dem.backfillBorder(Se.dem,nr,Ye),ce.neighboringTiles&&ce.neighboringTiles[lr]&&(ce.neighboringTiles[lr].backfilled=!0)))}},ot.prototype.getTile=function(et){return this.getTileByID(et.key)},ot.prototype.getTileByID=function(et){return this._tiles[et]},ot.prototype._retainLoadedChildren=function(et,xt,Ut,fe){for(var ye in this._tiles){var Yt=this._tiles[ye];if(!(fe[ye]||!Yt.hasData()||Yt.tileID.overscaledZ<=xt||Yt.tileID.overscaledZ>Ut)){for(var ce=Yt.tileID;Yt&&Yt.tileID.overscaledZ>xt+1;){var Se=Yt.tileID.scaledTo(Yt.tileID.overscaledZ-1);Yt=this._tiles[Se.key],Yt&&Yt.hasData()&&(ce=Se)}for(var nr=ce;nr.overscaledZ>xt;)if(nr=nr.scaledTo(nr.overscaledZ-1),et[nr.key]){fe[ce.key]=ce;break}}}},ot.prototype.findLoadedParent=function(et,xt){if(et.key in this._loadedParentTiles){var Ut=this._loadedParentTiles[et.key];return Ut&&Ut.tileID.overscaledZ>=xt?Ut:null}for(var fe=et.overscaledZ-1;fe>=xt;fe--){var ye=et.scaledTo(fe),Yt=this._getLoadedTile(ye);if(Yt)return Yt}},ot.prototype._getLoadedTile=function(et){var xt=this._tiles[et.key];if(xt&&xt.hasData())return xt;var Ut=this._cache.getByKey(et.wrapped().key);return Ut},ot.prototype.updateCacheSize=function(et){var xt=Math.ceil(et.width/this._source.tileSize)+1,Ut=Math.ceil(et.height/this._source.tileSize)+1,fe=xt*Ut,ye=5,Yt=Math.floor(fe*ye),ce=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Yt):Yt;this._cache.setMaxSize(ce)},ot.prototype.handleWrapJump=function(et){var xt=this._prevLng===void 0?et:this._prevLng,Ut=et-xt,fe=Ut/360,ye=Math.round(fe);if(this._prevLng=et,ye){var Yt={};for(var ce in this._tiles){var Se=this._tiles[ce];Se.tileID=Se.tileID.unwrapTo(Se.tileID.wrap+ye),Yt[Se.tileID.key]=Se}this._tiles=Yt;for(var nr in this._timers)clearTimeout(this._timers[nr]),delete this._timers[nr];for(var Ye in this._tiles){var tr=this._tiles[Ye];this._setTileReloadTimer(Ye,tr)}}},ot.prototype.update=function(et){var xt=this;if(this.transform=et,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(et),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Ut;this.used?this._source.tileID?Ut=et.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(di){return new t.OverscaledTileID(di.canonical.z,di.wrap,di.canonical.z,di.canonical.x,di.canonical.y)}):(Ut=et.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Ut=Ut.filter(function(di){return xt._source.hasTile(di)}))):Ut=[];var fe=et.coveringZoomLevel(this._source),ye=Math.max(fe-ot.maxOverzooming,this._source.minzoom),Yt=Math.max(fe+ot.maxUnderzooming,this._source.minzoom),ce=this._updateRetainedTiles(Ut,fe);if(ci(this._source.type)){for(var Se={},nr={},Ye=Object.keys(ce),tr=0,lr=Ye;tr<lr.length;tr+=1){var hr=lr[tr],Ve=ce[hr],Xe=this._tiles[hr];if(!(!Xe||Xe.fadeEndTime&&Xe.fadeEndTime<=t.browser.now())){var $e=this.findLoadedParent(Ve,ye);$e&&(this._addTile($e.tileID),Se[$e.tileID.key]=$e.tileID),nr[hr]=Ve}}this._retainLoadedChildren(nr,fe,Yt,ce);for(var Cr in Se)ce[Cr]||(this._coveredTiles[Cr]=!0,ce[Cr]=Se[Cr])}for(var on in ce)this._tiles[on].clearFadeHold();for(var fn=t.keysDifference(this._tiles,ce),fi=0,si=fn;fi<si.length;fi+=1){var Gn=si[fi],Mi=this._tiles[Gn];Mi.hasSymbolBuckets&&!Mi.holdingForFade()?Mi.setHoldDuration(this.map._fadeDuration):(!Mi.hasSymbolBuckets||Mi.symbolFadeFinished())&&this._removeTile(Gn)}this._updateLoadedParentTileCache()}},ot.prototype.releaseSymbolFadeTiles=function(){for(var et in this._tiles)this._tiles[et].holdingForFade()&&this._removeTile(et)},ot.prototype._updateRetainedTiles=function(et,xt){for(var Ut={},fe={},ye=Math.max(xt-ot.maxOverzooming,this._source.minzoom),Yt=Math.max(xt+ot.maxUnderzooming,this._source.minzoom),ce={},Se=0,nr=et;Se<nr.length;Se+=1){var Ye=nr[Se],tr=this._addTile(Ye);Ut[Ye.key]=Ye,!tr.hasData()&&xt<this._source.maxzoom&&(ce[Ye.key]=Ye)}this._retainLoadedChildren(ce,xt,Yt,Ut);for(var lr=0,hr=et;lr<hr.length;lr+=1){var Ve=hr[lr],Xe=this._tiles[Ve.key];if(!Xe.hasData()){if(xt+1>this._source.maxzoom){var $e=Ve.children(this._source.maxzoom)[0],Cr=this.getTile($e);if(Cr&&Cr.hasData()){Ut[$e.key]=$e;continue}}else{var on=Ve.children(this._source.maxzoom);if(Ut[on[0].key]&&Ut[on[1].key]&&Ut[on[2].key]&&Ut[on[3].key])continue}for(var fn=Xe.wasRequested(),fi=Ve.overscaledZ-1;fi>=ye;--fi){var si=Ve.scaledTo(fi);if(fe[si.key]||(fe[si.key]=!0,Xe=this.getTile(si),!Xe&&fn&&(Xe=this._addTile(si)),Xe&&(Ut[si.key]=si,fn=Xe.wasRequested(),Xe.hasData())))break}}}return Ut},ot.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var et in this._tiles){for(var xt=[],Ut=void 0,fe=this._tiles[et].tileID;fe.overscaledZ>0;){if(fe.key in this._loadedParentTiles){Ut=this._loadedParentTiles[fe.key];break}xt.push(fe.key);var ye=fe.scaledTo(fe.overscaledZ-1);if(Ut=this._getLoadedTile(ye),Ut)break;fe=ye}for(var Yt=0,ce=xt;Yt<ce.length;Yt+=1){var Se=ce[Yt];this._loadedParentTiles[Se]=Ut}}},ot.prototype._addTile=function(et){var xt=this._tiles[et.key];if(xt)return xt;xt=this._cache.getAndRemove(et),xt&&(this._setTileReloadTimer(et.key,xt),xt.tileID=et,this._state.initializeTileState(xt,this.map?this.map.painter:null),this._cacheTimers[et.key]&&(clearTimeout(this._cacheTimers[et.key]),delete this._cacheTimers[et.key],this._setTileReloadTimer(et.key,xt)));var Ut=!!xt;return Ut||(xt=new t.Tile(et,this._source.tileSize*et.overscaleFactor()),this._loadTile(xt,this._tileLoaded.bind(this,xt,et.key,xt.state))),xt?(xt.uses++,this._tiles[et.key]=xt,Ut||this._source.fire(new t.Event("dataloading",{tile:xt,coord:xt.tileID,dataType:"source"})),xt):null},ot.prototype._setTileReloadTimer=function(et,xt){var Ut=this;et in this._timers&&(clearTimeout(this._timers[et]),delete this._timers[et]);var fe=xt.getExpiryTimeout();fe&&(this._timers[et]=setTimeout(function(){Ut._reloadTile(et,"expired"),delete Ut._timers[et]},fe))},ot.prototype._removeTile=function(et){var xt=this._tiles[et];xt&&(xt.uses--,delete this._tiles[et],this._timers[et]&&(clearTimeout(this._timers[et]),delete this._timers[et]),!(xt.uses>0)&&(xt.hasData()&&xt.state!=="reloading"?this._cache.add(xt.tileID,xt,xt.getExpiryTimeout()):(xt.aborted=!0,this._abortTile(xt),this._unloadTile(xt))))},ot.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var et in this._tiles)this._removeTile(et);this._cache.reset()},ot.prototype.tilesIn=function(et,xt,Ut){var fe=this,ye=[],Yt=this.transform;if(!Yt)return ye;for(var ce=Ut?Yt.getCameraQueryGeometry(et):et,Se=et.map(function(fi){return Yt.pointCoordinate(fi)}),nr=ce.map(function(fi){return Yt.pointCoordinate(fi)}),Ye=this.getIds(),tr=1/0,lr=1/0,hr=-1/0,Ve=-1/0,Xe=0,$e=nr;Xe<$e.length;Xe+=1){var Cr=$e[Xe];tr=Math.min(tr,Cr.x),lr=Math.min(lr,Cr.y),hr=Math.max(hr,Cr.x),Ve=Math.max(Ve,Cr.y)}for(var on=function(fi){var si=fe._tiles[Ye[fi]];if(!si.holdingForFade()){var Gn=si.tileID,Mi=Math.pow(2,Yt.zoom-si.tileID.overscaledZ),di=xt*si.queryPadding*t.EXTENT/si.tileSize/Mi,Ki=[Gn.getTilePoint(new t.MercatorCoordinate(tr,lr)),Gn.getTilePoint(new t.MercatorCoordinate(hr,Ve))];if(Ki[0].x-di<t.EXTENT&&Ki[0].y-di<t.EXTENT&&Ki[1].x+di>=0&&Ki[1].y+di>=0){var Ai=Se.map(function(sa){return Gn.getTilePoint(sa)}),Si=nr.map(function(sa){return Gn.getTilePoint(sa)});ye.push({tile:si,tileID:Gn,queryGeometry:Ai,cameraQueryGeometry:Si,scale:Mi})}}},fn=0;fn<Ye.length;fn++)on(fn);return ye},ot.prototype.getVisibleCoordinates=function(et){for(var xt=this,Ut=this.getRenderableIds(et).map(function(ce){return xt._tiles[ce].tileID}),fe=0,ye=Ut;fe<ye.length;fe+=1){var Yt=ye[fe];Yt.posMatrix=this.transform.calculatePosMatrix(Yt.toUnwrapped())}return Ut},ot.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(ci(this._source.type))for(var et in this._tiles){var xt=this._tiles[et];if(xt.fadeEndTime!==void 0&&xt.fadeEndTime>=t.browser.now())return!0}return!1},ot.prototype.setFeatureState=function(et,xt,Ut){et=et||"_geojsonTileLayer",this._state.updateState(et,xt,Ut)},ot.prototype.removeFeatureState=function(et,xt,Ut){et=et||"_geojsonTileLayer",this._state.removeFeatureState(et,xt,Ut)},ot.prototype.getFeatureState=function(et,xt){return et=et||"_geojsonTileLayer",this._state.getState(et,xt)},ot.prototype.setDependencies=function(et,xt,Ut){var fe=this._tiles[et];fe&&fe.setDependencies(xt,Ut)},ot.prototype.reloadTilesForDependencies=function(et,xt){for(var Ut in this._tiles){var fe=this._tiles[Ut];fe.hasDependency(et,xt)&&this._reloadTile(Ut,"reloading")}this._cache.filter(function(ye){return!ye.hasDependency(et,xt)})},ot}(t.Evented);wn.maxOverzooming=10,wn.maxUnderzooming=3;function Mn(Z,ot){var et=Math.abs(Z.wrap*2)-+(Z.wrap<0),xt=Math.abs(ot.wrap*2)-+(ot.wrap<0);return Z.overscaledZ-ot.overscaledZ||xt-et||ot.canonical.y-Z.canonical.y||ot.canonical.x-Z.canonical.x}function ci(Z){return Z==="raster"||Z==="image"||Z==="video"}function xi(){return new t.window.Worker(yl.workerUrl)}var Pi="mapboxgl_preloaded_worker_pool",Di=function(){this.active={}};Di.prototype.acquire=function(Z){if(!this.workers)for(this.workers=[];this.workers.length<Di.workerCount;)this.workers.push(new xi);return this.active[Z]=!0,this.workers.slice()},Di.prototype.release=function(Z){delete this.active[Z],this.numActive()===0&&(this.workers.forEach(function(ot){ot.terminate()}),this.workers=null)},Di.prototype.isPreloaded=function(){return!!this.active[Pi]},Di.prototype.numActive=function(){return Object.keys(this.active).length};var Zi=Math.floor(t.browser.hardwareConcurrency/2);Di.workerCount=Math.max(Math.min(Zi,6),1);var ui;function Pa(){return ui||(ui=new Di),ui}function Wa(){var Z=Pa();Z.acquire(Pi)}function ze(){var Z=ui;Z&&(Z.isPreloaded()&&Z.numActive()===1?(Z.release(Pi),ui=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 Pe(Z,ot){var et={};for(var xt in Z)xt!=="ref"&&(et[xt]=Z[xt]);return t.refProperties.forEach(function(Ut){Ut in ot&&(et[Ut]=ot[Ut])}),et}function Rr(Z){Z=Z.slice();for(var ot=Object.create(null),et=0;et<Z.length;et++)ot[Z[et].id]=Z[et];for(var xt=0;xt<Z.length;xt++)"ref"in Z[xt]&&(Z[xt]=Pe(Z[xt],ot[Z[xt].ref]));return Z}function qr(){var Z={},ot=t.styleSpec.$version;for(var et in t.styleSpec.$root){var xt=t.styleSpec.$root[et];if(xt.required){var Ut=null;et==="version"?Ut=ot:xt.type==="array"?Ut=[]:Ut={},Ut!=null&&(Z[et]=Ut)}}return Z}var $r={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 Br(Z,ot,et){et.push({command:$r.addSource,args:[Z,ot[Z]]})}function Gr(Z,ot,et){ot.push({command:$r.removeSource,args:[Z]}),et[Z]=!0}function dn(Z,ot,et,xt){Gr(Z,et,xt),Br(Z,ot,et)}function an(Z,ot,et){var xt;for(xt in Z[et])if(Z[et].hasOwnProperty(xt)&&xt!=="data"&&!t.deepEqual(Z[et][xt],ot[et][xt]))return!1;for(xt in ot[et])if(ot[et].hasOwnProperty(xt)&&xt!=="data"&&!t.deepEqual(Z[et][xt],ot[et][xt]))return!1;return!0}function Ee(Z,ot,et,xt){Z=Z||{},ot=ot||{};var Ut;for(Ut in Z)Z.hasOwnProperty(Ut)&&(ot.hasOwnProperty(Ut)||Gr(Ut,et,xt));for(Ut in ot)ot.hasOwnProperty(Ut)&&(Z.hasOwnProperty(Ut)?t.deepEqual(Z[Ut],ot[Ut])||(Z[Ut].type==="geojson"&&ot[Ut].type==="geojson"&&an(Z,ot,Ut)?et.push({command:$r.setGeoJSONSourceData,args:[Ut,ot[Ut].data]}):dn(Ut,ot,et,xt)):Br(Ut,ot,et))}function dr(Z,ot,et,xt,Ut,fe){Z=Z||{},ot=ot||{};var ye;for(ye in Z)Z.hasOwnProperty(ye)&&(t.deepEqual(Z[ye],ot[ye])||et.push({command:fe,args:[xt,ye,ot[ye],Ut]}));for(ye in ot)!ot.hasOwnProperty(ye)||Z.hasOwnProperty(ye)||t.deepEqual(Z[ye],ot[ye])||et.push({command:fe,args:[xt,ye,ot[ye],Ut]})}function Vr(Z){return Z.id}function yn(Z,ot){return Z[ot.id]=ot,Z}function Fn(Z,ot,et){Z=Z||[],ot=ot||[];var xt=Z.map(Vr),Ut=ot.map(Vr),fe=Z.reduce(yn,{}),ye=ot.reduce(yn,{}),Yt=xt.slice(),ce=Object.create(null),Se,nr,Ye,tr,lr,hr,Ve;for(Se=0,nr=0;Se<xt.length;Se++)Ye=xt[Se],ye.hasOwnProperty(Ye)?nr++:(et.push({command:$r.removeLayer,args:[Ye]}),Yt.splice(Yt.indexOf(Ye,nr),1));for(Se=0,nr=0;Se<Ut.length;Se++)Ye=Ut[Ut.length-1-Se],Yt[Yt.length-1-Se]!==Ye&&(fe.hasOwnProperty(Ye)?(et.push({command:$r.removeLayer,args:[Ye]}),Yt.splice(Yt.lastIndexOf(Ye,Yt.length-nr),1)):nr++,hr=Yt[Yt.length-Se],et.push({command:$r.addLayer,args:[ye[Ye],hr]}),Yt.splice(Yt.length-Se,0,Ye),ce[Ye]=!0);for(Se=0;Se<Ut.length;Se++)if(Ye=Ut[Se],tr=fe[Ye],lr=ye[Ye],!(ce[Ye]||t.deepEqual(tr,lr))){if(!t.deepEqual(tr.source,lr.source)||!t.deepEqual(tr["source-layer"],lr["source-layer"])||!t.deepEqual(tr.type,lr.type)){et.push({command:$r.removeLayer,args:[Ye]}),hr=Yt[Yt.lastIndexOf(Ye)+1],et.push({command:$r.addLayer,args:[lr,hr]});continue}dr(tr.layout,lr.layout,et,Ye,null,$r.setLayoutProperty),dr(tr.paint,lr.paint,et,Ye,null,$r.setPaintProperty),t.deepEqual(tr.filter,lr.filter)||et.push({command:$r.setFilter,args:[Ye,lr.filter]}),(!t.deepEqual(tr.minzoom,lr.minzoom)||!t.deepEqual(tr.maxzoom,lr.maxzoom))&&et.push({command:$r.setLayerZoomRange,args:[Ye,lr.minzoom,lr.maxzoom]});for(Ve in tr)tr.hasOwnProperty(Ve)&&(Ve==="layout"||Ve==="paint"||Ve==="filter"||Ve==="metadata"||Ve==="minzoom"||Ve==="maxzoom"||(Ve.indexOf("paint.")===0?dr(tr[Ve],lr[Ve],et,Ye,Ve.slice(6),$r.setPaintProperty):t.deepEqual(tr[Ve],lr[Ve])||et.push({command:$r.setLayerProperty,args:[Ye,Ve,lr[Ve]]})));for(Ve in lr)!lr.hasOwnProperty(Ve)||tr.hasOwnProperty(Ve)||Ve==="layout"||Ve==="paint"||Ve==="filter"||Ve==="metadata"||Ve==="minzoom"||Ve==="maxzoom"||(Ve.indexOf("paint.")===0?dr(tr[Ve],lr[Ve],et,Ye,Ve.slice(6),$r.setPaintProperty):t.deepEqual(tr[Ve],lr[Ve])||et.push({command:$r.setLayerProperty,args:[Ye,Ve,lr[Ve]]}))}}function Xn(Z,ot){if(!Z)return[{command:$r.setStyle,args:[ot]}];var et=[];try{if(!t.deepEqual(Z.version,ot.version))return[{command:$r.setStyle,args:[ot]}];t.deepEqual(Z.center,ot.center)||et.push({command:$r.setCenter,args:[ot.center]}),t.deepEqual(Z.zoom,ot.zoom)||et.push({command:$r.setZoom,args:[ot.zoom]}),t.deepEqual(Z.bearing,ot.bearing)||et.push({command:$r.setBearing,args:[ot.bearing]}),t.deepEqual(Z.pitch,ot.pitch)||et.push({command:$r.setPitch,args:[ot.pitch]}),t.deepEqual(Z.sprite,ot.sprite)||et.push({command:$r.setSprite,args:[ot.sprite]}),t.deepEqual(Z.glyphs,ot.glyphs)||et.push({command:$r.setGlyphs,args:[ot.glyphs]}),t.deepEqual(Z.transition,ot.transition)||et.push({command:$r.setTransition,args:[ot.transition]}),t.deepEqual(Z.light,ot.light)||et.push({command:$r.setLight,args:[ot.light]});var xt={},Ut=[];Ee(Z.sources,ot.sources,Ut,xt);var fe=[];Z.layers&&Z.layers.forEach(function(ye){xt[ye.source]?et.push({command:$r.removeLayer,args:[ye.id]}):fe.push(ye)}),et=et.concat(Ut),Fn(fe,ot.layers,et)}catch(ye){console.warn("Unable to compute style diff:",ye),et=[{command:$r.setStyle,args:[ot]}]}return et}var Pn=function(Z,ot){this.reset(Z,ot)};Pn.prototype.reset=function(Z,ot){this.points=Z||[],this._distances=[0];for(var et=1;et<this.points.length;et++)this._distances[et]=this._distances[et-1]+this.points[et].dist(this.points[et-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(ot||0,this.length*.5),this.paddedLength=this.length-this.padding*2},Pn.prototype.lerp=function(Z){if(this.points.length===1)return this.points[0];Z=t.clamp(Z,0,1);for(var ot=1,et=this._distances[ot],xt=Z*this.paddedLength+this.padding;et<xt&&ot<this._distances.length;)et=this._distances[++ot];var Ut=ot-1,fe=this._distances[Ut],ye=et-fe,Yt=ye>0?(xt-fe)/ye:0;return this.points[Ut].mult(1-Yt).add(this.points[ot].mult(Yt))};var En=function(Z,ot,et){var xt=this.boxCells=[],Ut=this.circleCells=[];this.xCellCount=Math.ceil(Z/et),this.yCellCount=Math.ceil(ot/et);for(var fe=0;fe<this.xCellCount*this.yCellCount;fe++)xt.push([]),Ut.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=Z,this.height=ot,this.xScale=this.xCellCount/Z,this.yScale=this.yCellCount/ot,this.boxUid=0,this.circleUid=0};En.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},En.prototype.insert=function(Z,ot,et,xt,Ut){this._forEachCell(ot,et,xt,Ut,this._insertBoxCell,this.boxUid++),this.boxKeys.push(Z),this.bboxes.push(ot),this.bboxes.push(et),this.bboxes.push(xt),this.bboxes.push(Ut)},En.prototype.insertCircle=function(Z,ot,et,xt){this._forEachCell(ot-xt,et-xt,ot+xt,et+xt,this._insertCircleCell,this.circleUid++),this.circleKeys.push(Z),this.circles.push(ot),this.circles.push(et),this.circles.push(xt)},En.prototype._insertBoxCell=function(Z,ot,et,xt,Ut,fe){this.boxCells[Ut].push(fe)},En.prototype._insertCircleCell=function(Z,ot,et,xt,Ut,fe){this.circleCells[Ut].push(fe)},En.prototype._query=function(Z,ot,et,xt,Ut,fe){if(et<0||Z>this.width||xt<0||ot>this.height)return Ut?!1:[];var ye=[];if(Z<=0&&ot<=0&&this.width<=et&&this.height<=xt){if(Ut)return!0;for(var Yt=0;Yt<this.boxKeys.length;Yt++)ye.push({key:this.boxKeys[Yt],x1:this.bboxes[Yt*4],y1:this.bboxes[Yt*4+1],x2:this.bboxes[Yt*4+2],y2:this.bboxes[Yt*4+3]});for(var ce=0;ce<this.circleKeys.length;ce++){var Se=this.circles[ce*3],nr=this.circles[ce*3+1],Ye=this.circles[ce*3+2];ye.push({key:this.circleKeys[ce],x1:Se-Ye,y1:nr-Ye,x2:Se+Ye,y2:nr+Ye})}return fe?ye.filter(fe):ye}else{var tr={hitTest:Ut,seenUids:{box:{},circle:{}}};return this._forEachCell(Z,ot,et,xt,this._queryCell,ye,tr,fe),Ut?ye.length>0:ye}},En.prototype._queryCircle=function(Z,ot,et,xt,Ut){var fe=Z-et,ye=Z+et,Yt=ot-et,ce=ot+et;if(ye<0||fe>this.width||ce<0||Yt>this.height)return xt?!1:[];var Se=[],nr={hitTest:xt,circle:{x:Z,y:ot,radius:et},seenUids:{box:{},circle:{}}};return this._forEachCell(fe,Yt,ye,ce,this._queryCellCircle,Se,nr,Ut),xt?Se.length>0:Se},En.prototype.query=function(Z,ot,et,xt,Ut){return this._query(Z,ot,et,xt,!1,Ut)},En.prototype.hitTest=function(Z,ot,et,xt,Ut){return this._query(Z,ot,et,xt,!0,Ut)},En.prototype.hitTestCircle=function(Z,ot,et,xt){return this._queryCircle(Z,ot,et,!0,xt)},En.prototype._queryCell=function(Z,ot,et,xt,Ut,fe,ye,Yt){var ce=ye.seenUids,Se=this.boxCells[Ut];if(Se!==null)for(var nr=this.bboxes,Ye=0,tr=Se;Ye<tr.length;Ye+=1){var lr=tr[Ye];if(!ce.box[lr]){ce.box[lr]=!0;var hr=lr*4;if(Z<=nr[hr+2]&&ot<=nr[hr+3]&&et>=nr[hr+0]&&xt>=nr[hr+1]&&(!Yt||Yt(this.boxKeys[lr]))){if(ye.hitTest)return fe.push(!0),!0;fe.push({key:this.boxKeys[lr],x1:nr[hr],y1:nr[hr+1],x2:nr[hr+2],y2:nr[hr+3]})}}}var Ve=this.circleCells[Ut];if(Ve!==null)for(var Xe=this.circles,$e=0,Cr=Ve;$e<Cr.length;$e+=1){var on=Cr[$e];if(!ce.circle[on]){ce.circle[on]=!0;var fn=on*3;if(this._circleAndRectCollide(Xe[fn],Xe[fn+1],Xe[fn+2],Z,ot,et,xt)&&(!Yt||Yt(this.circleKeys[on]))){if(ye.hitTest)return fe.push(!0),!0;var fi=Xe[fn],si=Xe[fn+1],Gn=Xe[fn+2];fe.push({key:this.circleKeys[on],x1:fi-Gn,y1:si-Gn,x2:fi+Gn,y2:si+Gn})}}}},En.prototype._queryCellCircle=function(Z,ot,et,xt,Ut,fe,ye,Yt){var ce=ye.circle,Se=ye.seenUids,nr=this.boxCells[Ut];if(nr!==null)for(var Ye=this.bboxes,tr=0,lr=nr;tr<lr.length;tr+=1){var hr=lr[tr];if(!Se.box[hr]){Se.box[hr]=!0;var Ve=hr*4;if(this._circleAndRectCollide(ce.x,ce.y,ce.radius,Ye[Ve+0],Ye[Ve+1],Ye[Ve+2],Ye[Ve+3])&&(!Yt||Yt(this.boxKeys[hr])))return fe.push(!0),!0}}var Xe=this.circleCells[Ut];if(Xe!==null)for(var $e=this.circles,Cr=0,on=Xe;Cr<on.length;Cr+=1){var fn=on[Cr];if(!Se.circle[fn]){Se.circle[fn]=!0;var fi=fn*3;if(this._circlesCollide($e[fi],$e[fi+1],$e[fi+2],ce.x,ce.y,ce.radius)&&(!Yt||Yt(this.circleKeys[fn])))return fe.push(!0),!0}}},En.prototype._forEachCell=function(Z,ot,et,xt,Ut,fe,ye,Yt){for(var ce=this._convertToXCellCoord(Z),Se=this._convertToYCellCoord(ot),nr=this._convertToXCellCoord(et),Ye=this._convertToYCellCoord(xt),tr=ce;tr<=nr;tr++)for(var lr=Se;lr<=Ye;lr++){var hr=this.xCellCount*lr+tr;if(Ut.call(this,Z,ot,et,xt,hr,fe,ye,Yt))return}},En.prototype._convertToXCellCoord=function(Z){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(Z*this.xScale)))},En.prototype._convertToYCellCoord=function(Z){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(Z*this.yScale)))},En.prototype._circlesCollide=function(Z,ot,et,xt,Ut,fe){var ye=xt-Z,Yt=Ut-ot,ce=et+fe;return ce*ce>ye*ye+Yt*Yt},En.prototype._circleAndRectCollide=function(Z,ot,et,xt,Ut,fe,ye){var Yt=(fe-xt)/2,ce=Math.abs(Z-(xt+Yt));if(ce>Yt+et)return!1;var Se=(ye-Ut)/2,nr=Math.abs(ot-(Ut+Se));if(nr>Se+et)return!1;if(ce<=Yt||nr<=Se)return!0;var Ye=ce-Yt,tr=nr-Se;return Ye*Ye+tr*tr<=et*et};function Zn(Z,ot,et,xt,Ut){var fe=t.create();return ot?(t.scale(fe,fe,[1/Ut,1/Ut,1]),et||t.rotateZ(fe,fe,xt.angle)):t.multiply(fe,xt.labelPlaneMatrix,Z),fe}function Ca(Z,ot,et,xt,Ut){if(ot){var fe=t.clone(Z);return t.scale(fe,fe,[Ut,Ut,1]),et||t.rotateZ(fe,fe,-xt.angle),fe}else return xt.glCoordMatrix}function Ri(Z,ot){var et=[Z.x,Z.y,0,1];Gs(et,et,ot);var xt=et[3];return{point:new t.Point(et[0]/xt,et[1]/xt),signedDistanceFromCamera:xt}}function Ja(Z,ot){return .5+.5*(Z/ot)}function Xa(Z,ot){var et=Z[0]/Z[3],xt=Z[1]/Z[3],Ut=et>=-ot[0]&&et<=ot[0]&&xt>=-ot[1]&&xt<=ot[1];return Ut}function Io(Z,ot,et,xt,Ut,fe,ye,Yt){var ce=xt?Z.textSizeData:Z.iconSizeData,Se=t.evaluateSizeForZoom(ce,et.transform.zoom),nr=[256/et.width*2+1,256/et.height*2+1],Ye=xt?Z.text.dynamicLayoutVertexArray:Z.icon.dynamicLayoutVertexArray;Ye.clear();for(var tr=Z.lineVertexArray,lr=xt?Z.text.placedSymbolArray:Z.icon.placedSymbolArray,hr=et.transform.width/et.transform.height,Ve=!1,Xe=0;Xe<lr.length;Xe++){var $e=lr.get(Xe);if($e.hidden||$e.writingMode===t.WritingMode.vertical&&!Ve){Ho($e.numGlyphs,Ye);continue}Ve=!1;var Cr=[$e.anchorX,$e.anchorY,0,1];if(t.transformMat4(Cr,Cr,ot),!Xa(Cr,nr)){Ho($e.numGlyphs,Ye);continue}var on=Cr[3],fn=Ja(et.transform.cameraToCenterDistance,on),fi=t.evaluateSizeForFeature(ce,Se,$e),si=ye?fi/fn:fi*fn,Gn=new t.Point($e.anchorX,$e.anchorY),Mi=Ri(Gn,Ut).point,di={},Ki=Ia($e,si,!1,Yt,ot,Ut,fe,Z.glyphOffsetArray,tr,Ye,Mi,Gn,di,hr);Ve=Ki.useVertical,(Ki.notEnoughRoom||Ve||Ki.needsFlipping&&Ia($e,si,!0,Yt,ot,Ut,fe,Z.glyphOffsetArray,tr,Ye,Mi,Gn,di,hr).notEnoughRoom)&&Ho($e.numGlyphs,Ye)}xt?Z.text.dynamicLayoutVertexBuffer.updateData(Ye):Z.icon.dynamicLayoutVertexBuffer.updateData(Ye)}function po(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se,nr){var Ye=Yt.glyphStartIndex+Yt.numGlyphs,tr=Yt.lineStartIndex,lr=Yt.lineStartIndex+Yt.lineLength,hr=ot.getoffsetX(Yt.glyphStartIndex),Ve=ot.getoffsetX(Ye-1),Xe=is(Z*hr,et,xt,Ut,fe,ye,Yt.segment,tr,lr,ce,Se,nr);if(!Xe)return null;var $e=is(Z*Ve,et,xt,Ut,fe,ye,Yt.segment,tr,lr,ce,Se,nr);return $e?{first:Xe,last:$e}:null}function Do(Z,ot,et,xt){if(Z===t.WritingMode.horizontal){var Ut=Math.abs(et.y-ot.y),fe=Math.abs(et.x-ot.x)*xt;if(Ut>fe)return{useVertical:!0}}return(Z===t.WritingMode.vertical?ot.y<et.y:ot.x>et.x)?{needsFlipping:!0}:null}function Ia(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se,nr,Ye,tr,lr){var hr=ot/24,Ve=Z.lineOffsetX*hr,Xe=Z.lineOffsetY*hr,$e;if(Z.numGlyphs>1){var Cr=Z.glyphStartIndex+Z.numGlyphs,on=Z.lineStartIndex,fn=Z.lineStartIndex+Z.lineLength,fi=po(hr,Yt,Ve,Xe,et,nr,Ye,Z,ce,fe,tr);if(!fi)return{notEnoughRoom:!0};var si=Ri(fi.first.point,ye).point,Gn=Ri(fi.last.point,ye).point;if(xt&&!et){var Mi=Do(Z.writingMode,si,Gn,lr);if(Mi)return Mi}$e=[fi.first];for(var di=Z.glyphStartIndex+1;di<Cr-1;di++)$e.push(is(hr*Yt.getoffsetX(di),Ve,Xe,et,nr,Ye,Z.segment,on,fn,ce,fe,tr));$e.push(fi.last)}else{if(xt&&!et){var Ki=Ri(Ye,Ut).point,Ai=Z.lineStartIndex+Z.segment+1,Si=new t.Point(ce.getx(Ai),ce.gety(Ai)),sa=Ri(Si,Ut),Qa=sa.signedDistanceFromCamera>0?sa.point:gs(Ye,Si,Ki,1,Ut),so=Do(Z.writingMode,Ki,Qa,lr);if(so)return so}var Vo=is(hr*Yt.getoffsetX(Z.glyphStartIndex),Ve,Xe,et,nr,Ye,Z.segment,Z.lineStartIndex,Z.lineStartIndex+Z.lineLength,ce,fe,tr);if(!Vo)return{notEnoughRoom:!0};$e=[Vo]}for(var vs=0,zl=$e;vs<zl.length;vs+=1){var jl=zl[vs];t.addDynamicAttributes(Se,jl.point,jl.angle)}return{}}function gs(Z,ot,et,xt,Ut){var fe=Ri(Z.add(Z.sub(ot)._unit()),Ut).point,ye=et.sub(fe);return et.add(ye._mult(xt/ye.mag()))}function is(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se,nr,Ye){var tr=xt?Z-ot:Z+ot,lr=tr>0?1:-1,hr=0;xt&&(lr*=-1,hr=Math.PI),lr<0&&(hr+=Math.PI);for(var Ve=lr>0?Yt+ye:Yt+ye+1,Xe=Ut,$e=Ut,Cr=0,on=0,fn=Math.abs(tr),fi=[];Cr+on<=fn;){if(Ve+=lr,Ve<Yt||Ve>=ce)return null;if($e=Xe,fi.push(Xe),Xe=Ye[Ve],Xe===void 0){var si=new t.Point(Se.getx(Ve),Se.gety(Ve)),Gn=Ri(si,nr);if(Gn.signedDistanceFromCamera>0)Xe=Ye[Ve]=Gn.point;else{var Mi=Ve-lr,di=Cr===0?fe:new t.Point(Se.getx(Mi),Se.gety(Mi));Xe=gs(di,si,$e,fn-Cr+1,nr)}}Cr+=on,on=$e.dist(Xe)}var Ki=(fn-Cr)/on,Ai=Xe.sub($e),Si=Ai.mult(Ki)._add($e);Si._add(Ai._unit()._perp()._mult(et*lr));var sa=hr+Math.atan2(Xe.y-$e.y,Xe.x-$e.x);return fi.push(Si),{point:Si,angle:sa,path:fi}}var ll=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ho(Z,ot){for(var et=0;et<Z;et++){var xt=ot.length;ot.resize(xt+4),ot.float32.set(ll,xt*3)}}function Gs(Z,ot,et){var xt=ot[0],Ut=ot[1];return Z[0]=et[0]*xt+et[4]*Ut+et[12],Z[1]=et[1]*xt+et[5]*Ut+et[13],Z[3]=et[3]*xt+et[7]*Ut+et[15],Z}var as=100,ul=function(Z,ot,et){ot===void 0&&(ot=new En(Z.width+2*as,Z.height+2*as,25)),et===void 0&&(et=new En(Z.width+2*as,Z.height+2*as,25)),this.transform=Z,this.grid=ot,this.ignoredGrid=et,this.pitchfactor=Math.cos(Z._pitch)*Z.cameraToCenterDistance,this.screenRightBoundary=Z.width+as,this.screenBottomBoundary=Z.height+as,this.gridRightBoundary=Z.width+2*as,this.gridBottomBoundary=Z.height+2*as};ul.prototype.placeCollisionBox=function(Z,ot,et,xt,Ut){var fe=this.projectAndGetPerspectiveRatio(xt,Z.anchorPointX,Z.anchorPointY),ye=et*fe.perspectiveRatio,Yt=Z.x1*ye+fe.point.x,ce=Z.y1*ye+fe.point.y,Se=Z.x2*ye+fe.point.x,nr=Z.y2*ye+fe.point.y;return!this.isInsideGrid(Yt,ce,Se,nr)||!ot&&this.grid.hitTest(Yt,ce,Se,nr,Ut)?{box:[],offscreen:!1}:{box:[Yt,ce,Se,nr],offscreen:this.isOffscreen(Yt,ce,Se,nr)}},ul.prototype.placeCollisionCircles=function(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se,nr,Ye,tr){var lr=[],hr=new t.Point(ot.anchorX,ot.anchorY),Ve=Ri(hr,fe),Xe=Ja(this.transform.cameraToCenterDistance,Ve.signedDistanceFromCamera),$e=Se?Ut/Xe:Ut*Xe,Cr=$e/t.ONE_EM,on=Ri(hr,ye).point,fn={},fi=ot.lineOffsetX*Cr,si=ot.lineOffsetY*Cr,Gn=po(Cr,xt,fi,si,!1,on,hr,ot,et,ye,fn),Mi=!1,di=!1,Ki=!0;if(Gn){for(var Ai=Ye*.5*Xe+tr,Si=new t.Point(-as,-as),sa=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),Qa=new Pn,so=Gn.first,Vo=Gn.last,vs=[],zl=so.path.length-1;zl>=1;zl--)vs.push(so.path[zl]);for(var jl=1;jl<Vo.path.length;jl++)vs.push(Vo.path[jl]);var dl=Ai*2.5;if(Yt){var Ul=vs.map(function(ep){return Ri(ep,Yt)});Ul.some(function(ep){return ep.signedDistanceFromCamera<=0})?vs=[]:vs=Ul.map(function(ep){return ep.point})}var _c=[];if(vs.length>0){for(var Ds=vs[0].clone(),Au=vs[0].clone(),nf=1;nf<vs.length;nf++)Ds.x=Math.min(Ds.x,vs[nf].x),Ds.y=Math.min(Ds.y,vs[nf].y),Au.x=Math.max(Au.x,vs[nf].x),Au.y=Math.max(Au.y,vs[nf].y);Ds.x>=Si.x&&Au.x<=sa.x&&Ds.y>=Si.y&&Au.y<=sa.y?_c=[vs]:Au.x<Si.x||Ds.x>sa.x||Au.y<Si.y||Ds.y>sa.y?_c=[]:_c=t.clipLine([vs],Si.x,Si.y,sa.x,sa.y)}for(var zf=0,Np=_c;zf<Np.length;zf+=1){var b0=Np[zf];Qa.reset(b0,Ai*.25);var kp=0;Qa.length<=.5*Ai?kp=1:kp=Math.ceil(Qa.paddedLength/dl)+1;for(var Tp=0;Tp<kp;Tp++){var R0=Tp/Math.max(kp-1,1),tp=Qa.lerp(R0),Ap=tp.x+as,qd=tp.y+as;lr.push(Ap,qd,Ai,0);var Q0=Ap-Ai,Hm=qd-Ai,Mp=Ap+Ai,Sp=qd+Ai;if(Ki=Ki&&this.isOffscreen(Q0,Hm,Mp,Sp),di=di||this.isInsideGrid(Q0,Hm,Mp,Sp),!Z&&this.grid.hitTestCircle(Ap,qd,Ai,nr)&&(Mi=!0,!ce))return{circles:[],offscreen:!1,collisionDetected:Mi}}}}return{circles:!ce&&Mi||!di?[]:lr,offscreen:Ki,collisionDetected:Mi}},ul.prototype.queryRenderedSymbols=function(Z){if(Z.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var ot=[],et=1/0,xt=1/0,Ut=-1/0,fe=-1/0,ye=0,Yt=Z;ye<Yt.length;ye+=1){var ce=Yt[ye],Se=new t.Point(ce.x+as,ce.y+as);et=Math.min(et,Se.x),xt=Math.min(xt,Se.y),Ut=Math.max(Ut,Se.x),fe=Math.max(fe,Se.y),ot.push(Se)}for(var nr=this.grid.query(et,xt,Ut,fe).concat(this.ignoredGrid.query(et,xt,Ut,fe)),Ye={},tr={},lr=0,hr=nr;lr<hr.length;lr+=1){var Ve=hr[lr],Xe=Ve.key;if(Ye[Xe.bucketInstanceId]===void 0&&(Ye[Xe.bucketInstanceId]={}),!Ye[Xe.bucketInstanceId][Xe.featureIndex]){var $e=[new t.Point(Ve.x1,Ve.y1),new t.Point(Ve.x2,Ve.y1),new t.Point(Ve.x2,Ve.y2),new t.Point(Ve.x1,Ve.y2)];t.polygonIntersectsPolygon(ot,$e)&&(Ye[Xe.bucketInstanceId][Xe.featureIndex]=!0,tr[Xe.bucketInstanceId]===void 0&&(tr[Xe.bucketInstanceId]=[]),tr[Xe.bucketInstanceId].push(Xe.featureIndex))}}return tr},ul.prototype.insertCollisionBox=function(Z,ot,et,xt,Ut){var fe=ot?this.ignoredGrid:this.grid,ye={bucketInstanceId:et,featureIndex:xt,collisionGroupID:Ut};fe.insert(ye,Z[0],Z[1],Z[2],Z[3])},ul.prototype.insertCollisionCircles=function(Z,ot,et,xt,Ut){for(var fe=ot?this.ignoredGrid:this.grid,ye={bucketInstanceId:et,featureIndex:xt,collisionGroupID:Ut},Yt=0;Yt<Z.length;Yt+=4)fe.insertCircle(ye,Z[Yt],Z[Yt+1],Z[Yt+2])},ul.prototype.projectAndGetPerspectiveRatio=function(Z,ot,et){var xt=[ot,et,0,1];Gs(xt,xt,Z);var Ut=new t.Point((xt[0]/xt[3]+1)/2*this.transform.width+as,(-xt[1]/xt[3]+1)/2*this.transform.height+as);return{point:Ut,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/xt[3])}},ul.prototype.isOffscreen=function(Z,ot,et,xt){return et<as||Z>=this.screenRightBoundary||xt<as||ot>this.screenBottomBoundary},ul.prototype.isInsideGrid=function(Z,ot,et,xt){return et>=0&&Z<this.gridRightBoundary&&xt>=0&&ot<this.gridBottomBoundary},ul.prototype.getViewportMatrix=function(){var Z=t.identity([]);return t.translate(Z,Z,[-as,-as,0]),Z};function Js(Z,ot,et){return ot*(t.EXTENT/(Z.tileSize*Math.pow(2,et-Z.tileID.overscaledZ)))}var Rl=function(Z,ot,et,xt){Z?this.opacity=Math.max(0,Math.min(1,Z.opacity+(Z.placed?ot:-ot))):this.opacity=xt&&et?1:0,this.placed=et};Rl.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var ls=function(Z,ot,et,xt,Ut){this.text=new Rl(Z?Z.text:null,ot,et,Ut),this.icon=new Rl(Z?Z.icon:null,ot,xt,Ut)};ls.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Cs=function(Z,ot,et){this.text=Z,this.icon=ot,this.skipFade=et},Co=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},ks=function(Z,ot,et,xt,Ut){this.bucketInstanceId=Z,this.featureIndex=ot,this.sourceLayerIndex=et,this.bucketIndex=xt,this.tileID=Ut},kl=function(Z){this.crossSourceCollisions=Z,this.maxGroupID=0,this.collisionGroups={}};kl.prototype.get=function(Z){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[Z]){var ot=++this.maxGroupID;this.collisionGroups[Z]={ID:ot,predicate:function(et){return et.collisionGroupID===ot}}}return this.collisionGroups[Z]};function Vl(Z,ot,et,xt,Ut){var fe=t.getAnchorAlignment(Z),ye=fe.horizontalAlign,Yt=fe.verticalAlign,ce=-(ye-.5)*ot,Se=-(Yt-.5)*et,nr=t.evaluateVariableOffset(Z,xt);return new t.Point(ce+nr[0]*Ut,Se+nr[1]*Ut)}function Yl(Z,ot,et,xt,Ut,fe){var ye=Z.x1,Yt=Z.x2,ce=Z.y1,Se=Z.y2,nr=Z.anchorPointX,Ye=Z.anchorPointY,tr=new t.Point(ot,et);return xt&&tr._rotate(Ut?fe:-fe),{x1:ye+tr.x,y1:ce+tr.y,x2:Yt+tr.x,y2:Se+tr.y,anchorPointX:nr,anchorPointY:Ye}}var Ns=function(Z,ot,et,xt){this.transform=Z.clone(),this.collisionIndex=new ul(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=ot,this.retainedQueryData={},this.collisionGroups=new kl(et),this.collisionCircleArrays={},this.prevPlacement=xt,xt&&(xt.prevPlacement=void 0),this.placedOrientations={}};Ns.prototype.getBucketParts=function(Z,ot,et,xt){var Ut=et.getBucket(ot),fe=et.latestFeatureIndex;if(!(!Ut||!fe||ot.id!==Ut.layerIds[0])){var ye=et.collisionBoxArray,Yt=Ut.layers[0].layout,ce=Math.pow(2,this.transform.zoom-et.tileID.overscaledZ),Se=et.tileSize/t.EXTENT,nr=this.transform.calculatePosMatrix(et.tileID.toUnwrapped()),Ye=Yt.get("text-pitch-alignment")==="map",tr=Yt.get("text-rotation-alignment")==="map",lr=Js(et,1,this.transform.zoom),hr=Zn(nr,Ye,tr,this.transform,lr),Ve=null;if(Ye){var Xe=Ca(nr,Ye,tr,this.transform,lr);Ve=t.multiply([],this.transform.labelPlaneMatrix,Xe)}this.retainedQueryData[Ut.bucketInstanceId]=new ks(Ut.bucketInstanceId,fe,Ut.sourceLayerIndex,Ut.index,et.tileID);var $e={bucket:Ut,layout:Yt,posMatrix:nr,textLabelPlaneMatrix:hr,labelToScreenMatrix:Ve,scale:ce,textPixelRatio:Se,holdingForFade:et.holdingForFade(),collisionBoxArray:ye,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(Ut.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Ut.sourceID)};if(xt)for(var Cr=0,on=Ut.sortKeyRanges;Cr<on.length;Cr+=1){var fn=on[Cr],fi=fn.sortKey,si=fn.symbolInstanceStart,Gn=fn.symbolInstanceEnd;Z.push({sortKey:fi,symbolInstanceStart:si,symbolInstanceEnd:Gn,parameters:$e})}else Z.push({symbolInstanceStart:0,symbolInstanceEnd:Ut.symbolInstances.length,parameters:$e})}},Ns.prototype.attemptAnchorPlacement=function(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se,nr,Ye,tr,lr,hr){var Ve=[Ye.textOffset0,Ye.textOffset1],Xe=Vl(Z,et,xt,Ve,Ut),$e=this.collisionIndex.placeCollisionBox(Yl(ot,Xe.x,Xe.y,fe,ye,this.transform.angle),nr,Yt,ce,Se.predicate);if(hr){var Cr=this.collisionIndex.placeCollisionBox(Yl(hr,Xe.x,Xe.y,fe,ye,this.transform.angle),nr,Yt,ce,Se.predicate);if(Cr.box.length===0)return}if($e.box.length>0){var on;return this.prevPlacement&&this.prevPlacement.variableOffsets[Ye.crossTileID]&&this.prevPlacement.placements[Ye.crossTileID]&&this.prevPlacement.placements[Ye.crossTileID].text&&(on=this.prevPlacement.variableOffsets[Ye.crossTileID].anchor),this.variableOffsets[Ye.crossTileID]={textOffset:Ve,width:et,height:xt,anchor:Z,textBoxScale:Ut,prevAnchor:on},this.markUsedJustification(tr,Z,Ye,lr),tr.allowVerticalPlacement&&(this.markUsedOrientation(tr,lr,Ye),this.placedOrientations[Ye.crossTileID]=lr),{shift:Xe,placedGlyphBoxes:$e}}},Ns.prototype.placeLayerBucketPart=function(Z,ot,et){var xt=this,Ut=Z.parameters,fe=Ut.bucket,ye=Ut.layout,Yt=Ut.posMatrix,ce=Ut.textLabelPlaneMatrix,Se=Ut.labelToScreenMatrix,nr=Ut.textPixelRatio,Ye=Ut.holdingForFade,tr=Ut.collisionBoxArray,lr=Ut.partiallyEvaluatedTextSize,hr=Ut.collisionGroup,Ve=ye.get("text-optional"),Xe=ye.get("icon-optional"),$e=ye.get("text-allow-overlap"),Cr=ye.get("icon-allow-overlap"),on=ye.get("text-rotation-alignment")==="map",fn=ye.get("text-pitch-alignment")==="map",fi=ye.get("icon-text-fit")!=="none",si=ye.get("symbol-z-order")==="viewport-y",Gn=$e&&(Cr||!fe.hasIconData()||Xe),Mi=Cr&&($e||!fe.hasTextData()||Ve);!fe.collisionArrays&&tr&&fe.deserializeCollisionBoxes(tr);var di=function(so,Vo){if(!ot[so.crossTileID]){if(Ye){xt.placements[so.crossTileID]=new Cs(!1,!1,!1);return}var vs=!1,zl=!1,jl=!0,dl=null,Ul={box:null,offscreen:null},_c={box:null,offscreen:null},Ds=null,Au=null,nf=null,zf=0,Np=0,b0=0;Vo.textFeatureIndex?zf=Vo.textFeatureIndex:so.useRuntimeCollisionCircles&&(zf=so.featureIndex),Vo.verticalTextFeatureIndex&&(Np=Vo.verticalTextFeatureIndex);var kp=Vo.textBox;if(kp){var Tp=function(af){var md=t.WritingMode.horizontal;if(fe.allowVerticalPlacement&&!af&&xt.prevPlacement){var bc=xt.prevPlacement.placedOrientations[so.crossTileID];bc&&(xt.placedOrientations[so.crossTileID]=bc,md=bc,xt.markUsedOrientation(fe,md,so))}return md},R0=function(af,md){if(fe.allowVerticalPlacement&&so.numVerticalGlyphVertices>0&&Vo.verticalTextBox)for(var bc=0,Og=fe.writingModes;bc<Og.length;bc+=1){var Pv=Og[bc];if(Pv===t.WritingMode.vertical?(Ul=md(),_c=Ul):Ul=af(),Ul&&Ul.box&&Ul.box.length)break}else Ul=af()};if(ye.get("text-variable-anchor")){var tp=ye.get("text-variable-anchor");if(xt.prevPlacement&&xt.prevPlacement.variableOffsets[so.crossTileID]){var Ap=xt.prevPlacement.variableOffsets[so.crossTileID];tp.indexOf(Ap.anchor)>0&&(tp=tp.filter(function(af){return af!==Ap.anchor}),tp.unshift(Ap.anchor))}var qd=function(af,md,bc){for(var Og=af.x2-af.x1,Pv=af.y2-af.y1,yx=so.textBoxScale,zc=fi&&!Cr?md:null,km={box:[],offscreen:!1},xx=$e?tp.length*2:tp.length,Dg=0;Dg<xx;++Dg){var N0=tp[Dg%tp.length],mb=Dg>=tp.length,zv=xt.attemptAnchorPlacement(N0,af,Og,Pv,yx,on,fn,nr,Yt,hr,mb,so,fe,bc,zc);if(zv&&(km=zv.placedGlyphBoxes,km&&km.box&&km.box.length)){vs=!0,dl=zv.shift;break}}return km},Q0=function(){return qd(kp,Vo.iconBox,t.WritingMode.horizontal)},Hm=function(){var af=Vo.verticalTextBox,md=Ul&&Ul.box&&Ul.box.length;return fe.allowVerticalPlacement&&!md&&so.numVerticalGlyphVertices>0&&af?qd(af,Vo.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}};R0(Q0,Hm),Ul&&(vs=Ul.box,jl=Ul.offscreen);var Mp=Tp(Ul&&Ul.box);if(!vs&&xt.prevPlacement){var Sp=xt.prevPlacement.variableOffsets[so.crossTileID];Sp&&(xt.variableOffsets[so.crossTileID]=Sp,xt.markUsedJustification(fe,Sp.anchor,so,Mp))}}else{var ep=function(af,md){var bc=xt.collisionIndex.placeCollisionBox(af,$e,nr,Yt,hr.predicate);return bc&&bc.box&&bc.box.length&&(xt.markUsedOrientation(fe,md,so),xt.placedOrientations[so.crossTileID]=md),bc},Wm=function(){return ep(kp,t.WritingMode.horizontal)},Pg=function(){var af=Vo.verticalTextBox;return fe.allowVerticalPlacement&&so.numVerticalGlyphVertices>0&&af?ep(af,t.WritingMode.vertical):{box:null,offscreen:null}};R0(Wm,Pg),Tp(Ul&&Ul.box&&Ul.box.length)}}if(Ds=Ul,vs=Ds&&Ds.box&&Ds.box.length>0,jl=Ds&&Ds.offscreen,so.useRuntimeCollisionCircles){var qm=fe.text.placedSymbolArray.get(so.centerJustifiedTextSymbolIndex),dd=t.evaluateSizeForFeature(fe.textSizeData,lr,qm),wm=ye.get("text-padding"),zg=so.collisionCircleDiameter;Au=xt.collisionIndex.placeCollisionCircles($e,qm,fe.lineVertexArray,fe.glyphOffsetArray,dd,Yt,ce,Se,et,fn,hr.predicate,zg,wm),vs=$e||Au.circles.length>0&&!Au.collisionDetected,jl=jl&&Au.offscreen}if(Vo.iconFeatureIndex&&(b0=Vo.iconFeatureIndex),Vo.iconBox){var pd=function(af){var md=fi&&dl?Yl(af,dl.x,dl.y,on,fn,xt.transform.angle):af;return xt.collisionIndex.placeCollisionBox(md,Cr,nr,Yt,hr.predicate)};_c&&_c.box&&_c.box.length&&Vo.verticalIconBox?(nf=pd(Vo.verticalIconBox),zl=nf.box.length>0):(nf=pd(Vo.iconBox),zl=nf.box.length>0),jl=jl&&nf.offscreen}var Zm=Ve||so.numHorizontalGlyphVertices===0&&so.numVerticalGlyphVertices===0,Cv=Xe||so.numIconVertices===0;if(!Zm&&!Cv?zl=vs=zl&&vs:Cv?Zm||(zl=zl&&vs):vs=zl&&vs,vs&&Ds&&Ds.box&&(_c&&_c.box&&Np?xt.collisionIndex.insertCollisionBox(Ds.box,ye.get("text-ignore-placement"),fe.bucketInstanceId,Np,hr.ID):xt.collisionIndex.insertCollisionBox(Ds.box,ye.get("text-ignore-placement"),fe.bucketInstanceId,zf,hr.ID)),zl&&nf&&xt.collisionIndex.insertCollisionBox(nf.box,ye.get("icon-ignore-placement"),fe.bucketInstanceId,b0,hr.ID),Au&&(vs&&xt.collisionIndex.insertCollisionCircles(Au.circles,ye.get("text-ignore-placement"),fe.bucketInstanceId,zf,hr.ID),et)){var Lv=fe.bucketInstanceId,B0=xt.collisionCircleArrays[Lv];B0===void 0&&(B0=xt.collisionCircleArrays[Lv]=new Co);for(var Ig=0;Ig<Au.circles.length;Ig+=4)B0.circles.push(Au.circles[Ig+0]),B0.circles.push(Au.circles[Ig+1]),B0.circles.push(Au.circles[Ig+2]),B0.circles.push(Au.collisionDetected?1:0)}xt.placements[so.crossTileID]=new Cs(vs||Gn,zl||Mi,jl||fe.justReloaded),ot[so.crossTileID]=!0}};if(si)for(var Ki=fe.getSortedSymbolIndexes(this.transform.angle),Ai=Ki.length-1;Ai>=0;--Ai){var Si=Ki[Ai];di(fe.symbolInstances.get(Si),fe.collisionArrays[Si])}else for(var sa=Z.symbolInstanceStart;sa<Z.symbolInstanceEnd;sa++)di(fe.symbolInstances.get(sa),fe.collisionArrays[sa]);if(et&&fe.bucketInstanceId in this.collisionCircleArrays){var Qa=this.collisionCircleArrays[fe.bucketInstanceId];t.invert(Qa.invProjMatrix,Yt),Qa.viewportMatrix=this.collisionIndex.getViewportMatrix()}fe.justReloaded=!1},Ns.prototype.markUsedJustification=function(Z,ot,et,xt){var Ut={left:et.leftJustifiedTextSymbolIndex,center:et.centerJustifiedTextSymbolIndex,right:et.rightJustifiedTextSymbolIndex},fe;xt===t.WritingMode.vertical?fe=et.verticalPlacedTextSymbolIndex:fe=Ut[t.getAnchorJustification(ot)];for(var ye=[et.leftJustifiedTextSymbolIndex,et.centerJustifiedTextSymbolIndex,et.rightJustifiedTextSymbolIndex,et.verticalPlacedTextSymbolIndex],Yt=0,ce=ye;Yt<ce.length;Yt+=1){var Se=ce[Yt];Se>=0&&(fe>=0&&Se!==fe?Z.text.placedSymbolArray.get(Se).crossTileID=0:Z.text.placedSymbolArray.get(Se).crossTileID=et.crossTileID)}},Ns.prototype.markUsedOrientation=function(Z,ot,et){for(var xt=ot===t.WritingMode.horizontal||ot===t.WritingMode.horizontalOnly?ot:0,Ut=ot===t.WritingMode.vertical?ot:0,fe=[et.leftJustifiedTextSymbolIndex,et.centerJustifiedTextSymbolIndex,et.rightJustifiedTextSymbolIndex],ye=0,Yt=fe;ye<Yt.length;ye+=1){var ce=Yt[ye];Z.text.placedSymbolArray.get(ce).placedOrientation=xt}et.verticalPlacedTextSymbolIndex&&(Z.text.placedSymbolArray.get(et.verticalPlacedTextSymbolIndex).placedOrientation=Ut)},Ns.prototype.commit=function(Z){this.commitTime=Z,this.zoomAtLastRecencyCheck=this.transform.zoom;var ot=this.prevPlacement,et=!1;this.prevZoomAdjustment=ot?ot.zoomAdjustment(this.transform.zoom):0;var xt=ot?ot.symbolFadeChange(Z):1,Ut=ot?ot.opacities:{},fe=ot?ot.variableOffsets:{},ye=ot?ot.placedOrientations:{};for(var Yt in this.placements){var ce=this.placements[Yt],Se=Ut[Yt];Se?(this.opacities[Yt]=new ls(Se,xt,ce.text,ce.icon),et=et||ce.text!==Se.text.placed||ce.icon!==Se.icon.placed):(this.opacities[Yt]=new ls(null,xt,ce.text,ce.icon,ce.skipFade),et=et||ce.text||ce.icon)}for(var nr in Ut){var Ye=Ut[nr];if(!this.opacities[nr]){var tr=new ls(Ye,xt,!1,!1);tr.isHidden()||(this.opacities[nr]=tr,et=et||Ye.text.placed||Ye.icon.placed)}}for(var lr in fe)!this.variableOffsets[lr]&&this.opacities[lr]&&!this.opacities[lr].isHidden()&&(this.variableOffsets[lr]=fe[lr]);for(var hr in ye)!this.placedOrientations[hr]&&this.opacities[hr]&&!this.opacities[hr].isHidden()&&(this.placedOrientations[hr]=ye[hr]);et?this.lastPlacementChangeTime=Z:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ot?ot.lastPlacementChangeTime:Z)},Ns.prototype.updateLayerOpacities=function(Z,ot){for(var et={},xt=0,Ut=ot;xt<Ut.length;xt+=1){var fe=Ut[xt],ye=fe.getBucket(Z);ye&&fe.latestFeatureIndex&&Z.id===ye.layerIds[0]&&this.updateBucketOpacities(ye,et,fe.collisionBoxArray)}},Ns.prototype.updateBucketOpacities=function(Z,ot,et){var xt=this;Z.hasTextData()&&Z.text.opacityVertexArray.clear(),Z.hasIconData()&&Z.icon.opacityVertexArray.clear(),Z.hasIconCollisionBoxData()&&Z.iconCollisionBox.collisionVertexArray.clear(),Z.hasTextCollisionBoxData()&&Z.textCollisionBox.collisionVertexArray.clear();var Ut=Z.layers[0].layout,fe=new ls(null,0,!1,!1,!0),ye=Ut.get("text-allow-overlap"),Yt=Ut.get("icon-allow-overlap"),ce=Ut.get("text-variable-anchor"),Se=Ut.get("text-rotation-alignment")==="map",nr=Ut.get("text-pitch-alignment")==="map",Ye=Ut.get("icon-text-fit")!=="none",tr=new ls(null,0,ye&&(Yt||!Z.hasIconData()||Ut.get("icon-optional")),Yt&&(ye||!Z.hasTextData()||Ut.get("text-optional")),!0);!Z.collisionArrays&&et&&(Z.hasIconCollisionBoxData()||Z.hasTextCollisionBoxData())&&Z.deserializeCollisionBoxes(et);for(var lr=function($e,Cr,on){for(var fn=0;fn<Cr/4;fn++)$e.opacityVertexArray.emplaceBack(on)},hr=function($e){var Cr=Z.symbolInstances.get($e),on=Cr.numHorizontalGlyphVertices,fn=Cr.numVerticalGlyphVertices,fi=Cr.crossTileID,si=ot[fi],Gn=xt.opacities[fi];si?Gn=fe:Gn||(Gn=tr,xt.opacities[fi]=Gn),ot[fi]=!0;var Mi=on>0||fn>0,di=Cr.numIconVertices>0,Ki=xt.placedOrientations[Cr.crossTileID],Ai=Ki===t.WritingMode.vertical,Si=Ki===t.WritingMode.horizontal||Ki===t.WritingMode.horizontalOnly;if(Mi){var sa=Fu(Gn.text),Qa=Ai?ao:sa;lr(Z.text,on,Qa);var so=Si?ao:sa;lr(Z.text,fn,so);var Vo=Gn.text.isHidden();[Cr.rightJustifiedTextSymbolIndex,Cr.centerJustifiedTextSymbolIndex,Cr.leftJustifiedTextSymbolIndex].forEach(function(b0){b0>=0&&(Z.text.placedSymbolArray.get(b0).hidden=Vo||Ai?1:0)}),Cr.verticalPlacedTextSymbolIndex>=0&&(Z.text.placedSymbolArray.get(Cr.verticalPlacedTextSymbolIndex).hidden=Vo||Si?1:0);var vs=xt.variableOffsets[Cr.crossTileID];vs&&xt.markUsedJustification(Z,vs.anchor,Cr,Ki);var zl=xt.placedOrientations[Cr.crossTileID];zl&&(xt.markUsedJustification(Z,"left",Cr,zl),xt.markUsedOrientation(Z,zl,Cr))}if(di){var jl=Fu(Gn.icon),dl=!(Ye&&Cr.verticalPlacedIconSymbolIndex&&Ai);if(Cr.placedIconSymbolIndex>=0){var Ul=dl?jl:ao;lr(Z.icon,Cr.numIconVertices,Ul),Z.icon.placedSymbolArray.get(Cr.placedIconSymbolIndex).hidden=Gn.icon.isHidden()}if(Cr.verticalPlacedIconSymbolIndex>=0){var _c=dl?ao:jl;lr(Z.icon,Cr.numVerticalIconVertices,_c),Z.icon.placedSymbolArray.get(Cr.verticalPlacedIconSymbolIndex).hidden=Gn.icon.isHidden()}}if(Z.hasIconCollisionBoxData()||Z.hasTextCollisionBoxData()){var Ds=Z.collisionArrays[$e];if(Ds){var Au=new t.Point(0,0);if(Ds.textBox||Ds.verticalTextBox){var nf=!0;if(ce){var zf=xt.variableOffsets[fi];zf?(Au=Vl(zf.anchor,zf.width,zf.height,zf.textOffset,zf.textBoxScale),Se&&Au._rotate(nr?xt.transform.angle:-xt.transform.angle)):nf=!1}Ds.textBox&&La(Z.textCollisionBox.collisionVertexArray,Gn.text.placed,!nf||Ai,Au.x,Au.y),Ds.verticalTextBox&&La(Z.textCollisionBox.collisionVertexArray,Gn.text.placed,!nf||Si,Au.x,Au.y)}var Np=!!(!Si&&Ds.verticalIconBox);Ds.iconBox&&La(Z.iconCollisionBox.collisionVertexArray,Gn.icon.placed,Np,Ye?Au.x:0,Ye?Au.y:0),Ds.verticalIconBox&&La(Z.iconCollisionBox.collisionVertexArray,Gn.icon.placed,!Np,Ye?Au.x:0,Ye?Au.y:0)}}},Ve=0;Ve<Z.symbolInstances.length;Ve++)hr(Ve);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.bucketInstanceId in this.collisionCircleArrays){var Xe=this.collisionCircleArrays[Z.bucketInstanceId];Z.placementInvProjMatrix=Xe.invProjMatrix,Z.placementViewportMatrix=Xe.viewportMatrix,Z.collisionCircleArray=Xe.circles,delete this.collisionCircleArrays[Z.bucketInstanceId]}},Ns.prototype.symbolFadeChange=function(Z){return this.fadeDuration===0?1:(Z-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Ns.prototype.zoomAdjustment=function(Z){return Math.max(0,(this.transform.zoom-Z)/1.5)},Ns.prototype.hasTransitions=function(Z){return this.stale||Z-this.lastPlacementChangeTime<this.fadeDuration},Ns.prototype.stillRecent=function(Z,ot){var et=this.zoomAtLastRecencyCheck===ot?1-this.zoomAdjustment(ot):1;return this.zoomAtLastRecencyCheck=ot,this.commitTime+this.fadeDuration*et>Z},Ns.prototype.setStale=function(){this.stale=!0};function La(Z,ot,et,xt,Ut){Z.emplaceBack(ot?1:0,et?1:0,xt||0,Ut||0),Z.emplaceBack(ot?1:0,et?1:0,xt||0,Ut||0),Z.emplaceBack(ot?1:0,et?1:0,xt||0,Ut||0),Z.emplaceBack(ot?1:0,et?1:0,xt||0,Ut||0)}var uo=Math.pow(2,25),Hs=Math.pow(2,24),Kl=Math.pow(2,17),Go=Math.pow(2,16),ql=Math.pow(2,9),il=Math.pow(2,8),Cl=Math.pow(2,1);function Fu(Z){if(Z.opacity===0&&!Z.placed)return 0;if(Z.opacity===1&&Z.placed)return 4294967295;var ot=Z.placed?1:0,et=Math.floor(Z.opacity*127);return et*uo+ot*Hs+et*Kl+ot*Go+et*ql+ot*il+et*Cl+ot}var ao=0,Ts=function(Z){this._sortAcrossTiles=Z.layout.get("symbol-z-order")!=="viewport-y"&&Z.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Ts.prototype.continuePlacement=function(Z,ot,et,xt,Ut){for(var fe=this._bucketParts;this._currentTileIndex<Z.length;){var ye=Z[this._currentTileIndex];if(ot.getBucketParts(fe,xt,ye,this._sortAcrossTiles),this._currentTileIndex++,Ut())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,fe.sort(function(ce,Se){return ce.sortKey-Se.sortKey}));this._currentPartIndex<fe.length;){var Yt=fe[this._currentPartIndex];if(ot.placeLayerBucketPart(Yt,this._seenCrossTileIDs,et),this._currentPartIndex++,Ut())return!0}return!1};var Ls=function(Z,ot,et,xt,Ut,fe,ye){this.placement=new Ns(Z,Ut,fe,ye),this._currentPlacementIndex=ot.length-1,this._forceFullPlacement=et,this._showCollisionBoxes=xt,this._done=!1};Ls.prototype.isDone=function(){return this._done},Ls.prototype.continuePlacement=function(Z,ot,et){for(var xt=this,Ut=t.browser.now(),fe=function(){var nr=t.browser.now()-Ut;return xt._forceFullPlacement?!1:nr>2};this._currentPlacementIndex>=0;){var ye=Z[this._currentPlacementIndex],Yt=ot[ye],ce=this.placement.collisionIndex.transform.zoom;if(Yt.type==="symbol"&&(!Yt.minzoom||Yt.minzoom<=ce)&&(!Yt.maxzoom||Yt.maxzoom>ce)){this._inProgressLayer||(this._inProgressLayer=new Ts(Yt));var Se=this._inProgressLayer.continuePlacement(et[Yt.source],this.placement,this._showCollisionBoxes,Yt,fe);if(Se)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Ls.prototype.commit=function(Z){return this.placement.commit(Z),this.placement};var nu=512/t.EXTENT/2,cl=function(Z,ot,et){this.tileID=Z,this.indexedSymbolInstances={},this.bucketInstanceId=et;for(var xt=0;xt<ot.length;xt++){var Ut=ot.get(xt),fe=Ut.key;this.indexedSymbolInstances[fe]||(this.indexedSymbolInstances[fe]=[]),this.indexedSymbolInstances[fe].push({crossTileID:Ut.crossTileID,coord:this.getScaledCoordinates(Ut,Z)})}};cl.prototype.getScaledCoordinates=function(Z,ot){var et=ot.canonical.z-this.tileID.canonical.z,xt=nu/Math.pow(2,et);return{x:Math.floor((ot.canonical.x*t.EXTENT+Z.anchorX)*xt),y:Math.floor((ot.canonical.y*t.EXTENT+Z.anchorY)*xt)}},cl.prototype.findMatches=function(Z,ot,et){for(var xt=this.tileID.canonical.z<ot.canonical.z?1:Math.pow(2,this.tileID.canonical.z-ot.canonical.z),Ut=0;Ut<Z.length;Ut++){var fe=Z.get(Ut);if(!fe.crossTileID){var ye=this.indexedSymbolInstances[fe.key];if(ye)for(var Yt=this.getScaledCoordinates(fe,ot),ce=0,Se=ye;ce<Se.length;ce+=1){var nr=Se[ce];if(Math.abs(nr.coord.x-Yt.x)<=xt&&Math.abs(nr.coord.y-Yt.y)<=xt&&!et[nr.crossTileID]){et[nr.crossTileID]=!0,fe.crossTileID=nr.crossTileID;break}}}}};var Qo=function(){this.maxCrossTileID=0};Qo.prototype.generate=function(){return++this.maxCrossTileID};var Mu=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Mu.prototype.handleWrapJump=function(Z){var ot=Math.round((Z-this.lng)/360);if(ot!==0)for(var et in this.indexes){var xt=this.indexes[et],Ut={};for(var fe in xt){var ye=xt[fe];ye.tileID=ye.tileID.unwrapTo(ye.tileID.wrap+ot),Ut[ye.tileID.key]=ye}this.indexes[et]=Ut}this.lng=Z},Mu.prototype.addBucket=function(Z,ot,et){if(this.indexes[Z.overscaledZ]&&this.indexes[Z.overscaledZ][Z.key]){if(this.indexes[Z.overscaledZ][Z.key].bucketInstanceId===ot.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(Z.overscaledZ,this.indexes[Z.overscaledZ][Z.key])}for(var xt=0;xt<ot.symbolInstances.length;xt++){var Ut=ot.symbolInstances.get(xt);Ut.crossTileID=0}this.usedCrossTileIDs[Z.overscaledZ]||(this.usedCrossTileIDs[Z.overscaledZ]={});var fe=this.usedCrossTileIDs[Z.overscaledZ];for(var ye in this.indexes){var Yt=this.indexes[ye];if(Number(ye)>Z.overscaledZ)for(var ce in Yt){var Se=Yt[ce];Se.tileID.isChildOf(Z)&&Se.findMatches(ot.symbolInstances,Z,fe)}else{var nr=Z.scaledTo(Number(ye)),Ye=Yt[nr.key];Ye&&Ye.findMatches(ot.symbolInstances,Z,fe)}}for(var tr=0;tr<ot.symbolInstances.length;tr++){var lr=ot.symbolInstances.get(tr);lr.crossTileID||(lr.crossTileID=et.generate(),fe[lr.crossTileID]=!0)}return this.indexes[Z.overscaledZ]===void 0&&(this.indexes[Z.overscaledZ]={}),this.indexes[Z.overscaledZ][Z.key]=new cl(Z,ot.symbolInstances,ot.bucketInstanceId),!0},Mu.prototype.removeBucketCrossTileIDs=function(Z,ot){for(var et in ot.indexedSymbolInstances)for(var xt=0,Ut=ot.indexedSymbolInstances[et];xt<Ut.length;xt+=1){var fe=Ut[xt];delete this.usedCrossTileIDs[Z][fe.crossTileID]}},Mu.prototype.removeStaleBuckets=function(Z){var ot=!1;for(var et in this.indexes){var xt=this.indexes[et];for(var Ut in xt)Z[xt[Ut].bucketInstanceId]||(this.removeBucketCrossTileIDs(et,xt[Ut]),delete xt[Ut],ot=!0)}return ot};var Gu=function(){this.layerIndexes={},this.crossTileIDs=new Qo,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Gu.prototype.addLayer=function(Z,ot,et){var xt=this.layerIndexes[Z.id];xt===void 0&&(xt=this.layerIndexes[Z.id]=new Mu);var Ut=!1,fe={};xt.handleWrapJump(et);for(var ye=0,Yt=ot;ye<Yt.length;ye+=1){var ce=Yt[ye],Se=ce.getBucket(Z);!Se||Z.id!==Se.layerIds[0]||(Se.bucketInstanceId||(Se.bucketInstanceId=++this.maxBucketInstanceId),xt.addBucket(ce.tileID,Se,this.crossTileIDs)&&(Ut=!0),fe[Se.bucketInstanceId]=!0)}return xt.removeStaleBuckets(fe)&&(Ut=!0),Ut},Gu.prototype.pruneUnusedLayers=function(Z){var ot={};Z.forEach(function(xt){ot[xt]=!0});for(var et in this.layerIndexes)ot[et]||delete this.layerIndexes[et]};var _l=function(Z,ot){return t.emitValidationErrors(Z,ot&&ot.filter(function(et){return et.identifier!=="source.canvas"}))},Ol=t.pick($r,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Xl=t.pick($r,["setCenter","setZoom","setBearing","setPitch"]),tu=qr(),ac=function(Z){function ot(et,xt){var Ut=this;xt===void 0&&(xt={}),Z.call(this),this.map=et,this.dispatcher=new H(Pa(),this),this.imageManager=new b,this.imageManager.setEventedParent(this),this.glyphManager=new k(et._requestManager,xt.localIdeographFontFamily),this.lineAtlas=new V(256,512),this.crossTileSymbolIndex=new Gu,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 fe=this;this._rtlTextPluginCallback=ot.registerForPluginStateChange(function(ye){var Yt={pluginStatus:ye.pluginStatus,pluginURL:ye.pluginURL};fe.dispatcher.broadcast("syncRTLPluginState",Yt,function(ce,Se){if(t.triggerPluginCompletionEvent(ce),Se){var nr=Se.every(function(tr){return tr});if(nr)for(var Ye in fe.sourceCaches)fe.sourceCaches[Ye].reload()}})}),this.on("data",function(ye){if(!(ye.dataType!=="source"||ye.sourceDataType!=="metadata")){var Yt=Ut.sourceCaches[ye.sourceId];if(Yt){var ce=Yt.getSource();if(!(!ce||!ce.vectorLayerIds))for(var Se in Ut._layers){var nr=Ut._layers[Se];nr.source===ce.id&&Ut._validateLayer(nr)}}}})}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.loadURL=function(et,xt){var Ut=this;xt===void 0&&(xt={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var fe=typeof xt.validate=="boolean"?xt.validate:!t.isMapboxURL(et);et=this.map._requestManager.normalizeStyleURL(et,xt.accessToken);var ye=this.map._requestManager.transformRequest(et,t.ResourceType.Style);this._request=t.getJSON(ye,function(Yt,ce){Ut._request=null,Yt?Ut.fire(new t.ErrorEvent(Yt)):ce&&Ut._load(ce,fe)})},ot.prototype.loadJSON=function(et,xt){var Ut=this;xt===void 0&&(xt={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame(function(){Ut._request=null,Ut._load(et,xt.validate!==!1)})},ot.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(tu,!1)},ot.prototype._load=function(et,xt){if(!(xt&&_l(this,t.validateStyle(et)))){this._loaded=!0,this.stylesheet=et;for(var Ut in et.sources)this.addSource(Ut,et.sources[Ut],{validate:!1});et.sprite?this._loadSprite(et.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(et.glyphs);var fe=Rr(this.stylesheet.layers);this._order=fe.map(function(Se){return Se.id}),this._layers={},this._serializedLayers={};for(var ye=0,Yt=fe;ye<Yt.length;ye+=1){var ce=Yt[ye];ce=t.createStyleLayer(ce),ce.setEventedParent(this,{layer:{id:ce.id}}),this._layers[ce.id]=ce,this._serializedLayers[ce.id]=ce.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new N(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},ot.prototype._loadSprite=function(et){var xt=this;this._spriteRequest=v(et,this.map._requestManager,function(Ut,fe){if(xt._spriteRequest=null,Ut)xt.fire(new t.ErrorEvent(Ut));else if(fe)for(var ye in fe)xt.imageManager.addImage(ye,fe[ye]);xt.imageManager.setLoaded(!0),xt._availableImages=xt.imageManager.listImages(),xt.dispatcher.broadcast("setImages",xt._availableImages),xt.fire(new t.Event("data",{dataType:"style"}))})},ot.prototype._validateLayer=function(et){var xt=this.sourceCaches[et.source];if(xt){var Ut=et.sourceLayer;if(Ut){var fe=xt.getSource();(fe.type==="geojson"||fe.vectorLayerIds&&fe.vectorLayerIds.indexOf(Ut)===-1)&&this.fire(new t.ErrorEvent(new Error('Source layer "'+Ut+'" does not exist on source "'+fe.id+'" as specified by style layer "'+et.id+'"')))}}},ot.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var et in this.sourceCaches)if(!this.sourceCaches[et].loaded())return!1;return!!this.imageManager.isLoaded()},ot.prototype._serializeLayers=function(et){for(var xt=[],Ut=0,fe=et;Ut<fe.length;Ut+=1){var ye=fe[Ut],Yt=this._layers[ye];Yt.type!=="custom"&&xt.push(Yt.serialize())}return xt},ot.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var et in this.sourceCaches)if(this.sourceCaches[et].hasTransition())return!0;for(var xt in this._layers)if(this._layers[xt].hasTransition())return!0;return!1},ot.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},ot.prototype.update=function(et){if(this._loaded){var xt=this._changed;if(this._changed){var Ut=Object.keys(this._updatedLayers),fe=Object.keys(this._removedLayers);(Ut.length||fe.length)&&this._updateWorkerLayers(Ut,fe);for(var ye in this._updatedSources){var Yt=this._updatedSources[ye];Yt==="reload"?this._reloadSource(ye):Yt==="clear"&&this._clearSource(ye)}this._updateTilesForChangedImages();for(var ce in this._updatedPaintProps)this._layers[ce].updateTransitions(et);this.light.updateTransitions(et),this._resetUpdates()}var Se={};for(var nr in this.sourceCaches){var Ye=this.sourceCaches[nr];Se[nr]=Ye.used,Ye.used=!1}for(var tr=0,lr=this._order;tr<lr.length;tr+=1){var hr=lr[tr],Ve=this._layers[hr];Ve.recalculate(et,this._availableImages),!Ve.isHidden(et.zoom)&&Ve.source&&(this.sourceCaches[Ve.source].used=!0)}for(var Xe in Se){var $e=this.sourceCaches[Xe];Se[Xe]!==$e.used&&$e.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:Xe}))}this.light.recalculate(et),this.z=et.zoom,xt&&this.fire(new t.Event("data",{dataType:"style"}))}},ot.prototype._updateTilesForChangedImages=function(){var et=Object.keys(this._changedImages);if(et.length){for(var xt in this.sourceCaches)this.sourceCaches[xt].reloadTilesForDependencies(["icons","patterns"],et);this._changedImages={}}},ot.prototype._updateWorkerLayers=function(et,xt){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(et),removedIds:xt})},ot.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},ot.prototype.setState=function(et){var xt=this;if(this._checkLoaded(),_l(this,t.validateStyle(et)))return!1;et=t.clone$1(et),et.layers=Rr(et.layers);var Ut=Xn(this.serialize(),et).filter(function(ye){return!(ye.command in Xl)});if(Ut.length===0)return!1;var fe=Ut.filter(function(ye){return!(ye.command in Ol)});if(fe.length>0)throw new Error("Unimplemented: "+fe.map(function(ye){return ye.command}).join(", ")+".");return Ut.forEach(function(ye){ye.command!=="setTransition"&&xt[ye.command].apply(xt,ye.args)}),this.stylesheet=et,!0},ot.prototype.addImage=function(et,xt){if(this.getImage(et))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(et,xt),this._afterImageUpdated(et)},ot.prototype.updateImage=function(et,xt){this.imageManager.updateImage(et,xt)},ot.prototype.getImage=function(et){return this.imageManager.getImage(et)},ot.prototype.removeImage=function(et){if(!this.getImage(et))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(et),this._afterImageUpdated(et)},ot.prototype._afterImageUpdated=function(et){this._availableImages=this.imageManager.listImages(),this._changedImages[et]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},ot.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},ot.prototype.addSource=function(et,xt,Ut){var fe=this;if(Ut===void 0&&(Ut={}),this._checkLoaded(),this.sourceCaches[et]!==void 0)throw new Error("There is already a source with this ID");if(!xt.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(xt).join(", ")+".");var ye=["vector","raster","geojson","video","image"],Yt=ye.indexOf(xt.type)>=0;if(!(Yt&&this._validate(t.validateStyle.source,"sources."+et,xt,null,Ut))){this.map&&this.map._collectResourceTiming&&(xt.collectResourceTiming=!0);var ce=this.sourceCaches[et]=new wn(et,xt,this.dispatcher);ce.style=this,ce.setEventedParent(this,function(){return{isSourceLoaded:fe.loaded(),source:ce.serialize(),sourceId:et}}),ce.onAdd(this.map),this._changed=!0}},ot.prototype.removeSource=function(et){if(this._checkLoaded(),this.sourceCaches[et]===void 0)throw new Error("There is no source with this ID");for(var xt in this._layers)if(this._layers[xt].source===et)return this.fire(new t.ErrorEvent(new Error('Source "'+et+'" cannot be removed while layer "'+xt+'" is using it.')));var Ut=this.sourceCaches[et];delete this.sourceCaches[et],delete this._updatedSources[et],Ut.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:et})),Ut.setEventedParent(null),Ut.clearTiles(),Ut.onRemove&&Ut.onRemove(this.map),this._changed=!0},ot.prototype.setGeoJSONSourceData=function(et,xt){this._checkLoaded();var Ut=this.sourceCaches[et].getSource();Ut.setData(xt),this._changed=!0},ot.prototype.getSource=function(et){return this.sourceCaches[et]&&this.sourceCaches[et].getSource()},ot.prototype.addLayer=function(et,xt,Ut){Ut===void 0&&(Ut={}),this._checkLoaded();var fe=et.id;if(this.getLayer(fe)){this.fire(new t.ErrorEvent(new Error('Layer with id "'+fe+'" already exists on this map')));return}var ye;if(et.type==="custom"){if(_l(this,t.validateCustomStyleLayer(et)))return;ye=t.createStyleLayer(et)}else{if(typeof et.source=="object"&&(this.addSource(fe,et.source),et=t.clone$1(et),et=t.extend(et,{source:fe})),this._validate(t.validateStyle.layer,"layers."+fe,et,{arrayIndex:-1},Ut))return;ye=t.createStyleLayer(et),this._validateLayer(ye),ye.setEventedParent(this,{layer:{id:fe}}),this._serializedLayers[ye.id]=ye.serialize()}var Yt=xt?this._order.indexOf(xt):this._order.length;if(xt&&Yt===-1){this.fire(new t.ErrorEvent(new Error('Layer with id "'+xt+'" does not exist on this map.')));return}if(this._order.splice(Yt,0,fe),this._layerOrderChanged=!0,this._layers[fe]=ye,this._removedLayers[fe]&&ye.source&&ye.type!=="custom"){var ce=this._removedLayers[fe];delete this._removedLayers[fe],ce.type!==ye.type?this._updatedSources[ye.source]="clear":(this._updatedSources[ye.source]="reload",this.sourceCaches[ye.source].pause())}this._updateLayer(ye),ye.onAdd&&ye.onAdd(this.map)},ot.prototype.moveLayer=function(et,xt){this._checkLoaded(),this._changed=!0;var Ut=this._layers[et];if(!Ut){this.fire(new t.ErrorEvent(new Error("The layer '"+et+"' does not exist in the map's style and cannot be moved.")));return}if(et!==xt){var fe=this._order.indexOf(et);this._order.splice(fe,1);var ye=xt?this._order.indexOf(xt):this._order.length;if(xt&&ye===-1){this.fire(new t.ErrorEvent(new Error('Layer with id "'+xt+'" does not exist on this map.')));return}this._order.splice(ye,0,et),this._layerOrderChanged=!0}},ot.prototype.removeLayer=function(et){this._checkLoaded();var xt=this._layers[et];if(!xt){this.fire(new t.ErrorEvent(new Error("The layer '"+et+"' does not exist in the map's style and cannot be removed.")));return}xt.setEventedParent(null);var Ut=this._order.indexOf(et);this._order.splice(Ut,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[et]=xt,delete this._layers[et],delete this._serializedLayers[et],delete this._updatedLayers[et],delete this._updatedPaintProps[et],xt.onRemove&&xt.onRemove(this.map)},ot.prototype.getLayer=function(et){return this._layers[et]},ot.prototype.hasLayer=function(et){return et in this._layers},ot.prototype.setLayerZoomRange=function(et,xt,Ut){this._checkLoaded();var fe=this.getLayer(et);if(!fe){this.fire(new t.ErrorEvent(new Error("The layer '"+et+"' does not exist in the map's style and cannot have zoom extent.")));return}fe.minzoom===xt&&fe.maxzoom===Ut||(xt!=null&&(fe.minzoom=xt),Ut!=null&&(fe.maxzoom=Ut),this._updateLayer(fe))},ot.prototype.setFilter=function(et,xt,Ut){Ut===void 0&&(Ut={}),this._checkLoaded();var fe=this.getLayer(et);if(!fe){this.fire(new t.ErrorEvent(new Error("The layer '"+et+"' does not exist in the map's style and cannot be filtered.")));return}if(!t.deepEqual(fe.filter,xt)){if(xt==null){fe.filter=void 0,this._updateLayer(fe);return}this._validate(t.validateStyle.filter,"layers."+fe.id+".filter",xt,null,Ut)||(fe.filter=t.clone$1(xt),this._updateLayer(fe))}},ot.prototype.getFilter=function(et){return t.clone$1(this.getLayer(et).filter)},ot.prototype.setLayoutProperty=function(et,xt,Ut,fe){fe===void 0&&(fe={}),this._checkLoaded();var ye=this.getLayer(et);if(!ye){this.fire(new t.ErrorEvent(new Error("The layer '"+et+"' does not exist in the map's style and cannot be styled.")));return}t.deepEqual(ye.getLayoutProperty(xt),Ut)||(ye.setLayoutProperty(xt,Ut,fe),this._updateLayer(ye))},ot.prototype.getLayoutProperty=function(et,xt){var Ut=this.getLayer(et);if(!Ut){this.fire(new t.ErrorEvent(new Error("The layer '"+et+"' does not exist in the map's style.")));return}return Ut.getLayoutProperty(xt)},ot.prototype.setPaintProperty=function(et,xt,Ut,fe){fe===void 0&&(fe={}),this._checkLoaded();var ye=this.getLayer(et);if(!ye){this.fire(new t.ErrorEvent(new Error("The layer '"+et+"' does not exist in the map's style and cannot be styled.")));return}if(!t.deepEqual(ye.getPaintProperty(xt),Ut)){var Yt=ye.setPaintProperty(xt,Ut,fe);Yt&&this._updateLayer(ye),this._changed=!0,this._updatedPaintProps[et]=!0}},ot.prototype.getPaintProperty=function(et,xt){return this.getLayer(et).getPaintProperty(xt)},ot.prototype.setFeatureState=function(et,xt){this._checkLoaded();var Ut=et.source,fe=et.sourceLayer,ye=this.sourceCaches[Ut];if(ye===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+Ut+"' does not exist in the map's style.")));return}var Yt=ye.getSource().type;if(Yt==="geojson"&&fe){this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(Yt==="vector"&&!fe){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}et.id===void 0&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),ye.setFeatureState(fe,et.id,xt)},ot.prototype.removeFeatureState=function(et,xt){this._checkLoaded();var Ut=et.source,fe=this.sourceCaches[Ut];if(fe===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+Ut+"' does not exist in the map's style.")));return}var ye=fe.getSource().type,Yt=ye==="vector"?et.sourceLayer:void 0;if(ye==="vector"&&!Yt){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(xt&&typeof et.id!="string"&&typeof et.id!="number"){this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}fe.removeFeatureState(Yt,et.id,xt)},ot.prototype.getFeatureState=function(et){this._checkLoaded();var xt=et.source,Ut=et.sourceLayer,fe=this.sourceCaches[xt];if(fe===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+xt+"' does not exist in the map's style.")));return}var ye=fe.getSource().type;if(ye==="vector"&&!Ut){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return et.id===void 0&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),fe.getFeatureState(Ut,et.id)},ot.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},ot.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(et){return et.serialize()}),layers:this._serializeLayers(this._order)},function(et){return et!==void 0})},ot.prototype._updateLayer=function(et){this._updatedLayers[et.id]=!0,et.source&&!this._updatedSources[et.source]&&this.sourceCaches[et.source].getSource().type!=="raster"&&(this._updatedSources[et.source]="reload",this.sourceCaches[et.source].pause()),this._changed=!0},ot.prototype._flattenAndSortRenderedFeatures=function(et){for(var xt=this,Ut=function(Si){return xt._layers[Si].type==="fill-extrusion"},fe={},ye=[],Yt=this._order.length-1;Yt>=0;Yt--){var ce=this._order[Yt];if(Ut(ce)){fe[ce]=Yt;for(var Se=0,nr=et;Se<nr.length;Se+=1){var Ye=nr[Se],tr=Ye[ce];if(tr)for(var lr=0,hr=tr;lr<hr.length;lr+=1){var Ve=hr[lr];ye.push(Ve)}}}}ye.sort(function(Si,sa){return sa.intersectionZ-Si.intersectionZ});for(var Xe=[],$e=this._order.length-1;$e>=0;$e--){var Cr=this._order[$e];if(Ut(Cr))for(var on=ye.length-1;on>=0;on--){var fn=ye[on].feature;if(fe[fn.layer.id]<$e)break;Xe.push(fn),ye.pop()}else for(var fi=0,si=et;fi<si.length;fi+=1){var Gn=si[fi],Mi=Gn[Cr];if(Mi)for(var di=0,Ki=Mi;di<Ki.length;di+=1){var Ai=Ki[di];Xe.push(Ai.feature)}}}return Xe},ot.prototype.queryRenderedFeatures=function(et,xt,Ut){xt&&xt.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",xt.filter,null,xt);var fe={};if(xt&&xt.layers){if(!Array.isArray(xt.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var ye=0,Yt=xt.layers;ye<Yt.length;ye+=1){var ce=Yt[ye],Se=this._layers[ce];if(!Se)return this.fire(new t.ErrorEvent(new Error("The layer '"+ce+"' does not exist in the map's style and cannot be queried for features."))),[];fe[Se.source]=!0}}var nr=[];xt.availableImages=this._availableImages;for(var Ye in this.sourceCaches)xt.layers&&!fe[Ye]||nr.push(ut(this.sourceCaches[Ye],this._layers,this._serializedLayers,et,xt,Ut));return this.placement&&nr.push(wt(this._layers,this._serializedLayers,this.sourceCaches,et,xt,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(nr)},ot.prototype.querySourceFeatures=function(et,xt){xt&&xt.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",xt.filter,null,xt);var Ut=this.sourceCaches[et];return Ut?zt(Ut,xt):[]},ot.prototype.addSourceType=function(et,xt,Ut){if(ot.getSourceType(et))return Ut(new Error('A source type called "'+et+'" already exists.'));if(ot.setSourceType(et,xt),!xt.workerSourceURL)return Ut(null,null);this.dispatcher.broadcast("loadWorkerSource",{name:et,url:xt.workerSourceURL},Ut)},ot.prototype.getLight=function(){return this.light.getLight()},ot.prototype.setLight=function(et,xt){xt===void 0&&(xt={}),this._checkLoaded();var Ut=this.light.getLight(),fe=!1;for(var ye in et)if(!t.deepEqual(et[ye],Ut[ye])){fe=!0;break}if(fe){var Yt={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(et,xt),this.light.updateTransitions(Yt)}},ot.prototype._validate=function(et,xt,Ut,fe,ye){return ye===void 0&&(ye={}),ye&&ye.validate===!1?!1:_l(this,et.call(t.validateStyle,t.extend({key:xt,style:this.serialize(),value:Ut,styleSpec:t.styleSpec},fe)))},ot.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 et in this._layers){var xt=this._layers[et];xt.setEventedParent(null)}for(var Ut in this.sourceCaches)this.sourceCaches[Ut].clearTiles(),this.sourceCaches[Ut].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},ot.prototype._clearSource=function(et){this.sourceCaches[et].clearTiles()},ot.prototype._reloadSource=function(et){this.sourceCaches[et].resume(),this.sourceCaches[et].reload()},ot.prototype._updateSources=function(et){for(var xt in this.sourceCaches)this.sourceCaches[xt].update(et)},ot.prototype._generateCollisionBoxes=function(){for(var et in this.sourceCaches)this._reloadSource(et)},ot.prototype._updatePlacement=function(et,xt,Ut,fe,ye){ye===void 0&&(ye=!1);for(var Yt=!1,ce=!1,Se={},nr=0,Ye=this._order;nr<Ye.length;nr+=1){var tr=Ye[nr],lr=this._layers[tr];if(lr.type==="symbol"){if(!Se[lr.source]){var hr=this.sourceCaches[lr.source];Se[lr.source]=hr.getRenderableIds(!0).map(function(fi){return hr.getTileByID(fi)}).sort(function(fi,si){return si.tileID.overscaledZ-fi.tileID.overscaledZ||(fi.tileID.isLessThan(si.tileID)?-1:1)})}var Ve=this.crossTileSymbolIndex.addLayer(lr,Se[lr.source],et.center.lng);Yt=Yt||Ve}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),ye=ye||this._layerOrderChanged||Ut===0,(ye||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),et.zoom))&&(this.pauseablePlacement=new Ls(et,this._order,ye,xt,Ut,fe,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Se),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),ce=!0),Yt&&this.pauseablePlacement.placement.setStale()),ce||Yt)for(var Xe=0,$e=this._order;Xe<$e.length;Xe+=1){var Cr=$e[Xe],on=this._layers[Cr];on.type==="symbol"&&this.placement.updateLayerOpacities(on,Se[on.source])}var fn=!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now());return fn},ot.prototype._releaseSymbolFadeTiles=function(){for(var et in this.sourceCaches)this.sourceCaches[et].releaseSymbolFadeTiles()},ot.prototype.getImages=function(et,xt,Ut){this.imageManager.getImages(xt.icons,Ut),this._updateTilesForChangedImages();var fe=this.sourceCaches[xt.source];fe&&fe.setDependencies(xt.tileID.key,xt.type,xt.icons)},ot.prototype.getGlyphs=function(et,xt,Ut){this.glyphManager.getGlyphs(xt.stacks,Ut)},ot.prototype.getResource=function(et,xt,Ut){return t.makeRequest(xt,Ut)},ot}(t.Evented);ac.getSourceType=vt,ac.setSourceType=it,ac.registerForPluginStateChange=t.registerForPluginStateChange;var ph=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Jc=`#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`,ah=`#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;}`,Nf=`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
}`,Sf="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",Dl=`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
}`,Bc="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);}",jf=`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
}`,hc=`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);}`,oc="void main() {gl_FragColor=vec4(1.0);}",fc="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",oh=`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
}`,su=`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;}`,sc=`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
}`,el="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;}",Zl="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;}}",Mh="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;}",Lc="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;}",jh="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);}",xu="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);}",Cd="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);}",Qs=`#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
}`,Wd=`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);}`,Ll=`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
}`,Jo=`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;}`,lf=`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
}`,sh=`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;}`,ec=`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
}`,Uf=`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);}`,Uh=`varying vec4 v_color;void main() {gl_FragColor=v_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,yf=`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;}`,lc=`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
}`,hd=`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;}`,$f=`#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
}`,xf="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;}",Vh=`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
}`,Vf="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;}",Hf=`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
}`,lh=`
#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);}`,Gf=`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
}`,Sh=`
#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);}`,mh=`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
}`,uc=`
#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;}`,ef=`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
}`,Wf=`
#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);}`,Jl=`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
}`,Ef="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;}",Ld=`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
}`,Yf=`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));}`,_f=`#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
}`,Kf=`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);}`,Nc=`#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
}`,Xf=`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);}`,zu=vu(Jc,ah),jc=vu(Nf,Sf),Hh=vu(Dl,Bc),lu=vu(jf,hc),Eh=vu(oc,fc),Sc=vu(oh,su),Uc=vu(sc,el),_u=vu(Zl,Mh),uf=vu(Lc,jh),gh=vu(xu,Cd),Wh=vu(Qs,Wd),Cf=vu(Ll,Jo),Pd=vu(lf,sh),Qd=vu(ec,Uf),cf=vu(Uh,yf),Lf=vu(lc,hd),wc=vu($f,xf),hf=vu(Vh,Vf),Qc=vu(Hf,lh),ff=vu(Gf,Sh),Pf=vu(mh,uc),vh=vu(ef,Wf),bu=vu(Jl,Ef),Ch=vu(Ld,Yf),Vc=vu(_f,Kf),fd=vu(Nc,Xf);function vu(Z,ot){var et=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,xt=ot.match(/attribute ([\w]+) ([\w]+)/g),Ut=Z.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),fe=ot.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ye=fe?fe.concat(Ut):Ut,Yt={};return Z=Z.replace(et,function(ce,Se,nr,Ye,tr){return Yt[tr]=!0,Se==="define"?`
#ifndef HAS_UNIFORM_u_`+tr+`
varying `+nr+" "+Ye+" "+tr+`;
#else
uniform `+nr+" "+Ye+" u_"+tr+`;
#endif
`:`
#ifdef HAS_UNIFORM_u_`+tr+`
`+nr+" "+Ye+" "+tr+" = u_"+tr+`;
#endif
`}),ot=ot.replace(et,function(ce,Se,nr,Ye,tr){var lr=Ye==="float"?"vec2":"vec4",hr=tr.match(/color/)?"color":lr;return Yt[tr]?Se==="define"?`
#ifndef HAS_UNIFORM_u_`+tr+`
uniform lowp float u_`+tr+`_t;
attribute `+nr+" "+lr+" a_"+tr+`;
varying `+nr+" "+Ye+" "+tr+`;
#else
uniform `+nr+" "+Ye+" u_"+tr+`;
#endif
`:hr==="vec4"?`
#ifndef HAS_UNIFORM_u_`+tr+`
`+tr+" = a_"+tr+`;
#else
`+nr+" "+Ye+" "+tr+" = u_"+tr+`;
#endif
`:`
#ifndef HAS_UNIFORM_u_`+tr+`
`+tr+" = unpack_mix_"+hr+"(a_"+tr+", u_"+tr+`_t);
#else
`+nr+" "+Ye+" "+tr+" = u_"+tr+`;
#endif
`:Se==="define"?`
#ifndef HAS_UNIFORM_u_`+tr+`
uniform lowp float u_`+tr+`_t;
attribute `+nr+" "+lr+" a_"+tr+`;
#else
uniform `+nr+" "+Ye+" u_"+tr+`;
#endif
`:hr==="vec4"?`
#ifndef HAS_UNIFORM_u_`+tr+`
`+nr+" "+Ye+" "+tr+" = a_"+tr+`;
#else
`+nr+" "+Ye+" "+tr+" = u_"+tr+`;
#endif
`:`
#ifndef HAS_UNIFORM_u_`+tr+`
`+nr+" "+Ye+" "+tr+" = unpack_mix_"+hr+"(a_"+tr+", u_"+tr+`_t);
#else
`+nr+" "+Ye+" "+tr+" = u_"+tr+`;
#endif
`}),{fragmentSource:Z,vertexSource:ot,staticAttributes:xt,staticUniforms:ye}}var bf=Object.freeze({__proto__:null,prelude:zu,background:jc,backgroundPattern:Hh,circle:lu,clippingMask:Eh,heatmap:Sc,heatmapTexture:Uc,collisionBox:_u,collisionCircle:uf,debug:gh,fill:Wh,fillOutline:Cf,fillOutlinePattern:Pd,fillPattern:Qd,fillExtrusion:cf,fillExtrusionPattern:Lf,hillshadePrepare:wc,hillshade:hf,line:Qc,lineGradient:ff,linePattern:Pf,lineSDF:vh,raster:bu,symbolIcon:Ch,symbolSDF:Vc,symbolTextAndIcon:fd}),qh=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};qh.prototype.bind=function(Z,ot,et,xt,Ut,fe,ye,Yt){this.context=Z;for(var ce=this.boundPaintVertexBuffers.length!==xt.length,Se=0;!ce&&Se<xt.length;Se++)this.boundPaintVertexBuffers[Se]!==xt[Se]&&(ce=!0);var nr=!this.vao||this.boundProgram!==ot||this.boundLayoutVertexBuffer!==et||ce||this.boundIndexBuffer!==Ut||this.boundVertexOffset!==fe||this.boundDynamicVertexBuffer!==ye||this.boundDynamicVertexBuffer2!==Yt;!Z.extVertexArrayObject||nr?this.freshBind(ot,et,xt,Ut,fe,ye,Yt):(Z.bindVertexArrayOES.set(this.vao),ye&&ye.bind(),Ut&&Ut.dynamicDraw&&Ut.bind(),Yt&&Yt.bind())},qh.prototype.freshBind=function(Z,ot,et,xt,Ut,fe,ye){var Yt,ce=Z.numAttributes,Se=this.context,nr=Se.gl;if(Se.extVertexArrayObject)this.vao&&this.destroy(),this.vao=Se.extVertexArrayObject.createVertexArrayOES(),Se.bindVertexArrayOES.set(this.vao),Yt=0,this.boundProgram=Z,this.boundLayoutVertexBuffer=ot,this.boundPaintVertexBuffers=et,this.boundIndexBuffer=xt,this.boundVertexOffset=Ut,this.boundDynamicVertexBuffer=fe,this.boundDynamicVertexBuffer2=ye;else{Yt=Se.currentNumAttributes||0;for(var Ye=ce;Ye<Yt;Ye++)nr.disableVertexAttribArray(Ye)}ot.enableAttributes(nr,Z);for(var tr=0,lr=et;tr<lr.length;tr+=1){var hr=lr[tr];hr.enableAttributes(nr,Z)}fe&&fe.enableAttributes(nr,Z),ye&&ye.enableAttributes(nr,Z),ot.bind(),ot.setVertexAttribPointers(nr,Z,Ut);for(var Ve=0,Xe=et;Ve<Xe.length;Ve+=1){var $e=Xe[Ve];$e.bind(),$e.setVertexAttribPointers(nr,Z,Ut)}fe&&(fe.bind(),fe.setVertexAttribPointers(nr,Z,Ut)),xt&&xt.bind(),ye&&(ye.bind(),ye.setVertexAttribPointers(nr,Z,Ut)),Se.currentNumAttributes=ce},qh.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};function th(Z){for(var ot=[],et=0;et<Z.length;et++)if(Z[et]!==null){var xt=Z[et].split(" ");ot.push(xt.pop())}return ot}var rf=function(Z,ot,et,xt,Ut,fe){var ye=Z.gl;this.program=ye.createProgram();for(var Yt=th(et.staticAttributes),ce=xt?xt.getBinderAttributes():[],Se=Yt.concat(ce),nr=et.staticUniforms?th(et.staticUniforms):[],Ye=xt?xt.getBinderUniforms():[],tr=nr.concat(Ye),lr=[],hr=0,Ve=tr;hr<Ve.length;hr+=1){var Xe=Ve[hr];lr.indexOf(Xe)<0&&lr.push(Xe)}var $e=xt?xt.defines():[];fe&&$e.push("#define OVERDRAW_INSPECTOR;");var Cr=$e.concat(zu.fragmentSource,et.fragmentSource).join(`
`),on=$e.concat(zu.vertexSource,et.vertexSource).join(`
`),fn=ye.createShader(ye.FRAGMENT_SHADER);if(ye.isContextLost()){this.failedToCreate=!0;return}ye.shaderSource(fn,Cr),ye.compileShader(fn),ye.attachShader(this.program,fn);var fi=ye.createShader(ye.VERTEX_SHADER);if(ye.isContextLost()){this.failedToCreate=!0;return}ye.shaderSource(fi,on),ye.compileShader(fi),ye.attachShader(this.program,fi),this.attributes={};var si={};this.numAttributes=Se.length;for(var Gn=0;Gn<this.numAttributes;Gn++)Se[Gn]&&(ye.bindAttribLocation(this.program,Gn,Se[Gn]),this.attributes[Se[Gn]]=Gn);ye.linkProgram(this.program),ye.deleteShader(fi),ye.deleteShader(fn);for(var Mi=0;Mi<lr.length;Mi++){var di=lr[Mi];if(di&&!si[di]){var Ki=ye.getUniformLocation(this.program,di);Ki&&(si[di]=Ki)}}this.fixedUniforms=Ut(Z,si),this.binderUniforms=xt?xt.getUniforms(Z,si):[]};rf.prototype.draw=function(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se,nr,Ye,tr,lr,hr,Ve){var Xe,$e=Z.gl;if(!this.failedToCreate){Z.program.set(this.program),Z.setDepthMode(et),Z.setStencilMode(xt),Z.setColorMode(Ut),Z.setCullFace(fe);for(var Cr in this.fixedUniforms)this.fixedUniforms[Cr].set(ye[Cr]);lr&&lr.setUniforms(Z,this.binderUniforms,Ye,{zoom:tr});for(var on=(Xe={},Xe[$e.LINES]=2,Xe[$e.TRIANGLES]=3,Xe[$e.LINE_STRIP]=1,Xe)[ot],fn=0,fi=nr.get();fn<fi.length;fn+=1){var si=fi[fn],Gn=si.vaos||(si.vaos={}),Mi=Gn[Yt]||(Gn[Yt]=new qh);Mi.bind(Z,this,ce,lr?lr.getPaintVertexBuffers():[],Se,si.vertexOffset,hr,Ve),$e.drawElements(ot,si.primitiveLength*on,$e.UNSIGNED_SHORT,si.primitiveOffset*on*2)}}};function Zh(Z,ot,et){var xt=1/Js(et,1,ot.transform.tileZoom),Ut=Math.pow(2,et.tileID.overscaledZ),fe=et.tileSize*Math.pow(2,ot.transform.tileZoom)/Ut,ye=fe*(et.tileID.canonical.x+et.tileID.wrap*Ut),Yt=fe*et.tileID.canonical.y;return{u_image:0,u_texsize:et.imageAtlasTexture.size,u_scale:[xt,Z.fromScale,Z.toScale],u_fade:Z.t,u_pixel_coord_upper:[ye>>16,Yt>>16],u_pixel_coord_lower:[ye&65535,Yt&65535]}}function wf(Z,ot,et,xt){var Ut=et.imageManager.getPattern(Z.from.toString()),fe=et.imageManager.getPattern(Z.to.toString()),ye=et.imageManager.getPixelSize(),Yt=ye.width,ce=ye.height,Se=Math.pow(2,xt.tileID.overscaledZ),nr=xt.tileSize*Math.pow(2,et.transform.tileZoom)/Se,Ye=nr*(xt.tileID.canonical.x+xt.tileID.wrap*Se),tr=nr*xt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Ut.tl,u_pattern_br_a:Ut.br,u_pattern_tl_b:fe.tl,u_pattern_br_b:fe.br,u_texsize:[Yt,ce],u_mix:ot.t,u_pattern_size_a:Ut.displaySize,u_pattern_size_b:fe.displaySize,u_scale_a:ot.fromScale,u_scale_b:ot.toScale,u_tile_units_to_pixels:1/Js(xt,1,et.transform.tileZoom),u_pixel_coord_upper:[Ye>>16,tr>>16],u_pixel_coord_lower:[Ye&65535,tr&65535]}}var zd=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_lightpos:new t.Uniform3f(Z,ot.u_lightpos),u_lightintensity:new t.Uniform1f(Z,ot.u_lightintensity),u_lightcolor:new t.Uniform3f(Z,ot.u_lightcolor),u_vertical_gradient:new t.Uniform1f(Z,ot.u_vertical_gradient),u_opacity:new t.Uniform1f(Z,ot.u_opacity)}},gc=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_lightpos:new t.Uniform3f(Z,ot.u_lightpos),u_lightintensity:new t.Uniform1f(Z,ot.u_lightintensity),u_lightcolor:new t.Uniform3f(Z,ot.u_lightcolor),u_vertical_gradient:new t.Uniform1f(Z,ot.u_vertical_gradient),u_height_factor:new t.Uniform1f(Z,ot.u_height_factor),u_image:new t.Uniform1i(Z,ot.u_image),u_texsize:new t.Uniform2f(Z,ot.u_texsize),u_pixel_coord_upper:new t.Uniform2f(Z,ot.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(Z,ot.u_pixel_coord_lower),u_scale:new t.Uniform3f(Z,ot.u_scale),u_fade:new t.Uniform1f(Z,ot.u_fade),u_opacity:new t.Uniform1f(Z,ot.u_opacity)}},Jf=function(Z,ot,et,xt){var Ut=ot.style.light,fe=Ut.properties.get("position"),ye=[fe.x,fe.y,fe.z],Yt=t.create$1();Ut.properties.get("anchor")==="viewport"&&t.fromRotation(Yt,-ot.transform.angle),t.transformMat3(ye,ye,Yt);var ce=Ut.properties.get("color");return{u_matrix:Z,u_lightpos:ye,u_lightintensity:Ut.properties.get("intensity"),u_lightcolor:[ce.r,ce.g,ce.b],u_vertical_gradient:+et,u_opacity:xt}},eh=function(Z,ot,et,xt,Ut,fe,ye){return t.extend(Jf(Z,ot,et,xt),Zh(fe,ot,ye),{u_height_factor:-Math.pow(2,Ut.overscaledZ)/ye.tileSize/8})},Lh=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix)}},yh=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_image:new t.Uniform1i(Z,ot.u_image),u_texsize:new t.Uniform2f(Z,ot.u_texsize),u_pixel_coord_upper:new t.Uniform2f(Z,ot.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(Z,ot.u_pixel_coord_lower),u_scale:new t.Uniform3f(Z,ot.u_scale),u_fade:new t.Uniform1f(Z,ot.u_fade)}},Ru=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_world:new t.Uniform2f(Z,ot.u_world)}},eu=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_world:new t.Uniform2f(Z,ot.u_world),u_image:new t.Uniform1i(Z,ot.u_image),u_texsize:new t.Uniform2f(Z,ot.u_texsize),u_pixel_coord_upper:new t.Uniform2f(Z,ot.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(Z,ot.u_pixel_coord_lower),u_scale:new t.Uniform3f(Z,ot.u_scale),u_fade:new t.Uniform1f(Z,ot.u_fade)}},xh=function(Z){return{u_matrix:Z}},df=function(Z,ot,et,xt){return t.extend(xh(Z),Zh(et,ot,xt))},_h=function(Z,ot){return{u_matrix:Z,u_world:ot}},qf=function(Z,ot,et,xt,Ut){return t.extend(df(Z,ot,et,xt),{u_world:Ut})},mr=function(Z,ot){return{u_camera_to_center_distance:new t.Uniform1f(Z,ot.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(Z,ot.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(Z,ot.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(Z,ot.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(Z,ot.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix)}},Ur=function(Z,ot,et,xt){var Ut=Z.transform,fe,ye;if(xt.paint.get("circle-pitch-alignment")==="map"){var Yt=Js(et,1,Ut.zoom);fe=!0,ye=[Yt,Yt]}else fe=!1,ye=Ut.pixelsToGLUnits;return{u_camera_to_center_distance:Ut.cameraToCenterDistance,u_scale_with_map:+(xt.paint.get("circle-pitch-scale")==="map"),u_matrix:Z.translatePosMatrix(ot.posMatrix,et,xt.paint.get("circle-translate"),xt.paint.get("circle-translate-anchor")),u_pitch_with_map:+fe,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:ye}},_n=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_camera_to_center_distance:new t.Uniform1f(Z,ot.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(Z,ot.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(Z,ot.u_extrude_scale),u_overscale_factor:new t.Uniform1f(Z,ot.u_overscale_factor)}},cn=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_inv_matrix:new t.UniformMatrix4f(Z,ot.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(Z,ot.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(Z,ot.u_viewport_size)}},Wn=function(Z,ot,et){var xt=Js(et,1,ot.zoom),Ut=Math.pow(2,ot.zoom-et.tileID.overscaledZ),fe=et.tileID.overscaleFactor();return{u_matrix:Z,u_camera_to_center_distance:ot.cameraToCenterDistance,u_pixels_to_tile_units:xt,u_extrude_scale:[ot.pixelsToGLUnits[0]/(xt*Ut),ot.pixelsToGLUnits[1]/(xt*Ut)],u_overscale_factor:fe}},hi=function(Z,ot,et){return{u_matrix:Z,u_inv_matrix:ot,u_camera_to_center_distance:et.cameraToCenterDistance,u_viewport_size:[et.width,et.height]}},ea=function(Z,ot){return{u_color:new t.UniformColor(Z,ot.u_color),u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_overlay:new t.Uniform1i(Z,ot.u_overlay),u_overlay_scale:new t.Uniform1f(Z,ot.u_overlay_scale)}},ga=function(Z,ot,et){return et===void 0&&(et=1),{u_matrix:Z,u_color:ot,u_overlay:0,u_overlay_scale:et}},Ra=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix)}},$a=function(Z){return{u_matrix:Z}},ua=function(Z,ot){return{u_extrude_scale:new t.Uniform1f(Z,ot.u_extrude_scale),u_intensity:new t.Uniform1f(Z,ot.u_intensity),u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix)}},za=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_world:new t.Uniform2f(Z,ot.u_world),u_image:new t.Uniform1i(Z,ot.u_image),u_color_ramp:new t.Uniform1i(Z,ot.u_color_ramp),u_opacity:new t.Uniform1f(Z,ot.u_opacity)}},wa=function(Z,ot,et,xt){return{u_matrix:Z,u_extrude_scale:Js(ot,1,et),u_intensity:xt}},Ji=function(Z,ot,et,xt){var Ut=t.create();t.ortho(Ut,0,Z.width,Z.height,0,0,1);var fe=Z.context.gl;return{u_matrix:Ut,u_world:[fe.drawingBufferWidth,fe.drawingBufferHeight],u_image:et,u_color_ramp:xt,u_opacity:ot.paint.get("heatmap-opacity")}},eo=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_image:new t.Uniform1i(Z,ot.u_image),u_latrange:new t.Uniform2f(Z,ot.u_latrange),u_light:new t.Uniform2f(Z,ot.u_light),u_shadow:new t.UniformColor(Z,ot.u_shadow),u_highlight:new t.UniformColor(Z,ot.u_highlight),u_accent:new t.UniformColor(Z,ot.u_accent)}},rs=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_image:new t.Uniform1i(Z,ot.u_image),u_dimension:new t.Uniform2f(Z,ot.u_dimension),u_zoom:new t.Uniform1f(Z,ot.u_zoom),u_unpack:new t.Uniform4f(Z,ot.u_unpack)}},Zo=function(Z,ot,et){var xt=et.paint.get("hillshade-shadow-color"),Ut=et.paint.get("hillshade-highlight-color"),fe=et.paint.get("hillshade-accent-color"),ye=et.paint.get("hillshade-illumination-direction")*(Math.PI/180);et.paint.get("hillshade-illumination-anchor")==="viewport"&&(ye-=Z.transform.angle);var Yt=!Z.options.moving;return{u_matrix:Z.transform.calculatePosMatrix(ot.tileID.toUnwrapped(),Yt),u_image:0,u_latrange:fs(Z,ot.tileID),u_light:[et.paint.get("hillshade-exaggeration"),ye],u_shadow:xt,u_highlight:Ut,u_accent:fe}},os=function(Z,ot){var et=ot.stride,xt=t.create();return t.ortho(xt,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(xt,xt,[0,-t.EXTENT,0]),{u_matrix:xt,u_image:1,u_dimension:[et,et],u_zoom:Z.overscaledZ,u_unpack:ot.getUnpackVector()}};function fs(Z,ot){var et=Math.pow(2,ot.canonical.z),xt=ot.canonical.y;return[new t.MercatorCoordinate(0,xt/et).toLngLat().lat,new t.MercatorCoordinate(0,(xt+1)/et).toLngLat().lat]}var no=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_ratio:new t.Uniform1f(Z,ot.u_ratio),u_device_pixel_ratio:new t.Uniform1f(Z,ot.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(Z,ot.u_units_to_pixels)}},qa=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_ratio:new t.Uniform1f(Z,ot.u_ratio),u_device_pixel_ratio:new t.Uniform1f(Z,ot.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(Z,ot.u_units_to_pixels),u_image:new t.Uniform1i(Z,ot.u_image),u_image_height:new t.Uniform1f(Z,ot.u_image_height)}},ds=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_texsize:new t.Uniform2f(Z,ot.u_texsize),u_ratio:new t.Uniform1f(Z,ot.u_ratio),u_device_pixel_ratio:new t.Uniform1f(Z,ot.u_device_pixel_ratio),u_image:new t.Uniform1i(Z,ot.u_image),u_units_to_pixels:new t.Uniform2f(Z,ot.u_units_to_pixels),u_scale:new t.Uniform3f(Z,ot.u_scale),u_fade:new t.Uniform1f(Z,ot.u_fade)}},tl=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_ratio:new t.Uniform1f(Z,ot.u_ratio),u_device_pixel_ratio:new t.Uniform1f(Z,ot.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(Z,ot.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(Z,ot.u_patternscale_a),u_patternscale_b:new t.Uniform2f(Z,ot.u_patternscale_b),u_sdfgamma:new t.Uniform1f(Z,ot.u_sdfgamma),u_image:new t.Uniform1i(Z,ot.u_image),u_tex_y_a:new t.Uniform1f(Z,ot.u_tex_y_a),u_tex_y_b:new t.Uniform1f(Z,ot.u_tex_y_b),u_mix:new t.Uniform1f(Z,ot.u_mix)}},Pl=function(Z,ot,et){var xt=Z.transform;return{u_matrix:qu(Z,ot,et),u_ratio:1/Js(ot,1,xt.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/xt.pixelsToGLUnits[0],1/xt.pixelsToGLUnits[1]]}},iu=function(Z,ot,et,xt){return t.extend(Pl(Z,ot,et),{u_image:0,u_image_height:xt})},Hl=function(Z,ot,et,xt){var Ut=Z.transform,fe=ml(ot,Ut);return{u_matrix:qu(Z,ot,et),u_texsize:ot.imageAtlasTexture.size,u_ratio:1/Js(ot,1,Ut.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[fe,xt.fromScale,xt.toScale],u_fade:xt.t,u_units_to_pixels:[1/Ut.pixelsToGLUnits[0],1/Ut.pixelsToGLUnits[1]]}},au=function(Z,ot,et,xt,Ut){var fe=Z.transform,ye=Z.lineAtlas,Yt=ml(ot,fe),ce=et.layout.get("line-cap")==="round",Se=ye.getDash(xt.from,ce),nr=ye.getDash(xt.to,ce),Ye=Se.width*Ut.fromScale,tr=nr.width*Ut.toScale;return t.extend(Pl(Z,ot,et),{u_patternscale_a:[Yt/Ye,-Se.height/2],u_patternscale_b:[Yt/tr,-nr.height/2],u_sdfgamma:ye.width/(Math.min(Ye,tr)*256*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:Se.y,u_tex_y_b:nr.y,u_mix:Ut.t})};function ml(Z,ot){return 1/Js(Z,1,ot.tileZoom)}function qu(Z,ot,et){return Z.translatePosMatrix(ot.tileID.posMatrix,ot,et.paint.get("line-translate"),et.paint.get("line-translate-anchor"))}var Lu=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_tl_parent:new t.Uniform2f(Z,ot.u_tl_parent),u_scale_parent:new t.Uniform1f(Z,ot.u_scale_parent),u_buffer_scale:new t.Uniform1f(Z,ot.u_buffer_scale),u_fade_t:new t.Uniform1f(Z,ot.u_fade_t),u_opacity:new t.Uniform1f(Z,ot.u_opacity),u_image0:new t.Uniform1i(Z,ot.u_image0),u_image1:new t.Uniform1i(Z,ot.u_image1),u_brightness_low:new t.Uniform1f(Z,ot.u_brightness_low),u_brightness_high:new t.Uniform1f(Z,ot.u_brightness_high),u_saturation_factor:new t.Uniform1f(Z,ot.u_saturation_factor),u_contrast_factor:new t.Uniform1f(Z,ot.u_contrast_factor),u_spin_weights:new t.Uniform3f(Z,ot.u_spin_weights)}},uu=function(Z,ot,et,xt,Ut){return{u_matrix:Z,u_tl_parent:ot,u_scale_parent:et,u_buffer_scale:1,u_fade_t:xt.mix,u_opacity:xt.opacity*Ut.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Ut.paint.get("raster-brightness-min"),u_brightness_high:Ut.paint.get("raster-brightness-max"),u_saturation_factor:$l(Ut.paint.get("raster-saturation")),u_contrast_factor:Ms(Ut.paint.get("raster-contrast")),u_spin_weights:zo(Ut.paint.get("raster-hue-rotate"))}};function zo(Z){Z*=Math.PI/180;var ot=Math.sin(Z),et=Math.cos(Z);return[(2*et+1)/3,(-Math.sqrt(3)*ot-et+1)/3,(Math.sqrt(3)*ot-et+1)/3]}function Ms(Z){return Z>0?1/(1-Z):1+Z}function $l(Z){return Z>0?1-1/(1.001-Z):-Z}var Fl=function(Z,ot){return{u_is_size_zoom_constant:new t.Uniform1i(Z,ot.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(Z,ot.u_is_size_feature_constant),u_size_t:new t.Uniform1f(Z,ot.u_size_t),u_size:new t.Uniform1f(Z,ot.u_size),u_camera_to_center_distance:new t.Uniform1f(Z,ot.u_camera_to_center_distance),u_pitch:new t.Uniform1f(Z,ot.u_pitch),u_rotate_symbol:new t.Uniform1i(Z,ot.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(Z,ot.u_aspect_ratio),u_fade_change:new t.Uniform1f(Z,ot.u_fade_change),u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(Z,ot.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(Z,ot.u_coord_matrix),u_is_text:new t.Uniform1i(Z,ot.u_is_text),u_pitch_with_map:new t.Uniform1i(Z,ot.u_pitch_with_map),u_texsize:new t.Uniform2f(Z,ot.u_texsize),u_texture:new t.Uniform1i(Z,ot.u_texture)}},vc=function(Z,ot){return{u_is_size_zoom_constant:new t.Uniform1i(Z,ot.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(Z,ot.u_is_size_feature_constant),u_size_t:new t.Uniform1f(Z,ot.u_size_t),u_size:new t.Uniform1f(Z,ot.u_size),u_camera_to_center_distance:new t.Uniform1f(Z,ot.u_camera_to_center_distance),u_pitch:new t.Uniform1f(Z,ot.u_pitch),u_rotate_symbol:new t.Uniform1i(Z,ot.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(Z,ot.u_aspect_ratio),u_fade_change:new t.Uniform1f(Z,ot.u_fade_change),u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(Z,ot.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(Z,ot.u_coord_matrix),u_is_text:new t.Uniform1i(Z,ot.u_is_text),u_pitch_with_map:new t.Uniform1i(Z,ot.u_pitch_with_map),u_texsize:new t.Uniform2f(Z,ot.u_texsize),u_texture:new t.Uniform1i(Z,ot.u_texture),u_gamma_scale:new t.Uniform1f(Z,ot.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(Z,ot.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(Z,ot.u_is_halo)}},Hc=function(Z,ot){return{u_is_size_zoom_constant:new t.Uniform1i(Z,ot.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(Z,ot.u_is_size_feature_constant),u_size_t:new t.Uniform1f(Z,ot.u_size_t),u_size:new t.Uniform1f(Z,ot.u_size),u_camera_to_center_distance:new t.Uniform1f(Z,ot.u_camera_to_center_distance),u_pitch:new t.Uniform1f(Z,ot.u_pitch),u_rotate_symbol:new t.Uniform1i(Z,ot.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(Z,ot.u_aspect_ratio),u_fade_change:new t.Uniform1f(Z,ot.u_fade_change),u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(Z,ot.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(Z,ot.u_coord_matrix),u_is_text:new t.Uniform1i(Z,ot.u_is_text),u_pitch_with_map:new t.Uniform1i(Z,ot.u_pitch_with_map),u_texsize:new t.Uniform2f(Z,ot.u_texsize),u_texsize_icon:new t.Uniform2f(Z,ot.u_texsize_icon),u_texture:new t.Uniform1i(Z,ot.u_texture),u_texture_icon:new t.Uniform1i(Z,ot.u_texture_icon),u_gamma_scale:new t.Uniform1f(Z,ot.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(Z,ot.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(Z,ot.u_is_halo)}},Pc=function(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se){var nr=Ut.transform;return{u_is_size_zoom_constant:+(Z==="constant"||Z==="source"),u_is_size_feature_constant:+(Z==="constant"||Z==="camera"),u_size_t:ot?ot.uSizeT:0,u_size:ot?ot.uSize:0,u_camera_to_center_distance:nr.cameraToCenterDistance,u_pitch:nr.pitch/360*2*Math.PI,u_rotate_symbol:+et,u_aspect_ratio:nr.width/nr.height,u_fade_change:Ut.options.fadeDuration?Ut.symbolFadeChange:1,u_matrix:fe,u_label_plane_matrix:ye,u_coord_matrix:Yt,u_is_text:+ce,u_pitch_with_map:+xt,u_texsize:Se,u_texture:0}},Ph=function(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se,nr){var Ye=Ut.transform;return t.extend(Pc(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se),{u_gamma_scale:xt?Math.cos(Ye._pitch)*Ye.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:1})},Wc=function(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se){return t.extend(Ph(Z,ot,et,xt,Ut,fe,ye,Yt,!0,ce),{u_texsize_icon:Se,u_texture_icon:1})},zh=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_opacity:new t.Uniform1f(Z,ot.u_opacity),u_color:new t.UniformColor(Z,ot.u_color)}},Iu=function(Z,ot){return{u_matrix:new t.UniformMatrix4f(Z,ot.u_matrix),u_opacity:new t.Uniform1f(Z,ot.u_opacity),u_image:new t.Uniform1i(Z,ot.u_image),u_pattern_tl_a:new t.Uniform2f(Z,ot.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(Z,ot.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(Z,ot.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(Z,ot.u_pattern_br_b),u_texsize:new t.Uniform2f(Z,ot.u_texsize),u_mix:new t.Uniform1f(Z,ot.u_mix),u_pattern_size_a:new t.Uniform2f(Z,ot.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(Z,ot.u_pattern_size_b),u_scale_a:new t.Uniform1f(Z,ot.u_scale_a),u_scale_b:new t.Uniform1f(Z,ot.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(Z,ot.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(Z,ot.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(Z,ot.u_tile_units_to_pixels)}},Ih=function(Z,ot,et){return{u_matrix:Z,u_opacity:ot,u_color:et}},es=function(Z,ot,et,xt,Ut,fe){return t.extend(wf(xt,fe,et,Ut),{u_matrix:Z,u_opacity:ot})},zs={fillExtrusion:zd,fillExtrusionPattern:gc,fill:Lh,fillPattern:yh,fillOutline:Ru,fillOutlinePattern:eu,circle:mr,collisionBox:_n,collisionCircle:cn,debug:ea,clippingMask:Ra,heatmap:ua,heatmapTexture:za,hillshade:eo,hillshadePrepare:rs,line:no,lineGradient:qa,linePattern:ds,lineSDF:tl,raster:Lu,symbolIcon:Fl,symbolSDF:vc,symbolTextAndIcon:Hc,background:zh,backgroundPattern:Iu},qc;function Zu(Z,ot,et,xt,Ut,fe,ye){for(var Yt=Z.context,ce=Yt.gl,Se=Z.useProgram("collisionBox"),nr=[],Ye=0,tr=0,lr=0;lr<xt.length;lr++){var hr=xt[lr],Ve=ot.getTile(hr),Xe=Ve.getBucket(et);if(Xe){var $e=hr.posMatrix;(Ut[0]!==0||Ut[1]!==0)&&($e=Z.translatePosMatrix(hr.posMatrix,Ve,Ut,fe));var Cr=ye?Xe.textCollisionBox:Xe.iconCollisionBox,on=Xe.collisionCircleArray;if(on.length>0){var fn=t.create(),fi=$e;t.mul(fn,Xe.placementInvProjMatrix,Z.transform.glCoordMatrix),t.mul(fn,fn,Xe.placementViewportMatrix),nr.push({circleArray:on,circleOffset:tr,transform:fi,invTransform:fn}),Ye+=on.length/4,tr=Ye}Cr&&Se.draw(Yt,ce.LINES,Kn.disabled,qn.disabled,Z.colorModeForRenderPass(),Qr.disabled,Wn($e,Z.transform,Ve),et.id,Cr.layoutVertexBuffer,Cr.indexBuffer,Cr.segments,null,Z.transform.zoom,null,null,Cr.collisionVertexBuffer)}}if(!(!ye||!nr.length)){var si=Z.useProgram("collisionCircle"),Gn=new t.StructArrayLayout2f1f2i16;Gn.resize(Ye*4),Gn._trim();for(var Mi=0,di=0,Ki=nr;di<Ki.length;di+=1)for(var Ai=Ki[di],Si=0;Si<Ai.circleArray.length/4;Si++){var sa=Si*4,Qa=Ai.circleArray[sa+0],so=Ai.circleArray[sa+1],Vo=Ai.circleArray[sa+2],vs=Ai.circleArray[sa+3];Gn.emplace(Mi++,Qa,so,Vo,vs,0),Gn.emplace(Mi++,Qa,so,Vo,vs,1),Gn.emplace(Mi++,Qa,so,Vo,vs,2),Gn.emplace(Mi++,Qa,so,Vo,vs,3)}(!qc||qc.length<Ye*2)&&(qc=Zf(Ye));for(var zl=Yt.createIndexBuffer(qc,!0),jl=Yt.createVertexBuffer(Gn,t.collisionCircleLayout.members,!0),dl=0,Ul=nr;dl<Ul.length;dl+=1){var _c=Ul[dl],Ds=hi(_c.transform,_c.invTransform,Z.transform);si.draw(Yt,ce.TRIANGLES,Kn.disabled,qn.disabled,Z.colorModeForRenderPass(),Qr.disabled,Ds,et.id,jl,zl,t.SegmentVector.simpleSegment(0,_c.circleOffset*2,_c.circleArray.length,_c.circleArray.length/2),null,Z.transform.zoom,null,null,null)}jl.destroy(),zl.destroy()}}function Zf(Z){var ot=Z*2,et=new t.StructArrayLayout3ui6;et.resize(ot),et._trim();for(var xt=0;xt<ot;xt++){var Ut=xt*6;et.uint16[Ut+0]=xt*4+0,et.uint16[Ut+1]=xt*4+1,et.uint16[Ut+2]=xt*4+2,et.uint16[Ut+3]=xt*4+2,et.uint16[Ut+4]=xt*4+3,et.uint16[Ut+5]=xt*4+0}return et}var qt=t.identity(new Float32Array(16));function I(Z,ot,et,xt,Ut){if(Z.renderPass==="translucent"){var fe=qn.disabled,ye=Z.colorModeForRenderPass(),Yt=et.layout.get("text-variable-anchor");Yt&&Et(xt,Z,et,ot,et.layout.get("text-rotation-alignment"),et.layout.get("text-pitch-alignment"),Ut),et.paint.get("icon-opacity").constantOr(1)!==0&&ke(Z,ot,et,xt,!1,et.paint.get("icon-translate"),et.paint.get("icon-translate-anchor"),et.layout.get("icon-rotation-alignment"),et.layout.get("icon-pitch-alignment"),et.layout.get("icon-keep-upright"),fe,ye),et.paint.get("text-opacity").constantOr(1)!==0&&ke(Z,ot,et,xt,!0,et.paint.get("text-translate"),et.paint.get("text-translate-anchor"),et.layout.get("text-rotation-alignment"),et.layout.get("text-pitch-alignment"),et.layout.get("text-keep-upright"),fe,ye),ot.map.showCollisionBoxes&&(Zu(Z,ot,et,xt,et.paint.get("text-translate"),et.paint.get("text-translate-anchor"),!0),Zu(Z,ot,et,xt,et.paint.get("icon-translate"),et.paint.get("icon-translate-anchor"),!1))}}function ht(Z,ot,et,xt,Ut,fe){var ye=t.getAnchorAlignment(Z),Yt=ye.horizontalAlign,ce=ye.verticalAlign,Se=-(Yt-.5)*ot,nr=-(ce-.5)*et,Ye=t.evaluateVariableOffset(Z,xt);return new t.Point((Se/Ut+Ye[0])*fe,(nr/Ut+Ye[1])*fe)}function Et(Z,ot,et,xt,Ut,fe,ye){for(var Yt=ot.transform,ce=Ut==="map",Se=fe==="map",nr=0,Ye=Z;nr<Ye.length;nr+=1){var tr=Ye[nr],lr=xt.getTile(tr),hr=lr.getBucket(et);if(!(!hr||!hr.text||!hr.text.segments.get().length)){var Ve=hr.textSizeData,Xe=t.evaluateSizeForZoom(Ve,Yt.zoom),$e=Js(lr,1,ot.transform.zoom),Cr=Zn(tr.posMatrix,Se,ce,ot.transform,$e),on=et.layout.get("icon-text-fit")!=="none"&&hr.hasIconData();if(Xe){var fn=Math.pow(2,Yt.zoom-lr.tileID.overscaledZ);It(hr,ce,Se,ye,t.symbolSize,Yt,Cr,tr.posMatrix,fn,Xe,on)}}}}function It(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se,nr){var Ye=Z.text.placedSymbolArray,tr=Z.text.dynamicLayoutVertexArray,lr=Z.icon.dynamicLayoutVertexArray,hr={};tr.clear();for(var Ve=0;Ve<Ye.length;Ve++){var Xe=Ye.get(Ve),$e=Z.allowVerticalPlacement&&!Xe.placedOrientation,Cr=!Xe.hidden&&Xe.crossTileID&&!$e?xt[Xe.crossTileID]:null;if(!Cr)Ho(Xe.numGlyphs,tr);else{var on=new t.Point(Xe.anchorX,Xe.anchorY),fn=Ri(on,et?Yt:ye),fi=Ja(fe.cameraToCenterDistance,fn.signedDistanceFromCamera),si=Ut.evaluateSizeForFeature(Z.textSizeData,Se,Xe)*fi/t.ONE_EM;et&&(si*=Z.tilePixelRatio/ce);for(var Gn=Cr.width,Mi=Cr.height,di=Cr.anchor,Ki=Cr.textOffset,Ai=Cr.textBoxScale,Si=ht(di,Gn,Mi,Ki,Ai,si),sa=et?Ri(on.add(Si),ye).point:fn.point.add(ot?Si.rotate(-fe.angle):Si),Qa=Z.allowVerticalPlacement&&Xe.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,so=0;so<Xe.numGlyphs;so++)t.addDynamicAttributes(tr,sa,Qa);nr&&Xe.associatedIconIndex>=0&&(hr[Xe.associatedIconIndex]={shiftedAnchor:sa,angle:Qa})}}if(nr){lr.clear();for(var Vo=Z.icon.placedSymbolArray,vs=0;vs<Vo.length;vs++){var zl=Vo.get(vs);if(zl.hidden)Ho(zl.numGlyphs,lr);else{var jl=hr[vs];if(!jl)Ho(zl.numGlyphs,lr);else for(var dl=0;dl<zl.numGlyphs;dl++)t.addDynamicAttributes(lr,jl.shiftedAnchor,jl.angle)}}Z.icon.dynamicLayoutVertexBuffer.updateData(lr)}Z.text.dynamicLayoutVertexBuffer.updateData(tr)}function Vt(Z,ot,et){return et.iconsInText&&ot?"symbolTextAndIcon":Z?"symbolSDF":"symbolIcon"}function ke(Z,ot,et,xt,Ut,fe,ye,Yt,ce,Se,nr,Ye){for(var tr=Z.context,lr=tr.gl,hr=Z.transform,Ve=Yt==="map",Xe=ce==="map",$e=Ve&&et.layout.get("symbol-placement")!=="point",Cr=Ve&&!Xe&&!$e,on=et.layout.get("symbol-sort-key").constantOr(1)!==void 0,fn=!1,fi=Z.depthModeForSublayer(0,Kn.ReadOnly),si=et.layout.get("text-variable-anchor"),Gn=[],Mi=0,di=xt;Mi<di.length;Mi+=1){var Ki=di[Mi],Ai=ot.getTile(Ki),Si=Ai.getBucket(et);if(Si){var sa=Ut?Si.text:Si.icon;if(!(!sa||!sa.segments.get().length)){var Qa=sa.programConfigurations.get(et.id),so=Ut||Si.sdfIcons,Vo=Ut?Si.textSizeData:Si.iconSizeData,vs=Xe||hr.pitch!==0,zl=Z.useProgram(Vt(so,Ut,Si),Qa),jl=t.evaluateSizeForZoom(Vo,hr.zoom),dl=void 0,Ul=[0,0],_c=void 0,Ds=void 0,Au=null,nf=void 0;if(Ut){if(_c=Ai.glyphAtlasTexture,Ds=lr.LINEAR,dl=Ai.glyphAtlasTexture.size,Si.iconsInText){Ul=Ai.imageAtlasTexture.size,Au=Ai.imageAtlasTexture;var zf=Vo.kind==="composite"||Vo.kind==="camera";nf=vs||Z.options.rotating||Z.options.zooming||zf?lr.LINEAR:lr.NEAREST}}else{var Np=et.layout.get("icon-size").constantOr(0)!==1||Si.iconsNeedLinear;_c=Ai.imageAtlasTexture,Ds=so||Z.options.rotating||Z.options.zooming||Np||vs?lr.LINEAR:lr.NEAREST,dl=Ai.imageAtlasTexture.size}var b0=Js(Ai,1,Z.transform.zoom),kp=Zn(Ki.posMatrix,Xe,Ve,Z.transform,b0),Tp=Ca(Ki.posMatrix,Xe,Ve,Z.transform,b0),R0=si&&Si.hasTextData(),tp=et.layout.get("icon-text-fit")!=="none"&&R0&&Si.hasIconData();$e&&Io(Si,Ki.posMatrix,Z,Ut,kp,Tp,Xe,Se);var Ap=Z.translatePosMatrix(Ki.posMatrix,Ai,fe,ye),qd=$e||Ut&&si||tp?qt:kp,Q0=Z.translatePosMatrix(Tp,Ai,fe,ye,!0),Hm=so&&et.paint.get(Ut?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Mp=void 0;so?Si.iconsInText?Mp=Wc(Vo.kind,jl,Cr,Xe,Z,Ap,qd,Q0,dl,Ul):Mp=Ph(Vo.kind,jl,Cr,Xe,Z,Ap,qd,Q0,Ut,dl):Mp=Pc(Vo.kind,jl,Cr,Xe,Z,Ap,qd,Q0,Ut,dl);var Sp={program:zl,buffers:sa,uniformValues:Mp,atlasTexture:_c,atlasTextureIcon:Au,atlasInterpolation:Ds,atlasInterpolationIcon:nf,isSDF:so,hasHalo:Hm};if(on&&Si.canOverlap){fn=!0;for(var ep=sa.segments.get(),Wm=0,Pg=ep;Wm<Pg.length;Wm+=1){var qm=Pg[Wm];Gn.push({segments:new t.SegmentVector([qm]),sortKey:qm.sortKey,state:Sp})}}else Gn.push({segments:sa.segments,sortKey:0,state:Sp})}}}fn&&Gn.sort(function(Cv,Lv){return Cv.sortKey-Lv.sortKey});for(var dd=0,wm=Gn;dd<wm.length;dd+=1){var zg=wm[dd],pd=zg.state;if(tr.activeTexture.set(lr.TEXTURE0),pd.atlasTexture.bind(pd.atlasInterpolation,lr.CLAMP_TO_EDGE),pd.atlasTextureIcon&&(tr.activeTexture.set(lr.TEXTURE1),pd.atlasTextureIcon&&pd.atlasTextureIcon.bind(pd.atlasInterpolationIcon,lr.CLAMP_TO_EDGE)),pd.isSDF){var Zm=pd.uniformValues;pd.hasHalo&&(Zm.u_is_halo=1,Oe(pd.buffers,zg.segments,et,Z,pd.program,fi,nr,Ye,Zm)),Zm.u_is_halo=0}Oe(pd.buffers,zg.segments,et,Z,pd.program,fi,nr,Ye,pd.uniformValues)}}function Oe(Z,ot,et,xt,Ut,fe,ye,Yt,ce){var Se=xt.context,nr=Se.gl;Ut.draw(Se,nr.TRIANGLES,fe,ye,Yt,Qr.disabled,ce,et.id,Z.layoutVertexBuffer,Z.indexBuffer,ot,et.paint,xt.transform.zoom,Z.programConfigurations.get(et.id),Z.dynamicLayoutVertexBuffer,Z.opacityVertexBuffer)}function Ke(Z,ot,et,xt){if(Z.renderPass==="translucent"){var Ut=et.paint.get("circle-opacity"),fe=et.paint.get("circle-stroke-width"),ye=et.paint.get("circle-stroke-opacity"),Yt=et.layout.get("circle-sort-key").constantOr(1)!==void 0;if(!(Ut.constantOr(1)===0&&(fe.constantOr(1)===0||ye.constantOr(1)===0))){for(var ce=Z.context,Se=ce.gl,nr=Z.depthModeForSublayer(0,Kn.ReadOnly),Ye=qn.disabled,tr=Z.colorModeForRenderPass(),lr=[],hr=0;hr<xt.length;hr++){var Ve=xt[hr],Xe=ot.getTile(Ve),$e=Xe.getBucket(et);if($e){var Cr=$e.programConfigurations.get(et.id),on=Z.useProgram("circle",Cr),fn=$e.layoutVertexBuffer,fi=$e.indexBuffer,si=Ur(Z,Ve,Xe,et),Gn={programConfiguration:Cr,program:on,layoutVertexBuffer:fn,indexBuffer:fi,uniformValues:si};if(Yt)for(var Mi=$e.segments.get(),di=0,Ki=Mi;di<Ki.length;di+=1){var Ai=Ki[di];lr.push({segments:new t.SegmentVector([Ai]),sortKey:Ai.sortKey,state:Gn})}else lr.push({segments:$e.segments,sortKey:0,state:Gn})}}Yt&&lr.sort(function(_c,Ds){return _c.sortKey-Ds.sortKey});for(var Si=0,sa=lr;Si<sa.length;Si+=1){var Qa=sa[Si],so=Qa.state,Vo=so.programConfiguration,vs=so.program,zl=so.layoutVertexBuffer,jl=so.indexBuffer,dl=so.uniformValues,Ul=Qa.segments;vs.draw(ce,Se.TRIANGLES,nr,Ye,tr,Qr.disabled,dl,et.id,zl,jl,Ul,et.paint,Z.transform.zoom,Vo)}}}}function gr(Z,ot,et,xt){if(et.paint.get("heatmap-opacity")!==0)if(Z.renderPass==="offscreen"){var Ut=Z.context,fe=Ut.gl,ye=qn.disabled,Yt=new rr([fe.ONE,fe.ONE],t.Color.transparent,[!0,!0,!0,!0]);Or(Ut,Z,et),Ut.clear({color:t.Color.transparent});for(var ce=0;ce<xt.length;ce++){var Se=xt[ce];if(!ot.hasRenderableParent(Se)){var nr=ot.getTile(Se),Ye=nr.getBucket(et);if(Ye){var tr=Ye.programConfigurations.get(et.id),lr=Z.useProgram("heatmap",tr),hr=Z.transform,Ve=hr.zoom;lr.draw(Ut,fe.TRIANGLES,Kn.disabled,ye,Yt,Qr.disabled,wa(Se.posMatrix,nr,Ve,et.paint.get("heatmap-intensity")),et.id,Ye.layoutVertexBuffer,Ye.indexBuffer,Ye.segments,et.paint,Z.transform.zoom,tr)}}}Ut.viewport.set([0,0,Z.width,Z.height])}else Z.renderPass==="translucent"&&(Z.context.setColorMode(Z.colorModeForRenderPass()),ln(Z,et))}function Or(Z,ot,et){var xt=Z.gl;Z.activeTexture.set(xt.TEXTURE1),Z.viewport.set([0,0,ot.width/4,ot.height/4]);var Ut=et.heatmapFbo;if(Ut)xt.bindTexture(xt.TEXTURE_2D,Ut.colorAttachment.get()),Z.bindFramebuffer.set(Ut.framebuffer);else{var fe=xt.createTexture();xt.bindTexture(xt.TEXTURE_2D,fe),xt.texParameteri(xt.TEXTURE_2D,xt.TEXTURE_WRAP_S,xt.CLAMP_TO_EDGE),xt.texParameteri(xt.TEXTURE_2D,xt.TEXTURE_WRAP_T,xt.CLAMP_TO_EDGE),xt.texParameteri(xt.TEXTURE_2D,xt.TEXTURE_MIN_FILTER,xt.LINEAR),xt.texParameteri(xt.TEXTURE_2D,xt.TEXTURE_MAG_FILTER,xt.LINEAR),Ut=et.heatmapFbo=Z.createFramebuffer(ot.width/4,ot.height/4,!1),Dr(Z,ot,fe,Ut)}}function Dr(Z,ot,et,xt){var Ut=Z.gl,fe=Z.extRenderToTextureHalfFloat?Z.extTextureHalfFloat.HALF_FLOAT_OES:Ut.UNSIGNED_BYTE;Ut.texImage2D(Ut.TEXTURE_2D,0,Ut.RGBA,ot.width/4,ot.height/4,0,Ut.RGBA,fe,null),xt.colorAttachment.set(et)}function ln(Z,ot){var et=Z.context,xt=et.gl,Ut=ot.heatmapFbo;if(Ut){et.activeTexture.set(xt.TEXTURE0),xt.bindTexture(xt.TEXTURE_2D,Ut.colorAttachment.get()),et.activeTexture.set(xt.TEXTURE1);var fe=ot.colorRampTexture;fe||(fe=ot.colorRampTexture=new t.Texture(et,ot.colorRamp,xt.RGBA)),fe.bind(xt.LINEAR,xt.CLAMP_TO_EDGE),Z.useProgram("heatmapTexture").draw(et,xt.TRIANGLES,Kn.disabled,qn.disabled,Z.colorModeForRenderPass(),Qr.disabled,Ji(Z,ot,0,1),ot.id,Z.viewportBuffer,Z.quadTriangleIndexBuffer,Z.viewportSegments,ot.paint,Z.transform.zoom)}}function Sn(Z,ot,et,xt){if(Z.renderPass==="translucent"){var Ut=et.paint.get("line-opacity"),fe=et.paint.get("line-width");if(!(Ut.constantOr(1)===0||fe.constantOr(1)===0))for(var ye=Z.depthModeForSublayer(0,Kn.ReadOnly),Yt=Z.colorModeForRenderPass(),ce=et.paint.get("line-dasharray"),Se=et.paint.get("line-pattern"),nr=Se.constantOr(1),Ye=et.paint.get("line-gradient"),tr=et.getCrossfadeParameters(),lr=nr?"linePattern":ce?"lineSDF":Ye?"lineGradient":"line",hr=Z.context,Ve=hr.gl,Xe=!0,$e=0,Cr=xt;$e<Cr.length;$e+=1){var on=Cr[$e],fn=ot.getTile(on);if(!(nr&&!fn.patternsLoaded())){var fi=fn.getBucket(et);if(fi){var si=fi.programConfigurations.get(et.id),Gn=Z.context.program.get(),Mi=Z.useProgram(lr,si),di=Xe||Mi.program!==Gn,Ki=Se.constantOr(null);if(Ki&&fn.imageAtlas){var Ai=fn.imageAtlas,Si=Ai.patternPositions[Ki.to.toString()],sa=Ai.patternPositions[Ki.from.toString()];Si&&sa&&si.setConstantPatternPositions(Si,sa)}var Qa=nr?Hl(Z,fn,et,tr):ce?au(Z,fn,et,ce,tr):Ye?iu(Z,fn,et,fi.lineClipsArray.length):Pl(Z,fn,et);if(nr)hr.activeTexture.set(Ve.TEXTURE0),fn.imageAtlasTexture.bind(Ve.LINEAR,Ve.CLAMP_TO_EDGE),si.updatePaintBuffers(tr);else if(ce&&(di||Z.lineAtlas.dirty))hr.activeTexture.set(Ve.TEXTURE0),Z.lineAtlas.bind(hr);else if(Ye){var so=fi.gradients[et.id],Vo=so.texture;if(et.gradientVersion!==so.version){var vs=256;if(et.stepInterpolant){var zl=ot.getSource().maxzoom,jl=on.canonical.z===zl?Math.ceil(1<<Z.transform.maxZoom-on.canonical.z):1,dl=fi.maxLineLength/t.EXTENT,Ul=1024,_c=dl*Ul*jl;vs=t.clamp(t.nextPowerOfTwo(_c),256,hr.maxTextureSize)}so.gradient=t.renderColorRamp({expression:et.gradientExpression(),evaluationKey:"lineProgress",resolution:vs,image:so.gradient||void 0,clips:fi.lineClipsArray}),so.texture?so.texture.update(so.gradient):so.texture=new t.Texture(hr,so.gradient,Ve.RGBA),so.version=et.gradientVersion,Vo=so.texture}hr.activeTexture.set(Ve.TEXTURE0),Vo.bind(et.stepInterpolant?Ve.NEAREST:Ve.LINEAR,Ve.CLAMP_TO_EDGE)}Mi.draw(hr,Ve.TRIANGLES,ye,Z.stencilModeForClipping(on),Yt,Qr.disabled,Qa,et.id,fi.layoutVertexBuffer,fi.indexBuffer,fi.segments,et.paint,Z.transform.zoom,si,fi.layoutVertexBuffer2),Xe=!1}}}}}function Xt(Z,ot,et,xt){var Ut=et.paint.get("fill-color"),fe=et.paint.get("fill-opacity");if(fe.constantOr(1)!==0){var ye=Z.colorModeForRenderPass(),Yt=et.paint.get("fill-pattern"),ce=Z.opaquePassEnabledForLayer()&&!Yt.constantOr(1)&&Ut.constantOr(t.Color.transparent).a===1&&fe.constantOr(0)===1?"opaque":"translucent";if(Z.renderPass===ce){var Se=Z.depthModeForSublayer(1,Z.renderPass==="opaque"?Kn.ReadWrite:Kn.ReadOnly);ae(Z,ot,et,xt,Se,ye,!1)}if(Z.renderPass==="translucent"&&et.paint.get("fill-antialias")){var nr=Z.depthModeForSublayer(et.getPaintProperty("fill-outline-color")?2:0,Kn.ReadOnly);ae(Z,ot,et,xt,nr,ye,!0)}}}function ae(Z,ot,et,xt,Ut,fe,ye){var Yt=Z.context.gl,ce=et.paint.get("fill-pattern"),Se=ce&&ce.constantOr(1),nr=et.getCrossfadeParameters(),Ye,tr,lr,hr,Ve;ye?(tr=Se&&!et.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Ye=Yt.LINES):(tr=Se?"fillPattern":"fill",Ye=Yt.TRIANGLES);for(var Xe=0,$e=xt;Xe<$e.length;Xe+=1){var Cr=$e[Xe],on=ot.getTile(Cr);if(!(Se&&!on.patternsLoaded())){var fn=on.getBucket(et);if(fn){var fi=fn.programConfigurations.get(et.id),si=Z.useProgram(tr,fi);Se&&(Z.context.activeTexture.set(Yt.TEXTURE0),on.imageAtlasTexture.bind(Yt.LINEAR,Yt.CLAMP_TO_EDGE),fi.updatePaintBuffers(nr));var Gn=ce.constantOr(null);if(Gn&&on.imageAtlas){var Mi=on.imageAtlas,di=Mi.patternPositions[Gn.to.toString()],Ki=Mi.patternPositions[Gn.from.toString()];di&&Ki&&fi.setConstantPatternPositions(di,Ki)}var Ai=Z.translatePosMatrix(Cr.posMatrix,on,et.paint.get("fill-translate"),et.paint.get("fill-translate-anchor"));if(!ye)hr=fn.indexBuffer,Ve=fn.segments,lr=Se?df(Ai,Z,nr,on):xh(Ai);else{hr=fn.indexBuffer2,Ve=fn.segments2;var Si=[Yt.drawingBufferWidth,Yt.drawingBufferHeight];lr=tr==="fillOutlinePattern"&&Se?qf(Ai,Z,nr,on,Si):_h(Ai,Si)}si.draw(Z.context,Ye,Ut,Z.stencilModeForClipping(Cr),fe,Qr.disabled,lr,et.id,fn.layoutVertexBuffer,hr,Ve,et.paint,Z.transform.zoom,fi)}}}}function xe(Z,ot,et,xt){var Ut=et.paint.get("fill-extrusion-opacity");if(Ut!==0&&Z.renderPass==="translucent"){var fe=new Kn(Z.context.gl.LEQUAL,Kn.ReadWrite,Z.depthRangeFor3D);if(Ut===1&&!et.paint.get("fill-extrusion-pattern").constantOr(1)){var ye=Z.colorModeForRenderPass();Ae(Z,ot,et,xt,fe,qn.disabled,ye)}else Ae(Z,ot,et,xt,fe,qn.disabled,rr.disabled),Ae(Z,ot,et,xt,fe,Z.stencilModeFor3D(),Z.colorModeForRenderPass())}}function Ae(Z,ot,et,xt,Ut,fe,ye){for(var Yt=Z.context,ce=Yt.gl,Se=et.paint.get("fill-extrusion-pattern"),nr=Se.constantOr(1),Ye=et.getCrossfadeParameters(),tr=et.paint.get("fill-extrusion-opacity"),lr=0,hr=xt;lr<hr.length;lr+=1){var Ve=hr[lr],Xe=ot.getTile(Ve),$e=Xe.getBucket(et);if($e){var Cr=$e.programConfigurations.get(et.id),on=Z.useProgram(nr?"fillExtrusionPattern":"fillExtrusion",Cr);nr&&(Z.context.activeTexture.set(ce.TEXTURE0),Xe.imageAtlasTexture.bind(ce.LINEAR,ce.CLAMP_TO_EDGE),Cr.updatePaintBuffers(Ye));var fn=Se.constantOr(null);if(fn&&Xe.imageAtlas){var fi=Xe.imageAtlas,si=fi.patternPositions[fn.to.toString()],Gn=fi.patternPositions[fn.from.toString()];si&&Gn&&Cr.setConstantPatternPositions(si,Gn)}var Mi=Z.translatePosMatrix(Ve.posMatrix,Xe,et.paint.get("fill-extrusion-translate"),et.paint.get("fill-extrusion-translate-anchor")),di=et.paint.get("fill-extrusion-vertical-gradient"),Ki=nr?eh(Mi,Z,di,tr,Ve,Ye,Xe):Jf(Mi,Z,di,tr);on.draw(Yt,Yt.gl.TRIANGLES,Ut,fe,ye,Qr.backCCW,Ki,et.id,$e.layoutVertexBuffer,$e.indexBuffer,$e.segments,et.paint,Z.transform.zoom,Cr)}}}function je(Z,ot,et,xt){if(!(Z.renderPass!=="offscreen"&&Z.renderPass!=="translucent")){for(var Ut=Z.context,fe=Z.depthModeForSublayer(0,Kn.ReadOnly),ye=Z.colorModeForRenderPass(),Yt=Z.renderPass==="translucent"?Z.stencilConfigForOverlap(xt):[{},xt],ce=Yt[0],Se=Yt[1],nr=0,Ye=Se;nr<Ye.length;nr+=1){var tr=Ye[nr],lr=ot.getTile(tr);lr.needsHillshadePrepare&&Z.renderPass==="offscreen"?Ze(Z,lr,et,fe,qn.disabled,ye):Z.renderPass==="translucent"&&Ie(Z,lr,et,fe,ce[tr.overscaledZ],ye)}Ut.viewport.set([0,0,Z.width,Z.height])}}function Ie(Z,ot,et,xt,Ut,fe){var ye=Z.context,Yt=ye.gl,ce=ot.fbo;if(ce){var Se=Z.useProgram("hillshade");ye.activeTexture.set(Yt.TEXTURE0),Yt.bindTexture(Yt.TEXTURE_2D,ce.colorAttachment.get());var nr=Zo(Z,ot,et);Se.draw(ye,Yt.TRIANGLES,xt,Ut,fe,Qr.disabled,nr,et.id,Z.rasterBoundsBuffer,Z.quadTriangleIndexBuffer,Z.rasterBoundsSegments)}}function Ze(Z,ot,et,xt,Ut,fe){var ye=Z.context,Yt=ye.gl,ce=ot.dem;if(ce&&ce.data){var Se=ce.dim,nr=ce.stride,Ye=ce.getPixels();if(ye.activeTexture.set(Yt.TEXTURE1),ye.pixelStoreUnpackPremultiplyAlpha.set(!1),ot.demTexture=ot.demTexture||Z.getTileTexture(nr),ot.demTexture){var tr=ot.demTexture;tr.update(Ye,{premultiply:!1}),tr.bind(Yt.NEAREST,Yt.CLAMP_TO_EDGE)}else ot.demTexture=new t.Texture(ye,Ye,Yt.RGBA,{premultiply:!1}),ot.demTexture.bind(Yt.NEAREST,Yt.CLAMP_TO_EDGE);ye.activeTexture.set(Yt.TEXTURE0);var lr=ot.fbo;if(!lr){var hr=new t.Texture(ye,{width:Se,height:Se,data:null},Yt.RGBA);hr.bind(Yt.LINEAR,Yt.CLAMP_TO_EDGE),lr=ot.fbo=ye.createFramebuffer(Se,Se,!0),lr.colorAttachment.set(hr.texture)}ye.bindFramebuffer.set(lr.framebuffer),ye.viewport.set([0,0,Se,Se]),Z.useProgram("hillshadePrepare").draw(ye,Yt.TRIANGLES,xt,Ut,fe,Qr.disabled,os(ot.tileID,ce),et.id,Z.rasterBoundsBuffer,Z.quadTriangleIndexBuffer,Z.rasterBoundsSegments),ot.needsHillshadePrepare=!1}}function wr(Z,ot,et,xt){if(Z.renderPass==="translucent"&&et.paint.get("raster-opacity")!==0&&xt.length)for(var Ut=Z.context,fe=Ut.gl,ye=ot.getSource(),Yt=Z.useProgram("raster"),ce=Z.colorModeForRenderPass(),Se=ye instanceof pt?[{},xt]:Z.stencilConfigForOverlap(xt),nr=Se[0],Ye=Se[1],tr=Ye[Ye.length-1].overscaledZ,lr=!Z.options.moving,hr=0,Ve=Ye;hr<Ve.length;hr+=1){var Xe=Ve[hr],$e=Z.depthModeForSublayer(Xe.overscaledZ-tr,et.paint.get("raster-opacity")===1?Kn.ReadWrite:Kn.ReadOnly,fe.LESS),Cr=ot.getTile(Xe),on=Z.transform.calculatePosMatrix(Xe.toUnwrapped(),lr);Cr.registerFadeDuration(et.paint.get("raster-fade-duration"));var fn=ot.findLoadedParent(Xe,0),fi=Ir(Cr,fn,ot,et,Z.transform),si=void 0,Gn=void 0,Mi=et.paint.get("raster-resampling")==="nearest"?fe.NEAREST:fe.LINEAR;Ut.activeTexture.set(fe.TEXTURE0),Cr.texture.bind(Mi,fe.CLAMP_TO_EDGE,fe.LINEAR_MIPMAP_NEAREST),Ut.activeTexture.set(fe.TEXTURE1),fn?(fn.texture.bind(Mi,fe.CLAMP_TO_EDGE,fe.LINEAR_MIPMAP_NEAREST),si=Math.pow(2,fn.tileID.overscaledZ-Cr.tileID.overscaledZ),Gn=[Cr.tileID.canonical.x*si%1,Cr.tileID.canonical.y*si%1]):Cr.texture.bind(Mi,fe.CLAMP_TO_EDGE,fe.LINEAR_MIPMAP_NEAREST);var di=uu(on,Gn||[0,0],si||1,fi,et);ye instanceof pt?Yt.draw(Ut,fe.TRIANGLES,$e,qn.disabled,ce,Qr.disabled,di,et.id,ye.boundsBuffer,Z.quadTriangleIndexBuffer,ye.boundsSegments):Yt.draw(Ut,fe.TRIANGLES,$e,nr[Xe.overscaledZ],ce,Qr.disabled,di,et.id,Z.rasterBoundsBuffer,Z.quadTriangleIndexBuffer,Z.rasterBoundsSegments)}}function Ir(Z,ot,et,xt,Ut){var fe=xt.paint.get("raster-fade-duration");if(fe>0){var ye=t.browser.now(),Yt=(ye-Z.timeAdded)/fe,ce=ot?(ye-ot.timeAdded)/fe:-1,Se=et.getSource(),nr=Ut.coveringZoomLevel({tileSize:Se.tileSize,roundZoom:Se.roundZoom}),Ye=!ot||Math.abs(ot.tileID.overscaledZ-nr)>Math.abs(Z.tileID.overscaledZ-nr),tr=Ye&&Z.refreshedUponExpiration?1:t.clamp(Ye?Yt:1-ce,0,1);return Z.refreshedUponExpiration&&Yt>=1&&(Z.refreshedUponExpiration=!1),ot?{opacity:1,mix:1-tr}:{opacity:tr,mix:0}}else return{opacity:1,mix:0}}function Nr(Z,ot,et){var xt=et.paint.get("background-color"),Ut=et.paint.get("background-opacity");if(Ut!==0){var fe=Z.context,ye=fe.gl,Yt=Z.transform,ce=Yt.tileSize,Se=et.paint.get("background-pattern");if(!Z.isPatternMissing(Se)){var nr=!Se&&xt.a===1&&Ut===1&&Z.opaquePassEnabledForLayer()?"opaque":"translucent";if(Z.renderPass===nr){var Ye=qn.disabled,tr=Z.depthModeForSublayer(0,nr==="opaque"?Kn.ReadWrite:Kn.ReadOnly),lr=Z.colorModeForRenderPass(),hr=Z.useProgram(Se?"backgroundPattern":"background"),Ve=Yt.coveringTiles({tileSize:ce});Se&&(fe.activeTexture.set(ye.TEXTURE0),Z.imageManager.bind(Z.context));for(var Xe=et.getCrossfadeParameters(),$e=0,Cr=Ve;$e<Cr.length;$e+=1){var on=Cr[$e],fn=Z.transform.calculatePosMatrix(on.toUnwrapped()),fi=Se?es(fn,Ut,Z,Se,{tileID:on,tileSize:ce},Xe):Ih(fn,Ut,xt);hr.draw(fe,ye.TRIANGLES,tr,Ye,lr,Qr.disabled,fi,et.id,Z.tileExtentBuffer,Z.quadTriangleIndexBuffer,Z.tileExtentSegments)}}}}}var tn=new t.Color(1,0,0,1),mn=new t.Color(0,1,0,1),zn=new t.Color(0,0,1,1),Bn=new t.Color(1,0,1,1),ri=new t.Color(0,1,1,1);function Fi(Z){var ot=Z.transform.padding,et=3;ha(Z,Z.transform.height-(ot.top||0),et,tn),ha(Z,ot.bottom||0,et,mn),ka(Z,ot.left||0,et,zn),ka(Z,Z.transform.width-(ot.right||0),et,Bn);var xt=Z.transform.centerPoint;da(Z,xt.x,Z.transform.height-xt.y,ri)}function da(Z,ot,et,xt){var Ut=20,fe=2;io(Z,ot-fe/2,et-Ut/2,fe,Ut,xt),io(Z,ot-Ut/2,et-fe/2,Ut,fe,xt)}function ha(Z,ot,et,xt){io(Z,0,ot+et/2,Z.transform.width,et,xt)}function ka(Z,ot,et,xt){io(Z,ot-et/2,0,et,Z.transform.height,xt)}function io(Z,ot,et,xt,Ut,fe){var ye=Z.context,Yt=ye.gl;Yt.enable(Yt.SCISSOR_TEST),Yt.scissor(ot*t.browser.devicePixelRatio,et*t.browser.devicePixelRatio,xt*t.browser.devicePixelRatio,Ut*t.browser.devicePixelRatio),ye.clear({color:fe}),Yt.disable(Yt.SCISSOR_TEST)}function Ro(Z,ot,et){for(var xt=0;xt<et.length;xt++)Mo(Z,ot,et[xt])}function Mo(Z,ot,et){var xt=Z.context,Ut=xt.gl,fe=et.posMatrix,ye=Z.useProgram("debug"),Yt=Kn.disabled,ce=qn.disabled,Se=Z.colorModeForRenderPass(),nr="$debug";xt.activeTexture.set(Ut.TEXTURE0),Z.emptyTexture.bind(Ut.LINEAR,Ut.CLAMP_TO_EDGE),ye.draw(xt,Ut.LINE_STRIP,Yt,ce,Se,Qr.disabled,ga(fe,t.Color.red),nr,Z.debugBuffer,Z.tileBorderIndexBuffer,Z.debugSegments);var Ye=ot.getTileByID(et.key).latestRawTileData,tr=Ye&&Ye.byteLength||0,lr=Math.floor(tr/1024),hr=ot.getTile(et).tileSize,Ve=512/Math.min(hr,512)*(et.overscaledZ/Z.transform.zoom)*.5,Xe=et.canonical.toString();et.overscaledZ!==et.canonical.z&&(Xe+=" => "+et.overscaledZ);var $e=Xe+" "+lr+"kb";hs(Z,$e),ye.draw(xt,Ut.TRIANGLES,Yt,ce,rr.alphaBlended,Qr.disabled,ga(fe,t.Color.transparent,Ve),nr,Z.debugBuffer,Z.quadTriangleIndexBuffer,Z.debugSegments)}function hs(Z,ot){Z.initDebugOverlayCanvas();var et=Z.debugOverlayCanvas,xt=Z.context.gl,Ut=Z.debugOverlayCanvas.getContext("2d");Ut.clearRect(0,0,et.width,et.height),Ut.shadowColor="white",Ut.shadowBlur=2,Ut.lineWidth=1.5,Ut.strokeStyle="white",Ut.textBaseline="top",Ut.font="bold 36px Open Sans, sans-serif",Ut.fillText(ot,5,5),Ut.strokeText(ot,5,5),Z.debugOverlayTexture.update(et),Z.debugOverlayTexture.bind(xt.LINEAR,xt.CLAMP_TO_EDGE)}function hl(Z,ot,et){var xt=Z.context,Ut=et.implementation;if(Z.renderPass==="offscreen"){var fe=Ut.prerender;fe&&(Z.setCustomLayerDefaults(),xt.setColorMode(Z.colorModeForRenderPass()),fe.call(Ut,xt.gl,Z.transform.customLayerMatrix()),xt.setDirty(),Z.setBaseState())}else if(Z.renderPass==="translucent"){Z.setCustomLayerDefaults(),xt.setColorMode(Z.colorModeForRenderPass()),xt.setStencilMode(qn.disabled);var ye=Ut.renderingMode==="3d"?new Kn(Z.context.gl.LEQUAL,Kn.ReadWrite,Z.depthRangeFor3D):Z.depthModeForSublayer(0,Kn.ReadOnly);xt.setDepthMode(ye),Ut.render(xt.gl,Z.transform.customLayerMatrix()),xt.setDirty(),Z.setBaseState(),xt.bindFramebuffer.set(null)}}var vl={symbol:I,circle:Ke,heatmap:gr,line:Sn,fill:Xt,"fill-extrusion":xe,hillshade:je,raster:wr,background:Nr,debug:Ro,custom:hl},Os=function(Z,ot){this.context=new Cn(Z),this.transform=ot,this._tileTextures={},this.setup(),this.numSublayers=wn.maxUnderzooming+wn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Gu,this.gpuTimers={}};Os.prototype.resize=function(Z,ot){if(this.width=Z*t.browser.devicePixelRatio,this.height=ot*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var et=0,xt=this.style._order;et<xt.length;et+=1){var Ut=xt[et];this.style._layers[Ut].resize()}},Os.prototype.setup=function(){var Z=this.context,ot=new t.StructArrayLayout2i4;ot.emplaceBack(0,0),ot.emplaceBack(t.EXTENT,0),ot.emplaceBack(0,t.EXTENT),ot.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=Z.createVertexBuffer(ot,ph.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var et=new t.StructArrayLayout2i4;et.emplaceBack(0,0),et.emplaceBack(t.EXTENT,0),et.emplaceBack(0,t.EXTENT),et.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=Z.createVertexBuffer(et,ph.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var xt=new t.StructArrayLayout4i8;xt.emplaceBack(0,0,0,0),xt.emplaceBack(t.EXTENT,0,t.EXTENT,0),xt.emplaceBack(0,t.EXTENT,0,t.EXTENT),xt.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=Z.createVertexBuffer(xt,yt.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var Ut=new t.StructArrayLayout2i4;Ut.emplaceBack(0,0),Ut.emplaceBack(1,0),Ut.emplaceBack(0,1),Ut.emplaceBack(1,1),this.viewportBuffer=Z.createVertexBuffer(Ut,ph.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var fe=new t.StructArrayLayout1ui2;fe.emplaceBack(0),fe.emplaceBack(1),fe.emplaceBack(3),fe.emplaceBack(2),fe.emplaceBack(0),this.tileBorderIndexBuffer=Z.createIndexBuffer(fe);var ye=new t.StructArrayLayout3ui6;ye.emplaceBack(0,1,2),ye.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=Z.createIndexBuffer(ye),this.emptyTexture=new t.Texture(Z,{width:1,height:1,data:new Uint8Array([0,0,0,0])},Z.gl.RGBA);var Yt=this.context.gl;this.stencilClearMode=new qn({func:Yt.ALWAYS,mask:0},0,255,Yt.ZERO,Yt.ZERO,Yt.ZERO)},Os.prototype.clearStencil=function(){var Z=this.context,ot=Z.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var et=t.create();t.ortho(et,0,this.width,this.height,0,0,1),t.scale(et,et,[ot.drawingBufferWidth,ot.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(Z,ot.TRIANGLES,Kn.disabled,this.stencilClearMode,rr.disabled,Qr.disabled,$a(et),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Os.prototype._renderTileClippingMasks=function(Z,ot){if(!(this.currentStencilSource===Z.source||!Z.isTileClipped()||!ot||!ot.length)){this.currentStencilSource=Z.source;var et=this.context,xt=et.gl;this.nextStencilID+ot.length>256&&this.clearStencil(),et.setColorMode(rr.disabled),et.setDepthMode(Kn.disabled);var Ut=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var fe=0,ye=ot;fe<ye.length;fe+=1){var Yt=ye[fe],ce=this._tileClippingMaskIDs[Yt.key]=this.nextStencilID++;Ut.draw(et,xt.TRIANGLES,Kn.disabled,new qn({func:xt.ALWAYS,mask:0},ce,255,xt.KEEP,xt.KEEP,xt.REPLACE),rr.disabled,Qr.disabled,$a(Yt.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Os.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var Z=this.nextStencilID++,ot=this.context.gl;return new qn({func:ot.NOTEQUAL,mask:255},Z,255,ot.KEEP,ot.KEEP,ot.REPLACE)},Os.prototype.stencilModeForClipping=function(Z){var ot=this.context.gl;return new qn({func:ot.EQUAL,mask:255},this._tileClippingMaskIDs[Z.key],0,ot.KEEP,ot.KEEP,ot.REPLACE)},Os.prototype.stencilConfigForOverlap=function(Z){var ot,et=this.context.gl,xt=Z.sort(function(ce,Se){return Se.overscaledZ-ce.overscaledZ}),Ut=xt[xt.length-1].overscaledZ,fe=xt[0].overscaledZ-Ut+1;if(fe>1){this.currentStencilSource=void 0,this.nextStencilID+fe>256&&this.clearStencil();for(var ye={},Yt=0;Yt<fe;Yt++)ye[Yt+Ut]=new qn({func:et.GEQUAL,mask:255},Yt+this.nextStencilID,255,et.KEEP,et.KEEP,et.REPLACE);return this.nextStencilID+=fe,[ye,xt]}return[(ot={},ot[Ut]=qn.disabled,ot),xt]},Os.prototype.colorModeForRenderPass=function(){var Z=this.context.gl;if(this._showOverdrawInspector){var ot=8,et=1/ot;return new rr([Z.CONSTANT_COLOR,Z.ONE],new t.Color(et,et,et,0),[!0,!0,!0,!0])}else return this.renderPass==="opaque"?rr.unblended:rr.alphaBlended},Os.prototype.depthModeForSublayer=function(Z,ot,et){if(!this.opaquePassEnabledForLayer())return Kn.disabled;var xt=1-((1+this.currentLayer)*this.numSublayers+Z)*this.depthEpsilon;return new Kn(et||this.context.gl.LEQUAL,ot,[xt,xt])},Os.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Os.prototype.render=function(Z,ot){var et=this;this.style=Z,this.options=ot,this.lineAtlas=Z.lineAtlas,this.imageManager=Z.imageManager,this.glyphManager=Z.glyphManager,this.symbolFadeChange=Z.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var xt=this.style._order,Ut=this.style.sourceCaches;for(var fe in Ut){var ye=Ut[fe];ye.used&&ye.prepare(this.context)}var Yt={},ce={},Se={};for(var nr in Ut){var Ye=Ut[nr];Yt[nr]=Ye.getVisibleCoordinates(),ce[nr]=Yt[nr].slice().reverse(),Se[nr]=Ye.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var tr=0;tr<xt.length;tr++){var lr=xt[tr];if(this.style._layers[lr].is3D()){this.opaquePassCutoff=tr;break}}this.renderPass="offscreen";for(var hr=0,Ve=xt;hr<Ve.length;hr+=1){var Xe=Ve[hr],$e=this.style._layers[Xe];if(!(!$e.hasOffscreenPass()||$e.isHidden(this.transform.zoom))){var Cr=ce[$e.source];$e.type!=="custom"&&!Cr.length||this.renderLayer(this,Ut[$e.source],$e,Cr)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:ot.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=ot.showOverdrawInspector,this.depthRangeFor3D=[0,1-(Z._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=xt.length-1;this.currentLayer>=0;this.currentLayer--){var on=this.style._layers[xt[this.currentLayer]],fn=Ut[on.source],fi=Yt[on.source];this._renderTileClippingMasks(on,fi),this.renderLayer(this,fn,on,fi)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<xt.length;this.currentLayer++){var si=this.style._layers[xt[this.currentLayer]],Gn=Ut[si.source],Mi=(si.type==="symbol"?Se:ce)[si.source];this._renderTileClippingMasks(si,Yt[si.source]),this.renderLayer(this,Gn,si,Mi)}if(this.options.showTileBoundaries){var di,Ki,Ai=t.values(this.style._layers);Ai.forEach(function(Si){Si.source&&!Si.isHidden(et.transform.zoom)&&(Si.source!==(Ki&&Ki.id)&&(Ki=et.style.sourceCaches[Si.source]),(!di||di.getSource().maxzoom<Ki.getSource().maxzoom)&&(di=Ki))}),di&&vl.debug(this,di,di.getVisibleCoordinates())}this.options.showPadding&&Fi(this),this.context.setDefault()},Os.prototype.renderLayer=function(Z,ot,et,xt){et.isHidden(this.transform.zoom)||et.type!=="background"&&et.type!=="custom"&&!xt.length||(this.id=et.id,this.gpuTimingStart(et),vl[et.type](Z,ot,et,xt,this.style.placement.variableOffsets),this.gpuTimingEnd())},Os.prototype.gpuTimingStart=function(Z){if(this.options.gpuTiming){var ot=this.context.extTimerQuery,et=this.gpuTimers[Z.id];et||(et=this.gpuTimers[Z.id]={calls:0,cpuTime:0,query:ot.createQueryEXT()}),et.calls++,ot.beginQueryEXT(ot.TIME_ELAPSED_EXT,et.query)}},Os.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var Z=this.context.extTimerQuery;Z.endQueryEXT(Z.TIME_ELAPSED_EXT)}},Os.prototype.collectGpuTimers=function(){var Z=this.gpuTimers;return this.gpuTimers={},Z},Os.prototype.queryGpuTimers=function(Z){var ot={};for(var et in Z){var xt=Z[et],Ut=this.context.extTimerQuery,fe=Ut.getQueryObjectEXT(xt.query,Ut.QUERY_RESULT_EXT)/(1e3*1e3);Ut.deleteQueryEXT(xt.query),ot[et]=fe}return ot},Os.prototype.translatePosMatrix=function(Z,ot,et,xt,Ut){if(!et[0]&&!et[1])return Z;var fe=Ut?xt==="map"?this.transform.angle:0:xt==="viewport"?-this.transform.angle:0;if(fe){var ye=Math.sin(fe),Yt=Math.cos(fe);et=[et[0]*Yt-et[1]*ye,et[0]*ye+et[1]*Yt]}var ce=[Ut?et[0]:Js(ot,et[0],this.transform.zoom),Ut?et[1]:Js(ot,et[1],this.transform.zoom),0],Se=new Float32Array(16);return t.translate(Se,Z,ce),Se},Os.prototype.saveTileTexture=function(Z){var ot=this._tileTextures[Z.size[0]];ot?ot.push(Z):this._tileTextures[Z.size[0]]=[Z]},Os.prototype.getTileTexture=function(Z){var ot=this._tileTextures[Z];return ot&&ot.length>0?ot.pop():null},Os.prototype.isPatternMissing=function(Z){if(!Z)return!1;if(!Z.from||!Z.to)return!0;var ot=this.imageManager.getPattern(Z.from.toString()),et=this.imageManager.getPattern(Z.to.toString());return!ot||!et},Os.prototype.useProgram=function(Z,ot){this.cache=this.cache||{};var et=""+Z+(ot?ot.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[et]||(this.cache[et]=new rf(this.context,Z,bf[Z],ot,zs[Z],this._showOverdrawInspector)),this.cache[et]},Os.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()},Os.prototype.setBaseState=function(){var 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)},Os.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var Z=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,Z.RGBA)}},Os.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var bl=function(Z,ot){this.points=Z,this.planes=ot};bl.fromInvProjectionMatrix=function(Z,ot,et){var xt=[[-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]],Ut=Math.pow(2,et),fe=xt.map(function(ce){return t.transformMat4([],ce,Z)}).map(function(ce){return t.scale$1([],ce,1/ce[3]/ot*Ut)}),ye=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],Yt=ye.map(function(ce){var Se=t.sub([],fe[ce[0]],fe[ce[1]]),nr=t.sub([],fe[ce[2]],fe[ce[1]]),Ye=t.normalize([],t.cross([],Se,nr)),tr=-t.dot(Ye,fe[ce[1]]);return Ye.concat(tr)});return new bl(fe,Yt)};var Su=function(Z,ot){this.min=Z,this.max=ot,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Su.prototype.quadrant=function(Z){for(var ot=[Z%2===0,Z<2],et=t.clone$2(this.min),xt=t.clone$2(this.max),Ut=0;Ut<ot.length;Ut++)et[Ut]=ot[Ut]?this.min[Ut]:this.center[Ut],xt[Ut]=ot[Ut]?this.center[Ut]:this.max[Ut];return xt[2]=this.max[2],new Su(et,xt)},Su.prototype.distanceX=function(Z){var ot=Math.max(Math.min(this.max[0],Z[0]),this.min[0]);return ot-Z[0]},Su.prototype.distanceY=function(Z){var ot=Math.max(Math.min(this.max[1],Z[1]),this.min[1]);return ot-Z[1]},Su.prototype.intersects=function(Z){for(var ot=[[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]],et=!0,xt=0;xt<Z.planes.length;xt++){for(var Ut=Z.planes[xt],fe=0,ye=0;ye<ot.length;ye++)fe+=t.dot$1(Ut,ot[ye])>=0;if(fe===0)return 0;fe!==ot.length&&(et=!1)}if(et)return 2;for(var Yt=0;Yt<3;Yt++){for(var ce=Number.MAX_VALUE,Se=-Number.MAX_VALUE,nr=0;nr<Z.points.length;nr++){var Ye=Z.points[nr][Yt]-this.min[Yt];ce=Math.min(ce,Ye),Se=Math.max(Se,Ye)}if(Se<0||ce>this.max[Yt]-this.min[Yt])return 0}return 1};var mu=function(Z,ot,et,xt){if(Z===void 0&&(Z=0),ot===void 0&&(ot=0),et===void 0&&(et=0),xt===void 0&&(xt=0),isNaN(Z)||Z<0||isNaN(ot)||ot<0||isNaN(et)||et<0||isNaN(xt)||xt<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=Z,this.bottom=ot,this.left=et,this.right=xt};mu.prototype.interpolate=function(Z,ot,et){return ot.top!=null&&Z.top!=null&&(this.top=t.number(Z.top,ot.top,et)),ot.bottom!=null&&Z.bottom!=null&&(this.bottom=t.number(Z.bottom,ot.bottom,et)),ot.left!=null&&Z.left!=null&&(this.left=t.number(Z.left,ot.left,et)),ot.right!=null&&Z.right!=null&&(this.right=t.number(Z.right,ot.right,et)),this},mu.prototype.getCenter=function(Z,ot){var et=t.clamp((this.left+Z-this.right)/2,0,Z),xt=t.clamp((this.top+ot-this.bottom)/2,0,ot);return new t.Point(et,xt)},mu.prototype.equals=function(Z){return this.top===Z.top&&this.bottom===Z.bottom&&this.left===Z.left&&this.right===Z.right},mu.prototype.clone=function(){return new mu(this.top,this.bottom,this.left,this.right)},mu.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Ws=function(Z,ot,et,xt,Ut){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Ut===void 0?!0:Ut,this._minZoom=Z||0,this._maxZoom=ot||22,this._minPitch=et??0,this._maxPitch=xt??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 mu,this._posMatrixCache={},this._alignedPosMatrixCache={}},qs={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}};Ws.prototype.clone=function(){var Z=new Ws(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return Z.tileSize=this.tileSize,Z.latRange=this.latRange,Z.width=this.width,Z.height=this.height,Z._center=this._center,Z.zoom=this.zoom,Z.angle=this.angle,Z._fov=this._fov,Z._pitch=this._pitch,Z._unmodified=this._unmodified,Z._edgeInsets=this._edgeInsets.clone(),Z._calcMatrices(),Z},qs.minZoom.get=function(){return this._minZoom},qs.minZoom.set=function(Z){this._minZoom!==Z&&(this._minZoom=Z,this.zoom=Math.max(this.zoom,Z))},qs.maxZoom.get=function(){return this._maxZoom},qs.maxZoom.set=function(Z){this._maxZoom!==Z&&(this._maxZoom=Z,this.zoom=Math.min(this.zoom,Z))},qs.minPitch.get=function(){return this._minPitch},qs.minPitch.set=function(Z){this._minPitch!==Z&&(this._minPitch=Z,this.pitch=Math.max(this.pitch,Z))},qs.maxPitch.get=function(){return this._maxPitch},qs.maxPitch.set=function(Z){this._maxPitch!==Z&&(this._maxPitch=Z,this.pitch=Math.min(this.pitch,Z))},qs.renderWorldCopies.get=function(){return this._renderWorldCopies},qs.renderWorldCopies.set=function(Z){Z===void 0?Z=!0:Z===null&&(Z=!1),this._renderWorldCopies=Z},qs.worldSize.get=function(){return this.tileSize*this.scale},qs.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},qs.size.get=function(){return new t.Point(this.width,this.height)},qs.bearing.get=function(){return-this.angle/Math.PI*180},qs.bearing.set=function(Z){var ot=-t.wrap(Z,-180,180)*Math.PI/180;this.angle!==ot&&(this._unmodified=!1,this.angle=ot,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},qs.pitch.get=function(){return this._pitch/Math.PI*180},qs.pitch.set=function(Z){var ot=t.clamp(Z,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ot&&(this._unmodified=!1,this._pitch=ot,this._calcMatrices())},qs.fov.get=function(){return this._fov/Math.PI*180},qs.fov.set=function(Z){Z=Math.max(.01,Math.min(60,Z)),this._fov!==Z&&(this._unmodified=!1,this._fov=Z/180*Math.PI,this._calcMatrices())},qs.zoom.get=function(){return this._zoom},qs.zoom.set=function(Z){var ot=Math.min(Math.max(Z,this.minZoom),this.maxZoom);this._zoom!==ot&&(this._unmodified=!1,this._zoom=ot,this.scale=this.zoomScale(ot),this.tileZoom=Math.floor(ot),this.zoomFraction=ot-this.tileZoom,this._constrain(),this._calcMatrices())},qs.center.get=function(){return this._center},qs.center.set=function(Z){Z.lat===this._center.lat&&Z.lng===this._center.lng||(this._unmodified=!1,this._center=Z,this._constrain(),this._calcMatrices())},qs.padding.get=function(){return this._edgeInsets.toJSON()},qs.padding.set=function(Z){this._edgeInsets.equals(Z)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,Z,1),this._calcMatrices())},qs.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Ws.prototype.isPaddingEqual=function(Z){return this._edgeInsets.equals(Z)},Ws.prototype.interpolatePadding=function(Z,ot,et){this._unmodified=!1,this._edgeInsets.interpolate(Z,ot,et),this._constrain(),this._calcMatrices()},Ws.prototype.coveringZoomLevel=function(Z){var ot=(Z.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/Z.tileSize));return Math.max(0,ot)},Ws.prototype.getVisibleUnwrappedCoordinates=function(Z){var ot=[new t.UnwrappedTileID(0,Z)];if(this._renderWorldCopies)for(var et=this.pointCoordinate(new t.Point(0,0)),xt=this.pointCoordinate(new t.Point(this.width,0)),Ut=this.pointCoordinate(new t.Point(this.width,this.height)),fe=this.pointCoordinate(new t.Point(0,this.height)),ye=Math.floor(Math.min(et.x,xt.x,Ut.x,fe.x)),Yt=Math.floor(Math.max(et.x,xt.x,Ut.x,fe.x)),ce=1,Se=ye-ce;Se<=Yt+ce;Se++)Se!==0&&ot.push(new t.UnwrappedTileID(Se,Z));return ot},Ws.prototype.coveringTiles=function(Z){var ot=this.coveringZoomLevel(Z),et=ot;if(Z.minzoom!==void 0&&ot<Z.minzoom)return[];Z.maxzoom!==void 0&&ot>Z.maxzoom&&(ot=Z.maxzoom);var xt=t.MercatorCoordinate.fromLngLat(this.center),Ut=Math.pow(2,ot),fe=[Ut*xt.x,Ut*xt.y,0],ye=bl.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,ot),Yt=Z.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(Yt=ot);var ce=3,Se=function(Ai){return{aabb:new Su([Ai*Ut,0,0],[(Ai+1)*Ut,Ut,0]),zoom:0,x:0,y:0,wrap:Ai,fullyVisible:!1}},nr=[],Ye=[],tr=ot,lr=Z.reparseOverscaled?et:ot;if(this._renderWorldCopies)for(var hr=1;hr<=3;hr++)nr.push(Se(-hr)),nr.push(Se(hr));for(nr.push(Se(0));nr.length>0;){var Ve=nr.pop(),Xe=Ve.x,$e=Ve.y,Cr=Ve.fullyVisible;if(!Cr){var on=Ve.aabb.intersects(ye);if(on===0)continue;Cr=on===2}var fn=Ve.aabb.distanceX(fe),fi=Ve.aabb.distanceY(fe),si=Math.max(Math.abs(fn),Math.abs(fi)),Gn=ce+(1<<tr-Ve.zoom)-2;if(Ve.zoom===tr||si>Gn&&Ve.zoom>=Yt){Ye.push({tileID:new t.OverscaledTileID(Ve.zoom===tr?lr:Ve.zoom,Ve.wrap,Ve.zoom,Xe,$e),distanceSq:t.sqrLen([fe[0]-.5-Xe,fe[1]-.5-$e])});continue}for(var Mi=0;Mi<4;Mi++){var di=(Xe<<1)+Mi%2,Ki=($e<<1)+(Mi>>1);nr.push({aabb:Ve.aabb.quadrant(Mi),zoom:Ve.zoom+1,x:di,y:Ki,wrap:Ve.wrap,fullyVisible:Cr})}}return Ye.sort(function(Ai,Si){return Ai.distanceSq-Si.distanceSq}).map(function(Ai){return Ai.tileID})},Ws.prototype.resize=function(Z,ot){this.width=Z,this.height=ot,this.pixelsToGLUnits=[2/Z,-2/ot],this._constrain(),this._calcMatrices()},qs.unmodified.get=function(){return this._unmodified},Ws.prototype.zoomScale=function(Z){return Math.pow(2,Z)},Ws.prototype.scaleZoom=function(Z){return Math.log(Z)/Math.LN2},Ws.prototype.project=function(Z){var ot=t.clamp(Z.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(Z.lng)*this.worldSize,t.mercatorYfromLat(ot)*this.worldSize)},Ws.prototype.unproject=function(Z){return new t.MercatorCoordinate(Z.x/this.worldSize,Z.y/this.worldSize).toLngLat()},qs.point.get=function(){return this.project(this.center)},Ws.prototype.setLocationAtPoint=function(Z,ot){var et=this.pointCoordinate(ot),xt=this.pointCoordinate(this.centerPoint),Ut=this.locationCoordinate(Z),fe=new t.MercatorCoordinate(Ut.x-(et.x-xt.x),Ut.y-(et.y-xt.y));this.center=this.coordinateLocation(fe),this._renderWorldCopies&&(this.center=this.center.wrap())},Ws.prototype.locationPoint=function(Z){return this.coordinatePoint(this.locationCoordinate(Z))},Ws.prototype.pointLocation=function(Z){return this.coordinateLocation(this.pointCoordinate(Z))},Ws.prototype.locationCoordinate=function(Z){return t.MercatorCoordinate.fromLngLat(Z)},Ws.prototype.coordinateLocation=function(Z){return Z.toLngLat()},Ws.prototype.pointCoordinate=function(Z){var ot=0,et=[Z.x,Z.y,0,1],xt=[Z.x,Z.y,1,1];t.transformMat4(et,et,this.pixelMatrixInverse),t.transformMat4(xt,xt,this.pixelMatrixInverse);var Ut=et[3],fe=xt[3],ye=et[0]/Ut,Yt=xt[0]/fe,ce=et[1]/Ut,Se=xt[1]/fe,nr=et[2]/Ut,Ye=xt[2]/fe,tr=nr===Ye?0:(ot-nr)/(Ye-nr);return new t.MercatorCoordinate(t.number(ye,Yt,tr)/this.worldSize,t.number(ce,Se,tr)/this.worldSize)},Ws.prototype.coordinatePoint=function(Z){var ot=[Z.x*this.worldSize,Z.y*this.worldSize,0,1];return t.transformMat4(ot,ot,this.pixelMatrix),new t.Point(ot[0]/ot[3],ot[1]/ot[3])},Ws.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)))},Ws.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]])},Ws.prototype.setMaxBounds=function(Z){Z?(this.lngRange=[Z.getWest(),Z.getEast()],this.latRange=[Z.getSouth(),Z.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Ws.prototype.calculatePosMatrix=function(Z,ot){ot===void 0&&(ot=!1);var et=Z.key,xt=ot?this._alignedPosMatrixCache:this._posMatrixCache;if(xt[et])return xt[et];var Ut=Z.canonical,fe=this.worldSize/this.zoomScale(Ut.z),ye=Ut.x+Math.pow(2,Ut.z)*Z.wrap,Yt=t.identity(new Float64Array(16));return t.translate(Yt,Yt,[ye*fe,Ut.y*fe,0]),t.scale(Yt,Yt,[fe/t.EXTENT,fe/t.EXTENT,1]),t.multiply(Yt,ot?this.alignedProjMatrix:this.projMatrix,Yt),xt[et]=new Float32Array(Yt),xt[et]},Ws.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Ws.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var Z=-90,ot=90,et=-180,xt=180,Ut,fe,ye,Yt,ce=this.size,Se=this._unmodified;if(this.latRange){var nr=this.latRange;Z=t.mercatorYfromLat(nr[1])*this.worldSize,ot=t.mercatorYfromLat(nr[0])*this.worldSize,Ut=ot-Z<ce.y?ce.y/(ot-Z):0}if(this.lngRange){var Ye=this.lngRange;et=t.mercatorXfromLng(Ye[0])*this.worldSize,xt=t.mercatorXfromLng(Ye[1])*this.worldSize,fe=xt-et<ce.x?ce.x/(xt-et):0}var tr=this.point,lr=Math.max(fe||0,Ut||0);if(lr){this.center=this.unproject(new t.Point(fe?(xt+et)/2:tr.x,Ut?(ot+Z)/2:tr.y)),this.zoom+=this.scaleZoom(lr),this._unmodified=Se,this._constraining=!1;return}if(this.latRange){var hr=tr.y,Ve=ce.y/2;hr-Ve<Z&&(Yt=Z+Ve),hr+Ve>ot&&(Yt=ot-Ve)}if(this.lngRange){var Xe=tr.x,$e=ce.x/2;Xe-$e<et&&(ye=et+$e),Xe+$e>xt&&(ye=xt-$e)}(ye!==void 0||Yt!==void 0)&&(this.center=this.unproject(new t.Point(ye!==void 0?ye:tr.x,Yt!==void 0?Yt:tr.y))),this._unmodified=Se,this._constraining=!1}},Ws.prototype._calcMatrices=function(){if(this.height){var Z=this._fov/2,ot=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(Z)*this.height;var et=Math.PI/2+this._pitch,xt=this._fov*(.5+ot.y/this.height),Ut=Math.sin(xt)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-et-xt,.01,Math.PI-.01)),fe=this.point,ye=fe.x,Yt=fe.y,ce=Math.cos(Math.PI/2-this._pitch)*Ut+this.cameraToCenterDistance,Se=ce*1.01,nr=this.height/50,Ye=new Float64Array(16);t.perspective(Ye,this._fov,this.width/this.height,nr,Se),Ye[8]=-ot.x*2/this.width,Ye[9]=ot.y*2/this.height,t.scale(Ye,Ye,[1,-1,1]),t.translate(Ye,Ye,[0,0,-this.cameraToCenterDistance]),t.rotateX(Ye,Ye,this._pitch),t.rotateZ(Ye,Ye,this.angle),t.translate(Ye,Ye,[-ye,-Yt,0]),this.mercatorMatrix=t.scale([],Ye,[this.worldSize,this.worldSize,this.worldSize]),t.scale(Ye,Ye,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Ye,this.invProjMatrix=t.invert([],this.projMatrix);var tr=this.width%2/2,lr=this.height%2/2,hr=Math.cos(this.angle),Ve=Math.sin(this.angle),Xe=ye-Math.round(ye)+hr*tr+Ve*lr,$e=Yt-Math.round(Yt)+hr*lr+Ve*tr,Cr=new Float64Array(Ye);if(t.translate(Cr,Cr,[Xe>.5?Xe-1:Xe,$e>.5?$e-1:$e,0]),this.alignedProjMatrix=Cr,Ye=t.create(),t.scale(Ye,Ye,[this.width/2,-this.height/2,1]),t.translate(Ye,Ye,[1,-1,0]),this.labelPlaneMatrix=Ye,Ye=t.create(),t.scale(Ye,Ye,[1,-1,1]),t.translate(Ye,Ye,[-1,-1,0]),t.scale(Ye,Ye,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ye,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Ye=t.invert(new Float64Array(16),this.pixelMatrix),!Ye)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ye,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Ws.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var Z=this.pointCoordinate(new t.Point(0,0)),ot=[Z.x*this.worldSize,Z.y*this.worldSize,0,1],et=t.transformMat4(ot,ot,this.pixelMatrix);return et[3]/this.cameraToCenterDistance},Ws.prototype.getCameraPoint=function(){var Z=this._pitch,ot=Math.tan(Z)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,ot))},Ws.prototype.getCameraQueryGeometry=function(Z){var ot=this.getCameraPoint();if(Z.length===1)return[Z[0],ot];for(var et=ot.x,xt=ot.y,Ut=ot.x,fe=ot.y,ye=0,Yt=Z;ye<Yt.length;ye+=1){var ce=Yt[ye];et=Math.min(et,ce.x),xt=Math.min(xt,ce.y),Ut=Math.max(Ut,ce.x),fe=Math.max(fe,ce.y)}return[new t.Point(et,xt),new t.Point(Ut,xt),new t.Point(Ut,fe),new t.Point(et,fe),new t.Point(et,xt)]},Object.defineProperties(Ws.prototype,qs);function Yu(Z,ot){var et=!1,xt=null,Ut=function(){xt=null,et&&(Z(),xt=setTimeout(Ut,ot),et=!1)};return function(){return et=!0,xt||Ut(),xt}}var dc=function(Z){this._hashName=Z&&encodeURIComponent(Z),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Yu(this._updateHashUnthrottled.bind(this),30*1e3/100)};dc.prototype.addTo=function(Z){return this._map=Z,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},dc.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},dc.prototype.getHashString=function(Z){var ot=this._map.getCenter(),et=Math.round(this._map.getZoom()*100)/100,xt=Math.ceil((et*Math.LN2+Math.log(512/360/.5))/Math.LN10),Ut=Math.pow(10,xt),fe=Math.round(ot.lng*Ut)/Ut,ye=Math.round(ot.lat*Ut)/Ut,Yt=this._map.getBearing(),ce=this._map.getPitch(),Se="";if(Z?Se+="/"+fe+"/"+ye+"/"+et:Se+=et+"/"+ye+"/"+fe,(Yt||ce)&&(Se+="/"+Math.round(Yt*10)/10),ce&&(Se+="/"+Math.round(ce)),this._hashName){var nr=this._hashName,Ye=!1,tr=t.window.location.hash.slice(1).split("&").map(function(lr){var hr=lr.split("=")[0];return hr===nr?(Ye=!0,hr+"="+Se):lr}).filter(function(lr){return lr});return Ye||tr.push(nr+"="+Se),"#"+tr.join("&")}return"#"+Se},dc.prototype._getCurrentHash=function(){var Z=this,ot=t.window.location.hash.replace("#","");if(this._hashName){var et;return ot.split("&").map(function(xt){return xt.split("=")}).forEach(function(xt){xt[0]===Z._hashName&&(et=xt)}),(et&&et[1]||"").split("/")}return ot.split("/")},dc.prototype._onHashChange=function(){var Z=this._getCurrentHash();if(Z.length>=3&&!Z.some(function(et){return isNaN(et)})){var ot=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(Z[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+Z[2],+Z[1]],zoom:+Z[0],bearing:ot,pitch:+(Z[4]||0)}),!0}return!1},dc.prototype._updateHashUnthrottled=function(){var Z=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,Z)}catch{}};var Zc={linearity:.3,easing:t.bezier(0,0,.3,1)},At=t.extend({deceleration:2500,maxSpeed:1400},Zc),jt=t.extend({deceleration:20,maxSpeed:1400},Zc),ue=t.extend({deceleration:1e3,maxSpeed:360},Zc),Me=t.extend({deceleration:1e3,maxSpeed:90},Zc),Le=function(Z){this._map=Z,this.clear()};Le.prototype.clear=function(){this._inertiaBuffer=[]},Le.prototype.record=function(Z){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:Z})},Le.prototype._drainInertiaBuffer=function(){for(var Z=this._inertiaBuffer,ot=t.browser.now(),et=160;Z.length>0&&ot-Z[0].time>et;)Z.shift()},Le.prototype._onMoveEnd=function(Z){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var ot={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},et=0,xt=this._inertiaBuffer;et<xt.length;et+=1){var Ut=xt[et],fe=Ut.settings;ot.zoom+=fe.zoomDelta||0,ot.bearing+=fe.bearingDelta||0,ot.pitch+=fe.pitchDelta||0,fe.panDelta&&ot.pan._add(fe.panDelta),fe.around&&(ot.around=fe.around),fe.pinchAround&&(ot.pinchAround=fe.pinchAround)}var ye=this._inertiaBuffer[this._inertiaBuffer.length-1],Yt=ye.time-this._inertiaBuffer[0].time,ce={};if(ot.pan.mag()){var Se=sr(ot.pan.mag(),Yt,t.extend({},At,Z||{}));ce.offset=ot.pan.mult(Se.amount/ot.pan.mag()),ce.center=this._map.transform.center,Be(ce,Se)}if(ot.zoom){var nr=sr(ot.zoom,Yt,jt);ce.zoom=this._map.transform.zoom+nr.amount,Be(ce,nr)}if(ot.bearing){var Ye=sr(ot.bearing,Yt,ue);ce.bearing=this._map.transform.bearing+t.clamp(Ye.amount,-179,179),Be(ce,Ye)}if(ot.pitch){var tr=sr(ot.pitch,Yt,Me);ce.pitch=this._map.transform.pitch+tr.amount,Be(ce,tr)}if(ce.zoom||ce.bearing){var lr=ot.pinchAround===void 0?ot.around:ot.pinchAround;ce.around=lr?this._map.unproject(lr):this._map.getCenter()}return this.clear(),t.extend(ce,{noMoveStart:!0})}};function Be(Z,ot){(!Z.duration||Z.duration<ot.duration)&&(Z.duration=ot.duration,Z.easing=ot.easing)}function sr(Z,ot,et){var xt=et.maxSpeed,Ut=et.linearity,fe=et.deceleration,ye=t.clamp(Z*Ut/(ot/1e3),-xt,xt),Yt=Math.abs(ye)/(fe*Ut);return{easing:et.easing,duration:Yt*1e3,amount:ye*(Yt/2)}}var ir=function(Z){function ot(xt,Ut,fe,ye){ye===void 0&&(ye={});var Yt=r.mousePos(Ut.getCanvasContainer(),fe),ce=Ut.unproject(Yt);Z.call(this,xt,t.extend({point:Yt,lngLat:ce,originalEvent:fe},ye)),this._defaultPrevented=!1,this.target=Ut}Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot;var et={defaultPrevented:{configurable:!0}};return ot.prototype.preventDefault=function(){this._defaultPrevented=!0},et.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(ot.prototype,et),ot}(t.Event),Mr=function(Z){function ot(xt,Ut,fe){var ye=xt==="touchend"?fe.changedTouches:fe.touches,Yt=r.touchPos(Ut.getCanvasContainer(),ye),ce=Yt.map(function(Ye){return Ut.unproject(Ye)}),Se=Yt.reduce(function(Ye,tr,lr,hr){return Ye.add(tr.div(hr.length))},new t.Point(0,0)),nr=Ut.unproject(Se);Z.call(this,xt,{points:Yt,point:Se,lngLats:ce,lngLat:nr,originalEvent:fe}),this._defaultPrevented=!1}Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot;var et={defaultPrevented:{configurable:!0}};return ot.prototype.preventDefault=function(){this._defaultPrevented=!0},et.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(ot.prototype,et),ot}(t.Event),en=function(Z){function ot(xt,Ut,fe){Z.call(this,xt,{originalEvent:fe}),this._defaultPrevented=!1}Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot;var et={defaultPrevented:{configurable:!0}};return ot.prototype.preventDefault=function(){this._defaultPrevented=!0},et.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(ot.prototype,et),ot}(t.Event),Xr=function(Z,ot){this._map=Z,this._clickTolerance=ot.clickTolerance};Xr.prototype.reset=function(){delete this._mousedownPos},Xr.prototype.wheel=function(Z){return this._firePreventable(new en(Z.type,this._map,Z))},Xr.prototype.mousedown=function(Z,ot){return this._mousedownPos=ot,this._firePreventable(new ir(Z.type,this._map,Z))},Xr.prototype.mouseup=function(Z){this._map.fire(new ir(Z.type,this._map,Z))},Xr.prototype.click=function(Z,ot){this._mousedownPos&&this._mousedownPos.dist(ot)>=this._clickTolerance||this._map.fire(new ir(Z.type,this._map,Z))},Xr.prototype.dblclick=function(Z){return this._firePreventable(new ir(Z.type,this._map,Z))},Xr.prototype.mouseover=function(Z){this._map.fire(new ir(Z.type,this._map,Z))},Xr.prototype.mouseout=function(Z){this._map.fire(new ir(Z.type,this._map,Z))},Xr.prototype.touchstart=function(Z){return this._firePreventable(new Mr(Z.type,this._map,Z))},Xr.prototype.touchmove=function(Z){this._map.fire(new Mr(Z.type,this._map,Z))},Xr.prototype.touchend=function(Z){this._map.fire(new Mr(Z.type,this._map,Z))},Xr.prototype.touchcancel=function(Z){this._map.fire(new Mr(Z.type,this._map,Z))},Xr.prototype._firePreventable=function(Z){if(this._map.fire(Z),Z.defaultPrevented)return{}},Xr.prototype.isEnabled=function(){return!0},Xr.prototype.isActive=function(){return!1},Xr.prototype.enable=function(){},Xr.prototype.disable=function(){};var vn=function(Z){this._map=Z};vn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},vn.prototype.mousemove=function(Z){this._map.fire(new ir(Z.type,this._map,Z))},vn.prototype.mousedown=function(){this._delayContextMenu=!0},vn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ir("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},vn.prototype.contextmenu=function(Z){this._delayContextMenu?this._contextMenuEvent=Z:this._map.fire(new ir(Z.type,this._map,Z)),this._map.listens("contextmenu")&&Z.preventDefault()},vn.prototype.isEnabled=function(){return!0},vn.prototype.isActive=function(){return!1},vn.prototype.enable=function(){},vn.prototype.disable=function(){};var In=function(Z,ot){this._map=Z,this._el=Z.getCanvasContainer(),this._container=Z.getContainer(),this._clickTolerance=ot.clickTolerance||1};In.prototype.isEnabled=function(){return!!this._enabled},In.prototype.isActive=function(){return!!this._active},In.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},In.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},In.prototype.mousedown=function(Z,ot){this.isEnabled()&&Z.shiftKey&&Z.button===0&&(r.disableDrag(),this._startPos=this._lastPos=ot,this._active=!0)},In.prototype.mousemoveWindow=function(Z,ot){if(this._active){var et=ot;if(!(this._lastPos.equals(et)||!this._box&&et.dist(this._startPos)<this._clickTolerance)){var xt=this._startPos;this._lastPos=et,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",Z));var Ut=Math.min(xt.x,et.x),fe=Math.max(xt.x,et.x),ye=Math.min(xt.y,et.y),Yt=Math.max(xt.y,et.y);r.setTransform(this._box,"translate("+Ut+"px,"+ye+"px)"),this._box.style.width=fe-Ut+"px",this._box.style.height=Yt-ye+"px"}}},In.prototype.mouseupWindow=function(Z,ot){var et=this;if(this._active&&Z.button===0){var xt=this._startPos,Ut=ot;if(this.reset(),r.suppressClick(),xt.x===Ut.x&&xt.y===Ut.y)this._fireEvent("boxzoomcancel",Z);else return this._map.fire(new t.Event("boxzoomend",{originalEvent:Z})),{cameraAnimation:function(fe){return fe.fitScreenCoordinates(xt,Ut,et._map.getBearing(),{linear:!0})}}}},In.prototype.keydown=function(Z){this._active&&Z.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",Z))},In.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},In.prototype._fireEvent=function(Z,ot){return this._map.fire(new t.Event(Z,{originalEvent:ot}))};function On(Z,ot){for(var et={},xt=0;xt<Z.length;xt++)et[Z[xt].identifier]=ot[xt];return et}function Bi(Z){for(var ot=new t.Point(0,0),et=0,xt=Z;et<xt.length;et+=1){var Ut=xt[et];ot._add(Ut)}return ot.div(Z.length)}var Un=500,mi=500,Ti=30,Ii=function(Z){this.reset(),this.numTouches=Z.numTouches};Ii.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Ii.prototype.touchstart=function(Z,ot,et){(this.centroid||et.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=Z.timeStamp),et.length===this.numTouches&&(this.centroid=Bi(ot),this.touches=On(et,ot)))},Ii.prototype.touchmove=function(Z,ot,et){if(!(this.aborted||!this.centroid)){var xt=On(et,ot);for(var Ut in this.touches){var fe=this.touches[Ut],ye=xt[Ut];(!ye||ye.dist(fe)>Ti)&&(this.aborted=!0)}}},Ii.prototype.touchend=function(Z,ot,et){if((!this.centroid||Z.timeStamp-this.startTime>mi)&&(this.aborted=!0),et.length===0){var xt=!this.aborted&&this.centroid;if(this.reset(),xt)return xt}};var Wi=function(Z){this.singleTap=new Ii(Z),this.numTaps=Z.numTaps,this.reset()};Wi.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Wi.prototype.touchstart=function(Z,ot,et){this.singleTap.touchstart(Z,ot,et)},Wi.prototype.touchmove=function(Z,ot,et){this.singleTap.touchmove(Z,ot,et)},Wi.prototype.touchend=function(Z,ot,et){var xt=this.singleTap.touchend(Z,ot,et);if(xt){var Ut=Z.timeStamp-this.lastTime<Un,fe=!this.lastTap||this.lastTap.dist(xt)<Ti;if((!Ut||!fe)&&this.reset(),this.count++,this.lastTime=Z.timeStamp,this.lastTap=xt,this.count===this.numTaps)return this.reset(),xt}};var Yn=function(){this._zoomIn=new Wi({numTouches:1,numTaps:2}),this._zoomOut=new Wi({numTouches:2,numTaps:1}),this.reset()};Yn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Yn.prototype.touchstart=function(Z,ot,et){this._zoomIn.touchstart(Z,ot,et),this._zoomOut.touchstart(Z,ot,et)},Yn.prototype.touchmove=function(Z,ot,et){this._zoomIn.touchmove(Z,ot,et),this._zoomOut.touchmove(Z,ot,et)},Yn.prototype.touchend=function(Z,ot,et){var xt=this,Ut=this._zoomIn.touchend(Z,ot,et),fe=this._zoomOut.touchend(Z,ot,et);if(Ut)return this._active=!0,Z.preventDefault(),setTimeout(function(){return xt.reset()},0),{cameraAnimation:function(ye){return ye.easeTo({duration:300,zoom:ye.getZoom()+1,around:ye.unproject(Ut)},{originalEvent:Z})}};if(fe)return this._active=!0,Z.preventDefault(),setTimeout(function(){return xt.reset()},0),{cameraAnimation:function(ye){return ye.easeTo({duration:300,zoom:ye.getZoom()-1,around:ye.unproject(fe)},{originalEvent:Z})}}},Yn.prototype.touchcancel=function(){this.reset()},Yn.prototype.enable=function(){this._enabled=!0},Yn.prototype.disable=function(){this._enabled=!1,this.reset()},Yn.prototype.isEnabled=function(){return this._enabled},Yn.prototype.isActive=function(){return this._active};var ja=0,Ha=2,ro={};ro[ja]=1,ro[Ha]=2;function Lo(Z,ot){var et=ro[ot];return Z.buttons===void 0||(Z.buttons&et)!==et}var Fo=function(Z){this.reset(),this._clickTolerance=Z.clickTolerance||1};Fo.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Fo.prototype._correctButton=function(Z,ot){return!1},Fo.prototype._move=function(Z,ot){return{}},Fo.prototype.mousedown=function(Z,ot){if(!this._lastPoint){var et=r.mouseButton(Z);this._correctButton(Z,et)&&(this._lastPoint=ot,this._eventButton=et)}},Fo.prototype.mousemoveWindow=function(Z,ot){var et=this._lastPoint;if(et){if(Z.preventDefault(),Lo(Z,this._eventButton)){this.reset();return}if(!(!this._moved&&ot.dist(et)<this._clickTolerance))return this._moved=!0,this._lastPoint=ot,this._move(et,ot)}},Fo.prototype.mouseupWindow=function(Z){if(this._lastPoint){var ot=r.mouseButton(Z);ot===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())}},Fo.prototype.enable=function(){this._enabled=!0},Fo.prototype.disable=function(){this._enabled=!1,this.reset()},Fo.prototype.isEnabled=function(){return this._enabled},Fo.prototype.isActive=function(){return this._active};var Uo=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.mousedown=function(et,xt){Z.prototype.mousedown.call(this,et,xt),this._lastPoint&&(this._active=!0)},ot.prototype._correctButton=function(et,xt){return xt===ja&&!et.ctrlKey},ot.prototype._move=function(et,xt){return{around:xt,panDelta:xt.sub(et)}},ot}(Fo),al=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype._correctButton=function(et,xt){return xt===ja&&et.ctrlKey||xt===Ha},ot.prototype._move=function(et,xt){var Ut=.8,fe=(xt.x-et.x)*Ut;if(fe)return this._active=!0,{bearingDelta:fe}},ot.prototype.contextmenu=function(et){et.preventDefault()},ot}(Fo),Wo=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype._correctButton=function(et,xt){return xt===ja&&et.ctrlKey||xt===Ha},ot.prototype._move=function(et,xt){var Ut=-.5,fe=(xt.y-et.y)*Ut;if(fe)return this._active=!0,{pitchDelta:fe}},ot.prototype.contextmenu=function(et){et.preventDefault()},ot}(Fo),ps=function(Z){this._minTouches=1,this._clickTolerance=Z.clickTolerance||1,this.reset()};ps.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},ps.prototype.touchstart=function(Z,ot,et){return this._calculateTransform(Z,ot,et)},ps.prototype.touchmove=function(Z,ot,et){if(!(!this._active||et.length<this._minTouches))return Z.preventDefault(),this._calculateTransform(Z,ot,et)},ps.prototype.touchend=function(Z,ot,et){this._calculateTransform(Z,ot,et),this._active&&et.length<this._minTouches&&this.reset()},ps.prototype.touchcancel=function(){this.reset()},ps.prototype._calculateTransform=function(Z,ot,et){et.length>0&&(this._active=!0);var xt=On(et,ot),Ut=new t.Point(0,0),fe=new t.Point(0,0),ye=0;for(var Yt in xt){var ce=xt[Yt],Se=this._touches[Yt];Se&&(Ut._add(ce),fe._add(ce.sub(Se)),ye++,xt[Yt]=ce)}if(this._touches=xt,!(ye<this._minTouches||!fe.mag())){var nr=fe.div(ye);if(this._sum._add(nr),!(this._sum.mag()<this._clickTolerance)){var Ye=Ut.div(ye);return{around:Ye,panDelta:nr}}}},ps.prototype.enable=function(){this._enabled=!0},ps.prototype.disable=function(){this._enabled=!1,this.reset()},ps.prototype.isEnabled=function(){return this._enabled},ps.prototype.isActive=function(){return this._active};var Tl=function(){this.reset()};Tl.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Tl.prototype._start=function(Z){},Tl.prototype._move=function(Z,ot,et){return{}},Tl.prototype.touchstart=function(Z,ot,et){this._firstTwoTouches||et.length<2||(this._firstTwoTouches=[et[0].identifier,et[1].identifier],this._start([ot[0],ot[1]]))},Tl.prototype.touchmove=function(Z,ot,et){if(this._firstTwoTouches){Z.preventDefault();var xt=this._firstTwoTouches,Ut=xt[0],fe=xt[1],ye=Ku(et,ot,Ut),Yt=Ku(et,ot,fe);if(!(!ye||!Yt)){var ce=this._aroundCenter?null:ye.add(Yt).div(2);return this._move([ye,Yt],ce,Z)}}},Tl.prototype.touchend=function(Z,ot,et){if(this._firstTwoTouches){var xt=this._firstTwoTouches,Ut=xt[0],fe=xt[1],ye=Ku(et,ot,Ut),Yt=Ku(et,ot,fe);ye&&Yt||(this._active&&r.suppressClick(),this.reset())}},Tl.prototype.touchcancel=function(){this.reset()},Tl.prototype.enable=function(Z){this._enabled=!0,this._aroundCenter=!!Z&&Z.around==="center"},Tl.prototype.disable=function(){this._enabled=!1,this.reset()},Tl.prototype.isEnabled=function(){return this._enabled},Tl.prototype.isActive=function(){return this._active};function Ku(Z,ot,et){for(var xt=0;xt<Z.length;xt++)if(Z[xt].identifier===et)return ot[xt]}var cu=.1;function _o(Z,ot){return Math.log(Z/ot)/Math.LN2}var Zs=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.reset=function(){Z.prototype.reset.call(this),delete this._distance,delete this._startDistance},ot.prototype._start=function(et){this._startDistance=this._distance=et[0].dist(et[1])},ot.prototype._move=function(et,xt){var Ut=this._distance;if(this._distance=et[0].dist(et[1]),!(!this._active&&Math.abs(_o(this._distance,this._startDistance))<cu))return this._active=!0,{zoomDelta:_o(this._distance,Ut),pinchAround:xt}},ot}(Tl),rl=25;function ou(Z,ot){return Z.angleWith(ot)*180/Math.PI}var Gl=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.reset=function(){Z.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},ot.prototype._start=function(et){this._startVector=this._vector=et[0].sub(et[1]),this._minDiameter=et[0].dist(et[1])},ot.prototype._move=function(et,xt){var Ut=this._vector;if(this._vector=et[0].sub(et[1]),!(!this._active&&this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:ou(this._vector,Ut),pinchAround:xt}},ot.prototype._isBelowThreshold=function(et){this._minDiameter=Math.min(this._minDiameter,et.mag());var xt=Math.PI*this._minDiameter,Ut=rl/xt*360,fe=ou(et,this._startVector);return Math.abs(fe)<Ut},ot}(Tl);function rh(Z){return Math.abs(Z.y)>Math.abs(Z.x)}var Bl=100,Ql=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.reset=function(){Z.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},ot.prototype._start=function(et){this._lastPoints=et,rh(et[0].sub(et[1]))&&(this._valid=!1)},ot.prototype._move=function(et,xt,Ut){var fe=et[0].sub(this._lastPoints[0]),ye=et[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(fe,ye,Ut.timeStamp),!!this._valid){this._lastPoints=et,this._active=!0;var Yt=(fe.y+ye.y)/2,ce=-.5;return{pitchDelta:Yt*ce}}},ot.prototype.gestureBeginsVertically=function(et,xt,Ut){if(this._valid!==void 0)return this._valid;var fe=2,ye=et.mag()>=fe,Yt=xt.mag()>=fe;if(!(!ye&&!Yt)){if(!ye||!Yt)return this._firstMove===void 0&&(this._firstMove=Ut),Ut-this._firstMove<Bl?void 0:!1;var ce=et.y>0==xt.y>0;return rh(et)&&rh(xt)&&ce}},ot}(Tl),bh={panStep:100,bearingStep:15,pitchStep:10},_e=function(){var Z=bh;this._panStep=Z.panStep,this._bearingStep=Z.bearingStep,this._pitchStep=Z.pitchStep,this._rotationDisabled=!1};_e.prototype.reset=function(){this._active=!1},_e.prototype.keydown=function(Z){var ot=this;if(!(Z.altKey||Z.ctrlKey||Z.metaKey)){var et=0,xt=0,Ut=0,fe=0,ye=0;switch(Z.keyCode){case 61:case 107:case 171:case 187:et=1;break;case 189:case 109:case 173:et=-1;break;case 37:Z.shiftKey?xt=-1:(Z.preventDefault(),fe=-1);break;case 39:Z.shiftKey?xt=1:(Z.preventDefault(),fe=1);break;case 38:Z.shiftKey?Ut=1:(Z.preventDefault(),ye=-1);break;case 40:Z.shiftKey?Ut=-1:(Z.preventDefault(),ye=1);break;default:return}return this._rotationDisabled&&(xt=0,Ut=0),{cameraAnimation:function(Yt){var ce=Yt.getZoom();Yt.easeTo({duration:300,easeId:"keyboardHandler",easing:kr,zoom:et?Math.round(ce)+et*(Z.shiftKey?2:1):ce,bearing:Yt.getBearing()+xt*ot._bearingStep,pitch:Yt.getPitch()+Ut*ot._pitchStep,offset:[-fe*ot._panStep,-ye*ot._panStep],center:Yt.getCenter()},{originalEvent:Z})}}}},_e.prototype.enable=function(){this._enabled=!0},_e.prototype.disable=function(){this._enabled=!1,this.reset()},_e.prototype.isEnabled=function(){return this._enabled},_e.prototype.isActive=function(){return this._active},_e.prototype.disableRotation=function(){this._rotationDisabled=!0},_e.prototype.enableRotation=function(){this._rotationDisabled=!1};function kr(Z){return Z*(2-Z)}var Lr=4.000244140625,Dn=1/100,oi=1/450,Jn=2,gn=function(Z,ot){this._map=Z,this._el=Z.getCanvasContainer(),this._handler=ot,this._delta=0,this._defaultZoomRate=Dn,this._wheelZoomRate=oi,t.bindAll(["_onTimeout"],this)};gn.prototype.setZoomRate=function(Z){this._defaultZoomRate=Z},gn.prototype.setWheelZoomRate=function(Z){this._wheelZoomRate=Z},gn.prototype.isEnabled=function(){return!!this._enabled},gn.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},gn.prototype.isZooming=function(){return!!this._zooming},gn.prototype.enable=function(Z){this.isEnabled()||(this._enabled=!0,this._aroundCenter=Z&&Z.around==="center")},gn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},gn.prototype.wheel=function(Z){if(this.isEnabled()){var ot=Z.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?Z.deltaY*40:Z.deltaY,et=t.browser.now(),xt=et-(this._lastWheelEventTime||0);this._lastWheelEventTime=et,ot!==0&&ot%Lr===0?this._type="wheel":ot!==0&&Math.abs(ot)<4?this._type="trackpad":xt>400?(this._type=null,this._lastValue=ot,this._timeout=setTimeout(this._onTimeout,40,Z)):this._type||(this._type=Math.abs(xt*ot)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ot+=this._lastValue)),Z.shiftKey&&ot&&(ot=ot/4),this._type&&(this._lastWheelEvent=Z,this._delta-=ot,this._active||this._start(Z)),Z.preventDefault()}},gn.prototype._onTimeout=function(Z){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Z)},gn.prototype._start=function(Z){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 ot=r.mousePos(this._el,Z);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(ot)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},gn.prototype.renderFrame=function(){var Z=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var ot=this._map.transform;if(this._delta!==0){var et=this._type==="wheel"&&Math.abs(this._delta)>Lr?this._wheelZoomRate:this._defaultZoomRate,xt=Jn/(1+Math.exp(-Math.abs(this._delta*et)));this._delta<0&&xt!==0&&(xt=1/xt);var Ut=typeof this._targetZoom=="number"?ot.zoomScale(this._targetZoom):ot.scale;this._targetZoom=Math.min(ot.maxZoom,Math.max(ot.minZoom,ot.scaleZoom(Ut*xt))),this._type==="wheel"&&(this._startZoom=ot.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var fe=typeof this._targetZoom=="number"?this._targetZoom:ot.zoom,ye=this._startZoom,Yt=this._easing,ce=!1,Se;if(this._type==="wheel"&&ye&&Yt){var nr=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),Ye=Yt(nr);Se=t.number(ye,fe,Ye),nr<1?this._frameId||(this._frameId=!0):ce=!0}else Se=fe,ce=!0;return this._active=!0,ce&&(this._active=!1,this._finishTimeout=setTimeout(function(){Z._zooming=!1,Z._handler._triggerRenderFrame(),delete Z._targetZoom,delete Z._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ce,zoomDelta:Se-ot.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},gn.prototype._smoothOutEasing=function(Z){var ot=t.ease;if(this._prevEase){var et=this._prevEase,xt=(t.browser.now()-et.start)/et.duration,Ut=et.easing(xt+.01)-et.easing(xt),fe=.27/Math.sqrt(Ut*Ut+1e-4)*.01,ye=Math.sqrt(.27*.27-fe*fe);ot=t.bezier(fe,ye,.25,1)}return this._prevEase={start:t.browser.now(),duration:Z,easing:ot},ot},gn.prototype.reset=function(){this._active=!1};var ni=function(Z,ot){this._clickZoom=Z,this._tapZoom=ot};ni.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ni.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ni.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ni.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Yi=function(){this.reset()};Yi.prototype.reset=function(){this._active=!1},Yi.prototype.dblclick=function(Z,ot){return Z.preventDefault(),{cameraAnimation:function(et){et.easeTo({duration:300,zoom:et.getZoom()+(Z.shiftKey?-1:1),around:et.unproject(ot)},{originalEvent:Z})}}},Yi.prototype.enable=function(){this._enabled=!0},Yi.prototype.disable=function(){this._enabled=!1,this.reset()},Yi.prototype.isEnabled=function(){return this._enabled},Yi.prototype.isActive=function(){return this._active};var Ui=function(){this._tap=new Wi({numTouches:1,numTaps:1}),this.reset()};Ui.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Ui.prototype.touchstart=function(Z,ot,et){this._swipePoint||(this._tapTime&&Z.timeStamp-this._tapTime>Un&&this.reset(),this._tapTime?et.length>0&&(this._swipePoint=ot[0],this._swipeTouch=et[0].identifier):this._tap.touchstart(Z,ot,et))},Ui.prototype.touchmove=function(Z,ot,et){if(!this._tapTime)this._tap.touchmove(Z,ot,et);else if(this._swipePoint){if(et[0].identifier!==this._swipeTouch)return;var xt=ot[0],Ut=xt.y-this._swipePoint.y;return this._swipePoint=xt,Z.preventDefault(),this._active=!0,{zoomDelta:Ut/128}}},Ui.prototype.touchend=function(Z,ot,et){if(this._tapTime)this._swipePoint&&et.length===0&&this.reset();else{var xt=this._tap.touchend(Z,ot,et);xt&&(this._tapTime=Z.timeStamp)}},Ui.prototype.touchcancel=function(){this.reset()},Ui.prototype.enable=function(){this._enabled=!0},Ui.prototype.disable=function(){this._enabled=!1,this.reset()},Ui.prototype.isEnabled=function(){return this._enabled},Ui.prototype.isActive=function(){return this._active};var va=function(Z,ot,et){this._el=Z,this._mousePan=ot,this._touchPan=et};va.prototype.enable=function(Z){this._inertiaOptions=Z||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},va.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},va.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},va.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Za=function(Z,ot,et){this._pitchWithRotate=Z.pitchWithRotate,this._mouseRotate=ot,this._mousePitch=et};Za.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Za.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Za.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Za.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Ba=function(Z,ot,et,xt){this._el=Z,this._touchZoom=ot,this._touchRotate=et,this._tapDragZoom=xt,this._rotationDisabled=!1,this._enabled=!0};Ba.prototype.enable=function(Z){this._touchZoom.enable(Z),this._rotationDisabled||this._touchRotate.enable(Z),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Ba.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Ba.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Ba.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Ba.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Ba.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var ta=function(Z){return Z.zoom||Z.drag||Z.pitch||Z.rotate},wi=function(Z){function ot(){Z.apply(this,arguments)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot}(t.Event);function hn(Z){return Z.panDelta&&Z.panDelta.mag()||Z.zoomDelta||Z.bearingDelta||Z.pitchDelta}var Nn=function(Z,ot){this._map=Z,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Le(Z),this._bearingSnap=ot.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ot),t.bindAll(["handleEvent","handleWindowEvent"],this);var et=this._el;this._listeners=[[et,"touchstart",{passive:!0}],[et,"touchmove",{passive:!1}],[et,"touchend",void 0],[et,"touchcancel",void 0],[et,"mousedown",void 0],[et,"mousemove",void 0],[et,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[et,"mouseover",void 0],[et,"mouseout",void 0],[et,"dblclick",void 0],[et,"click",void 0],[et,"keydown",{capture:!1}],[et,"keyup",void 0],[et,"wheel",{passive:!1}],[et,"contextmenu",void 0],[t.window,"blur",void 0]];for(var xt=0,Ut=this._listeners;xt<Ut.length;xt+=1){var fe=Ut[xt],ye=fe[0],Yt=fe[1],ce=fe[2];r.addEventListener(ye,Yt,ye===t.window.document?this.handleWindowEvent:this.handleEvent,ce)}};Nn.prototype.destroy=function(){for(var Z=0,ot=this._listeners;Z<ot.length;Z+=1){var et=ot[Z],xt=et[0],Ut=et[1],fe=et[2];r.removeEventListener(xt,Ut,xt===t.window.document?this.handleWindowEvent:this.handleEvent,fe)}},Nn.prototype._addDefaultHandlers=function(Z){var ot=this._map,et=ot.getCanvasContainer();this._add("mapEvent",new Xr(ot,Z));var xt=ot.boxZoom=new In(ot,Z);this._add("boxZoom",xt);var Ut=new Yn,fe=new Yi;ot.doubleClickZoom=new ni(fe,Ut),this._add("tapZoom",Ut),this._add("clickZoom",fe);var ye=new Ui;this._add("tapDragZoom",ye);var Yt=ot.touchPitch=new Ql;this._add("touchPitch",Yt);var ce=new al(Z),Se=new Wo(Z);ot.dragRotate=new Za(Z,ce,Se),this._add("mouseRotate",ce,["mousePitch"]),this._add("mousePitch",Se,["mouseRotate"]);var nr=new Uo(Z),Ye=new ps(Z);ot.dragPan=new va(et,nr,Ye),this._add("mousePan",nr),this._add("touchPan",Ye,["touchZoom","touchRotate"]);var tr=new Gl,lr=new Zs;ot.touchZoomRotate=new Ba(et,lr,tr,ye),this._add("touchRotate",tr,["touchPan","touchZoom"]),this._add("touchZoom",lr,["touchPan","touchRotate"]);var hr=ot.scrollZoom=new gn(ot,this);this._add("scrollZoom",hr,["mousePan"]);var Ve=ot.keyboard=new _e;this._add("keyboard",Ve),this._add("blockableMapEvent",new vn(ot));for(var Xe=0,$e=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];Xe<$e.length;Xe+=1){var Cr=$e[Xe];Z.interactive&&Z[Cr]&&ot[Cr].enable(Z[Cr])}},Nn.prototype._add=function(Z,ot,et){this._handlers.push({handlerName:Z,handler:ot,allowed:et}),this._handlersById[Z]=ot},Nn.prototype.stop=function(Z){if(!this._updatingCamera){for(var ot=0,et=this._handlers;ot<et.length;ot+=1){var xt=et[ot],Ut=xt.handler;Ut.reset()}this._inertia.clear(),this._fireEvents({},{},Z),this._changes=[]}},Nn.prototype.isActive=function(){for(var Z=0,ot=this._handlers;Z<ot.length;Z+=1){var et=ot[Z],xt=et.handler;if(xt.isActive())return!0}return!1},Nn.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Nn.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Nn.prototype.isMoving=function(){return!!ta(this._eventsInProgress)||this.isZooming()},Nn.prototype._blockedByActive=function(Z,ot,et){for(var xt in Z)if(xt!==et&&(!ot||ot.indexOf(xt)<0))return!0;return!1},Nn.prototype.handleWindowEvent=function(Z){this.handleEvent(Z,Z.type+"Window")},Nn.prototype._getMapTouches=function(Z){for(var ot=[],et=0,xt=Z;et<xt.length;et+=1){var Ut=xt[et],fe=Ut.target;this._el.contains(fe)&&ot.push(Ut)}return ot},Nn.prototype.handleEvent=function(Z,ot){if(Z.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;for(var et=Z.type==="renderFrame"?void 0:Z,xt={needsRenderFrame:!1},Ut={},fe={},ye=Z.touches?this._getMapTouches(Z.touches):void 0,Yt=ye?r.touchPos(this._el,ye):r.mousePos(this._el,Z),ce=0,Se=this._handlers;ce<Se.length;ce+=1){var nr=Se[ce],Ye=nr.handlerName,tr=nr.handler,lr=nr.allowed;if(tr.isEnabled()){var hr=void 0;this._blockedByActive(fe,lr,Ye)?tr.reset():tr[ot||Z.type]&&(hr=tr[ot||Z.type](Z,Yt,ye),this.mergeHandlerResult(xt,Ut,hr,Ye,et),hr&&hr.needsRenderFrame&&this._triggerRenderFrame()),(hr||tr.isActive())&&(fe[Ye]=tr)}}var Ve={};for(var Xe in this._previousActiveHandlers)fe[Xe]||(Ve[Xe]=et);this._previousActiveHandlers=fe,(Object.keys(Ve).length||hn(xt))&&(this._changes.push([xt,Ut,Ve]),this._triggerRenderFrame()),(Object.keys(fe).length||hn(xt))&&this._map._stop(!0),this._updatingCamera=!1;var $e=xt.cameraAnimation;$e&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],$e(this._map))},Nn.prototype.mergeHandlerResult=function(Z,ot,et,xt,Ut){if(et){t.extend(Z,et);var fe={handlerName:xt,originalEvent:et.originalEvent||Ut};et.zoomDelta!==void 0&&(ot.zoom=fe),et.panDelta!==void 0&&(ot.drag=fe),et.pitchDelta!==void 0&&(ot.pitch=fe),et.bearingDelta!==void 0&&(ot.rotate=fe)}},Nn.prototype._applyChanges=function(){for(var Z={},ot={},et={},xt=0,Ut=this._changes;xt<Ut.length;xt+=1){var fe=Ut[xt],ye=fe[0],Yt=fe[1],ce=fe[2];ye.panDelta&&(Z.panDelta=(Z.panDelta||new t.Point(0,0))._add(ye.panDelta)),ye.zoomDelta&&(Z.zoomDelta=(Z.zoomDelta||0)+ye.zoomDelta),ye.bearingDelta&&(Z.bearingDelta=(Z.bearingDelta||0)+ye.bearingDelta),ye.pitchDelta&&(Z.pitchDelta=(Z.pitchDelta||0)+ye.pitchDelta),ye.around!==void 0&&(Z.around=ye.around),ye.pinchAround!==void 0&&(Z.pinchAround=ye.pinchAround),ye.noInertia&&(Z.noInertia=ye.noInertia),t.extend(ot,Yt),t.extend(et,ce)}this._updateMapTransform(Z,ot,et),this._changes=[]},Nn.prototype._updateMapTransform=function(Z,ot,et){var xt=this._map,Ut=xt.transform;if(!hn(Z))return this._fireEvents(ot,et,!0);var fe=Z.panDelta,ye=Z.zoomDelta,Yt=Z.bearingDelta,ce=Z.pitchDelta,Se=Z.around,nr=Z.pinchAround;nr!==void 0&&(Se=nr),xt._stop(!0),Se=Se||xt.transform.centerPoint;var Ye=Ut.pointLocation(fe?Se.sub(fe):Se);Yt&&(Ut.bearing+=Yt),ce&&(Ut.pitch+=ce),ye&&(Ut.zoom+=ye),Ut.setLocationAtPoint(Ye,Se),this._map._update(),Z.noInertia||this._inertia.record(Z),this._fireEvents(ot,et,!0)},Nn.prototype._fireEvents=function(Z,ot,et){var xt=this,Ut=ta(this._eventsInProgress),fe=ta(Z),ye={};for(var Yt in Z){var ce=Z[Yt],Se=ce.originalEvent;this._eventsInProgress[Yt]||(ye[Yt+"start"]=Se),this._eventsInProgress[Yt]=Z[Yt]}!Ut&&fe&&this._fireEvent("movestart",fe.originalEvent);for(var nr in ye)this._fireEvent(nr,ye[nr]);fe&&this._fireEvent("move",fe.originalEvent);for(var Ye in Z){var tr=Z[Ye],lr=tr.originalEvent;this._fireEvent(Ye,lr)}var hr={},Ve;for(var Xe in this._eventsInProgress){var $e=this._eventsInProgress[Xe],Cr=$e.handlerName,on=$e.originalEvent;this._handlersById[Cr].isActive()||(delete this._eventsInProgress[Xe],Ve=ot[Cr]||on,hr[Xe+"end"]=Ve)}for(var fn in hr)this._fireEvent(fn,hr[fn]);var fi=ta(this._eventsInProgress);if(et&&(Ut||fe)&&!fi){this._updatingCamera=!0;var si=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Gn=function(Mi){return Mi!==0&&-xt._bearingSnap<Mi&&Mi<xt._bearingSnap};si?(Gn(si.bearing||this._map.getBearing())&&(si.bearing=0),this._map.easeTo(si,{originalEvent:Ve})):(this._map.fire(new t.Event("moveend",{originalEvent:Ve})),Gn(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Nn.prototype._fireEvent=function(Z,ot){this._map.fire(new t.Event(Z,ot?{originalEvent:ot}:{}))},Nn.prototype._requestFrame=function(){var Z=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(ot){delete Z._frameId,Z.handleEvent(new wi("renderFrame",{timeStamp:ot})),Z._applyChanges()})},Nn.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var Oi=function(Z){function ot(et,xt){Z.call(this),this._moving=!1,this._zooming=!1,this.transform=et,this._bearingSnap=xt.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},ot.prototype.setCenter=function(et,xt){return this.jumpTo({center:et},xt)},ot.prototype.panBy=function(et,xt,Ut){return et=t.Point.convert(et).mult(-1),this.panTo(this.transform.center,t.extend({offset:et},xt),Ut)},ot.prototype.panTo=function(et,xt,Ut){return this.easeTo(t.extend({center:et},xt),Ut)},ot.prototype.getZoom=function(){return this.transform.zoom},ot.prototype.setZoom=function(et,xt){return this.jumpTo({zoom:et},xt),this},ot.prototype.zoomTo=function(et,xt,Ut){return this.easeTo(t.extend({zoom:et},xt),Ut)},ot.prototype.zoomIn=function(et,xt){return this.zoomTo(this.getZoom()+1,et,xt),this},ot.prototype.zoomOut=function(et,xt){return this.zoomTo(this.getZoom()-1,et,xt),this},ot.prototype.getBearing=function(){return this.transform.bearing},ot.prototype.setBearing=function(et,xt){return this.jumpTo({bearing:et},xt),this},ot.prototype.getPadding=function(){return this.transform.padding},ot.prototype.setPadding=function(et,xt){return this.jumpTo({padding:et},xt),this},ot.prototype.rotateTo=function(et,xt,Ut){return this.easeTo(t.extend({bearing:et},xt),Ut)},ot.prototype.resetNorth=function(et,xt){return this.rotateTo(0,t.extend({duration:1e3},et),xt),this},ot.prototype.resetNorthPitch=function(et,xt){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},et),xt),this},ot.prototype.snapToNorth=function(et,xt){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(et,xt):this},ot.prototype.getPitch=function(){return this.transform.pitch},ot.prototype.setPitch=function(et,xt){return this.jumpTo({pitch:et},xt),this},ot.prototype.cameraForBounds=function(et,xt){et=t.LngLatBounds.convert(et);var Ut=xt&&xt.bearing||0;return this._cameraForBoxAndBearing(et.getNorthWest(),et.getSouthEast(),Ut,xt)},ot.prototype._cameraForBoxAndBearing=function(et,xt,Ut,fe){var ye={top:0,bottom:0,right:0,left:0};if(fe=t.extend({padding:ye,offset:[0,0],maxZoom:this.transform.maxZoom},fe),typeof fe.padding=="number"){var Yt=fe.padding;fe.padding={top:Yt,bottom:Yt,right:Yt,left:Yt}}fe.padding=t.extend(ye,fe.padding);var ce=this.transform,Se=ce.padding,nr=ce.project(t.LngLat.convert(et)),Ye=ce.project(t.LngLat.convert(xt)),tr=nr.rotate(-Ut*Math.PI/180),lr=Ye.rotate(-Ut*Math.PI/180),hr=new t.Point(Math.max(tr.x,lr.x),Math.max(tr.y,lr.y)),Ve=new t.Point(Math.min(tr.x,lr.x),Math.min(tr.y,lr.y)),Xe=hr.sub(Ve),$e=(ce.width-(Se.left+Se.right+fe.padding.left+fe.padding.right))/Xe.x,Cr=(ce.height-(Se.top+Se.bottom+fe.padding.top+fe.padding.bottom))/Xe.y;if(Cr<0||$e<0){t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");return}var on=Math.min(ce.scaleZoom(ce.scale*Math.min($e,Cr)),fe.maxZoom),fn=typeof fe.offset.x=="number"?new t.Point(fe.offset.x,fe.offset.y):t.Point.convert(fe.offset),fi=(fe.padding.left-fe.padding.right)/2,si=(fe.padding.top-fe.padding.bottom)/2,Gn=new t.Point(fi,si),Mi=Gn.rotate(Ut*Math.PI/180),di=fn.add(Mi),Ki=di.mult(ce.scale/ce.zoomScale(on)),Ai=ce.unproject(nr.add(Ye).div(2).sub(Ki));return{center:Ai,zoom:on,bearing:Ut}},ot.prototype.fitBounds=function(et,xt,Ut){return this._fitInternal(this.cameraForBounds(et,xt),xt,Ut)},ot.prototype.fitScreenCoordinates=function(et,xt,Ut,fe,ye){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(et)),this.transform.pointLocation(t.Point.convert(xt)),Ut,fe),fe,ye)},ot.prototype._fitInternal=function(et,xt,Ut){return et?(xt=t.extend(et,xt),delete xt.padding,xt.linear?this.easeTo(xt,Ut):this.flyTo(xt,Ut)):this},ot.prototype.jumpTo=function(et,xt){this.stop();var Ut=this.transform,fe=!1,ye=!1,Yt=!1;return"zoom"in et&&Ut.zoom!==+et.zoom&&(fe=!0,Ut.zoom=+et.zoom),et.center!==void 0&&(Ut.center=t.LngLat.convert(et.center)),"bearing"in et&&Ut.bearing!==+et.bearing&&(ye=!0,Ut.bearing=+et.bearing),"pitch"in et&&Ut.pitch!==+et.pitch&&(Yt=!0,Ut.pitch=+et.pitch),et.padding!=null&&!Ut.isPaddingEqual(et.padding)&&(Ut.padding=et.padding),this.fire(new t.Event("movestart",xt)).fire(new t.Event("move",xt)),fe&&this.fire(new t.Event("zoomstart",xt)).fire(new t.Event("zoom",xt)).fire(new t.Event("zoomend",xt)),ye&&this.fire(new t.Event("rotatestart",xt)).fire(new t.Event("rotate",xt)).fire(new t.Event("rotateend",xt)),Yt&&this.fire(new t.Event("pitchstart",xt)).fire(new t.Event("pitch",xt)).fire(new t.Event("pitchend",xt)),this.fire(new t.Event("moveend",xt))},ot.prototype.easeTo=function(et,xt){var Ut=this;this._stop(!1,et.easeId),et=t.extend({offset:[0,0],duration:500,easing:t.ease},et),(et.animate===!1||!et.essential&&t.browser.prefersReducedMotion)&&(et.duration=0);var fe=this.transform,ye=this.getZoom(),Yt=this.getBearing(),ce=this.getPitch(),Se=this.getPadding(),nr="zoom"in et?+et.zoom:ye,Ye="bearing"in et?this._normalizeBearing(et.bearing,Yt):Yt,tr="pitch"in et?+et.pitch:ce,lr="padding"in et?et.padding:fe.padding,hr=t.Point.convert(et.offset),Ve=fe.centerPoint.add(hr),Xe=fe.pointLocation(Ve),$e=t.LngLat.convert(et.center||Xe);this._normalizeCenter($e);var Cr=fe.project(Xe),on=fe.project($e).sub(Cr),fn=fe.zoomScale(nr-ye),fi,si;et.around&&(fi=t.LngLat.convert(et.around),si=fe.locationPoint(fi));var Gn={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||nr!==ye,this._rotating=this._rotating||Yt!==Ye,this._pitching=this._pitching||tr!==ce,this._padding=!fe.isPaddingEqual(lr),this._easeId=et.easeId,this._prepareEase(xt,et.noMoveStart,Gn),this._ease(function(Mi){if(Ut._zooming&&(fe.zoom=t.number(ye,nr,Mi)),Ut._rotating&&(fe.bearing=t.number(Yt,Ye,Mi)),Ut._pitching&&(fe.pitch=t.number(ce,tr,Mi)),Ut._padding&&(fe.interpolatePadding(Se,lr,Mi),Ve=fe.centerPoint.add(hr)),fi)fe.setLocationAtPoint(fi,si);else{var di=fe.zoomScale(fe.zoom-ye),Ki=nr>ye?Math.min(2,fn):Math.max(.5,fn),Ai=Math.pow(Ki,1-Mi),Si=fe.unproject(Cr.add(on.mult(Mi*Ai)).mult(di));fe.setLocationAtPoint(fe.renderWorldCopies?Si.wrap():Si,Ve)}Ut._fireMoveEvents(xt)},function(Mi){Ut._afterEase(xt,Mi)},et),this},ot.prototype._prepareEase=function(et,xt,Ut){Ut===void 0&&(Ut={}),this._moving=!0,!xt&&!Ut.moving&&this.fire(new t.Event("movestart",et)),this._zooming&&!Ut.zooming&&this.fire(new t.Event("zoomstart",et)),this._rotating&&!Ut.rotating&&this.fire(new t.Event("rotatestart",et)),this._pitching&&!Ut.pitching&&this.fire(new t.Event("pitchstart",et))},ot.prototype._fireMoveEvents=function(et){this.fire(new t.Event("move",et)),this._zooming&&this.fire(new t.Event("zoom",et)),this._rotating&&this.fire(new t.Event("rotate",et)),this._pitching&&this.fire(new t.Event("pitch",et))},ot.prototype._afterEase=function(et,xt){if(!(this._easeId&&xt&&this._easeId===xt)){delete this._easeId;var Ut=this._zooming,fe=this._rotating,ye=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ut&&this.fire(new t.Event("zoomend",et)),fe&&this.fire(new t.Event("rotateend",et)),ye&&this.fire(new t.Event("pitchend",et)),this.fire(new t.Event("moveend",et))}},ot.prototype.flyTo=function(et,xt){var Ut=this;if(!et.essential&&t.browser.prefersReducedMotion){var fe=t.pick(et,["center","zoom","bearing","pitch","around"]);return this.jumpTo(fe,xt)}this.stop(),et=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},et);var ye=this.transform,Yt=this.getZoom(),ce=this.getBearing(),Se=this.getPitch(),nr=this.getPadding(),Ye="zoom"in et?t.clamp(+et.zoom,ye.minZoom,ye.maxZoom):Yt,tr="bearing"in et?this._normalizeBearing(et.bearing,ce):ce,lr="pitch"in et?+et.pitch:Se,hr="padding"in et?et.padding:ye.padding,Ve=ye.zoomScale(Ye-Yt),Xe=t.Point.convert(et.offset),$e=ye.centerPoint.add(Xe),Cr=ye.pointLocation($e),on=t.LngLat.convert(et.center||Cr);this._normalizeCenter(on);var fn=ye.project(Cr),fi=ye.project(on).sub(fn),si=et.curve,Gn=Math.max(ye.width,ye.height),Mi=Gn/Ve,di=fi.mag();if("minZoom"in et){var Ki=t.clamp(Math.min(et.minZoom,Yt,Ye),ye.minZoom,ye.maxZoom),Ai=Gn/ye.zoomScale(Ki-Yt);si=Math.sqrt(Ai/di*2)}var Si=si*si;function sa(Ds){var Au=(Mi*Mi-Gn*Gn+(Ds?-1:1)*Si*Si*di*di)/(2*(Ds?Mi:Gn)*Si*di);return Math.log(Math.sqrt(Au*Au+1)-Au)}function Qa(Ds){return(Math.exp(Ds)-Math.exp(-Ds))/2}function so(Ds){return(Math.exp(Ds)+Math.exp(-Ds))/2}function Vo(Ds){return Qa(Ds)/so(Ds)}var vs=sa(0),zl=function(Ds){return so(vs)/so(vs+si*Ds)},jl=function(Ds){return Gn*((so(vs)*Vo(vs+si*Ds)-Qa(vs))/Si)/di},dl=(sa(1)-vs)/si;if(Math.abs(di)<1e-6||!isFinite(dl)){if(Math.abs(Gn-Mi)<1e-6)return this.easeTo(et,xt);var Ul=Mi<Gn?-1:1;dl=Math.abs(Math.log(Mi/Gn))/si,jl=function(){return 0},zl=function(Ds){return Math.exp(Ul*si*Ds)}}if("duration"in et)et.duration=+et.duration;else{var _c="screenSpeed"in et?+et.screenSpeed/si:+et.speed;et.duration=1e3*dl/_c}return et.maxDuration&&et.duration>et.maxDuration&&(et.duration=0),this._zooming=!0,this._rotating=ce!==tr,this._pitching=lr!==Se,this._padding=!ye.isPaddingEqual(hr),this._prepareEase(xt,!1),this._ease(function(Ds){var Au=Ds*dl,nf=1/zl(Au);ye.zoom=Ds===1?Ye:Yt+ye.scaleZoom(nf),Ut._rotating&&(ye.bearing=t.number(ce,tr,Ds)),Ut._pitching&&(ye.pitch=t.number(Se,lr,Ds)),Ut._padding&&(ye.interpolatePadding(nr,hr,Ds),$e=ye.centerPoint.add(Xe));var zf=Ds===1?on:ye.unproject(fn.add(fi.mult(jl(Au))).mult(nf));ye.setLocationAtPoint(ye.renderWorldCopies?zf.wrap():zf,$e),Ut._fireMoveEvents(xt)},function(){return Ut._afterEase(xt)},et),this},ot.prototype.isEasing=function(){return!!this._easeFrameId},ot.prototype.stop=function(){return this._stop()},ot.prototype._stop=function(et,xt){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Ut=this._onEaseEnd;delete this._onEaseEnd,Ut.call(this,xt)}if(!et){var fe=this.handlers;fe&&fe.stop(!1)}return this},ot.prototype._ease=function(et,xt,Ut){Ut.animate===!1||Ut.duration===0?(et(1),xt()):(this._easeStart=t.browser.now(),this._easeOptions=Ut,this._onEaseFrame=et,this._onEaseEnd=xt,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},ot.prototype._renderFrameCallback=function(){var et=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(et)),et<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},ot.prototype._normalizeBearing=function(et,xt){et=t.wrap(et,-180,180);var Ut=Math.abs(et-xt);return Math.abs(et-360-xt)<Ut&&(et-=360),Math.abs(et+360-xt)<Ut&&(et+=360),et},ot.prototype._normalizeCenter=function(et){var xt=this.transform;if(!(!xt.renderWorldCopies||xt.lngRange)){var Ut=et.lng-xt.center.lng;et.lng+=Ut>180?-360:Ut<-180?360:0}},ot}(t.Evented),_i=function(Z){Z===void 0&&(Z={}),this.options=Z,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};_i.prototype.getDefaultPosition=function(){return"bottom-right"},_i.prototype.onAdd=function(Z){var ot=this.options&&this.options.compact;return this._map=Z,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"),ot&&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),ot===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},_i.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},_i.prototype._setElementTitle=function(Z,ot){var et=this._map._getUIString("AttributionControl."+ot);Z.title=et,Z.setAttribute("aria-label",et)},_i.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"))},_i.prototype._updateEditLink=function(){var Z=this._editLink;Z||(Z=this._editLink=this._container.querySelector(".mapbox-improve-map"));var ot=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(Z){var et=ot.reduce(function(xt,Ut,fe){return Ut.value&&(xt+=Ut.key+"="+Ut.value+(fe<ot.length-1?"&":"")),xt},"?");Z.href=t.config.FEEDBACK_URL+"/"+et+(this._map._hash?this._map._hash.getHashString(!0):""),Z.rel="noopener nofollow",this._setElementTitle(Z,"MapFeedback")}},_i.prototype._updateData=function(Z){Z&&(Z.sourceDataType==="metadata"||Z.sourceDataType==="visibility"||Z.dataType==="style")&&(this._updateAttributions(),this._updateEditLink())},_i.prototype._updateAttributions=function(){if(this._map.style){var Z=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?Z=Z.concat(this.options.customAttribution.map(function(Yt){return typeof Yt!="string"?"":Yt})):typeof this.options.customAttribution=="string"&&Z.push(this.options.customAttribution)),this._map.style.stylesheet){var ot=this._map.style.stylesheet;this.styleOwner=ot.owner,this.styleId=ot.id}var et=this._map.style.sourceCaches;for(var xt in et){var Ut=et[xt];if(Ut.used){var fe=Ut.getSource();fe.attribution&&Z.indexOf(fe.attribution)<0&&Z.push(fe.attribution)}}Z.sort(function(Yt,ce){return Yt.length-ce.length}),Z=Z.filter(function(Yt,ce){for(var Se=ce+1;Se<Z.length;Se++)if(Z[Se].indexOf(Yt)>=0)return!1;return!0});var ye=Z.join(" | ");ye!==this._attribHTML&&(this._attribHTML=ye,Z.length?(this._innerContainer.innerHTML=ye,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},_i.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Qn=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Qn.prototype.onAdd=function(Z){this._map=Z,this._container=r.create("div","mapboxgl-ctrl");var ot=r.create("a","mapboxgl-ctrl-logo");return ot.target="_blank",ot.rel="noopener nofollow",ot.href="https://www.mapbox.com/",ot.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ot.setAttribute("rel","noopener nofollow"),this._container.appendChild(ot),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Qn.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Qn.prototype.getDefaultPosition=function(){return"bottom-left"},Qn.prototype._updateLogo=function(Z){(!Z||Z.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},Qn.prototype._logoRequired=function(){if(this._map.style){var Z=this._map.style.sourceCaches;for(var ot in Z){var et=Z[ot].getSource();if(et.mapbox_logo)return!0}return!1}},Qn.prototype._updateCompact=function(){var Z=this._container.children;if(Z.length){var ot=Z[0];this._map.getCanvasContainer().offsetWidth<250?ot.classList.add("mapboxgl-compact"):ot.classList.remove("mapboxgl-compact")}};var Ma=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ma.prototype.add=function(Z){var ot=++this._id,et=this._queue;return et.push({callback:Z,id:ot,cancelled:!1}),ot},Ma.prototype.remove=function(Z){for(var ot=this._currentlyRunning,et=ot?this._queue.concat(ot):this._queue,xt=0,Ut=et;xt<Ut.length;xt+=1){var fe=Ut[xt];if(fe.id===Z){fe.cancelled=!0;return}}},Ma.prototype.run=function(Z){Z===void 0&&(Z=0);var ot=this._currentlyRunning=this._queue;this._queue=[];for(var et=0,xt=ot;et<xt.length;et+=1){var Ut=xt[et];if(!Ut.cancelled&&(Ut.callback(Z),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Ma.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var ca={"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"},Ua=t.window.HTMLImageElement,vi=t.window.HTMLElement,ti=t.window.ImageBitmap,Sa=-2,pa=22,qi=0,$i=60,_a={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:Sa,maxZoom:pa,minPitch:qi,maxPitch:$i,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},Po=function(Z){function ot(xt){var Ut=this;if(xt=t.extend({},_a,xt),xt.minZoom!=null&&xt.maxZoom!=null&&xt.minZoom>xt.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(xt.minPitch!=null&&xt.maxPitch!=null&&xt.minPitch>xt.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(xt.minPitch!=null&&xt.minPitch<qi)throw new Error("minPitch must be greater than or equal to "+qi);if(xt.maxPitch!=null&&xt.maxPitch>$i)throw new Error("maxPitch must be less than or equal to "+$i);var fe=new Ws(xt.minZoom,xt.maxZoom,xt.minPitch,xt.maxPitch,xt.renderWorldCopies);if(Z.call(this,fe,xt),this._interactive=xt.interactive,this._maxTileCacheSize=xt.maxTileCacheSize,this._failIfMajorPerformanceCaveat=xt.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=xt.preserveDrawingBuffer,this._antialias=xt.antialias,this._trackResize=xt.trackResize,this._bearingSnap=xt.bearingSnap,this._refreshExpiredTiles=xt.refreshExpiredTiles,this._fadeDuration=xt.fadeDuration,this._crossSourceCollisions=xt.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=xt.collectResourceTiming,this._renderTaskQueue=new Ma,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},ca,xt.locale),this._clickTolerance=xt.clickTolerance,this._requestManager=new t.RequestManager(xt.transformRequest,xt.accessToken),typeof xt.container=="string"){if(this._container=t.window.document.getElementById(xt.container),!this._container)throw new Error("Container '"+xt.container+"' not found.")}else if(xt.container instanceof vi)this._container=xt.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(xt.maxBounds&&this.setMaxBounds(xt.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 Ut._update(!1)}),this.on("moveend",function(){return Ut._update(!1)}),this.on("zoom",function(){return Ut._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 Nn(this,xt);var ye=typeof xt.hash=="string"&&xt.hash||void 0;this._hash=xt.hash&&new dc(ye).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:xt.center,zoom:xt.zoom,bearing:xt.bearing,pitch:xt.pitch}),xt.bounds&&(this.resize(),this.fitBounds(xt.bounds,t.extend({},xt.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=xt.localIdeographFontFamily,xt.style&&this.setStyle(xt.style,{localIdeographFontFamily:xt.localIdeographFontFamily}),xt.attributionControl&&this.addControl(new _i({customAttribution:xt.customAttribution})),this.addControl(new Qn,xt.logoPosition),this.on("style.load",function(){Ut.transform.unmodified&&Ut.jumpTo(Ut.style.stylesheet)}),this.on("data",function(Yt){Ut._update(Yt.dataType==="style"),Ut.fire(new t.Event(Yt.dataType+"data",Yt))}),this.on("dataloading",function(Yt){Ut.fire(new t.Event(Yt.dataType+"dataloading",Yt))})}Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot;var et={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return ot.prototype._getMapId=function(){return this._mapId},ot.prototype.addControl=function(xt,Ut){if(Ut===void 0&&(xt.getDefaultPosition?Ut=xt.getDefaultPosition():Ut="top-right"),!xt||!xt.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 fe=xt.onAdd(this);this._controls.push(xt);var ye=this._controlPositions[Ut];return Ut.indexOf("bottom")!==-1?ye.insertBefore(fe,ye.firstChild):ye.appendChild(fe),this},ot.prototype.removeControl=function(xt){if(!xt||!xt.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 Ut=this._controls.indexOf(xt);return Ut>-1&&this._controls.splice(Ut,1),xt.onRemove(this),this},ot.prototype.hasControl=function(xt){return this._controls.indexOf(xt)>-1},ot.prototype.resize=function(xt){var Ut=this._containerDimensions(),fe=Ut[0],ye=Ut[1];this._resizeCanvas(fe,ye),this.transform.resize(fe,ye),this.painter.resize(fe,ye);var Yt=!this._moving;return Yt&&(this.stop(),this.fire(new t.Event("movestart",xt)).fire(new t.Event("move",xt))),this.fire(new t.Event("resize",xt)),Yt&&this.fire(new t.Event("moveend",xt)),this},ot.prototype.getBounds=function(){return this.transform.getBounds()},ot.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},ot.prototype.setMaxBounds=function(xt){return this.transform.setMaxBounds(t.LngLatBounds.convert(xt)),this._update()},ot.prototype.setMinZoom=function(xt){if(xt=xt??Sa,xt>=Sa&&xt<=this.transform.maxZoom)return this.transform.minZoom=xt,this._update(),this.getZoom()<xt&&this.setZoom(xt),this;throw new Error("minZoom must be between "+Sa+" and the current maxZoom, inclusive")},ot.prototype.getMinZoom=function(){return this.transform.minZoom},ot.prototype.setMaxZoom=function(xt){if(xt=xt??pa,xt>=this.transform.minZoom)return this.transform.maxZoom=xt,this._update(),this.getZoom()>xt&&this.setZoom(xt),this;throw new Error("maxZoom must be greater than the current minZoom")},ot.prototype.getMaxZoom=function(){return this.transform.maxZoom},ot.prototype.setMinPitch=function(xt){if(xt=xt??qi,xt<qi)throw new Error("minPitch must be greater than or equal to "+qi);if(xt>=qi&&xt<=this.transform.maxPitch)return this.transform.minPitch=xt,this._update(),this.getPitch()<xt&&this.setPitch(xt),this;throw new Error("minPitch must be between "+qi+" and the current maxPitch, inclusive")},ot.prototype.getMinPitch=function(){return this.transform.minPitch},ot.prototype.setMaxPitch=function(xt){if(xt=xt??$i,xt>$i)throw new Error("maxPitch must be less than or equal to "+$i);if(xt>=this.transform.minPitch)return this.transform.maxPitch=xt,this._update(),this.getPitch()>xt&&this.setPitch(xt),this;throw new Error("maxPitch must be greater than the current minPitch")},ot.prototype.getMaxPitch=function(){return this.transform.maxPitch},ot.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},ot.prototype.setRenderWorldCopies=function(xt){return this.transform.renderWorldCopies=xt,this._update()},ot.prototype.project=function(xt){return this.transform.locationPoint(t.LngLat.convert(xt))},ot.prototype.unproject=function(xt){return this.transform.pointLocation(t.Point.convert(xt))},ot.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},ot.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},ot.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},ot.prototype._createDelegatedListener=function(xt,Ut,fe){var ye=this,Yt;if(xt==="mouseenter"||xt==="mouseover"){var ce=!1,Se=function(Ve){var Xe=ye.getLayer(Ut)?ye.queryRenderedFeatures(Ve.point,{layers:[Ut]}):[];Xe.length?ce||(ce=!0,fe.call(ye,new ir(xt,ye,Ve.originalEvent,{features:Xe}))):ce=!1},nr=function(){ce=!1};return{layer:Ut,listener:fe,delegates:{mousemove:Se,mouseout:nr}}}else if(xt==="mouseleave"||xt==="mouseout"){var Ye=!1,tr=function(Ve){var Xe=ye.getLayer(Ut)?ye.queryRenderedFeatures(Ve.point,{layers:[Ut]}):[];Xe.length?Ye=!0:Ye&&(Ye=!1,fe.call(ye,new ir(xt,ye,Ve.originalEvent)))},lr=function(Ve){Ye&&(Ye=!1,fe.call(ye,new ir(xt,ye,Ve.originalEvent)))};return{layer:Ut,listener:fe,delegates:{mousemove:tr,mouseout:lr}}}else{var hr=function(Ve){var Xe=ye.getLayer(Ut)?ye.queryRenderedFeatures(Ve.point,{layers:[Ut]}):[];Xe.length&&(Ve.features=Xe,fe.call(ye,Ve),delete Ve.features)};return{layer:Ut,listener:fe,delegates:(Yt={},Yt[xt]=hr,Yt)}}},ot.prototype.on=function(xt,Ut,fe){if(fe===void 0)return Z.prototype.on.call(this,xt,Ut);var ye=this._createDelegatedListener(xt,Ut,fe);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[xt]=this._delegatedListeners[xt]||[],this._delegatedListeners[xt].push(ye);for(var Yt in ye.delegates)this.on(Yt,ye.delegates[Yt]);return this},ot.prototype.once=function(xt,Ut,fe){if(fe===void 0)return Z.prototype.once.call(this,xt,Ut);var ye=this._createDelegatedListener(xt,Ut,fe);for(var Yt in ye.delegates)this.once(Yt,ye.delegates[Yt]);return this},ot.prototype.off=function(xt,Ut,fe){var ye=this;if(fe===void 0)return Z.prototype.off.call(this,xt,Ut);var Yt=function(ce){for(var Se=ce[xt],nr=0;nr<Se.length;nr++){var Ye=Se[nr];if(Ye.layer===Ut&&Ye.listener===fe){for(var tr in Ye.delegates)ye.off(tr,Ye.delegates[tr]);return Se.splice(nr,1),ye}}};return this._delegatedListeners&&this._delegatedListeners[xt]&&Yt(this._delegatedListeners),this},ot.prototype.queryRenderedFeatures=function(xt,Ut){if(!this.style)return[];Ut===void 0&&xt!==void 0&&!(xt instanceof t.Point)&&!Array.isArray(xt)&&(Ut=xt,xt=void 0),Ut=Ut||{},xt=xt||[[0,0],[this.transform.width,this.transform.height]];var fe;if(xt instanceof t.Point||typeof xt[0]=="number")fe=[t.Point.convert(xt)];else{var ye=t.Point.convert(xt[0]),Yt=t.Point.convert(xt[1]);fe=[ye,new t.Point(Yt.x,ye.y),Yt,new t.Point(ye.x,Yt.y),ye]}return this.style.queryRenderedFeatures(fe,Ut,this.transform)},ot.prototype.querySourceFeatures=function(xt,Ut){return this.style.querySourceFeatures(xt,Ut)},ot.prototype.setStyle=function(xt,Ut){return Ut=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},Ut),Ut.diff!==!1&&Ut.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&xt?(this._diffStyle(xt,Ut),this):(this._localIdeographFontFamily=Ut.localIdeographFontFamily,this._updateStyle(xt,Ut))},ot.prototype._getUIString=function(xt){var Ut=this._locale[xt];if(Ut==null)throw new Error("Missing UI string '"+xt+"'");return Ut},ot.prototype._updateStyle=function(xt,Ut){if(this.style&&(this.style.setEventedParent(null),this.style._remove()),xt)this.style=new ac(this,Ut||{});else return delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof xt=="string"?this.style.loadURL(xt):this.style.loadJSON(xt),this},ot.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new ac(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},ot.prototype._diffStyle=function(xt,Ut){var fe=this;if(typeof xt=="string"){var ye=this._requestManager.normalizeStyleURL(xt),Yt=this._requestManager.transformRequest(ye,t.ResourceType.Style);t.getJSON(Yt,function(ce,Se){ce?fe.fire(new t.ErrorEvent(ce)):Se&&fe._updateDiff(Se,Ut)})}else typeof xt=="object"&&this._updateDiff(xt,Ut)},ot.prototype._updateDiff=function(xt,Ut){try{this.style.setState(xt)&&this._update(!0)}catch(fe){t.warnOnce("Unable to perform style diff: "+(fe.message||fe.error||fe)+". Rebuilding the style from scratch."),this._updateStyle(xt,Ut)}},ot.prototype.getStyle=function(){if(this.style)return this.style.serialize()},ot.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},ot.prototype.addSource=function(xt,Ut){return this._lazyInitEmptyStyle(),this.style.addSource(xt,Ut),this._update(!0)},ot.prototype.isSourceLoaded=function(xt){var Ut=this.style&&this.style.sourceCaches[xt];if(Ut===void 0){this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+xt+"'")));return}return Ut.loaded()},ot.prototype.areTilesLoaded=function(){var xt=this.style&&this.style.sourceCaches;for(var Ut in xt){var fe=xt[Ut],ye=fe._tiles;for(var Yt in ye){var ce=ye[Yt];if(!(ce.state==="loaded"||ce.state==="errored"))return!1}}return!0},ot.prototype.addSourceType=function(xt,Ut,fe){return this._lazyInitEmptyStyle(),this.style.addSourceType(xt,Ut,fe)},ot.prototype.removeSource=function(xt){return this.style.removeSource(xt),this._update(!0)},ot.prototype.getSource=function(xt){return this.style.getSource(xt)},ot.prototype.addImage=function(xt,Ut,fe){fe===void 0&&(fe={});var ye=fe.pixelRatio;ye===void 0&&(ye=1);var Yt=fe.sdf;Yt===void 0&&(Yt=!1);var ce=fe.stretchX,Se=fe.stretchY,nr=fe.content;this._lazyInitEmptyStyle();var Ye=0;if(Ut instanceof Ua||ti&&Ut instanceof ti){var tr=t.browser.getImageData(Ut),lr=tr.width,hr=tr.height,Ve=tr.data;this.style.addImage(xt,{data:new t.RGBAImage({width:lr,height:hr},Ve),pixelRatio:ye,stretchX:ce,stretchY:Se,content:nr,sdf:Yt,version:Ye})}else{if(Ut.width===void 0||Ut.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 Xe=Ut.width,$e=Ut.height,Cr=Ut.data,on=Ut;this.style.addImage(xt,{data:new t.RGBAImage({width:Xe,height:$e},new Uint8Array(Cr)),pixelRatio:ye,stretchX:ce,stretchY:Se,content:nr,sdf:Yt,version:Ye,userImage:on}),on.onAdd&&on.onAdd(this,xt)}},ot.prototype.updateImage=function(xt,Ut){var fe=this.style.getImage(xt);if(!fe)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 ye=Ut instanceof Ua||ti&&Ut instanceof ti?t.browser.getImageData(Ut):Ut,Yt=ye.width,ce=ye.height,Se=ye.data;if(Yt===void 0||ce===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(Yt!==fe.data.width||ce!==fe.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 nr=!(Ut instanceof Ua||ti&&Ut instanceof ti);fe.data.replace(Se,nr),this.style.updateImage(xt,fe)},ot.prototype.hasImage=function(xt){return xt?!!this.style.getImage(xt):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},ot.prototype.removeImage=function(xt){this.style.removeImage(xt)},ot.prototype.loadImage=function(xt,Ut){t.getImage(this._requestManager.transformRequest(xt,t.ResourceType.Image),Ut)},ot.prototype.listImages=function(){return this.style.listImages()},ot.prototype.addLayer=function(xt,Ut){return this._lazyInitEmptyStyle(),this.style.addLayer(xt,Ut),this._update(!0)},ot.prototype.moveLayer=function(xt,Ut){return this.style.moveLayer(xt,Ut),this._update(!0)},ot.prototype.removeLayer=function(xt){return this.style.removeLayer(xt),this._update(!0)},ot.prototype.getLayer=function(xt){return this.style.getLayer(xt)},ot.prototype.setLayerZoomRange=function(xt,Ut,fe){return this.style.setLayerZoomRange(xt,Ut,fe),this._update(!0)},ot.prototype.setFilter=function(xt,Ut,fe){return fe===void 0&&(fe={}),this.style.setFilter(xt,Ut,fe),this._update(!0)},ot.prototype.getFilter=function(xt){return this.style.getFilter(xt)},ot.prototype.setPaintProperty=function(xt,Ut,fe,ye){return ye===void 0&&(ye={}),this.style.setPaintProperty(xt,Ut,fe,ye),this._update(!0)},ot.prototype.getPaintProperty=function(xt,Ut){return this.style.getPaintProperty(xt,Ut)},ot.prototype.setLayoutProperty=function(xt,Ut,fe,ye){return ye===void 0&&(ye={}),this.style.setLayoutProperty(xt,Ut,fe,ye),this._update(!0)},ot.prototype.getLayoutProperty=function(xt,Ut){return this.style.getLayoutProperty(xt,Ut)},ot.prototype.setLight=function(xt,Ut){return Ut===void 0&&(Ut={}),this._lazyInitEmptyStyle(),this.style.setLight(xt,Ut),this._update(!0)},ot.prototype.getLight=function(){return this.style.getLight()},ot.prototype.setFeatureState=function(xt,Ut){return this.style.setFeatureState(xt,Ut),this._update()},ot.prototype.removeFeatureState=function(xt,Ut){return this.style.removeFeatureState(xt,Ut),this._update()},ot.prototype.getFeatureState=function(xt){return this.style.getFeatureState(xt)},ot.prototype.getContainer=function(){return this._container},ot.prototype.getCanvasContainer=function(){return this._canvasContainer},ot.prototype.getCanvas=function(){return this._canvas},ot.prototype._containerDimensions=function(){var xt=0,Ut=0;return this._container&&(xt=this._container.clientWidth||400,Ut=this._container.clientHeight||300),[xt,Ut]},ot.prototype._detectMissingCSS=function(){var xt=t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color");xt!=="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/.")},ot.prototype._setupContainer=function(){var xt=this._container;xt.classList.add("mapboxgl-map");var Ut=this._missingCSSCanary=r.create("div","mapboxgl-canary",xt);Ut.style.visibility="hidden",this._detectMissingCSS();var fe=this._canvasContainer=r.create("div","mapboxgl-canvas-container",xt);this._interactive&&fe.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",fe),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 ye=this._containerDimensions();this._resizeCanvas(ye[0],ye[1]);var Yt=this._controlContainer=r.create("div","mapboxgl-control-container",xt),ce=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(Se){ce[Se]=r.create("div","mapboxgl-ctrl-"+Se,Yt)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},ot.prototype._resizeCanvas=function(xt,Ut){var fe=t.browser.devicePixelRatio||1;this._canvas.width=fe*xt,this._canvas.height=fe*Ut,this._canvas.style.width=xt+"px",this._canvas.style.height=Ut+"px"},ot.prototype._setupPainter=function(){var xt=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),Ut=this._canvas.getContext("webgl",xt)||this._canvas.getContext("experimental-webgl",xt);if(!Ut){this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")));return}this.painter=new Os(Ut,this.transform),t.webpSupported.testSupport(Ut)},ot.prototype._contextLost=function(xt){xt.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:xt}))},ot.prototype._contextRestored=function(xt){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:xt}))},ot.prototype._onMapScroll=function(xt){if(xt.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},ot.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},ot.prototype._update=function(xt){return this.style?(this._styleDirty=this._styleDirty||xt,this._sourcesDirty=!0,this.triggerRepaint(),this):this},ot.prototype._requestRenderFrame=function(xt){return this._update(),this._renderTaskQueue.add(xt)},ot.prototype._cancelRenderFrame=function(xt){this._renderTaskQueue.remove(xt)},ot.prototype._render=function(xt){var Ut=this,fe,ye=0,Yt=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(fe=Yt.createQueryEXT(),Yt.beginQueryEXT(Yt.TIME_ELAPSED_EXT,fe),ye=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(xt),!this._removed){var ce=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var Se=this.transform.zoom,nr=t.browser.now();this.style.zoomHistory.update(Se,nr);var Ye=new t.EvaluationParameters(Se,{now:nr,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),tr=Ye.crossFadingFactor();(tr!==1||tr!==this._crossFadingFactor)&&(ce=!0,this._crossFadingFactor=tr),this.style.update(Ye)}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()||ce)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var lr=t.browser.now()-ye;Yt.endQueryEXT(Yt.TIME_ELAPSED_EXT,fe),setTimeout(function(){var Xe=Yt.getQueryObjectEXT(fe,Yt.QUERY_RESULT_EXT)/1e6;Yt.deleteQueryEXT(fe),Ut.fire(new t.Event("gpu-timing-frame",{cpuTime:lr,gpuTime:Xe}))},50)}if(this.listens("gpu-timing-layer")){var hr=this.painter.collectGpuTimers();setTimeout(function(){var Xe=Ut.painter.queryGpuTimers(hr);Ut.fire(new t.Event("gpu-timing-layer",{layerTimes:Xe}))},50)}var Ve=this._sourcesDirty||this._styleDirty||this._placementDirty;return Ve||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),this._loaded&&!this._fullyLoaded&&!Ve&&(this._fullyLoaded=!0),this}},ot.prototype.remove=function(){this._hash&&this._hash.remove();for(var xt=0,Ut=this._controls;xt<Ut.length;xt+=1){var fe=Ut[xt];fe.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 ye=this.painter.context.gl.getExtension("WEBGL_lose_context");ye&&ye.loseContext&&ye.loseContext(),wo(this._canvasContainer),wo(this._controlContainer),wo(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},ot.prototype.triggerRepaint=function(){var xt=this;this.style&&!this._frame&&(this._frame=t.browser.frame(function(Ut){xt._frame=null,xt._render(Ut)}))},ot.prototype._onWindowOnline=function(){this._update()},ot.prototype._onWindowResize=function(xt){this._trackResize&&this.resize({originalEvent:xt})._update()},et.showTileBoundaries.get=function(){return!!this._showTileBoundaries},et.showTileBoundaries.set=function(xt){this._showTileBoundaries!==xt&&(this._showTileBoundaries=xt,this._update())},et.showPadding.get=function(){return!!this._showPadding},et.showPadding.set=function(xt){this._showPadding!==xt&&(this._showPadding=xt,this._update())},et.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},et.showCollisionBoxes.set=function(xt){this._showCollisionBoxes!==xt&&(this._showCollisionBoxes=xt,xt?this.style._generateCollisionBoxes():this._update())},et.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},et.showOverdrawInspector.set=function(xt){this._showOverdrawInspector!==xt&&(this._showOverdrawInspector=xt,this._update())},et.repaint.get=function(){return!!this._repaint},et.repaint.set=function(xt){this._repaint!==xt&&(this._repaint=xt,this.triggerRepaint())},et.vertices.get=function(){return!!this._vertices},et.vertices.set=function(xt){this._vertices=xt,this._update()},ot.prototype._setCacheLimits=function(xt,Ut){t.setCacheLimits(xt,Ut)},et.version.get=function(){return t.version},Object.defineProperties(ot.prototype,et),ot}(Oi);function wo(Z){Z.parentNode&&Z.parentNode.removeChild(Z)}var xa={showCompass:!0,showZoom:!0,visualizePitch:!1},Oa=function(Z){var ot=this;this.options=t.extend({},xa,Z),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(et){return et.preventDefault()}),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(et){return ot._map.zoomIn({},{originalEvent:et})}),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(et){return ot._map.zoomOut({},{originalEvent:et})}),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(et){ot.options.visualizePitch?ot._map.resetNorthPitch({},{originalEvent:et}):ot._map.resetNorth({},{originalEvent:et})}),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Oa.prototype._updateZoomButtons=function(){var Z=this._map.getZoom(),ot=Z===this._map.getMaxZoom(),et=Z===this._map.getMinZoom();this._zoomInButton.disabled=ot,this._zoomOutButton.disabled=et,this._zoomInButton.setAttribute("aria-disabled",ot.toString()),this._zoomOutButton.setAttribute("aria-disabled",et.toString())},Oa.prototype._rotateCompassArrow=function(){var 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},Oa.prototype.onAdd=function(Z){return this._map=Z,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 ho(this._map,this._compass,this.options.visualizePitch)),this._container},Oa.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},Oa.prototype._createButton=function(Z,ot){var et=r.create("button",Z,this._container);return et.type="button",et.addEventListener("click",ot),et},Oa.prototype._setButtonTitle=function(Z,ot){var et=this._map._getUIString("NavigationControl."+ot);Z.title=et,Z.setAttribute("aria-label",et)};var ho=function(Z,ot,et){et===void 0&&(et=!1),this._clickTolerance=10,this.element=ot,this.mouseRotate=new al({clickTolerance:Z.dragRotate._mouseRotate._clickTolerance}),this.map=Z,et&&(this.mousePitch=new Wo({clickTolerance:Z.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(ot,"mousedown",this.mousedown),r.addEventListener(ot,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(ot,"touchmove",this.touchmove),r.addEventListener(ot,"touchend",this.touchend),r.addEventListener(ot,"touchcancel",this.reset)};ho.prototype.down=function(Z,ot){this.mouseRotate.mousedown(Z,ot),this.mousePitch&&this.mousePitch.mousedown(Z,ot),r.disableDrag()},ho.prototype.move=function(Z,ot){var et=this.map,xt=this.mouseRotate.mousemoveWindow(Z,ot);if(xt&&xt.bearingDelta&&et.setBearing(et.getBearing()+xt.bearingDelta),this.mousePitch){var Ut=this.mousePitch.mousemoveWindow(Z,ot);Ut&&Ut.pitchDelta&&et.setPitch(et.getPitch()+Ut.pitchDelta)}},ho.prototype.off=function(){var Z=this.element;r.removeEventListener(Z,"mousedown",this.mousedown),r.removeEventListener(Z,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(Z,"touchmove",this.touchmove),r.removeEventListener(Z,"touchend",this.touchend),r.removeEventListener(Z,"touchcancel",this.reset),this.offTemp()},ho.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},ho.prototype.mousedown=function(Z){this.down(t.extend({},Z,{ctrlKey:!0,preventDefault:function(){return Z.preventDefault()}}),r.mousePos(this.element,Z)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},ho.prototype.mousemove=function(Z){this.move(Z,r.mousePos(this.element,Z))},ho.prototype.mouseup=function(Z){this.mouseRotate.mouseupWindow(Z),this.mousePitch&&this.mousePitch.mouseupWindow(Z),this.offTemp()},ho.prototype.touchstart=function(Z){Z.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,Z.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return Z.preventDefault()}},this._startPos))},ho.prototype.touchmove=function(Z){Z.targetTouches.length!==1?this.reset():(this._lastPos=r.touchPos(this.element,Z.targetTouches)[0],this.move({preventDefault:function(){return Z.preventDefault()}},this._lastPos))},ho.prototype.touchend=function(Z){Z.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},ho.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};function So(Z,ot,et){if(Z=new t.LngLat(Z.lng,Z.lat),ot){var xt=new t.LngLat(Z.lng-360,Z.lat),Ut=new t.LngLat(Z.lng+360,Z.lat),fe=et.locationPoint(Z).distSqr(ot);et.locationPoint(xt).distSqr(ot)<fe?Z=xt:et.locationPoint(Ut).distSqr(ot)<fe&&(Z=Ut)}for(;Math.abs(Z.lng-et.center.lng)>180;){var ye=et.locationPoint(Z);if(ye.x>=0&&ye.y>=0&&ye.x<=et.width&&ye.y<=et.height)break;Z.lng>et.center.lng?Z.lng-=360:Z.lng+=360}return Z}var ts={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 Nl(Z,ot,et){var xt=Z.classList;for(var Ut in ts)xt.remove("mapboxgl-"+et+"-anchor-"+Ut);xt.add("mapboxgl-"+et+"-anchor-"+ot)}var Al=function(Z){function ot(et,xt){if(Z.call(this),(et instanceof t.window.HTMLElement||xt)&&(et=t.extend({element:et},xt)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=et&&et.anchor||"center",this._color=et&&et.color||"#3FB1CE",this._scale=et&&et.scale||1,this._draggable=et&&et.draggable||!1,this._clickTolerance=et&&et.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=et&&et.rotation||0,this._rotationAlignment=et&&et.rotationAlignment||"auto",this._pitchAlignment=et&&et.pitchAlignment&&et.pitchAlignment!=="auto"?et.pitchAlignment:this._rotationAlignment,!et||!et.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var Ut=r.createNS("http://www.w3.org/2000/svg","svg"),fe=41,ye=27;Ut.setAttributeNS(null,"display","block"),Ut.setAttributeNS(null,"height",fe+"px"),Ut.setAttributeNS(null,"width",ye+"px"),Ut.setAttributeNS(null,"viewBox","0 0 "+ye+" "+fe);var Yt=r.createNS("http://www.w3.org/2000/svg","g");Yt.setAttributeNS(null,"stroke","none"),Yt.setAttributeNS(null,"stroke-width","1"),Yt.setAttributeNS(null,"fill","none"),Yt.setAttributeNS(null,"fill-rule","evenodd");var ce=r.createNS("http://www.w3.org/2000/svg","g");ce.setAttributeNS(null,"fill-rule","nonzero");var Se=r.createNS("http://www.w3.org/2000/svg","g");Se.setAttributeNS(null,"transform","translate(3.0, 29.0)"),Se.setAttributeNS(null,"fill","#000000");for(var nr=[{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"}],Ye=0,tr=nr;Ye<tr.length;Ye+=1){var lr=tr[Ye],hr=r.createNS("http://www.w3.org/2000/svg","ellipse");hr.setAttributeNS(null,"opacity","0.04"),hr.setAttributeNS(null,"cx","10.5"),hr.setAttributeNS(null,"cy","5.80029008"),hr.setAttributeNS(null,"rx",lr.rx),hr.setAttributeNS(null,"ry",lr.ry),Se.appendChild(hr)}var Ve=r.createNS("http://www.w3.org/2000/svg","g");Ve.setAttributeNS(null,"fill",this._color);var Xe=r.createNS("http://www.w3.org/2000/svg","path");Xe.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"),Ve.appendChild(Xe);var $e=r.createNS("http://www.w3.org/2000/svg","g");$e.setAttributeNS(null,"opacity","0.25"),$e.setAttributeNS(null,"fill","#000000");var Cr=r.createNS("http://www.w3.org/2000/svg","path");Cr.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"),$e.appendChild(Cr);var on=r.createNS("http://www.w3.org/2000/svg","g");on.setAttributeNS(null,"transform","translate(6.0, 7.0)"),on.setAttributeNS(null,"fill","#FFFFFF");var fn=r.createNS("http://www.w3.org/2000/svg","g");fn.setAttributeNS(null,"transform","translate(8.0, 8.0)");var fi=r.createNS("http://www.w3.org/2000/svg","circle");fi.setAttributeNS(null,"fill","#000000"),fi.setAttributeNS(null,"opacity","0.25"),fi.setAttributeNS(null,"cx","5.5"),fi.setAttributeNS(null,"cy","5.5"),fi.setAttributeNS(null,"r","5.4999962");var si=r.createNS("http://www.w3.org/2000/svg","circle");si.setAttributeNS(null,"fill","#FFFFFF"),si.setAttributeNS(null,"cx","5.5"),si.setAttributeNS(null,"cy","5.5"),si.setAttributeNS(null,"r","5.4999962"),fn.appendChild(fi),fn.appendChild(si),ce.appendChild(Se),ce.appendChild(Ve),ce.appendChild($e),ce.appendChild(on),ce.appendChild(fn),Ut.appendChild(ce),Ut.setAttributeNS(null,"height",fe*this._scale+"px"),Ut.setAttributeNS(null,"width",ye*this._scale+"px"),this._element.appendChild(Ut),this._offset=t.Point.convert(et&&et.offset||[0,-14])}else this._element=et.element,this._offset=t.Point.convert(et&&et.offset||[0,0]);this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(Gn){Gn.preventDefault()}),this._element.addEventListener("mousedown",function(Gn){Gn.preventDefault()}),Nl(this._element,this._anchor,"marker"),this._popup=null}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.addTo=function(et){return this.remove(),this._map=et,et.getCanvasContainer().appendChild(this._element),et.on("move",this._update),et.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},ot.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},ot.prototype.getLngLat=function(){return this._lngLat},ot.prototype.setLngLat=function(et){return this._lngLat=t.LngLat.convert(et),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},ot.prototype.getElement=function(){return this._element},ot.prototype.setPopup=function(et){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),et){if(!("offset"in et.options)){var xt=38.1,Ut=13.5,fe=Math.sqrt(Math.pow(Ut,2)/2);et.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-xt],"bottom-left":[fe,(xt-Ut+fe)*-1],"bottom-right":[-fe,(xt-Ut+fe)*-1],left:[Ut,(xt-Ut)*-1],right:[-Ut,(xt-Ut)*-1]}:this._offset}this._popup=et,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},ot.prototype._onKeyPress=function(et){var xt=et.code,Ut=et.charCode||et.keyCode;(xt==="Space"||xt==="Enter"||Ut===32||Ut===13)&&this.togglePopup()},ot.prototype._onMapClick=function(et){var xt=et.originalEvent.target,Ut=this._element;this._popup&&(xt===Ut||Ut.contains(xt))&&this.togglePopup()},ot.prototype.getPopup=function(){return this._popup},ot.prototype.togglePopup=function(){var et=this._popup;if(et)et.isOpen()?et.remove():et.addTo(this._map);else return this;return this},ot.prototype._update=function(et){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=So(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var xt="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?xt="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(xt="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var Ut="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?Ut="rotateX(0deg)":this._pitchAlignment==="map"&&(Ut="rotateX("+this._map.getPitch()+"deg)"),(!et||et.type==="moveend")&&(this._pos=this._pos.round()),r.setTransform(this._element,ts[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+Ut+" "+xt)}},ot.prototype.getOffset=function(){return this._offset},ot.prototype.setOffset=function(et){return this._offset=t.Point.convert(et),this._update(),this},ot.prototype._onMove=function(et){if(!this._isDragging){var xt=this._clickTolerance||this._map._clickTolerance;this._isDragging=et.point.dist(this._pointerdownPos)>=xt}this._isDragging&&(this._pos=et.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")))},ot.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"},ot.prototype._addDragHandler=function(et){this._element.contains(et.originalEvent.target)&&(et.preventDefault(),this._positionDelta=et.point.sub(this._pos).add(this._offset),this._pointerdownPos=et.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))},ot.prototype.setDraggable=function(et){return this._draggable=!!et,this._map&&(et?(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},ot.prototype.isDraggable=function(){return this._draggable},ot.prototype.setRotation=function(et){return this._rotation=et||0,this._update(),this},ot.prototype.getRotation=function(){return this._rotation},ot.prototype.setRotationAlignment=function(et){return this._rotationAlignment=et||"auto",this._update(),this},ot.prototype.getRotationAlignment=function(){return this._rotationAlignment},ot.prototype.setPitchAlignment=function(et){return this._pitchAlignment=et&&et!=="auto"?et:this._rotationAlignment,this._update(),this},ot.prototype.getPitchAlignment=function(){return this._pitchAlignment},ot}(t.Evented),us={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},wu;function fl(Z){wu!==void 0?Z(wu):t.window.navigator.permissions!==void 0?t.window.navigator.permissions.query({name:"geolocation"}).then(function(ot){wu=ot.state!=="denied",Z(wu)}):(wu=!!t.window.navigator.geolocation,Z(wu))}var Eu=0,pc=!1,yc=function(Z){function ot(et){Z.call(this),this.options=t.extend({},us,et),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.onAdd=function(et){return this._map=et,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),fl(this._setupUI),this._container},ot.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,Eu=0,pc=!1},ot.prototype._isOutOfMapMaxBounds=function(et){var xt=this._map.getMaxBounds(),Ut=et.coords;return xt&&(Ut.longitude<xt.getWest()||Ut.longitude>xt.getEast()||Ut.latitude<xt.getSouth()||Ut.latitude>xt.getNorth())},ot.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}},ot.prototype._onSuccess=function(et){if(this._map){if(this._isOutOfMapMaxBounds(et)){this._setErrorState(),this.fire(new t.Event("outofmaxbounds",et)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=et,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(et),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(et),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",et)),this._finish()}},ot.prototype._updateCamera=function(et){var xt=new t.LngLat(et.coords.longitude,et.coords.latitude),Ut=et.coords.accuracy,fe=this._map.getBearing(),ye=t.extend({bearing:fe},this.options.fitBoundsOptions);this._map.fitBounds(xt.toBounds(Ut),ye,{geolocateSource:!0})},ot.prototype._updateMarker=function(et){if(et){var xt=new t.LngLat(et.coords.longitude,et.coords.latitude);this._accuracyCircleMarker.setLngLat(xt).addTo(this._map),this._userLocationDotMarker.setLngLat(xt).addTo(this._map),this._accuracy=et.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},ot.prototype._updateCircleRadius=function(){var et=this._map._container.clientHeight/2,xt=this._map.unproject([0,et]),Ut=this._map.unproject([1,et]),fe=xt.distanceTo(Ut),ye=Math.ceil(2*this._accuracy/fe);this._circleElement.style.width=ye+"px",this._circleElement.style.height=ye+"px"},ot.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},ot.prototype._onError=function(et){if(this._map){if(this.options.trackUserLocation)if(et.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 xt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=xt,this._geolocateButton.setAttribute("aria-label",xt),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(et.code===3&&pc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",et)),this._finish()}},ot.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},ot.prototype._setupUI=function(et){var xt=this;if(this._container.addEventListener("contextmenu",function(ye){return ye.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",et===!1){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Ut=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Ut,this._geolocateButton.setAttribute("aria-label",Ut)}else{var fe=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=fe,this._geolocateButton.setAttribute("aria-label",fe)}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 Al(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Al({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(ye){var Yt=ye.originalEvent&&ye.originalEvent.type==="resize";!ye.geolocateSource&&xt._watchState==="ACTIVE_LOCK"&&!Yt&&(xt._watchState="BACKGROUND",xt._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),xt._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),xt.fire(new t.Event("trackuserlocationend")))})},ot.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":Eu--,pc=!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"),Eu++;var et;Eu>1?(et={maximumAge:6e5,timeout:0},pc=!0):(et=this.options.positionOptions,pc=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,et)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},ot.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)},ot}(t.Evented),yu={maxWidth:100,unit:"metric"},hu=function(Z){this.options=t.extend({},yu,Z),t.bindAll(["_onMove","setUnit"],this)};hu.prototype.getDefaultPosition=function(){return"bottom-left"},hu.prototype._onMove=function(){ku(this._map,this._container,this.options)},hu.prototype.onAdd=function(Z){return this._map=Z,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",Z.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},hu.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},hu.prototype.setUnit=function(Z){this.options.unit=Z,ku(this._map,this._container,this.options)};function ku(Z,ot,et){var xt=et&&et.maxWidth||100,Ut=Z._container.clientHeight/2,fe=Z.unproject([0,Ut]),ye=Z.unproject([xt,Ut]),Yt=fe.distanceTo(ye);if(et&&et.unit==="imperial"){var ce=3.2808*Yt;if(ce>5280){var Se=ce/5280;Bo(ot,xt,Se,Z._getUIString("ScaleControl.Miles"))}else Bo(ot,xt,ce,Z._getUIString("ScaleControl.Feet"))}else if(et&&et.unit==="nautical"){var nr=Yt/1852;Bo(ot,xt,nr,Z._getUIString("ScaleControl.NauticalMiles"))}else Yt>=1e3?Bo(ot,xt,Yt/1e3,Z._getUIString("ScaleControl.Kilometers")):Bo(ot,xt,Yt,Z._getUIString("ScaleControl.Meters"))}function Bo(Z,ot,et,xt){var Ut=ol(et),fe=Ut/et;Z.style.width=ot*fe+"px",Z.innerHTML=Ut+"&nbsp;"+xt}function Tu(Z){var ot=Math.pow(10,Math.ceil(-Math.log(Z)/Math.LN10));return Math.round(Z*ot)/ot}function ol(Z){var ot=Math.pow(10,(""+Math.floor(Z)).length-1),et=Z/ot;return et=et>=10?10:et>=5?5:et>=3?3:et>=2?2:et>=1?1:Tu(et),ot*et}var Cu=function(Z){this._fullscreen=!1,Z&&Z.container&&(Z.container instanceof t.window.HTMLElement?this._container=Z.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")};Cu.prototype.onAdd=function(Z){return this._map=Z,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},Cu.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Cu.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Cu.prototype._setupUI=function(){var Z=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",Z).setAttribute("aria-hidden",!0),Z.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Cu.prototype._updateTitle=function(){var Z=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Z),this._fullscreenButton.title=Z},Cu.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Cu.prototype._isFullscreen=function(){return this._fullscreen},Cu.prototype._changeIcon=function(){var Z=t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement;Z===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Cu.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 xc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Eo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Ss=function(Z){function ot(et){Z.call(this),this.options=t.extend(Object.create(xc),et),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return Z&&(ot.__proto__=Z),ot.prototype=Object.create(Z&&Z.prototype),ot.prototype.constructor=ot,ot.prototype.addTo=function(et){return this._map&&this.remove(),this._map=et,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},ot.prototype.isOpen=function(){return!!this._map},ot.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},ot.prototype.getLngLat=function(){return this._lngLat},ot.prototype.setLngLat=function(et){return this._lngLat=t.LngLat.convert(et),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},ot.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},ot.prototype.getElement=function(){return this._container},ot.prototype.setText=function(et){return this.setDOMContent(t.window.document.createTextNode(et))},ot.prototype.setHTML=function(et){var xt=t.window.document.createDocumentFragment(),Ut=t.window.document.createElement("body"),fe;for(Ut.innerHTML=et;fe=Ut.firstChild,!!fe;)xt.appendChild(fe);return this.setDOMContent(xt)},ot.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},ot.prototype.setMaxWidth=function(et){return this.options.maxWidth=et,this._update(),this},ot.prototype.setDOMContent=function(et){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(et),this._createCloseButton(),this._update(),this._focusFirstElement(),this},ot.prototype.addClassName=function(et){this._container&&this._container.classList.add(et)},ot.prototype.removeClassName=function(et){this._container&&this._container.classList.remove(et)},ot.prototype.setOffset=function(et){return this.options.offset=et,this._update(),this},ot.prototype.toggleClassName=function(et){if(this._container)return this._container.classList.toggle(et)},ot.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))},ot.prototype._onMouseUp=function(et){this._update(et.point)},ot.prototype._onMouseMove=function(et){this._update(et.point)},ot.prototype._onDrag=function(et){this._update(et.point)},ot.prototype._update=function(et){var xt=this,Ut=this._lngLat||this._trackPointer;if(!(!this._map||!Ut||!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(tr){return xt._container.classList.add(tr)}),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=So(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!et))){var fe=this._pos=this._trackPointer&&et?et:this._map.project(this._lngLat),ye=this.options.anchor,Yt=Ml(this.options.offset);if(!ye){var ce=this._container.offsetWidth,Se=this._container.offsetHeight,nr;fe.y+Yt.bottom.y<Se?nr=["top"]:fe.y>this._map.transform.height-Se?nr=["bottom"]:nr=[],fe.x<ce/2?nr.push("left"):fe.x>this._map.transform.width-ce/2&&nr.push("right"),nr.length===0?ye="bottom":ye=nr.join("-")}var Ye=fe.add(Yt[ye]).round();r.setTransform(this._container,ts[ye]+" translate("+Ye.x+"px,"+Ye.y+"px)"),Nl(this._container,ye,"popup")}},ot.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var et=this._container.querySelector(Eo);et&&et.focus()}},ot.prototype._onClose=function(){this.remove()},ot}(t.Evented);function Ml(Z){if(Z)if(typeof Z=="number"){var ot=Math.round(Math.sqrt(.5*Math.pow(Z,2)));return{center:new t.Point(0,0),top:new t.Point(0,Z),"top-left":new t.Point(ot,ot),"top-right":new t.Point(-ot,ot),bottom:new t.Point(0,-Z),"bottom-left":new t.Point(ot,-ot),"bottom-right":new t.Point(-ot,-ot),left:new t.Point(Z,0),right:new t.Point(-Z,0)}}else if(Z instanceof t.Point||Array.isArray(Z)){var et=t.Point.convert(Z);return{center:et,top:et,"top-left":et,"top-right":et,bottom:et,"bottom-left":et,"bottom-right":et,left:et,right:et}}else return{center:t.Point.convert(Z.center||[0,0]),top:t.Point.convert(Z.top||[0,0]),"top-left":t.Point.convert(Z["top-left"]||[0,0]),"top-right":t.Point.convert(Z["top-right"]||[0,0]),bottom:t.Point.convert(Z.bottom||[0,0]),"bottom-left":t.Point.convert(Z["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(Z["bottom-right"]||[0,0]),left:t.Point.convert(Z.left||[0,0]),right:t.Point.convert(Z.right||[0,0])};else return Ml(new t.Point(0,0))}var yl={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Po,NavigationControl:Oa,GeolocateControl:yc,AttributionControl:_i,ScaleControl:hu,FullscreenControl:Cu,Popup:Ss,Marker:Al,Style:ac,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:Wa,clearPrewarmedResources:ze,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(Z){t.config.ACCESS_TOKEN=Z},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(Z){t.config.API_URL=Z},get workerCount(){return Di.workerCount},set workerCount(Z){Di.workerCount=Z},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(Z){t.config.MAX_PARALLEL_IMAGE_REQUESTS=Z},clearStorage:function(Z){t.clearTileCache(Z)},workerUrl:""};return yl}),P})}),iW=Ft((Q,$)=>{var c=bn(),g=tc().sanitizeHTML,P=cE(),S=Ev();function t(o,i){this.subplot=o,this.uid=o.uid+"-"+i,this.index=i,this.idSource="source-"+this.uid,this.idLayer=S.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 i=this.subplot.map;return i.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 i=this.subplot.map;i.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 i=this.subplot.map;if(i.getSource(this.idSource)&&i.removeSource(this.idSource),this.sourceType=o.sourcetype,this.source=o.source,!!r(o)){var s=n(o);i.addSource(this.idSource,s)}},e.findFollowingMapboxLayerId=function(o){if(o==="traces")for(var i=this.subplot.getMapLayers(),s=0;s<i.length;s++){var f=i[s].id;if(typeof f=="string"&&f.indexOf(S.traceLayerPrefix)===0){o=f;break}}return o},e.updateLayer=function(o){var i=this.subplot,s=a(o),f=this.lookupBelow(),x=this.findFollowingMapboxLayerId(f);this.removeLayer(),r(o)&&i.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},x),this.layerType=o.type,this.below=f},e.updateStyle=function(o){if(r(o)){var i=a(o);this.subplot.setOptions(this.idLayer,"setLayoutProperty",i.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",i.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 i=o.source;if(Array.isArray(i)&&i.length>0){for(var s=0;s<i.length;s++)if(typeof i[s]!="string"||i[s].length===0)return!1;return!0}return c.isPlainObject(i)||typeof i=="string"&&i.length>0}function a(o){var i={},s={};switch(o.type){case"circle":c.extendFlat(s,{"circle-radius":o.circle.radius,"circle-color":o.color,"circle-opacity":o.opacity});break;case"line":c.extendFlat(s,{"line-width":o.line.width,"line-color":o.color,"line-opacity":o.opacity,"line-dasharray":o.line.dash});break;case"fill":c.extendFlat(s,{"fill-color":o.color,"fill-outline-color":o.fill.outlinecolor,"fill-opacity":o.opacity});break;case"symbol":var f=o.symbol,x=P(f.textposition,f.iconsize);c.extendFlat(i,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":x.anchor,"text-offset":x.offset,"symbol-placement":f.placement}),c.extendFlat(s,{"icon-color":o.color,"text-color":f.textfont.color,"text-opacity":o.opacity});break;case"raster":c.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":o.opacity});break}return{layout:i,paint:s}}function n(o){var i=o.sourcetype,s=o.source,f={type:i},x;return i==="geojson"?x="data":i==="vector"?x=typeof s=="string"?"url":"tiles":i==="raster"?(x="tiles",f.tileSize=256):i==="image"&&(x="url",f.coordinates=o.coordinates),f[x]=s,o.sourceattribution&&(f.attribution=g(o.sourceattribution)),f}$.exports=function(o,i,s){var f=new t(o,i);return f.update(s),f}}),aW=Ft((Q,$)=>{var c=hE(),g=bn(),P=V1(),S=Xo(),t=Es(),e=up(),r=Qh(),a=v0(),n=a.drawMode,o=a.selectMode,i=vf().prepSelect,s=vf().clearOutline,f=vf().clearSelectionsCache,x=vf().selectOnClick,y=Ev(),v=iW();function T(E,A){this.id=A,this.gd=E;var h=E._fullLayout,p=E._context;this.container=h._glcontainer.node(),this.isStatic=p.staticPlot,this.uid=h._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(h),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var u=T.prototype;u.plot=function(E,A,h){var p=this,k=A[p.id];p.map&&k.accesstoken!==p.accessToken&&(p.map.remove(),p.map=null,p.styleObj=null,p.traceHash={},p.layerList=[]);var w;p.map?w=new Promise(function(R,O){p.updateMap(E,A,R,O)}):w=new Promise(function(R,O){p.createMap(E,A,R,O)}),h.push(w)},u.createMap=function(E,A,h,p){var k=this,w=A[k.id],R=k.styleObj=_(w.style,A);k.accessToken=w.accesstoken;var O=w.bounds,N=O?[[O.west,O.south],[O.east,O.north]]:null,V=k.map=new c.Map({container:k.div,style:R.style,center:M(w.center),zoom:w.zoom,bearing:w.bearing,pitch:w.pitch,maxBounds:N,interactive:!k.isStatic,preserveDrawingBuffer:k.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new c.AttributionControl({compact:!0}));V._canvas.style.left="0px",V._canvas.style.top="0px",k.rejectOnError(p),k.isStatic||k.initFx(E,A);var H=[];H.push(new Promise(function(F){V.once("load",F)})),H=H.concat(P.fetchTraceGeoData(E)),Promise.all(H).then(function(){k.fillBelowLookup(E,A),k.updateData(E),k.updateLayout(A),k.resolveOnRender(h)}).catch(p)},u.updateMap=function(E,A,h,p){var k=this,w=k.map,R=A[this.id];k.rejectOnError(p);var O=[],N=_(R.style,A);JSON.stringify(k.styleObj)!==JSON.stringify(N)&&(k.styleObj=N,w.setStyle(N.style),k.traceHash={},O.push(new Promise(function(V){w.once("styledata",V)}))),O=O.concat(P.fetchTraceGeoData(E)),Promise.all(O).then(function(){k.fillBelowLookup(E,A),k.updateData(E),k.updateLayout(A),k.resolveOnRender(h)}).catch(p)},u.fillBelowLookup=function(E,A){var h=A[this.id],p=h.layers,k,w,R=this.belowLookup={},O=!1;for(k=0;k<E.length;k++){var N=E[k][0].trace,V=N._module;typeof N.below=="string"?w=N.below:V.getBelow&&(w=V.getBelow(N,this)),w===""&&(O=!0),R["trace-"+N.uid]=w||""}for(k=0;k<p.length;k++){var H=p[k];typeof H.below=="string"?w=H.below:O?w="traces":w="",R["layout-"+k]=w}var F={},U,W;for(U in R)w=R[U],F[w]?F[w].push(U):F[w]=[U];for(w in F){var q=F[w];if(q.length>1)for(k=0;k<q.length;k++)U=q[k],U.indexOf("trace-")===0?(W=U.split("trace-")[1],this.traceHash[W]&&(this.traceHash[W].below=null)):U.indexOf("layout-")===0&&(W=U.split("layout-")[1],this.layerList[W]&&(this.layerList[W].below=null))}};var b={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};u.updateData=function(E){var A=this.traceHash,h,p,k,w,R=E.slice().sort(function(F,U){return b[F[0].trace.type]-b[U[0].trace.type]});for(k=0;k<R.length;k++){var O=R[k];p=O[0].trace,h=A[p.uid];var N=!1;h&&(h.type===p.type?(h.update(O),N=!0):h.dispose()),!N&&p._module&&(A[p.uid]=p._module.plot(this,O))}var V=Object.keys(A);t:for(k=0;k<V.length;k++){var H=V[k];for(w=0;w<E.length;w++)if(p=E[w][0].trace,H===p.uid)continue t;h=A[H],h.dispose(),delete A[H]}},u.updateLayout=function(E){var A=this.map,h=E[this.id];!this.dragging&&!this.wheeling&&(A.setCenter(M(h.center)),A.setZoom(h.zoom),A.setBearing(h.bearing),A.setPitch(h.pitch)),this.updateLayers(E),this.updateFramework(E),this.updateFx(E),this.map.resize(),this.gd._context._scrollZoom.mapbox?A.scrollZoom.enable():A.scrollZoom.disable()},u.resolveOnRender=function(E){var A=this.map;A.on("render",function h(){A.loaded()&&(A.off("render",h),setTimeout(E,10))})},u.rejectOnError=function(E){var A=this.map;function h(){E(new Error(y.mapOnErrorMsg))}A.once("error",h),A.once("style.error",h),A.once("source.error",h),A.once("tile.error",h),A.once("layer.error",h)},u.createFramework=function(E){var A=this,h=A.div=document.createElement("div");h.id=A.uid,h.style.position="absolute",A.container.appendChild(h),A.xaxis={_id:"x",c2p:function(p){return A.project(p).x}},A.yaxis={_id:"y",c2p:function(p){return A.project(p).y}},A.updateFramework(E),A.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},t.setConvert(A.mockAxis,E)},u.initFx=function(E,A){var h=this,p=h.gd,k=h.map;k.on("moveend",function(O){if(h.map){var N=p._fullLayout;if(O.originalEvent||h.wheeling){var V=N[h.id];S.call("_storeDirectGUIEdit",p.layout,N._preGUI,h.getViewEdits(V));var H=h.getView();V._input.center=V.center=H.center,V._input.zoom=V.zoom=H.zoom,V._input.bearing=V.bearing=H.bearing,V._input.pitch=V.pitch=H.pitch,p.emit("plotly_relayout",h.getViewEditsWithDerived(H))}O.originalEvent&&O.originalEvent.type==="mouseup"?h.dragging=!1:h.wheeling&&(h.wheeling=!1),N._rehover&&N._rehover()}}),k.on("wheel",function(){h.wheeling=!0}),k.on("mousemove",function(O){var N=h.div.getBoundingClientRect(),V=[O.originalEvent.offsetX,O.originalEvent.offsetY];O.target.getBoundingClientRect=function(){return N},h.xaxis.p2c=function(){return k.unproject(V).lng},h.yaxis.p2c=function(){return k.unproject(V).lat},p._fullLayout._rehover=function(){p._fullLayout._hoversubplot===h.id&&p._fullLayout[h.id]&&r.hover(p,O,h.id)},r.hover(p,O,h.id),p._fullLayout._hoversubplot=h.id});function w(){r.loneUnhover(A._hoverlayer)}k.on("dragstart",function(){h.dragging=!0,w()}),k.on("zoomstart",w),k.on("mouseout",function(){p._fullLayout._hoversubplot=null});function R(){var O=h.getView();p.emit("plotly_relayouting",h.getViewEditsWithDerived(O))}k.on("drag",R),k.on("zoom",R),k.on("dblclick",function(){var O=p._fullLayout[h.id];S.call("_storeDirectGUIEdit",p.layout,p._fullLayout._preGUI,h.getViewEdits(O));var N=h.viewInitial;k.setCenter(M(N.center)),k.setZoom(N.zoom),k.setBearing(N.bearing),k.setPitch(N.pitch);var V=h.getView();O._input.center=O.center=V.center,O._input.zoom=O.zoom=V.zoom,O._input.bearing=O.bearing=V.bearing,O._input.pitch=O.pitch=V.pitch,p.emit("plotly_doubleclick",null),p.emit("plotly_relayout",h.getViewEditsWithDerived(V))}),h.clearOutline=function(){f(h.dragOptions),s(h.dragOptions.gd)},h.onClickInPanFn=function(O){return function(N){var V=p._fullLayout.clickmode;V.indexOf("select")>-1&&x(N.originalEvent,p,[h.xaxis],[h.yaxis],h.id,O),V.indexOf("event")>-1&&r.click(p,N.originalEvent)}}},u.updateFx=function(E){var A=this,h=A.map,p=A.gd;if(A.isStatic)return;function k(N){var V=A.map.unproject(N);return[V.lng,V.lat]}var w=E.dragmode,R;R=function(N,V){if(V.isRect){var H=N.range={};H[A.id]=[k([V.xmin,V.ymin]),k([V.xmax,V.ymax])]}else{var F=N.lassoPoints={};F[A.id]=V.map(k)}};var O=A.dragOptions;A.dragOptions=g.extendDeep(O||{},{dragmode:E.dragmode,element:A.div,gd:p,plotinfo:{id:A.id,domain:E[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis,fillRangeItems:R},xaxes:[A.xaxis],yaxes:[A.yaxis],subplot:A.id}),h.off("click",A.onClickInPanHandler),o(w)||n(w)?(h.dragPan.disable(),h.on("zoomstart",A.clearOutline),A.dragOptions.prepFn=function(N,V,H){i(N,V,H,A.dragOptions,w)},e.init(A.dragOptions)):(h.dragPan.enable(),h.off("zoomstart",A.clearOutline),A.div.onmousedown=null,A.div.ontouchstart=null,A.div.removeEventListener("touchstart",A.div._ontouchstart),A.onClickInPanHandler=A.onClickInPanFn(A.dragOptions),h.on("click",A.onClickInPanHandler))},u.updateFramework=function(E){var A=E[this.id].domain,h=E._size,p=this.div.style;p.width=h.w*(A.x[1]-A.x[0])+"px",p.height=h.h*(A.y[1]-A.y[0])+"px",p.left=h.l+A.x[0]*h.w+"px",p.top=h.t+(1-A.y[1])*h.h+"px",this.xaxis._offset=h.l+A.x[0]*h.w,this.xaxis._length=h.w*(A.x[1]-A.x[0]),this.yaxis._offset=h.t+(1-A.y[1])*h.h,this.yaxis._length=h.h*(A.y[1]-A.y[0])},u.updateLayers=function(E){var A=E[this.id],h=A.layers,p=this.layerList,k;if(h.length!==p.length){for(k=0;k<p.length;k++)p[k].dispose();for(p=this.layerList=[],k=0;k<h.length;k++)p.push(v(this,k,h[k]))}else for(k=0;k<h.length;k++)p[k].update(h[k])},u.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},u.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},u.setOptions=function(E,A,h){for(var p in h)this.map[A](E,p,h[p])},u.getMapLayers=function(){return this.map.getStyle().layers},u.addLayer=function(E,A){var h=this.map;if(typeof A=="string"){if(A===""){h.addLayer(E,A);return}for(var p=this.getMapLayers(),k=0;k<p.length;k++)if(A===p[k].id){h.addLayer(E,A);return}g.warn(["Trying to add layer with *below* value",A,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}h.addLayer(E)},u.project=function(E){return this.map.project(new c.LngLat(E[0],E[1]))},u.getView=function(){var E=this.map,A=E.getCenter(),h=A.lng,p=A.lat,k={lon:h,lat:p},w=E.getCanvas(),R=parseInt(w.style.width),O=parseInt(w.style.height);return{center:k,zoom:E.getZoom(),bearing:E.getBearing(),pitch:E.getPitch(),_derived:{coordinates:[E.unproject([0,0]).toArray(),E.unproject([R,0]).toArray(),E.unproject([R,O]).toArray(),E.unproject([0,O]).toArray()]}}},u.getViewEdits=function(E){for(var A=this.id,h=["center","zoom","bearing","pitch"],p={},k=0;k<h.length;k++){var w=h[k];p[A+"."+w]=E[w]}return p},u.getViewEditsWithDerived=function(E){var A=this.id,h=this.getViewEdits(E);return h[A+"._derived"]=E._derived,h};function _(E,A){var h={};if(g.isPlainObject(E))h.id=E.id,h.style=E;else if(typeof E=="string")if(h.id=E,y.styleValuesMapbox.indexOf(E)!==-1)h.style=C(E);else if(y.stylesNonMapbox[E]){h.style=y.stylesNonMapbox[E];var p=h.style.sources["plotly-"+E],k=p?p.tiles:void 0;k&&k[0]&&k[0].slice(-9)==="?api_key="&&(k[0]+=A._mapboxAccessToken)}else h.style=E;else h.id=y.styleValueDflt,h.style=C(y.styleValueDflt);return h.transition={duration:0,delay:0},h}function C(E){return y.styleUrlPrefix+E+"-"+y.styleUrlSuffix}function M(E){return[E.lon,E.lat]}$.exports=T}),oW=Ft((Q,$)=>{var c=bn(),g=P1(),P=Md(),S=M3();$.exports=function(r,a,n){g(r,a,n,{type:"mapbox",attributes:S,handleDefaults:t,partition:"y",accessToken:a._mapboxAccessToken})};function t(r,a,n,o){n("accesstoken",o.accessToken),n("style"),n("center.lon"),n("center.lat"),n("zoom"),n("bearing"),n("pitch");var i=n("bounds.west"),s=n("bounds.east"),f=n("bounds.south"),x=n("bounds.north");(i===void 0||s===void 0||f===void 0||x===void 0)&&delete a.bounds,P(r,a,{name:"layers",handleItemDefaults:e}),a._input=r}function e(r,a){function n(y,v){return c.coerce(r,a,S.layers,y,v)}var o=n("visible");if(o){var i=n("sourcetype"),s=i==="raster"||i==="image";n("source"),n("sourceattribution"),i==="vector"&&n("sourcelayer"),i==="image"&&n("coordinates");var f;s&&(f="raster");var x=n("type",f);s&&x!=="raster"&&(x=a.type="raster",c.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),x==="circle"&&n("circle.radius"),x==="line"&&(n("line.width"),n("line.dash")),x==="fill"&&n("fill.outlinecolor"),x==="symbol"&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),c.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}}),mT=Ft(Q=>{var $=hE(),c=bn(),g=c.strTranslate,P=c.strScale,S=ud().getSubplotCalcData,t=Op(),e=un(),r=js(),a=tc(),n=aW(),o="mapbox",i=Q.constants=Ev();Q.name=o,Q.attr="subplot",Q.idRoot=o,Q.idRegex=Q.attrRegex=c.counterRegex(o);var s=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");Q.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},Q.layoutAttributes=M3(),Q.supplyLayoutDefaults=oW();var f=!0;Q.plot=function(v){f&&(f=!1,c.warn(s));var T=v._fullLayout,u=v.calcdata,b=T._subplots[o];if($.version!==i.requiredVersion)throw new Error(i.wrongVersionErrorMsg);var _=x(v,b);$.accessToken=_;for(var C=0;C<b.length;C++){var M=b[C],E=S(u,o,M),A=T[M],h=A._subplot;h||(h=new n(v,M),T[M]._subplot=h),h.viewInitial||(h.viewInitial={center:c.extendFlat({},A.center),zoom:A.zoom,bearing:A.bearing,pitch:A.pitch}),h.plot(E,T,v._promises)}},Q.clean=function(v,T,u,b){for(var _=b._subplots[o]||[],C=0;C<_.length;C++){var M=_[C];!T[M]&&b[M]._subplot&&b[M]._subplot.destroy()}},Q.toSVG=function(v){for(var T=v._fullLayout,u=T._subplots[o],b=T._size,_=0;_<u.length;_++){var C=T[u[_]],M=C.domain,E=C._subplot,A=E.toImage("png"),h=T._glimages.append("svg:image");h.attr({xmlns:t.svg,"xlink:href":A,x:b.l+b.w*M.x[0],y:b.t+b.h*(1-M.y[1]),width:b.w*(M.x[1]-M.x[0]),height:b.h*(M.y[1]-M.y[0]),preserveAspectRatio:"none"});var p=e.select(C._subplot.div),k=p.select(".mapboxgl-ctrl-logo").node().offsetParent===null;if(!k){var w=T._glimages.append("g");w.attr("transform",g(b.l+b.w*M.x[0]+10,b.t+b.h*(1-M.y[0])-31)),w.append("path").attr("d",i.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),w.append("path").attr("d",i.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),w.append("path").attr("d",i.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),w.append("polygon").attr("points",i.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var R=p.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),O=T._glimages.append("g"),N=O.append("text");N.text(R).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":R});var V=r.bBox(N.node()),H=b.w*(M.x[1]-M.x[0]);if(V.width>H/2){var F=R.split("|").join("<br>");N.text(F).attr("data-unformatted",F).call(a.convertToTspans,v),V=r.bBox(N.node())}N.attr("transform",g(-3,-V.height+8)),O.insert("rect",".static-attribution").attr({x:-V.width-6,y:-V.height-3,width:V.width+6,height:V.height+3,fill:"rgba(255, 255, 255, 0.75)"});var U=1;V.width+6>H&&(U=H/(V.width+6));var W=[b.l+b.w*M.x[1],b.t+b.h*(1-M.y[0])];O.attr("transform",g(W[0],W[1])+P(U))}};function x(v,T){var u=v._fullLayout,b=v._context;if(b.mapboxAccessToken==="")return"";for(var _=[],C=[],M=!1,E=!1,A=0;A<T.length;A++){var h=u[T[A]],p=h.accesstoken;y(h.style)&&(p?c.pushUnique(_,p):(y(h._input.style)&&(c.error("Uses Mapbox map style, but did not set an access token."),M=!0),E=!0)),p&&c.pushUnique(C,p)}if(E){var k=M?i.noAccessTokenErrorMsg:i.missingStyleErrorMsg;throw c.error(k),new Error(k)}return _.length?(_.length>1&&c.warn(i.multipleTokensErrorMsg),_[0]):(C.length&&c.log(["Listed mapbox access token(s)",C.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function y(v){return typeof v=="string"&&(i.styleValuesMapbox.indexOf(v)!==-1||v.indexOf("mapbox://")===0||v.indexOf("stamen")===0)}Q.updateFx=function(v){for(var T=v._fullLayout,u=T._subplots[o],b=0;b<u.length;b++){var _=T[u[b]]._subplot;_.updateFx(T)}}}),sW=Ft((Q,$)=>{$.exports={attributes:dT(),supplyDefaults:QH(),colorbar:xo(),formatLabels:uE(),calc:$k(),plot:eW(),hoverPoints:pT().hoverPoints,eventData:rW(),selectPoints:nW(),styleOnSelect:function(c,g){if(g){var P=g[0].trace;P._glTrace.update(g)}},moduleType:"trace",name:"scattermapbox",basePlotModule:mT(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}),lW=Ft((Q,$)=>{$.exports=sW()}),fE=Ft((Q,$)=>{var c=fb(),g=Tc(),{hovertemplateAttrs:P,templatefallbackAttrs:S}=$u(),t=$o(),e=Ta().extendFlat;$.exports=e({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:e({},c.featureidkey,{}),below:{valType:"string",editType:"plot"},text:c.text,hovertext:c.hovertext,marker:{line:{color:e({},c.marker.line.color,{editType:"plot"}),width:e({},c.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:e({},c.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:e({},c.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:e({},c.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:c.hoverinfo,hovertemplate:P({},{keys:["properties"]}),hovertemplatefallback:S(),showlegend:e({},t.showlegend,{dflt:!1})},g("",{cLetter:"z",editTypeOverride:"calc"}))}),uW=Ft((Q,$)=>{var c=bn(),g=mc(),P=fE();$.exports=function(S,t,e,r){function a(f,x){return c.coerce(S,t,P,f,x)}var n=a("locations"),o=a("z"),i=a("geojson");if(!c.isArrayOrTypedArray(n)||!n.length||!c.isArrayOrTypedArray(o)||!o.length||!(typeof i=="string"&&i!==""||c.isPlainObject(i))){t.visible=!1;return}a("featureidkey"),t._length=Math.min(n.length,o.length),a("below"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback");var s=a("marker.line.width");s&&a("marker.line.color"),a("marker.opacity"),g(S,t,r,a,{prefix:"",cLetter:"z"}),c.coerceSelectionMarkerOpacity(t,a)}}),dE=Ft((Q,$)=>{var c=ra(),g=bn(),P=Xc(),S=js(),t=U1().makeBlank,e=V1();function r(n){var o=n[0].trace,i=o.visible===!0&&o._length!==0,s={layout:{visibility:"none"},paint:{}},f={layout:{visibility:"none"},paint:{}},x=o._opts={fill:s,line:f,geojson:t()};if(!i)return x;var y=e.extractTraceFeature(n);if(!y)return x;var v=P.makeColorScaleFuncFromTrace(o),T=o.marker,u=T.line||{},b;g.isArrayOrTypedArray(T.opacity)&&(b=function(k){var w=k.mo;return c(w)?+g.constrain(w,0,1):0});var _;g.isArrayOrTypedArray(u.color)&&(_=function(k){return k.mlc});var C;g.isArrayOrTypedArray(u.width)&&(C=function(k){return k.mlw});for(var M=0;M<n.length;M++){var E=n[M],A=E.fOut;if(A){var h=A.properties;h.fc=v(E.z),b&&(h.mo=b(E)),_&&(h.mlc=_(E)),C&&(h.mlw=C(E)),E.ct=h.ct,E._polygons=e.feature2polygons(A)}}var p=b?{type:"identity",property:"mo"}:T.opacity;return g.extendFlat(s.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":p}),g.extendFlat(f.paint,{"line-color":_?{type:"identity",property:"mlc"}:u.color,"line-width":C?{type:"identity",property:"mlw"}:u.width,"line-opacity":p}),s.layout.visibility="visible",f.layout.visibility="visible",x.geojson={type:"FeatureCollection",features:y},a(n),x}function a(n){var o=n[0].trace,i=o._opts,s;if(o.selectedpoints){for(var f=S.makeSelectedPointStyleFns(o),x=0;x<n.length;x++){var y=n[x];y.fOut&&(y.fOut.properties.mo2=f.selectedOpacityFn(y))}s={type:"identity",property:"mo2"}}else s=g.isArrayOrTypedArray(o.marker.opacity)?{type:"identity",property:"mo"}:o.marker.opacity;return g.extendFlat(i.fill.paint,{"fill-opacity":s}),g.extendFlat(i.line.paint,{"line-opacity":s}),i}$.exports={convert:r,convertOnSelect:a}}),cW=Ft((Q,$)=>{var c=dE().convert,g=dE().convertOnSelect,P=Ev().traceLayerPrefix;function S(e,r){this.type="choroplethmapbox",this.subplot=e,this.uid=r,this.sourceId="source-"+r,this.layerList=[["fill",P+r+"-fill"],["line",P+r+"-line"]],this.below=null}var t=S.prototype;t.update=function(e){this._update(c(e)),e[0].trace._glTrace=this},t.updateOnSelect=function(e){this._update(g(e))},t._update=function(e){var r=this.subplot,a=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<a.length;o++){var i=a[o],s=i[0],f=i[1],x=e[s];r.setOptions(f,"setLayoutProperty",x.layout),x.layout.visibility==="visible"&&r.setOptions(f,"setPaintProperty",x.paint)}},t._addLayers=function(e,r){for(var a=this.subplot,n=this.layerList,o=this.sourceId,i=0;i<n.length;i++){var s=n[i],f=s[0],x=e[f];a.addLayer({type:f,id:s[1],source:o,layout:x.layout,paint:x.paint},r)}},t._removeLayers=function(){for(var e=this.subplot.map,r=this.layerList,a=r.length-1;a>=0;a--)e.removeLayer(r[a][1])},t.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},$.exports=function(e,r){var a=r[0].trace,n=new S(e,a.uid),o=n.sourceId,i=c(r),s=n.below=e.belowLookup["trace-"+a.uid];return e.map.addSource(o,{type:"geojson",data:i.geojson}),n._addLayers(i,s),r[0].trace._glTrace=n,n}}),hW=Ft((Q,$)=>{$.exports={attributes:fE(),supplyDefaults:uW(),colorbar:L1(),calc:Xk(),plot:cW(),hoverPoints:Qk(),eventData:tT(),selectPoints:eT(),styleOnSelect:function(c,g){if(g){var P=g[0].trace;P._glTrace.updateOnSelect(g)}},getBelow:function(c,g){for(var P=g.getMapLayers(),S=P.length-2;S>=0;S--){var t=P[S].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var e=S+1;e<P.length;e++)if(t=P[e].id,typeof t=="string"&&t.indexOf("plotly-")===-1)return t}}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:mT(),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}}),fW=Ft((Q,$)=>{$.exports=hW()}),pE=Ft((Q,$)=>{var c=Tc(),{hovertemplateAttrs:g,templatefallbackAttrs:P}=$u(),S=$o(),t=dT(),e=Ta().extendFlat;$.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({},S.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:g(),hovertemplatefallback:P(),showlegend:e({},S.showlegend,{dflt:!1})},c("",{cLetter:"z",editTypeOverride:"calc"}))}),dW=Ft((Q,$)=>{var c=bn(),g=mc(),P=pE();$.exports=function(S,t,e,r){function a(s,f){return c.coerce(S,t,P,s,f)}var n=a("lon")||[],o=a("lat")||[],i=Math.min(n.length,o.length);if(!i){t.visible=!1;return}t._length=i,a("z"),a("radius"),a("below"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),g(S,t,r,a,{prefix:"",cLetter:"z"})}}),pW=Ft((Q,$)=>{var c=ra(),g=bn().isArrayOrTypedArray,P=Da().BADNUM,S=Jd(),t=bn()._;$.exports=function(e,r){for(var a=r._length,n=new Array(a),o=r.z,i=g(o)&&o.length,s=0;s<a;s++){var f=n[s]={},x=r.lon[s],y=r.lat[s];if(f.lonlat=c(x)&&c(y)?[+x,+y]:[P,P],i){var v=o[s];f.z=c(v)?v:P}}return S(e,r,{vals:i?o:[0,1],containerStr:"",cLetter:"z"}),a&&(n[0].t={labels:{lat:t(e,"lat:")+" ",lon:t(e,"lon:")+" "}}),n}}),mW=Ft((Q,$)=>{var c=ra(),g=bn(),P=li(),S=Xc(),t=Da().BADNUM,e=U1().makeBlank;$.exports=function(r){var a=r[0].trace,n=a.visible===!0&&a._length!==0,o={layout:{visibility:"none"},paint:{}},i=a._opts={heatmap:o,geojson:e()};if(!n)return i;var s=[],f,x=a.z,y=a.radius,v=g.isArrayOrTypedArray(x)&&x.length,T=g.isArrayOrTypedArray(y);for(f=0;f<r.length;f++){var u=r[f],b=u.lonlat;if(b[0]!==t){var _={};if(v){var C=u.z;_.z=C!==t?C:0}T&&(_.r=c(y[f])&&y[f]>0?+y[f]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:_})}}var M=S.extractOpts(a),E=M.reversescale?S.flipScale(M.colorscale):M.colorscale,A=E[0][1],h=P.opacity(A)<1?A:P.addOpacity(A,0),p=["interpolate",["linear"],["heatmap-density"],0,h];for(f=1;f<E.length;f++)p.push(E[f][0],E[f][1]);var k=["interpolate",["linear"],["get","z"],M.min,0,M.max,1];return g.extendFlat(i.heatmap.paint,{"heatmap-weight":v?k:1/(M.max-M.min),"heatmap-color":p,"heatmap-radius":T?{type:"identity",property:"r"}:a.radius,"heatmap-opacity":a.opacity}),i.geojson={type:"FeatureCollection",features:s},i.heatmap.layout.visibility="visible",i}}),gW=Ft((Q,$)=>{var c=mW(),g=Ev().traceLayerPrefix;function P(t,e){this.type="densitymapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",g+e+"-heatmap"]],this.below=null}var S=P.prototype;S.update=function(t){var e=this.subplot,r=this.layerList,a=c(t),n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(a.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(a,n),this.below=n);for(var o=0;o<r.length;o++){var i=r[o],s=i[0],f=i[1],x=a[s];e.setOptions(f,"setLayoutProperty",x.layout),x.layout.visibility==="visible"&&e.setOptions(f,"setPaintProperty",x.paint)}},S._addLayers=function(t,e){for(var r=this.subplot,a=this.layerList,n=this.sourceId,o=0;o<a.length;o++){var i=a[o],s=i[0],f=t[s];r.addLayer({type:s,id:i[1],source:n,layout:f.layout,paint:f.paint},e)}},S._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},S.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},$.exports=function(t,e){var r=e[0].trace,a=new P(t,r.uid),n=a.sourceId,o=c(e),i=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(n,{type:"geojson",data:o.geojson}),a._addLayers(o,i),a}}),vW=Ft((Q,$)=>{var c=Es(),g=pT().hoverPoints,P=pT().getExtraText;$.exports=function(S,t,e){var r=g(S,t,e);if(r){var a=r[0],n=a.cd,o=n[0].trace,i=n[a.index];if(delete a.color,"z"in i){var s=a.subplot.mockAxis;a.z=i.z,a.zLabel=c.tickText(s,s.c2l(i.z),"hover").text}return a.extraText=P(o,i,n[0].t.labels),[a]}}}),yW=Ft((Q,$)=>{$.exports=function(c,g){return c.lon=g.lon,c.lat=g.lat,c.z=g.z,c}}),xW=Ft((Q,$)=>{$.exports={attributes:pE(),supplyDefaults:dW(),colorbar:L1(),formatLabels:uE(),calc:pW(),plot:gW(),hoverPoints:vW(),eventData:yW(),getBelow:function(c,g){for(var P=g.getMapLayers(),S=0;S<P.length;S++){var t=P[S],e=t.id;if(t.type==="symbol"&&typeof e=="string"&&e.indexOf("plotly-")===-1)return e}},moduleType:"trace",name:"densitymapbox",basePlotModule:mT(),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}}),_W=Ft((Q,$)=>{$.exports=xW()}),bW=Ft((Q,$)=>{$.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"}}),wW=Ft((Q,$)=>{$.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"}}]}}),Z1=Ft((Q,$)=>{var c=G0(),g=bW(),P=wW(),S='© <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",a="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",i={basic:r,streets:r,outdoors:r,light:t,dark:e,satellite:P,"satellite-streets":g,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:S,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":a,"carto-darkmatter-nolabels":n,"carto-voyager-nolabels":o},s=c(i);$.exports={styleValueDflt:"basic",stylesMap:i,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."}}),S3=Ft((Q,$)=>{var c=bn(),g=li().defaultLine,P=Nh().attributes,S=Ea(),t=tf().textposition,e=Yc().overrideAll,r=pu().templatedArray,a=Z1(),n=S({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var o=$.exports=e({_arrayAttrRegexps:[c.counterRegex("map",".layers",!0)],domain:P({name:"map"}),style:{valType:"any",values:a.styleValuesMap,dflt:a.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:g},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:g}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:c.extendFlat({},t,{arrayOk:!1})}})},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}),gT=Ft((Q,$)=>{var{hovertemplateAttrs:c,texttemplateAttrs:g,templatefallbackAttrs:P}=$u(),S=z0(),t=dx(),e=tf(),r=S3(),a=$o(),n=Tc(),o=Ta().extendFlat,i=Yc().overrideAll,s=S3(),f=t.line,x=t.marker;$.exports=i({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({},x.opacity,{dflt:1})},mode:o({},e.mode,{dflt:"markers"}),text:o({},e.text,{}),texttemplate:g({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:P({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:x.opacity,size:x.size,sizeref:x.sizeref,sizemin:x.sizemin,sizemode:x.sizemode},n("marker")),fill:t.fill,fillcolor:S(),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({},a.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:c(),hovertemplatefallback:P()},"calc","nested")}),mE=Ft((Q,$)=>{var c=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];$.exports={isSupportedFont:function(g){return c.indexOf(g)!==-1}}}),kW=Ft((Q,$)=>{var c=bn(),g=Ac(),P=s0(),S=I0(),t=x0(),e=O0(),r=gT(),a=mE().isSupportedFont;$.exports=function(o,i,s,f){function x(p,k){return c.coerce(o,i,r,p,k)}function y(p,k){return c.coerce2(o,i,r,p,k)}var v=n(o,i,x);if(!v){i.visible=!1;return}if(x("text"),x("texttemplate"),x("texttemplatefallback"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback"),x("mode"),x("below"),g.hasMarkers(i)){P(o,i,s,f,x,{noLine:!0,noAngle:!0}),x("marker.allowoverlap"),x("marker.angle");var T=i.marker;T.symbol!=="circle"&&(c.isArrayOrTypedArray(T.size)&&(T.size=T.size[0]),c.isArrayOrTypedArray(T.color)&&(T.color=T.color[0]))}g.hasLines(i)&&(S(o,i,s,f,x,{noDash:!0}),x("connectgaps"));var u=y("cluster.maxzoom"),b=y("cluster.step"),_=y("cluster.color",i.marker&&i.marker.color||s),C=y("cluster.size"),M=y("cluster.opacity"),E=u!==!1||b!==!1||_!==!1||C!==!1||M!==!1,A=x("cluster.enabled",E);if(A||g.hasText(i)){var h=f.font.family;t(o,i,f,x,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:a(h)?h:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}x("fill"),i.fill!=="none"&&e(o,i,s,x),c.coerceSelectionMarkerOpacity(i,x)};function n(o,i,s){var f=s("lon")||[],x=s("lat")||[],y=Math.min(f.length,x.length);return i._length=y,y}}),gE=Ft((Q,$)=>{var c=Es();$.exports=function(g,P,S){var t={},e=S[P.subplot]._subplot,r=e.mockAxis,a=g.lonlat;return t.lonLabel=c.tickText(r,r.c2l(a[0]),!0).text,t.latLabel=c.tickText(r,r.c2l(a[1]),!0).text,t}}),vE=Ft((Q,$)=>{var c=bn();$.exports=function(g,P){var S=g.split(" "),t=S[0],e=S[1],r=c.isArrayOrTypedArray(P)?c.mean(P):P,a=.5+r/100,n=1.5+r/100,o=["",""],i=[0,0];switch(t){case"top":o[0]="top",i[1]=-n;break;case"bottom":o[0]="bottom",i[1]=n;break}switch(e){case"left":o[1]="right",i[0]=-a;break;case"right":o[1]="left",i[0]=a;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:i}}}),TW=Ft((Q,$)=>{var c=ra(),g=bn(),P=Da().BADNUM,S=U1(),t=Xc(),e=js(),r=yg(),a=Ac(),n=mE().isSupportedFont,o=vE(),i=Dp().appendArrayPointValue,s=tc().NEWLINES,f=tc().BR_TAG_ALL;$.exports=function(M,E){var A=E[0].trace,h=A.visible===!0&&A._length!==0,p=A.fill!=="none",k=a.hasLines(A),w=a.hasMarkers(A),R=a.hasText(A),O=w&&A.marker.symbol==="circle",N=w&&A.marker.symbol!=="circle",V=A.cluster&&A.cluster.enabled,H=x("fill"),F=x("line"),U=x("circle"),W=x("symbol"),q={fill:H,line:F,circle:U,symbol:W};if(!h)return q;var X;if((p||k)&&(X=S.calcTraceToLineCoords(E)),p&&(H.geojson=S.makePolygon(X),H.layout.visibility="visible",g.extendFlat(H.paint,{"fill-color":A.fillcolor})),k&&(F.geojson=S.makeLine(X),F.layout.visibility="visible",g.extendFlat(F.paint,{"line-width":A.line.width,"line-color":A.line.color,"line-opacity":A.opacity})),O){var lt=y(E);U.geojson=lt.geojson,U.layout.visibility="visible",V&&(U.filter=["!",["has","point_count"]],q.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":_(A.cluster.color,A.cluster.step),"circle-radius":_(A.cluster.size,A.cluster.step),"circle-opacity":_(A.cluster.opacity,A.cluster.step)}},q.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":C(A),"text-size":12}}),g.extendFlat(U.paint,{"circle-color":lt.mcc,"circle-radius":lt.mrc,"circle-opacity":lt.mo})}if(O&&V&&(U.filter=["!",["has","point_count"]]),(N||R)&&(W.geojson=v(E,M),g.extendFlat(W.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),N&&(g.extendFlat(W.layout,{"icon-size":A.marker.size/10}),"angle"in A.marker&&A.marker.angle!=="auto"&&g.extendFlat(W.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),W.layout["icon-allow-overlap"]=A.marker.allowoverlap,g.extendFlat(W.paint,{"icon-opacity":A.opacity*A.marker.opacity,"icon-color":A.marker.color})),R)){var yt=(A.marker||{}).size,pt=o(A.textposition,yt);g.extendFlat(W.layout,{"text-size":A.textfont.size,"text-anchor":pt.anchor,"text-offset":pt.offset,"text-font":C(A)}),g.extendFlat(W.paint,{"text-color":A.textfont.color,"text-opacity":A.opacity})}return q};function x(M){return{type:M,geojson:S.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function y(M){var E=M[0].trace,A=E.marker,h=E.selectedpoints,p=g.isArrayOrTypedArray(A.color),k=g.isArrayOrTypedArray(A.size),w=g.isArrayOrTypedArray(A.opacity),R;function O(pt){return E.opacity*pt}function N(pt){return pt/2}var V;p&&(t.hasColorscale(E,"marker")?V=t.makeColorScaleFuncFromTrace(A):V=g.identity);var H;k&&(H=r(E));var F;w&&(F=function(pt){var st=c(pt)?+g.constrain(pt,0,1):0;return O(st)});var U=[];for(R=0;R<M.length;R++){var W=M[R],q=W.lonlat;if(!b(q)){var X={};V&&(X.mcc=W.mcc=V(W.mc)),H&&(X.mrc=W.mrc=H(W.ms)),F&&(X.mo=F(W.mo)),h&&(X.selected=W.selected||0),U.push({type:"Feature",id:R+1,geometry:{type:"Point",coordinates:q},properties:X})}}var lt;if(h)for(lt=e.makeSelectedPointStyleFns(E),R=0;R<U.length;R++){var yt=U[R].properties;lt.selectedOpacityFn&&(yt.mo=O(lt.selectedOpacityFn(yt))),lt.selectedColorFn&&(yt.mcc=lt.selectedColorFn(yt)),lt.selectedSizeFn&&(yt.mrc=lt.selectedSizeFn(yt))}return{geojson:{type:"FeatureCollection",features:U},mcc:p||lt&&lt.selectedColorFn?{type:"identity",property:"mcc"}:A.color,mrc:k||lt&&lt.selectedSizeFn?{type:"identity",property:"mrc"}:N(A.size),mo:w||lt&&lt.selectedOpacityFn?{type:"identity",property:"mo"}:O(A.opacity)}}function v(M,E){for(var A=E._fullLayout,h=M[0].trace,p=h.marker||{},k=p.symbol,w=p.angle,R=k!=="circle"?T(k):u,O=w!=="auto"?T(w,!0):u,N=a.hasText(h)?T(h.text):u,V=[],H=0;H<M.length;H++){var F=M[H];if(!b(F.lonlat)){var U=h.texttemplate,W;if(U){var q=Array.isArray(U)?U[H]||"":U,X=h._module.formatLabels(F,h,A),lt={};i(lt,h,F.i),W=g.texttemplateString({data:[lt,F,h._meta],fallback:h.texttemplatefallback,labels:X,locale:A._d3locale,template:q})}else W=N(H);W&&(W=W.replace(s,"").replace(f,`
`)),V.push({type:"Feature",geometry:{type:"Point",coordinates:F.lonlat},properties:{symbol:R(H),angle:O(H),text:W}})}}return{type:"FeatureCollection",features:V}}function T(M,E){return g.isArrayOrTypedArray(M)?E?function(A){return c(M[A])?+M[A]:0}:function(A){return M[A]}:M?function(){return M}:u}function u(){return""}function b(M){return M[0]===P}function _(M,E){var A;if(g.isArrayOrTypedArray(M)&&g.isArrayOrTypedArray(E)){A=["step",["get","point_count"],M[0]];for(var h=1;h<M.length;h++)A.push(E[h-1],M[h])}else A=M;return A}function C(M){var E=M.textfont,A=E.family,h=E.style,p=E.weight,k=A.split(" "),w=k[k.length-1]==="Italic";w&&k.pop(),w=w||h==="italic";var R=k.join(" ");p==="bold"&&k.indexOf("Bold")===-1?R+=" Bold":p<=1e3&&(k[0]==="Metropolis"?(R="Metropolis",p>850?R+=" Black":p>750?R+=" Extra Bold":p>650?R+=" Bold":p>550?R+=" Semi Bold":p>450?R+=" Medium":p>350?R+=" Regular":p>250?R+=" Light":p>150?R+=" Extra Light":R+=" Thin"):k.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",p>750?R+=" Extrabold":p>650?R+=" Bold":p>550?R+=" Semibold":p>350?R+=" Regular":R+=" Light"):k.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",k[3]==="CJK"&&(R+=" CJK"),R+=p>500?" Bold":" Regular")),w&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),n(R)||(R=A);var O=R.split(", ");return O}}),AW=Ft((Q,$)=>{var c=bn(),g=TW(),P=Z1().traceLayerPrefix,S={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function t(r,a,n,o){this.type="scattermap",this.subplot=r,this.uid=a,this.clusterEnabled=n,this.isHidden=o,this.sourceIds={fill:"source-"+a+"-fill",line:"source-"+a+"-line",circle:"source-"+a+"-circle",symbol:"source-"+a+"-symbol",cluster:"source-"+a+"-circle",clusterCount:"source-"+a+"-circle"},this.layerIds={fill:P+a+"-fill",line:P+a+"-line",circle:P+a+"-circle",symbol:P+a+"-symbol",cluster:P+a+"-cluster",clusterCount:P+a+"-cluster-count"},this.below=null}var e=t.prototype;e.addSource=function(r,a,n){var o={type:"geojson",data:a.geojson};n&&n.enabled&&c.extendFlat(o,{cluster:!0,clusterMaxZoom:n.maxzoom});var i=this.subplot.map.getSource(this.sourceIds[r]);i?i.setData(a.geojson):this.subplot.map.addSource(this.sourceIds[r],o)},e.setSourceData=function(r,a){this.subplot.map.getSource(this.sourceIds[r]).setData(a.geojson)},e.addLayer=function(r,a,n){var o={type:a.type,id:this.layerIds[r],source:this.sourceIds[r],layout:a.layout,paint:a.paint};a.filter&&(o.filter=a.filter);for(var i=this.layerIds[r],s,f=this.subplot.getMapLayers(),x=0;x<f.length;x++)if(f[x].id===i){s=!0;break}s?(this.subplot.setOptions(i,"setLayoutProperty",o.layout),o.layout.visibility==="visible"&&this.subplot.setOptions(i,"setPaintProperty",o.paint)):this.subplot.addLayer(o,n)},e.update=function(r){var a=r[0].trace,n=this.subplot,o=n.map,i=g(n.gd,r),s=n.belowLookup["trace-"+this.uid],f=!!(a.cluster&&a.cluster.enabled),x=!!this.clusterEnabled,y=this;function v(h){h||y.addSource("circle",i.circle,a.cluster);for(var p=S.cluster,k=0;k<p.length;k++){var w=p[k],R=i[w];y.addLayer(w,R,s)}}function T(h){for(var p=S.cluster,k=p.length-1;k>=0;k--){var w=p[k];o.removeLayer(y.layerIds[w])}h||o.removeSource(y.sourceIds.circle)}function u(h){for(var p=S.nonCluster,k=0;k<p.length;k++){var w=p[k],R=i[w];h||y.addSource(w,R),y.addLayer(w,R,s)}}function b(h){for(var p=S.nonCluster,k=p.length-1;k>=0;k--){var w=p[k];o.removeLayer(y.layerIds[w]),h||o.removeSource(y.sourceIds[w])}}function _(h){x?T(h):b(h)}function C(h){f?v(h):u(h)}function M(){for(var h=f?S.cluster:S.nonCluster,p=0;p<h.length;p++){var k=h[p],w=i[k];w&&(n.setOptions(y.layerIds[k],"setLayoutProperty",w.layout),w.layout.visibility==="visible"&&(k!=="cluster"&&y.setSourceData(k,w),n.setOptions(y.layerIds[k],"setPaintProperty",w.paint)))}}var E=this.isHidden,A=a.visible!==!0;A?E||_():E?A||C():x!==f?(_(),C()):(this.below!==s&&(_(!0),C(!0)),M()),this.clusterEnabled=f,this.isHidden=A,this.below=s,r[0].trace._glTrace=this},e.dispose=function(){for(var r=this.subplot.map,a=this.clusterEnabled?S.cluster:S.nonCluster,n=a.length-1;n>=0;n--){var o=a[n];r.removeLayer(this.layerIds[o]),r.removeSource(this.sourceIds[o])}},$.exports=function(r,a){var n=a[0].trace,o=n.cluster&&n.cluster.enabled,i=n.visible!==!0,s=new t(r,n.uid,o,i),f=g(r.gd,a),x=s.below=r.belowLookup["trace-"+n.uid],y,v,T;if(o)for(s.addSource("circle",f.circle,n.cluster),y=0;y<S.cluster.length;y++)v=S.cluster[y],T=f[v],s.addLayer(v,T,x);else for(y=0;y<S.nonCluster.length;y++)v=S.nonCluster[y],T=f[v],s.addSource(v,T,n.cluster),s.addLayer(v,T,x);return a[0].trace._glTrace=s,s}}),vT=Ft((Q,$)=>{var c=Qh(),g=bn(),P=Du(),S=g.fillText,t=Da().BADNUM,e=Z1().traceLayerPrefix;function r(n,o,i){var s=n.cd,f=s[0].trace,x=n.xa,y=n.ya,v=n.subplot,T=[],u=e+f.uid+"-circle",b=f.cluster&&f.cluster.enabled;if(b){var _=v.map.queryRenderedFeatures(null,{layers:[u]});T=_.map(function(H){return H.id})}var C=o>=0?Math.floor((o+180)/360):Math.ceil((o-180)/360),M=C*360,E=o-M;function A(H){var F=H.lonlat;if(F[0]===t||b&&T.indexOf(H.i+1)===-1)return 1/0;var U=g.modHalf(F[0],360),W=F[1],q=v.project([U,W]),X=q.x-x.c2p([E,W]),lt=q.y-y.c2p([U,i]),yt=Math.max(3,H.mrc||0);return Math.max(Math.sqrt(X*X+lt*lt)-yt,1-3/yt)}if(c.getClosest(s,A,n),n.index!==!1){var h=s[n.index],p=h.lonlat,k=[g.modHalf(p[0],360)+M,p[1]],w=x.c2p(k),R=y.c2p(k),O=h.mrc||1;n.x0=w-O,n.x1=w+O,n.y0=R-O,n.y1=R+O;var N={};N[f.subplot]={_subplot:v};var V=f._module.formatLabels(h,f,N);return n.lonLabel=V.lonLabel,n.latLabel=V.latLabel,n.color=P(f,h),n.extraText=a(f,h,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function a(n,o,i){if(n.hovertemplate)return;var s=o.hi||n.hoverinfo,f=s.split("+"),x=f.indexOf("all")!==-1,y=f.indexOf("lon")!==-1,v=f.indexOf("lat")!==-1,T=o.lonlat,u=[];function b(_){return _+"°"}return x||y&&v?u.push("("+b(T[1])+", "+b(T[0])+")"):y?u.push(i.lon+b(T[0])):v&&u.push(i.lat+b(T[1])),(x||f.indexOf("text")!==-1)&&S(o,n,u),u.join("<br>")}$.exports={hoverPoints:r,getExtraText:a}}),MW=Ft((Q,$)=>{$.exports=function(c,g){return c.lon=g.lon,c.lat=g.lat,c}}),SW=Ft((Q,$)=>{var c=bn(),g=Ac(),P=Da().BADNUM;$.exports=function(S,t){var e=S.cd,r=S.xaxis,a=S.yaxis,n=[],o=e[0].trace,i;if(!g.hasMarkers(o))return[];if(t===!1)for(i=0;i<e.length;i++)e[i].selected=0;else for(i=0;i<e.length;i++){var s=e[i],f=s.lonlat;if(f[0]!==P){var x=[c.modHalf(f[0],360),f[1]],y=[r.c2p(x),a.c2p(x)];t.contains(y,null,i,S)?(n.push({pointNumber:i,lon:f[0],lat:f[1]}),s.selected=1):s.selected=0}}return n}}),EW=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?$.exports=g():(c=typeof globalThis<"u"?globalThis:c||self,c.maplibregl=g())})(Q,function(){var c={},g={};function P(t,e,r){if(g[t]=r,t==="index"){var a="var sharedModule = {}; ("+g.shared+")(sharedModule); ("+g.worker+")(sharedModule);",n={};return g.shared(n),g.index(c,n),typeof window<"u"&&c.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))),c}}P("shared",["exports"],function(t){function e(G,D,nt,_t){return new(nt||(nt=Promise))(function(Rt,Kt){function Qt(er){try{Fe(_t.next(er))}catch(yr){Kt(yr)}}function be(er){try{Fe(_t.throw(er))}catch(yr){Kt(yr)}}function Fe(er){var yr;er.done?Rt(er.value):(yr=er.value,yr instanceof nt?yr:new nt(function(Er){Er(yr)})).then(Qt,be)}Fe((_t=_t.apply(G,D||[])).next())})}function r(G){return G&&G.__esModule&&Object.prototype.hasOwnProperty.call(G,"default")?G.default:G}typeof SuppressedError=="function"&&SuppressedError;var a=n;function n(G,D){this.x=G,this.y=D}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(G){return this.clone()._add(G)},sub:function(G){return this.clone()._sub(G)},multByPoint:function(G){return this.clone()._multByPoint(G)},divByPoint:function(G){return this.clone()._divByPoint(G)},mult:function(G){return this.clone()._mult(G)},div:function(G){return this.clone()._div(G)},rotate:function(G){return this.clone()._rotate(G)},rotateAround:function(G,D){return this.clone()._rotateAround(G,D)},matMult:function(G){return this.clone()._matMult(G)},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(G){return this.x===G.x&&this.y===G.y},dist:function(G){return Math.sqrt(this.distSqr(G))},distSqr:function(G){var D=G.x-this.x,nt=G.y-this.y;return D*D+nt*nt},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(G){return Math.atan2(this.y-G.y,this.x-G.x)},angleWith:function(G){return this.angleWithSep(G.x,G.y)},angleWithSep:function(G,D){return Math.atan2(this.x*D-this.y*G,this.x*G+this.y*D)},_matMult:function(G){var D=G[2]*this.x+G[3]*this.y;return this.x=G[0]*this.x+G[1]*this.y,this.y=D,this},_add:function(G){return this.x+=G.x,this.y+=G.y,this},_sub:function(G){return this.x-=G.x,this.y-=G.y,this},_mult:function(G){return this.x*=G,this.y*=G,this},_div:function(G){return this.x/=G,this.y/=G,this},_multByPoint:function(G){return this.x*=G.x,this.y*=G.y,this},_divByPoint:function(G){return this.x/=G.x,this.y/=G.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var G=this.y;return this.y=this.x,this.x=-G,this},_rotate:function(G){var D=Math.cos(G),nt=Math.sin(G),_t=nt*this.x+D*this.y;return this.x=D*this.x-nt*this.y,this.y=_t,this},_rotateAround:function(G,D){var nt=Math.cos(G),_t=Math.sin(G),Rt=D.y+_t*(this.x-D.x)+nt*(this.y-D.y);return this.x=D.x+nt*(this.x-D.x)-_t*(this.y-D.y),this.y=Rt,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(G){return G instanceof n?G:Array.isArray(G)?new n(G[0],G[1]):G};var o=r(a),i=s;function s(G,D,nt,_t){this.cx=3*G,this.bx=3*(nt-G)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(_t-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=G,this.p1y=D,this.p2x=nt,this.p2y=_t}s.prototype={sampleCurveX:function(G){return((this.ax*G+this.bx)*G+this.cx)*G},sampleCurveY:function(G){return((this.ay*G+this.by)*G+this.cy)*G},sampleCurveDerivativeX:function(G){return(3*this.ax*G+2*this.bx)*G+this.cx},solveCurveX:function(G,D){if(D===void 0&&(D=1e-6),G<0)return 0;if(G>1)return 1;for(var nt=G,_t=0;_t<8;_t++){var Rt=this.sampleCurveX(nt)-G;if(Math.abs(Rt)<D)return nt;var Kt=this.sampleCurveDerivativeX(nt);if(Math.abs(Kt)<1e-6)break;nt-=Rt/Kt}var Qt=0,be=1;for(nt=G,_t=0;_t<20&&(Rt=this.sampleCurveX(nt),!(Math.abs(Rt-G)<D));_t++)G>Rt?Qt=nt:be=nt,nt=.5*(be-Qt)+Qt;return nt},solve:function(G,D){return this.sampleCurveY(this.solveCurveX(G,D))}};var f=r(i);let x,y;function v(){return x==null&&(x=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),x}function T(){if(y==null&&(y=!1,v())){let G=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(G){for(let nt=0;nt<25;nt++){let _t=4*nt;G.fillStyle=`rgb(${_t},${_t+1},${_t+2})`,G.fillRect(nt%5,Math.floor(nt/5),1,1)}let D=G.getImageData(0,0,5,5).data;for(let nt=0;nt<100;nt++)if(nt%4!=3&&D[nt]!==nt){y=!0;break}}}return y||!1}function u(G,D,nt,_t){let Rt=new f(G,D,nt,_t);return Kt=>Rt.solve(Kt)}let b=u(.25,.1,.25,1);function _(G,D,nt){return Math.min(nt,Math.max(D,G))}function C(G,D,nt){let _t=nt-D,Rt=((G-D)%_t+_t)%_t+D;return Rt===D?nt:Rt}function M(G,...D){for(let nt of D)for(let _t in nt)G[_t]=nt[_t];return G}let E=1;function A(G,D,nt){let _t={};for(let Rt in G)_t[Rt]=D.call(this,G[Rt],Rt,G);return _t}function h(G,D,nt){let _t={};for(let Rt in G)D.call(this,G[Rt],Rt,G)&&(_t[Rt]=G[Rt]);return _t}function p(G){return Array.isArray(G)?G.map(p):typeof G=="object"&&G?A(G,p):G}let k={};function w(G){k[G]||(typeof console<"u"&&console.warn(G),k[G]=!0)}function R(G,D,nt){return(nt.y-G.y)*(D.x-G.x)>(D.y-G.y)*(nt.x-G.x)}function O(G){return typeof WorkerGlobalScope<"u"&&G!==void 0&&G instanceof WorkerGlobalScope}let N=null;function V(G){return typeof ImageBitmap<"u"&&G instanceof ImageBitmap}let H="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function F(G,D,nt,_t,Rt){return e(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let Kt=new VideoFrame(G,{timestamp:0});try{let Qt=Kt?.format;if(!Qt||!Qt.startsWith("BGR")&&!Qt.startsWith("RGB"))throw new Error(`Unrecognized format ${Qt}`);let be=Qt.startsWith("BGR"),Fe=new Uint8ClampedArray(_t*Rt*4);if(yield Kt.copyTo(Fe,function(er,yr,Er,Zr,sn){let xn=4*Math.max(-yr,0),Ln=(Math.max(0,Er)-Er)*Zr*4+xn,$n=4*Zr,ki=Math.max(0,yr),Aa=Math.max(0,Er);return{rect:{x:ki,y:Aa,width:Math.min(er.width,yr+Zr)-ki,height:Math.min(er.height,Er+sn)-Aa},layout:[{offset:Ln,stride:$n}]}}(G,D,nt,_t,Rt)),be)for(let er=0;er<Fe.length;er+=4){let yr=Fe[er];Fe[er]=Fe[er+2],Fe[er+2]=yr}return Fe}finally{Kt.close()}})}let U,W,q="AbortError";function X(){return new Error(q)}let lt={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function yt(G){return lt.REGISTERED_PROTOCOLS[G.substring(0,G.indexOf("://"))]}let pt="global-dispatcher";class st extends Error{constructor(D,nt,_t,Rt){super(`AJAXError: ${nt} (${D}): ${_t}`),this.status=D,this.statusText=nt,this.url=_t,this.body=Rt}}let tt=()=>O(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,dt=function(G,D){if(/:\/\//.test(G.url)&&!/^https?:|^file:/.test(G.url)){let _t=yt(G.url);if(_t)return _t(G,D);if(O(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:G,targetMapId:pt},D)}if(!(/^file:/.test(nt=G.url)||/^file:/.test(tt())&&!/^\w+:/.test(nt))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(_t,Rt){return e(this,void 0,void 0,function*(){let Kt=new Request(_t.url,{method:_t.method||"GET",body:_t.body,credentials:_t.credentials,headers:_t.headers,cache:_t.cache,referrer:tt(),signal:Rt.signal});_t.type!=="json"||Kt.headers.has("Accept")||Kt.headers.set("Accept","application/json");let Qt=yield fetch(Kt);if(!Qt.ok){let er=yield Qt.blob();throw new st(Qt.status,Qt.statusText,_t.url,er)}let be;be=_t.type==="arrayBuffer"||_t.type==="image"?Qt.arrayBuffer():_t.type==="json"?Qt.json():Qt.text();let Fe=yield be;if(Rt.signal.aborted)throw X();return{data:Fe,cacheControl:Qt.headers.get("Cache-Control"),expires:Qt.headers.get("Expires")}})}(G,D);if(O(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:G,mustQueue:!0,targetMapId:pt},D)}var nt;return function(_t,Rt){return new Promise((Kt,Qt)=>{var be;let Fe=new XMLHttpRequest;Fe.open(_t.method||"GET",_t.url,!0),_t.type!=="arrayBuffer"&&_t.type!=="image"||(Fe.responseType="arraybuffer");for(let er in _t.headers)Fe.setRequestHeader(er,_t.headers[er]);_t.type==="json"&&(Fe.responseType="text",!((be=_t.headers)===null||be===void 0)&&be.Accept||Fe.setRequestHeader("Accept","application/json")),Fe.withCredentials=_t.credentials==="include",Fe.onerror=()=>{Qt(new Error(Fe.statusText))},Fe.onload=()=>{if(!Rt.signal.aborted)if((Fe.status>=200&&Fe.status<300||Fe.status===0)&&Fe.response!==null){let er=Fe.response;if(_t.type==="json")try{er=JSON.parse(Fe.response)}catch(yr){return void Qt(yr)}Kt({data:er,cacheControl:Fe.getResponseHeader("Cache-Control"),expires:Fe.getResponseHeader("Expires")})}else{let er=new Blob([Fe.response],{type:Fe.getResponseHeader("Content-Type")});Qt(new st(Fe.status,Fe.statusText,_t.url,er))}},Rt.signal.addEventListener("abort",()=>{Fe.abort(),Qt(X())}),Fe.send(_t.body)})}(G,D)};function rt(G){if(!G||G.indexOf("://")<=0||G.indexOf("data:image/")===0||G.indexOf("blob:")===0)return!0;let D=new URL(G),nt=window.location;return D.protocol===nt.protocol&&D.host===nt.host}function at(G,D,nt){nt[G]&&nt[G].indexOf(D)!==-1||(nt[G]=nt[G]||[],nt[G].push(D))}function vt(G,D,nt){if(nt&&nt[G]){let _t=nt[G].indexOf(D);_t!==-1&&nt[G].splice(_t,1)}}class it{constructor(D,nt={}){M(this,nt),this.type=D}}class Y extends it{constructor(D,nt={}){super("error",M({error:D},nt))}}class ft{on(D,nt){return this._listeners=this._listeners||{},at(D,nt,this._listeners),this}off(D,nt){return vt(D,nt,this._listeners),vt(D,nt,this._oneTimeListeners),this}once(D,nt){return nt?(this._oneTimeListeners=this._oneTimeListeners||{},at(D,nt,this._oneTimeListeners),this):new Promise(_t=>this.once(D,_t))}fire(D,nt){typeof D=="string"&&(D=new it(D,nt||{}));let _t=D.type;if(this.listens(_t)){D.target=this;let Rt=this._listeners&&this._listeners[_t]?this._listeners[_t].slice():[];for(let be of Rt)be.call(this,D);let Kt=this._oneTimeListeners&&this._oneTimeListeners[_t]?this._oneTimeListeners[_t].slice():[];for(let be of Kt)vt(_t,be,this._oneTimeListeners),be.call(this,D);let Qt=this._eventedParent;Qt&&(M(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Qt.fire(D))}else D instanceof Y&&console.error(D.error);return this}listens(D){return this._listeners&&this._listeners[D]&&this._listeners[D].length>0||this._oneTimeListeners&&this._oneTimeListeners[D]&&this._oneTimeListeners[D].length>0||this._eventedParent&&this._eventedParent.listens(D)}setEventedParent(D,nt){return this._eventedParent=D,this._eventedParentData=nt,this}}var ut={$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 wt=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function zt(G,D){let nt={};for(let _t in G)_t!=="ref"&&(nt[_t]=G[_t]);return wt.forEach(_t=>{_t in D&&(nt[_t]=D[_t])}),nt}function Pt(G,D){if(Array.isArray(G)){if(!Array.isArray(D)||G.length!==D.length)return!1;for(let nt=0;nt<G.length;nt++)if(!Pt(G[nt],D[nt]))return!1;return!0}if(typeof G=="object"&&G!==null&&D!==null){if(typeof D!="object"||Object.keys(G).length!==Object.keys(D).length)return!1;for(let nt in G)if(!Pt(G[nt],D[nt]))return!1;return!0}return G===D}function Wt(G,D){G.push(D)}function Ht(G,D,nt){Wt(nt,{command:"addSource",args:[G,D[G]]})}function Jt(G,D,nt){Wt(D,{command:"removeSource",args:[G]}),nt[G]=!0}function ge(G,D,nt,_t){Jt(G,nt,_t),Ht(G,D,nt)}function he(G,D,nt){let _t;for(_t in G[nt])if(Object.prototype.hasOwnProperty.call(G[nt],_t)&&_t!=="data"&&!Pt(G[nt][_t],D[nt][_t]))return!1;for(_t in D[nt])if(Object.prototype.hasOwnProperty.call(D[nt],_t)&&_t!=="data"&&!Pt(G[nt][_t],D[nt][_t]))return!1;return!0}function de(G,D,nt,_t,Rt,Kt){G=G||{},D=D||{};for(let Qt in G)Object.prototype.hasOwnProperty.call(G,Qt)&&(Pt(G[Qt],D[Qt])||nt.push({command:Kt,args:[_t,Qt,D[Qt],Rt]}));for(let Qt in D)Object.prototype.hasOwnProperty.call(D,Qt)&&!Object.prototype.hasOwnProperty.call(G,Qt)&&(Pt(G[Qt],D[Qt])||nt.push({command:Kt,args:[_t,Qt,D[Qt],Rt]}))}function se(G){return G.id}function Tt(G,D){return G[D.id]=D,G}class Lt{constructor(D,nt,_t,Rt){this.message=(D?`${D}: `:"")+_t,Rt&&(this.identifier=Rt),nt!=null&&nt.__line__&&(this.line=nt.__line__)}}function Mt(G,...D){for(let nt of D)for(let _t in nt)G[_t]=nt[_t];return G}class te extends Error{constructor(D,nt){super(nt),this.message=nt,this.key=D}}class ve{constructor(D,nt=[]){this.parent=D,this.bindings={};for(let[_t,Rt]of nt)this.bindings[_t]=Rt}concat(D){return new ve(this,D)}get(D){if(this.bindings[D])return this.bindings[D];if(this.parent)return this.parent.get(D);throw new Error(`${D} not found in scope.`)}has(D){return!!this.bindings[D]||!!this.parent&&this.parent.has(D)}}let oe={kind:"null"},Te={kind:"number"},He={kind:"string"},Ge={kind:"boolean"},cr={kind:"color"},ur={kind:"object"},jr={kind:"value"},Hr={kind:"collator"},br={kind:"formatted"},Kr={kind:"padding"},rn={kind:"resolvedImage"},Ce={kind:"variableAnchorOffsetCollection"};function $t(G,D){return{kind:"array",itemType:G,N:D}}function ne(G){if(G.kind==="array"){let D=ne(G.itemType);return typeof G.N=="number"?`array<${D}, ${G.N}>`:G.itemType.kind==="value"?"array":`array<${D}>`}return G.kind}let Ct=[oe,Te,He,Ge,cr,br,ur,$t(jr),Kr,rn,Ce];function gt(G,D){if(D.kind==="error")return null;if(G.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!gt(G.itemType,D.itemType))&&(typeof G.N!="number"||G.N===D.N))return null}else{if(G.kind===D.kind)return null;if(G.kind==="value"){for(let nt of Ct)if(!gt(nt,D))return null}}return`Expected ${ne(G)} but found ${ne(D)} instead.`}function St(G,D){return D.some(nt=>nt.kind===G.kind)}function Nt(G,D){return D.some(nt=>nt==="null"?G===null:nt==="array"?Array.isArray(G):nt==="object"?G&&!Array.isArray(G)&&typeof G=="object":nt===typeof G)}function ee(G,D){return G.kind==="array"&&D.kind==="array"?G.itemType.kind===D.itemType.kind&&typeof G.N=="number":G.kind===D.kind}let le=.96422,we=.82521,Ue=4/29,qe=6/29,ar=3*qe*qe,Ar=qe*qe*qe,Tr=Math.PI/180,pr=180/Math.PI;function Jr(G){return(G%=360)<0&&(G+=360),G}function Vn([G,D,nt,_t]){let Rt,Kt,Qt=Kn((.2225045*(G=Hn(G))+.7168786*(D=Hn(D))+.0606169*(nt=Hn(nt)))/1);G===D&&D===nt?Rt=Kt=Qt:(Rt=Kn((.4360747*G+.3850649*D+.1430804*nt)/le),Kt=Kn((.0139322*G+.0971045*D+.7141733*nt)/we));let be=116*Qt-16;return[be<0?0:be,500*(Rt-Qt),200*(Qt-Kt),_t]}function Hn(G){return G<=.04045?G/12.92:Math.pow((G+.055)/1.055,2.4)}function Kn(G){return G>Ar?Math.pow(G,1/3):G/ar+Ue}function Ci([G,D,nt,_t]){let Rt=(G+16)/116,Kt=isNaN(D)?Rt:Rt+D/500,Qt=isNaN(nt)?Rt:Rt-nt/200;return Rt=1*qn(Rt),Kt=le*qn(Kt),Qt=we*qn(Qt),[ii(3.1338561*Kt-1.6168667*Rt-.4906146*Qt),ii(-.9787684*Kt+1.9161415*Rt+.033454*Qt),ii(.0719453*Kt-.2289914*Rt+1.4052427*Qt),_t]}function ii(G){return(G=G<=.00304?12.92*G:1.055*Math.pow(G,1/2.4)-.055)<0?0:G>1?1:G}function qn(G){return G>qe?G*G*G:ar*(G-Ue)}function oa(G){return parseInt(G.padEnd(2,G),16)/255}function Hi(G,D){return We(D?G/100:G,0,1)}function We(G,D,nt){return Math.min(Math.max(D,G),nt)}function rr(G){return!G.some(Number.isNaN)}let fr={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 xr{constructor(D,nt,_t,Rt=1,Kt=!0){this.r=D,this.g=nt,this.b=_t,this.a=Rt,Kt||(this.r*=Rt,this.g*=Rt,this.b*=Rt,Rt||this.overwriteGetter("rgb",[D,nt,_t,Rt]))}static parse(D){if(D instanceof xr)return D;if(typeof D!="string")return;let nt=function(_t){if((_t=_t.toLowerCase().trim())==="transparent")return[0,0,0,0];let Rt=fr[_t];if(Rt){let[Qt,be,Fe]=Rt;return[Qt/255,be/255,Fe/255,1]}if(_t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(_t)){let Qt=_t.length<6?1:2,be=1;return[oa(_t.slice(be,be+=Qt)),oa(_t.slice(be,be+=Qt)),oa(_t.slice(be,be+=Qt)),oa(_t.slice(be,be+Qt)||"ff")]}if(_t.startsWith("rgb")){let Qt=_t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Qt){let[be,Fe,er,yr,Er,Zr,sn,xn,Ln,$n,ki,Aa]=Qt,Xi=[yr||" ",sn||" ",$n].join("");if(Xi===" "||Xi===" /"||Xi===",,"||Xi===",,,"){let ma=[er,Zr,Ln].join(""),Ga=ma==="%%%"?100:ma===""?255:0;if(Ga){let To=[We(+Fe/Ga,0,1),We(+Er/Ga,0,1),We(+xn/Ga,0,1),ki?Hi(+ki,Aa):1];if(rr(To))return To}}return}}let Kt=_t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Kt){let[Qt,be,Fe,er,yr,Er,Zr,sn,xn]=Kt,Ln=[Fe||" ",yr||" ",Zr].join("");if(Ln===" "||Ln===" /"||Ln===",,"||Ln===",,,"){let $n=[+be,We(+er,0,100),We(+Er,0,100),sn?Hi(+sn,xn):1];if(rr($n))return function([ki,Aa,Xi,ma]){function Ga(To){let As=(To+ki/30)%12,Sl=Aa*Math.min(Xi,1-Xi);return Xi-Sl*Math.max(-1,Math.min(As-3,9-As,1))}return ki=Jr(ki),Aa/=100,Xi/=100,[Ga(0),Ga(8),Ga(4),ma]}($n)}}}(D);return nt?new xr(...nt,!1):void 0}get rgb(){let{r:D,g:nt,b:_t,a:Rt}=this,Kt=Rt||1/0;return this.overwriteGetter("rgb",[D/Kt,nt/Kt,_t/Kt,Rt])}get hcl(){return this.overwriteGetter("hcl",function(D){let[nt,_t,Rt,Kt]=Vn(D),Qt=Math.sqrt(_t*_t+Rt*Rt);return[Math.round(1e4*Qt)?Jr(Math.atan2(Rt,_t)*pr):NaN,Qt,nt,Kt]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Vn(this.rgb))}overwriteGetter(D,nt){return Object.defineProperty(this,D,{value:nt}),nt}toString(){let[D,nt,_t,Rt]=this.rgb;return`rgba(${[D,nt,_t].map(Kt=>Math.round(255*Kt)).join(",")},${Rt})`}}xr.black=new xr(0,0,0,1),xr.white=new xr(1,1,1,1),xr.transparent=new xr(0,0,0,0),xr.red=new xr(1,0,0,1);class Qr{constructor(D,nt,_t){this.sensitivity=D?nt?"variant":"case":nt?"accent":"base",this.locale=_t,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(D,nt){return this.collator.compare(D,nt)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Cn{constructor(D,nt,_t,Rt,Kt){this.text=D,this.image=nt,this.scale=_t,this.fontStack=Rt,this.textColor=Kt}}class wn{constructor(D){this.sections=D}static fromString(D){return new wn([new Cn(D,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(D=>D.text.length!==0||D.image&&D.image.name.length!==0)}static factory(D){return D instanceof wn?D:wn.fromString(D)}toString(){return this.sections.length===0?"":this.sections.map(D=>D.text).join("")}}class Mn{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Mn)return D;if(typeof D=="number")return new Mn([D,D,D,D]);if(Array.isArray(D)&&!(D.length<1||D.length>4)){for(let nt of D)if(typeof nt!="number")return;switch(D.length){case 1:D=[D[0],D[0],D[0],D[0]];break;case 2:D=[D[0],D[1],D[0],D[1]];break;case 3:D=[D[0],D[1],D[2],D[1]]}return new Mn(D)}}toString(){return JSON.stringify(this.values)}}let ci=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class xi{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof xi)return D;if(Array.isArray(D)&&!(D.length<1)&&D.length%2==0){for(let nt=0;nt<D.length;nt+=2){let _t=D[nt],Rt=D[nt+1];if(typeof _t!="string"||!ci.has(_t)||!Array.isArray(Rt)||Rt.length!==2||typeof Rt[0]!="number"||typeof Rt[1]!="number")return}return new xi(D)}}toString(){return JSON.stringify(this.values)}}class Pi{constructor(D){this.name=D.name,this.available=D.available}toString(){return this.name}static fromString(D){return D?new Pi({name:D,available:!1}):null}}function Di(G,D,nt,_t){return typeof G=="number"&&G>=0&&G<=255&&typeof D=="number"&&D>=0&&D<=255&&typeof nt=="number"&&nt>=0&&nt<=255?_t===void 0||typeof _t=="number"&&_t>=0&&_t<=1?null:`Invalid rgba value [${[G,D,nt,_t].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof _t=="number"?[G,D,nt,_t]:[G,D,nt]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Zi(G){if(G===null||typeof G=="string"||typeof G=="boolean"||typeof G=="number"||G instanceof xr||G instanceof Qr||G instanceof wn||G instanceof Mn||G instanceof xi||G instanceof Pi)return!0;if(Array.isArray(G)){for(let D of G)if(!Zi(D))return!1;return!0}if(typeof G=="object"){for(let D in G)if(!Zi(G[D]))return!1;return!0}return!1}function ui(G){if(G===null)return oe;if(typeof G=="string")return He;if(typeof G=="boolean")return Ge;if(typeof G=="number")return Te;if(G instanceof xr)return cr;if(G instanceof Qr)return Hr;if(G instanceof wn)return br;if(G instanceof Mn)return Kr;if(G instanceof xi)return Ce;if(G instanceof Pi)return rn;if(Array.isArray(G)){let D=G.length,nt;for(let _t of G){let Rt=ui(_t);if(nt){if(nt===Rt)continue;nt=jr;break}nt=Rt}return $t(nt||jr,D)}return ur}function Pa(G){let D=typeof G;return G===null?"":D==="string"||D==="number"||D==="boolean"?String(G):G instanceof xr||G instanceof wn||G instanceof Mn||G instanceof xi||G instanceof Pi?G.toString():JSON.stringify(G)}class Wa{constructor(D,nt){this.type=D,this.value=nt}static parse(D,nt){if(D.length!==2)return nt.error(`'literal' expression requires exactly one argument, but found ${D.length-1} instead.`);if(!Zi(D[1]))return nt.error("invalid value");let _t=D[1],Rt=ui(_t),Kt=nt.expectedType;return Rt.kind!=="array"||Rt.N!==0||!Kt||Kt.kind!=="array"||typeof Kt.N=="number"&&Kt.N!==0||(Rt=Kt),new Wa(Rt,_t)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ze{constructor(D){this.name="ExpressionEvaluationError",this.message=D}toJSON(){return this.message}}let Pe={string:He,number:Te,boolean:Ge,object:ur};class Rr{constructor(D,nt){this.type=D,this.args=nt}static parse(D,nt){if(D.length<2)return nt.error("Expected at least one argument.");let _t,Rt=1,Kt=D[0];if(Kt==="array"){let be,Fe;if(D.length>2){let er=D[1];if(typeof er!="string"||!(er in Pe)||er==="object")return nt.error('The item type argument of "array" must be one of string, number, boolean',1);be=Pe[er],Rt++}else be=jr;if(D.length>3){if(D[2]!==null&&(typeof D[2]!="number"||D[2]<0||D[2]!==Math.floor(D[2])))return nt.error('The length argument to "array" must be a positive integer literal',2);Fe=D[2],Rt++}_t=$t(be,Fe)}else{if(!Pe[Kt])throw new Error(`Types doesn't contain name = ${Kt}`);_t=Pe[Kt]}let Qt=[];for(;Rt<D.length;Rt++){let be=nt.parse(D[Rt],Rt,jr);if(!be)return null;Qt.push(be)}return new Rr(_t,Qt)}evaluate(D){for(let nt=0;nt<this.args.length;nt++){let _t=this.args[nt].evaluate(D);if(!gt(this.type,ui(_t)))return _t;if(nt===this.args.length-1)throw new ze(`Expected value to be of type ${ne(this.type)}, but found ${ne(ui(_t))} instead.`)}throw new Error}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}let qr={"to-boolean":Ge,"to-color":cr,"to-number":Te,"to-string":He};class $r{constructor(D,nt){this.type=D,this.args=nt}static parse(D,nt){if(D.length<2)return nt.error("Expected at least one argument.");let _t=D[0];if(!qr[_t])throw new Error(`Can't parse ${_t} as it is not part of the known types`);if((_t==="to-boolean"||_t==="to-string")&&D.length!==2)return nt.error("Expected one argument.");let Rt=qr[_t],Kt=[];for(let Qt=1;Qt<D.length;Qt++){let be=nt.parse(D[Qt],Qt,jr);if(!be)return null;Kt.push(be)}return new $r(Rt,Kt)}evaluate(D){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(D);case"color":{let nt,_t;for(let Rt of this.args){if(nt=Rt.evaluate(D),_t=null,nt instanceof xr)return nt;if(typeof nt=="string"){let Kt=D.parseColor(nt);if(Kt)return Kt}else if(Array.isArray(nt)&&(_t=nt.length<3||nt.length>4?`Invalid rbga value ${JSON.stringify(nt)}: expected an array containing either three or four numeric values.`:Di(nt[0],nt[1],nt[2],nt[3]),!_t))return new xr(nt[0]/255,nt[1]/255,nt[2]/255,nt[3])}throw new ze(_t||`Could not parse color from value '${typeof nt=="string"?nt:JSON.stringify(nt)}'`)}case"padding":{let nt;for(let _t of this.args){nt=_t.evaluate(D);let Rt=Mn.parse(nt);if(Rt)return Rt}throw new ze(`Could not parse padding from value '${typeof nt=="string"?nt:JSON.stringify(nt)}'`)}case"variableAnchorOffsetCollection":{let nt;for(let _t of this.args){nt=_t.evaluate(D);let Rt=xi.parse(nt);if(Rt)return Rt}throw new ze(`Could not parse variableAnchorOffsetCollection from value '${typeof nt=="string"?nt:JSON.stringify(nt)}'`)}case"number":{let nt=null;for(let _t of this.args){if(nt=_t.evaluate(D),nt===null)return 0;let Rt=Number(nt);if(!isNaN(Rt))return Rt}throw new ze(`Could not convert ${JSON.stringify(nt)} to number.`)}case"formatted":return wn.fromString(Pa(this.args[0].evaluate(D)));case"resolvedImage":return Pi.fromString(Pa(this.args[0].evaluate(D)));default:return Pa(this.args[0].evaluate(D))}}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}let Br=["Unknown","Point","LineString","Polygon"];class Gr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Br[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(D){let nt=this._parseColorCache[D];return nt||(nt=this._parseColorCache[D]=xr.parse(D)),nt}}class dn{constructor(D,nt,_t=[],Rt,Kt=new ve,Qt=[]){this.registry=D,this.path=_t,this.key=_t.map(be=>`[${be}]`).join(""),this.scope=Kt,this.errors=Qt,this.expectedType=Rt,this._isConstant=nt}parse(D,nt,_t,Rt,Kt={}){return nt?this.concat(nt,_t,Rt)._parse(D,Kt):this._parse(D,Kt)}_parse(D,nt){function _t(Rt,Kt,Qt){return Qt==="assert"?new Rr(Kt,[Rt]):Qt==="coerce"?new $r(Kt,[Rt]):Rt}if(D!==null&&typeof D!="string"&&typeof D!="boolean"&&typeof D!="number"||(D=["literal",D]),Array.isArray(D)){if(D.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let Rt=D[0];if(typeof Rt!="string")return this.error(`Expression name must be a string, but found ${typeof Rt} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let Kt=this.registry[Rt];if(Kt){let Qt=Kt.parse(D,this);if(!Qt)return null;if(this.expectedType){let be=this.expectedType,Fe=Qt.type;if(be.kind!=="string"&&be.kind!=="number"&&be.kind!=="boolean"&&be.kind!=="object"&&be.kind!=="array"||Fe.kind!=="value")if(be.kind!=="color"&&be.kind!=="formatted"&&be.kind!=="resolvedImage"||Fe.kind!=="value"&&Fe.kind!=="string")if(be.kind!=="padding"||Fe.kind!=="value"&&Fe.kind!=="number"&&Fe.kind!=="array")if(be.kind!=="variableAnchorOffsetCollection"||Fe.kind!=="value"&&Fe.kind!=="array"){if(this.checkSubtype(be,Fe))return null}else Qt=_t(Qt,be,nt.typeAnnotation||"coerce");else Qt=_t(Qt,be,nt.typeAnnotation||"coerce");else Qt=_t(Qt,be,nt.typeAnnotation||"coerce");else Qt=_t(Qt,be,nt.typeAnnotation||"assert")}if(!(Qt instanceof Wa)&&Qt.type.kind!=="resolvedImage"&&this._isConstant(Qt)){let be=new Gr;try{Qt=new Wa(Qt.type,Qt.evaluate(be))}catch(Fe){return this.error(Fe.message),null}}return Qt}return this.error(`Unknown expression "${Rt}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(D===void 0?"'undefined' value invalid. Use null instead.":typeof D=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof D} instead.`)}concat(D,nt,_t){let Rt=typeof D=="number"?this.path.concat(D):this.path,Kt=_t?this.scope.concat(_t):this.scope;return new dn(this.registry,this._isConstant,Rt,nt||null,Kt,this.errors)}error(D,...nt){let _t=`${this.key}${nt.map(Rt=>`[${Rt}]`).join("")}`;this.errors.push(new te(_t,D))}checkSubtype(D,nt){let _t=gt(D,nt);return _t&&this.error(_t),_t}}class an{constructor(D,nt){this.type=nt.type,this.bindings=[].concat(D),this.result=nt}evaluate(D){return this.result.evaluate(D)}eachChild(D){for(let nt of this.bindings)D(nt[1]);D(this.result)}static parse(D,nt){if(D.length<4)return nt.error(`Expected at least 3 arguments, but found ${D.length-1} instead.`);let _t=[];for(let Kt=1;Kt<D.length-1;Kt+=2){let Qt=D[Kt];if(typeof Qt!="string")return nt.error(`Expected string, but found ${typeof Qt} instead.`,Kt);if(/[^a-zA-Z0-9_]/.test(Qt))return nt.error("Variable names must contain only alphanumeric characters or '_'.",Kt);let be=nt.parse(D[Kt+1],Kt+1);if(!be)return null;_t.push([Qt,be])}let Rt=nt.parse(D[D.length-1],D.length-1,nt.expectedType,_t);return Rt?new an(_t,Rt):null}outputDefined(){return this.result.outputDefined()}}class Ee{constructor(D,nt){this.type=nt.type,this.name=D,this.boundExpression=nt}static parse(D,nt){if(D.length!==2||typeof D[1]!="string")return nt.error("'var' expression requires exactly one string literal argument.");let _t=D[1];return nt.scope.has(_t)?new Ee(_t,nt.scope.get(_t)):nt.error(`Unknown variable "${_t}". Make sure "${_t}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(D){return this.boundExpression.evaluate(D)}eachChild(){}outputDefined(){return!1}}class dr{constructor(D,nt,_t){this.type=D,this.index=nt,this.input=_t}static parse(D,nt){if(D.length!==3)return nt.error(`Expected 2 arguments, but found ${D.length-1} instead.`);let _t=nt.parse(D[1],1,Te),Rt=nt.parse(D[2],2,$t(nt.expectedType||jr));return _t&&Rt?new dr(Rt.type.itemType,_t,Rt):null}evaluate(D){let nt=this.index.evaluate(D),_t=this.input.evaluate(D);if(nt<0)throw new ze(`Array index out of bounds: ${nt} < 0.`);if(nt>=_t.length)throw new ze(`Array index out of bounds: ${nt} > ${_t.length-1}.`);if(nt!==Math.floor(nt))throw new ze(`Array index must be an integer, but found ${nt} instead.`);return _t[nt]}eachChild(D){D(this.index),D(this.input)}outputDefined(){return!1}}class Vr{constructor(D,nt){this.type=Ge,this.needle=D,this.haystack=nt}static parse(D,nt){if(D.length!==3)return nt.error(`Expected 2 arguments, but found ${D.length-1} instead.`);let _t=nt.parse(D[1],1,jr),Rt=nt.parse(D[2],2,jr);return _t&&Rt?St(_t.type,[Ge,He,Te,oe,jr])?new Vr(_t,Rt):nt.error(`Expected first argument to be of type boolean, string, number or null, but found ${ne(_t.type)} instead`):null}evaluate(D){let nt=this.needle.evaluate(D),_t=this.haystack.evaluate(D);if(!_t)return!1;if(!Nt(nt,["boolean","string","number","null"]))throw new ze(`Expected first argument to be of type boolean, string, number or null, but found ${ne(ui(nt))} instead.`);if(!Nt(_t,["string","array"]))throw new ze(`Expected second argument to be of type array or string, but found ${ne(ui(_t))} instead.`);return _t.indexOf(nt)>=0}eachChild(D){D(this.needle),D(this.haystack)}outputDefined(){return!0}}class yn{constructor(D,nt,_t){this.type=Te,this.needle=D,this.haystack=nt,this.fromIndex=_t}static parse(D,nt){if(D.length<=2||D.length>=5)return nt.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);let _t=nt.parse(D[1],1,jr),Rt=nt.parse(D[2],2,jr);if(!_t||!Rt)return null;if(!St(_t.type,[Ge,He,Te,oe,jr]))return nt.error(`Expected first argument to be of type boolean, string, number or null, but found ${ne(_t.type)} instead`);if(D.length===4){let Kt=nt.parse(D[3],3,Te);return Kt?new yn(_t,Rt,Kt):null}return new yn(_t,Rt)}evaluate(D){let nt=this.needle.evaluate(D),_t=this.haystack.evaluate(D);if(!Nt(nt,["boolean","string","number","null"]))throw new ze(`Expected first argument to be of type boolean, string, number or null, but found ${ne(ui(nt))} instead.`);let Rt;if(this.fromIndex&&(Rt=this.fromIndex.evaluate(D)),Nt(_t,["string"])){let Kt=_t.indexOf(nt,Rt);return Kt===-1?-1:[..._t.slice(0,Kt)].length}if(Nt(_t,["array"]))return _t.indexOf(nt,Rt);throw new ze(`Expected second argument to be of type array or string, but found ${ne(ui(_t))} instead.`)}eachChild(D){D(this.needle),D(this.haystack),this.fromIndex&&D(this.fromIndex)}outputDefined(){return!1}}class Fn{constructor(D,nt,_t,Rt,Kt,Qt){this.inputType=D,this.type=nt,this.input=_t,this.cases=Rt,this.outputs=Kt,this.otherwise=Qt}static parse(D,nt){if(D.length<5)return nt.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if(D.length%2!=1)return nt.error("Expected an even number of arguments.");let _t,Rt;nt.expectedType&&nt.expectedType.kind!=="value"&&(Rt=nt.expectedType);let Kt={},Qt=[];for(let er=2;er<D.length-1;er+=2){let yr=D[er],Er=D[er+1];Array.isArray(yr)||(yr=[yr]);let Zr=nt.concat(er);if(yr.length===0)return Zr.error("Expected at least one branch label.");for(let xn of yr){if(typeof xn!="number"&&typeof xn!="string")return Zr.error("Branch labels must be numbers or strings.");if(typeof xn=="number"&&Math.abs(xn)>Number.MAX_SAFE_INTEGER)return Zr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof xn=="number"&&Math.floor(xn)!==xn)return Zr.error("Numeric branch labels must be integer values.");if(_t){if(Zr.checkSubtype(_t,ui(xn)))return null}else _t=ui(xn);if(Kt[String(xn)]!==void 0)return Zr.error("Branch labels must be unique.");Kt[String(xn)]=Qt.length}let sn=nt.parse(Er,er,Rt);if(!sn)return null;Rt=Rt||sn.type,Qt.push(sn)}let be=nt.parse(D[1],1,jr);if(!be)return null;let Fe=nt.parse(D[D.length-1],D.length-1,Rt);return Fe?be.type.kind!=="value"&&nt.concat(1).checkSubtype(_t,be.type)?null:new Fn(_t,Rt,be,Kt,Qt,Fe):null}evaluate(D){let nt=this.input.evaluate(D);return(ui(nt)===this.inputType&&this.outputs[this.cases[nt]]||this.otherwise).evaluate(D)}eachChild(D){D(this.input),this.outputs.forEach(D),D(this.otherwise)}outputDefined(){return this.outputs.every(D=>D.outputDefined())&&this.otherwise.outputDefined()}}class Xn{constructor(D,nt,_t){this.type=D,this.branches=nt,this.otherwise=_t}static parse(D,nt){if(D.length<4)return nt.error(`Expected at least 3 arguments, but found only ${D.length-1}.`);if(D.length%2!=0)return nt.error("Expected an odd number of arguments.");let _t;nt.expectedType&&nt.expectedType.kind!=="value"&&(_t=nt.expectedType);let Rt=[];for(let Qt=1;Qt<D.length-1;Qt+=2){let be=nt.parse(D[Qt],Qt,Ge);if(!be)return null;let Fe=nt.parse(D[Qt+1],Qt+1,_t);if(!Fe)return null;Rt.push([be,Fe]),_t=_t||Fe.type}let Kt=nt.parse(D[D.length-1],D.length-1,_t);if(!Kt)return null;if(!_t)throw new Error("Can't infer output type");return new Xn(_t,Rt,Kt)}evaluate(D){for(let[nt,_t]of this.branches)if(nt.evaluate(D))return _t.evaluate(D);return this.otherwise.evaluate(D)}eachChild(D){for(let[nt,_t]of this.branches)D(nt),D(_t);D(this.otherwise)}outputDefined(){return this.branches.every(([D,nt])=>nt.outputDefined())&&this.otherwise.outputDefined()}}class Pn{constructor(D,nt,_t,Rt){this.type=D,this.input=nt,this.beginIndex=_t,this.endIndex=Rt}static parse(D,nt){if(D.length<=2||D.length>=5)return nt.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);let _t=nt.parse(D[1],1,jr),Rt=nt.parse(D[2],2,Te);if(!_t||!Rt)return null;if(!St(_t.type,[$t(jr),He,jr]))return nt.error(`Expected first argument to be of type array or string, but found ${ne(_t.type)} instead`);if(D.length===4){let Kt=nt.parse(D[3],3,Te);return Kt?new Pn(_t.type,_t,Rt,Kt):null}return new Pn(_t.type,_t,Rt)}evaluate(D){let nt=this.input.evaluate(D),_t=this.beginIndex.evaluate(D),Rt;if(this.endIndex&&(Rt=this.endIndex.evaluate(D)),Nt(nt,["string"]))return[...nt].slice(_t,Rt).join("");if(Nt(nt,["array"]))return nt.slice(_t,Rt);throw new ze(`Expected first argument to be of type array or string, but found ${ne(ui(nt))} instead.`)}eachChild(D){D(this.input),D(this.beginIndex),this.endIndex&&D(this.endIndex)}outputDefined(){return!1}}function En(G,D){let nt=G.length-1,_t,Rt,Kt=0,Qt=nt,be=0;for(;Kt<=Qt;)if(be=Math.floor((Kt+Qt)/2),_t=G[be],Rt=G[be+1],_t<=D){if(be===nt||D<Rt)return be;Kt=be+1}else{if(!(_t>D))throw new ze("Input is not a number.");Qt=be-1}return 0}class Zn{constructor(D,nt,_t){this.type=D,this.input=nt,this.labels=[],this.outputs=[];for(let[Rt,Kt]of _t)this.labels.push(Rt),this.outputs.push(Kt)}static parse(D,nt){if(D.length-1<4)return nt.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return nt.error("Expected an even number of arguments.");let _t=nt.parse(D[1],1,Te);if(!_t)return null;let Rt=[],Kt=null;nt.expectedType&&nt.expectedType.kind!=="value"&&(Kt=nt.expectedType);for(let Qt=1;Qt<D.length;Qt+=2){let be=Qt===1?-1/0:D[Qt],Fe=D[Qt+1],er=Qt,yr=Qt+1;if(typeof be!="number")return nt.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',er);if(Rt.length&&Rt[Rt.length-1][0]>=be)return nt.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',er);let Er=nt.parse(Fe,yr,Kt);if(!Er)return null;Kt=Kt||Er.type,Rt.push([be,Er])}return new Zn(Kt,_t,Rt)}evaluate(D){let nt=this.labels,_t=this.outputs;if(nt.length===1)return _t[0].evaluate(D);let Rt=this.input.evaluate(D);if(Rt<=nt[0])return _t[0].evaluate(D);let Kt=nt.length;return Rt>=nt[Kt-1]?_t[Kt-1].evaluate(D):_t[En(nt,Rt)].evaluate(D)}eachChild(D){D(this.input);for(let nt of this.outputs)D(nt)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function Ca(G){return G&&G.__esModule&&Object.prototype.hasOwnProperty.call(G,"default")?G.default:G}var Ri=Ja;function Ja(G,D,nt,_t){this.cx=3*G,this.bx=3*(nt-G)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(_t-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=G,this.p1y=D,this.p2x=nt,this.p2y=_t}Ja.prototype={sampleCurveX:function(G){return((this.ax*G+this.bx)*G+this.cx)*G},sampleCurveY:function(G){return((this.ay*G+this.by)*G+this.cy)*G},sampleCurveDerivativeX:function(G){return(3*this.ax*G+2*this.bx)*G+this.cx},solveCurveX:function(G,D){if(D===void 0&&(D=1e-6),G<0)return 0;if(G>1)return 1;for(var nt=G,_t=0;_t<8;_t++){var Rt=this.sampleCurveX(nt)-G;if(Math.abs(Rt)<D)return nt;var Kt=this.sampleCurveDerivativeX(nt);if(Math.abs(Kt)<1e-6)break;nt-=Rt/Kt}var Qt=0,be=1;for(nt=G,_t=0;_t<20&&(Rt=this.sampleCurveX(nt),!(Math.abs(Rt-G)<D));_t++)G>Rt?Qt=nt:be=nt,nt=.5*(be-Qt)+Qt;return nt},solve:function(G,D){return this.sampleCurveY(this.solveCurveX(G,D))}};var Xa=Ca(Ri);function Io(G,D,nt){return G+nt*(D-G)}function po(G,D,nt){return G.map((_t,Rt)=>Io(_t,D[Rt],nt))}let Do={number:Io,color:function(G,D,nt,_t="rgb"){switch(_t){case"rgb":{let[Rt,Kt,Qt,be]=po(G.rgb,D.rgb,nt);return new xr(Rt,Kt,Qt,be,!1)}case"hcl":{let[Rt,Kt,Qt,be]=G.hcl,[Fe,er,yr,Er]=D.hcl,Zr,sn;if(isNaN(Rt)||isNaN(Fe))isNaN(Rt)?isNaN(Fe)?Zr=NaN:(Zr=Fe,Qt!==1&&Qt!==0||(sn=er)):(Zr=Rt,yr!==1&&yr!==0||(sn=Kt));else{let Aa=Fe-Rt;Fe>Rt&&Aa>180?Aa-=360:Fe<Rt&&Rt-Fe>180&&(Aa+=360),Zr=Rt+nt*Aa}let[xn,Ln,$n,ki]=function([Aa,Xi,ma,Ga]){return Aa=isNaN(Aa)?0:Aa*Tr,Ci([ma,Math.cos(Aa)*Xi,Math.sin(Aa)*Xi,Ga])}([Zr,sn??Io(Kt,er,nt),Io(Qt,yr,nt),Io(be,Er,nt)]);return new xr(xn,Ln,$n,ki,!1)}case"lab":{let[Rt,Kt,Qt,be]=Ci(po(G.lab,D.lab,nt));return new xr(Rt,Kt,Qt,be,!1)}}},array:po,padding:function(G,D,nt){return new Mn(po(G.values,D.values,nt))},variableAnchorOffsetCollection:function(G,D,nt){let _t=G.values,Rt=D.values;if(_t.length!==Rt.length)throw new ze(`Cannot interpolate values of different length. from: ${G.toString()}, to: ${D.toString()}`);let Kt=[];for(let Qt=0;Qt<_t.length;Qt+=2){if(_t[Qt]!==Rt[Qt])throw new ze(`Cannot interpolate values containing mismatched anchors. from[${Qt}]: ${_t[Qt]}, to[${Qt}]: ${Rt[Qt]}`);Kt.push(_t[Qt]);let[be,Fe]=_t[Qt+1],[er,yr]=Rt[Qt+1];Kt.push([Io(be,er,nt),Io(Fe,yr,nt)])}return new xi(Kt)}};class Ia{constructor(D,nt,_t,Rt,Kt){this.type=D,this.operator=nt,this.interpolation=_t,this.input=Rt,this.labels=[],this.outputs=[];for(let[Qt,be]of Kt)this.labels.push(Qt),this.outputs.push(be)}static interpolationFactor(D,nt,_t,Rt){let Kt=0;if(D.name==="exponential")Kt=gs(nt,D.base,_t,Rt);else if(D.name==="linear")Kt=gs(nt,1,_t,Rt);else if(D.name==="cubic-bezier"){let Qt=D.controlPoints;Kt=new Xa(Qt[0],Qt[1],Qt[2],Qt[3]).solve(gs(nt,1,_t,Rt))}return Kt}static parse(D,nt){let[_t,Rt,Kt,...Qt]=D;if(!Array.isArray(Rt)||Rt.length===0)return nt.error("Expected an interpolation type expression.",1);if(Rt[0]==="linear")Rt={name:"linear"};else if(Rt[0]==="exponential"){let er=Rt[1];if(typeof er!="number")return nt.error("Exponential interpolation requires a numeric base.",1,1);Rt={name:"exponential",base:er}}else{if(Rt[0]!=="cubic-bezier")return nt.error(`Unknown interpolation type ${String(Rt[0])}`,1,0);{let er=Rt.slice(1);if(er.length!==4||er.some(yr=>typeof yr!="number"||yr<0||yr>1))return nt.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Rt={name:"cubic-bezier",controlPoints:er}}}if(D.length-1<4)return nt.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return nt.error("Expected an even number of arguments.");if(Kt=nt.parse(Kt,2,Te),!Kt)return null;let be=[],Fe=null;_t==="interpolate-hcl"||_t==="interpolate-lab"?Fe=cr:nt.expectedType&&nt.expectedType.kind!=="value"&&(Fe=nt.expectedType);for(let er=0;er<Qt.length;er+=2){let yr=Qt[er],Er=Qt[er+1],Zr=er+3,sn=er+4;if(typeof yr!="number")return nt.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Zr);if(be.length&&be[be.length-1][0]>=yr)return nt.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Zr);let xn=nt.parse(Er,sn,Fe);if(!xn)return null;Fe=Fe||xn.type,be.push([yr,xn])}return ee(Fe,Te)||ee(Fe,cr)||ee(Fe,Kr)||ee(Fe,Ce)||ee(Fe,$t(Te))?new Ia(Fe,_t,Rt,Kt,be):nt.error(`Type ${ne(Fe)} is not interpolatable.`)}evaluate(D){let nt=this.labels,_t=this.outputs;if(nt.length===1)return _t[0].evaluate(D);let Rt=this.input.evaluate(D);if(Rt<=nt[0])return _t[0].evaluate(D);let Kt=nt.length;if(Rt>=nt[Kt-1])return _t[Kt-1].evaluate(D);let Qt=En(nt,Rt),be=Ia.interpolationFactor(this.interpolation,Rt,nt[Qt],nt[Qt+1]),Fe=_t[Qt].evaluate(D),er=_t[Qt+1].evaluate(D);switch(this.operator){case"interpolate":return Do[this.type.kind](Fe,er,be);case"interpolate-hcl":return Do.color(Fe,er,be,"hcl");case"interpolate-lab":return Do.color(Fe,er,be,"lab")}}eachChild(D){D(this.input);for(let nt of this.outputs)D(nt)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function gs(G,D,nt,_t){let Rt=_t-nt,Kt=G-nt;return Rt===0?0:D===1?Kt/Rt:(Math.pow(D,Kt)-1)/(Math.pow(D,Rt)-1)}class is{constructor(D,nt){this.type=D,this.args=nt}static parse(D,nt){if(D.length<2)return nt.error("Expectected at least one argument.");let _t=null,Rt=nt.expectedType;Rt&&Rt.kind!=="value"&&(_t=Rt);let Kt=[];for(let be of D.slice(1)){let Fe=nt.parse(be,1+Kt.length,_t,void 0,{typeAnnotation:"omit"});if(!Fe)return null;_t=_t||Fe.type,Kt.push(Fe)}if(!_t)throw new Error("No output type");let Qt=Rt&&Kt.some(be=>gt(Rt,be.type));return new is(Qt?jr:_t,Kt)}evaluate(D){let nt,_t=null,Rt=0;for(let Kt of this.args)if(Rt++,_t=Kt.evaluate(D),_t&&_t instanceof Pi&&!_t.available&&(nt||(nt=_t.name),_t=null,Rt===this.args.length&&(_t=nt)),_t!==null)break;return _t}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}function ll(G,D){return G==="=="||G==="!="?D.kind==="boolean"||D.kind==="string"||D.kind==="number"||D.kind==="null"||D.kind==="value":D.kind==="string"||D.kind==="number"||D.kind==="value"}function Ho(G,D,nt,_t){return _t.compare(D,nt)===0}function Gs(G,D,nt){let _t=G!=="=="&&G!=="!=";return class HD{constructor(Kt,Qt,be){this.type=Ge,this.lhs=Kt,this.rhs=Qt,this.collator=be,this.hasUntypedArgument=Kt.type.kind==="value"||Qt.type.kind==="value"}static parse(Kt,Qt){if(Kt.length!==3&&Kt.length!==4)return Qt.error("Expected two or three arguments.");let be=Kt[0],Fe=Qt.parse(Kt[1],1,jr);if(!Fe)return null;if(!ll(be,Fe.type))return Qt.concat(1).error(`"${be}" comparisons are not supported for type '${ne(Fe.type)}'.`);let er=Qt.parse(Kt[2],2,jr);if(!er)return null;if(!ll(be,er.type))return Qt.concat(2).error(`"${be}" comparisons are not supported for type '${ne(er.type)}'.`);if(Fe.type.kind!==er.type.kind&&Fe.type.kind!=="value"&&er.type.kind!=="value")return Qt.error(`Cannot compare types '${ne(Fe.type)}' and '${ne(er.type)}'.`);_t&&(Fe.type.kind==="value"&&er.type.kind!=="value"?Fe=new Rr(er.type,[Fe]):Fe.type.kind!=="value"&&er.type.kind==="value"&&(er=new Rr(Fe.type,[er])));let yr=null;if(Kt.length===4){if(Fe.type.kind!=="string"&&er.type.kind!=="string"&&Fe.type.kind!=="value"&&er.type.kind!=="value")return Qt.error("Cannot use collator to compare non-string types.");if(yr=Qt.parse(Kt[3],3,Hr),!yr)return null}return new HD(Fe,er,yr)}evaluate(Kt){let Qt=this.lhs.evaluate(Kt),be=this.rhs.evaluate(Kt);if(_t&&this.hasUntypedArgument){let Fe=ui(Qt),er=ui(be);if(Fe.kind!==er.kind||Fe.kind!=="string"&&Fe.kind!=="number")throw new ze(`Expected arguments for "${G}" to be (string, string) or (number, number), but found (${Fe.kind}, ${er.kind}) instead.`)}if(this.collator&&!_t&&this.hasUntypedArgument){let Fe=ui(Qt),er=ui(be);if(Fe.kind!=="string"||er.kind!=="string")return D(Kt,Qt,be)}return this.collator?nt(Kt,Qt,be,this.collator.evaluate(Kt)):D(Kt,Qt,be)}eachChild(Kt){Kt(this.lhs),Kt(this.rhs),this.collator&&Kt(this.collator)}outputDefined(){return!0}}}let as=Gs("==",function(G,D,nt){return D===nt},Ho),ul=Gs("!=",function(G,D,nt){return D!==nt},function(G,D,nt,_t){return!Ho(0,D,nt,_t)}),Js=Gs("<",function(G,D,nt){return D<nt},function(G,D,nt,_t){return _t.compare(D,nt)<0}),Rl=Gs(">",function(G,D,nt){return D>nt},function(G,D,nt,_t){return _t.compare(D,nt)>0}),ls=Gs("<=",function(G,D,nt){return D<=nt},function(G,D,nt,_t){return _t.compare(D,nt)<=0}),Cs=Gs(">=",function(G,D,nt){return D>=nt},function(G,D,nt,_t){return _t.compare(D,nt)>=0});class Co{constructor(D,nt,_t){this.type=Hr,this.locale=_t,this.caseSensitive=D,this.diacriticSensitive=nt}static parse(D,nt){if(D.length!==2)return nt.error("Expected one argument.");let _t=D[1];if(typeof _t!="object"||Array.isArray(_t))return nt.error("Collator options argument must be an object.");let Rt=nt.parse(_t["case-sensitive"]!==void 0&&_t["case-sensitive"],1,Ge);if(!Rt)return null;let Kt=nt.parse(_t["diacritic-sensitive"]!==void 0&&_t["diacritic-sensitive"],1,Ge);if(!Kt)return null;let Qt=null;return _t.locale&&(Qt=nt.parse(_t.locale,1,He),!Qt)?null:new Co(Rt,Kt,Qt)}evaluate(D){return new Qr(this.caseSensitive.evaluate(D),this.diacriticSensitive.evaluate(D),this.locale?this.locale.evaluate(D):null)}eachChild(D){D(this.caseSensitive),D(this.diacriticSensitive),this.locale&&D(this.locale)}outputDefined(){return!1}}class ks{constructor(D,nt,_t,Rt,Kt){this.type=He,this.number=D,this.locale=nt,this.currency=_t,this.minFractionDigits=Rt,this.maxFractionDigits=Kt}static parse(D,nt){if(D.length!==3)return nt.error("Expected two arguments.");let _t=nt.parse(D[1],1,Te);if(!_t)return null;let Rt=D[2];if(typeof Rt!="object"||Array.isArray(Rt))return nt.error("NumberFormat options argument must be an object.");let Kt=null;if(Rt.locale&&(Kt=nt.parse(Rt.locale,1,He),!Kt))return null;let Qt=null;if(Rt.currency&&(Qt=nt.parse(Rt.currency,1,He),!Qt))return null;let be=null;if(Rt["min-fraction-digits"]&&(be=nt.parse(Rt["min-fraction-digits"],1,Te),!be))return null;let Fe=null;return Rt["max-fraction-digits"]&&(Fe=nt.parse(Rt["max-fraction-digits"],1,Te),!Fe)?null:new ks(_t,Kt,Qt,be,Fe)}evaluate(D){return new Intl.NumberFormat(this.locale?this.locale.evaluate(D):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(D):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(D):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(D):void 0}).format(this.number.evaluate(D))}eachChild(D){D(this.number),this.locale&&D(this.locale),this.currency&&D(this.currency),this.minFractionDigits&&D(this.minFractionDigits),this.maxFractionDigits&&D(this.maxFractionDigits)}outputDefined(){return!1}}class kl{constructor(D){this.type=br,this.sections=D}static parse(D,nt){if(D.length<2)return nt.error("Expected at least one argument.");let _t=D[1];if(!Array.isArray(_t)&&typeof _t=="object")return nt.error("First argument must be an image or text section.");let Rt=[],Kt=!1;for(let Qt=1;Qt<=D.length-1;++Qt){let be=D[Qt];if(Kt&&typeof be=="object"&&!Array.isArray(be)){Kt=!1;let Fe=null;if(be["font-scale"]&&(Fe=nt.parse(be["font-scale"],1,Te),!Fe))return null;let er=null;if(be["text-font"]&&(er=nt.parse(be["text-font"],1,$t(He)),!er))return null;let yr=null;if(be["text-color"]&&(yr=nt.parse(be["text-color"],1,cr),!yr))return null;let Er=Rt[Rt.length-1];Er.scale=Fe,Er.font=er,Er.textColor=yr}else{let Fe=nt.parse(D[Qt],1,jr);if(!Fe)return null;let er=Fe.type.kind;if(er!=="string"&&er!=="value"&&er!=="null"&&er!=="resolvedImage")return nt.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Kt=!0,Rt.push({content:Fe,scale:null,font:null,textColor:null})}}return new kl(Rt)}evaluate(D){return new wn(this.sections.map(nt=>{let _t=nt.content.evaluate(D);return ui(_t)===rn?new Cn("",_t,null,null,null):new Cn(Pa(_t),null,nt.scale?nt.scale.evaluate(D):null,nt.font?nt.font.evaluate(D).join(","):null,nt.textColor?nt.textColor.evaluate(D):null)}))}eachChild(D){for(let nt of this.sections)D(nt.content),nt.scale&&D(nt.scale),nt.font&&D(nt.font),nt.textColor&&D(nt.textColor)}outputDefined(){return!1}}class Vl{constructor(D){this.type=rn,this.input=D}static parse(D,nt){if(D.length!==2)return nt.error("Expected two arguments.");let _t=nt.parse(D[1],1,He);return _t?new Vl(_t):nt.error("No image name provided.")}evaluate(D){let nt=this.input.evaluate(D),_t=Pi.fromString(nt);return _t&&D.availableImages&&(_t.available=D.availableImages.indexOf(nt)>-1),_t}eachChild(D){D(this.input)}outputDefined(){return!1}}class Yl{constructor(D){this.type=Te,this.input=D}static parse(D,nt){if(D.length!==2)return nt.error(`Expected 1 argument, but found ${D.length-1} instead.`);let _t=nt.parse(D[1],1);return _t?_t.type.kind!=="array"&&_t.type.kind!=="string"&&_t.type.kind!=="value"?nt.error(`Expected argument of type string or array, but found ${ne(_t.type)} instead.`):new Yl(_t):null}evaluate(D){let nt=this.input.evaluate(D);if(typeof nt=="string")return[...nt].length;if(Array.isArray(nt))return nt.length;throw new ze(`Expected value to be of type string or array, but found ${ne(ui(nt))} instead.`)}eachChild(D){D(this.input)}outputDefined(){return!1}}let Ns=8192;function La(G,D){let nt=(180+G[0])/360,_t=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+G[1]*Math.PI/360)))/360,Rt=Math.pow(2,D.z);return[Math.round(nt*Rt*Ns),Math.round(_t*Rt*Ns)]}function uo(G,D){let nt=Math.pow(2,D.z);return[(Rt=(G[0]/Ns+D.x)/nt,360*Rt-180),(_t=(G[1]/Ns+D.y)/nt,360/Math.PI*Math.atan(Math.exp((180-360*_t)*Math.PI/180))-90)];var _t,Rt}function Hs(G,D){G[0]=Math.min(G[0],D[0]),G[1]=Math.min(G[1],D[1]),G[2]=Math.max(G[2],D[0]),G[3]=Math.max(G[3],D[1])}function Kl(G,D){return!(G[0]<=D[0]||G[2]>=D[2]||G[1]<=D[1]||G[3]>=D[3])}function Go(G,D,nt){let _t=G[0]-D[0],Rt=G[1]-D[1],Kt=G[0]-nt[0],Qt=G[1]-nt[1];return _t*Qt-Kt*Rt==0&&_t*Kt<=0&&Rt*Qt<=0}function ql(G,D,nt,_t){return(Rt=[_t[0]-nt[0],_t[1]-nt[1]])[0]*(Kt=[D[0]-G[0],D[1]-G[1]])[1]-Rt[1]*Kt[0]!=0&&!(!Ls(G,D,nt,_t)||!Ls(nt,_t,G,D));var Rt,Kt}function il(G,D,nt){for(let _t of nt)for(let Rt=0;Rt<_t.length-1;++Rt)if(ql(G,D,_t[Rt],_t[Rt+1]))return!0;return!1}function Cl(G,D,nt=!1){let _t=!1;for(let be of D)for(let Fe=0;Fe<be.length-1;Fe++){if(Go(G,be[Fe],be[Fe+1]))return nt;(Kt=be[Fe])[1]>(Rt=G)[1]!=(Qt=be[Fe+1])[1]>Rt[1]&&Rt[0]<(Qt[0]-Kt[0])*(Rt[1]-Kt[1])/(Qt[1]-Kt[1])+Kt[0]&&(_t=!_t)}var Rt,Kt,Qt;return _t}function Fu(G,D){for(let nt of D)if(Cl(G,nt))return!0;return!1}function ao(G,D){for(let nt of G)if(!Cl(nt,D))return!1;for(let nt=0;nt<G.length-1;++nt)if(il(G[nt],G[nt+1],D))return!1;return!0}function Ts(G,D){for(let nt of D)if(ao(G,nt))return!0;return!1}function Ls(G,D,nt,_t){let Rt=_t[0]-nt[0],Kt=_t[1]-nt[1],Qt=(G[0]-nt[0])*Kt-Rt*(G[1]-nt[1]),be=(D[0]-nt[0])*Kt-Rt*(D[1]-nt[1]);return Qt>0&&be<0||Qt<0&&be>0}function nu(G,D,nt){let _t=[];for(let Rt=0;Rt<G.length;Rt++){let Kt=[];for(let Qt=0;Qt<G[Rt].length;Qt++){let be=La(G[Rt][Qt],nt);Hs(D,be),Kt.push(be)}_t.push(Kt)}return _t}function cl(G,D,nt){let _t=[];for(let Rt=0;Rt<G.length;Rt++){let Kt=nu(G[Rt],D,nt);_t.push(Kt)}return _t}function Qo(G,D,nt,_t){if(G[0]<nt[0]||G[0]>nt[2]){let Rt=.5*_t,Kt=G[0]-nt[0]>Rt?-_t:nt[0]-G[0]>Rt?_t:0;Kt===0&&(Kt=G[0]-nt[2]>Rt?-_t:nt[2]-G[0]>Rt?_t:0),G[0]+=Kt}Hs(D,G)}function Mu(G,D,nt,_t){let Rt=Math.pow(2,_t.z)*Ns,Kt=[_t.x*Ns,_t.y*Ns],Qt=[];for(let be of G)for(let Fe of be){let er=[Fe.x+Kt[0],Fe.y+Kt[1]];Qo(er,D,nt,Rt),Qt.push(er)}return Qt}function Gu(G,D,nt,_t){let Rt=Math.pow(2,_t.z)*Ns,Kt=[_t.x*Ns,_t.y*Ns],Qt=[];for(let Fe of G){let er=[];for(let yr of Fe){let Er=[yr.x+Kt[0],yr.y+Kt[1]];Hs(D,Er),er.push(Er)}Qt.push(er)}if(D[2]-D[0]<=Rt/2){(be=D)[0]=be[1]=1/0,be[2]=be[3]=-1/0;for(let Fe of Qt)for(let er of Fe)Qo(er,D,nt,Rt)}var be;return Qt}class _l{constructor(D,nt){this.type=Ge,this.geojson=D,this.geometries=nt}static parse(D,nt){if(D.length!==2)return nt.error(`'within' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Zi(D[1])){let _t=D[1];if(_t.type==="FeatureCollection"){let Rt=[];for(let Kt of _t.features){let{type:Qt,coordinates:be}=Kt.geometry;Qt==="Polygon"&&Rt.push(be),Qt==="MultiPolygon"&&Rt.push(...be)}if(Rt.length)return new _l(_t,{type:"MultiPolygon",coordinates:Rt})}else if(_t.type==="Feature"){let Rt=_t.geometry.type;if(Rt==="Polygon"||Rt==="MultiPolygon")return new _l(_t,_t.geometry)}else if(_t.type==="Polygon"||_t.type==="MultiPolygon")return new _l(_t,_t)}return nt.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return function(nt,_t){let Rt=[1/0,1/0,-1/0,-1/0],Kt=[1/0,1/0,-1/0,-1/0],Qt=nt.canonicalID();if(_t.type==="Polygon"){let be=nu(_t.coordinates,Kt,Qt),Fe=Mu(nt.geometry(),Rt,Kt,Qt);if(!Kl(Rt,Kt))return!1;for(let er of Fe)if(!Cl(er,be))return!1}if(_t.type==="MultiPolygon"){let be=cl(_t.coordinates,Kt,Qt),Fe=Mu(nt.geometry(),Rt,Kt,Qt);if(!Kl(Rt,Kt))return!1;for(let er of Fe)if(!Fu(er,be))return!1}return!0}(D,this.geometries);if(D.geometryType()==="LineString")return function(nt,_t){let Rt=[1/0,1/0,-1/0,-1/0],Kt=[1/0,1/0,-1/0,-1/0],Qt=nt.canonicalID();if(_t.type==="Polygon"){let be=nu(_t.coordinates,Kt,Qt),Fe=Gu(nt.geometry(),Rt,Kt,Qt);if(!Kl(Rt,Kt))return!1;for(let er of Fe)if(!ao(er,be))return!1}if(_t.type==="MultiPolygon"){let be=cl(_t.coordinates,Kt,Qt),Fe=Gu(nt.geometry(),Rt,Kt,Qt);if(!Kl(Rt,Kt))return!1;for(let er of Fe)if(!Ts(er,be))return!1}return!0}(D,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Ol=class{constructor(G=[],D=(nt,_t)=>nt<_t?-1:nt>_t?1:0){if(this.data=G,this.length=this.data.length,this.compare=D,this.length>0)for(let nt=(this.length>>1)-1;nt>=0;nt--)this._down(nt)}push(G){this.data.push(G),this._up(this.length++)}pop(){if(this.length===0)return;let G=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),G}peek(){return this.data[0]}_up(G){let{data:D,compare:nt}=this,_t=D[G];for(;G>0;){let Rt=G-1>>1,Kt=D[Rt];if(nt(_t,Kt)>=0)break;D[G]=Kt,G=Rt}D[G]=_t}_down(G){let{data:D,compare:nt}=this,_t=this.length>>1,Rt=D[G];for(;G<_t;){let Kt=1+(G<<1),Qt=Kt+1;if(Qt<this.length&&nt(D[Qt],D[Kt])<0&&(Kt=Qt),nt(D[Kt],Rt)>=0)break;D[G]=D[Kt],G=Kt}D[G]=Rt}};function Xl(G,D,nt,_t,Rt){tu(G,D,nt,_t||G.length-1,Rt||ph)}function tu(G,D,nt,_t,Rt){for(;_t>nt;){if(_t-nt>600){var Kt=_t-nt+1,Qt=D-nt+1,be=Math.log(Kt),Fe=.5*Math.exp(2*be/3),er=.5*Math.sqrt(be*Fe*(Kt-Fe)/Kt)*(Qt-Kt/2<0?-1:1);tu(G,D,Math.max(nt,Math.floor(D-Qt*Fe/Kt+er)),Math.min(_t,Math.floor(D+(Kt-Qt)*Fe/Kt+er)),Rt)}var yr=G[D],Er=nt,Zr=_t;for(ac(G,nt,D),Rt(G[_t],yr)>0&&ac(G,nt,_t);Er<Zr;){for(ac(G,Er,Zr),Er++,Zr--;Rt(G[Er],yr)<0;)Er++;for(;Rt(G[Zr],yr)>0;)Zr--}Rt(G[nt],yr)===0?ac(G,nt,Zr):ac(G,++Zr,_t),Zr<=D&&(nt=Zr+1),D<=Zr&&(_t=Zr-1)}}function ac(G,D,nt){var _t=G[D];G[D]=G[nt],G[nt]=_t}function ph(G,D){return G<D?-1:G>D?1:0}function Jc(G,D){if(G.length<=1)return[G];let nt=[],_t,Rt;for(let Kt of G){let Qt=Nf(Kt);Qt!==0&&(Kt.area=Math.abs(Qt),Rt===void 0&&(Rt=Qt<0),Rt===Qt<0?(_t&&nt.push(_t),_t=[Kt]):_t.push(Kt))}if(_t&&nt.push(_t),D>1)for(let Kt=0;Kt<nt.length;Kt++)nt[Kt].length<=D||(Xl(nt[Kt],D,1,nt[Kt].length-1,ah),nt[Kt]=nt[Kt].slice(0,D));return nt}function ah(G,D){return D.area-G.area}function Nf(G){let D=0;for(let nt,_t,Rt=0,Kt=G.length,Qt=Kt-1;Rt<Kt;Qt=Rt++)nt=G[Rt],_t=G[Qt],D+=(_t.x-nt.x)*(nt.y+_t.y);return D}let Sf=1/298.257223563,Dl=Sf*(2-Sf),Bc=Math.PI/180;class jf{constructor(D){let nt=6378.137*Bc*1e3,_t=Math.cos(D*Bc),Rt=1/(1-Dl*(1-_t*_t)),Kt=Math.sqrt(Rt);this.kx=nt*Kt*_t,this.ky=nt*Kt*Rt*(1-Dl)}distance(D,nt){let _t=this.wrap(D[0]-nt[0])*this.kx,Rt=(D[1]-nt[1])*this.ky;return Math.sqrt(_t*_t+Rt*Rt)}pointOnLine(D,nt){let _t,Rt,Kt,Qt,be=1/0;for(let Fe=0;Fe<D.length-1;Fe++){let er=D[Fe][0],yr=D[Fe][1],Er=this.wrap(D[Fe+1][0]-er)*this.kx,Zr=(D[Fe+1][1]-yr)*this.ky,sn=0;Er===0&&Zr===0||(sn=(this.wrap(nt[0]-er)*this.kx*Er+(nt[1]-yr)*this.ky*Zr)/(Er*Er+Zr*Zr),sn>1?(er=D[Fe+1][0],yr=D[Fe+1][1]):sn>0&&(er+=Er/this.kx*sn,yr+=Zr/this.ky*sn)),Er=this.wrap(nt[0]-er)*this.kx,Zr=(nt[1]-yr)*this.ky;let xn=Er*Er+Zr*Zr;xn<be&&(be=xn,_t=er,Rt=yr,Kt=Fe,Qt=sn)}return{point:[_t,Rt],index:Kt,t:Math.max(0,Math.min(1,Qt))}}wrap(D){for(;D<-180;)D+=360;for(;D>180;)D-=360;return D}}function hc(G,D){return D[0]-G[0]}function oc(G){return G[1]-G[0]+1}function fc(G,D){return G[1]>=G[0]&&G[1]<D}function oh(G,D){if(G[0]>G[1])return[null,null];let nt=oc(G);if(D){if(nt===2)return[G,null];let Rt=Math.floor(nt/2);return[[G[0],G[0]+Rt],[G[0]+Rt,G[1]]]}if(nt===1)return[G,null];let _t=Math.floor(nt/2)-1;return[[G[0],G[0]+_t],[G[0]+_t+1,G[1]]]}function su(G,D){if(!fc(D,G.length))return[1/0,1/0,-1/0,-1/0];let nt=[1/0,1/0,-1/0,-1/0];for(let _t=D[0];_t<=D[1];++_t)Hs(nt,G[_t]);return nt}function sc(G){let D=[1/0,1/0,-1/0,-1/0];for(let nt of G)for(let _t of nt)Hs(D,_t);return D}function el(G){return G[0]!==-1/0&&G[1]!==-1/0&&G[2]!==1/0&&G[3]!==1/0}function Zl(G,D,nt){if(!el(G)||!el(D))return NaN;let _t=0,Rt=0;return G[2]<D[0]&&(_t=D[0]-G[2]),G[0]>D[2]&&(_t=G[0]-D[2]),G[1]>D[3]&&(Rt=G[1]-D[3]),G[3]<D[1]&&(Rt=D[1]-G[3]),nt.distance([0,0],[_t,Rt])}function Mh(G,D,nt){let _t=nt.pointOnLine(D,G);return nt.distance(G,_t.point)}function Lc(G,D,nt,_t,Rt){let Kt=Math.min(Mh(G,[nt,_t],Rt),Mh(D,[nt,_t],Rt)),Qt=Math.min(Mh(nt,[G,D],Rt),Mh(_t,[G,D],Rt));return Math.min(Kt,Qt)}function jh(G,D,nt,_t,Rt){if(!fc(D,G.length)||!fc(_t,nt.length))return 1/0;let Kt=1/0;for(let Qt=D[0];Qt<D[1];++Qt){let be=G[Qt],Fe=G[Qt+1];for(let er=_t[0];er<_t[1];++er){let yr=nt[er],Er=nt[er+1];if(ql(be,Fe,yr,Er))return 0;Kt=Math.min(Kt,Lc(be,Fe,yr,Er,Rt))}}return Kt}function xu(G,D,nt,_t,Rt){if(!fc(D,G.length)||!fc(_t,nt.length))return NaN;let Kt=1/0;for(let Qt=D[0];Qt<=D[1];++Qt)for(let be=_t[0];be<=_t[1];++be)if(Kt=Math.min(Kt,Rt.distance(G[Qt],nt[be])),Kt===0)return Kt;return Kt}function Cd(G,D,nt){if(Cl(G,D,!0))return 0;let _t=1/0;for(let Rt of D){let Kt=Rt[0],Qt=Rt[Rt.length-1];if(Kt!==Qt&&(_t=Math.min(_t,Mh(G,[Qt,Kt],nt)),_t===0))return _t;let be=nt.pointOnLine(Rt,G);if(_t=Math.min(_t,nt.distance(G,be.point)),_t===0)return _t}return _t}function Qs(G,D,nt,_t){if(!fc(D,G.length))return NaN;for(let Kt=D[0];Kt<=D[1];++Kt)if(Cl(G[Kt],nt,!0))return 0;let Rt=1/0;for(let Kt=D[0];Kt<D[1];++Kt){let Qt=G[Kt],be=G[Kt+1];for(let Fe of nt)for(let er=0,yr=Fe.length,Er=yr-1;er<yr;Er=er++){let Zr=Fe[Er],sn=Fe[er];if(ql(Qt,be,Zr,sn))return 0;Rt=Math.min(Rt,Lc(Qt,be,Zr,sn,_t))}}return Rt}function Wd(G,D){for(let nt of G)for(let _t of nt)if(Cl(_t,D,!0))return!0;return!1}function Ll(G,D,nt,_t=1/0){let Rt=sc(G),Kt=sc(D);if(_t!==1/0&&Zl(Rt,Kt,nt)>=_t)return _t;if(Kl(Rt,Kt)){if(Wd(G,D))return 0}else if(Wd(D,G))return 0;let Qt=1/0;for(let be of G)for(let Fe=0,er=be.length,yr=er-1;Fe<er;yr=Fe++){let Er=be[yr],Zr=be[Fe];for(let sn of D)for(let xn=0,Ln=sn.length,$n=Ln-1;xn<Ln;$n=xn++){let ki=sn[$n],Aa=sn[xn];if(ql(Er,Zr,ki,Aa))return 0;Qt=Math.min(Qt,Lc(Er,Zr,ki,Aa,nt))}}return Qt}function Jo(G,D,nt,_t,Rt,Kt){if(!Kt)return;let Qt=Zl(su(_t,Kt),Rt,nt);Qt<D&&G.push([Qt,Kt,[0,0]])}function lf(G,D,nt,_t,Rt,Kt,Qt){if(!Kt||!Qt)return;let be=Zl(su(_t,Kt),su(Rt,Qt),nt);be<D&&G.push([be,Kt,Qt])}function sh(G,D,nt,_t,Rt=1/0){let Kt=Math.min(_t.distance(G[0],nt[0][0]),Rt);if(Kt===0)return Kt;let Qt=new Ol([[0,[0,G.length-1],[0,0]]],hc),be=sc(nt);for(;Qt.length>0;){let Fe=Qt.pop();if(Fe[0]>=Kt)continue;let er=Fe[1],yr=D?50:100;if(oc(er)<=yr){if(!fc(er,G.length))return NaN;if(D){let Er=Qs(G,er,nt,_t);if(isNaN(Er)||Er===0)return Er;Kt=Math.min(Kt,Er)}else for(let Er=er[0];Er<=er[1];++Er){let Zr=Cd(G[Er],nt,_t);if(Kt=Math.min(Kt,Zr),Kt===0)return 0}}else{let Er=oh(er,D);Jo(Qt,Kt,_t,G,be,Er[0]),Jo(Qt,Kt,_t,G,be,Er[1])}}return Kt}function ec(G,D,nt,_t,Rt,Kt=1/0){let Qt=Math.min(Kt,Rt.distance(G[0],nt[0]));if(Qt===0)return Qt;let be=new Ol([[0,[0,G.length-1],[0,nt.length-1]]],hc);for(;be.length>0;){let Fe=be.pop();if(Fe[0]>=Qt)continue;let er=Fe[1],yr=Fe[2],Er=D?50:100,Zr=_t?50:100;if(oc(er)<=Er&&oc(yr)<=Zr){if(!fc(er,G.length)&&fc(yr,nt.length))return NaN;let sn;if(D&&_t)sn=jh(G,er,nt,yr,Rt),Qt=Math.min(Qt,sn);else if(D&&!_t){let xn=G.slice(er[0],er[1]+1);for(let Ln=yr[0];Ln<=yr[1];++Ln)if(sn=Mh(nt[Ln],xn,Rt),Qt=Math.min(Qt,sn),Qt===0)return Qt}else if(!D&&_t){let xn=nt.slice(yr[0],yr[1]+1);for(let Ln=er[0];Ln<=er[1];++Ln)if(sn=Mh(G[Ln],xn,Rt),Qt=Math.min(Qt,sn),Qt===0)return Qt}else sn=xu(G,er,nt,yr,Rt),Qt=Math.min(Qt,sn)}else{let sn=oh(er,D),xn=oh(yr,_t);lf(be,Qt,Rt,G,nt,sn[0],xn[0]),lf(be,Qt,Rt,G,nt,sn[0],xn[1]),lf(be,Qt,Rt,G,nt,sn[1],xn[0]),lf(be,Qt,Rt,G,nt,sn[1],xn[1])}}return Qt}function Uf(G){return G.type==="MultiPolygon"?G.coordinates.map(D=>({type:"Polygon",coordinates:D})):G.type==="MultiLineString"?G.coordinates.map(D=>({type:"LineString",coordinates:D})):G.type==="MultiPoint"?G.coordinates.map(D=>({type:"Point",coordinates:D})):[G]}class Uh{constructor(D,nt){this.type=Te,this.geojson=D,this.geometries=nt}static parse(D,nt){if(D.length!==2)return nt.error(`'distance' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Zi(D[1])){let _t=D[1];if(_t.type==="FeatureCollection")return new Uh(_t,_t.features.map(Rt=>Uf(Rt.geometry)).flat());if(_t.type==="Feature")return new Uh(_t,Uf(_t.geometry));if("type"in _t&&"coordinates"in _t)return new Uh(_t,Uf(_t))}return nt.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return function(nt,_t){let Rt=nt.geometry(),Kt=Rt.flat().map(Fe=>uo([Fe.x,Fe.y],nt.canonical));if(Rt.length===0)return NaN;let Qt=new jf(Kt[0][1]),be=1/0;for(let Fe of _t){switch(Fe.type){case"Point":be=Math.min(be,ec(Kt,!1,[Fe.coordinates],!1,Qt,be));break;case"LineString":be=Math.min(be,ec(Kt,!1,Fe.coordinates,!0,Qt,be));break;case"Polygon":be=Math.min(be,sh(Kt,!1,Fe.coordinates,Qt,be))}if(be===0)return be}return be}(D,this.geometries);if(D.geometryType()==="LineString")return function(nt,_t){let Rt=nt.geometry(),Kt=Rt.flat().map(Fe=>uo([Fe.x,Fe.y],nt.canonical));if(Rt.length===0)return NaN;let Qt=new jf(Kt[0][1]),be=1/0;for(let Fe of _t){switch(Fe.type){case"Point":be=Math.min(be,ec(Kt,!0,[Fe.coordinates],!1,Qt,be));break;case"LineString":be=Math.min(be,ec(Kt,!0,Fe.coordinates,!0,Qt,be));break;case"Polygon":be=Math.min(be,sh(Kt,!0,Fe.coordinates,Qt,be))}if(be===0)return be}return be}(D,this.geometries);if(D.geometryType()==="Polygon")return function(nt,_t){let Rt=nt.geometry();if(Rt.length===0||Rt[0].length===0)return NaN;let Kt=Jc(Rt,0).map(Fe=>Fe.map(er=>er.map(yr=>uo([yr.x,yr.y],nt.canonical)))),Qt=new jf(Kt[0][0][0][1]),be=1/0;for(let Fe of _t)for(let er of Kt){switch(Fe.type){case"Point":be=Math.min(be,sh([Fe.coordinates],!1,er,Qt,be));break;case"LineString":be=Math.min(be,sh(Fe.coordinates,!0,er,Qt,be));break;case"Polygon":be=Math.min(be,Ll(er,Fe.coordinates,Qt,be))}if(be===0)return be}return be}(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let yf={"==":as,"!=":ul,">":Rl,"<":Js,">=":Cs,"<=":ls,array:Rr,at:dr,boolean:Rr,case:Xn,coalesce:is,collator:Co,format:kl,image:Vl,in:Vr,"index-of":yn,interpolate:Ia,"interpolate-hcl":Ia,"interpolate-lab":Ia,length:Yl,let:an,literal:Wa,match:Fn,number:Rr,"number-format":ks,object:Rr,slice:Pn,step:Zn,string:Rr,"to-boolean":$r,"to-color":$r,"to-number":$r,"to-string":$r,var:Ee,within:_l,distance:Uh};class lc{constructor(D,nt,_t,Rt){this.name=D,this.type=nt,this._evaluate=_t,this.args=Rt}evaluate(D){return this._evaluate(D,this.args)}eachChild(D){this.args.forEach(D)}outputDefined(){return!1}static parse(D,nt){let _t=D[0],Rt=lc.definitions[_t];if(!Rt)return nt.error(`Unknown expression "${_t}". If you wanted a literal array, use ["literal", [...]].`,0);let Kt=Array.isArray(Rt)?Rt[0]:Rt.type,Qt=Array.isArray(Rt)?[[Rt[1],Rt[2]]]:Rt.overloads,be=Qt.filter(([er])=>!Array.isArray(er)||er.length===D.length-1),Fe=null;for(let[er,yr]of be){Fe=new dn(nt.registry,Vf,nt.path,null,nt.scope);let Er=[],Zr=!1;for(let sn=1;sn<D.length;sn++){let xn=D[sn],Ln=Array.isArray(er)?er[sn-1]:er.type,$n=Fe.parse(xn,1+Er.length,Ln);if(!$n){Zr=!0;break}Er.push($n)}if(!Zr)if(Array.isArray(er)&&er.length!==Er.length)Fe.error(`Expected ${er.length} arguments, but found ${Er.length} instead.`);else{for(let sn=0;sn<Er.length;sn++){let xn=Array.isArray(er)?er[sn]:er.type,Ln=Er[sn];Fe.concat(sn+1).checkSubtype(xn,Ln.type)}if(Fe.errors.length===0)return new lc(_t,Kt,yr,Er)}}if(be.length===1)nt.errors.push(...Fe.errors);else{let er=(be.length?be:Qt).map(([Er])=>{return Zr=Er,Array.isArray(Zr)?`(${Zr.map(ne).join(", ")})`:`(${ne(Zr.type)}...)`;var Zr}).join(" | "),yr=[];for(let Er=1;Er<D.length;Er++){let Zr=nt.parse(D[Er],1+yr.length);if(!Zr)return null;yr.push(ne(Zr.type))}nt.error(`Expected arguments of type ${er}, but found (${yr.join(", ")}) instead.`)}return null}static register(D,nt){lc.definitions=nt;for(let _t in nt)D[_t]=lc}}function hd(G,[D,nt,_t,Rt]){D=D.evaluate(G),nt=nt.evaluate(G),_t=_t.evaluate(G);let Kt=Rt?Rt.evaluate(G):1,Qt=Di(D,nt,_t,Kt);if(Qt)throw new ze(Qt);return new xr(D/255,nt/255,_t/255,Kt,!1)}function $f(G,D){return G in D}function xf(G,D){let nt=D[G];return nt===void 0?null:nt}function Vh(G){return{type:G}}function Vf(G){if(G instanceof Ee)return Vf(G.boundExpression);if(G instanceof lc&&G.name==="error"||G instanceof Co||G instanceof _l||G instanceof Uh)return!1;let D=G instanceof $r||G instanceof Rr,nt=!0;return G.eachChild(_t=>{nt=D?nt&&Vf(_t):nt&&_t instanceof Wa}),!!nt&&Hf(G)&&Gf(G,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Hf(G){if(G instanceof lc&&(G.name==="get"&&G.args.length===1||G.name==="feature-state"||G.name==="has"&&G.args.length===1||G.name==="properties"||G.name==="geometry-type"||G.name==="id"||/^filter-/.test(G.name))||G instanceof _l||G instanceof Uh)return!1;let D=!0;return G.eachChild(nt=>{D&&!Hf(nt)&&(D=!1)}),D}function lh(G){if(G instanceof lc&&G.name==="feature-state")return!1;let D=!0;return G.eachChild(nt=>{D&&!lh(nt)&&(D=!1)}),D}function Gf(G,D){if(G instanceof lc&&D.indexOf(G.name)>=0)return!1;let nt=!0;return G.eachChild(_t=>{nt&&!Gf(_t,D)&&(nt=!1)}),nt}function Sh(G){return{result:"success",value:G}}function mh(G){return{result:"error",value:G}}function uc(G){return G["property-type"]==="data-driven"||G["property-type"]==="cross-faded-data-driven"}function ef(G){return!!G.expression&&G.expression.parameters.indexOf("zoom")>-1}function Wf(G){return!!G.expression&&G.expression.interpolated}function Jl(G){return G instanceof Number?"number":G instanceof String?"string":G instanceof Boolean?"boolean":Array.isArray(G)?"array":G===null?"null":typeof G}function Ef(G){return typeof G=="object"&&G!==null&&!Array.isArray(G)}function Ld(G){return G}function Yf(G,D){let nt=D.type==="color",_t=G.stops&&typeof G.stops[0][0]=="object",Rt=_t||!(_t||G.property!==void 0),Kt=G.type||(Wf(D)?"exponential":"interval");if(nt||D.type==="padding"){let yr=nt?xr.parse:Mn.parse;(G=Mt({},G)).stops&&(G.stops=G.stops.map(Er=>[Er[0],yr(Er[1])])),G.default=yr(G.default?G.default:D.default)}if(G.colorSpace&&(Qt=G.colorSpace)!=="rgb"&&Qt!=="hcl"&&Qt!=="lab")throw new Error(`Unknown color space: "${G.colorSpace}"`);var Qt;let be,Fe,er;if(Kt==="exponential")be=Xf;else if(Kt==="interval")be=Nc;else if(Kt==="categorical"){be=Kf,Fe=Object.create(null);for(let yr of G.stops)Fe[yr[0]]=yr[1];er=typeof G.stops[0][0]}else{if(Kt!=="identity")throw new Error(`Unknown function type "${Kt}"`);be=zu}if(_t){let yr={},Er=[];for(let xn=0;xn<G.stops.length;xn++){let Ln=G.stops[xn],$n=Ln[0].zoom;yr[$n]===void 0&&(yr[$n]={zoom:$n,type:G.type,property:G.property,default:G.default,stops:[]},Er.push($n)),yr[$n].stops.push([Ln[0].value,Ln[1]])}let Zr=[];for(let xn of Er)Zr.push([yr[xn].zoom,Yf(yr[xn],D)]);let sn={name:"linear"};return{kind:"composite",interpolationType:sn,interpolationFactor:Ia.interpolationFactor.bind(void 0,sn),zoomStops:Zr.map(xn=>xn[0]),evaluate:({zoom:xn},Ln)=>Xf({stops:Zr,base:G.base},D,xn).evaluate(xn,Ln)}}if(Rt){let yr=Kt==="exponential"?{name:"exponential",base:G.base!==void 0?G.base:1}:null;return{kind:"camera",interpolationType:yr,interpolationFactor:Ia.interpolationFactor.bind(void 0,yr),zoomStops:G.stops.map(Er=>Er[0]),evaluate:({zoom:Er})=>be(G,D,Er,Fe,er)}}return{kind:"source",evaluate(yr,Er){let Zr=Er&&Er.properties?Er.properties[G.property]:void 0;return Zr===void 0?_f(G.default,D.default):be(G,D,Zr,Fe,er)}}}function _f(G,D,nt){return G!==void 0?G:D!==void 0?D:nt!==void 0?nt:void 0}function Kf(G,D,nt,_t,Rt){return _f(typeof nt===Rt?_t[nt]:void 0,G.default,D.default)}function Nc(G,D,nt){if(Jl(nt)!=="number")return _f(G.default,D.default);let _t=G.stops.length;if(_t===1||nt<=G.stops[0][0])return G.stops[0][1];if(nt>=G.stops[_t-1][0])return G.stops[_t-1][1];let Rt=En(G.stops.map(Kt=>Kt[0]),nt);return G.stops[Rt][1]}function Xf(G,D,nt){let _t=G.base!==void 0?G.base:1;if(Jl(nt)!=="number")return _f(G.default,D.default);let Rt=G.stops.length;if(Rt===1||nt<=G.stops[0][0])return G.stops[0][1];if(nt>=G.stops[Rt-1][0])return G.stops[Rt-1][1];let Kt=En(G.stops.map(yr=>yr[0]),nt),Qt=function(yr,Er,Zr,sn){let xn=sn-Zr,Ln=yr-Zr;return xn===0?0:Er===1?Ln/xn:(Math.pow(Er,Ln)-1)/(Math.pow(Er,xn)-1)}(nt,_t,G.stops[Kt][0],G.stops[Kt+1][0]),be=G.stops[Kt][1],Fe=G.stops[Kt+1][1],er=Do[D.type]||Ld;return typeof be.evaluate=="function"?{evaluate(...yr){let Er=be.evaluate.apply(void 0,yr),Zr=Fe.evaluate.apply(void 0,yr);if(Er!==void 0&&Zr!==void 0)return er(Er,Zr,Qt,G.colorSpace)}}:er(be,Fe,Qt,G.colorSpace)}function zu(G,D,nt){switch(D.type){case"color":nt=xr.parse(nt);break;case"formatted":nt=wn.fromString(nt.toString());break;case"resolvedImage":nt=Pi.fromString(nt.toString());break;case"padding":nt=Mn.parse(nt);break;default:Jl(nt)===D.type||D.type==="enum"&&D.values[nt]||(nt=void 0)}return _f(nt,G.default,D.default)}lc.register(yf,{error:[{kind:"error"},[He],(G,[D])=>{throw new ze(D.evaluate(G))}],typeof:[He,[jr],(G,[D])=>ne(ui(D.evaluate(G)))],"to-rgba":[$t(Te,4),[cr],(G,[D])=>{let[nt,_t,Rt,Kt]=D.evaluate(G).rgb;return[255*nt,255*_t,255*Rt,Kt]}],rgb:[cr,[Te,Te,Te],hd],rgba:[cr,[Te,Te,Te,Te],hd],has:{type:Ge,overloads:[[[He],(G,[D])=>$f(D.evaluate(G),G.properties())],[[He,ur],(G,[D,nt])=>$f(D.evaluate(G),nt.evaluate(G))]]},get:{type:jr,overloads:[[[He],(G,[D])=>xf(D.evaluate(G),G.properties())],[[He,ur],(G,[D,nt])=>xf(D.evaluate(G),nt.evaluate(G))]]},"feature-state":[jr,[He],(G,[D])=>xf(D.evaluate(G),G.featureState||{})],properties:[ur,[],G=>G.properties()],"geometry-type":[He,[],G=>G.geometryType()],id:[jr,[],G=>G.id()],zoom:[Te,[],G=>G.globals.zoom],"heatmap-density":[Te,[],G=>G.globals.heatmapDensity||0],"line-progress":[Te,[],G=>G.globals.lineProgress||0],accumulated:[jr,[],G=>G.globals.accumulated===void 0?null:G.globals.accumulated],"+":[Te,Vh(Te),(G,D)=>{let nt=0;for(let _t of D)nt+=_t.evaluate(G);return nt}],"*":[Te,Vh(Te),(G,D)=>{let nt=1;for(let _t of D)nt*=_t.evaluate(G);return nt}],"-":{type:Te,overloads:[[[Te,Te],(G,[D,nt])=>D.evaluate(G)-nt.evaluate(G)],[[Te],(G,[D])=>-D.evaluate(G)]]},"/":[Te,[Te,Te],(G,[D,nt])=>D.evaluate(G)/nt.evaluate(G)],"%":[Te,[Te,Te],(G,[D,nt])=>D.evaluate(G)%nt.evaluate(G)],ln2:[Te,[],()=>Math.LN2],pi:[Te,[],()=>Math.PI],e:[Te,[],()=>Math.E],"^":[Te,[Te,Te],(G,[D,nt])=>Math.pow(D.evaluate(G),nt.evaluate(G))],sqrt:[Te,[Te],(G,[D])=>Math.sqrt(D.evaluate(G))],log10:[Te,[Te],(G,[D])=>Math.log(D.evaluate(G))/Math.LN10],ln:[Te,[Te],(G,[D])=>Math.log(D.evaluate(G))],log2:[Te,[Te],(G,[D])=>Math.log(D.evaluate(G))/Math.LN2],sin:[Te,[Te],(G,[D])=>Math.sin(D.evaluate(G))],cos:[Te,[Te],(G,[D])=>Math.cos(D.evaluate(G))],tan:[Te,[Te],(G,[D])=>Math.tan(D.evaluate(G))],asin:[Te,[Te],(G,[D])=>Math.asin(D.evaluate(G))],acos:[Te,[Te],(G,[D])=>Math.acos(D.evaluate(G))],atan:[Te,[Te],(G,[D])=>Math.atan(D.evaluate(G))],min:[Te,Vh(Te),(G,D)=>Math.min(...D.map(nt=>nt.evaluate(G)))],max:[Te,Vh(Te),(G,D)=>Math.max(...D.map(nt=>nt.evaluate(G)))],abs:[Te,[Te],(G,[D])=>Math.abs(D.evaluate(G))],round:[Te,[Te],(G,[D])=>{let nt=D.evaluate(G);return nt<0?-Math.round(-nt):Math.round(nt)}],floor:[Te,[Te],(G,[D])=>Math.floor(D.evaluate(G))],ceil:[Te,[Te],(G,[D])=>Math.ceil(D.evaluate(G))],"filter-==":[Ge,[He,jr],(G,[D,nt])=>G.properties()[D.value]===nt.value],"filter-id-==":[Ge,[jr],(G,[D])=>G.id()===D.value],"filter-type-==":[Ge,[He],(G,[D])=>G.geometryType()===D.value],"filter-<":[Ge,[He,jr],(G,[D,nt])=>{let _t=G.properties()[D.value],Rt=nt.value;return typeof _t==typeof Rt&&_t<Rt}],"filter-id-<":[Ge,[jr],(G,[D])=>{let nt=G.id(),_t=D.value;return typeof nt==typeof _t&&nt<_t}],"filter->":[Ge,[He,jr],(G,[D,nt])=>{let _t=G.properties()[D.value],Rt=nt.value;return typeof _t==typeof Rt&&_t>Rt}],"filter-id->":[Ge,[jr],(G,[D])=>{let nt=G.id(),_t=D.value;return typeof nt==typeof _t&&nt>_t}],"filter-<=":[Ge,[He,jr],(G,[D,nt])=>{let _t=G.properties()[D.value],Rt=nt.value;return typeof _t==typeof Rt&&_t<=Rt}],"filter-id-<=":[Ge,[jr],(G,[D])=>{let nt=G.id(),_t=D.value;return typeof nt==typeof _t&&nt<=_t}],"filter->=":[Ge,[He,jr],(G,[D,nt])=>{let _t=G.properties()[D.value],Rt=nt.value;return typeof _t==typeof Rt&&_t>=Rt}],"filter-id->=":[Ge,[jr],(G,[D])=>{let nt=G.id(),_t=D.value;return typeof nt==typeof _t&&nt>=_t}],"filter-has":[Ge,[jr],(G,[D])=>D.value in G.properties()],"filter-has-id":[Ge,[],G=>G.id()!==null&&G.id()!==void 0],"filter-type-in":[Ge,[$t(He)],(G,[D])=>D.value.indexOf(G.geometryType())>=0],"filter-id-in":[Ge,[$t(jr)],(G,[D])=>D.value.indexOf(G.id())>=0],"filter-in-small":[Ge,[He,$t(jr)],(G,[D,nt])=>nt.value.indexOf(G.properties()[D.value])>=0],"filter-in-large":[Ge,[He,$t(jr)],(G,[D,nt])=>function(_t,Rt,Kt,Qt){for(;Kt<=Qt;){let be=Kt+Qt>>1;if(Rt[be]===_t)return!0;Rt[be]>_t?Qt=be-1:Kt=be+1}return!1}(G.properties()[D.value],nt.value,0,nt.value.length-1)],all:{type:Ge,overloads:[[[Ge,Ge],(G,[D,nt])=>D.evaluate(G)&&nt.evaluate(G)],[Vh(Ge),(G,D)=>{for(let nt of D)if(!nt.evaluate(G))return!1;return!0}]]},any:{type:Ge,overloads:[[[Ge,Ge],(G,[D,nt])=>D.evaluate(G)||nt.evaluate(G)],[Vh(Ge),(G,D)=>{for(let nt of D)if(nt.evaluate(G))return!0;return!1}]]},"!":[Ge,[Ge],(G,[D])=>!D.evaluate(G)],"is-supported-script":[Ge,[He],(G,[D])=>{let nt=G.globals&&G.globals.isSupportedScript;return!nt||nt(D.evaluate(G))}],upcase:[He,[He],(G,[D])=>D.evaluate(G).toUpperCase()],downcase:[He,[He],(G,[D])=>D.evaluate(G).toLowerCase()],concat:[He,Vh(jr),(G,D)=>D.map(nt=>Pa(nt.evaluate(G))).join("")],"resolved-locale":[He,[Hr],(G,[D])=>D.evaluate(G).resolvedLocale()]});class jc{constructor(D,nt){var _t;this.expression=D,this._warningHistory={},this._evaluator=new Gr,this._defaultValue=nt?(_t=nt).type==="color"&&Ef(_t.default)?new xr(0,0,0,0):_t.type==="color"?xr.parse(_t.default)||null:_t.type==="padding"?Mn.parse(_t.default)||null:_t.type==="variableAnchorOffsetCollection"?xi.parse(_t.default)||null:_t.default===void 0?null:_t.default:null,this._enumValues=nt&&nt.type==="enum"?nt.values:null}evaluateWithoutErrorHandling(D,nt,_t,Rt,Kt,Qt){return this._evaluator.globals=D,this._evaluator.feature=nt,this._evaluator.featureState=_t,this._evaluator.canonical=Rt,this._evaluator.availableImages=Kt||null,this._evaluator.formattedSection=Qt,this.expression.evaluate(this._evaluator)}evaluate(D,nt,_t,Rt,Kt,Qt){this._evaluator.globals=D,this._evaluator.feature=nt||null,this._evaluator.featureState=_t||null,this._evaluator.canonical=Rt,this._evaluator.availableImages=Kt||null,this._evaluator.formattedSection=Qt||null;try{let be=this.expression.evaluate(this._evaluator);if(be==null||typeof be=="number"&&be!=be)return this._defaultValue;if(this._enumValues&&!(be in this._enumValues))throw new ze(`Expected value to be one of ${Object.keys(this._enumValues).map(Fe=>JSON.stringify(Fe)).join(", ")}, but found ${JSON.stringify(be)} instead.`);return be}catch(be){return this._warningHistory[be.message]||(this._warningHistory[be.message]=!0,typeof console<"u"&&console.warn(be.message)),this._defaultValue}}}function Hh(G){return Array.isArray(G)&&G.length>0&&typeof G[0]=="string"&&G[0]in yf}function lu(G,D){let nt=new dn(yf,Vf,[],D?function(Rt){let Kt={color:cr,string:He,number:Te,enum:He,boolean:Ge,formatted:br,padding:Kr,resolvedImage:rn,variableAnchorOffsetCollection:Ce};return Rt.type==="array"?$t(Kt[Rt.value]||jr,Rt.length):Kt[Rt.type]}(D):void 0),_t=nt.parse(G,void 0,void 0,void 0,D&&D.type==="string"?{typeAnnotation:"coerce"}:void 0);return _t?Sh(new jc(_t,D)):mh(nt.errors)}class Eh{constructor(D,nt){this.kind=D,this._styleExpression=nt,this.isStateDependent=D!=="constant"&&!lh(nt.expression)}evaluateWithoutErrorHandling(D,nt,_t,Rt,Kt,Qt){return this._styleExpression.evaluateWithoutErrorHandling(D,nt,_t,Rt,Kt,Qt)}evaluate(D,nt,_t,Rt,Kt,Qt){return this._styleExpression.evaluate(D,nt,_t,Rt,Kt,Qt)}}class Sc{constructor(D,nt,_t,Rt){this.kind=D,this.zoomStops=_t,this._styleExpression=nt,this.isStateDependent=D!=="camera"&&!lh(nt.expression),this.interpolationType=Rt}evaluateWithoutErrorHandling(D,nt,_t,Rt,Kt,Qt){return this._styleExpression.evaluateWithoutErrorHandling(D,nt,_t,Rt,Kt,Qt)}evaluate(D,nt,_t,Rt,Kt,Qt){return this._styleExpression.evaluate(D,nt,_t,Rt,Kt,Qt)}interpolationFactor(D,nt,_t){return this.interpolationType?Ia.interpolationFactor(this.interpolationType,D,nt,_t):0}}function Uc(G,D){let nt=lu(G,D);if(nt.result==="error")return nt;let _t=nt.value.expression,Rt=Hf(_t);if(!Rt&&!uc(D))return mh([new te("","data expressions not supported")]);let Kt=Gf(_t,["zoom"]);if(!Kt&&!ef(D))return mh([new te("","zoom expressions not supported")]);let Qt=uf(_t);return Qt||Kt?Qt instanceof te?mh([Qt]):Qt instanceof Ia&&!Wf(D)?mh([new te("",'"interpolate" expressions cannot be used with this property')]):Sh(Qt?new Sc(Rt?"camera":"composite",nt.value,Qt.labels,Qt instanceof Ia?Qt.interpolation:void 0):new Eh(Rt?"constant":"source",nt.value)):mh([new te("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class _u{constructor(D,nt){this._parameters=D,this._specification=nt,Mt(this,Yf(this._parameters,this._specification))}static deserialize(D){return new _u(D._parameters,D._specification)}static serialize(D){return{_parameters:D._parameters,_specification:D._specification}}}function uf(G){let D=null;if(G instanceof an)D=uf(G.result);else if(G instanceof is){for(let nt of G.args)if(D=uf(nt),D)break}else(G instanceof Zn||G instanceof Ia)&&G.input instanceof lc&&G.input.name==="zoom"&&(D=G);return D instanceof te||G.eachChild(nt=>{let _t=uf(nt);_t instanceof te?D=_t:!D&&_t?D=new te("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&_t&&D!==_t&&(D=new te("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}function gh(G){if(G===!0||G===!1)return!0;if(!Array.isArray(G)||G.length===0)return!1;switch(G[0]){case"has":return G.length>=2&&G[1]!=="$id"&&G[1]!=="$type";case"in":return G.length>=3&&(typeof G[1]!="string"||Array.isArray(G[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return G.length!==3||Array.isArray(G[1])||Array.isArray(G[2]);case"any":case"all":for(let D of G.slice(1))if(!gh(D)&&typeof D!="boolean")return!1;return!0;default:return!0}}let Wh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Cf(G){if(G==null)return{filter:()=>!0,needGeometry:!1};gh(G)||(G=cf(G));let D=lu(G,Wh);if(D.result==="error")throw new Error(D.value.map(nt=>`${nt.key}: ${nt.message}`).join(", "));return{filter:(nt,_t,Rt)=>D.value.evaluate(nt,_t,{},Rt),needGeometry:Qd(G)}}function Pd(G,D){return G<D?-1:G>D?1:0}function Qd(G){if(!Array.isArray(G))return!1;if(G[0]==="within"||G[0]==="distance")return!0;for(let D=1;D<G.length;D++)if(Qd(G[D]))return!0;return!1}function cf(G){if(!G)return!0;let D=G[0];return G.length<=1?D!=="any":D==="=="?Lf(G[1],G[2],"=="):D==="!="?Qc(Lf(G[1],G[2],"==")):D==="<"||D===">"||D==="<="||D===">="?Lf(G[1],G[2],D):D==="any"?(nt=G.slice(1),["any"].concat(nt.map(cf))):D==="all"?["all"].concat(G.slice(1).map(cf)):D==="none"?["all"].concat(G.slice(1).map(cf).map(Qc)):D==="in"?wc(G[1],G.slice(2)):D==="!in"?Qc(wc(G[1],G.slice(2))):D==="has"?hf(G[1]):D!=="!has"||Qc(hf(G[1]));var nt}function Lf(G,D,nt){switch(G){case"$type":return[`filter-type-${nt}`,D];case"$id":return[`filter-id-${nt}`,D];default:return[`filter-${nt}`,G,D]}}function wc(G,D){if(D.length===0)return!1;switch(G){case"$type":return["filter-type-in",["literal",D]];case"$id":return["filter-id-in",["literal",D]];default:return D.length>200&&!D.some(nt=>typeof nt!=typeof D[0])?["filter-in-large",G,["literal",D.sort(Pd)]]:["filter-in-small",G,["literal",D]]}}function hf(G){switch(G){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",G]}}function Qc(G){return["!",G]}function ff(G){let D=typeof G;if(D==="number"||D==="boolean"||D==="string"||G==null)return JSON.stringify(G);if(Array.isArray(G)){let Rt="[";for(let Kt of G)Rt+=`${ff(Kt)},`;return`${Rt}]`}let nt=Object.keys(G).sort(),_t="{";for(let Rt=0;Rt<nt.length;Rt++)_t+=`${JSON.stringify(nt[Rt])}:${ff(G[nt[Rt]])},`;return`${_t}}`}function Pf(G){let D="";for(let nt of wt)D+=`/${ff(G[nt])}`;return D}function vh(G){let D=G.value;return D?[new Lt(G.key,D,"constants have been deprecated as of v8")]:[]}function bu(G){return G instanceof Number||G instanceof String||G instanceof Boolean?G.valueOf():G}function Ch(G){if(Array.isArray(G))return G.map(Ch);if(G instanceof Object&&!(G instanceof Number||G instanceof String||G instanceof Boolean)){let D={};for(let nt in G)D[nt]=Ch(G[nt]);return D}return bu(G)}function Vc(G){let D=G.key,nt=G.value,_t=G.valueSpec||{},Rt=G.objectElementValidators||{},Kt=G.style,Qt=G.styleSpec,be=G.validateSpec,Fe=[],er=Jl(nt);if(er!=="object")return[new Lt(D,nt,`object expected, ${er} found`)];for(let yr in nt){let Er=yr.split(".")[0],Zr=_t[Er]||_t["*"],sn;if(Rt[Er])sn=Rt[Er];else if(_t[Er])sn=be;else if(Rt["*"])sn=Rt["*"];else{if(!_t["*"]){Fe.push(new Lt(D,nt[yr],`unknown property "${yr}"`));continue}sn=be}Fe=Fe.concat(sn({key:(D&&`${D}.`)+yr,value:nt[yr],valueSpec:Zr,style:Kt,styleSpec:Qt,object:nt,objectKey:yr,validateSpec:be},nt))}for(let yr in _t)Rt[yr]||_t[yr].required&&_t[yr].default===void 0&&nt[yr]===void 0&&Fe.push(new Lt(D,nt,`missing required property "${yr}"`));return Fe}function fd(G){let D=G.value,nt=G.valueSpec,_t=G.style,Rt=G.styleSpec,Kt=G.key,Qt=G.arrayElementValidator||G.validateSpec;if(Jl(D)!=="array")return[new Lt(Kt,D,`array expected, ${Jl(D)} found`)];if(nt.length&&D.length!==nt.length)return[new Lt(Kt,D,`array length ${nt.length} expected, length ${D.length} found`)];if(nt["min-length"]&&D.length<nt["min-length"])return[new Lt(Kt,D,`array length at least ${nt["min-length"]} expected, length ${D.length} found`)];let be={type:nt.value,values:nt.values};Rt.$version<7&&(be.function=nt.function),Jl(nt.value)==="object"&&(be=nt.value);let Fe=[];for(let er=0;er<D.length;er++)Fe=Fe.concat(Qt({array:D,arrayIndex:er,value:D[er],valueSpec:be,validateSpec:G.validateSpec,style:_t,styleSpec:Rt,key:`${Kt}[${er}]`}));return Fe}function vu(G){let D=G.key,nt=G.value,_t=G.valueSpec,Rt=Jl(nt);return Rt==="number"&&nt!=nt&&(Rt="NaN"),Rt!=="number"?[new Lt(D,nt,`number expected, ${Rt} found`)]:"minimum"in _t&&nt<_t.minimum?[new Lt(D,nt,`${nt} is less than the minimum value ${_t.minimum}`)]:"maximum"in _t&&nt>_t.maximum?[new Lt(D,nt,`${nt} is greater than the maximum value ${_t.maximum}`)]:[]}function bf(G){let D=G.valueSpec,nt=bu(G.value.type),_t,Rt,Kt,Qt={},be=nt!=="categorical"&&G.value.property===void 0,Fe=!be,er=Jl(G.value.stops)==="array"&&Jl(G.value.stops[0])==="array"&&Jl(G.value.stops[0][0])==="object",yr=Vc({key:G.key,value:G.value,valueSpec:G.styleSpec.function,validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec,objectElementValidators:{stops:function(sn){if(nt==="identity")return[new Lt(sn.key,sn.value,'identity function may not have a "stops" property')];let xn=[],Ln=sn.value;return xn=xn.concat(fd({key:sn.key,value:Ln,valueSpec:sn.valueSpec,validateSpec:sn.validateSpec,style:sn.style,styleSpec:sn.styleSpec,arrayElementValidator:Er})),Jl(Ln)==="array"&&Ln.length===0&&xn.push(new Lt(sn.key,Ln,"array must have at least one stop")),xn},default:function(sn){return sn.validateSpec({key:sn.key,value:sn.value,valueSpec:D,validateSpec:sn.validateSpec,style:sn.style,styleSpec:sn.styleSpec})}}});return nt==="identity"&&be&&yr.push(new Lt(G.key,G.value,'missing required property "property"')),nt==="identity"||G.value.stops||yr.push(new Lt(G.key,G.value,'missing required property "stops"')),nt==="exponential"&&G.valueSpec.expression&&!Wf(G.valueSpec)&&yr.push(new Lt(G.key,G.value,"exponential functions not supported")),G.styleSpec.$version>=8&&(Fe&&!uc(G.valueSpec)?yr.push(new Lt(G.key,G.value,"property functions not supported")):be&&!ef(G.valueSpec)&&yr.push(new Lt(G.key,G.value,"zoom functions not supported"))),nt!=="categorical"&&!er||G.value.property!==void 0||yr.push(new Lt(G.key,G.value,'"property" property is required')),yr;function Er(sn){let xn=[],Ln=sn.value,$n=sn.key;if(Jl(Ln)!=="array")return[new Lt($n,Ln,`array expected, ${Jl(Ln)} found`)];if(Ln.length!==2)return[new Lt($n,Ln,`array length 2 expected, length ${Ln.length} found`)];if(er){if(Jl(Ln[0])!=="object")return[new Lt($n,Ln,`object expected, ${Jl(Ln[0])} found`)];if(Ln[0].zoom===void 0)return[new Lt($n,Ln,"object stop key must have zoom")];if(Ln[0].value===void 0)return[new Lt($n,Ln,"object stop key must have value")];if(Kt&&Kt>bu(Ln[0].zoom))return[new Lt($n,Ln[0].zoom,"stop zoom values must appear in ascending order")];bu(Ln[0].zoom)!==Kt&&(Kt=bu(Ln[0].zoom),Rt=void 0,Qt={}),xn=xn.concat(Vc({key:`${$n}[0]`,value:Ln[0],valueSpec:{zoom:{}},validateSpec:sn.validateSpec,style:sn.style,styleSpec:sn.styleSpec,objectElementValidators:{zoom:vu,value:Zr}}))}else xn=xn.concat(Zr({key:`${$n}[0]`,value:Ln[0],validateSpec:sn.validateSpec,style:sn.style,styleSpec:sn.styleSpec},Ln));return Hh(Ch(Ln[1]))?xn.concat([new Lt(`${$n}[1]`,Ln[1],"expressions are not allowed in function stops.")]):xn.concat(sn.validateSpec({key:`${$n}[1]`,value:Ln[1],valueSpec:D,validateSpec:sn.validateSpec,style:sn.style,styleSpec:sn.styleSpec}))}function Zr(sn,xn){let Ln=Jl(sn.value),$n=bu(sn.value),ki=sn.value!==null?sn.value:xn;if(_t){if(Ln!==_t)return[new Lt(sn.key,ki,`${Ln} stop domain type must match previous stop domain type ${_t}`)]}else _t=Ln;if(Ln!=="number"&&Ln!=="string"&&Ln!=="boolean")return[new Lt(sn.key,ki,"stop domain value must be a number, string, or boolean")];if(Ln!=="number"&&nt!=="categorical"){let Aa=`number expected, ${Ln} found`;return uc(D)&&nt===void 0&&(Aa+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Lt(sn.key,ki,Aa)]}return nt!=="categorical"||Ln!=="number"||isFinite($n)&&Math.floor($n)===$n?nt!=="categorical"&&Ln==="number"&&Rt!==void 0&&$n<Rt?[new Lt(sn.key,ki,"stop domain values must appear in ascending order")]:(Rt=$n,nt==="categorical"&&$n in Qt?[new Lt(sn.key,ki,"stop domain values must be unique")]:(Qt[$n]=!0,[])):[new Lt(sn.key,ki,`integer expected, found ${$n}`)]}}function qh(G){let D=(G.expressionContext==="property"?Uc:lu)(Ch(G.value),G.valueSpec);if(D.result==="error")return D.value.map(_t=>new Lt(`${G.key}${_t.key}`,G.value,_t.message));let nt=D.value.expression||D.value._styleExpression.expression;if(G.expressionContext==="property"&&G.propertyKey==="text-font"&&!nt.outputDefined())return[new Lt(G.key,G.value,`Invalid data expression for "${G.propertyKey}". Output values must be contained as literals within the expression.`)];if(G.expressionContext==="property"&&G.propertyType==="layout"&&!lh(nt))return[new Lt(G.key,G.value,'"feature-state" data expressions are not supported with layout properties.')];if(G.expressionContext==="filter"&&!lh(nt))return[new Lt(G.key,G.value,'"feature-state" data expressions are not supported with filters.')];if(G.expressionContext&&G.expressionContext.indexOf("cluster")===0){if(!Gf(nt,["zoom","feature-state"]))return[new Lt(G.key,G.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(G.expressionContext==="cluster-initial"&&!Hf(nt))return[new Lt(G.key,G.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function th(G){let D=G.key,nt=G.value,_t=G.valueSpec,Rt=[];return Array.isArray(_t.values)?_t.values.indexOf(bu(nt))===-1&&Rt.push(new Lt(D,nt,`expected one of [${_t.values.join(", ")}], ${JSON.stringify(nt)} found`)):Object.keys(_t.values).indexOf(bu(nt))===-1&&Rt.push(new Lt(D,nt,`expected one of [${Object.keys(_t.values).join(", ")}], ${JSON.stringify(nt)} found`)),Rt}function rf(G){return gh(Ch(G.value))?qh(Mt({},G,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Zh(G)}function Zh(G){let D=G.value,nt=G.key;if(Jl(D)!=="array")return[new Lt(nt,D,`array expected, ${Jl(D)} found`)];let _t=G.styleSpec,Rt,Kt=[];if(D.length<1)return[new Lt(nt,D,"filter array must have at least 1 element")];switch(Kt=Kt.concat(th({key:`${nt}[0]`,value:D[0],valueSpec:_t.filter_operator,style:G.style,styleSpec:G.styleSpec})),bu(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&bu(D[1])==="$type"&&Kt.push(new Lt(nt,D,`"$type" cannot be use with operator "${D[0]}"`));case"==":case"!=":D.length!==3&&Kt.push(new Lt(nt,D,`filter array for operator "${D[0]}" must have 3 elements`));case"in":case"!in":D.length>=2&&(Rt=Jl(D[1]),Rt!=="string"&&Kt.push(new Lt(`${nt}[1]`,D[1],`string expected, ${Rt} found`)));for(let Qt=2;Qt<D.length;Qt++)Rt=Jl(D[Qt]),bu(D[1])==="$type"?Kt=Kt.concat(th({key:`${nt}[${Qt}]`,value:D[Qt],valueSpec:_t.geometry_type,style:G.style,styleSpec:G.styleSpec})):Rt!=="string"&&Rt!=="number"&&Rt!=="boolean"&&Kt.push(new Lt(`${nt}[${Qt}]`,D[Qt],`string, number, or boolean expected, ${Rt} found`));break;case"any":case"all":case"none":for(let Qt=1;Qt<D.length;Qt++)Kt=Kt.concat(Zh({key:`${nt}[${Qt}]`,value:D[Qt],style:G.style,styleSpec:G.styleSpec}));break;case"has":case"!has":Rt=Jl(D[1]),D.length!==2?Kt.push(new Lt(nt,D,`filter array for "${D[0]}" operator must have 2 elements`)):Rt!=="string"&&Kt.push(new Lt(`${nt}[1]`,D[1],`string expected, ${Rt} found`))}return Kt}function wf(G,D){let nt=G.key,_t=G.validateSpec,Rt=G.style,Kt=G.styleSpec,Qt=G.value,be=G.objectKey,Fe=Kt[`${D}_${G.layerType}`];if(!Fe)return[];let er=be.match(/^(.*)-transition$/);if(D==="paint"&&er&&Fe[er[1]]&&Fe[er[1]].transition)return _t({key:nt,value:Qt,valueSpec:Kt.transition,style:Rt,styleSpec:Kt});let yr=G.valueSpec||Fe[be];if(!yr)return[new Lt(nt,Qt,`unknown property "${be}"`)];let Er;if(Jl(Qt)==="string"&&uc(yr)&&!yr.tokens&&(Er=/^{([^}]+)}$/.exec(Qt)))return[new Lt(nt,Qt,`"${be}" does not support interpolation syntax
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(Er[1])} }\`.`)];let Zr=[];return G.layerType==="symbol"&&(be==="text-field"&&Rt&&!Rt.glyphs&&Zr.push(new Lt(nt,Qt,'use of "text-field" requires a style "glyphs" property')),be==="text-font"&&Ef(Ch(Qt))&&bu(Qt.type)==="identity"&&Zr.push(new Lt(nt,Qt,'"text-font" does not support identity functions'))),Zr.concat(_t({key:G.key,value:Qt,valueSpec:yr,style:Rt,styleSpec:Kt,expressionContext:"property",propertyType:D,propertyKey:be}))}function zd(G){return wf(G,"paint")}function gc(G){return wf(G,"layout")}function Jf(G){let D=[],nt=G.value,_t=G.key,Rt=G.style,Kt=G.styleSpec;nt.type||nt.ref||D.push(new Lt(_t,nt,'either "type" or "ref" is required'));let Qt=bu(nt.type),be=bu(nt.ref);if(nt.id){let Fe=bu(nt.id);for(let er=0;er<G.arrayIndex;er++){let yr=Rt.layers[er];bu(yr.id)===Fe&&D.push(new Lt(_t,nt.id,`duplicate layer id "${nt.id}", previously used at line ${yr.id.__line__}`))}}if("ref"in nt){let Fe;["type","source","source-layer","filter","layout"].forEach(er=>{er in nt&&D.push(new Lt(_t,nt[er],`"${er}" is prohibited for ref layers`))}),Rt.layers.forEach(er=>{bu(er.id)===be&&(Fe=er)}),Fe?Fe.ref?D.push(new Lt(_t,nt.ref,"ref cannot reference another ref layer")):Qt=bu(Fe.type):D.push(new Lt(_t,nt.ref,`ref layer "${be}" not found`))}else if(Qt!=="background")if(nt.source){let Fe=Rt.sources&&Rt.sources[nt.source],er=Fe&&bu(Fe.type);Fe?er==="vector"&&Qt==="raster"?D.push(new Lt(_t,nt.source,`layer "${nt.id}" requires a raster source`)):er!=="raster-dem"&&Qt==="hillshade"?D.push(new Lt(_t,nt.source,`layer "${nt.id}" requires a raster-dem source`)):er==="raster"&&Qt!=="raster"?D.push(new Lt(_t,nt.source,`layer "${nt.id}" requires a vector source`)):er!=="vector"||nt["source-layer"]?er==="raster-dem"&&Qt!=="hillshade"?D.push(new Lt(_t,nt.source,"raster-dem source can only be used with layer type 'hillshade'.")):Qt!=="line"||!nt.paint||!nt.paint["line-gradient"]||er==="geojson"&&Fe.lineMetrics||D.push(new Lt(_t,nt,`layer "${nt.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new Lt(_t,nt,`layer "${nt.id}" must specify a "source-layer"`)):D.push(new Lt(_t,nt.source,`source "${nt.source}" not found`))}else D.push(new Lt(_t,nt,'missing required property "source"'));return D=D.concat(Vc({key:_t,value:nt,valueSpec:Kt.layer,style:G.style,styleSpec:G.styleSpec,validateSpec:G.validateSpec,objectElementValidators:{"*":()=>[],type:()=>G.validateSpec({key:`${_t}.type`,value:nt.type,valueSpec:Kt.layer.type,style:G.style,styleSpec:G.styleSpec,validateSpec:G.validateSpec,object:nt,objectKey:"type"}),filter:rf,layout:Fe=>Vc({layer:nt,key:Fe.key,value:Fe.value,style:Fe.style,styleSpec:Fe.styleSpec,validateSpec:Fe.validateSpec,objectElementValidators:{"*":er=>gc(Mt({layerType:Qt},er))}}),paint:Fe=>Vc({layer:nt,key:Fe.key,value:Fe.value,style:Fe.style,styleSpec:Fe.styleSpec,validateSpec:Fe.validateSpec,objectElementValidators:{"*":er=>zd(Mt({layerType:Qt},er))}})}})),D}function eh(G){let D=G.value,nt=G.key,_t=Jl(D);return _t!=="string"?[new Lt(nt,D,`string expected, ${_t} found`)]:[]}let Lh={promoteId:function({key:G,value:D}){if(Jl(D)==="string")return eh({key:G,value:D});{let nt=[];for(let _t in D)nt.push(...eh({key:`${G}.${_t}`,value:D[_t]}));return nt}}};function yh(G){let D=G.value,nt=G.key,_t=G.styleSpec,Rt=G.style,Kt=G.validateSpec;if(!D.type)return[new Lt(nt,D,'"type" is required')];let Qt=bu(D.type),be;switch(Qt){case"vector":case"raster":return be=Vc({key:nt,value:D,valueSpec:_t[`source_${Qt.replace("-","_")}`],style:G.style,styleSpec:_t,objectElementValidators:Lh,validateSpec:Kt}),be;case"raster-dem":return be=function(Fe){var er;let yr=(er=Fe.sourceName)!==null&&er!==void 0?er:"",Er=Fe.value,Zr=Fe.styleSpec,sn=Zr.source_raster_dem,xn=Fe.style,Ln=[],$n=Jl(Er);if(Er===void 0)return Ln;if($n!=="object")return Ln.push(new Lt("source_raster_dem",Er,`object expected, ${$n} found`)),Ln;let ki=bu(Er.encoding)==="custom",Aa=["redFactor","greenFactor","blueFactor","baseShift"],Xi=Fe.value.encoding?`"${Fe.value.encoding}"`:"Default";for(let ma in Er)!ki&&Aa.includes(ma)?Ln.push(new Lt(ma,Er[ma],`In "${yr}": "${ma}" is only valid when "encoding" is set to "custom". ${Xi} encoding found`)):sn[ma]?Ln=Ln.concat(Fe.validateSpec({key:ma,value:Er[ma],valueSpec:sn[ma],validateSpec:Fe.validateSpec,style:xn,styleSpec:Zr})):Ln.push(new Lt(ma,Er[ma],`unknown property "${ma}"`));return Ln}({sourceName:nt,value:D,style:G.style,styleSpec:_t,validateSpec:Kt}),be;case"geojson":if(be=Vc({key:nt,value:D,valueSpec:_t.source_geojson,style:Rt,styleSpec:_t,validateSpec:Kt,objectElementValidators:Lh}),D.cluster)for(let Fe in D.clusterProperties){let[er,yr]=D.clusterProperties[Fe],Er=typeof er=="string"?[er,["accumulated"],["get",Fe]]:er;be.push(...qh({key:`${nt}.${Fe}.map`,value:yr,expressionContext:"cluster-map"})),be.push(...qh({key:`${nt}.${Fe}.reduce`,value:Er,expressionContext:"cluster-reduce"}))}return be;case"video":return Vc({key:nt,value:D,valueSpec:_t.source_video,style:Rt,validateSpec:Kt,styleSpec:_t});case"image":return Vc({key:nt,value:D,valueSpec:_t.source_image,style:Rt,validateSpec:Kt,styleSpec:_t});case"canvas":return[new Lt(nt,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return th({key:`${nt}.type`,value:D.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Ru(G){let D=G.value,nt=G.styleSpec,_t=nt.light,Rt=G.style,Kt=[],Qt=Jl(D);if(D===void 0)return Kt;if(Qt!=="object")return Kt=Kt.concat([new Lt("light",D,`object expected, ${Qt} found`)]),Kt;for(let be in D){let Fe=be.match(/^(.*)-transition$/);Kt=Kt.concat(Fe&&_t[Fe[1]]&&_t[Fe[1]].transition?G.validateSpec({key:be,value:D[be],valueSpec:nt.transition,validateSpec:G.validateSpec,style:Rt,styleSpec:nt}):_t[be]?G.validateSpec({key:be,value:D[be],valueSpec:_t[be],validateSpec:G.validateSpec,style:Rt,styleSpec:nt}):[new Lt(be,D[be],`unknown property "${be}"`)])}return Kt}function eu(G){let D=G.value,nt=G.styleSpec,_t=nt.sky,Rt=G.style,Kt=Jl(D);if(D===void 0)return[];if(Kt!=="object")return[new Lt("sky",D,`object expected, ${Kt} found`)];let Qt=[];for(let be in D)Qt=Qt.concat(_t[be]?G.validateSpec({key:be,value:D[be],valueSpec:_t[be],style:Rt,styleSpec:nt}):[new Lt(be,D[be],`unknown property "${be}"`)]);return Qt}function xh(G){let D=G.value,nt=G.styleSpec,_t=nt.terrain,Rt=G.style,Kt=[],Qt=Jl(D);if(D===void 0)return Kt;if(Qt!=="object")return Kt=Kt.concat([new Lt("terrain",D,`object expected, ${Qt} found`)]),Kt;for(let be in D)Kt=Kt.concat(_t[be]?G.validateSpec({key:be,value:D[be],valueSpec:_t[be],validateSpec:G.validateSpec,style:Rt,styleSpec:nt}):[new Lt(be,D[be],`unknown property "${be}"`)]);return Kt}function df(G){let D=[],nt=G.value,_t=G.key;if(Array.isArray(nt)){let Rt=[],Kt=[];for(let Qt in nt)nt[Qt].id&&Rt.includes(nt[Qt].id)&&D.push(new Lt(_t,nt,`all the sprites' ids must be unique, but ${nt[Qt].id} is duplicated`)),Rt.push(nt[Qt].id),nt[Qt].url&&Kt.includes(nt[Qt].url)&&D.push(new Lt(_t,nt,`all the sprites' URLs must be unique, but ${nt[Qt].url} is duplicated`)),Kt.push(nt[Qt].url),D=D.concat(Vc({key:`${_t}[${Qt}]`,value:nt[Qt],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:G.validateSpec}));return D}return eh({key:_t,value:nt})}let _h={"*":()=>[],array:fd,boolean:function(G){let D=G.value,nt=G.key,_t=Jl(D);return _t!=="boolean"?[new Lt(nt,D,`boolean expected, ${_t} found`)]:[]},number:vu,color:function(G){let D=G.key,nt=G.value,_t=Jl(nt);return _t!=="string"?[new Lt(D,nt,`color expected, ${_t} found`)]:xr.parse(String(nt))?[]:[new Lt(D,nt,`color expected, "${nt}" found`)]},constants:vh,enum:th,filter:rf,function:bf,layer:Jf,object:Vc,source:yh,light:Ru,sky:eu,terrain:xh,projection:function(G){let D=G.value,nt=G.styleSpec,_t=nt.projection,Rt=G.style,Kt=Jl(D);if(D===void 0)return[];if(Kt!=="object")return[new Lt("projection",D,`object expected, ${Kt} found`)];let Qt=[];for(let be in D)Qt=Qt.concat(_t[be]?G.validateSpec({key:be,value:D[be],valueSpec:_t[be],style:Rt,styleSpec:nt}):[new Lt(be,D[be],`unknown property "${be}"`)]);return Qt},string:eh,formatted:function(G){return eh(G).length===0?[]:qh(G)},resolvedImage:function(G){return eh(G).length===0?[]:qh(G)},padding:function(G){let D=G.key,nt=G.value;if(Jl(nt)==="array"){if(nt.length<1||nt.length>4)return[new Lt(D,nt,`padding requires 1 to 4 values; ${nt.length} values found`)];let _t={type:"number"},Rt=[];for(let Kt=0;Kt<nt.length;Kt++)Rt=Rt.concat(G.validateSpec({key:`${D}[${Kt}]`,value:nt[Kt],validateSpec:G.validateSpec,valueSpec:_t}));return Rt}return vu({key:D,value:nt,valueSpec:{}})},variableAnchorOffsetCollection:function(G){let D=G.key,nt=G.value,_t=Jl(nt),Rt=G.styleSpec;if(_t!=="array"||nt.length<1||nt.length%2!=0)return[new Lt(D,nt,"variableAnchorOffsetCollection requires a non-empty array of even length")];let Kt=[];for(let Qt=0;Qt<nt.length;Qt+=2)Kt=Kt.concat(th({key:`${D}[${Qt}]`,value:nt[Qt],valueSpec:Rt.layout_symbol["text-anchor"]})),Kt=Kt.concat(fd({key:`${D}[${Qt+1}]`,value:nt[Qt+1],valueSpec:{length:2,value:"number"},validateSpec:G.validateSpec,style:G.style,styleSpec:Rt}));return Kt},sprite:df};function qf(G){let D=G.value,nt=G.valueSpec,_t=G.styleSpec;return G.validateSpec=qf,nt.expression&&Ef(bu(D))?bf(G):nt.expression&&Hh(Ch(D))?qh(G):nt.type&&_h[nt.type]?_h[nt.type](G):Vc(Mt({},G,{valueSpec:nt.type?_t[nt.type]:nt}))}function mr(G){let D=G.value,nt=G.key,_t=eh(G);return _t.length||(D.indexOf("{fontstack}")===-1&&_t.push(new Lt(nt,D,'"glyphs" url must include a "{fontstack}" token')),D.indexOf("{range}")===-1&&_t.push(new Lt(nt,D,'"glyphs" url must include a "{range}" token'))),_t}function Ur(G,D=ut){let nt=[];return nt=nt.concat(qf({key:"",value:G,valueSpec:D.$root,styleSpec:D,style:G,validateSpec:qf,objectElementValidators:{glyphs:mr,"*":()=>[]}})),G.constants&&(nt=nt.concat(vh({key:"constants",value:G.constants}))),cn(nt)}function _n(G){return function(D){return G(zr(Fr({},D),{validateSpec:qf}))}}function cn(G){return[].concat(G).sort((D,nt)=>D.line-nt.line)}function Wn(G){return function(...D){return cn(G.apply(this,D))}}Ur.source=Wn(_n(yh)),Ur.sprite=Wn(_n(df)),Ur.glyphs=Wn(_n(mr)),Ur.light=Wn(_n(Ru)),Ur.sky=Wn(_n(eu)),Ur.terrain=Wn(_n(xh)),Ur.layer=Wn(_n(Jf)),Ur.filter=Wn(_n(rf)),Ur.paintProperty=Wn(_n(zd)),Ur.layoutProperty=Wn(_n(gc));let hi=Ur,ea=hi.light,ga=hi.sky,Ra=hi.paintProperty,$a=hi.layoutProperty;function ua(G,D){let nt=!1;if(D&&D.length)for(let _t of D)G.fire(new Y(new Error(_t.message))),nt=!0;return nt}class za{constructor(D,nt,_t){let Rt=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;let Qt=new Int32Array(this.arrayBuffer);D=Qt[0],this.d=(nt=Qt[1])+2*(_t=Qt[2]);for(let Fe=0;Fe<this.d*this.d;Fe++){let er=Qt[3+Fe],yr=Qt[3+Fe+1];Rt.push(er===yr?null:Qt.subarray(er,yr))}let be=Qt[3+Rt.length+1];this.keys=Qt.subarray(Qt[3+Rt.length],be),this.bboxes=Qt.subarray(be),this.insert=this._insertReadonly}else{this.d=nt+2*_t;for(let Qt=0;Qt<this.d*this.d;Qt++)Rt.push([]);this.keys=[],this.bboxes=[]}this.n=nt,this.extent=D,this.padding=_t,this.scale=nt/D,this.uid=0;let Kt=_t/nt*D;this.min=-Kt,this.max=D+Kt}insert(D,nt,_t,Rt,Kt){this._forEachCell(nt,_t,Rt,Kt,this._insertCell,this.uid++,void 0,void 0),this.keys.push(D),this.bboxes.push(nt),this.bboxes.push(_t),this.bboxes.push(Rt),this.bboxes.push(Kt)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(D,nt,_t,Rt,Kt,Qt){this.cells[Kt].push(Qt)}query(D,nt,_t,Rt,Kt){let Qt=this.min,be=this.max;if(D<=Qt&&nt<=Qt&&be<=_t&&be<=Rt&&!Kt)return Array.prototype.slice.call(this.keys);{let Fe=[];return this._forEachCell(D,nt,_t,Rt,this._queryCell,Fe,{},Kt),Fe}}_queryCell(D,nt,_t,Rt,Kt,Qt,be,Fe){let er=this.cells[Kt];if(er!==null){let yr=this.keys,Er=this.bboxes;for(let Zr=0;Zr<er.length;Zr++){let sn=er[Zr];if(be[sn]===void 0){let xn=4*sn;(Fe?Fe(Er[xn+0],Er[xn+1],Er[xn+2],Er[xn+3]):D<=Er[xn+2]&&nt<=Er[xn+3]&&_t>=Er[xn+0]&&Rt>=Er[xn+1])?(be[sn]=!0,Qt.push(yr[sn])):be[sn]=!1}}}}_forEachCell(D,nt,_t,Rt,Kt,Qt,be,Fe){let er=this._convertToCellCoord(D),yr=this._convertToCellCoord(nt),Er=this._convertToCellCoord(_t),Zr=this._convertToCellCoord(Rt);for(let sn=er;sn<=Er;sn++)for(let xn=yr;xn<=Zr;xn++){let Ln=this.d*xn+sn;if((!Fe||Fe(this._convertFromCellCoord(sn),this._convertFromCellCoord(xn),this._convertFromCellCoord(sn+1),this._convertFromCellCoord(xn+1)))&&Kt.call(this,D,nt,_t,Rt,Ln,Qt,be,Fe))return}}_convertFromCellCoord(D){return(D-this.padding)/this.scale}_convertToCellCoord(D){return Math.max(0,Math.min(this.d-1,Math.floor(D*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let D=this.cells,nt=3+this.cells.length+1+1,_t=0;for(let Qt=0;Qt<this.cells.length;Qt++)_t+=this.cells[Qt].length;let Rt=new Int32Array(nt+_t+this.keys.length+this.bboxes.length);Rt[0]=this.extent,Rt[1]=this.n,Rt[2]=this.padding;let Kt=nt;for(let Qt=0;Qt<D.length;Qt++){let be=D[Qt];Rt[3+Qt]=Kt,Rt.set(be,Kt),Kt+=be.length}return Rt[3+D.length]=Kt,Rt.set(this.keys,Kt),Kt+=this.keys.length,Rt[3+D.length+1]=Kt,Rt.set(this.bboxes,Kt),Kt+=this.bboxes.length,Rt.buffer}static serialize(D,nt){let _t=D.toArrayBuffer();return nt&&nt.push(_t),{buffer:_t}}static deserialize(D){return new za(D.buffer)}}let wa={};function Ji(G,D,nt={}){if(wa[G])throw new Error(`${G} is already registered.`);Object.defineProperty(D,"_classRegistryKey",{value:G,writeable:!1}),wa[G]={klass:D,omit:nt.omit||[],shallow:nt.shallow||[]}}Ji("Object",Object),Ji("TransferableGridIndex",za),Ji("Color",xr),Ji("Error",Error),Ji("AJAXError",st),Ji("ResolvedImage",Pi),Ji("StylePropertyFunction",_u),Ji("StyleExpression",jc,{omit:["_evaluator"]}),Ji("ZoomDependentExpression",Sc),Ji("ZoomConstantExpression",Eh),Ji("CompoundExpression",lc,{omit:["_evaluate"]});for(let G in yf)yf[G]._classRegistryKey||Ji(`Expression_${G}`,yf[G]);function eo(G){return G&&typeof ArrayBuffer<"u"&&(G instanceof ArrayBuffer||G.constructor&&G.constructor.name==="ArrayBuffer")}function rs(G){return G.$name||G.constructor._classRegistryKey}function Zo(G){return!function(D){if(D===null||typeof D!="object")return!1;let nt=rs(D);return!(!nt||nt==="Object")}(G)&&(G==null||typeof G=="boolean"||typeof G=="number"||typeof G=="string"||G instanceof Boolean||G instanceof Number||G instanceof String||G instanceof Date||G instanceof RegExp||G instanceof Blob||G instanceof Error||eo(G)||V(G)||ArrayBuffer.isView(G)||G instanceof ImageData)}function os(G,D){if(Zo(G))return(eo(G)||V(G))&&D&&D.push(G),ArrayBuffer.isView(G)&&D&&D.push(G.buffer),G instanceof ImageData&&D&&D.push(G.data.buffer),G;if(Array.isArray(G)){let Kt=[];for(let Qt of G)Kt.push(os(Qt,D));return Kt}if(typeof G!="object")throw new Error("can't serialize object of type "+typeof G);let nt=rs(G);if(!nt)throw new Error(`can't serialize object of unregistered class ${G.constructor.name}`);if(!wa[nt])throw new Error(`${nt} is not registered.`);let{klass:_t}=wa[nt],Rt=_t.serialize?_t.serialize(G,D):{};if(_t.serialize){if(D&&Rt===D[D.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let Kt in G){if(!G.hasOwnProperty(Kt)||wa[nt].omit.indexOf(Kt)>=0)continue;let Qt=G[Kt];Rt[Kt]=wa[nt].shallow.indexOf(Kt)>=0?Qt:os(Qt,D)}G instanceof Error&&(Rt.message=G.message)}if(Rt.$name)throw new Error("$name property is reserved for worker serialization logic.");return nt!=="Object"&&(Rt.$name=nt),Rt}function fs(G){if(Zo(G))return G;if(Array.isArray(G))return G.map(fs);if(typeof G!="object")throw new Error("can't deserialize object of type "+typeof G);let D=rs(G)||"Object";if(!wa[D])throw new Error(`can't deserialize unregistered class ${D}`);let{klass:nt}=wa[D];if(!nt)throw new Error(`can't deserialize unregistered class ${D}`);if(nt.deserialize)return nt.deserialize(G);let _t=Object.create(nt.prototype);for(let Rt of Object.keys(G)){if(Rt==="$name")continue;let Kt=G[Rt];_t[Rt]=wa[D].shallow.indexOf(Rt)>=0?Kt:fs(Kt)}return _t}class no{constructor(){this.first=!0}update(D,nt){let _t=Math.floor(D);return this.first?(this.first=!1,this.lastIntegerZoom=_t,this.lastIntegerZoomTime=0,this.lastZoom=D,this.lastFloorZoom=_t,!0):(this.lastFloorZoom>_t?(this.lastIntegerZoom=_t+1,this.lastIntegerZoomTime=nt):this.lastFloorZoom<_t&&(this.lastIntegerZoom=_t,this.lastIntegerZoomTime=nt),D!==this.lastZoom&&(this.lastZoom=D,this.lastFloorZoom=_t,!0))}}let qa={"Latin-1 Supplement":G=>G>=128&&G<=255,"Hangul Jamo":G=>G>=4352&&G<=4607,Khmer:G=>G>=6016&&G<=6143,"General Punctuation":G=>G>=8192&&G<=8303,"Letterlike Symbols":G=>G>=8448&&G<=8527,"Number Forms":G=>G>=8528&&G<=8591,"Miscellaneous Technical":G=>G>=8960&&G<=9215,"Control Pictures":G=>G>=9216&&G<=9279,"Optical Character Recognition":G=>G>=9280&&G<=9311,"Enclosed Alphanumerics":G=>G>=9312&&G<=9471,"Geometric Shapes":G=>G>=9632&&G<=9727,"Miscellaneous Symbols":G=>G>=9728&&G<=9983,"Miscellaneous Symbols and Arrows":G=>G>=11008&&G<=11263,"Ideographic Description Characters":G=>G>=12272&&G<=12287,"CJK Symbols and Punctuation":G=>G>=12288&&G<=12351,Katakana:G=>G>=12448&&G<=12543,Kanbun:G=>G>=12688&&G<=12703,"CJK Strokes":G=>G>=12736&&G<=12783,"Enclosed CJK Letters and Months":G=>G>=12800&&G<=13055,"CJK Compatibility":G=>G>=13056&&G<=13311,"Yijing Hexagram Symbols":G=>G>=19904&&G<=19967,"Private Use Area":G=>G>=57344&&G<=63743,"Vertical Forms":G=>G>=65040&&G<=65055,"CJK Compatibility Forms":G=>G>=65072&&G<=65103,"Small Form Variants":G=>G>=65104&&G<=65135,"Halfwidth and Fullwidth Forms":G=>G>=65280&&G<=65519};function ds(G){for(let D of G)if(ml(D.charCodeAt(0)))return!0;return!1}function tl(G){for(let D of G)if(!Hl(D.charCodeAt(0)))return!1;return!0}function Pl(G){let D=G.map(nt=>{try{return new RegExp(`\\p{sc=${nt}}`,"u").source}catch{return null}}).filter(nt=>nt);return new RegExp(D.join("|"),"u")}let iu=Pl(["Arab","Dupl","Mong","Ougr","Syrc"]);function Hl(G){return!iu.test(String.fromCodePoint(G))}let au=Pl(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ml(G){return!(G!==746&&G!==747&&(G<4352||!(qa["CJK Compatibility Forms"](G)&&!(G>=65097&&G<=65103)||qa["CJK Compatibility"](G)||qa["CJK Strokes"](G)||!(!qa["CJK Symbols and Punctuation"](G)||G>=12296&&G<=12305||G>=12308&&G<=12319||G===12336)||qa["Enclosed CJK Letters and Months"](G)||qa["Ideographic Description Characters"](G)||qa.Kanbun(G)||qa.Katakana(G)&&G!==12540||!(!qa["Halfwidth and Fullwidth Forms"](G)||G===65288||G===65289||G===65293||G>=65306&&G<=65310||G===65339||G===65341||G===65343||G>=65371&&G<=65503||G===65507||G>=65512&&G<=65519)||!(!qa["Small Form Variants"](G)||G>=65112&&G<=65118||G>=65123&&G<=65126)||qa["Vertical Forms"](G)||qa["Yijing Hexagram Symbols"](G)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(G))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(G))||au.test(String.fromCodePoint(G)))))}function qu(G){return!(ml(G)||function(D){return!!(qa["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||qa["General Punctuation"](D)&&(D===8214||D===8224||D===8225||D===8240||D===8241||D===8251||D===8252||D===8258||D===8263||D===8264||D===8265||D===8273)||qa["Letterlike Symbols"](D)||qa["Number Forms"](D)||qa["Miscellaneous Technical"](D)&&(D>=8960&&D<=8967||D>=8972&&D<=8991||D>=8996&&D<=9e3||D===9003||D>=9085&&D<=9114||D>=9150&&D<=9165||D===9167||D>=9169&&D<=9179||D>=9186&&D<=9215)||qa["Control Pictures"](D)&&D!==9251||qa["Optical Character Recognition"](D)||qa["Enclosed Alphanumerics"](D)||qa["Geometric Shapes"](D)||qa["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||qa["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||qa["CJK Symbols and Punctuation"](D)||qa.Katakana(D)||qa["Private Use Area"](D)||qa["CJK Compatibility Forms"](D)||qa["Small Form Variants"](D)||qa["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)}(G))}let Lu=Pl(["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 uu(G){return Lu.test(String.fromCodePoint(G))}function zo(G,D){return!(!D&&uu(G)||G>=2304&&G<=3583||G>=3840&&G<=4255||qa.Khmer(G))}function Ms(G){for(let D of G)if(uu(D.charCodeAt(0)))return!0;return!1}let $l=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(G){this.pluginStatus=G.pluginStatus,this.pluginURL=G.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(G){this.applyArabicShaping=G.applyArabicShaping,this.processBidirectionalText=G.processBidirectionalText,this.processStyledBidirectionalText=G.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Fl{constructor(D,nt){this.zoom=D,nt?(this.now=nt.now,this.fadeDuration=nt.fadeDuration,this.zoomHistory=nt.zoomHistory,this.transition=nt.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new no,this.transition={})}isSupportedScript(D){return function(nt,_t){for(let Rt of nt)if(!zo(Rt.charCodeAt(0),_t))return!1;return!0}(D,$l.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let D=this.zoom,nt=D-Math.floor(D),_t=this.crossFadingFactor();return D>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:nt+(1-nt)*_t}:{fromScale:.5,toScale:1,t:1-(1-_t)*nt}}}class vc{constructor(D,nt){this.property=D,this.value=nt,this.expression=function(_t,Rt){if(Ef(_t))return new _u(_t,Rt);if(Hh(_t)){let Kt=Uc(_t,Rt);if(Kt.result==="error")throw new Error(Kt.value.map(Qt=>`${Qt.key}: ${Qt.message}`).join(", "));return Kt.value}{let Kt=_t;return Rt.type==="color"&&typeof _t=="string"?Kt=xr.parse(_t):Rt.type!=="padding"||typeof _t!="number"&&!Array.isArray(_t)?Rt.type==="variableAnchorOffsetCollection"&&Array.isArray(_t)&&(Kt=xi.parse(_t)):Kt=Mn.parse(_t),{kind:"constant",evaluate:()=>Kt}}}(nt===void 0?D.specification.default:nt,D.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(D,nt,_t){return this.property.possiblyEvaluate(this,D,nt,_t)}}class Hc{constructor(D){this.property=D,this.value=new vc(D,void 0)}transitioned(D,nt){return new Ph(this.property,this.value,nt,M({},D.transition,this.transition),D.now)}untransitioned(){return new Ph(this.property,this.value,null,{},0)}}class Pc{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitionablePropertyValues)}getValue(D){return p(this._values[D].value.value)}setValue(D,nt){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new Hc(this._values[D].property)),this._values[D].value=new vc(this._values[D].property,nt===null?void 0:p(nt))}getTransition(D){return p(this._values[D].transition)}setTransition(D,nt){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new Hc(this._values[D].property)),this._values[D].transition=p(nt)||void 0}serialize(){let D={};for(let nt of Object.keys(this._values)){let _t=this.getValue(nt);_t!==void 0&&(D[nt]=_t);let Rt=this.getTransition(nt);Rt!==void 0&&(D[`${nt}-transition`]=Rt)}return D}transitioned(D,nt){let _t=new Wc(this._properties);for(let Rt of Object.keys(this._values))_t._values[Rt]=this._values[Rt].transitioned(D,nt._values[Rt]);return _t}untransitioned(){let D=new Wc(this._properties);for(let nt of Object.keys(this._values))D._values[nt]=this._values[nt].untransitioned();return D}}class Ph{constructor(D,nt,_t,Rt,Kt){this.property=D,this.value=nt,this.begin=Kt+Rt.delay||0,this.end=this.begin+Rt.duration||0,D.specification.transition&&(Rt.delay||Rt.duration)&&(this.prior=_t)}possiblyEvaluate(D,nt,_t){let Rt=D.now||0,Kt=this.value.possiblyEvaluate(D,nt,_t),Qt=this.prior;if(Qt){if(Rt>this.end)return this.prior=null,Kt;if(this.value.isDataDriven())return this.prior=null,Kt;if(Rt<this.begin)return Qt.possiblyEvaluate(D,nt,_t);{let be=(Rt-this.begin)/(this.end-this.begin);return this.property.interpolate(Qt.possiblyEvaluate(D,nt,_t),Kt,function(Fe){if(Fe<=0)return 0;if(Fe>=1)return 1;let er=Fe*Fe,yr=er*Fe;return 4*(Fe<.5?yr:3*(Fe-er)+yr-.75)}(be))}}return Kt}}class Wc{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitioningPropertyValues)}possiblyEvaluate(D,nt,_t){let Rt=new Ih(this._properties);for(let Kt of Object.keys(this._values))Rt._values[Kt]=this._values[Kt].possiblyEvaluate(D,nt,_t);return Rt}hasTransition(){for(let D of Object.keys(this._values))if(this._values[D].prior)return!0;return!1}}class zh{constructor(D){this._properties=D,this._values=Object.create(D.defaultPropertyValues)}hasValue(D){return this._values[D].value!==void 0}getValue(D){return p(this._values[D].value)}setValue(D,nt){this._values[D]=new vc(this._values[D].property,nt===null?void 0:p(nt))}serialize(){let D={};for(let nt of Object.keys(this._values)){let _t=this.getValue(nt);_t!==void 0&&(D[nt]=_t)}return D}possiblyEvaluate(D,nt,_t){let Rt=new Ih(this._properties);for(let Kt of Object.keys(this._values))Rt._values[Kt]=this._values[Kt].possiblyEvaluate(D,nt,_t);return Rt}}class Iu{constructor(D,nt,_t){this.property=D,this.value=nt,this.parameters=_t}isConstant(){return this.value.kind==="constant"}constantOr(D){return this.value.kind==="constant"?this.value.value:D}evaluate(D,nt,_t,Rt){return this.property.evaluate(this.value,this.parameters,D,nt,_t,Rt)}}class Ih{constructor(D){this._properties=D,this._values=Object.create(D.defaultPossiblyEvaluatedValues)}get(D){return this._values[D]}}class es{constructor(D){this.specification=D}possiblyEvaluate(D,nt){if(D.isDataDriven())throw new Error("Value should not be data driven");return D.expression.evaluate(nt)}interpolate(D,nt,_t){let Rt=Do[this.specification.type];return Rt?Rt(D,nt,_t):D}}class zs{constructor(D,nt){this.specification=D,this.overrides=nt}possiblyEvaluate(D,nt,_t,Rt){return new Iu(this,D.expression.kind==="constant"||D.expression.kind==="camera"?{kind:"constant",value:D.expression.evaluate(nt,null,{},_t,Rt)}:D.expression,nt)}interpolate(D,nt,_t){if(D.value.kind!=="constant"||nt.value.kind!=="constant")return D;if(D.value.value===void 0||nt.value.value===void 0)return new Iu(this,{kind:"constant",value:void 0},D.parameters);let Rt=Do[this.specification.type];if(Rt){let Kt=Rt(D.value.value,nt.value.value,_t);return new Iu(this,{kind:"constant",value:Kt},D.parameters)}return D}evaluate(D,nt,_t,Rt,Kt,Qt){return D.kind==="constant"?D.value:D.evaluate(nt,_t,Rt,Kt,Qt)}}class qc extends zs{possiblyEvaluate(D,nt,_t,Rt){if(D.value===void 0)return new Iu(this,{kind:"constant",value:void 0},nt);if(D.expression.kind==="constant"){let Kt=D.expression.evaluate(nt,null,{},_t,Rt),Qt=D.property.specification.type==="resolvedImage"&&typeof Kt!="string"?Kt.name:Kt,be=this._calculate(Qt,Qt,Qt,nt);return new Iu(this,{kind:"constant",value:be},nt)}if(D.expression.kind==="camera"){let Kt=this._calculate(D.expression.evaluate({zoom:nt.zoom-1}),D.expression.evaluate({zoom:nt.zoom}),D.expression.evaluate({zoom:nt.zoom+1}),nt);return new Iu(this,{kind:"constant",value:Kt},nt)}return new Iu(this,D.expression,nt)}evaluate(D,nt,_t,Rt,Kt,Qt){if(D.kind==="source"){let be=D.evaluate(nt,_t,Rt,Kt,Qt);return this._calculate(be,be,be,nt)}return D.kind==="composite"?this._calculate(D.evaluate({zoom:Math.floor(nt.zoom)-1},_t,Rt),D.evaluate({zoom:Math.floor(nt.zoom)},_t,Rt),D.evaluate({zoom:Math.floor(nt.zoom)+1},_t,Rt),nt):D.value}_calculate(D,nt,_t,Rt){return Rt.zoom>Rt.zoomHistory.lastIntegerZoom?{from:D,to:nt}:{from:_t,to:nt}}interpolate(D){return D}}class Zu{constructor(D){this.specification=D}possiblyEvaluate(D,nt,_t,Rt){if(D.value!==void 0){if(D.expression.kind==="constant"){let Kt=D.expression.evaluate(nt,null,{},_t,Rt);return this._calculate(Kt,Kt,Kt,nt)}return this._calculate(D.expression.evaluate(new Fl(Math.floor(nt.zoom-1),nt)),D.expression.evaluate(new Fl(Math.floor(nt.zoom),nt)),D.expression.evaluate(new Fl(Math.floor(nt.zoom+1),nt)),nt)}}_calculate(D,nt,_t,Rt){return Rt.zoom>Rt.zoomHistory.lastIntegerZoom?{from:D,to:nt}:{from:_t,to:nt}}interpolate(D){return D}}class Zf{constructor(D){this.specification=D}possiblyEvaluate(D,nt,_t,Rt){return!!D.expression.evaluate(nt,null,{},_t,Rt)}interpolate(){return!1}}class qt{constructor(D){this.properties=D,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let nt in D){let _t=D[nt];_t.specification.overridable&&this.overridableProperties.push(nt);let Rt=this.defaultPropertyValues[nt]=new vc(_t,void 0),Kt=this.defaultTransitionablePropertyValues[nt]=new Hc(_t);this.defaultTransitioningPropertyValues[nt]=Kt.untransitioned(),this.defaultPossiblyEvaluatedValues[nt]=Rt.possiblyEvaluate({})}}}Ji("DataDrivenProperty",zs),Ji("DataConstantProperty",es),Ji("CrossFadedDataDrivenProperty",qc),Ji("CrossFadedProperty",Zu),Ji("ColorRampProperty",Zf);let I="-transition";class ht extends ft{constructor(D,nt){if(super(),this.id=D.id,this.type=D.type,this._featureFilter={filter:()=>!0,needGeometry:!1},D.type!=="custom"&&(this.metadata=D.metadata,this.minzoom=D.minzoom,this.maxzoom=D.maxzoom,D.type!=="background"&&(this.source=D.source,this.sourceLayer=D["source-layer"],this.filter=D.filter),nt.layout&&(this._unevaluatedLayout=new zh(nt.layout)),nt.paint)){this._transitionablePaint=new Pc(nt.paint);for(let _t in D.paint)this.setPaintProperty(_t,D.paint[_t],{validate:!1});for(let _t in D.layout)this.setLayoutProperty(_t,D.layout[_t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ih(nt.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(D){return D==="visibility"?this.visibility:this._unevaluatedLayout.getValue(D)}setLayoutProperty(D,nt,_t={}){nt!=null&&this._validate($a,`layers.${this.id}.layout.${D}`,D,nt,_t)||(D!=="visibility"?this._unevaluatedLayout.setValue(D,nt):this.visibility=nt)}getPaintProperty(D){return D.endsWith(I)?this._transitionablePaint.getTransition(D.slice(0,-11)):this._transitionablePaint.getValue(D)}setPaintProperty(D,nt,_t={}){if(nt!=null&&this._validate(Ra,`layers.${this.id}.paint.${D}`,D,nt,_t))return!1;if(D.endsWith(I))return this._transitionablePaint.setTransition(D.slice(0,-11),nt||void 0),!1;{let Rt=this._transitionablePaint._values[D],Kt=Rt.property.specification["property-type"]==="cross-faded-data-driven",Qt=Rt.value.isDataDriven(),be=Rt.value;this._transitionablePaint.setValue(D,nt),this._handleSpecialPaintPropertyUpdate(D);let Fe=this._transitionablePaint._values[D].value;return Fe.isDataDriven()||Qt||Kt||this._handleOverridablePaintPropertyUpdate(D,be,Fe)}}_handleSpecialPaintPropertyUpdate(D){}_handleOverridablePaintPropertyUpdate(D,nt,_t){return!1}isHidden(D){return!!(this.minzoom&&D<this.minzoom)||!!(this.maxzoom&&D>=this.maxzoom)||this.visibility==="none"}updateTransitions(D){this._transitioningPaint=this._transitionablePaint.transitioned(D,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(D,nt){D.getCrossfadeParameters&&(this._crossfadeParameters=D.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(D,void 0,nt)),this.paint=this._transitioningPaint.possiblyEvaluate(D,void 0,nt)}serialize(){let D={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&&(D.layout=D.layout||{},D.layout.visibility=this.visibility),h(D,(nt,_t)=>!(nt===void 0||_t==="layout"&&!Object.keys(nt).length||_t==="paint"&&!Object.keys(nt).length))}_validate(D,nt,_t,Rt,Kt={}){return(!Kt||Kt.validate!==!1)&&ua(this,D.call(hi,{key:nt,layerType:this.type,objectKey:_t,value:Rt,styleSpec:ut,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let D in this.paint._values){let nt=this.paint.get(D);if(nt instanceof Iu&&uc(nt.property.specification)&&(nt.value.kind==="source"||nt.value.kind==="composite")&&nt.value.isStateDependent)return!0}return!1}}let Et={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class It{constructor(D,nt){this._structArray=D,this._pos1=nt*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Vt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(D,nt){return D._trim(),nt&&(D.isTransferred=!0,nt.push(D.arrayBuffer)),{length:D.length,arrayBuffer:D.arrayBuffer}}static deserialize(D){let nt=Object.create(this.prototype);return nt.arrayBuffer=D.arrayBuffer,nt.length=D.length,nt.capacity=D.arrayBuffer.byteLength/nt.bytesPerElement,nt._refreshViews(),nt}_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(D){this.reserve(D),this.length=D}reserve(D){if(D>this.capacity){this.capacity=Math.max(D,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let nt=this.uint8;this._refreshViews(),nt&&this.uint8.set(nt)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ke(G,D=1){let nt=0,_t=0;return{members:G.map(Rt=>{let Kt=Et[Rt.type].BYTES_PER_ELEMENT,Qt=nt=Oe(nt,Math.max(D,Kt)),be=Rt.components||1;return _t=Math.max(_t,Kt),nt+=Kt*be,{name:Rt.name,type:Rt.type,components:be,offset:Qt}}),size:Oe(nt,Math.max(_t,D)),alignment:D}}function Oe(G,D){return Math.ceil(G/D)*D}class Ke extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,nt){let _t=this.length;return this.resize(_t+1),this.emplace(_t,D,nt)}emplace(D,nt,_t){let Rt=2*D;return this.int16[Rt+0]=nt,this.int16[Rt+1]=_t,D}}Ke.prototype.bytesPerElement=4,Ji("StructArrayLayout2i4",Ke);class gr extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,nt,_t){let Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,D,nt,_t)}emplace(D,nt,_t,Rt){let Kt=3*D;return this.int16[Kt+0]=nt,this.int16[Kt+1]=_t,this.int16[Kt+2]=Rt,D}}gr.prototype.bytesPerElement=6,Ji("StructArrayLayout3i6",gr);class Or extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,nt,_t,Rt){let Kt=this.length;return this.resize(Kt+1),this.emplace(Kt,D,nt,_t,Rt)}emplace(D,nt,_t,Rt,Kt){let Qt=4*D;return this.int16[Qt+0]=nt,this.int16[Qt+1]=_t,this.int16[Qt+2]=Rt,this.int16[Qt+3]=Kt,D}}Or.prototype.bytesPerElement=8,Ji("StructArrayLayout4i8",Or);class Dr extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,nt,_t,Rt,Kt,Qt){let be=this.length;return this.resize(be+1),this.emplace(be,D,nt,_t,Rt,Kt,Qt)}emplace(D,nt,_t,Rt,Kt,Qt,be){let Fe=6*D;return this.int16[Fe+0]=nt,this.int16[Fe+1]=_t,this.int16[Fe+2]=Rt,this.int16[Fe+3]=Kt,this.int16[Fe+4]=Qt,this.int16[Fe+5]=be,D}}Dr.prototype.bytesPerElement=12,Ji("StructArrayLayout2i4i12",Dr);class ln extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,nt,_t,Rt,Kt,Qt){let be=this.length;return this.resize(be+1),this.emplace(be,D,nt,_t,Rt,Kt,Qt)}emplace(D,nt,_t,Rt,Kt,Qt,be){let Fe=4*D,er=8*D;return this.int16[Fe+0]=nt,this.int16[Fe+1]=_t,this.uint8[er+4]=Rt,this.uint8[er+5]=Kt,this.uint8[er+6]=Qt,this.uint8[er+7]=be,D}}ln.prototype.bytesPerElement=8,Ji("StructArrayLayout2i4ub8",ln);class Sn extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,nt){let _t=this.length;return this.resize(_t+1),this.emplace(_t,D,nt)}emplace(D,nt,_t){let Rt=2*D;return this.float32[Rt+0]=nt,this.float32[Rt+1]=_t,D}}Sn.prototype.bytesPerElement=8,Ji("StructArrayLayout2f8",Sn);class Xt extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr){let Er=this.length;return this.resize(Er+1),this.emplace(Er,D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr)}emplace(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er){let Zr=10*D;return this.uint16[Zr+0]=nt,this.uint16[Zr+1]=_t,this.uint16[Zr+2]=Rt,this.uint16[Zr+3]=Kt,this.uint16[Zr+4]=Qt,this.uint16[Zr+5]=be,this.uint16[Zr+6]=Fe,this.uint16[Zr+7]=er,this.uint16[Zr+8]=yr,this.uint16[Zr+9]=Er,D}}Xt.prototype.bytesPerElement=20,Ji("StructArrayLayout10ui20",Xt);class ae extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr){let sn=this.length;return this.resize(sn+1),this.emplace(sn,D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr)}emplace(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr,sn){let xn=12*D;return this.int16[xn+0]=nt,this.int16[xn+1]=_t,this.int16[xn+2]=Rt,this.int16[xn+3]=Kt,this.uint16[xn+4]=Qt,this.uint16[xn+5]=be,this.uint16[xn+6]=Fe,this.uint16[xn+7]=er,this.int16[xn+8]=yr,this.int16[xn+9]=Er,this.int16[xn+10]=Zr,this.int16[xn+11]=sn,D}}ae.prototype.bytesPerElement=24,Ji("StructArrayLayout4i4ui4i24",ae);class xe extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,nt,_t){let Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,D,nt,_t)}emplace(D,nt,_t,Rt){let Kt=3*D;return this.float32[Kt+0]=nt,this.float32[Kt+1]=_t,this.float32[Kt+2]=Rt,D}}xe.prototype.bytesPerElement=12,Ji("StructArrayLayout3f12",xe);class Ae extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(D){let nt=this.length;return this.resize(nt+1),this.emplace(nt,D)}emplace(D,nt){return this.uint32[1*D+0]=nt,D}}Ae.prototype.bytesPerElement=4,Ji("StructArrayLayout1ul4",Ae);class je extends Vt{_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(D,nt,_t,Rt,Kt,Qt,be,Fe,er){let yr=this.length;return this.resize(yr+1),this.emplace(yr,D,nt,_t,Rt,Kt,Qt,be,Fe,er)}emplace(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr){let Er=10*D,Zr=5*D;return this.int16[Er+0]=nt,this.int16[Er+1]=_t,this.int16[Er+2]=Rt,this.int16[Er+3]=Kt,this.int16[Er+4]=Qt,this.int16[Er+5]=be,this.uint32[Zr+3]=Fe,this.uint16[Er+8]=er,this.uint16[Er+9]=yr,D}}je.prototype.bytesPerElement=20,Ji("StructArrayLayout6i1ul2ui20",je);class Ie extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,nt,_t,Rt,Kt,Qt){let be=this.length;return this.resize(be+1),this.emplace(be,D,nt,_t,Rt,Kt,Qt)}emplace(D,nt,_t,Rt,Kt,Qt,be){let Fe=6*D;return this.int16[Fe+0]=nt,this.int16[Fe+1]=_t,this.int16[Fe+2]=Rt,this.int16[Fe+3]=Kt,this.int16[Fe+4]=Qt,this.int16[Fe+5]=be,D}}Ie.prototype.bytesPerElement=12,Ji("StructArrayLayout2i2i2i12",Ie);class Ze extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,nt,_t,Rt,Kt){let Qt=this.length;return this.resize(Qt+1),this.emplace(Qt,D,nt,_t,Rt,Kt)}emplace(D,nt,_t,Rt,Kt,Qt){let be=4*D,Fe=8*D;return this.float32[be+0]=nt,this.float32[be+1]=_t,this.float32[be+2]=Rt,this.int16[Fe+6]=Kt,this.int16[Fe+7]=Qt,D}}Ze.prototype.bytesPerElement=16,Ji("StructArrayLayout2f1f2i16",Ze);class wr extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,nt,_t,Rt,Kt,Qt){let be=this.length;return this.resize(be+1),this.emplace(be,D,nt,_t,Rt,Kt,Qt)}emplace(D,nt,_t,Rt,Kt,Qt,be){let Fe=16*D,er=4*D,yr=8*D;return this.uint8[Fe+0]=nt,this.uint8[Fe+1]=_t,this.float32[er+1]=Rt,this.float32[er+2]=Kt,this.int16[yr+6]=Qt,this.int16[yr+7]=be,D}}wr.prototype.bytesPerElement=16,Ji("StructArrayLayout2ub2f2i16",wr);class Ir extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,nt,_t){let Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,D,nt,_t)}emplace(D,nt,_t,Rt){let Kt=3*D;return this.uint16[Kt+0]=nt,this.uint16[Kt+1]=_t,this.uint16[Kt+2]=Rt,D}}Ir.prototype.bytesPerElement=6,Ji("StructArrayLayout3ui6",Ir);class Nr extends Vt{_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(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr,sn,xn,Ln,$n,ki){let Aa=this.length;return this.resize(Aa+1),this.emplace(Aa,D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr,sn,xn,Ln,$n,ki)}emplace(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr,sn,xn,Ln,$n,ki,Aa){let Xi=24*D,ma=12*D,Ga=48*D;return this.int16[Xi+0]=nt,this.int16[Xi+1]=_t,this.uint16[Xi+2]=Rt,this.uint16[Xi+3]=Kt,this.uint32[ma+2]=Qt,this.uint32[ma+3]=be,this.uint32[ma+4]=Fe,this.uint16[Xi+10]=er,this.uint16[Xi+11]=yr,this.uint16[Xi+12]=Er,this.float32[ma+7]=Zr,this.float32[ma+8]=sn,this.uint8[Ga+36]=xn,this.uint8[Ga+37]=Ln,this.uint8[Ga+38]=$n,this.uint32[ma+10]=ki,this.int16[Xi+22]=Aa,D}}Nr.prototype.bytesPerElement=48,Ji("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Nr);class tn extends Vt{_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(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr,sn,xn,Ln,$n,ki,Aa,Xi,ma,Ga,To,As,Sl,ys,cs,Ys,Bs){let Is=this.length;return this.resize(Is+1),this.emplace(Is,D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr,sn,xn,Ln,$n,ki,Aa,Xi,ma,Ga,To,As,Sl,ys,cs,Ys,Bs)}emplace(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr,sn,xn,Ln,$n,ki,Aa,Xi,ma,Ga,To,As,Sl,ys,cs,Ys,Bs,Is){let oo=32*D,nl=16*D;return this.int16[oo+0]=nt,this.int16[oo+1]=_t,this.int16[oo+2]=Rt,this.int16[oo+3]=Kt,this.int16[oo+4]=Qt,this.int16[oo+5]=be,this.int16[oo+6]=Fe,this.int16[oo+7]=er,this.uint16[oo+8]=yr,this.uint16[oo+9]=Er,this.uint16[oo+10]=Zr,this.uint16[oo+11]=sn,this.uint16[oo+12]=xn,this.uint16[oo+13]=Ln,this.uint16[oo+14]=$n,this.uint16[oo+15]=ki,this.uint16[oo+16]=Aa,this.uint16[oo+17]=Xi,this.uint16[oo+18]=ma,this.uint16[oo+19]=Ga,this.uint16[oo+20]=To,this.uint16[oo+21]=As,this.uint16[oo+22]=Sl,this.uint32[nl+12]=ys,this.float32[nl+13]=cs,this.float32[nl+14]=Ys,this.uint16[oo+30]=Bs,this.uint16[oo+31]=Is,D}}tn.prototype.bytesPerElement=64,Ji("StructArrayLayout8i15ui1ul2f2ui64",tn);class mn extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D){let nt=this.length;return this.resize(nt+1),this.emplace(nt,D)}emplace(D,nt){return this.float32[1*D+0]=nt,D}}mn.prototype.bytesPerElement=4,Ji("StructArrayLayout1f4",mn);class zn extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,nt,_t){let Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,D,nt,_t)}emplace(D,nt,_t,Rt){let Kt=3*D;return this.uint16[6*D+0]=nt,this.float32[Kt+1]=_t,this.float32[Kt+2]=Rt,D}}zn.prototype.bytesPerElement=12,Ji("StructArrayLayout1ui2f12",zn);class Bn extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,nt,_t){let Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,D,nt,_t)}emplace(D,nt,_t,Rt){let Kt=4*D;return this.uint32[2*D+0]=nt,this.uint16[Kt+2]=_t,this.uint16[Kt+3]=Rt,D}}Bn.prototype.bytesPerElement=8,Ji("StructArrayLayout1ul2ui8",Bn);class ri extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,nt){let _t=this.length;return this.resize(_t+1),this.emplace(_t,D,nt)}emplace(D,nt,_t){let Rt=2*D;return this.uint16[Rt+0]=nt,this.uint16[Rt+1]=_t,D}}ri.prototype.bytesPerElement=4,Ji("StructArrayLayout2ui4",ri);class Fi extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D){let nt=this.length;return this.resize(nt+1),this.emplace(nt,D)}emplace(D,nt){return this.uint16[1*D+0]=nt,D}}Fi.prototype.bytesPerElement=2,Ji("StructArrayLayout1ui2",Fi);class da extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,nt,_t,Rt){let Kt=this.length;return this.resize(Kt+1),this.emplace(Kt,D,nt,_t,Rt)}emplace(D,nt,_t,Rt,Kt){let Qt=4*D;return this.float32[Qt+0]=nt,this.float32[Qt+1]=_t,this.float32[Qt+2]=Rt,this.float32[Qt+3]=Kt,D}}da.prototype.bytesPerElement=16,Ji("StructArrayLayout4f16",da);class ha extends It{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)}}ha.prototype.size=20;class ka extends je{get(D){return new ha(this,D)}}Ji("CollisionBoxArray",ka);class io extends It{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(D){this._structArray.uint8[this._pos1+37]=D}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(D){this._structArray.uint8[this._pos1+38]=D}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(D){this._structArray.uint32[this._pos4+10]=D}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}io.prototype.size=48;class Ro extends Nr{get(D){return new io(this,D)}}Ji("PlacedSymbolArray",Ro);class Mo extends It{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(D){this._structArray.uint32[this._pos4+12]=D}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]}}Mo.prototype.size=64;class hs extends tn{get(D){return new Mo(this,D)}}Ji("SymbolInstanceArray",hs);class hl extends mn{getoffsetX(D){return this.float32[1*D+0]}}Ji("GlyphOffsetArray",hl);class vl extends gr{getx(D){return this.int16[3*D+0]}gety(D){return this.int16[3*D+1]}gettileUnitDistanceFromAnchor(D){return this.int16[3*D+2]}}Ji("SymbolLineVertexArray",vl);class Os extends It{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]}}Os.prototype.size=12;class bl extends zn{get(D){return new Os(this,D)}}Ji("TextAnchorOffsetArray",bl);class Su extends It{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]}}Su.prototype.size=8;class mu extends Bn{get(D){return new Su(this,D)}}Ji("FeatureIndexArray",mu);class Ws extends Ke{}class qs extends Ke{}class Yu extends Ke{}class dc extends Dr{}class Zc extends ln{}class At extends Sn{}class jt extends Xt{}class ue extends ae{}class Me extends xe{}class Le extends Ae{}class Be extends Ie{}class sr extends wr{}class ir extends Ir{}class Mr extends ri{}let en=ke([{name:"a_pos",components:2,type:"Int16"}],4),{members:Xr}=en;class vn{constructor(D=[]){this.segments=D}prepareSegment(D,nt,_t,Rt){let Kt=this.segments[this.segments.length-1];return D>vn.MAX_VERTEX_ARRAY_LENGTH&&w(`Max vertices per segment is ${vn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${D}`),(!Kt||Kt.vertexLength+D>vn.MAX_VERTEX_ARRAY_LENGTH||Kt.sortKey!==Rt)&&(Kt={vertexOffset:nt.length,primitiveOffset:_t.length,vertexLength:0,primitiveLength:0},Rt!==void 0&&(Kt.sortKey=Rt),this.segments.push(Kt)),Kt}get(){return this.segments}destroy(){for(let D of this.segments)for(let nt in D.vaos)D.vaos[nt].destroy()}static simpleSegment(D,nt,_t,Rt){return new vn([{vertexOffset:D,primitiveOffset:nt,vertexLength:_t,primitiveLength:Rt,vaos:{},sortKey:0}])}}function In(G,D){return 256*(G=_(Math.floor(G),0,255))+_(Math.floor(D),0,255)}vn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ji("SegmentVector",vn);let On=ke([{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 Bi={exports:{}},Un={exports:{}};Un.exports=function(G,D){var nt,_t,Rt,Kt,Qt,be,Fe,er;for(_t=G.length-(nt=3&G.length),Rt=D,Qt=3432918353,be=461845907,er=0;er<_t;)Fe=255&G.charCodeAt(er)|(255&G.charCodeAt(++er))<<8|(255&G.charCodeAt(++er))<<16|(255&G.charCodeAt(++er))<<24,++er,Rt=27492+(65535&(Kt=5*(65535&(Rt=(Rt^=Fe=(65535&(Fe=(Fe=(65535&Fe)*Qt+(((Fe>>>16)*Qt&65535)<<16)&4294967295)<<15|Fe>>>17))*be+(((Fe>>>16)*be&65535)<<16)&4294967295)<<13|Rt>>>19))+((5*(Rt>>>16)&65535)<<16)&4294967295))+((58964+(Kt>>>16)&65535)<<16);switch(Fe=0,nt){case 3:Fe^=(255&G.charCodeAt(er+2))<<16;case 2:Fe^=(255&G.charCodeAt(er+1))<<8;case 1:Rt^=Fe=(65535&(Fe=(Fe=(65535&(Fe^=255&G.charCodeAt(er)))*Qt+(((Fe>>>16)*Qt&65535)<<16)&4294967295)<<15|Fe>>>17))*be+(((Fe>>>16)*be&65535)<<16)&4294967295}return Rt^=G.length,Rt=2246822507*(65535&(Rt^=Rt>>>16))+((2246822507*(Rt>>>16)&65535)<<16)&4294967295,Rt=3266489909*(65535&(Rt^=Rt>>>13))+((3266489909*(Rt>>>16)&65535)<<16)&4294967295,(Rt^=Rt>>>16)>>>0};var mi=Un.exports,Ti={exports:{}};Ti.exports=function(G,D){for(var nt,_t=G.length,Rt=D^_t,Kt=0;_t>=4;)nt=1540483477*(65535&(nt=255&G.charCodeAt(Kt)|(255&G.charCodeAt(++Kt))<<8|(255&G.charCodeAt(++Kt))<<16|(255&G.charCodeAt(++Kt))<<24))+((1540483477*(nt>>>16)&65535)<<16),Rt=1540483477*(65535&Rt)+((1540483477*(Rt>>>16)&65535)<<16)^(nt=1540483477*(65535&(nt^=nt>>>24))+((1540483477*(nt>>>16)&65535)<<16)),_t-=4,++Kt;switch(_t){case 3:Rt^=(255&G.charCodeAt(Kt+2))<<16;case 2:Rt^=(255&G.charCodeAt(Kt+1))<<8;case 1:Rt=1540483477*(65535&(Rt^=255&G.charCodeAt(Kt)))+((1540483477*(Rt>>>16)&65535)<<16)}return Rt=1540483477*(65535&(Rt^=Rt>>>13))+((1540483477*(Rt>>>16)&65535)<<16),(Rt^=Rt>>>15)>>>0};var Ii=mi,Wi=Ti.exports;Bi.exports=Ii,Bi.exports.murmur3=Ii,Bi.exports.murmur2=Wi;var Yn=r(Bi.exports);class ja{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,nt,_t,Rt){this.ids.push(Ha(D)),this.positions.push(nt,_t,Rt)}getPositions(D){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let nt=Ha(D),_t=0,Rt=this.ids.length-1;for(;_t<Rt;){let Qt=_t+Rt>>1;this.ids[Qt]>=nt?Rt=Qt:_t=Qt+1}let Kt=[];for(;this.ids[_t]===nt;)Kt.push({index:this.positions[3*_t],start:this.positions[3*_t+1],end:this.positions[3*_t+2]}),_t++;return Kt}static serialize(D,nt){let _t=new Float64Array(D.ids),Rt=new Uint32Array(D.positions);return ro(_t,Rt,0,_t.length-1),nt&&nt.push(_t.buffer,Rt.buffer),{ids:_t,positions:Rt}}static deserialize(D){let nt=new ja;return nt.ids=D.ids,nt.positions=D.positions,nt.indexed=!0,nt}}function Ha(G){let D=+G;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:Yn(String(G))}function ro(G,D,nt,_t){for(;nt<_t;){let Rt=G[nt+_t>>1],Kt=nt-1,Qt=_t+1;for(;;){do Kt++;while(G[Kt]<Rt);do Qt--;while(G[Qt]>Rt);if(Kt>=Qt)break;Lo(G,Kt,Qt),Lo(D,3*Kt,3*Qt),Lo(D,3*Kt+1,3*Qt+1),Lo(D,3*Kt+2,3*Qt+2)}Qt-nt<_t-Qt?(ro(G,D,nt,Qt),nt=Qt+1):(ro(G,D,Qt+1,_t),_t=Qt)}}function Lo(G,D,nt){let _t=G[D];G[D]=G[nt],G[nt]=_t}Ji("FeaturePositionMap",ja);class Fo{constructor(D,nt){this.gl=D.gl,this.location=nt}}class Uo extends Fo{constructor(D,nt){super(D,nt),this.current=0}set(D){this.current!==D&&(this.current=D,this.gl.uniform1f(this.location,D))}}class al extends Fo{constructor(D,nt){super(D,nt),this.current=[0,0,0,0]}set(D){D[0]===this.current[0]&&D[1]===this.current[1]&&D[2]===this.current[2]&&D[3]===this.current[3]||(this.current=D,this.gl.uniform4f(this.location,D[0],D[1],D[2],D[3]))}}class Wo extends Fo{constructor(D,nt){super(D,nt),this.current=xr.transparent}set(D){D.r===this.current.r&&D.g===this.current.g&&D.b===this.current.b&&D.a===this.current.a||(this.current=D,this.gl.uniform4f(this.location,D.r,D.g,D.b,D.a))}}let ps=new Float32Array(16);function Tl(G){return[In(255*G.r,255*G.g),In(255*G.b,255*G.a)]}class Ku{constructor(D,nt,_t){this.value=D,this.uniformNames=nt.map(Rt=>`u_${Rt}`),this.type=_t}setUniform(D,nt,_t){D.set(_t.constantOr(this.value))}getBinding(D,nt,_t){return this.type==="color"?new Wo(D,nt):new Uo(D,nt)}}class cu{constructor(D,nt){this.uniformNames=nt.map(_t=>`u_${_t}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(D,nt){this.pixelRatioFrom=nt.pixelRatio,this.pixelRatioTo=D.pixelRatio,this.patternFrom=nt.tlbr,this.patternTo=D.tlbr}setUniform(D,nt,_t,Rt){let Kt=Rt==="u_pattern_to"?this.patternTo:Rt==="u_pattern_from"?this.patternFrom:Rt==="u_pixel_ratio_to"?this.pixelRatioTo:Rt==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Kt&&D.set(Kt)}getBinding(D,nt,_t){return _t.substr(0,9)==="u_pattern"?new al(D,nt):new Uo(D,nt)}}class _o{constructor(D,nt,_t,Rt){this.expression=D,this.type=_t,this.maxValue=0,this.paintVertexAttributes=nt.map(Kt=>({name:`a_${Kt}`,type:"Float32",components:_t==="color"?2:1,offset:0})),this.paintVertexArray=new Rt}populatePaintArray(D,nt,_t,Rt,Kt){let Qt=this.paintVertexArray.length,be=this.expression.evaluate(new Fl(0),nt,{},Rt,[],Kt);this.paintVertexArray.resize(D),this._setPaintValue(Qt,D,be)}updatePaintArray(D,nt,_t,Rt){let Kt=this.expression.evaluate({zoom:0},_t,Rt);this._setPaintValue(D,nt,Kt)}_setPaintValue(D,nt,_t){if(this.type==="color"){let Rt=Tl(_t);for(let Kt=D;Kt<nt;Kt++)this.paintVertexArray.emplace(Kt,Rt[0],Rt[1])}else{for(let Rt=D;Rt<nt;Rt++)this.paintVertexArray.emplace(Rt,_t);this.maxValue=Math.max(this.maxValue,Math.abs(_t))}}upload(D){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=D.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Zs{constructor(D,nt,_t,Rt,Kt,Qt){this.expression=D,this.uniformNames=nt.map(be=>`u_${be}_t`),this.type=_t,this.useIntegerZoom=Rt,this.zoom=Kt,this.maxValue=0,this.paintVertexAttributes=nt.map(be=>({name:`a_${be}`,type:"Float32",components:_t==="color"?4:2,offset:0})),this.paintVertexArray=new Qt}populatePaintArray(D,nt,_t,Rt,Kt){let Qt=this.expression.evaluate(new Fl(this.zoom),nt,{},Rt,[],Kt),be=this.expression.evaluate(new Fl(this.zoom+1),nt,{},Rt,[],Kt),Fe=this.paintVertexArray.length;this.paintVertexArray.resize(D),this._setPaintValue(Fe,D,Qt,be)}updatePaintArray(D,nt,_t,Rt){let Kt=this.expression.evaluate({zoom:this.zoom},_t,Rt),Qt=this.expression.evaluate({zoom:this.zoom+1},_t,Rt);this._setPaintValue(D,nt,Kt,Qt)}_setPaintValue(D,nt,_t,Rt){if(this.type==="color"){let Kt=Tl(_t),Qt=Tl(Rt);for(let be=D;be<nt;be++)this.paintVertexArray.emplace(be,Kt[0],Kt[1],Qt[0],Qt[1])}else{for(let Kt=D;Kt<nt;Kt++)this.paintVertexArray.emplace(Kt,_t,Rt);this.maxValue=Math.max(this.maxValue,Math.abs(_t),Math.abs(Rt))}}upload(D){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=D.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(D,nt){let _t=this.useIntegerZoom?Math.floor(nt.zoom):nt.zoom,Rt=_(this.expression.interpolationFactor(_t,this.zoom,this.zoom+1),0,1);D.set(Rt)}getBinding(D,nt,_t){return new Uo(D,nt)}}class rl{constructor(D,nt,_t,Rt,Kt,Qt){this.expression=D,this.type=nt,this.useIntegerZoom=_t,this.zoom=Rt,this.layerId=Qt,this.zoomInPaintVertexArray=new Kt,this.zoomOutPaintVertexArray=new Kt}populatePaintArray(D,nt,_t){let Rt=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(D),this.zoomOutPaintVertexArray.resize(D),this._setPaintValues(Rt,D,nt.patterns&&nt.patterns[this.layerId],_t)}updatePaintArray(D,nt,_t,Rt,Kt){this._setPaintValues(D,nt,_t.patterns&&_t.patterns[this.layerId],Kt)}_setPaintValues(D,nt,_t,Rt){if(!Rt||!_t)return;let{min:Kt,mid:Qt,max:be}=_t,Fe=Rt[Kt],er=Rt[Qt],yr=Rt[be];if(Fe&&er&&yr)for(let Er=D;Er<nt;Er++)this.zoomInPaintVertexArray.emplace(Er,er.tl[0],er.tl[1],er.br[0],er.br[1],Fe.tl[0],Fe.tl[1],Fe.br[0],Fe.br[1],er.pixelRatio,Fe.pixelRatio),this.zoomOutPaintVertexArray.emplace(Er,er.tl[0],er.tl[1],er.br[0],er.br[1],yr.tl[0],yr.tl[1],yr.br[0],yr.br[1],er.pixelRatio,yr.pixelRatio)}upload(D){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=D.createVertexBuffer(this.zoomInPaintVertexArray,On.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=D.createVertexBuffer(this.zoomOutPaintVertexArray,On.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class ou{constructor(D,nt,_t){this.binders={},this._buffers=[];let Rt=[];for(let Kt in D.paint._values){if(!_t(Kt))continue;let Qt=D.paint.get(Kt);if(!(Qt instanceof Iu&&uc(Qt.property.specification)))continue;let be=rh(Kt,D.type),Fe=Qt.value,er=Qt.property.specification.type,yr=Qt.property.useIntegerZoom,Er=Qt.property.specification["property-type"],Zr=Er==="cross-faded"||Er==="cross-faded-data-driven";if(Fe.kind==="constant")this.binders[Kt]=Zr?new cu(Fe.value,be):new Ku(Fe.value,be,er),Rt.push(`/u_${Kt}`);else if(Fe.kind==="source"||Zr){let sn=Bl(Kt,er,"source");this.binders[Kt]=Zr?new rl(Fe,er,yr,nt,sn,D.id):new _o(Fe,be,er,sn),Rt.push(`/a_${Kt}`)}else{let sn=Bl(Kt,er,"composite");this.binders[Kt]=new Zs(Fe,be,er,yr,nt,sn),Rt.push(`/z_${Kt}`)}}this.cacheKey=Rt.sort().join("")}getMaxValue(D){let nt=this.binders[D];return nt instanceof _o||nt instanceof Zs?nt.maxValue:0}populatePaintArrays(D,nt,_t,Rt,Kt){for(let Qt in this.binders){let be=this.binders[Qt];(be instanceof _o||be instanceof Zs||be instanceof rl)&&be.populatePaintArray(D,nt,_t,Rt,Kt)}}setConstantPatternPositions(D,nt){for(let _t in this.binders){let Rt=this.binders[_t];Rt instanceof cu&&Rt.setConstantPatternPositions(D,nt)}}updatePaintArrays(D,nt,_t,Rt,Kt){let Qt=!1;for(let be in D){let Fe=nt.getPositions(be);for(let er of Fe){let yr=_t.feature(er.index);for(let Er in this.binders){let Zr=this.binders[Er];if((Zr instanceof _o||Zr instanceof Zs||Zr instanceof rl)&&Zr.expression.isStateDependent===!0){let sn=Rt.paint.get(Er);Zr.expression=sn.value,Zr.updatePaintArray(er.start,er.end,yr,D[be],Kt),Qt=!0}}}}return Qt}defines(){let D=[];for(let nt in this.binders){let _t=this.binders[nt];(_t instanceof Ku||_t instanceof cu)&&D.push(..._t.uniformNames.map(Rt=>`#define HAS_UNIFORM_${Rt}`))}return D}getBinderAttributes(){let D=[];for(let nt in this.binders){let _t=this.binders[nt];if(_t instanceof _o||_t instanceof Zs)for(let Rt=0;Rt<_t.paintVertexAttributes.length;Rt++)D.push(_t.paintVertexAttributes[Rt].name);else if(_t instanceof rl)for(let Rt=0;Rt<On.members.length;Rt++)D.push(On.members[Rt].name)}return D}getBinderUniforms(){let D=[];for(let nt in this.binders){let _t=this.binders[nt];if(_t instanceof Ku||_t instanceof cu||_t instanceof Zs)for(let Rt of _t.uniformNames)D.push(Rt)}return D}getPaintVertexBuffers(){return this._buffers}getUniforms(D,nt){let _t=[];for(let Rt in this.binders){let Kt=this.binders[Rt];if(Kt instanceof Ku||Kt instanceof cu||Kt instanceof Zs){for(let Qt of Kt.uniformNames)if(nt[Qt]){let be=Kt.getBinding(D,nt[Qt],Qt);_t.push({name:Qt,property:Rt,binding:be})}}}return _t}setUniforms(D,nt,_t,Rt){for(let{name:Kt,property:Qt,binding:be}of nt)this.binders[Qt].setUniform(be,Rt,_t.get(Qt),Kt)}updatePaintBuffers(D){this._buffers=[];for(let nt in this.binders){let _t=this.binders[nt];if(D&&_t instanceof rl){let Rt=D.fromScale===2?_t.zoomInPaintVertexBuffer:_t.zoomOutPaintVertexBuffer;Rt&&this._buffers.push(Rt)}else(_t instanceof _o||_t instanceof Zs)&&_t.paintVertexBuffer&&this._buffers.push(_t.paintVertexBuffer)}}upload(D){for(let nt in this.binders){let _t=this.binders[nt];(_t instanceof _o||_t instanceof Zs||_t instanceof rl)&&_t.upload(D)}this.updatePaintBuffers()}destroy(){for(let D in this.binders){let nt=this.binders[D];(nt instanceof _o||nt instanceof Zs||nt instanceof rl)&&nt.destroy()}}}class Gl{constructor(D,nt,_t=()=>!0){this.programConfigurations={};for(let Rt of D)this.programConfigurations[Rt.id]=new ou(Rt,nt,_t);this.needsUpload=!1,this._featureMap=new ja,this._bufferOffset=0}populatePaintArrays(D,nt,_t,Rt,Kt,Qt){for(let be in this.programConfigurations)this.programConfigurations[be].populatePaintArrays(D,nt,Rt,Kt,Qt);nt.id!==void 0&&this._featureMap.add(nt.id,_t,this._bufferOffset,D),this._bufferOffset=D,this.needsUpload=!0}updatePaintArrays(D,nt,_t,Rt){for(let Kt of _t)this.needsUpload=this.programConfigurations[Kt.id].updatePaintArrays(D,this._featureMap,nt,Kt,Rt)||this.needsUpload}get(D){return this.programConfigurations[D]}upload(D){if(this.needsUpload){for(let nt in this.programConfigurations)this.programConfigurations[nt].upload(D);this.needsUpload=!1}}destroy(){for(let D in this.programConfigurations)this.programConfigurations[D].destroy()}}function rh(G,D){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"]}[G]||[G.replace(`${D}-`,"").replace(/-/g,"_")]}function Bl(G,D,nt){let _t={color:{source:Sn,composite:da},number:{source:mn,composite:Sn}},Rt=function(Kt){return{"line-pattern":{source:jt,composite:jt},"fill-pattern":{source:jt,composite:jt},"fill-extrusion-pattern":{source:jt,composite:jt}}[Kt]}(G);return Rt&&Rt[nt]||_t[D][nt]}Ji("ConstantBinder",Ku),Ji("CrossFadedConstantBinder",cu),Ji("SourceExpressionBinder",_o),Ji("CrossFadedCompositeBinder",rl),Ji("CompositeExpressionBinder",Zs),Ji("ProgramConfiguration",ou,{omit:["_buffers"]}),Ji("ProgramConfigurationSet",Gl);let Ql=8192,bh=Math.pow(2,14)-1,_e=-bh-1;function kr(G){let D=Ql/G.extent,nt=G.loadGeometry();for(let _t=0;_t<nt.length;_t++){let Rt=nt[_t];for(let Kt=0;Kt<Rt.length;Kt++){let Qt=Rt[Kt],be=Math.round(Qt.x*D),Fe=Math.round(Qt.y*D);Qt.x=_(be,_e,bh),Qt.y=_(Fe,_e,bh),(be<Qt.x||be>Qt.x+1||Fe<Qt.y||Fe>Qt.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return nt}function Lr(G,D){return{type:G.type,id:G.id,properties:G.properties,geometry:D?kr(G):[]}}function Dn(G,D,nt,_t,Rt){G.emplaceBack(2*D+(_t+1)/2,2*nt+(Rt+1)/2)}class oi{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(nt=>nt.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new qs,this.indexArray=new ir,this.segments=new vn,this.programConfigurations=new Gl(D.layers,D.zoom),this.stateDependentLayerIds=this.layers.filter(nt=>nt.isStateDependent()).map(nt=>nt.id)}populate(D,nt,_t){let Rt=this.layers[0],Kt=[],Qt=null,be=!1;Rt.type==="circle"&&(Qt=Rt.layout.get("circle-sort-key"),be=!Qt.isConstant());for(let{feature:Fe,id:er,index:yr,sourceLayerIndex:Er}of D){let Zr=this.layers[0]._featureFilter.needGeometry,sn=Lr(Fe,Zr);if(!this.layers[0]._featureFilter.filter(new Fl(this.zoom),sn,_t))continue;let xn=be?Qt.evaluate(sn,{},_t):void 0,Ln={id:er,properties:Fe.properties,type:Fe.type,sourceLayerIndex:Er,index:yr,geometry:Zr?sn.geometry:kr(Fe),patterns:{},sortKey:xn};Kt.push(Ln)}be&&Kt.sort((Fe,er)=>Fe.sortKey-er.sortKey);for(let Fe of Kt){let{geometry:er,index:yr,sourceLayerIndex:Er}=Fe,Zr=D[yr].feature;this.addFeature(Fe,er,yr,_t),nt.featureIndex.insert(Zr,er,yr,Er,this.index)}}update(D,nt,_t){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,nt,this.stateDependentLayers,_t)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Xr),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(D,nt,_t,Rt){for(let Kt of nt)for(let Qt of Kt){let be=Qt.x,Fe=Qt.y;if(be<0||be>=Ql||Fe<0||Fe>=Ql)continue;let er=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),yr=er.vertexLength;Dn(this.layoutVertexArray,be,Fe,-1,-1),Dn(this.layoutVertexArray,be,Fe,1,-1),Dn(this.layoutVertexArray,be,Fe,1,1),Dn(this.layoutVertexArray,be,Fe,-1,1),this.indexArray.emplaceBack(yr,yr+1,yr+2),this.indexArray.emplaceBack(yr,yr+3,yr+2),er.vertexLength+=4,er.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,_t,{},Rt)}}function Jn(G,D){for(let nt=0;nt<G.length;nt++)if(wi(D,G[nt]))return!0;for(let nt=0;nt<D.length;nt++)if(wi(G,D[nt]))return!0;return!!Ui(G,D)}function gn(G,D,nt){return!!wi(G,D)||!!Za(D,G,nt)}function ni(G,D){if(G.length===1)return ta(D,G[0]);for(let nt=0;nt<D.length;nt++){let _t=D[nt];for(let Rt=0;Rt<_t.length;Rt++)if(wi(G,_t[Rt]))return!0}for(let nt=0;nt<G.length;nt++)if(ta(D,G[nt]))return!0;for(let nt=0;nt<D.length;nt++)if(Ui(G,D[nt]))return!0;return!1}function Yi(G,D,nt){if(G.length>1){if(Ui(G,D))return!0;for(let _t=0;_t<D.length;_t++)if(Za(D[_t],G,nt))return!0}for(let _t=0;_t<G.length;_t++)if(Za(G[_t],D,nt))return!0;return!1}function Ui(G,D){if(G.length===0||D.length===0)return!1;for(let nt=0;nt<G.length-1;nt++){let _t=G[nt],Rt=G[nt+1];for(let Kt=0;Kt<D.length-1;Kt++)if(va(_t,Rt,D[Kt],D[Kt+1]))return!0}return!1}function va(G,D,nt,_t){return R(G,nt,_t)!==R(D,nt,_t)&&R(G,D,nt)!==R(G,D,_t)}function Za(G,D,nt){let _t=nt*nt;if(D.length===1)return G.distSqr(D[0])<_t;for(let Rt=1;Rt<D.length;Rt++)if(Ba(G,D[Rt-1],D[Rt])<_t)return!0;return!1}function Ba(G,D,nt){let _t=D.distSqr(nt);if(_t===0)return G.distSqr(D);let Rt=((G.x-D.x)*(nt.x-D.x)+(G.y-D.y)*(nt.y-D.y))/_t;return G.distSqr(Rt<0?D:Rt>1?nt:nt.sub(D)._mult(Rt)._add(D))}function ta(G,D){let nt,_t,Rt,Kt=!1;for(let Qt=0;Qt<G.length;Qt++){nt=G[Qt];for(let be=0,Fe=nt.length-1;be<nt.length;Fe=be++)_t=nt[be],Rt=nt[Fe],_t.y>D.y!=Rt.y>D.y&&D.x<(Rt.x-_t.x)*(D.y-_t.y)/(Rt.y-_t.y)+_t.x&&(Kt=!Kt)}return Kt}function wi(G,D){let nt=!1;for(let _t=0,Rt=G.length-1;_t<G.length;Rt=_t++){let Kt=G[_t],Qt=G[Rt];Kt.y>D.y!=Qt.y>D.y&&D.x<(Qt.x-Kt.x)*(D.y-Kt.y)/(Qt.y-Kt.y)+Kt.x&&(nt=!nt)}return nt}function hn(G,D,nt){let _t=nt[0],Rt=nt[2];if(G.x<_t.x&&D.x<_t.x||G.x>Rt.x&&D.x>Rt.x||G.y<_t.y&&D.y<_t.y||G.y>Rt.y&&D.y>Rt.y)return!1;let Kt=R(G,D,nt[0]);return Kt!==R(G,D,nt[1])||Kt!==R(G,D,nt[2])||Kt!==R(G,D,nt[3])}function Nn(G,D,nt){let _t=D.paint.get(G).value;return _t.kind==="constant"?_t.value:nt.programConfigurations.get(D.id).getMaxValue(G)}function Oi(G){return Math.sqrt(G[0]*G[0]+G[1]*G[1])}function _i(G,D,nt,_t,Rt){if(!D[0]&&!D[1])return G;let Kt=o.convert(D)._mult(Rt);nt==="viewport"&&Kt._rotate(-_t);let Qt=[];for(let be=0;be<G.length;be++)Qt.push(G[be].sub(Kt));return Qt}let Qn,Ma;Ji("CircleBucket",oi,{omit:["layers"]});var ca={get paint(){return Ma=Ma||new qt({"circle-radius":new zs(ut.paint_circle["circle-radius"]),"circle-color":new zs(ut.paint_circle["circle-color"]),"circle-blur":new zs(ut.paint_circle["circle-blur"]),"circle-opacity":new zs(ut.paint_circle["circle-opacity"]),"circle-translate":new es(ut.paint_circle["circle-translate"]),"circle-translate-anchor":new es(ut.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new es(ut.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new es(ut.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new zs(ut.paint_circle["circle-stroke-width"]),"circle-stroke-color":new zs(ut.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new zs(ut.paint_circle["circle-stroke-opacity"])})},get layout(){return Qn=Qn||new qt({"circle-sort-key":new zs(ut.layout_circle["circle-sort-key"])})}},Ua=1e-6,vi=typeof Float32Array<"u"?Float32Array:Array;function ti(G){return G[0]=1,G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=1,G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[10]=1,G[11]=0,G[12]=0,G[13]=0,G[14]=0,G[15]=1,G}function Sa(G,D,nt){var _t=D[0],Rt=D[1],Kt=D[2],Qt=D[3],be=D[4],Fe=D[5],er=D[6],yr=D[7],Er=D[8],Zr=D[9],sn=D[10],xn=D[11],Ln=D[12],$n=D[13],ki=D[14],Aa=D[15],Xi=nt[0],ma=nt[1],Ga=nt[2],To=nt[3];return G[0]=Xi*_t+ma*be+Ga*Er+To*Ln,G[1]=Xi*Rt+ma*Fe+Ga*Zr+To*$n,G[2]=Xi*Kt+ma*er+Ga*sn+To*ki,G[3]=Xi*Qt+ma*yr+Ga*xn+To*Aa,G[4]=(Xi=nt[4])*_t+(ma=nt[5])*be+(Ga=nt[6])*Er+(To=nt[7])*Ln,G[5]=Xi*Rt+ma*Fe+Ga*Zr+To*$n,G[6]=Xi*Kt+ma*er+Ga*sn+To*ki,G[7]=Xi*Qt+ma*yr+Ga*xn+To*Aa,G[8]=(Xi=nt[8])*_t+(ma=nt[9])*be+(Ga=nt[10])*Er+(To=nt[11])*Ln,G[9]=Xi*Rt+ma*Fe+Ga*Zr+To*$n,G[10]=Xi*Kt+ma*er+Ga*sn+To*ki,G[11]=Xi*Qt+ma*yr+Ga*xn+To*Aa,G[12]=(Xi=nt[12])*_t+(ma=nt[13])*be+(Ga=nt[14])*Er+(To=nt[15])*Ln,G[13]=Xi*Rt+ma*Fe+Ga*Zr+To*$n,G[14]=Xi*Kt+ma*er+Ga*sn+To*ki,G[15]=Xi*Qt+ma*yr+Ga*xn+To*Aa,G}Math.hypot||(Math.hypot=function(){for(var G=0,D=arguments.length;D--;)G+=arguments[D]*arguments[D];return Math.sqrt(G)});var pa,qi=Sa;function $i(G,D,nt){var _t=D[0],Rt=D[1],Kt=D[2],Qt=D[3];return G[0]=nt[0]*_t+nt[4]*Rt+nt[8]*Kt+nt[12]*Qt,G[1]=nt[1]*_t+nt[5]*Rt+nt[9]*Kt+nt[13]*Qt,G[2]=nt[2]*_t+nt[6]*Rt+nt[10]*Kt+nt[14]*Qt,G[3]=nt[3]*_t+nt[7]*Rt+nt[11]*Kt+nt[15]*Qt,G}pa=new vi(4),vi!=Float32Array&&(pa[0]=0,pa[1]=0,pa[2]=0,pa[3]=0);class _a extends ht{constructor(D){super(D,ca)}createBucket(D){return new oi(D)}queryRadius(D){let nt=D;return Nn("circle-radius",this,nt)+Nn("circle-stroke-width",this,nt)+Oi(this.paint.get("circle-translate"))}queryIntersectsFeature(D,nt,_t,Rt,Kt,Qt,be,Fe){let er=_i(D,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),Qt.angle,be),yr=this.paint.get("circle-radius").evaluate(nt,_t)+this.paint.get("circle-stroke-width").evaluate(nt,_t),Er=this.paint.get("circle-pitch-alignment")==="map",Zr=Er?er:function(xn,Ln){return xn.map($n=>Po($n,Ln))}(er,Fe),sn=Er?yr*be:yr;for(let xn of Rt)for(let Ln of xn){let $n=Er?Ln:Po(Ln,Fe),ki=sn,Aa=$i([],[Ln.x,Ln.y,0,1],Fe);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ki*=Aa[3]/Qt.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ki*=Qt.cameraToCenterDistance/Aa[3]),gn(Zr,$n,ki))return!0}return!1}}function Po(G,D){let nt=$i([],[G.x,G.y,0,1],D);return new o(nt[0]/nt[3],nt[1]/nt[3])}class wo extends oi{}let xa;Ji("HeatmapBucket",wo,{omit:["layers"]});var Oa={get paint(){return xa=xa||new qt({"heatmap-radius":new zs(ut.paint_heatmap["heatmap-radius"]),"heatmap-weight":new zs(ut.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new es(ut.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Zf(ut.paint_heatmap["heatmap-color"]),"heatmap-opacity":new es(ut.paint_heatmap["heatmap-opacity"])})}};function ho(G,{width:D,height:nt},_t,Rt){if(Rt){if(Rt instanceof Uint8ClampedArray)Rt=new Uint8Array(Rt.buffer);else if(Rt.length!==D*nt*_t)throw new RangeError(`mismatched image size. expected: ${Rt.length} but got: ${D*nt*_t}`)}else Rt=new Uint8Array(D*nt*_t);return G.width=D,G.height=nt,G.data=Rt,G}function So(G,{width:D,height:nt},_t){if(D===G.width&&nt===G.height)return;let Rt=ho({},{width:D,height:nt},_t);ts(G,Rt,{x:0,y:0},{x:0,y:0},{width:Math.min(G.width,D),height:Math.min(G.height,nt)},_t),G.width=D,G.height=nt,G.data=Rt.data}function ts(G,D,nt,_t,Rt,Kt){if(Rt.width===0||Rt.height===0)return D;if(Rt.width>G.width||Rt.height>G.height||nt.x>G.width-Rt.width||nt.y>G.height-Rt.height)throw new RangeError("out of range source coordinates for image copy");if(Rt.width>D.width||Rt.height>D.height||_t.x>D.width-Rt.width||_t.y>D.height-Rt.height)throw new RangeError("out of range destination coordinates for image copy");let Qt=G.data,be=D.data;if(Qt===be)throw new Error("srcData equals dstData, so image is already copied");for(let Fe=0;Fe<Rt.height;Fe++){let er=((nt.y+Fe)*G.width+nt.x)*Kt,yr=((_t.y+Fe)*D.width+_t.x)*Kt;for(let Er=0;Er<Rt.width*Kt;Er++)be[yr+Er]=Qt[er+Er]}return D}class Nl{constructor(D,nt){ho(this,D,1,nt)}resize(D){So(this,D,1)}clone(){return new Nl({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(D,nt,_t,Rt,Kt){ts(D,nt,_t,Rt,Kt,1)}}class Al{constructor(D,nt){ho(this,D,4,nt)}resize(D){So(this,D,4)}replace(D,nt){nt?this.data.set(D):this.data=D instanceof Uint8ClampedArray?new Uint8Array(D.buffer):D}clone(){return new Al({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(D,nt,_t,Rt,Kt){ts(D,nt,_t,Rt,Kt,4)}}function us(G){let D={},nt=G.resolution||256,_t=G.clips?G.clips.length:1,Rt=G.image||new Al({width:nt,height:_t});if(Math.log(nt)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${nt}`);let Kt=(Qt,be,Fe)=>{D[G.evaluationKey]=Fe;let er=G.expression.evaluate(D);Rt.data[Qt+be+0]=Math.floor(255*er.r/er.a),Rt.data[Qt+be+1]=Math.floor(255*er.g/er.a),Rt.data[Qt+be+2]=Math.floor(255*er.b/er.a),Rt.data[Qt+be+3]=Math.floor(255*er.a)};if(G.clips)for(let Qt=0,be=0;Qt<_t;++Qt,be+=4*nt)for(let Fe=0,er=0;Fe<nt;Fe++,er+=4){let yr=Fe/(nt-1),{start:Er,end:Zr}=G.clips[Qt];Kt(be,er,Er*(1-yr)+Zr*yr)}else for(let Qt=0,be=0;Qt<nt;Qt++,be+=4)Kt(0,be,Qt/(nt-1));return Rt}Ji("AlphaImage",Nl),Ji("RGBAImage",Al);let wu="big-fb";class fl extends ht{createBucket(D){return new wo(D)}constructor(D){super(D,Oa),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(D){D==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=us({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(wu)&&this.heatmapFbos.delete(wu)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Eu;var pc={get paint(){return Eu=Eu||new qt({"hillshade-illumination-direction":new es(ut.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new es(ut.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new es(ut.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new es(ut.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new es(ut.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new es(ut.paint_hillshade["hillshade-accent-color"])})}};class yc extends ht{constructor(D){super(D,pc)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}let yu=ke([{name:"a_pos",components:2,type:"Int16"}],4),{members:hu}=yu;function ku(G,D,nt=2){let _t=D&&D.length,Rt=_t?D[0]*nt:G.length,Kt=Bo(G,0,Rt,nt,!0),Qt=[];if(!Kt||Kt.next===Kt.prev)return Qt;let be,Fe,er;if(_t&&(Kt=function(yr,Er,Zr,sn){let xn=[];for(let Ln=0,$n=Er.length;Ln<$n;Ln++){let ki=Bo(yr,Er[Ln]*sn,Ln<$n-1?Er[Ln+1]*sn:yr.length,sn,!1);ki===ki.next&&(ki.steiner=!0),xn.push(et(ki))}xn.sort(Ml);for(let Ln=0;Ln<xn.length;Ln++)Zr=yl(xn[Ln],Zr);return Zr}(G,D,Kt,nt)),G.length>80*nt){be=1/0,Fe=1/0;let yr=-1/0,Er=-1/0;for(let Zr=nt;Zr<Rt;Zr+=nt){let sn=G[Zr],xn=G[Zr+1];sn<be&&(be=sn),xn<Fe&&(Fe=xn),sn>yr&&(yr=sn),xn>Er&&(Er=xn)}er=Math.max(yr-be,Er-Fe),er=er!==0?32767/er:0}return ol(Kt,Qt,nt,be,Fe,er,0),Qt}function Bo(G,D,nt,_t,Rt){let Kt;if(Rt===function(Qt,be,Fe,er){let yr=0;for(let Er=be,Zr=Fe-er;Er<Fe;Er+=er)yr+=(Qt[Zr]-Qt[Er])*(Qt[Er+1]+Qt[Zr+1]),Zr=Er;return yr}(G,D,nt,_t)>0)for(let Qt=D;Qt<nt;Qt+=_t)Kt=tr(Qt/_t|0,G[Qt],G[Qt+1],Kt);else for(let Qt=nt-_t;Qt>=D;Qt-=_t)Kt=tr(Qt/_t|0,G[Qt],G[Qt+1],Kt);return Kt&&ye(Kt,Kt.next)&&(lr(Kt),Kt=Kt.next),Kt}function Tu(G,D){if(!G)return G;D||(D=G);let nt,_t=G;do if(nt=!1,_t.steiner||!ye(_t,_t.next)&&fe(_t.prev,_t,_t.next)!==0)_t=_t.next;else{if(lr(_t),_t=D=_t.prev,_t===_t.next)break;nt=!0}while(nt||_t!==D);return D}function ol(G,D,nt,_t,Rt,Kt,Qt){if(!G)return;!Qt&&Kt&&function(Fe,er,yr,Er){let Zr=Fe;do Zr.z===0&&(Zr.z=ot(Zr.x,Zr.y,er,yr,Er)),Zr.prevZ=Zr.prev,Zr.nextZ=Zr.next,Zr=Zr.next;while(Zr!==Fe);Zr.prevZ.nextZ=null,Zr.prevZ=null,function(sn){let xn,Ln=1;do{let $n,ki=sn;sn=null;let Aa=null;for(xn=0;ki;){xn++;let Xi=ki,ma=0;for(let To=0;To<Ln&&(ma++,Xi=Xi.nextZ,Xi);To++);let Ga=Ln;for(;ma>0||Ga>0&&Xi;)ma!==0&&(Ga===0||!Xi||ki.z<=Xi.z)?($n=ki,ki=ki.nextZ,ma--):($n=Xi,Xi=Xi.nextZ,Ga--),Aa?Aa.nextZ=$n:sn=$n,$n.prevZ=Aa,Aa=$n;ki=Xi}Aa.nextZ=null,Ln*=2}while(xn>1)}(Zr)}(G,_t,Rt,Kt);let be=G;for(;G.prev!==G.next;){let Fe=G.prev,er=G.next;if(Kt?xc(G,_t,Rt,Kt):Cu(G))D.push(Fe.i,G.i,er.i),lr(G),G=er.next,be=er.next;else if((G=er)===be){Qt?Qt===1?ol(G=Eo(Tu(G),D),D,nt,_t,Rt,Kt,2):Qt===2&&Ss(G,D,nt,_t,Rt,Kt):ol(Tu(G),D,nt,_t,Rt,Kt,1);break}}}function Cu(G){let D=G.prev,nt=G,_t=G.next;if(fe(D,nt,_t)>=0)return!1;let Rt=D.x,Kt=nt.x,Qt=_t.x,be=D.y,Fe=nt.y,er=_t.y,yr=Rt<Kt?Rt<Qt?Rt:Qt:Kt<Qt?Kt:Qt,Er=be<Fe?be<er?be:er:Fe<er?Fe:er,Zr=Rt>Kt?Rt>Qt?Rt:Qt:Kt>Qt?Kt:Qt,sn=be>Fe?be>er?be:er:Fe>er?Fe:er,xn=_t.next;for(;xn!==D;){if(xn.x>=yr&&xn.x<=Zr&&xn.y>=Er&&xn.y<=sn&&xt(Rt,be,Kt,Fe,Qt,er,xn.x,xn.y)&&fe(xn.prev,xn,xn.next)>=0)return!1;xn=xn.next}return!0}function xc(G,D,nt,_t){let Rt=G.prev,Kt=G,Qt=G.next;if(fe(Rt,Kt,Qt)>=0)return!1;let be=Rt.x,Fe=Kt.x,er=Qt.x,yr=Rt.y,Er=Kt.y,Zr=Qt.y,sn=be<Fe?be<er?be:er:Fe<er?Fe:er,xn=yr<Er?yr<Zr?yr:Zr:Er<Zr?Er:Zr,Ln=be>Fe?be>er?be:er:Fe>er?Fe:er,$n=yr>Er?yr>Zr?yr:Zr:Er>Zr?Er:Zr,ki=ot(sn,xn,D,nt,_t),Aa=ot(Ln,$n,D,nt,_t),Xi=G.prevZ,ma=G.nextZ;for(;Xi&&Xi.z>=ki&&ma&&ma.z<=Aa;){if(Xi.x>=sn&&Xi.x<=Ln&&Xi.y>=xn&&Xi.y<=$n&&Xi!==Rt&&Xi!==Qt&&xt(be,yr,Fe,Er,er,Zr,Xi.x,Xi.y)&&fe(Xi.prev,Xi,Xi.next)>=0||(Xi=Xi.prevZ,ma.x>=sn&&ma.x<=Ln&&ma.y>=xn&&ma.y<=$n&&ma!==Rt&&ma!==Qt&&xt(be,yr,Fe,Er,er,Zr,ma.x,ma.y)&&fe(ma.prev,ma,ma.next)>=0))return!1;ma=ma.nextZ}for(;Xi&&Xi.z>=ki;){if(Xi.x>=sn&&Xi.x<=Ln&&Xi.y>=xn&&Xi.y<=$n&&Xi!==Rt&&Xi!==Qt&&xt(be,yr,Fe,Er,er,Zr,Xi.x,Xi.y)&&fe(Xi.prev,Xi,Xi.next)>=0)return!1;Xi=Xi.prevZ}for(;ma&&ma.z<=Aa;){if(ma.x>=sn&&ma.x<=Ln&&ma.y>=xn&&ma.y<=$n&&ma!==Rt&&ma!==Qt&&xt(be,yr,Fe,Er,er,Zr,ma.x,ma.y)&&fe(ma.prev,ma,ma.next)>=0)return!1;ma=ma.nextZ}return!0}function Eo(G,D){let nt=G;do{let _t=nt.prev,Rt=nt.next.next;!ye(_t,Rt)&&Yt(_t,nt,nt.next,Rt)&&nr(_t,Rt)&&nr(Rt,_t)&&(D.push(_t.i,nt.i,Rt.i),lr(nt),lr(nt.next),nt=G=Rt),nt=nt.next}while(nt!==G);return Tu(nt)}function Ss(G,D,nt,_t,Rt,Kt){let Qt=G;do{let be=Qt.next.next;for(;be!==Qt.prev;){if(Qt.i!==be.i&&Ut(Qt,be)){let Fe=Ye(Qt,be);return Qt=Tu(Qt,Qt.next),Fe=Tu(Fe,Fe.next),ol(Qt,D,nt,_t,Rt,Kt,0),void ol(Fe,D,nt,_t,Rt,Kt,0)}be=be.next}Qt=Qt.next}while(Qt!==G)}function Ml(G,D){return G.x-D.x}function yl(G,D){let nt=function(Rt,Kt){let Qt=Kt,be=Rt.x,Fe=Rt.y,er,yr=-1/0;do{if(Fe<=Qt.y&&Fe>=Qt.next.y&&Qt.next.y!==Qt.y){let Ln=Qt.x+(Fe-Qt.y)*(Qt.next.x-Qt.x)/(Qt.next.y-Qt.y);if(Ln<=be&&Ln>yr&&(yr=Ln,er=Qt.x<Qt.next.x?Qt:Qt.next,Ln===be))return er}Qt=Qt.next}while(Qt!==Kt);if(!er)return null;let Er=er,Zr=er.x,sn=er.y,xn=1/0;Qt=er;do{if(be>=Qt.x&&Qt.x>=Zr&&be!==Qt.x&&xt(Fe<sn?be:yr,Fe,Zr,sn,Fe<sn?yr:be,Fe,Qt.x,Qt.y)){let Ln=Math.abs(Fe-Qt.y)/(be-Qt.x);nr(Qt,Rt)&&(Ln<xn||Ln===xn&&(Qt.x>er.x||Qt.x===er.x&&Z(er,Qt)))&&(er=Qt,xn=Ln)}Qt=Qt.next}while(Qt!==Er);return er}(G,D);if(!nt)return D;let _t=Ye(nt,G);return Tu(_t,_t.next),Tu(nt,nt.next)}function Z(G,D){return fe(G.prev,G,D.prev)<0&&fe(D.next,G,G.next)<0}function ot(G,D,nt,_t,Rt){return(G=1431655765&((G=858993459&((G=252645135&((G=16711935&((G=(G-nt)*Rt|0)|G<<8))|G<<4))|G<<2))|G<<1))|(D=1431655765&((D=858993459&((D=252645135&((D=16711935&((D=(D-_t)*Rt|0)|D<<8))|D<<4))|D<<2))|D<<1))<<1}function et(G){let D=G,nt=G;do(D.x<nt.x||D.x===nt.x&&D.y<nt.y)&&(nt=D),D=D.next;while(D!==G);return nt}function xt(G,D,nt,_t,Rt,Kt,Qt,be){return(Rt-Qt)*(D-be)>=(G-Qt)*(Kt-be)&&(G-Qt)*(_t-be)>=(nt-Qt)*(D-be)&&(nt-Qt)*(Kt-be)>=(Rt-Qt)*(_t-be)}function Ut(G,D){return G.next.i!==D.i&&G.prev.i!==D.i&&!function(nt,_t){let Rt=nt;do{if(Rt.i!==nt.i&&Rt.next.i!==nt.i&&Rt.i!==_t.i&&Rt.next.i!==_t.i&&Yt(Rt,Rt.next,nt,_t))return!0;Rt=Rt.next}while(Rt!==nt);return!1}(G,D)&&(nr(G,D)&&nr(D,G)&&function(nt,_t){let Rt=nt,Kt=!1,Qt=(nt.x+_t.x)/2,be=(nt.y+_t.y)/2;do Rt.y>be!=Rt.next.y>be&&Rt.next.y!==Rt.y&&Qt<(Rt.next.x-Rt.x)*(be-Rt.y)/(Rt.next.y-Rt.y)+Rt.x&&(Kt=!Kt),Rt=Rt.next;while(Rt!==nt);return Kt}(G,D)&&(fe(G.prev,G,D.prev)||fe(G,D.prev,D))||ye(G,D)&&fe(G.prev,G,G.next)>0&&fe(D.prev,D,D.next)>0)}function fe(G,D,nt){return(D.y-G.y)*(nt.x-D.x)-(D.x-G.x)*(nt.y-D.y)}function ye(G,D){return G.x===D.x&&G.y===D.y}function Yt(G,D,nt,_t){let Rt=Se(fe(G,D,nt)),Kt=Se(fe(G,D,_t)),Qt=Se(fe(nt,_t,G)),be=Se(fe(nt,_t,D));return Rt!==Kt&&Qt!==be||!(Rt!==0||!ce(G,nt,D))||!(Kt!==0||!ce(G,_t,D))||!(Qt!==0||!ce(nt,G,_t))||!(be!==0||!ce(nt,D,_t))}function ce(G,D,nt){return D.x<=Math.max(G.x,nt.x)&&D.x>=Math.min(G.x,nt.x)&&D.y<=Math.max(G.y,nt.y)&&D.y>=Math.min(G.y,nt.y)}function Se(G){return G>0?1:G<0?-1:0}function nr(G,D){return fe(G.prev,G,G.next)<0?fe(G,D,G.next)>=0&&fe(G,G.prev,D)>=0:fe(G,D,G.prev)<0||fe(G,G.next,D)<0}function Ye(G,D){let nt=hr(G.i,G.x,G.y),_t=hr(D.i,D.x,D.y),Rt=G.next,Kt=D.prev;return G.next=D,D.prev=G,nt.next=Rt,Rt.prev=nt,_t.next=nt,nt.prev=_t,Kt.next=_t,_t.prev=Kt,_t}function tr(G,D,nt,_t){let Rt=hr(G,D,nt);return _t?(Rt.next=_t.next,Rt.prev=_t,_t.next.prev=Rt,_t.next=Rt):(Rt.prev=Rt,Rt.next=Rt),Rt}function lr(G){G.next.prev=G.prev,G.prev.next=G.next,G.prevZ&&(G.prevZ.nextZ=G.nextZ),G.nextZ&&(G.nextZ.prevZ=G.prevZ)}function hr(G,D,nt){return{i:G,x:D,y:nt,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Ve(G,D,nt){let _t=nt.patternDependencies,Rt=!1;for(let Kt of D){let Qt=Kt.paint.get(`${G}-pattern`);Qt.isConstant()||(Rt=!0);let be=Qt.constantOr(null);be&&(Rt=!0,_t[be.to]=!0,_t[be.from]=!0)}return Rt}function Xe(G,D,nt,_t,Rt){let Kt=Rt.patternDependencies;for(let Qt of D){let be=Qt.paint.get(`${G}-pattern`).value;if(be.kind!=="constant"){let Fe=be.evaluate({zoom:_t-1},nt,{},Rt.availableImages),er=be.evaluate({zoom:_t},nt,{},Rt.availableImages),yr=be.evaluate({zoom:_t+1},nt,{},Rt.availableImages);Fe=Fe&&Fe.name?Fe.name:Fe,er=er&&er.name?er.name:er,yr=yr&&yr.name?yr.name:yr,Kt[Fe]=!0,Kt[er]=!0,Kt[yr]=!0,nt.patterns[Qt.id]={min:Fe,mid:er,max:yr}}}return nt}class $e{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(nt=>nt.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Yu,this.indexArray=new ir,this.indexArray2=new Mr,this.programConfigurations=new Gl(D.layers,D.zoom),this.segments=new vn,this.segments2=new vn,this.stateDependentLayerIds=this.layers.filter(nt=>nt.isStateDependent()).map(nt=>nt.id)}populate(D,nt,_t){this.hasPattern=Ve("fill",this.layers,nt);let Rt=this.layers[0].layout.get("fill-sort-key"),Kt=!Rt.isConstant(),Qt=[];for(let{feature:be,id:Fe,index:er,sourceLayerIndex:yr}of D){let Er=this.layers[0]._featureFilter.needGeometry,Zr=Lr(be,Er);if(!this.layers[0]._featureFilter.filter(new Fl(this.zoom),Zr,_t))continue;let sn=Kt?Rt.evaluate(Zr,{},_t,nt.availableImages):void 0,xn={id:Fe,properties:be.properties,type:be.type,sourceLayerIndex:yr,index:er,geometry:Er?Zr.geometry:kr(be),patterns:{},sortKey:sn};Qt.push(xn)}Kt&&Qt.sort((be,Fe)=>be.sortKey-Fe.sortKey);for(let be of Qt){let{geometry:Fe,index:er,sourceLayerIndex:yr}=be;if(this.hasPattern){let Er=Xe("fill",this.layers,be,this.zoom,nt);this.patternFeatures.push(Er)}else this.addFeature(be,Fe,er,_t,{});nt.featureIndex.insert(D[er].feature,Fe,er,yr,this.index)}}update(D,nt,_t){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,nt,this.stateDependentLayers,_t)}addFeatures(D,nt,_t){for(let Rt of this.patternFeatures)this.addFeature(Rt,Rt.geometry,Rt.index,nt,_t)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,hu),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.indexBuffer2=D.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(D),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(D,nt,_t,Rt,Kt){for(let Qt of Jc(nt,500)){let be=0;for(let sn of Qt)be+=sn.length;let Fe=this.segments.prepareSegment(be,this.layoutVertexArray,this.indexArray),er=Fe.vertexLength,yr=[],Er=[];for(let sn of Qt){if(sn.length===0)continue;sn!==Qt[0]&&Er.push(yr.length/2);let xn=this.segments2.prepareSegment(sn.length,this.layoutVertexArray,this.indexArray2),Ln=xn.vertexLength;this.layoutVertexArray.emplaceBack(sn[0].x,sn[0].y),this.indexArray2.emplaceBack(Ln+sn.length-1,Ln),yr.push(sn[0].x),yr.push(sn[0].y);for(let $n=1;$n<sn.length;$n++)this.layoutVertexArray.emplaceBack(sn[$n].x,sn[$n].y),this.indexArray2.emplaceBack(Ln+$n-1,Ln+$n),yr.push(sn[$n].x),yr.push(sn[$n].y);xn.vertexLength+=sn.length,xn.primitiveLength+=sn.length}let Zr=ku(yr,Er);for(let sn=0;sn<Zr.length;sn+=3)this.indexArray.emplaceBack(er+Zr[sn],er+Zr[sn+1],er+Zr[sn+2]);Fe.vertexLength+=be,Fe.primitiveLength+=Zr.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,_t,Kt,Rt)}}let Cr,on;Ji("FillBucket",$e,{omit:["layers","patternFeatures"]});var fn={get paint(){return on=on||new qt({"fill-antialias":new es(ut.paint_fill["fill-antialias"]),"fill-opacity":new zs(ut.paint_fill["fill-opacity"]),"fill-color":new zs(ut.paint_fill["fill-color"]),"fill-outline-color":new zs(ut.paint_fill["fill-outline-color"]),"fill-translate":new es(ut.paint_fill["fill-translate"]),"fill-translate-anchor":new es(ut.paint_fill["fill-translate-anchor"]),"fill-pattern":new qc(ut.paint_fill["fill-pattern"])})},get layout(){return Cr=Cr||new qt({"fill-sort-key":new zs(ut.layout_fill["fill-sort-key"])})}};class fi extends ht{constructor(D){super(D,fn)}recalculate(D,nt){super.recalculate(D,nt);let _t=this.paint._values["fill-outline-color"];_t.value.kind==="constant"&&_t.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(D){return new $e(D)}queryRadius(){return Oi(this.paint.get("fill-translate"))}queryIntersectsFeature(D,nt,_t,Rt,Kt,Qt,be){return ni(_i(D,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),Qt.angle,be),Rt)}isTileClipped(){return!0}}let si=ke([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Gn=ke([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Mi}=si;var di={},Ki=a,Ai=Si;function Si(G,D,nt,_t,Rt){this.properties={},this.extent=nt,this.type=0,this._pbf=G,this._geometry=-1,this._keys=_t,this._values=Rt,G.readFields(sa,this,D)}function sa(G,D,nt){G==1?D.id=nt.readVarint():G==2?function(_t,Rt){for(var Kt=_t.readVarint()+_t.pos;_t.pos<Kt;){var Qt=Rt._keys[_t.readVarint()],be=Rt._values[_t.readVarint()];Rt.properties[Qt]=be}}(nt,D):G==3?D.type=nt.readVarint():G==4&&(D._geometry=nt.pos)}function Qa(G){for(var D,nt,_t=0,Rt=0,Kt=G.length,Qt=Kt-1;Rt<Kt;Qt=Rt++)_t+=((nt=G[Qt]).x-(D=G[Rt]).x)*(D.y+nt.y);return _t}Si.types=["Unknown","Point","LineString","Polygon"],Si.prototype.loadGeometry=function(){var G=this._pbf;G.pos=this._geometry;for(var D,nt=G.readVarint()+G.pos,_t=1,Rt=0,Kt=0,Qt=0,be=[];G.pos<nt;){if(Rt<=0){var Fe=G.readVarint();_t=7&Fe,Rt=Fe>>3}if(Rt--,_t===1||_t===2)Kt+=G.readSVarint(),Qt+=G.readSVarint(),_t===1&&(D&&be.push(D),D=[]),D.push(new Ki(Kt,Qt));else{if(_t!==7)throw new Error("unknown command "+_t);D&&D.push(D[0].clone())}}return D&&be.push(D),be},Si.prototype.bbox=function(){var G=this._pbf;G.pos=this._geometry;for(var D=G.readVarint()+G.pos,nt=1,_t=0,Rt=0,Kt=0,Qt=1/0,be=-1/0,Fe=1/0,er=-1/0;G.pos<D;){if(_t<=0){var yr=G.readVarint();nt=7&yr,_t=yr>>3}if(_t--,nt===1||nt===2)(Rt+=G.readSVarint())<Qt&&(Qt=Rt),Rt>be&&(be=Rt),(Kt+=G.readSVarint())<Fe&&(Fe=Kt),Kt>er&&(er=Kt);else if(nt!==7)throw new Error("unknown command "+nt)}return[Qt,Fe,be,er]},Si.prototype.toGeoJSON=function(G,D,nt){var _t,Rt,Kt=this.extent*Math.pow(2,nt),Qt=this.extent*G,be=this.extent*D,Fe=this.loadGeometry(),er=Si.types[this.type];function yr(sn){for(var xn=0;xn<sn.length;xn++){var Ln=sn[xn];sn[xn]=[360*(Ln.x+Qt)/Kt-180,360/Math.PI*Math.atan(Math.exp((180-360*(Ln.y+be)/Kt)*Math.PI/180))-90]}}switch(this.type){case 1:var Er=[];for(_t=0;_t<Fe.length;_t++)Er[_t]=Fe[_t][0];yr(Fe=Er);break;case 2:for(_t=0;_t<Fe.length;_t++)yr(Fe[_t]);break;case 3:for(Fe=function(sn){var xn=sn.length;if(xn<=1)return[sn];for(var Ln,$n,ki=[],Aa=0;Aa<xn;Aa++){var Xi=Qa(sn[Aa]);Xi!==0&&($n===void 0&&($n=Xi<0),$n===Xi<0?(Ln&&ki.push(Ln),Ln=[sn[Aa]]):Ln.push(sn[Aa]))}return Ln&&ki.push(Ln),ki}(Fe),_t=0;_t<Fe.length;_t++)for(Rt=0;Rt<Fe[_t].length;Rt++)yr(Fe[_t][Rt])}Fe.length===1?Fe=Fe[0]:er="Multi"+er;var Zr={type:"Feature",geometry:{type:er,coordinates:Fe},properties:this.properties};return"id"in this&&(Zr.id=this.id),Zr};var so=Ai,Vo=vs;function vs(G,D){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=G,this._keys=[],this._values=[],this._features=[],G.readFields(zl,this,D),this.length=this._features.length}function zl(G,D,nt){G===15?D.version=nt.readVarint():G===1?D.name=nt.readString():G===5?D.extent=nt.readVarint():G===2?D._features.push(nt.pos):G===3?D._keys.push(nt.readString()):G===4&&D._values.push(function(_t){for(var Rt=null,Kt=_t.readVarint()+_t.pos;_t.pos<Kt;){var Qt=_t.readVarint()>>3;Rt=Qt===1?_t.readString():Qt===2?_t.readFloat():Qt===3?_t.readDouble():Qt===4?_t.readVarint64():Qt===5?_t.readVarint():Qt===6?_t.readSVarint():Qt===7?_t.readBoolean():null}return Rt}(nt))}vs.prototype.feature=function(G){if(G<0||G>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[G];var D=this._pbf.readVarint()+this._pbf.pos;return new so(this._pbf,D,this.extent,this._keys,this._values)};var jl=Vo;function dl(G,D,nt){if(G===3){var _t=new jl(nt,nt.readVarint()+nt.pos);_t.length&&(D[_t.name]=_t)}}di.VectorTile=function(G,D){this.layers=G.readFields(dl,{},D)},di.VectorTileFeature=Ai,di.VectorTileLayer=Vo;let Ul=di.VectorTileFeature.types,_c=Math.pow(2,13);function Ds(G,D,nt,_t,Rt,Kt,Qt,be){G.emplaceBack(D,nt,2*Math.floor(_t*_c)+Qt,Rt*_c*2,Kt*_c*2,Math.round(be))}class Au{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(nt=>nt.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new dc,this.centroidVertexArray=new Ws,this.indexArray=new ir,this.programConfigurations=new Gl(D.layers,D.zoom),this.segments=new vn,this.stateDependentLayerIds=this.layers.filter(nt=>nt.isStateDependent()).map(nt=>nt.id)}populate(D,nt,_t){this.features=[],this.hasPattern=Ve("fill-extrusion",this.layers,nt);for(let{feature:Rt,id:Kt,index:Qt,sourceLayerIndex:be}of D){let Fe=this.layers[0]._featureFilter.needGeometry,er=Lr(Rt,Fe);if(!this.layers[0]._featureFilter.filter(new Fl(this.zoom),er,_t))continue;let yr={id:Kt,sourceLayerIndex:be,index:Qt,geometry:Fe?er.geometry:kr(Rt),properties:Rt.properties,type:Rt.type,patterns:{}};this.hasPattern?this.features.push(Xe("fill-extrusion",this.layers,yr,this.zoom,nt)):this.addFeature(yr,yr.geometry,Qt,_t,{}),nt.featureIndex.insert(Rt,yr.geometry,Qt,be,this.index,!0)}}addFeatures(D,nt,_t){for(let Rt of this.features){let{geometry:Kt}=Rt;this.addFeature(Rt,Kt,Rt.index,nt,_t)}}update(D,nt,_t){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,nt,this.stateDependentLayers,_t)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Mi),this.centroidVertexBuffer=D.createVertexBuffer(this.centroidVertexArray,Gn.members,!0),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(D,nt,_t,Rt,Kt){for(let Qt of Jc(nt,500)){let be={x:0,y:0,vertexCount:0},Fe=0;for(let xn of Qt)Fe+=xn.length;let er=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let xn of Qt){if(xn.length===0||zf(xn))continue;let Ln=0;for(let $n=0;$n<xn.length;$n++){let ki=xn[$n];if($n>=1){let Aa=xn[$n-1];if(!nf(ki,Aa)){er.vertexLength+4>vn.MAX_VERTEX_ARRAY_LENGTH&&(er=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let Xi=ki.sub(Aa)._perp()._unit(),ma=Aa.dist(ki);Ln+ma>32768&&(Ln=0),Ds(this.layoutVertexArray,ki.x,ki.y,Xi.x,Xi.y,0,0,Ln),Ds(this.layoutVertexArray,ki.x,ki.y,Xi.x,Xi.y,0,1,Ln),be.x+=2*ki.x,be.y+=2*ki.y,be.vertexCount+=2,Ln+=ma,Ds(this.layoutVertexArray,Aa.x,Aa.y,Xi.x,Xi.y,0,0,Ln),Ds(this.layoutVertexArray,Aa.x,Aa.y,Xi.x,Xi.y,0,1,Ln),be.x+=2*Aa.x,be.y+=2*Aa.y,be.vertexCount+=2;let Ga=er.vertexLength;this.indexArray.emplaceBack(Ga,Ga+2,Ga+1),this.indexArray.emplaceBack(Ga+1,Ga+2,Ga+3),er.vertexLength+=4,er.primitiveLength+=2}}}}if(er.vertexLength+Fe>vn.MAX_VERTEX_ARRAY_LENGTH&&(er=this.segments.prepareSegment(Fe,this.layoutVertexArray,this.indexArray)),Ul[D.type]!=="Polygon")continue;let yr=[],Er=[],Zr=er.vertexLength;for(let xn of Qt)if(xn.length!==0){xn!==Qt[0]&&Er.push(yr.length/2);for(let Ln=0;Ln<xn.length;Ln++){let $n=xn[Ln];Ds(this.layoutVertexArray,$n.x,$n.y,0,0,1,1,0),be.x+=$n.x,be.y+=$n.y,be.vertexCount+=1,yr.push($n.x),yr.push($n.y)}}let sn=ku(yr,Er);for(let xn=0;xn<sn.length;xn+=3)this.indexArray.emplaceBack(Zr+sn[xn],Zr+sn[xn+2],Zr+sn[xn+1]);er.primitiveLength+=sn.length/3,er.vertexLength+=Fe;for(let xn=0;xn<be.vertexCount;xn++){let Ln=Math.floor(be.x/be.vertexCount),$n=Math.floor(be.y/be.vertexCount);this.centroidVertexArray.emplaceBack(Ln,$n)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,_t,Kt,Rt)}}function nf(G,D){return G.x===D.x&&(G.x<0||G.x>Ql)||G.y===D.y&&(G.y<0||G.y>Ql)}function zf(G){return G.every(D=>D.x<0)||G.every(D=>D.x>Ql)||G.every(D=>D.y<0)||G.every(D=>D.y>Ql)}let Np;Ji("FillExtrusionBucket",Au,{omit:["layers","features"]});var b0={get paint(){return Np=Np||new qt({"fill-extrusion-opacity":new es(ut["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new zs(ut["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new es(ut["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new es(ut["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new qc(ut["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new zs(ut["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new zs(ut["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new es(ut["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class kp extends ht{constructor(D){super(D,b0)}createBucket(D){return new Au(D)}queryRadius(){return Oi(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,nt,_t,Rt,Kt,Qt,be,Fe){let er=_i(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Qt.angle,be),yr=this.paint.get("fill-extrusion-height").evaluate(nt,_t),Er=this.paint.get("fill-extrusion-base").evaluate(nt,_t),Zr=function(xn,Ln,$n,ki){let Aa=[];for(let Xi of xn){let ma=[Xi.x,Xi.y,0,1];$i(ma,ma,Ln),Aa.push(new o(ma[0]/ma[3],ma[1]/ma[3]))}return Aa}(er,Fe),sn=function(xn,Ln,$n,ki){let Aa=[],Xi=[],ma=ki[8]*Ln,Ga=ki[9]*Ln,To=ki[10]*Ln,As=ki[11]*Ln,Sl=ki[8]*$n,ys=ki[9]*$n,cs=ki[10]*$n,Ys=ki[11]*$n;for(let Bs of xn){let Is=[],oo=[];for(let nl of Bs){let Ks=nl.x,Wl=nl.y,uh=ki[0]*Ks+ki[4]*Wl+ki[12],nh=ki[1]*Ks+ki[5]*Wl+ki[13],gd=ki[2]*Ks+ki[6]*Wl+ki[14],Ep=ki[3]*Ks+ki[7]*Wl+ki[15],If=gd+To,td=Ep+As,dp=uh+Sl,pp=nh+ys,mp=gd+cs,of=Ep+Ys,vd=new o((uh+ma)/td,(nh+Ga)/td);vd.z=If/td,Is.push(vd);let rp=new o(dp/of,pp/of);rp.z=mp/of,oo.push(rp)}Aa.push(Is),Xi.push(oo)}return[Aa,Xi]}(Rt,Er,yr,Fe);return function(xn,Ln,$n){let ki=1/0;ni($n,Ln)&&(ki=R0($n,Ln[0]));for(let Aa=0;Aa<Ln.length;Aa++){let Xi=Ln[Aa],ma=xn[Aa];for(let Ga=0;Ga<Xi.length-1;Ga++){let To=Xi[Ga],As=[To,Xi[Ga+1],ma[Ga+1],ma[Ga],To];Jn($n,As)&&(ki=Math.min(ki,R0($n,As)))}}return ki!==1/0&&ki}(sn[0],sn[1],Zr)}}function Tp(G,D){return G.x*D.x+G.y*D.y}function R0(G,D){if(G.length===1){let nt=0,_t=D[nt++],Rt;for(;!Rt||_t.equals(Rt);)if(Rt=D[nt++],!Rt)return 1/0;for(;nt<D.length;nt++){let Kt=D[nt],Qt=G[0],be=Rt.sub(_t),Fe=Kt.sub(_t),er=Qt.sub(_t),yr=Tp(be,be),Er=Tp(be,Fe),Zr=Tp(Fe,Fe),sn=Tp(er,be),xn=Tp(er,Fe),Ln=yr*Zr-Er*Er,$n=(Zr*sn-Er*xn)/Ln,ki=(yr*xn-Er*sn)/Ln,Aa=_t.z*(1-$n-ki)+Rt.z*$n+Kt.z*ki;if(isFinite(Aa))return Aa}return 1/0}{let nt=1/0;for(let _t of D)nt=Math.min(nt,_t.z);return nt}}let tp=ke([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Ap}=tp,qd=ke([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Q0}=qd,Hm=di.VectorTileFeature.types,Mp=Math.cos(Math.PI/180*37.5),Sp=Math.pow(2,14)/.5;class ep{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(nt=>nt.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(nt=>{this.gradients[nt.id]={}}),this.layoutVertexArray=new Zc,this.layoutVertexArray2=new At,this.indexArray=new ir,this.programConfigurations=new Gl(D.layers,D.zoom),this.segments=new vn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(nt=>nt.isStateDependent()).map(nt=>nt.id)}populate(D,nt,_t){this.hasPattern=Ve("line",this.layers,nt);let Rt=this.layers[0].layout.get("line-sort-key"),Kt=!Rt.isConstant(),Qt=[];for(let{feature:be,id:Fe,index:er,sourceLayerIndex:yr}of D){let Er=this.layers[0]._featureFilter.needGeometry,Zr=Lr(be,Er);if(!this.layers[0]._featureFilter.filter(new Fl(this.zoom),Zr,_t))continue;let sn=Kt?Rt.evaluate(Zr,{},_t):void 0,xn={id:Fe,properties:be.properties,type:be.type,sourceLayerIndex:yr,index:er,geometry:Er?Zr.geometry:kr(be),patterns:{},sortKey:sn};Qt.push(xn)}Kt&&Qt.sort((be,Fe)=>be.sortKey-Fe.sortKey);for(let be of Qt){let{geometry:Fe,index:er,sourceLayerIndex:yr}=be;if(this.hasPattern){let Er=Xe("line",this.layers,be,this.zoom,nt);this.patternFeatures.push(Er)}else this.addFeature(be,Fe,er,_t,{});nt.featureIndex.insert(D[er].feature,Fe,er,yr,this.index)}}update(D,nt,_t){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,nt,this.stateDependentLayers,_t)}addFeatures(D,nt,_t){for(let Rt of this.patternFeatures)this.addFeature(Rt,Rt.geometry,Rt.index,nt,_t)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=D.createVertexBuffer(this.layoutVertexArray2,Q0)),this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Ap),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(D){if(D.properties&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_end"))return{start:+D.properties.mapbox_clip_start,end:+D.properties.mapbox_clip_end}}addFeature(D,nt,_t,Rt,Kt){let Qt=this.layers[0].layout,be=Qt.get("line-join").evaluate(D,{}),Fe=Qt.get("line-cap"),er=Qt.get("line-miter-limit"),yr=Qt.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(let Er of nt)this.addLine(Er,D,be,Fe,er,yr);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,_t,Kt,Rt)}addLine(D,nt,_t,Rt,Kt,Qt){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let ki=0;ki<D.length-1;ki++)this.totalDistance+=D[ki].dist(D[ki+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let be=Hm[nt.type]==="Polygon",Fe=D.length;for(;Fe>=2&&D[Fe-1].equals(D[Fe-2]);)Fe--;let er=0;for(;er<Fe-1&&D[er].equals(D[er+1]);)er++;if(Fe<(be?3:2))return;_t==="bevel"&&(Kt=1.05);let yr=this.overscaling<=16?15*Ql/(512*this.overscaling):0,Er=this.segments.prepareSegment(10*Fe,this.layoutVertexArray,this.indexArray),Zr,sn,xn,Ln,$n;this.e1=this.e2=-1,be&&(Zr=D[Fe-2],$n=D[er].sub(Zr)._unit()._perp());for(let ki=er;ki<Fe;ki++){if(xn=ki===Fe-1?be?D[er+1]:void 0:D[ki+1],xn&&D[ki].equals(xn))continue;$n&&(Ln=$n),Zr&&(sn=Zr),Zr=D[ki],$n=xn?xn.sub(Zr)._unit()._perp():Ln,Ln=Ln||$n;let Aa=Ln.add($n);Aa.x===0&&Aa.y===0||Aa._unit();let Xi=Ln.x*$n.x+Ln.y*$n.y,ma=Aa.x*$n.x+Aa.y*$n.y,Ga=ma!==0?1/ma:1/0,To=2*Math.sqrt(2-2*ma),As=ma<Mp&&sn&&xn,Sl=Ln.x*$n.y-Ln.y*$n.x>0;if(As&&ki>er){let Ys=Zr.dist(sn);if(Ys>2*yr){let Bs=Zr.sub(Zr.sub(sn)._mult(yr/Ys)._round());this.updateDistance(sn,Bs),this.addCurrentVertex(Bs,Ln,0,0,Er),sn=Bs}}let ys=sn&&xn,cs=ys?_t:be?"butt":Rt;if(ys&&cs==="round"&&(Ga<Qt?cs="miter":Ga<=2&&(cs="fakeround")),cs==="miter"&&Ga>Kt&&(cs="bevel"),cs==="bevel"&&(Ga>2&&(cs="flipbevel"),Ga<Kt&&(cs="miter")),sn&&this.updateDistance(sn,Zr),cs==="miter")Aa._mult(Ga),this.addCurrentVertex(Zr,Aa,0,0,Er);else if(cs==="flipbevel"){if(Ga>100)Aa=$n.mult(-1);else{let Ys=Ga*Ln.add($n).mag()/Ln.sub($n).mag();Aa._perp()._mult(Ys*(Sl?-1:1))}this.addCurrentVertex(Zr,Aa,0,0,Er),this.addCurrentVertex(Zr,Aa.mult(-1),0,0,Er)}else if(cs==="bevel"||cs==="fakeround"){let Ys=-Math.sqrt(Ga*Ga-1),Bs=Sl?Ys:0,Is=Sl?0:Ys;if(sn&&this.addCurrentVertex(Zr,Ln,Bs,Is,Er),cs==="fakeround"){let oo=Math.round(180*To/Math.PI/20);for(let nl=1;nl<oo;nl++){let Ks=nl/oo;if(Ks!==.5){let uh=Ks-.5;Ks+=Ks*uh*(Ks-1)*((1.0904+Xi*(Xi*(3.55645-1.43519*Xi)-3.2452))*uh*uh+(.848013+Xi*(.215638*Xi-1.06021)))}let Wl=$n.sub(Ln)._mult(Ks)._add(Ln)._unit()._mult(Sl?-1:1);this.addHalfVertex(Zr,Wl.x,Wl.y,!1,Sl,0,Er)}}xn&&this.addCurrentVertex(Zr,$n,-Bs,-Is,Er)}else if(cs==="butt")this.addCurrentVertex(Zr,Aa,0,0,Er);else if(cs==="square"){let Ys=sn?1:-1;this.addCurrentVertex(Zr,Aa,Ys,Ys,Er)}else cs==="round"&&(sn&&(this.addCurrentVertex(Zr,Ln,0,0,Er),this.addCurrentVertex(Zr,Ln,1,1,Er,!0)),xn&&(this.addCurrentVertex(Zr,$n,-1,-1,Er,!0),this.addCurrentVertex(Zr,$n,0,0,Er)));if(As&&ki<Fe-1){let Ys=Zr.dist(xn);if(Ys>2*yr){let Bs=Zr.add(xn.sub(Zr)._mult(yr/Ys)._round());this.updateDistance(Zr,Bs),this.addCurrentVertex(Bs,$n,0,0,Er),Zr=Bs}}}}addCurrentVertex(D,nt,_t,Rt,Kt,Qt=!1){let be=nt.y*Rt-nt.x,Fe=-nt.y-nt.x*Rt;this.addHalfVertex(D,nt.x+nt.y*_t,nt.y-nt.x*_t,Qt,!1,_t,Kt),this.addHalfVertex(D,be,Fe,Qt,!0,-Rt,Kt),this.distance>Sp/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,nt,_t,Rt,Kt,Qt))}addHalfVertex({x:D,y:nt},_t,Rt,Kt,Qt,be,Fe){let er=.5*(this.lineClips?this.scaledDistance*(Sp-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(Kt?1:0),(nt<<1)+(Qt?1:0),Math.round(63*_t)+128,Math.round(63*Rt)+128,1+(be===0?0:be<0?-1:1)|(63&er)<<2,er>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let yr=Fe.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,yr),Fe.primitiveLength++),Qt?this.e2=yr:this.e1=yr}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(D,nt){this.distance+=D.dist(nt),this.updateScaledDistance()}}let Wm,Pg;Ji("LineBucket",ep,{omit:["layers","patternFeatures"]});var qm={get paint(){return Pg=Pg||new qt({"line-opacity":new zs(ut.paint_line["line-opacity"]),"line-color":new zs(ut.paint_line["line-color"]),"line-translate":new es(ut.paint_line["line-translate"]),"line-translate-anchor":new es(ut.paint_line["line-translate-anchor"]),"line-width":new zs(ut.paint_line["line-width"]),"line-gap-width":new zs(ut.paint_line["line-gap-width"]),"line-offset":new zs(ut.paint_line["line-offset"]),"line-blur":new zs(ut.paint_line["line-blur"]),"line-dasharray":new Zu(ut.paint_line["line-dasharray"]),"line-pattern":new qc(ut.paint_line["line-pattern"]),"line-gradient":new Zf(ut.paint_line["line-gradient"])})},get layout(){return Wm=Wm||new qt({"line-cap":new es(ut.layout_line["line-cap"]),"line-join":new zs(ut.layout_line["line-join"]),"line-miter-limit":new es(ut.layout_line["line-miter-limit"]),"line-round-limit":new es(ut.layout_line["line-round-limit"]),"line-sort-key":new zs(ut.layout_line["line-sort-key"])})}};class dd extends zs{possiblyEvaluate(D,nt){return nt=new Fl(Math.floor(nt.zoom),{now:nt.now,fadeDuration:nt.fadeDuration,zoomHistory:nt.zoomHistory,transition:nt.transition}),super.possiblyEvaluate(D,nt)}evaluate(D,nt,_t,Rt){return nt=M({},nt,{zoom:Math.floor(nt.zoom)}),super.evaluate(D,nt,_t,Rt)}}let wm;class zg extends ht{constructor(D){super(D,qm),this.gradientVersion=0,wm||(wm=new dd(qm.paint.properties["line-width"].specification),wm.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(D){if(D==="line-gradient"){let nt=this.gradientExpression();this.stepInterpolant=!!function(_t){return _t._styleExpression!==void 0}(nt)&&nt._styleExpression.expression instanceof Zn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(D,nt){super.recalculate(D,nt),this.paint._values["line-floorwidth"]=wm.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,D)}createBucket(D){return new ep(D)}queryRadius(D){let nt=D,_t=pd(Nn("line-width",this,nt),Nn("line-gap-width",this,nt)),Rt=Nn("line-offset",this,nt);return _t/2+Math.abs(Rt)+Oi(this.paint.get("line-translate"))}queryIntersectsFeature(D,nt,_t,Rt,Kt,Qt,be){let Fe=_i(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Qt.angle,be),er=be/2*pd(this.paint.get("line-width").evaluate(nt,_t),this.paint.get("line-gap-width").evaluate(nt,_t)),yr=this.paint.get("line-offset").evaluate(nt,_t);return yr&&(Rt=function(Er,Zr){let sn=[];for(let xn=0;xn<Er.length;xn++){let Ln=Er[xn],$n=[];for(let ki=0;ki<Ln.length;ki++){let Aa=Ln[ki-1],Xi=Ln[ki],ma=Ln[ki+1],Ga=ki===0?new o(0,0):Xi.sub(Aa)._unit()._perp(),To=ki===Ln.length-1?new o(0,0):ma.sub(Xi)._unit()._perp(),As=Ga._add(To)._unit(),Sl=As.x*To.x+As.y*To.y;Sl!==0&&As._mult(1/Sl),$n.push(As._mult(Zr)._add(Xi))}sn.push($n)}return sn}(Rt,yr*be)),function(Er,Zr,sn){for(let xn=0;xn<Zr.length;xn++){let Ln=Zr[xn];if(Er.length>=3){for(let $n=0;$n<Ln.length;$n++)if(wi(Er,Ln[$n]))return!0}if(Yi(Er,Ln,sn))return!0}return!1}(Fe,Rt,er)}isTileClipped(){return!0}}function pd(G,D){return D>0?D+2*G:G}let Zm=ke([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Cv=ke([{name:"a_projected_pos",components:3,type:"Float32"}],4);ke([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let Lv=ke([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);ke([{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 B0=ke([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Ig=ke([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function af(G,D,nt){return G.sections.forEach(_t=>{_t.text=function(Rt,Kt,Qt){let be=Kt.layout.get("text-transform").evaluate(Qt,{});return be==="uppercase"?Rt=Rt.toLocaleUpperCase():be==="lowercase"&&(Rt=Rt.toLocaleLowerCase()),$l.applyArabicShaping&&(Rt=$l.applyArabicShaping(Rt)),Rt}(_t.text,D,nt)}),G}ke([{name:"triangle",components:3,type:"Uint16"}]),ke([{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"}]),ke([{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"}]),ke([{type:"Float32",name:"offsetX"}]),ke([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ke([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let md={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var bc=24,Og=zc,Pv=function(G,D,nt,_t,Rt){var Kt,Qt,be=8*Rt-_t-1,Fe=(1<<be)-1,er=Fe>>1,yr=-7,Er=Rt-1,Zr=-1,sn=G[D+Er];for(Er+=Zr,Kt=sn&(1<<-yr)-1,sn>>=-yr,yr+=be;yr>0;Kt=256*Kt+G[D+Er],Er+=Zr,yr-=8);for(Qt=Kt&(1<<-yr)-1,Kt>>=-yr,yr+=_t;yr>0;Qt=256*Qt+G[D+Er],Er+=Zr,yr-=8);if(Kt===0)Kt=1-er;else{if(Kt===Fe)return Qt?NaN:1/0*(sn?-1:1);Qt+=Math.pow(2,_t),Kt-=er}return(sn?-1:1)*Qt*Math.pow(2,Kt-_t)},yx=function(G,D,nt,_t,Rt,Kt){var Qt,be,Fe,er=8*Kt-Rt-1,yr=(1<<er)-1,Er=yr>>1,Zr=Rt===23?Math.pow(2,-24)-Math.pow(2,-77):0,sn=0,xn=1,Ln=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(be=isNaN(D)?1:0,Qt=yr):(Qt=Math.floor(Math.log(D)/Math.LN2),D*(Fe=Math.pow(2,-Qt))<1&&(Qt--,Fe*=2),(D+=Qt+Er>=1?Zr/Fe:Zr*Math.pow(2,1-Er))*Fe>=2&&(Qt++,Fe/=2),Qt+Er>=yr?(be=0,Qt=yr):Qt+Er>=1?(be=(D*Fe-1)*Math.pow(2,Rt),Qt+=Er):(be=D*Math.pow(2,Er-1)*Math.pow(2,Rt),Qt=0));Rt>=8;G[nt+sn]=255&be,sn+=xn,be/=256,Rt-=8);for(Qt=Qt<<Rt|be,er+=Rt;er>0;G[nt+sn]=255&Qt,sn+=xn,Qt/=256,er-=8);G[nt+sn-xn]|=128*Ln};function zc(G){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(G)?G:new Uint8Array(G||0),this.pos=0,this.type=0,this.length=this.buf.length}zc.Varint=0,zc.Fixed64=1,zc.Bytes=2,zc.Fixed32=5;var km=4294967296,xx=1/km,Dg=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function N0(G){return G.type===zc.Bytes?G.readVarint()+G.pos:G.pos+1}function mb(G,D,nt){return nt?4294967296*D+(G>>>0):4294967296*(D>>>0)+(G>>>0)}function zv(G,D,nt){var _t=D<=16383?1:D<=2097151?2:D<=268435455?3:Math.floor(Math.log(D)/(7*Math.LN2));nt.realloc(_t);for(var Rt=nt.pos-1;Rt>=G;Rt--)nt.buf[Rt+_t]=nt.buf[Rt]}function CT(G,D){for(var nt=0;nt<G.length;nt++)D.writeVarint(G[nt])}function LT(G,D){for(var nt=0;nt<G.length;nt++)D.writeSVarint(G[nt])}function PT(G,D){for(var nt=0;nt<G.length;nt++)D.writeFloat(G[nt])}function zT(G,D){for(var nt=0;nt<G.length;nt++)D.writeDouble(G[nt])}function IT(G,D){for(var nt=0;nt<G.length;nt++)D.writeBoolean(G[nt])}function OT(G,D){for(var nt=0;nt<G.length;nt++)D.writeFixed32(G[nt])}function DT(G,D){for(var nt=0;nt<G.length;nt++)D.writeSFixed32(G[nt])}function FT(G,D){for(var nt=0;nt<G.length;nt++)D.writeFixed64(G[nt])}function _x(G,D){for(var nt=0;nt<G.length;nt++)D.writeSFixed64(G[nt])}function bx(G,D){return(G[D]|G[D+1]<<8|G[D+2]<<16)+16777216*G[D+3]}function Iv(G,D,nt){G[nt]=D,G[nt+1]=D>>>8,G[nt+2]=D>>>16,G[nt+3]=D>>>24}function C3(G,D){return(G[D]|G[D+1]<<8|G[D+2]<<16)+(G[D+3]<<24)}zc.prototype={destroy:function(){this.buf=null},readFields:function(G,D,nt){for(nt=nt||this.length;this.pos<nt;){var _t=this.readVarint(),Rt=_t>>3,Kt=this.pos;this.type=7&_t,G(Rt,D,this),this.pos===Kt&&this.skip(_t)}return D},readMessage:function(G,D){return this.readFields(G,D,this.readVarint()+this.pos)},readFixed32:function(){var G=bx(this.buf,this.pos);return this.pos+=4,G},readSFixed32:function(){var G=C3(this.buf,this.pos);return this.pos+=4,G},readFixed64:function(){var G=bx(this.buf,this.pos)+bx(this.buf,this.pos+4)*km;return this.pos+=8,G},readSFixed64:function(){var G=bx(this.buf,this.pos)+C3(this.buf,this.pos+4)*km;return this.pos+=8,G},readFloat:function(){var G=Pv(this.buf,this.pos,!0,23,4);return this.pos+=4,G},readDouble:function(){var G=Pv(this.buf,this.pos,!0,52,8);return this.pos+=8,G},readVarint:function(G){var D,nt,_t=this.buf;return D=127&(nt=_t[this.pos++]),nt<128?D:(D|=(127&(nt=_t[this.pos++]))<<7,nt<128?D:(D|=(127&(nt=_t[this.pos++]))<<14,nt<128?D:(D|=(127&(nt=_t[this.pos++]))<<21,nt<128?D:function(Rt,Kt,Qt){var be,Fe,er=Qt.buf;if(be=(112&(Fe=er[Qt.pos++]))>>4,Fe<128||(be|=(127&(Fe=er[Qt.pos++]))<<3,Fe<128)||(be|=(127&(Fe=er[Qt.pos++]))<<10,Fe<128)||(be|=(127&(Fe=er[Qt.pos++]))<<17,Fe<128)||(be|=(127&(Fe=er[Qt.pos++]))<<24,Fe<128)||(be|=(1&(Fe=er[Qt.pos++]))<<31,Fe<128))return mb(Rt,be,Kt);throw new Error("Expected varint not more than 10 bytes")}(D|=(15&(nt=_t[this.pos]))<<28,G,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var G=this.readVarint();return G%2==1?(G+1)/-2:G/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var G=this.readVarint()+this.pos,D=this.pos;return this.pos=G,G-D>=12&&Dg?function(nt,_t,Rt){return Dg.decode(nt.subarray(_t,Rt))}(this.buf,D,G):function(nt,_t,Rt){for(var Kt="",Qt=_t;Qt<Rt;){var be,Fe,er,yr=nt[Qt],Er=null,Zr=yr>239?4:yr>223?3:yr>191?2:1;if(Qt+Zr>Rt)break;Zr===1?yr<128&&(Er=yr):Zr===2?(192&(be=nt[Qt+1]))==128&&(Er=(31&yr)<<6|63&be)<=127&&(Er=null):Zr===3?(Fe=nt[Qt+2],(192&(be=nt[Qt+1]))==128&&(192&Fe)==128&&((Er=(15&yr)<<12|(63&be)<<6|63&Fe)<=2047||Er>=55296&&Er<=57343)&&(Er=null)):Zr===4&&(Fe=nt[Qt+2],er=nt[Qt+3],(192&(be=nt[Qt+1]))==128&&(192&Fe)==128&&(192&er)==128&&((Er=(15&yr)<<18|(63&be)<<12|(63&Fe)<<6|63&er)<=65535||Er>=1114112)&&(Er=null)),Er===null?(Er=65533,Zr=1):Er>65535&&(Er-=65536,Kt+=String.fromCharCode(Er>>>10&1023|55296),Er=56320|1023&Er),Kt+=String.fromCharCode(Er),Qt+=Zr}return Kt}(this.buf,D,G)},readBytes:function(){var G=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,G);return this.pos=G,D},readPackedVarint:function(G,D){if(this.type!==zc.Bytes)return G.push(this.readVarint(D));var nt=N0(this);for(G=G||[];this.pos<nt;)G.push(this.readVarint(D));return G},readPackedSVarint:function(G){if(this.type!==zc.Bytes)return G.push(this.readSVarint());var D=N0(this);for(G=G||[];this.pos<D;)G.push(this.readSVarint());return G},readPackedBoolean:function(G){if(this.type!==zc.Bytes)return G.push(this.readBoolean());var D=N0(this);for(G=G||[];this.pos<D;)G.push(this.readBoolean());return G},readPackedFloat:function(G){if(this.type!==zc.Bytes)return G.push(this.readFloat());var D=N0(this);for(G=G||[];this.pos<D;)G.push(this.readFloat());return G},readPackedDouble:function(G){if(this.type!==zc.Bytes)return G.push(this.readDouble());var D=N0(this);for(G=G||[];this.pos<D;)G.push(this.readDouble());return G},readPackedFixed32:function(G){if(this.type!==zc.Bytes)return G.push(this.readFixed32());var D=N0(this);for(G=G||[];this.pos<D;)G.push(this.readFixed32());return G},readPackedSFixed32:function(G){if(this.type!==zc.Bytes)return G.push(this.readSFixed32());var D=N0(this);for(G=G||[];this.pos<D;)G.push(this.readSFixed32());return G},readPackedFixed64:function(G){if(this.type!==zc.Bytes)return G.push(this.readFixed64());var D=N0(this);for(G=G||[];this.pos<D;)G.push(this.readFixed64());return G},readPackedSFixed64:function(G){if(this.type!==zc.Bytes)return G.push(this.readSFixed64());var D=N0(this);for(G=G||[];this.pos<D;)G.push(this.readSFixed64());return G},skip:function(G){var D=7&G;if(D===zc.Varint)for(;this.buf[this.pos++]>127;);else if(D===zc.Bytes)this.pos=this.readVarint()+this.pos;else if(D===zc.Fixed32)this.pos+=4;else{if(D!==zc.Fixed64)throw new Error("Unimplemented type: "+D);this.pos+=8}},writeTag:function(G,D){this.writeVarint(G<<3|D)},realloc:function(G){for(var D=this.length||16;D<this.pos+G;)D*=2;if(D!==this.length){var nt=new Uint8Array(D);nt.set(this.buf),this.buf=nt,this.length=D}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(G){this.realloc(4),Iv(this.buf,G,this.pos),this.pos+=4},writeSFixed32:function(G){this.realloc(4),Iv(this.buf,G,this.pos),this.pos+=4},writeFixed64:function(G){this.realloc(8),Iv(this.buf,-1&G,this.pos),Iv(this.buf,Math.floor(G*xx),this.pos+4),this.pos+=8},writeSFixed64:function(G){this.realloc(8),Iv(this.buf,-1&G,this.pos),Iv(this.buf,Math.floor(G*xx),this.pos+4),this.pos+=8},writeVarint:function(G){(G=+G||0)>268435455||G<0?function(D,nt){var _t,Rt;if(D>=0?(_t=D%4294967296|0,Rt=D/4294967296|0):(Rt=~(-D/4294967296),4294967295^(_t=~(-D%4294967296))?_t=_t+1|0:(_t=0,Rt=Rt+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");nt.realloc(10),function(Kt,Qt,be){be.buf[be.pos++]=127&Kt|128,Kt>>>=7,be.buf[be.pos++]=127&Kt|128,Kt>>>=7,be.buf[be.pos++]=127&Kt|128,Kt>>>=7,be.buf[be.pos++]=127&Kt|128,be.buf[be.pos]=127&(Kt>>>=7)}(_t,0,nt),function(Kt,Qt){var be=(7&Kt)<<4;Qt.buf[Qt.pos++]|=be|((Kt>>>=3)?128:0),Kt&&(Qt.buf[Qt.pos++]=127&Kt|((Kt>>>=7)?128:0),Kt&&(Qt.buf[Qt.pos++]=127&Kt|((Kt>>>=7)?128:0),Kt&&(Qt.buf[Qt.pos++]=127&Kt|((Kt>>>=7)?128:0),Kt&&(Qt.buf[Qt.pos++]=127&Kt|((Kt>>>=7)?128:0),Kt&&(Qt.buf[Qt.pos++]=127&Kt)))))}(Rt,nt)}(G,this):(this.realloc(4),this.buf[this.pos++]=127&G|(G>127?128:0),G<=127||(this.buf[this.pos++]=127&(G>>>=7)|(G>127?128:0),G<=127||(this.buf[this.pos++]=127&(G>>>=7)|(G>127?128:0),G<=127||(this.buf[this.pos++]=G>>>7&127))))},writeSVarint:function(G){this.writeVarint(G<0?2*-G-1:2*G)},writeBoolean:function(G){this.writeVarint(!!G)},writeString:function(G){G=String(G),this.realloc(4*G.length),this.pos++;var D=this.pos;this.pos=function(_t,Rt,Kt){for(var Qt,be,Fe=0;Fe<Rt.length;Fe++){if((Qt=Rt.charCodeAt(Fe))>55295&&Qt<57344){if(!be){Qt>56319||Fe+1===Rt.length?(_t[Kt++]=239,_t[Kt++]=191,_t[Kt++]=189):be=Qt;continue}if(Qt<56320){_t[Kt++]=239,_t[Kt++]=191,_t[Kt++]=189,be=Qt;continue}Qt=be-55296<<10|Qt-56320|65536,be=null}else be&&(_t[Kt++]=239,_t[Kt++]=191,_t[Kt++]=189,be=null);Qt<128?_t[Kt++]=Qt:(Qt<2048?_t[Kt++]=Qt>>6|192:(Qt<65536?_t[Kt++]=Qt>>12|224:(_t[Kt++]=Qt>>18|240,_t[Kt++]=Qt>>12&63|128),_t[Kt++]=Qt>>6&63|128),_t[Kt++]=63&Qt|128)}return Kt}(this.buf,G,this.pos);var nt=this.pos-D;nt>=128&&zv(D,nt,this),this.pos=D-1,this.writeVarint(nt),this.pos+=nt},writeFloat:function(G){this.realloc(4),yx(this.buf,G,this.pos,!0,23,4),this.pos+=4},writeDouble:function(G){this.realloc(8),yx(this.buf,G,this.pos,!0,52,8),this.pos+=8},writeBytes:function(G){var D=G.length;this.writeVarint(D),this.realloc(D);for(var nt=0;nt<D;nt++)this.buf[this.pos++]=G[nt]},writeRawMessage:function(G,D){this.pos++;var nt=this.pos;G(D,this);var _t=this.pos-nt;_t>=128&&zv(nt,_t,this),this.pos=nt-1,this.writeVarint(_t),this.pos+=_t},writeMessage:function(G,D,nt){this.writeTag(G,zc.Bytes),this.writeRawMessage(D,nt)},writePackedVarint:function(G,D){D.length&&this.writeMessage(G,CT,D)},writePackedSVarint:function(G,D){D.length&&this.writeMessage(G,LT,D)},writePackedBoolean:function(G,D){D.length&&this.writeMessage(G,IT,D)},writePackedFloat:function(G,D){D.length&&this.writeMessage(G,PT,D)},writePackedDouble:function(G,D){D.length&&this.writeMessage(G,zT,D)},writePackedFixed32:function(G,D){D.length&&this.writeMessage(G,OT,D)},writePackedSFixed32:function(G,D){D.length&&this.writeMessage(G,DT,D)},writePackedFixed64:function(G,D){D.length&&this.writeMessage(G,FT,D)},writePackedSFixed64:function(G,D){D.length&&this.writeMessage(G,_x,D)},writeBytesField:function(G,D){this.writeTag(G,zc.Bytes),this.writeBytes(D)},writeFixed32Field:function(G,D){this.writeTag(G,zc.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(G,D){this.writeTag(G,zc.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(G,D){this.writeTag(G,zc.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(G,D){this.writeTag(G,zc.Fixed64),this.writeSFixed64(D)},writeVarintField:function(G,D){this.writeTag(G,zc.Varint),this.writeVarint(D)},writeSVarintField:function(G,D){this.writeTag(G,zc.Varint),this.writeSVarint(D)},writeStringField:function(G,D){this.writeTag(G,zc.Bytes),this.writeString(D)},writeFloatField:function(G,D){this.writeTag(G,zc.Fixed32),this.writeFloat(D)},writeDoubleField:function(G,D){this.writeTag(G,zc.Fixed64),this.writeDouble(D)},writeBooleanField:function(G,D){this.writeVarintField(G,!!D)}};var gb=r(Og);let wx=3;function RT(G,D,nt){G===1&&nt.readMessage(L3,D)}function L3(G,D,nt){if(G===3){let{id:_t,bitmap:Rt,width:Kt,height:Qt,left:be,top:Fe,advance:er}=nt.readMessage(vb,{});D.push({id:_t,bitmap:new Nl({width:Kt+2*wx,height:Qt+2*wx},Rt),metrics:{width:Kt,height:Qt,left:be,top:Fe,advance:er}})}}function vb(G,D,nt){G===1?D.id=nt.readVarint():G===2?D.bitmap=nt.readBytes():G===3?D.width=nt.readVarint():G===4?D.height=nt.readVarint():G===5?D.left=nt.readSVarint():G===6?D.top=nt.readSVarint():G===7&&(D.advance=nt.readVarint())}let yb=wx;function kx(G){let D=0,nt=0;for(let Qt of G)D+=Qt.w*Qt.h,nt=Math.max(nt,Qt.w);G.sort((Qt,be)=>be.h-Qt.h);let _t=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(D/.95)),nt),h:1/0}],Rt=0,Kt=0;for(let Qt of G)for(let be=_t.length-1;be>=0;be--){let Fe=_t[be];if(!(Qt.w>Fe.w||Qt.h>Fe.h)){if(Qt.x=Fe.x,Qt.y=Fe.y,Kt=Math.max(Kt,Qt.y+Qt.h),Rt=Math.max(Rt,Qt.x+Qt.w),Qt.w===Fe.w&&Qt.h===Fe.h){let er=_t.pop();be<_t.length&&(_t[be]=er)}else Qt.h===Fe.h?(Fe.x+=Qt.w,Fe.w-=Qt.w):Qt.w===Fe.w?(Fe.y+=Qt.h,Fe.h-=Qt.h):(_t.push({x:Fe.x+Qt.w,y:Fe.y,w:Fe.w-Qt.w,h:Qt.h}),Fe.y+=Qt.h,Fe.h-=Qt.h);break}}return{w:Rt,h:Kt,fill:D/(Rt*Kt)||0}}let Qf=1;class Zd{constructor(D,{pixelRatio:nt,version:_t,stretchX:Rt,stretchY:Kt,content:Qt,textFitWidth:be,textFitHeight:Fe}){this.paddedRect=D,this.pixelRatio=nt,this.stretchX=Rt,this.stretchY=Kt,this.content=Qt,this.version=_t,this.textFitWidth=be,this.textFitHeight=Fe}get tl(){return[this.paddedRect.x+Qf,this.paddedRect.y+Qf]}get br(){return[this.paddedRect.x+this.paddedRect.w-Qf,this.paddedRect.y+this.paddedRect.h-Qf]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*Qf)/this.pixelRatio,(this.paddedRect.h-2*Qf)/this.pixelRatio]}}class P3{constructor(D,nt){let _t={},Rt={};this.haveRenderCallbacks=[];let Kt=[];this.addImages(D,_t,Kt),this.addImages(nt,Rt,Kt);let{w:Qt,h:be}=kx(Kt),Fe=new Al({width:Qt||1,height:be||1});for(let er in D){let yr=D[er],Er=_t[er].paddedRect;Al.copy(yr.data,Fe,{x:0,y:0},{x:Er.x+Qf,y:Er.y+Qf},yr.data)}for(let er in nt){let yr=nt[er],Er=Rt[er].paddedRect,Zr=Er.x+Qf,sn=Er.y+Qf,xn=yr.data.width,Ln=yr.data.height;Al.copy(yr.data,Fe,{x:0,y:0},{x:Zr,y:sn},yr.data),Al.copy(yr.data,Fe,{x:0,y:Ln-1},{x:Zr,y:sn-1},{width:xn,height:1}),Al.copy(yr.data,Fe,{x:0,y:0},{x:Zr,y:sn+Ln},{width:xn,height:1}),Al.copy(yr.data,Fe,{x:xn-1,y:0},{x:Zr-1,y:sn},{width:1,height:Ln}),Al.copy(yr.data,Fe,{x:0,y:0},{x:Zr+xn,y:sn},{width:1,height:Ln})}this.image=Fe,this.iconPositions=_t,this.patternPositions=Rt}addImages(D,nt,_t){for(let Rt in D){let Kt=D[Rt],Qt={x:0,y:0,w:Kt.data.width+2*Qf,h:Kt.data.height+2*Qf};_t.push(Qt),nt[Rt]=new Zd(Qt,Kt),Kt.hasRenderCallback&&this.haveRenderCallbacks.push(Rt)}}patchUpdatedImages(D,nt){D.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let _t in D.updatedImages)this.patchUpdatedImage(this.iconPositions[_t],D.getImage(_t),nt),this.patchUpdatedImage(this.patternPositions[_t],D.getImage(_t),nt)}patchUpdatedImage(D,nt,_t){if(!D||!nt||D.version===nt.version)return;D.version=nt.version;let[Rt,Kt]=D.tl;_t.update(nt.data,void 0,{x:Rt,y:Kt})}}var $m;Ji("ImagePosition",Zd),Ji("ImageAtlas",P3),t.ah=void 0,($m=t.ah||(t.ah={}))[$m.none=0]="none",$m[$m.horizontal=1]="horizontal",$m[$m.vertical=2]="vertical",$m[$m.horizontalOnly=3]="horizontalOnly";let Ov=-17;class $1{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(D,nt){let _t=new $1;return _t.scale=D||1,_t.fontStack=nt,_t}static forImage(D){let nt=new $1;return nt.imageName=D,nt}}class Dv{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(D,nt){let _t=new Dv;for(let Rt=0;Rt<D.sections.length;Rt++){let Kt=D.sections[Rt];Kt.image?_t.addImageSection(Kt):_t.addTextSection(Kt,nt)}return _t}length(){return this.text.length}getSection(D){return this.sections[this.sectionIndex[D]]}getSectionIndex(D){return this.sectionIndex[D]}getCharCode(D){return this.text.charCodeAt(D)}verticalizePunctuation(){this.text=function(D){let nt="";for(let _t=0;_t<D.length;_t++){let Rt=D.charCodeAt(_t+1)||null,Kt=D.charCodeAt(_t-1)||null;nt+=Rt&&qu(Rt)&&!md[D[_t+1]]||Kt&&qu(Kt)&&!md[D[_t-1]]||!md[D[_t]]?D[_t]:md[D[_t]]}return nt}(this.text)}trim(){let D=0;for(let _t=0;_t<this.text.length&&Ax[this.text.charCodeAt(_t)];_t++)D++;let nt=this.text.length;for(let _t=this.text.length-1;_t>=0&&_t>=D&&Ax[this.text.charCodeAt(_t)];_t--)nt--;this.text=this.text.substring(D,nt),this.sectionIndex=this.sectionIndex.slice(D,nt)}substring(D,nt){let _t=new Dv;return _t.text=this.text.substring(D,nt),_t.sectionIndex=this.sectionIndex.slice(D,nt),_t.sections=this.sections,_t}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((D,nt)=>Math.max(D,this.sections[nt].scale),0)}addTextSection(D,nt){this.text+=D.text,this.sections.push($1.forText(D.scale,D.fontStack||nt));let _t=this.sections.length-1;for(let Rt=0;Rt<D.text.length;++Rt)this.sectionIndex.push(_t)}addImageSection(D){let nt=D.image?D.image.name:"";if(nt.length===0)return void w("Can't add FormattedSection with an empty image.");let _t=this.getNextImageSectionCharCode();_t?(this.text+=String.fromCharCode(_t),this.sections.push($1.forImage(nt)),this.sectionIndex.push(this.sections.length-1)):w("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Tx(G,D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr,sn,xn){let Ln=Dv.fromFeature(G,Rt),$n;Er===t.ah.vertical&&Ln.verticalizePunctuation();let{processBidirectionalText:ki,processStyledBidirectionalText:Aa}=$l;if(ki&&Ln.sections.length===1){$n=[];let Ga=ki(Ln.toString(),Fg(Ln,er,Kt,D,_t,sn));for(let To of Ga){let As=new Dv;As.text=To,As.sections=Ln.sections;for(let Sl=0;Sl<To.length;Sl++)As.sectionIndex.push(0);$n.push(As)}}else if(Aa){$n=[];let Ga=Aa(Ln.text,Ln.sectionIndex,Fg(Ln,er,Kt,D,_t,sn));for(let To of Ga){let As=new Dv;As.text=To[0],As.sectionIndex=To[1],As.sections=Ln.sections,$n.push(As)}}else $n=function(Ga,To){let As=[],Sl=Ga.text,ys=0;for(let cs of To)As.push(Ga.substring(ys,cs)),ys=cs;return ys<Sl.length&&As.push(Ga.substring(ys,Sl.length)),As}(Ln,Fg(Ln,er,Kt,D,_t,sn));let Xi=[],ma={positionedLines:Xi,text:Ln.toString(),top:yr[1],bottom:yr[1],left:yr[0],right:yr[0],writingMode:Er,iconsInText:!1,verticalizable:!1};return function(Ga,To,As,Sl,ys,cs,Ys,Bs,Is,oo,nl,Ks){let Wl=0,uh=Ov,nh=0,gd=0,Ep=Bs==="right"?1:Bs==="left"?0:.5,If=0;for(let of of ys){of.trim();let vd=of.getMaxScale(),rp=(vd-1)*bc,Gd={positionedGlyphs:[],lineOffset:0};Ga.positionedLines[If]=Gd;let gp=Gd.positionedGlyphs,Od=0;if(!of.length()){uh+=cs,++If;continue}for(let wh=0;wh<of.length();wh++){let rc=of.getSection(wh),Ic=of.getSectionIndex(wh),$c=of.getCharCode(wh),$h=0,kh=null,Wv=null,j0=null,U0=bc,np=!(Is===t.ah.horizontal||!nl&&!ml($c)||nl&&(Ax[$c]||(td=$c,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(td)))));if(rc.imageName){let ch=Sl[rc.imageName];if(!ch)continue;j0=rc.imageName,Ga.iconsInText=Ga.iconsInText||!0,Wv=ch.paddedRect;let Dd=ch.displaySize;rc.scale=rc.scale*bc/Ks,kh={width:Dd[0],height:Dd[1],left:Qf,top:-yb,advance:np?Dd[1]:Dd[0]},$h=rp+(bc-Dd[1]*rc.scale),U0=kh.advance;let k0=np?Dd[0]*rc.scale-bc*vd:Dd[1]*rc.scale-bc*vd;k0>0&&k0>Od&&(Od=k0)}else{let ch=As[rc.fontStack],Dd=ch&&ch[$c];if(Dd&&Dd.rect)Wv=Dd.rect,kh=Dd.metrics;else{let k0=To[rc.fontStack],Vp=k0&&k0[$c];if(!Vp)continue;kh=Vp.metrics}$h=(vd-rc.scale)*bc}np?(Ga.verticalizable=!0,gp.push({glyph:$c,imageName:j0,x:Wl,y:uh+$h,vertical:np,scale:rc.scale,fontStack:rc.fontStack,sectionIndex:Ic,metrics:kh,rect:Wv}),Wl+=U0*rc.scale+oo):(gp.push({glyph:$c,imageName:j0,x:Wl,y:uh+$h,vertical:np,scale:rc.scale,fontStack:rc.fontStack,sectionIndex:Ic,metrics:kh,rect:Wv}),Wl+=kh.advance*rc.scale+oo)}gp.length!==0&&(nh=Math.max(Wl-oo,nh),jT(gp,0,gp.length-1,Ep,Od)),Wl=0;let Up=cs*vd+Od;Gd.lineOffset=Math.max(Od,rp),uh+=Up,gd=Math.max(Up,gd),++If}var td;let dp=uh-Ov,{horizontalAlign:pp,verticalAlign:mp}=_b(Ys);(function(of,vd,rp,Gd,gp,Od,Up,wh,rc){let Ic=(vd-rp)*gp,$c=0;$c=Od!==Up?-wh*Gd-Ov:(-Gd*rc+.5)*Up;for(let $h of of)for(let kh of $h.positionedGlyphs)kh.x+=Ic,kh.y+=$c})(Ga.positionedLines,Ep,pp,mp,nh,gd,cs,dp,ys.length),Ga.top+=-mp*dp,Ga.bottom=Ga.top+dp,Ga.left+=-pp*nh,Ga.right=Ga.left+nh}(ma,D,nt,_t,$n,Qt,be,Fe,Er,er,Zr,xn),!function(Ga){for(let To of Ga)if(To.positionedGlyphs.length!==0)return!1;return!0}(Xi)&&ma}let Ax={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},BT={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},NT={40:!0};function Mx(G,D,nt,_t,Rt,Kt){if(D.imageName){let Qt=_t[D.imageName];return Qt?Qt.displaySize[0]*D.scale*bc/Kt+Rt:0}{let Qt=nt[D.fontStack],be=Qt&&Qt[G];return be?be.metrics.advance*D.scale+Rt:0}}function z3(G,D,nt,_t){let Rt=Math.pow(G-D,2);return _t?G<D?Rt/2:2*Rt:Rt+Math.abs(nt)*nt}function Sx(G,D,nt){let _t=0;return G===10&&(_t-=1e4),nt&&(_t+=150),G!==40&&G!==65288||(_t+=50),D!==41&&D!==65289||(_t+=50),_t}function xb(G,D,nt,_t,Rt,Kt){let Qt=null,be=z3(D,nt,Rt,Kt);for(let Fe of _t){let er=z3(D-Fe.x,nt,Rt,Kt)+Fe.badness;er<=be&&(Qt=Fe,be=er)}return{index:G,x:D,priorBreak:Qt,badness:be}}function Tm(G){return G?Tm(G.priorBreak).concat(G.index):[]}function Fg(G,D,nt,_t,Rt,Kt){if(!G)return[];let Qt=[],be=function(Er,Zr,sn,xn,Ln,$n){let ki=0;for(let Aa=0;Aa<Er.length();Aa++){let Xi=Er.getSection(Aa);ki+=Mx(Er.getCharCode(Aa),Xi,xn,Ln,Zr,$n)}return ki/Math.max(1,Math.ceil(ki/sn))}(G,D,nt,_t,Rt,Kt),Fe=G.text.indexOf("")>=0,er=0;for(let Er=0;Er<G.length();Er++){let Zr=G.getSection(Er),sn=G.getCharCode(Er);if(Ax[sn]||(er+=Mx(sn,Zr,_t,Rt,D,Kt)),Er<G.length()-1){let xn=!((yr=sn)<11904)&&(!!qa["CJK Compatibility Forms"](yr)||!!qa["CJK Compatibility"](yr)||!!qa["CJK Strokes"](yr)||!!qa["CJK Symbols and Punctuation"](yr)||!!qa["Enclosed CJK Letters and Months"](yr)||!!qa["Halfwidth and Fullwidth Forms"](yr)||!!qa["Ideographic Description Characters"](yr)||!!qa["Vertical Forms"](yr)||au.test(String.fromCodePoint(yr)));(BT[sn]||xn||Zr.imageName||Er!==G.length()-2&&NT[G.getCharCode(Er+1)])&&Qt.push(xb(Er+1,er,be,Qt,Sx(sn,G.getCharCode(Er+1),xn&&Fe),!1))}}var yr;return Tm(xb(G.length(),er,be,Qt,0,!0))}function _b(G){let D=.5,nt=.5;switch(G){case"right":case"top-right":case"bottom-right":D=1;break;case"left":case"top-left":case"bottom-left":D=0}switch(G){case"bottom":case"bottom-right":case"bottom-left":nt=1;break;case"top":case"top-right":case"top-left":nt=0}return{horizontalAlign:D,verticalAlign:nt}}function jT(G,D,nt,_t,Rt){if(!_t&&!Rt)return;let Kt=G[nt],Qt=(G[nt].x+Kt.metrics.advance*Kt.scale)*_t;for(let be=D;be<=nt;be++)G[be].x-=Qt,G[be].y+=Rt}function UT(G,D,nt){let{horizontalAlign:_t,verticalAlign:Rt}=_b(nt),Kt=D[0]-G.displaySize[0]*_t,Qt=D[1]-G.displaySize[1]*Rt;return{image:G,top:Qt,bottom:Qt+G.displaySize[1],left:Kt,right:Kt+G.displaySize[0]}}function I3(G){var D,nt;let _t=G.left,Rt=G.top,Kt=G.right-_t,Qt=G.bottom-Rt,be=(D=G.image.textFitWidth)!==null&&D!==void 0?D:"stretchOrShrink",Fe=(nt=G.image.textFitHeight)!==null&&nt!==void 0?nt:"stretchOrShrink",er=(G.image.content[2]-G.image.content[0])/(G.image.content[3]-G.image.content[1]);if(Fe==="proportional"){if(be==="stretchOnly"&&Kt/Qt<er||be==="proportional"){let yr=Math.ceil(Qt*er);_t*=yr/Kt,Kt=yr}}else if(be==="proportional"&&Fe==="stretchOnly"&&er!==0&&Kt/Qt>er){let yr=Math.ceil(Kt/er);Rt*=yr/Qt,Qt=yr}return{x1:_t,y1:Rt,x2:_t+Kt,y2:Rt+Qt}}function O3(G,D,nt,_t,Rt,Kt){let Qt=G.image,be;if(Qt.content){let $n=Qt.content,ki=Qt.pixelRatio||1;be=[$n[0]/ki,$n[1]/ki,Qt.displaySize[0]-$n[2]/ki,Qt.displaySize[1]-$n[3]/ki]}let Fe=D.left*Kt,er=D.right*Kt,yr,Er,Zr,sn;nt==="width"||nt==="both"?(sn=Rt[0]+Fe-_t[3],Er=Rt[0]+er+_t[1]):(sn=Rt[0]+(Fe+er-Qt.displaySize[0])/2,Er=sn+Qt.displaySize[0]);let xn=D.top*Kt,Ln=D.bottom*Kt;return nt==="height"||nt==="both"?(yr=Rt[1]+xn-_t[0],Zr=Rt[1]+Ln+_t[2]):(yr=Rt[1]+(xn+Ln-Qt.displaySize[1])/2,Zr=yr+Qt.displaySize[1]),{image:Qt,top:yr,right:Er,bottom:Zr,left:sn,collisionPadding:be}}let G1=255,tm=128,Gm=G1*tm;function D3(G,D){let{expression:nt}=D;if(nt.kind==="constant")return{kind:"constant",layoutSize:nt.evaluate(new Fl(G+1))};if(nt.kind==="source")return{kind:"source"};{let{zoomStops:_t,interpolationType:Rt}=nt,Kt=0;for(;Kt<_t.length&&_t[Kt]<=G;)Kt++;Kt=Math.max(0,Kt-1);let Qt=Kt;for(;Qt<_t.length&&_t[Qt]<G+1;)Qt++;Qt=Math.min(_t.length-1,Qt);let be=_t[Kt],Fe=_t[Qt];return nt.kind==="composite"?{kind:"composite",minZoom:be,maxZoom:Fe,interpolationType:Rt}:{kind:"camera",minZoom:be,maxZoom:Fe,minSize:nt.evaluate(new Fl(be)),maxSize:nt.evaluate(new Fl(Fe)),interpolationType:Rt}}}function bb(G,D,nt){let _t="never",Rt=G.get(D);return Rt?_t=Rt:G.get(nt)&&(_t="always"),_t}let VT=di.VectorTileFeature.types,wb=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ex(G,D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr){let sn=be?Math.min(Gm,Math.round(be[0])):0,xn=be?Math.min(Gm,Math.round(be[1])):0;G.emplaceBack(D,nt,Math.round(32*_t),Math.round(32*Rt),Kt,Qt,(sn<<1)+(Fe?1:0),xn,16*er,16*yr,256*Er,256*Zr)}function Ym(G,D,nt){G.emplaceBack(D.x,D.y,nt),G.emplaceBack(D.x,D.y,nt),G.emplaceBack(D.x,D.y,nt),G.emplaceBack(D.x,D.y,nt)}function HT(G){for(let D of G.sections)if(Ms(D.text))return!0;return!1}class pf{constructor(D){this.layoutVertexArray=new ue,this.indexArray=new ir,this.programConfigurations=D,this.segments=new vn,this.dynamicLayoutVertexArray=new Me,this.opacityVertexArray=new Le,this.hasVisibleVertices=!1,this.placedSymbolArray=new Ro}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(D,nt,_t,Rt){this.isEmpty()||(_t&&(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Zm.members),this.indexBuffer=D.createIndexBuffer(this.indexArray,nt),this.dynamicLayoutVertexBuffer=D.createVertexBuffer(this.dynamicLayoutVertexArray,Cv.members,!0),this.opacityVertexBuffer=D.createVertexBuffer(this.opacityVertexArray,wb,!0),this.opacityVertexBuffer.itemSize=1),(_t||Rt)&&this.programConfigurations.upload(D))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Ji("SymbolBuffers",pf);class Fv{constructor(D,nt,_t){this.layoutVertexArray=new D,this.layoutAttributes=nt,this.indexArray=new _t,this.segments=new vn,this.collisionVertexArray=new sr}upload(D){this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=D.createVertexBuffer(this.collisionVertexArray,Lv.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Ji("CollisionBuffers",Fv);class Rg{constructor(D){this.collisionBoxArray=D.collisionBoxArray,this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Qt=>Qt.id),this.index=D.index,this.pixelRatio=D.pixelRatio,this.sourceLayerIndex=D.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ti([]),this.placementViewportMatrix=ti([]);let nt=this.layers[0]._unevaluatedLayout._values;this.textSizeData=D3(this.zoom,nt["text-size"]),this.iconSizeData=D3(this.zoom,nt["icon-size"]);let _t=this.layers[0].layout,Rt=_t.get("symbol-sort-key"),Kt=_t.get("symbol-z-order");this.canOverlap=bb(_t,"text-overlap","text-allow-overlap")!=="never"||bb(_t,"icon-overlap","icon-allow-overlap")!=="never"||_t.get("text-ignore-placement")||_t.get("icon-ignore-placement"),this.sortFeaturesByKey=Kt!=="viewport-y"&&!Rt.isConstant(),this.sortFeaturesByY=(Kt==="viewport-y"||Kt==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,_t.get("symbol-placement")==="point"&&(this.writingModes=_t.get("text-writing-mode").map(Qt=>t.ah[Qt])),this.stateDependentLayerIds=this.layers.filter(Qt=>Qt.isStateDependent()).map(Qt=>Qt.id),this.sourceID=D.sourceID}createArrays(){this.text=new pf(new Gl(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new pf(new Gl(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new hl,this.lineVertexArray=new vl,this.symbolInstances=new hs,this.textAnchorOffsets=new bl}calculateGlyphDependencies(D,nt,_t,Rt,Kt){for(let Qt=0;Qt<D.length;Qt++)if(nt[D.charCodeAt(Qt)]=!0,(_t||Rt)&&Kt){let be=md[D.charAt(Qt)];be&&(nt[be.charCodeAt(0)]=!0)}}populate(D,nt,_t){let Rt=this.layers[0],Kt=Rt.layout,Qt=Kt.get("text-font"),be=Kt.get("text-field"),Fe=Kt.get("icon-image"),er=(be.value.kind!=="constant"||be.value.value instanceof wn&&!be.value.value.isEmpty()||be.value.value.toString().length>0)&&(Qt.value.kind!=="constant"||Qt.value.value.length>0),yr=Fe.value.kind!=="constant"||!!Fe.value.value||Object.keys(Fe.parameters).length>0,Er=Kt.get("symbol-sort-key");if(this.features=[],!er&&!yr)return;let Zr=nt.iconDependencies,sn=nt.glyphDependencies,xn=nt.availableImages,Ln=new Fl(this.zoom);for(let{feature:$n,id:ki,index:Aa,sourceLayerIndex:Xi}of D){let ma=Rt._featureFilter.needGeometry,Ga=Lr($n,ma);if(!Rt._featureFilter.filter(Ln,Ga,_t))continue;let To,As;if(ma||(Ga.geometry=kr($n)),er){let ys=Rt.getValueAndResolveTokens("text-field",Ga,_t,xn),cs=wn.factory(ys),Ys=this.hasRTLText=this.hasRTLText||HT(cs);(!Ys||$l.getRTLTextPluginStatus()==="unavailable"||Ys&&$l.isParsed())&&(To=af(cs,Rt,Ga))}if(yr){let ys=Rt.getValueAndResolveTokens("icon-image",Ga,_t,xn);As=ys instanceof Pi?ys:Pi.fromString(ys)}if(!To&&!As)continue;let Sl=this.sortFeaturesByKey?Er.evaluate(Ga,{},_t):void 0;if(this.features.push({id:ki,text:To,icon:As,index:Aa,sourceLayerIndex:Xi,geometry:Ga.geometry,properties:$n.properties,type:VT[$n.type],sortKey:Sl}),As&&(Zr[As.name]=!0),To){let ys=Qt.evaluate(Ga,{},_t).join(","),cs=Kt.get("text-rotation-alignment")!=="viewport"&&Kt.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(let Ys of To.sections)if(Ys.image)Zr[Ys.image.name]=!0;else{let Bs=ds(To.toString()),Is=Ys.fontStack||ys,oo=sn[Is]=sn[Is]||{};this.calculateGlyphDependencies(Ys.text,oo,cs,this.allowVerticalPlacement,Bs)}}}Kt.get("symbol-placement")==="line"&&(this.features=function($n){let ki={},Aa={},Xi=[],ma=0;function Ga(ys){Xi.push($n[ys]),ma++}function To(ys,cs,Ys){let Bs=Aa[ys];return delete Aa[ys],Aa[cs]=Bs,Xi[Bs].geometry[0].pop(),Xi[Bs].geometry[0]=Xi[Bs].geometry[0].concat(Ys[0]),Bs}function As(ys,cs,Ys){let Bs=ki[cs];return delete ki[cs],ki[ys]=Bs,Xi[Bs].geometry[0].shift(),Xi[Bs].geometry[0]=Ys[0].concat(Xi[Bs].geometry[0]),Bs}function Sl(ys,cs,Ys){let Bs=Ys?cs[0][cs[0].length-1]:cs[0][0];return`${ys}:${Bs.x}:${Bs.y}`}for(let ys=0;ys<$n.length;ys++){let cs=$n[ys],Ys=cs.geometry,Bs=cs.text?cs.text.toString():null;if(!Bs){Ga(ys);continue}let Is=Sl(Bs,Ys),oo=Sl(Bs,Ys,!0);if(Is in Aa&&oo in ki&&Aa[Is]!==ki[oo]){let nl=As(Is,oo,Ys),Ks=To(Is,oo,Xi[nl].geometry);delete ki[Is],delete Aa[oo],Aa[Sl(Bs,Xi[Ks].geometry,!0)]=Ks,Xi[nl].geometry=null}else Is in Aa?To(Is,oo,Ys):oo in ki?As(Is,oo,Ys):(Ga(ys),ki[Is]=ma-1,Aa[oo]=ma-1)}return Xi.filter(ys=>ys.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort(($n,ki)=>$n.sortKey-ki.sortKey)}update(D,nt,_t){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(D,nt,this.layers,_t),this.icon.programConfigurations.updatePaintArrays(D,nt,this.layers,_t))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(D){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(D),this.iconCollisionBox.upload(D)),this.text.upload(D,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(D,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(D,nt){let _t=this.lineVertexArray.length;if(D.segment!==void 0){let Rt=D.dist(nt[D.segment+1]),Kt=D.dist(nt[D.segment]),Qt={};for(let be=D.segment+1;be<nt.length;be++)Qt[be]={x:nt[be].x,y:nt[be].y,tileUnitDistanceFromAnchor:Rt},be<nt.length-1&&(Rt+=nt[be+1].dist(nt[be]));for(let be=D.segment||0;be>=0;be--)Qt[be]={x:nt[be].x,y:nt[be].y,tileUnitDistanceFromAnchor:Kt},be>0&&(Kt+=nt[be-1].dist(nt[be]));for(let be=0;be<nt.length;be++){let Fe=Qt[be];this.lineVertexArray.emplaceBack(Fe.x,Fe.y,Fe.tileUnitDistanceFromAnchor)}}return{lineStartIndex:_t,lineLength:this.lineVertexArray.length-_t}}addSymbols(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr){let sn=D.indexArray,xn=D.layoutVertexArray,Ln=D.segments.prepareSegment(4*nt.length,xn,sn,this.canOverlap?Qt.sortKey:void 0),$n=this.glyphOffsetArray.length,ki=Ln.vertexLength,Aa=this.allowVerticalPlacement&&be===t.ah.vertical?Math.PI/2:0,Xi=Qt.text&&Qt.text.sections;for(let ma=0;ma<nt.length;ma++){let{tl:Ga,tr:To,bl:As,br:Sl,tex:ys,pixelOffsetTL:cs,pixelOffsetBR:Ys,minFontScaleX:Bs,minFontScaleY:Is,glyphOffset:oo,isSDF:nl,sectionIndex:Ks}=nt[ma],Wl=Ln.vertexLength,uh=oo[1];Ex(xn,Fe.x,Fe.y,Ga.x,uh+Ga.y,ys.x,ys.y,_t,nl,cs.x,cs.y,Bs,Is),Ex(xn,Fe.x,Fe.y,To.x,uh+To.y,ys.x+ys.w,ys.y,_t,nl,Ys.x,cs.y,Bs,Is),Ex(xn,Fe.x,Fe.y,As.x,uh+As.y,ys.x,ys.y+ys.h,_t,nl,cs.x,Ys.y,Bs,Is),Ex(xn,Fe.x,Fe.y,Sl.x,uh+Sl.y,ys.x+ys.w,ys.y+ys.h,_t,nl,Ys.x,Ys.y,Bs,Is),Ym(D.dynamicLayoutVertexArray,Fe,Aa),sn.emplaceBack(Wl,Wl+1,Wl+2),sn.emplaceBack(Wl+1,Wl+2,Wl+3),Ln.vertexLength+=4,Ln.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(oo[0]),ma!==nt.length-1&&Ks===nt[ma+1].sectionIndex||D.programConfigurations.populatePaintArrays(xn.length,Qt,Qt.index,{},Zr,Xi&&Xi[Ks])}D.placedSymbolArray.emplaceBack(Fe.x,Fe.y,$n,this.glyphOffsetArray.length-$n,ki,er,yr,Fe.segment,_t?_t[0]:0,_t?_t[1]:0,Rt[0],Rt[1],be,0,!1,0,Er)}_addCollisionDebugVertex(D,nt,_t,Rt,Kt,Qt){return nt.emplaceBack(0,0),D.emplaceBack(_t.x,_t.y,Rt,Kt,Math.round(Qt.x),Math.round(Qt.y))}addCollisionDebugVertices(D,nt,_t,Rt,Kt,Qt,be){let Fe=Kt.segments.prepareSegment(4,Kt.layoutVertexArray,Kt.indexArray),er=Fe.vertexLength,yr=Kt.layoutVertexArray,Er=Kt.collisionVertexArray,Zr=be.anchorX,sn=be.anchorY;this._addCollisionDebugVertex(yr,Er,Qt,Zr,sn,new o(D,nt)),this._addCollisionDebugVertex(yr,Er,Qt,Zr,sn,new o(_t,nt)),this._addCollisionDebugVertex(yr,Er,Qt,Zr,sn,new o(_t,Rt)),this._addCollisionDebugVertex(yr,Er,Qt,Zr,sn,new o(D,Rt)),Fe.vertexLength+=4;let xn=Kt.indexArray;xn.emplaceBack(er,er+1),xn.emplaceBack(er+1,er+2),xn.emplaceBack(er+2,er+3),xn.emplaceBack(er+3,er),Fe.primitiveLength+=4}addDebugCollisionBoxes(D,nt,_t,Rt){for(let Kt=D;Kt<nt;Kt++){let Qt=this.collisionBoxArray.get(Kt);this.addCollisionDebugVertices(Qt.x1,Qt.y1,Qt.x2,Qt.y2,Rt?this.textCollisionBox:this.iconCollisionBox,Qt.anchorPoint,_t)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Fv(Be,B0.members,Mr),this.iconCollisionBox=new Fv(Be,B0.members,Mr);for(let D=0;D<this.symbolInstances.length;D++){let nt=this.symbolInstances.get(D);this.addDebugCollisionBoxes(nt.textBoxStartIndex,nt.textBoxEndIndex,nt,!0),this.addDebugCollisionBoxes(nt.verticalTextBoxStartIndex,nt.verticalTextBoxEndIndex,nt,!0),this.addDebugCollisionBoxes(nt.iconBoxStartIndex,nt.iconBoxEndIndex,nt,!1),this.addDebugCollisionBoxes(nt.verticalIconBoxStartIndex,nt.verticalIconBoxEndIndex,nt,!1)}}_deserializeCollisionBoxesForSymbol(D,nt,_t,Rt,Kt,Qt,be,Fe,er){let yr={};for(let Er=nt;Er<_t;Er++){let Zr=D.get(Er);yr.textBox={x1:Zr.x1,y1:Zr.y1,x2:Zr.x2,y2:Zr.y2,anchorPointX:Zr.anchorPointX,anchorPointY:Zr.anchorPointY},yr.textFeatureIndex=Zr.featureIndex;break}for(let Er=Rt;Er<Kt;Er++){let Zr=D.get(Er);yr.verticalTextBox={x1:Zr.x1,y1:Zr.y1,x2:Zr.x2,y2:Zr.y2,anchorPointX:Zr.anchorPointX,anchorPointY:Zr.anchorPointY},yr.verticalTextFeatureIndex=Zr.featureIndex;break}for(let Er=Qt;Er<be;Er++){let Zr=D.get(Er);yr.iconBox={x1:Zr.x1,y1:Zr.y1,x2:Zr.x2,y2:Zr.y2,anchorPointX:Zr.anchorPointX,anchorPointY:Zr.anchorPointY},yr.iconFeatureIndex=Zr.featureIndex;break}for(let Er=Fe;Er<er;Er++){let Zr=D.get(Er);yr.verticalIconBox={x1:Zr.x1,y1:Zr.y1,x2:Zr.x2,y2:Zr.y2,anchorPointX:Zr.anchorPointX,anchorPointY:Zr.anchorPointY},yr.verticalIconFeatureIndex=Zr.featureIndex;break}return yr}deserializeCollisionBoxes(D){this.collisionArrays=[];for(let nt=0;nt<this.symbolInstances.length;nt++){let _t=this.symbolInstances.get(nt);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(D,_t.textBoxStartIndex,_t.textBoxEndIndex,_t.verticalTextBoxStartIndex,_t.verticalTextBoxEndIndex,_t.iconBoxStartIndex,_t.iconBoxEndIndex,_t.verticalIconBoxStartIndex,_t.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(D,nt){let _t=D.placedSymbolArray.get(nt),Rt=_t.vertexStartIndex+4*_t.numGlyphs;for(let Kt=_t.vertexStartIndex;Kt<Rt;Kt+=4)D.indexArray.emplaceBack(Kt,Kt+1,Kt+2),D.indexArray.emplaceBack(Kt+1,Kt+2,Kt+3)}getSortedSymbolIndexes(D){if(this.sortedAngle===D&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let nt=Math.sin(D),_t=Math.cos(D),Rt=[],Kt=[],Qt=[];for(let be=0;be<this.symbolInstances.length;++be){Qt.push(be);let Fe=this.symbolInstances.get(be);Rt.push(0|Math.round(nt*Fe.anchorX+_t*Fe.anchorY)),Kt.push(Fe.featureIndex)}return Qt.sort((be,Fe)=>Rt[be]-Rt[Fe]||Kt[Fe]-Kt[be]),Qt}addToSortKeyRanges(D,nt){let _t=this.sortKeyRanges[this.sortKeyRanges.length-1];_t&&_t.sortKey===nt?_t.symbolInstanceEnd=D+1:this.sortKeyRanges.push({sortKey:nt,symbolInstanceStart:D,symbolInstanceEnd:D+1})}sortFeatures(D){if(this.sortFeaturesByY&&this.sortedAngle!==D&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(D),this.sortedAngle=D,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let nt of this.symbolInstanceIndexes){let _t=this.symbolInstances.get(nt);this.featureSortOrder.push(_t.featureIndex),[_t.rightJustifiedTextSymbolIndex,_t.centerJustifiedTextSymbolIndex,_t.leftJustifiedTextSymbolIndex].forEach((Rt,Kt,Qt)=>{Rt>=0&&Qt.indexOf(Rt)===Kt&&this.addIndicesForPlacedSymbol(this.text,Rt)}),_t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,_t.verticalPlacedTextSymbolIndex),_t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,_t.placedIconSymbolIndex),_t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,_t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Y1,K1;Ji("SymbolBucket",Rg,{omit:["layers","collisionBoxArray","features","compareText"]}),Rg.MAX_GLYPHS=65535,Rg.addDynamicAttributes=Ym;var kb={get paint(){return K1=K1||new qt({"icon-opacity":new zs(ut.paint_symbol["icon-opacity"]),"icon-color":new zs(ut.paint_symbol["icon-color"]),"icon-halo-color":new zs(ut.paint_symbol["icon-halo-color"]),"icon-halo-width":new zs(ut.paint_symbol["icon-halo-width"]),"icon-halo-blur":new zs(ut.paint_symbol["icon-halo-blur"]),"icon-translate":new es(ut.paint_symbol["icon-translate"]),"icon-translate-anchor":new es(ut.paint_symbol["icon-translate-anchor"]),"text-opacity":new zs(ut.paint_symbol["text-opacity"]),"text-color":new zs(ut.paint_symbol["text-color"],{runtimeType:cr,getOverride:G=>G.textColor,hasOverride:G=>!!G.textColor}),"text-halo-color":new zs(ut.paint_symbol["text-halo-color"]),"text-halo-width":new zs(ut.paint_symbol["text-halo-width"]),"text-halo-blur":new zs(ut.paint_symbol["text-halo-blur"]),"text-translate":new es(ut.paint_symbol["text-translate"]),"text-translate-anchor":new es(ut.paint_symbol["text-translate-anchor"])})},get layout(){return Y1=Y1||new qt({"symbol-placement":new es(ut.layout_symbol["symbol-placement"]),"symbol-spacing":new es(ut.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new es(ut.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new zs(ut.layout_symbol["symbol-sort-key"]),"symbol-z-order":new es(ut.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new es(ut.layout_symbol["icon-allow-overlap"]),"icon-overlap":new es(ut.layout_symbol["icon-overlap"]),"icon-ignore-placement":new es(ut.layout_symbol["icon-ignore-placement"]),"icon-optional":new es(ut.layout_symbol["icon-optional"]),"icon-rotation-alignment":new es(ut.layout_symbol["icon-rotation-alignment"]),"icon-size":new zs(ut.layout_symbol["icon-size"]),"icon-text-fit":new es(ut.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new es(ut.layout_symbol["icon-text-fit-padding"]),"icon-image":new zs(ut.layout_symbol["icon-image"]),"icon-rotate":new zs(ut.layout_symbol["icon-rotate"]),"icon-padding":new zs(ut.layout_symbol["icon-padding"]),"icon-keep-upright":new es(ut.layout_symbol["icon-keep-upright"]),"icon-offset":new zs(ut.layout_symbol["icon-offset"]),"icon-anchor":new zs(ut.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new es(ut.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new es(ut.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new es(ut.layout_symbol["text-rotation-alignment"]),"text-field":new zs(ut.layout_symbol["text-field"]),"text-font":new zs(ut.layout_symbol["text-font"]),"text-size":new zs(ut.layout_symbol["text-size"]),"text-max-width":new zs(ut.layout_symbol["text-max-width"]),"text-line-height":new es(ut.layout_symbol["text-line-height"]),"text-letter-spacing":new zs(ut.layout_symbol["text-letter-spacing"]),"text-justify":new zs(ut.layout_symbol["text-justify"]),"text-radial-offset":new zs(ut.layout_symbol["text-radial-offset"]),"text-variable-anchor":new es(ut.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new zs(ut.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new zs(ut.layout_symbol["text-anchor"]),"text-max-angle":new es(ut.layout_symbol["text-max-angle"]),"text-writing-mode":new es(ut.layout_symbol["text-writing-mode"]),"text-rotate":new zs(ut.layout_symbol["text-rotate"]),"text-padding":new es(ut.layout_symbol["text-padding"]),"text-keep-upright":new es(ut.layout_symbol["text-keep-upright"]),"text-transform":new zs(ut.layout_symbol["text-transform"]),"text-offset":new zs(ut.layout_symbol["text-offset"]),"text-allow-overlap":new es(ut.layout_symbol["text-allow-overlap"]),"text-overlap":new es(ut.layout_symbol["text-overlap"]),"text-ignore-placement":new es(ut.layout_symbol["text-ignore-placement"]),"text-optional":new es(ut.layout_symbol["text-optional"])})}};class Rv{constructor(D){if(D.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=D.property.overrides?D.property.overrides.runtimeType:oe,this.defaultValue=D}evaluate(D){if(D.formattedSection){let nt=this.defaultValue.property.overrides;if(nt&&nt.hasOverride(D.formattedSection))return nt.getOverride(D.formattedSection)}return D.feature&&D.featureState?this.defaultValue.evaluate(D.feature,D.featureState):this.defaultValue.property.specification.default}eachChild(D){this.defaultValue.isConstant()||D(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ji("FormatSectionOverride",Rv,{omit:["defaultValue"]});class Cx extends ht{constructor(D){super(D,kb)}recalculate(D,nt){if(super.recalculate(D,nt),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 _t=this.layout.get("text-writing-mode");if(_t){let Rt=[];for(let Kt of _t)Rt.indexOf(Kt)<0&&Rt.push(Kt);this.layout._values["text-writing-mode"]=Rt}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(D,nt,_t,Rt){let Kt=this.layout.get(D).evaluate(nt,{},_t,Rt),Qt=this._unevaluatedLayout._values[D];return Qt.isDataDriven()||Hh(Qt.value)||!Kt?Kt:function(be,Fe){return Fe.replace(/{([^{}]+)}/g,(er,yr)=>be&&yr in be?String(be[yr]):"")}(nt.properties,Kt)}createBucket(D){return new Rg(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let D of kb.paint.overridableProperties){if(!Cx.hasPaintOverride(this.layout,D))continue;let nt=this.paint.get(D),_t=new Rv(nt),Rt=new jc(_t,nt.property.specification),Kt=null;Kt=nt.value.kind==="constant"||nt.value.kind==="source"?new Eh("source",Rt):new Sc("composite",Rt,nt.value.zoomStops),this.paint._values[D]=new Iu(nt.property,Kt,nt.parameters)}}_handleOverridablePaintPropertyUpdate(D,nt,_t){return!(!this.layout||nt.isDataDriven()||_t.isDataDriven())&&Cx.hasPaintOverride(this.layout,D)}static hasPaintOverride(D,nt){let _t=D.get("text-field"),Rt=kb.paint.properties[nt],Kt=!1,Qt=be=>{for(let Fe of be)if(Rt.overrides&&Rt.overrides.hasOverride(Fe))return void(Kt=!0)};if(_t.value.kind==="constant"&&_t.value.value instanceof wn)Qt(_t.value.value.sections);else if(_t.value.kind==="source"){let be=er=>{Kt||(er instanceof Wa&&ui(er.value)===br?Qt(er.value.sections):er instanceof kl?Qt(er.sections):er.eachChild(be))},Fe=_t.value;Fe._styleExpression&&be(Fe._styleExpression.expression)}return Kt}}let Tb;var F3={get paint(){return Tb=Tb||new qt({"background-color":new es(ut.paint_background["background-color"]),"background-pattern":new Zu(ut.paint_background["background-pattern"]),"background-opacity":new es(ut.paint_background["background-opacity"])})}};class X1 extends ht{constructor(D){super(D,F3)}}let Lx;var Ab={get paint(){return Lx=Lx||new qt({"raster-opacity":new es(ut.paint_raster["raster-opacity"]),"raster-hue-rotate":new es(ut.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new es(ut.paint_raster["raster-brightness-min"]),"raster-brightness-max":new es(ut.paint_raster["raster-brightness-max"]),"raster-saturation":new es(ut.paint_raster["raster-saturation"]),"raster-contrast":new es(ut.paint_raster["raster-contrast"]),"raster-resampling":new es(ut.paint_raster["raster-resampling"]),"raster-fade-duration":new es(ut.paint_raster["raster-fade-duration"])})}};class WT extends ht{constructor(D){super(D,Ab)}}class R3 extends ht{constructor(D){super(D,{}),this.onAdd=nt=>{this.implementation.onAdd&&this.implementation.onAdd(nt,nt.painter.context.gl)},this.onRemove=nt=>{this.implementation.onRemove&&this.implementation.onRemove(nt,nt.painter.context.gl)},this.implementation=D}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 J1{constructor(D){this._methodToThrottle=D,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 Mb=63710088e-1;class em{constructor(D,nt){if(isNaN(D)||isNaN(nt))throw new Error(`Invalid LngLat object: (${D}, ${nt})`);if(this.lng=+D,this.lat=+nt,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new em(C(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(D){let nt=Math.PI/180,_t=this.lat*nt,Rt=D.lat*nt,Kt=Math.sin(_t)*Math.sin(Rt)+Math.cos(_t)*Math.cos(Rt)*Math.cos((D.lng-this.lng)*nt);return Mb*Math.acos(Math.min(Kt,1))}static convert(D){if(D instanceof em)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new em(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new em(Number("lng"in D?D.lng:D.lon),Number(D.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}let B3=2*Math.PI*Mb;function Px(G){return B3*Math.cos(G*Math.PI/180)}function zx(G){return(180+G)/360}function N3(G){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+G*Math.PI/360)))/360}function w0(G,D){return G/Px(D)}function Sb(G){return 360/Math.PI*Math.atan(Math.exp((180-360*G)*Math.PI/180))-90}class Q1{constructor(D,nt,_t=0){this.x=+D,this.y=+nt,this.z=+_t}static fromLngLat(D,nt=0){let _t=em.convert(D);return new Q1(zx(_t.lng),N3(_t.lat),w0(nt,_t.lat))}toLngLat(){return new em(360*this.x-180,Sb(this.y))}toAltitude(){return this.z*Px(Sb(this.y))}meterInMercatorCoordinateUnits(){return 1/B3*(D=Sb(this.y),1/Math.cos(D*Math.PI/180));var D}}function j3(G,D,nt){var _t=2*Math.PI*6378137/256/Math.pow(2,nt);return[G*_t-2*Math.PI*6378137/2,D*_t-2*Math.PI*6378137/2]}class Eb{constructor(D,nt,_t){if(!function(Rt,Kt,Qt){return!(Rt<0||Rt>25||Qt<0||Qt>=Math.pow(2,Rt)||Kt<0||Kt>=Math.pow(2,Rt))}(D,nt,_t))throw new Error(`x=${nt}, y=${_t}, z=${D} outside of bounds. 0<=x<${Math.pow(2,D)}, 0<=y<${Math.pow(2,D)} 0<=z<=25 `);this.z=D,this.x=nt,this.y=_t,this.key=Bv(0,D,D,nt,_t)}equals(D){return this.z===D.z&&this.x===D.x&&this.y===D.y}url(D,nt,_t){let Rt=(Qt=this.y,be=this.z,Fe=j3(256*(Kt=this.x),256*(Qt=Math.pow(2,be)-Qt-1),be),er=j3(256*(Kt+1),256*(Qt+1),be),Fe[0]+","+Fe[1]+","+er[0]+","+er[1]);var Kt,Qt,be,Fe,er;let yr=function(Er,Zr,sn){let xn,Ln="";for(let $n=Er;$n>0;$n--)xn=1<<$n-1,Ln+=(Zr&xn?1:0)+(sn&xn?2:0);return Ln}(this.z,this.x,this.y);return D[(this.x+this.y)%D.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(_t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,nt>1?"@2x":"").replace(/{quadkey}/g,yr).replace(/{bbox-epsg-3857}/g,Rt)}isChildOf(D){let nt=this.z-D.z;return nt>0&&D.x===this.x>>nt&&D.y===this.y>>nt}getTilePoint(D){let nt=Math.pow(2,this.z);return new o((D.x*nt-this.x)*Ql,(D.y*nt-this.y)*Ql)}toString(){return`${this.z}/${this.x}/${this.y}`}}class U3{constructor(D,nt){this.wrap=D,this.canonical=nt,this.key=Bv(D,nt.z,nt.z,nt.x,nt.y)}}class l0{constructor(D,nt,_t,Rt,Kt){if(D<_t)throw new Error(`overscaledZ should be >= z; overscaledZ = ${D}; z = ${_t}`);this.overscaledZ=D,this.wrap=nt,this.canonical=new Eb(_t,+Rt,+Kt),this.key=Bv(nt,D,_t,Rt,Kt)}clone(){return new l0(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(D){return this.overscaledZ===D.overscaledZ&&this.wrap===D.wrap&&this.canonical.equals(D.canonical)}scaledTo(D){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);let nt=this.canonical.z-D;return D>this.canonical.z?new l0(D,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new l0(D,this.wrap,D,this.canonical.x>>nt,this.canonical.y>>nt)}calculateScaledKey(D,nt){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);let _t=this.canonical.z-D;return D>this.canonical.z?Bv(this.wrap*+nt,D,this.canonical.z,this.canonical.x,this.canonical.y):Bv(this.wrap*+nt,D,D,this.canonical.x>>_t,this.canonical.y>>_t)}isChildOf(D){if(D.wrap!==this.wrap)return!1;let nt=this.canonical.z-D.canonical.z;return D.overscaledZ===0||D.overscaledZ<this.overscaledZ&&D.canonical.x===this.canonical.x>>nt&&D.canonical.y===this.canonical.y>>nt}children(D){if(this.overscaledZ>=D)return[new l0(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let nt=this.canonical.z+1,_t=2*this.canonical.x,Rt=2*this.canonical.y;return[new l0(nt,this.wrap,nt,_t,Rt),new l0(nt,this.wrap,nt,_t+1,Rt),new l0(nt,this.wrap,nt,_t,Rt+1),new l0(nt,this.wrap,nt,_t+1,Rt+1)]}isLessThan(D){return this.wrap<D.wrap||!(this.wrap>D.wrap)&&(this.overscaledZ<D.overscaledZ||!(this.overscaledZ>D.overscaledZ)&&(this.canonical.x<D.canonical.x||!(this.canonical.x>D.canonical.x)&&this.canonical.y<D.canonical.y))}wrapped(){return new l0(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(D){return new l0(this.overscaledZ,D,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new U3(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(D){return this.canonical.getTilePoint(new Q1(D.x-this.wrap,D.y))}}function Bv(G,D,nt,_t,Rt){(G*=2)<0&&(G=-1*G-1);let Kt=1<<nt;return(Kt*Kt*G+Kt*Rt+_t).toString(36)+nt.toString(36)+D.toString(36)}Ji("CanonicalTileID",Eb),Ji("OverscaledTileID",l0,{omit:["posMatrix"]});class Bg{constructor(D,nt,_t,Rt=1,Kt=1,Qt=1,be=0){if(this.uid=D,nt.height!==nt.width)throw new RangeError("DEM tiles must be square");if(_t&&!["mapbox","terrarium","custom"].includes(_t))return void w(`"${_t}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=nt.height;let Fe=this.dim=nt.height-2;switch(this.data=new Uint32Array(nt.data.buffer),_t){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=Rt,this.greenFactor=Kt,this.blueFactor=Qt,this.baseShift=be;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let er=0;er<Fe;er++)this.data[this._idx(-1,er)]=this.data[this._idx(0,er)],this.data[this._idx(Fe,er)]=this.data[this._idx(Fe-1,er)],this.data[this._idx(er,-1)]=this.data[this._idx(er,0)],this.data[this._idx(er,Fe)]=this.data[this._idx(er,Fe-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(Fe,-1)]=this.data[this._idx(Fe-1,0)],this.data[this._idx(-1,Fe)]=this.data[this._idx(0,Fe-1)],this.data[this._idx(Fe,Fe)]=this.data[this._idx(Fe-1,Fe-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let er=0;er<Fe;er++)for(let yr=0;yr<Fe;yr++){let Er=this.get(er,yr);Er>this.max&&(this.max=Er),Er<this.min&&(this.min=Er)}}get(D,nt){let _t=new Uint8Array(this.data.buffer),Rt=4*this._idx(D,nt);return this.unpack(_t[Rt],_t[Rt+1],_t[Rt+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(D,nt){if(D<-1||D>=this.dim+1||nt<-1||nt>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(nt+1)*this.stride+(D+1)}unpack(D,nt,_t){return D*this.redFactor+nt*this.greenFactor+_t*this.blueFactor-this.baseShift}getPixels(){return new Al({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(D,nt,_t){if(this.dim!==D.dim)throw new Error("dem dimension mismatch");let Rt=nt*this.dim,Kt=nt*this.dim+this.dim,Qt=_t*this.dim,be=_t*this.dim+this.dim;switch(nt){case-1:Rt=Kt-1;break;case 1:Kt=Rt+1}switch(_t){case-1:Qt=be-1;break;case 1:be=Qt+1}let Fe=-nt*this.dim,er=-_t*this.dim;for(let yr=Qt;yr<be;yr++)for(let Er=Rt;Er<Kt;Er++)this.data[this._idx(Er,yr)]=D.data[this._idx(Er+Fe,yr+er)]}}Ji("DEMData",Bg);class V3{constructor(D){this._stringToNumber={},this._numberToString=[];for(let nt=0;nt<D.length;nt++){let _t=D[nt];this._stringToNumber[_t]=nt,this._numberToString[nt]=_t}}encode(D){return this._stringToNumber[D]}decode(D){if(D>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${D} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[D]}}class H3{constructor(D,nt,_t,Rt,Kt){this.type="Feature",this._vectorTileFeature=D,D._z=nt,D._x=_t,D._y=Rt,this.properties=D.properties,this.id=Kt}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(D){this._geometry=D}toJSON(){let D={geometry:this.geometry};for(let nt in this)nt!=="_geometry"&&nt!=="_vectorTileFeature"&&(D[nt]=this[nt]);return D}}class W3{constructor(D,nt){this.tileID=D,this.x=D.canonical.x,this.y=D.canonical.y,this.z=D.canonical.z,this.grid=new za(Ql,16,0),this.grid3D=new za(Ql,16,0),this.featureIndexArray=new mu,this.promoteId=nt}insert(D,nt,_t,Rt,Kt,Qt){let be=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(_t,Rt,Kt);let Fe=Qt?this.grid3D:this.grid;for(let er=0;er<nt.length;er++){let yr=nt[er],Er=[1/0,1/0,-1/0,-1/0];for(let Zr=0;Zr<yr.length;Zr++){let sn=yr[Zr];Er[0]=Math.min(Er[0],sn.x),Er[1]=Math.min(Er[1],sn.y),Er[2]=Math.max(Er[2],sn.x),Er[3]=Math.max(Er[3],sn.y)}Er[0]<Ql&&Er[1]<Ql&&Er[2]>=0&&Er[3]>=0&&Fe.insert(be,Er[0],Er[1],Er[2],Er[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new di.VectorTile(new gb(this.rawTileData)).layers,this.sourceLayerCoder=new V3(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(D,nt,_t,Rt){this.loadVTLayers();let Kt=D.params||{},Qt=Ql/D.tileSize/D.scale,be=Cf(Kt.filter),Fe=D.queryGeometry,er=D.queryPadding*Qt,yr=Cb(Fe),Er=this.grid.query(yr.minX-er,yr.minY-er,yr.maxX+er,yr.maxY+er),Zr=Cb(D.cameraQueryGeometry),sn=this.grid3D.query(Zr.minX-er,Zr.minY-er,Zr.maxX+er,Zr.maxY+er,($n,ki,Aa,Xi)=>function(ma,Ga,To,As,Sl){for(let cs of ma)if(Ga<=cs.x&&To<=cs.y&&As>=cs.x&&Sl>=cs.y)return!0;let ys=[new o(Ga,To),new o(Ga,Sl),new o(As,Sl),new o(As,To)];if(ma.length>2){for(let cs of ys)if(wi(ma,cs))return!0}for(let cs=0;cs<ma.length-1;cs++)if(hn(ma[cs],ma[cs+1],ys))return!0;return!1}(D.cameraQueryGeometry,$n-er,ki-er,Aa+er,Xi+er));for(let $n of sn)Er.push($n);Er.sort(Z3);let xn={},Ln;for(let $n=0;$n<Er.length;$n++){let ki=Er[$n];if(ki===Ln)continue;Ln=ki;let Aa=this.featureIndexArray.get(ki),Xi=null;this.loadMatchingFeature(xn,Aa.bucketIndex,Aa.sourceLayerIndex,Aa.featureIndex,be,Kt.layers,Kt.availableImages,nt,_t,Rt,(ma,Ga,To)=>(Xi||(Xi=kr(ma)),Ga.queryIntersectsFeature(Fe,ma,To,Xi,this.z,D.transform,Qt,D.pixelPosMatrix)))}return xn}loadMatchingFeature(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er){let Zr=this.bucketLayerIDs[nt];if(Qt&&!function($n,ki){for(let Aa=0;Aa<$n.length;Aa++)if(ki.indexOf($n[Aa])>=0)return!0;return!1}(Qt,Zr))return;let sn=this.sourceLayerCoder.decode(_t),xn=this.vtLayers[sn].feature(Rt);if(Kt.needGeometry){let $n=Lr(xn,!0);if(!Kt.filter(new Fl(this.tileID.overscaledZ),$n,this.tileID.canonical))return}else if(!Kt.filter(new Fl(this.tileID.overscaledZ),xn))return;let Ln=this.getId(xn,sn);for(let $n=0;$n<Zr.length;$n++){let ki=Zr[$n];if(Qt&&Qt.indexOf(ki)<0)continue;let Aa=Fe[ki];if(!Aa)continue;let Xi={};Ln&&yr&&(Xi=yr.getState(Aa.sourceLayer||"_geojsonTileLayer",Ln));let ma=M({},er[ki]);ma.paint=q3(ma.paint,Aa.paint,xn,Xi,be),ma.layout=q3(ma.layout,Aa.layout,xn,Xi,be);let Ga=!Er||Er(xn,Aa,Xi);if(!Ga)continue;let To=new H3(xn,this.z,this.x,this.y,Ln);To.layer=ma;let As=D[ki];As===void 0&&(As=D[ki]=[]),As.push({featureIndex:Rt,feature:To,intersectionZ:Ga})}}lookupSymbolFeatures(D,nt,_t,Rt,Kt,Qt,be,Fe){let er={};this.loadVTLayers();let yr=Cf(Kt);for(let Er of D)this.loadMatchingFeature(er,_t,Rt,Er,yr,Qt,be,Fe,nt);return er}hasLayer(D){for(let nt of this.bucketLayerIDs)for(let _t of nt)if(D===_t)return!0;return!1}getId(D,nt){let _t=D.id;return this.promoteId&&(_t=D.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[nt]],typeof _t=="boolean"&&(_t=Number(_t))),_t}}function q3(G,D,nt,_t,Rt){return A(G,(Kt,Qt)=>{let be=D instanceof Ih?D.get(Qt):null;return be&&be.evaluate?be.evaluate(nt,_t,Rt):be})}function Cb(G){let D=1/0,nt=1/0,_t=-1/0,Rt=-1/0;for(let Kt of G)D=Math.min(D,Kt.x),nt=Math.min(nt,Kt.y),_t=Math.max(_t,Kt.x),Rt=Math.max(Rt,Kt.y);return{minX:D,minY:nt,maxX:_t,maxY:Rt}}function Z3(G,D){return D-G}function $3(G,D,nt,_t,Rt){let Kt=[];for(let Qt=0;Qt<G.length;Qt++){let be=G[Qt],Fe;for(let er=0;er<be.length-1;er++){let yr=be[er],Er=be[er+1];yr.x<D&&Er.x<D||(yr.x<D?yr=new o(D,yr.y+(D-yr.x)/(Er.x-yr.x)*(Er.y-yr.y))._round():Er.x<D&&(Er=new o(D,yr.y+(D-yr.x)/(Er.x-yr.x)*(Er.y-yr.y))._round()),yr.y<nt&&Er.y<nt||(yr.y<nt?yr=new o(yr.x+(nt-yr.y)/(Er.y-yr.y)*(Er.x-yr.x),nt)._round():Er.y<nt&&(Er=new o(yr.x+(nt-yr.y)/(Er.y-yr.y)*(Er.x-yr.x),nt)._round()),yr.x>=_t&&Er.x>=_t||(yr.x>=_t?yr=new o(_t,yr.y+(_t-yr.x)/(Er.x-yr.x)*(Er.y-yr.y))._round():Er.x>=_t&&(Er=new o(_t,yr.y+(_t-yr.x)/(Er.x-yr.x)*(Er.y-yr.y))._round()),yr.y>=Rt&&Er.y>=Rt||(yr.y>=Rt?yr=new o(yr.x+(Rt-yr.y)/(Er.y-yr.y)*(Er.x-yr.x),Rt)._round():Er.y>=Rt&&(Er=new o(yr.x+(Rt-yr.y)/(Er.y-yr.y)*(Er.x-yr.x),Rt)._round()),Fe&&yr.equals(Fe[Fe.length-1])||(Fe=[yr],Kt.push(Fe)),Fe.push(Er)))))}}return Kt}Ji("FeatureIndex",W3,{omit:["rawTileData","sourceLayerCoder"]});class Km extends o{constructor(D,nt,_t,Rt){super(D,nt),this.angle=_t,Rt!==void 0&&(this.segment=Rt)}clone(){return new Km(this.x,this.y,this.angle,this.segment)}}function G3(G,D,nt,_t,Rt){if(D.segment===void 0||nt===0)return!0;let Kt=D,Qt=D.segment+1,be=0;for(;be>-nt/2;){if(Qt--,Qt<0)return!1;be-=G[Qt].dist(Kt),Kt=G[Qt]}be+=G[Qt].dist(G[Qt+1]),Qt++;let Fe=[],er=0;for(;be<nt/2;){let yr=G[Qt],Er=G[Qt+1];if(!Er)return!1;let Zr=G[Qt-1].angleTo(yr)-yr.angleTo(Er);for(Zr=Math.abs((Zr+3*Math.PI)%(2*Math.PI)-Math.PI),Fe.push({distance:be,angleDelta:Zr}),er+=Zr;be-Fe[0].distance>_t;)er-=Fe.shift().angleDelta;if(er>Rt)return!1;Qt++,be+=yr.dist(Er)}return!0}function Y3(G){let D=0;for(let nt=0;nt<G.length-1;nt++)D+=G[nt].dist(G[nt+1]);return D}function K3(G,D,nt){return G?.6*D*nt:0}function X3(G,D){return Math.max(G?G.right-G.left:0,D?D.right-D.left:0)}function qT(G,D,nt,_t,Rt,Kt){let Qt=K3(nt,Rt,Kt),be=X3(nt,_t)*Kt,Fe=0,er=Y3(G)/2;for(let yr=0;yr<G.length-1;yr++){let Er=G[yr],Zr=G[yr+1],sn=Er.dist(Zr);if(Fe+sn>er){let xn=(er-Fe)/sn,Ln=Do.number(Er.x,Zr.x,xn),$n=Do.number(Er.y,Zr.y,xn),ki=new Km(Ln,$n,Zr.angleTo(Er),yr);return ki._round(),!Qt||G3(G,ki,be,Qt,D)?ki:void 0}Fe+=sn}}function ZT(G,D,nt,_t,Rt,Kt,Qt,be,Fe){let er=K3(_t,Kt,Qt),yr=X3(_t,Rt),Er=yr*Qt,Zr=G[0].x===0||G[0].x===Fe||G[0].y===0||G[0].y===Fe;return D-Er<D/4&&(D=Er+D/4),Ng(G,Zr?D/2*be%D:(yr/2+2*Kt)*Qt*be%D,D,er,nt,Er,Zr,!1,Fe)}function Ng(G,D,nt,_t,Rt,Kt,Qt,be,Fe){let er=Kt/2,yr=Y3(G),Er=0,Zr=D-nt,sn=[];for(let xn=0;xn<G.length-1;xn++){let Ln=G[xn],$n=G[xn+1],ki=Ln.dist($n),Aa=$n.angleTo(Ln);for(;Zr+nt<Er+ki;){Zr+=nt;let Xi=(Zr-Er)/ki,ma=Do.number(Ln.x,$n.x,Xi),Ga=Do.number(Ln.y,$n.y,Xi);if(ma>=0&&ma<Fe&&Ga>=0&&Ga<Fe&&Zr-er>=0&&Zr+er<=yr){let To=new Km(ma,Ga,Aa,xn);To._round(),_t&&!G3(G,To,Kt,_t,Rt)||sn.push(To)}}Er+=ki}return be||sn.length||Qt||(sn=Ng(G,Er/2,nt,_t,Rt,Kt,Qt,!0,Fe)),sn}Ji("Anchor",Km);let Nv=Qf;function J3(G,D,nt,_t){let Rt=[],Kt=G.image,Qt=Kt.pixelRatio,be=Kt.paddedRect.w-2*Nv,Fe=Kt.paddedRect.h-2*Nv,er={x1:G.left,y1:G.top,x2:G.right,y2:G.bottom},yr=Kt.stretchX||[[0,be]],Er=Kt.stretchY||[[0,Fe]],Zr=(oo,nl)=>oo+nl[1]-nl[0],sn=yr.reduce(Zr,0),xn=Er.reduce(Zr,0),Ln=be-sn,$n=Fe-xn,ki=0,Aa=sn,Xi=0,ma=xn,Ga=0,To=Ln,As=0,Sl=$n;if(Kt.content&&_t){let oo=Kt.content,nl=oo[2]-oo[0],Ks=oo[3]-oo[1];(Kt.textFitWidth||Kt.textFitHeight)&&(er=I3(G)),ki=jv(yr,0,oo[0]),Xi=jv(Er,0,oo[1]),Aa=jv(yr,oo[0],oo[2]),ma=jv(Er,oo[1],oo[3]),Ga=oo[0]-ki,As=oo[1]-Xi,To=nl-Aa,Sl=Ks-ma}let ys=er.x1,cs=er.y1,Ys=er.x2-ys,Bs=er.y2-cs,Is=(oo,nl,Ks,Wl)=>{let uh=jp(oo.stretch-ki,Aa,Ys,ys),nh=Ix(oo.fixed-Ga,To,oo.stretch,sn),gd=jp(nl.stretch-Xi,ma,Bs,cs),Ep=Ix(nl.fixed-As,Sl,nl.stretch,xn),If=jp(Ks.stretch-ki,Aa,Ys,ys),td=Ix(Ks.fixed-Ga,To,Ks.stretch,sn),dp=jp(Wl.stretch-Xi,ma,Bs,cs),pp=Ix(Wl.fixed-As,Sl,Wl.stretch,xn),mp=new o(uh,gd),of=new o(If,gd),vd=new o(If,dp),rp=new o(uh,dp),Gd=new o(nh/Qt,Ep/Qt),gp=new o(td/Qt,pp/Qt),Od=D*Math.PI/180;if(Od){let rc=Math.sin(Od),Ic=Math.cos(Od),$c=[Ic,-rc,rc,Ic];mp._matMult($c),of._matMult($c),rp._matMult($c),vd._matMult($c)}let Up=oo.stretch+oo.fixed,wh=nl.stretch+nl.fixed;return{tl:mp,tr:of,bl:rp,br:vd,tex:{x:Kt.paddedRect.x+Nv+Up,y:Kt.paddedRect.y+Nv+wh,w:Ks.stretch+Ks.fixed-Up,h:Wl.stretch+Wl.fixed-wh},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Gd,pixelOffsetBR:gp,minFontScaleX:To/Qt/Ys,minFontScaleY:Sl/Qt/Bs,isSDF:nt}};if(_t&&(Kt.stretchX||Kt.stretchY)){let oo=Uv(yr,Ln,sn),nl=Uv(Er,$n,xn);for(let Ks=0;Ks<oo.length-1;Ks++){let Wl=oo[Ks],uh=oo[Ks+1];for(let nh=0;nh<nl.length-1;nh++)Rt.push(Is(Wl,nl[nh],uh,nl[nh+1]))}}else Rt.push(Is({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:be+1},{fixed:0,stretch:Fe+1}));return Rt}function jv(G,D,nt){let _t=0;for(let Rt of G)_t+=Math.max(D,Math.min(nt,Rt[1]))-Math.max(D,Math.min(nt,Rt[0]));return _t}function Uv(G,D,nt){let _t=[{fixed:-Nv,stretch:0}];for(let[Rt,Kt]of G){let Qt=_t[_t.length-1];_t.push({fixed:Rt-Qt.stretch,stretch:Qt.stretch}),_t.push({fixed:Rt-Qt.stretch,stretch:Qt.stretch+(Kt-Rt)})}return _t.push({fixed:D+Nv,stretch:nt}),_t}function jp(G,D,nt,_t){return G/D*nt+_t}function Ix(G,D,nt,_t){return G-D*nt/_t}class Ox{constructor(D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr){var Er;if(this.boxStartIndex=D.length,er){let Zr=Qt.top,sn=Qt.bottom,xn=Qt.collisionPadding;xn&&(Zr-=xn[1],sn+=xn[3]);let Ln=sn-Zr;Ln>0&&(Ln=Math.max(10,Ln),this.circleDiameter=Ln)}else{let Zr=!((Er=Qt.image)===null||Er===void 0)&&Er.content&&(Qt.image.textFitWidth||Qt.image.textFitHeight)?I3(Qt):{x1:Qt.left,y1:Qt.top,x2:Qt.right,y2:Qt.bottom};Zr.y1=Zr.y1*be-Fe[0],Zr.y2=Zr.y2*be+Fe[2],Zr.x1=Zr.x1*be-Fe[3],Zr.x2=Zr.x2*be+Fe[1];let sn=Qt.collisionPadding;if(sn&&(Zr.x1-=sn[0]*be,Zr.y1-=sn[1]*be,Zr.x2+=sn[2]*be,Zr.y2+=sn[3]*be),yr){let xn=new o(Zr.x1,Zr.y1),Ln=new o(Zr.x2,Zr.y1),$n=new o(Zr.x1,Zr.y2),ki=new o(Zr.x2,Zr.y2),Aa=yr*Math.PI/180;xn._rotate(Aa),Ln._rotate(Aa),$n._rotate(Aa),ki._rotate(Aa),Zr.x1=Math.min(xn.x,Ln.x,$n.x,ki.x),Zr.x2=Math.max(xn.x,Ln.x,$n.x,ki.x),Zr.y1=Math.min(xn.y,Ln.y,$n.y,ki.y),Zr.y2=Math.max(xn.y,Ln.y,$n.y,ki.y)}D.emplaceBack(nt.x,nt.y,Zr.x1,Zr.y1,Zr.x2,Zr.y2,_t,Rt,Kt)}this.boxEndIndex=D.length}}class $T{constructor(D=[],nt=(_t,Rt)=>_t<Rt?-1:_t>Rt?1:0){if(this.data=D,this.length=this.data.length,this.compare=nt,this.length>0)for(let _t=(this.length>>1)-1;_t>=0;_t--)this._down(_t)}push(D){this.data.push(D),this._up(this.length++)}pop(){if(this.length===0)return;let D=this.data[0],nt=this.data.pop();return--this.length>0&&(this.data[0]=nt,this._down(0)),D}peek(){return this.data[0]}_up(D){let{data:nt,compare:_t}=this,Rt=nt[D];for(;D>0;){let Kt=D-1>>1,Qt=nt[Kt];if(_t(Rt,Qt)>=0)break;nt[D]=Qt,D=Kt}nt[D]=Rt}_down(D){let{data:nt,compare:_t}=this,Rt=this.length>>1,Kt=nt[D];for(;D<Rt;){let Qt=1+(D<<1),be=Qt+1;if(be<this.length&&_t(nt[be],nt[Qt])<0&&(Qt=be),_t(nt[Qt],Kt)>=0)break;nt[D]=nt[Qt],D=Qt}nt[D]=Kt}}function GT(G,D=1,nt=!1){let _t=1/0,Rt=1/0,Kt=-1/0,Qt=-1/0,be=G[0];for(let sn=0;sn<be.length;sn++){let xn=be[sn];(!sn||xn.x<_t)&&(_t=xn.x),(!sn||xn.y<Rt)&&(Rt=xn.y),(!sn||xn.x>Kt)&&(Kt=xn.x),(!sn||xn.y>Qt)&&(Qt=xn.y)}let Fe=Math.min(Kt-_t,Qt-Rt),er=Fe/2,yr=new $T([],YT);if(Fe===0)return new o(_t,Rt);for(let sn=_t;sn<Kt;sn+=Fe)for(let xn=Rt;xn<Qt;xn+=Fe)yr.push(new rm(sn+er,xn+er,er,G));let Er=function(sn){let xn=0,Ln=0,$n=0,ki=sn[0];for(let Aa=0,Xi=ki.length,ma=Xi-1;Aa<Xi;ma=Aa++){let Ga=ki[Aa],To=ki[ma],As=Ga.x*To.y-To.x*Ga.y;Ln+=(Ga.x+To.x)*As,$n+=(Ga.y+To.y)*As,xn+=3*As}return new rm(Ln/xn,$n/xn,0,sn)}(G),Zr=yr.length;for(;yr.length;){let sn=yr.pop();(sn.d>Er.d||!Er.d)&&(Er=sn,nt&&console.log("found best %d after %d probes",Math.round(1e4*sn.d)/1e4,Zr)),sn.max-Er.d<=D||(er=sn.h/2,yr.push(new rm(sn.p.x-er,sn.p.y-er,er,G)),yr.push(new rm(sn.p.x+er,sn.p.y-er,er,G)),yr.push(new rm(sn.p.x-er,sn.p.y+er,er,G)),yr.push(new rm(sn.p.x+er,sn.p.y+er,er,G)),Zr+=4)}return nt&&(console.log(`num probes: ${Zr}`),console.log(`best distance: ${Er.d}`)),Er.p}function YT(G,D){return D.max-G.max}function rm(G,D,nt,_t){this.p=new o(G,D),this.h=nt,this.d=function(Rt,Kt){let Qt=!1,be=1/0;for(let Fe=0;Fe<Kt.length;Fe++){let er=Kt[Fe];for(let yr=0,Er=er.length,Zr=Er-1;yr<Er;Zr=yr++){let sn=er[yr],xn=er[Zr];sn.y>Rt.y!=xn.y>Rt.y&&Rt.x<(xn.x-sn.x)*(Rt.y-sn.y)/(xn.y-sn.y)+sn.x&&(Qt=!Qt),be=Math.min(be,Ba(Rt,sn,xn))}}return(Qt?1:-1)*Math.sqrt(be)}(this.p,_t),this.max=this.d+this.h*Math.SQRT2}var Id;t.aq=void 0,(Id=t.aq||(t.aq={}))[Id.center=1]="center",Id[Id.left=2]="left",Id[Id.right=3]="right",Id[Id.top=4]="top",Id[Id.bottom=5]="bottom",Id[Id["top-left"]=6]="top-left",Id[Id["top-right"]=7]="top-right",Id[Id["bottom-left"]=8]="bottom-left",Id[Id["bottom-right"]=9]="bottom-right";let Xm=7,Lb=Number.POSITIVE_INFINITY;function Q3(G,D){return D[1]!==Lb?function(nt,_t,Rt){let Kt=0,Qt=0;switch(_t=Math.abs(_t),Rt=Math.abs(Rt),nt){case"top-right":case"top-left":case"top":Qt=Rt-Xm;break;case"bottom-right":case"bottom-left":case"bottom":Qt=-Rt+Xm}switch(nt){case"top-right":case"bottom-right":case"right":Kt=-_t;break;case"top-left":case"bottom-left":case"left":Kt=_t}return[Kt,Qt]}(G,D[0],D[1]):function(nt,_t){let Rt=0,Kt=0;_t<0&&(_t=0);let Qt=_t/Math.SQRT2;switch(nt){case"top-right":case"top-left":Kt=Qt-Xm;break;case"bottom-right":case"bottom-left":Kt=-Qt+Xm;break;case"bottom":Kt=-_t+Xm;break;case"top":Kt=_t-Xm}switch(nt){case"top-right":case"bottom-right":Rt=-Qt;break;case"top-left":case"bottom-left":Rt=Qt;break;case"left":Rt=_t;break;case"right":Rt=-_t}return[Rt,Kt]}(G,D[0])}function t5(G,D,nt){var _t;let Rt=G.layout,Kt=(_t=Rt.get("text-variable-anchor-offset"))===null||_t===void 0?void 0:_t.evaluate(D,{},nt);if(Kt){let be=Kt.values,Fe=[];for(let er=0;er<be.length;er+=2){let yr=Fe[er]=be[er],Er=be[er+1].map(Zr=>Zr*bc);yr.startsWith("top")?Er[1]-=Xm:yr.startsWith("bottom")&&(Er[1]+=Xm),Fe[er+1]=Er}return new xi(Fe)}let Qt=Rt.get("text-variable-anchor");if(Qt){let be;be=G._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Rt.get("text-radial-offset").evaluate(D,{},nt)*bc,Lb]:Rt.get("text-offset").evaluate(D,{},nt).map(er=>er*bc);let Fe=[];for(let er of Qt)Fe.push(er,Q3(er,be));return new xi(Fe)}return null}function Pb(G){switch(G){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function KT(G,D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr){let Er=Kt.textMaxSize.evaluate(D,{});Er===void 0&&(Er=Qt);let Zr=G.layers[0].layout,sn=Zr.get("icon-offset").evaluate(D,{},yr),xn=r5(nt.horizontal),Ln=Qt/24,$n=G.tilePixelRatio*Ln,ki=G.tilePixelRatio*Er/24,Aa=G.tilePixelRatio*be,Xi=G.tilePixelRatio*Zr.get("symbol-spacing"),ma=Zr.get("text-padding")*G.tilePixelRatio,Ga=function(oo,nl,Ks,Wl=1){let uh=oo.get("icon-padding").evaluate(nl,{},Ks),nh=uh&&uh.values;return[nh[0]*Wl,nh[1]*Wl,nh[2]*Wl,nh[3]*Wl]}(Zr,D,yr,G.tilePixelRatio),To=Zr.get("text-max-angle")/180*Math.PI,As=Zr.get("text-rotation-alignment")!=="viewport"&&Zr.get("symbol-placement")!=="point",Sl=Zr.get("icon-rotation-alignment")==="map"&&Zr.get("symbol-placement")!=="point",ys=Zr.get("symbol-placement"),cs=Xi/2,Ys=Zr.get("icon-text-fit"),Bs;_t&&Ys!=="none"&&(G.allowVerticalPlacement&&nt.vertical&&(Bs=O3(_t,nt.vertical,Ys,Zr.get("icon-text-fit-padding"),sn,Ln)),xn&&(_t=O3(_t,xn,Ys,Zr.get("icon-text-fit-padding"),sn,Ln)));let Is=(oo,nl)=>{nl.x<0||nl.x>=Ql||nl.y<0||nl.y>=Ql||function(Ks,Wl,uh,nh,gd,Ep,If,td,dp,pp,mp,of,vd,rp,Gd,gp,Od,Up,wh,rc,Ic,$c,$h,kh,Wv){let j0=Ks.addToLineVertexArray(Wl,uh),U0,np,ch,Dd,k0=0,Vp=0,vp=0,Rb=0,Bb=-1,Bx=-1,Am={},Nb=Yn("");if(Ks.allowVerticalPlacement&&nh.vertical){let Yd=td.layout.get("text-rotate").evaluate(Ic,{},kh)+90;ch=new Ox(dp,Wl,pp,mp,of,nh.vertical,vd,rp,Gd,Yd),If&&(Dd=new Ox(dp,Wl,pp,mp,of,If,Od,Up,Gd,Yd))}if(gd){let Yd=td.layout.get("icon-rotate").evaluate(Ic,{}),Hp=td.layout.get("icon-text-fit")!=="none",Jm=J3(gd,Yd,$h,Hp),V0=If?J3(If,Yd,$h,Hp):void 0;np=new Ox(dp,Wl,pp,mp,of,gd,Od,Up,!1,Yd),k0=4*Jm.length;let jg=Ks.iconSizeData,H0=null;jg.kind==="source"?(H0=[tm*td.layout.get("icon-size").evaluate(Ic,{})],H0[0]>Gm&&w(`${Ks.layerIds[0]}: Value for "icon-size" is >= ${G1}. Reduce your "icon-size".`)):jg.kind==="composite"&&(H0=[tm*$c.compositeIconSizes[0].evaluate(Ic,{},kh),tm*$c.compositeIconSizes[1].evaluate(Ic,{},kh)],(H0[0]>Gm||H0[1]>Gm)&&w(`${Ks.layerIds[0]}: Value for "icon-size" is >= ${G1}. Reduce your "icon-size".`)),Ks.addSymbols(Ks.icon,Jm,H0,rc,wh,Ic,t.ah.none,Wl,j0.lineStartIndex,j0.lineLength,-1,kh),Bb=Ks.icon.placedSymbolArray.length-1,V0&&(Vp=4*V0.length,Ks.addSymbols(Ks.icon,V0,H0,rc,wh,Ic,t.ah.vertical,Wl,j0.lineStartIndex,j0.lineLength,-1,kh),Bx=Ks.icon.placedSymbolArray.length-1)}let jb=Object.keys(nh.horizontal);for(let Yd of jb){let Hp=nh.horizontal[Yd];if(!U0){Nb=Yn(Hp.text);let V0=td.layout.get("text-rotate").evaluate(Ic,{},kh);U0=new Ox(dp,Wl,pp,mp,of,Hp,vd,rp,Gd,V0)}let Jm=Hp.positionedLines.length===1;if(vp+=e5(Ks,Wl,Hp,Ep,td,Gd,Ic,gp,j0,nh.vertical?t.ah.horizontal:t.ah.horizontalOnly,Jm?jb:[Yd],Am,Bb,$c,kh),Jm)break}nh.vertical&&(Rb+=e5(Ks,Wl,nh.vertical,Ep,td,Gd,Ic,gp,j0,t.ah.vertical,["vertical"],Am,Bx,$c,kh));let Ub=U0?U0.boxStartIndex:Ks.collisionBoxArray.length,Vb=U0?U0.boxEndIndex:Ks.collisionBoxArray.length,XT=ch?ch.boxStartIndex:Ks.collisionBoxArray.length,JT=ch?ch.boxEndIndex:Ks.collisionBoxArray.length,QT=np?np.boxStartIndex:Ks.collisionBoxArray.length,t8=np?np.boxEndIndex:Ks.collisionBoxArray.length,s5=Dd?Dd.boxStartIndex:Ks.collisionBoxArray.length,qv=Dd?Dd.boxEndIndex:Ks.collisionBoxArray.length,ed=-1,Zv=(Yd,Hp)=>Yd&&Yd.circleDiameter?Math.max(Yd.circleDiameter,Hp):Hp;ed=Zv(U0,ed),ed=Zv(ch,ed),ed=Zv(np,ed),ed=Zv(Dd,ed);let Hb=ed>-1?1:0;Hb&&(ed*=Wv/bc),Ks.glyphOffsetArray.length>=Rg.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ic.sortKey!==void 0&&Ks.addToSortKeyRanges(Ks.symbolInstances.length,Ic.sortKey);let l5=t5(td,Ic,kh),[e8,u5]=function(Yd,Hp){let Jm=Yd.length,V0=Hp?.values;if(V0?.length>0)for(let jg=0;jg<V0.length;jg+=2){let H0=V0[jg+1];Yd.emplaceBack(t.aq[V0[jg]],H0[0],H0[1])}return[Jm,Yd.length]}(Ks.textAnchorOffsets,l5);Ks.symbolInstances.emplaceBack(Wl.x,Wl.y,Am.right>=0?Am.right:-1,Am.center>=0?Am.center:-1,Am.left>=0?Am.left:-1,Am.vertical||-1,Bb,Bx,Nb,Ub,Vb,XT,JT,QT,t8,s5,qv,pp,vp,Rb,k0,Vp,Hb,0,vd,ed,e8,u5)}(G,nl,oo,nt,_t,Rt,Bs,G.layers[0],G.collisionBoxArray,D.index,D.sourceLayerIndex,G.index,$n,[ma,ma,ma,ma],As,Fe,Aa,Ga,Sl,sn,D,Kt,er,yr,Qt)};if(ys==="line")for(let oo of $3(D.geometry,0,0,Ql,Ql)){let nl=ZT(oo,Xi,To,nt.vertical||xn,_t,24,ki,G.overscaling,Ql);for(let Ks of nl)xn&&n5(G,xn.text,cs,Ks)||Is(oo,Ks)}else if(ys==="line-center"){for(let oo of D.geometry)if(oo.length>1){let nl=qT(oo,To,nt.vertical||xn,_t,24,ki);nl&&Is(oo,nl)}}else if(D.type==="Polygon")for(let oo of Jc(D.geometry,0)){let nl=GT(oo,16);Is(oo[0],new Km(nl.x,nl.y,0))}else if(D.type==="LineString")for(let oo of D.geometry)Is(oo,new Km(oo[0].x,oo[0].y,0));else if(D.type==="Point")for(let oo of D.geometry)for(let nl of oo)Is([nl],new Km(nl.x,nl.y,0))}function e5(G,D,nt,_t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr,sn,xn){let Ln=function(Aa,Xi,ma,Ga,To,As,Sl,ys){let cs=Ga.layout.get("text-rotate").evaluate(As,{})*Math.PI/180,Ys=[];for(let Bs of Xi.positionedLines)for(let Is of Bs.positionedGlyphs){if(!Is.rect)continue;let oo=Is.rect||{},nl=yb+1,Ks=!0,Wl=1,uh=0,nh=(To||ys)&&Is.vertical,gd=Is.metrics.advance*Is.scale/2;if(ys&&Xi.verticalizable&&(uh=Bs.lineOffset/2-(Is.imageName?-(bc-Is.metrics.width*Is.scale)/2:(Is.scale-1)*bc)),Is.imageName){let rc=Sl[Is.imageName];Ks=rc.sdf,Wl=rc.pixelRatio,nl=Qf/Wl}let Ep=To?[Is.x+gd,Is.y]:[0,0],If=To?[0,0]:[Is.x+gd+ma[0],Is.y+ma[1]-uh],td=[0,0];nh&&(td=If,If=[0,0]);let dp=Is.metrics.isDoubleResolution?2:1,pp=(Is.metrics.left-nl)*Is.scale-gd+If[0],mp=(-Is.metrics.top-nl)*Is.scale+If[1],of=pp+oo.w/dp*Is.scale/Wl,vd=mp+oo.h/dp*Is.scale/Wl,rp=new o(pp,mp),Gd=new o(of,mp),gp=new o(pp,vd),Od=new o(of,vd);if(nh){let rc=new o(-gd,gd-Ov),Ic=-Math.PI/2,$c=bc/2-gd,$h=new o(5-Ov-$c,-(Is.imageName?$c:0)),kh=new o(...td);rp._rotateAround(Ic,rc)._add($h)._add(kh),Gd._rotateAround(Ic,rc)._add($h)._add(kh),gp._rotateAround(Ic,rc)._add($h)._add(kh),Od._rotateAround(Ic,rc)._add($h)._add(kh)}if(cs){let rc=Math.sin(cs),Ic=Math.cos(cs),$c=[Ic,-rc,rc,Ic];rp._matMult($c),Gd._matMult($c),gp._matMult($c),Od._matMult($c)}let Up=new o(0,0),wh=new o(0,0);Ys.push({tl:rp,tr:Gd,bl:gp,br:Od,tex:oo,writingMode:Xi.writingMode,glyphOffset:Ep,sectionIndex:Is.sectionIndex,isSDF:Ks,pixelOffsetTL:Up,pixelOffsetBR:wh,minFontScaleX:0,minFontScaleY:0})}return Ys}(0,nt,be,Rt,Kt,Qt,_t,G.allowVerticalPlacement),$n=G.textSizeData,ki=null;$n.kind==="source"?(ki=[tm*Rt.layout.get("text-size").evaluate(Qt,{})],ki[0]>Gm&&w(`${G.layerIds[0]}: Value for "text-size" is >= ${G1}. Reduce your "text-size".`)):$n.kind==="composite"&&(ki=[tm*sn.compositeTextSizes[0].evaluate(Qt,{},xn),tm*sn.compositeTextSizes[1].evaluate(Qt,{},xn)],(ki[0]>Gm||ki[1]>Gm)&&w(`${G.layerIds[0]}: Value for "text-size" is >= ${G1}. Reduce your "text-size".`)),G.addSymbols(G.text,Ln,ki,be,Kt,Qt,er,D,Fe.lineStartIndex,Fe.lineLength,Zr,xn);for(let Aa of yr)Er[Aa]=G.text.placedSymbolArray.length-1;return 4*Ln.length}function r5(G){for(let D in G)return G[D];return null}function n5(G,D,nt,_t){let Rt=G.compareText;if(D in Rt){let Kt=Rt[D];for(let Qt=Kt.length-1;Qt>=0;Qt--)if(_t.dist(Kt[Qt])<nt)return!0}else Rt[D]=[];return Rt[D].push(_t),!1}let i5=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class zb{static from(D){if(!(D instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[nt,_t]=new Uint8Array(D,0,2);if(nt!==219)throw new Error("Data does not appear to be in a KDBush format.");let Rt=_t>>4;if(Rt!==1)throw new Error(`Got v${Rt} data when expected v1.`);let Kt=i5[15&_t];if(!Kt)throw new Error("Unrecognized array type.");let[Qt]=new Uint16Array(D,2,1),[be]=new Uint32Array(D,4,1);return new zb(be,Qt,Kt,D)}constructor(D,nt=64,_t=Float64Array,Rt){if(isNaN(D)||D<0)throw new Error(`Unpexpected numItems value: ${D}.`);this.numItems=+D,this.nodeSize=Math.min(Math.max(+nt,2),65535),this.ArrayType=_t,this.IndexArrayType=D<65536?Uint16Array:Uint32Array;let Kt=i5.indexOf(this.ArrayType),Qt=2*D*this.ArrayType.BYTES_PER_ELEMENT,be=D*this.IndexArrayType.BYTES_PER_ELEMENT,Fe=(8-be%8)%8;if(Kt<0)throw new Error(`Unexpected typed array class: ${_t}.`);Rt&&Rt instanceof ArrayBuffer?(this.data=Rt,this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+be+Fe,2*D),this._pos=2*D,this._finished=!0):(this.data=new ArrayBuffer(8+Qt+be+Fe),this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+be+Fe,2*D),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Kt]),new Uint16Array(this.data,2,1)[0]=nt,new Uint32Array(this.data,4,1)[0]=D)}add(D,nt){let _t=this._pos>>1;return this.ids[_t]=_t,this.coords[this._pos++]=D,this.coords[this._pos++]=nt,_t}finish(){let D=this._pos>>1;if(D!==this.numItems)throw new Error(`Added ${D} items when expected ${this.numItems}.`);return Ib(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(D,nt,_t,Rt){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Kt,coords:Qt,nodeSize:be}=this,Fe=[0,Kt.length-1,0],er=[];for(;Fe.length;){let yr=Fe.pop()||0,Er=Fe.pop()||0,Zr=Fe.pop()||0;if(Er-Zr<=be){for(let $n=Zr;$n<=Er;$n++){let ki=Qt[2*$n],Aa=Qt[2*$n+1];ki>=D&&ki<=_t&&Aa>=nt&&Aa<=Rt&&er.push(Kt[$n])}continue}let sn=Zr+Er>>1,xn=Qt[2*sn],Ln=Qt[2*sn+1];xn>=D&&xn<=_t&&Ln>=nt&&Ln<=Rt&&er.push(Kt[sn]),(yr===0?D<=xn:nt<=Ln)&&(Fe.push(Zr),Fe.push(sn-1),Fe.push(1-yr)),(yr===0?_t>=xn:Rt>=Ln)&&(Fe.push(sn+1),Fe.push(Er),Fe.push(1-yr))}return er}within(D,nt,_t){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Rt,coords:Kt,nodeSize:Qt}=this,be=[0,Rt.length-1,0],Fe=[],er=_t*_t;for(;be.length;){let yr=be.pop()||0,Er=be.pop()||0,Zr=be.pop()||0;if(Er-Zr<=Qt){for(let $n=Zr;$n<=Er;$n++)$d(Kt[2*$n],Kt[2*$n+1],D,nt)<=er&&Fe.push(Rt[$n]);continue}let sn=Zr+Er>>1,xn=Kt[2*sn],Ln=Kt[2*sn+1];$d(xn,Ln,D,nt)<=er&&Fe.push(Rt[sn]),(yr===0?D-_t<=xn:nt-_t<=Ln)&&(be.push(Zr),be.push(sn-1),be.push(1-yr)),(yr===0?D+_t>=xn:nt+_t>=Ln)&&(be.push(sn+1),be.push(Er),be.push(1-yr))}return Fe}}function Ib(G,D,nt,_t,Rt,Kt){if(Rt-_t<=nt)return;let Qt=_t+Rt>>1;a5(G,D,Qt,_t,Rt,Kt),Ib(G,D,nt,_t,Qt-1,1-Kt),Ib(G,D,nt,Qt+1,Rt,1-Kt)}function a5(G,D,nt,_t,Rt,Kt){for(;Rt>_t;){if(Rt-_t>600){let er=Rt-_t+1,yr=nt-_t+1,Er=Math.log(er),Zr=.5*Math.exp(2*Er/3),sn=.5*Math.sqrt(Er*Zr*(er-Zr)/er)*(yr-er/2<0?-1:1);a5(G,D,nt,Math.max(_t,Math.floor(nt-yr*Zr/er+sn)),Math.min(Rt,Math.floor(nt+(er-yr)*Zr/er+sn)),Kt)}let Qt=D[2*nt+Kt],be=_t,Fe=Rt;for(Vv(G,D,_t,nt),D[2*Rt+Kt]>Qt&&Vv(G,D,_t,Rt);be<Fe;){for(Vv(G,D,be,Fe),be++,Fe--;D[2*be+Kt]<Qt;)be++;for(;D[2*Fe+Kt]>Qt;)Fe--}D[2*_t+Kt]===Qt?Vv(G,D,_t,Fe):(Fe++,Vv(G,D,Fe,Rt)),Fe<=nt&&(_t=Fe+1),nt<=Fe&&(Rt=Fe-1)}}function Vv(G,D,nt,_t){Dx(G,nt,_t),Dx(D,2*nt,2*_t),Dx(D,2*nt+1,2*_t+1)}function Dx(G,D,nt){let _t=G[D];G[D]=G[nt],G[nt]=_t}function $d(G,D,nt,_t){let Rt=G-nt,Kt=D-_t;return Rt*Rt+Kt*Kt}var Ob;t.bg=void 0,(Ob=t.bg||(t.bg={})).create="create",Ob.load="load",Ob.fullLoad="fullLoad";let Fx=null,Hv=[],Db=1e3/60,Rx="loadTime",Fb="fullLoadTime",o5={mark(G){performance.mark(G)},frame(G){let D=G;Fx!=null&&Hv.push(D-Fx),Fx=D},clearMetrics(){Fx=null,Hv=[],performance.clearMeasures(Rx),performance.clearMeasures(Fb);for(let G in t.bg)performance.clearMarks(t.bg[G])},getPerformanceMetrics(){performance.measure(Rx,t.bg.create,t.bg.load),performance.measure(Fb,t.bg.create,t.bg.fullLoad);let G=performance.getEntriesByName(Rx)[0].duration,D=performance.getEntriesByName(Fb)[0].duration,nt=Hv.length,_t=1/(Hv.reduce((Kt,Qt)=>Kt+Qt,0)/nt/1e3),Rt=Hv.filter(Kt=>Kt>Db).reduce((Kt,Qt)=>Kt+(Qt-Db)/Db,0);return{loadTime:G,fullLoadTime:D,fps:_t,percentDroppedFrames:Rt/(nt+Rt)*100,totalFrames:nt}}};t.$=class extends Or{},t.A=vi,t.B=ga,t.C=function(G){if(N==null){let D=G.navigator?G.navigator.userAgent:null;N=!!G.safari||!(!D||!(/\b(iPad|iPhone|iPod)\b/.test(D)||D.match("Safari")&&!D.match("Chrome")))}return N},t.D=es,t.E=ft,t.F=class{constructor(G,D){this.target=G,this.mapId=D,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new J1(()=>this.process()),this.subscription=function(nt,_t,Rt,Kt){return nt.addEventListener(_t,Rt,!1),{unsubscribe:()=>{nt.removeEventListener(_t,Rt,!1)}}}(this.target,"message",nt=>this.receive(nt)),this.globalScope=O(self)?G:window}registerMessageHandler(G,D){this.messageHandlers[G]=D}sendAsync(G,D){return new Promise((nt,_t)=>{let Rt=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Rt]={resolve:nt,reject:_t},D&&D.signal.addEventListener("abort",()=>{delete this.resolveRejects[Rt];let be={id:Rt,type:"<cancel>",origin:location.origin,targetMapId:G.targetMapId,sourceMapId:this.mapId};this.target.postMessage(be)},{once:!0});let Kt=[],Qt=Object.assign(Object.assign({},G),{id:Rt,sourceMapId:this.mapId,origin:location.origin,data:os(G.data,Kt)});this.target.postMessage(Qt,{transfer:Kt})})}receive(G){let D=G.data,nt=D.id;if(!(D.origin!=="file://"&&location.origin!=="file://"&&D.origin!=="resource://android"&&location.origin!=="resource://android"&&D.origin!==location.origin||D.targetMapId&&this.mapId!==D.targetMapId)){if(D.type==="<cancel>"){delete this.tasks[nt];let _t=this.abortControllers[nt];return delete this.abortControllers[nt],void(_t&&_t.abort())}if(O(self)||D.mustQueue)return this.tasks[nt]=D,this.taskQueue.push(nt),void this.invoker.trigger();this.processTask(nt,D)}}process(){if(this.taskQueue.length===0)return;let G=this.taskQueue.shift(),D=this.tasks[G];delete this.tasks[G],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(G,D)}processTask(G,D){return e(this,void 0,void 0,function*(){if(D.type==="<response>"){let Rt=this.resolveRejects[G];return delete this.resolveRejects[G],Rt?void(D.error?Rt.reject(fs(D.error)):Rt.resolve(fs(D.data))):void 0}if(!this.messageHandlers[D.type])return void this.completeTask(G,new Error(`Could not find a registered handler for ${D.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let nt=fs(D.data),_t=new AbortController;this.abortControllers[G]=_t;try{let Rt=yield this.messageHandlers[D.type](D.sourceMapId,nt,_t);this.completeTask(G,null,Rt)}catch(Rt){this.completeTask(G,Rt)}})}completeTask(G,D,nt){let _t=[];delete this.abortControllers[G];let Rt={id:G,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:D?os(D):null,data:os(nt,_t)};this.target.postMessage(Rt,{transfer:_t})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=pt,t.H=function(){var G=new vi(16);return vi!=Float32Array&&(G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[11]=0,G[12]=0,G[13]=0,G[14]=0),G[0]=1,G[5]=1,G[10]=1,G[15]=1,G},t.I=Zd,t.J=function(G,D,nt){var _t,Rt,Kt,Qt,be,Fe,er,yr,Er,Zr,sn,xn,Ln=nt[0],$n=nt[1],ki=nt[2];return D===G?(G[12]=D[0]*Ln+D[4]*$n+D[8]*ki+D[12],G[13]=D[1]*Ln+D[5]*$n+D[9]*ki+D[13],G[14]=D[2]*Ln+D[6]*$n+D[10]*ki+D[14],G[15]=D[3]*Ln+D[7]*$n+D[11]*ki+D[15]):(Rt=D[1],Kt=D[2],Qt=D[3],be=D[4],Fe=D[5],er=D[6],yr=D[7],Er=D[8],Zr=D[9],sn=D[10],xn=D[11],G[0]=_t=D[0],G[1]=Rt,G[2]=Kt,G[3]=Qt,G[4]=be,G[5]=Fe,G[6]=er,G[7]=yr,G[8]=Er,G[9]=Zr,G[10]=sn,G[11]=xn,G[12]=_t*Ln+be*$n+Er*ki+D[12],G[13]=Rt*Ln+Fe*$n+Zr*ki+D[13],G[14]=Kt*Ln+er*$n+sn*ki+D[14],G[15]=Qt*Ln+yr*$n+xn*ki+D[15]),G},t.K=function(G,D,nt){var _t=nt[0],Rt=nt[1],Kt=nt[2];return G[0]=D[0]*_t,G[1]=D[1]*_t,G[2]=D[2]*_t,G[3]=D[3]*_t,G[4]=D[4]*Rt,G[5]=D[5]*Rt,G[6]=D[6]*Rt,G[7]=D[7]*Rt,G[8]=D[8]*Kt,G[9]=D[9]*Kt,G[10]=D[10]*Kt,G[11]=D[11]*Kt,G[12]=D[12],G[13]=D[13],G[14]=D[14],G[15]=D[15],G},t.L=Sa,t.M=function(G,D){let nt={};for(let _t=0;_t<D.length;_t++){let Rt=D[_t];Rt in G&&(nt[Rt]=G[Rt])}return nt},t.N=em,t.O=zx,t.P=o,t.Q=N3,t.R=Al,t.S=l0,t.T=Pc,t.U=v,t.V=T,t.W=F,t.X=Ql,t.Y=ke,t.Z=Q1,t._=e,t.a=lt,t.a$=function(G,D){var nt=G[0],_t=G[1],Rt=G[2],Kt=G[3],Qt=G[4],be=G[5],Fe=G[6],er=G[7],yr=G[8],Er=G[9],Zr=G[10],sn=G[11],xn=G[12],Ln=G[13],$n=G[14],ki=G[15],Aa=D[0],Xi=D[1],ma=D[2],Ga=D[3],To=D[4],As=D[5],Sl=D[6],ys=D[7],cs=D[8],Ys=D[9],Bs=D[10],Is=D[11],oo=D[12],nl=D[13],Ks=D[14],Wl=D[15];return Math.abs(nt-Aa)<=Ua*Math.max(1,Math.abs(nt),Math.abs(Aa))&&Math.abs(_t-Xi)<=Ua*Math.max(1,Math.abs(_t),Math.abs(Xi))&&Math.abs(Rt-ma)<=Ua*Math.max(1,Math.abs(Rt),Math.abs(ma))&&Math.abs(Kt-Ga)<=Ua*Math.max(1,Math.abs(Kt),Math.abs(Ga))&&Math.abs(Qt-To)<=Ua*Math.max(1,Math.abs(Qt),Math.abs(To))&&Math.abs(be-As)<=Ua*Math.max(1,Math.abs(be),Math.abs(As))&&Math.abs(Fe-Sl)<=Ua*Math.max(1,Math.abs(Fe),Math.abs(Sl))&&Math.abs(er-ys)<=Ua*Math.max(1,Math.abs(er),Math.abs(ys))&&Math.abs(yr-cs)<=Ua*Math.max(1,Math.abs(yr),Math.abs(cs))&&Math.abs(Er-Ys)<=Ua*Math.max(1,Math.abs(Er),Math.abs(Ys))&&Math.abs(Zr-Bs)<=Ua*Math.max(1,Math.abs(Zr),Math.abs(Bs))&&Math.abs(sn-Is)<=Ua*Math.max(1,Math.abs(sn),Math.abs(Is))&&Math.abs(xn-oo)<=Ua*Math.max(1,Math.abs(xn),Math.abs(oo))&&Math.abs(Ln-nl)<=Ua*Math.max(1,Math.abs(Ln),Math.abs(nl))&&Math.abs($n-Ks)<=Ua*Math.max(1,Math.abs($n),Math.abs(Ks))&&Math.abs(ki-Wl)<=Ua*Math.max(1,Math.abs(ki),Math.abs(Wl))},t.a0=vn,t.a1=Eb,t.a2=Lt,t.a3=G=>{let D=window.document.createElement("video");return D.muted=!0,new Promise(nt=>{D.onloadstart=()=>{nt(D)};for(let _t of G){let Rt=window.document.createElement("source");rt(_t)||(D.crossOrigin="Anonymous"),Rt.src=_t,D.appendChild(Rt)}})},t.a4=function(){return E++},t.a5=ka,t.a6=Rg,t.a7=Cf,t.a8=Lr,t.a9=H3,t.aA=function(G){if(G.type==="custom")return new R3(G);switch(G.type){case"background":return new X1(G);case"circle":return new _a(G);case"fill":return new fi(G);case"fill-extrusion":return new kp(G);case"heatmap":return new fl(G);case"hillshade":return new yc(G);case"line":return new zg(G);case"raster":return new WT(G);case"symbol":return new Cx(G)}},t.aB=p,t.aC=function(G,D){if(!G)return[{command:"setStyle",args:[D]}];let nt=[];try{if(!Pt(G.version,D.version))return[{command:"setStyle",args:[D]}];Pt(G.center,D.center)||nt.push({command:"setCenter",args:[D.center]}),Pt(G.zoom,D.zoom)||nt.push({command:"setZoom",args:[D.zoom]}),Pt(G.bearing,D.bearing)||nt.push({command:"setBearing",args:[D.bearing]}),Pt(G.pitch,D.pitch)||nt.push({command:"setPitch",args:[D.pitch]}),Pt(G.sprite,D.sprite)||nt.push({command:"setSprite",args:[D.sprite]}),Pt(G.glyphs,D.glyphs)||nt.push({command:"setGlyphs",args:[D.glyphs]}),Pt(G.transition,D.transition)||nt.push({command:"setTransition",args:[D.transition]}),Pt(G.light,D.light)||nt.push({command:"setLight",args:[D.light]}),Pt(G.terrain,D.terrain)||nt.push({command:"setTerrain",args:[D.terrain]}),Pt(G.sky,D.sky)||nt.push({command:"setSky",args:[D.sky]}),Pt(G.projection,D.projection)||nt.push({command:"setProjection",args:[D.projection]});let _t={},Rt=[];(function(Qt,be,Fe,er){let yr;for(yr in be=be||{},Qt=Qt||{})Object.prototype.hasOwnProperty.call(Qt,yr)&&(Object.prototype.hasOwnProperty.call(be,yr)||Jt(yr,Fe,er));for(yr in be)Object.prototype.hasOwnProperty.call(be,yr)&&(Object.prototype.hasOwnProperty.call(Qt,yr)?Pt(Qt[yr],be[yr])||(Qt[yr].type==="geojson"&&be[yr].type==="geojson"&&he(Qt,be,yr)?Wt(Fe,{command:"setGeoJSONSourceData",args:[yr,be[yr].data]}):ge(yr,be,Fe,er)):Ht(yr,be,Fe))})(G.sources,D.sources,Rt,_t);let Kt=[];G.layers&&G.layers.forEach(Qt=>{"source"in Qt&&_t[Qt.source]?nt.push({command:"removeLayer",args:[Qt.id]}):Kt.push(Qt)}),nt=nt.concat(Rt),function(Qt,be,Fe){be=be||[];let er=(Qt=Qt||[]).map(se),yr=be.map(se),Er=Qt.reduce(Tt,{}),Zr=be.reduce(Tt,{}),sn=er.slice(),xn=Object.create(null),Ln,$n,ki,Aa,Xi;for(let ma=0,Ga=0;ma<er.length;ma++)Ln=er[ma],Object.prototype.hasOwnProperty.call(Zr,Ln)?Ga++:(Wt(Fe,{command:"removeLayer",args:[Ln]}),sn.splice(sn.indexOf(Ln,Ga),1));for(let ma=0,Ga=0;ma<yr.length;ma++)Ln=yr[yr.length-1-ma],sn[sn.length-1-ma]!==Ln&&(Object.prototype.hasOwnProperty.call(Er,Ln)?(Wt(Fe,{command:"removeLayer",args:[Ln]}),sn.splice(sn.lastIndexOf(Ln,sn.length-Ga),1)):Ga++,Aa=sn[sn.length-ma],Wt(Fe,{command:"addLayer",args:[Zr[Ln],Aa]}),sn.splice(sn.length-ma,0,Ln),xn[Ln]=!0);for(let ma=0;ma<yr.length;ma++)if(Ln=yr[ma],$n=Er[Ln],ki=Zr[Ln],!xn[Ln]&&!Pt($n,ki))if(Pt($n.source,ki.source)&&Pt($n["source-layer"],ki["source-layer"])&&Pt($n.type,ki.type)){for(Xi in de($n.layout,ki.layout,Fe,Ln,null,"setLayoutProperty"),de($n.paint,ki.paint,Fe,Ln,null,"setPaintProperty"),Pt($n.filter,ki.filter)||Wt(Fe,{command:"setFilter",args:[Ln,ki.filter]}),Pt($n.minzoom,ki.minzoom)&&Pt($n.maxzoom,ki.maxzoom)||Wt(Fe,{command:"setLayerZoomRange",args:[Ln,ki.minzoom,ki.maxzoom]}),$n)Object.prototype.hasOwnProperty.call($n,Xi)&&Xi!=="layout"&&Xi!=="paint"&&Xi!=="filter"&&Xi!=="metadata"&&Xi!=="minzoom"&&Xi!=="maxzoom"&&(Xi.indexOf("paint.")===0?de($n[Xi],ki[Xi],Fe,Ln,Xi.slice(6),"setPaintProperty"):Pt($n[Xi],ki[Xi])||Wt(Fe,{command:"setLayerProperty",args:[Ln,Xi,ki[Xi]]}));for(Xi in ki)Object.prototype.hasOwnProperty.call(ki,Xi)&&!Object.prototype.hasOwnProperty.call($n,Xi)&&Xi!=="layout"&&Xi!=="paint"&&Xi!=="filter"&&Xi!=="metadata"&&Xi!=="minzoom"&&Xi!=="maxzoom"&&(Xi.indexOf("paint.")===0?de($n[Xi],ki[Xi],Fe,Ln,Xi.slice(6),"setPaintProperty"):Pt($n[Xi],ki[Xi])||Wt(Fe,{command:"setLayerProperty",args:[Ln,Xi,ki[Xi]]}))}else Wt(Fe,{command:"removeLayer",args:[Ln]}),Aa=sn[sn.lastIndexOf(Ln)+1],Wt(Fe,{command:"addLayer",args:[ki,Aa]})}(Kt,D.layers,nt)}catch(_t){console.warn("Unable to compute style diff:",_t),nt=[{command:"setStyle",args:[D]}]}return nt},t.aD=function(G){let D=[],nt=G.id;return nt===void 0&&D.push({message:`layers.${nt}: missing required property "id"`}),G.render===void 0&&D.push({message:`layers.${nt}: missing required method "render"`}),G.renderingMode&&G.renderingMode!=="2d"&&G.renderingMode!=="3d"&&D.push({message:`layers.${nt}: property "renderingMode" must be either "2d" or "3d"`}),D},t.aE=function G(D,nt){if(Array.isArray(D)){if(!Array.isArray(nt)||D.length!==nt.length)return!1;for(let _t=0;_t<D.length;_t++)if(!G(D[_t],nt[_t]))return!1;return!0}if(typeof D=="object"&&D!==null&&nt!==null){if(typeof nt!="object"||Object.keys(D).length!==Object.keys(nt).length)return!1;for(let _t in D)if(!G(D[_t],nt[_t]))return!1;return!0}return D===nt},t.aF=A,t.aG=h,t.aH=class extends Fo{constructor(G,D){super(G,D),this.current=0}set(G){this.current!==G&&(this.current=G,this.gl.uniform1i(this.location,G))}},t.aI=Uo,t.aJ=class extends Fo{constructor(G,D){super(G,D),this.current=ps}set(G){if(G[12]!==this.current[12]||G[0]!==this.current[0])return this.current=G,void this.gl.uniformMatrix4fv(this.location,!1,G);for(let D=1;D<16;D++)if(G[D]!==this.current[D]){this.current=G,this.gl.uniformMatrix4fv(this.location,!1,G);break}}},t.aK=al,t.aL=Wo,t.aM=xr,t.aN=class extends Fo{constructor(G,D){super(G,D),this.current=[0,0,0]}set(G){G[0]===this.current[0]&&G[1]===this.current[1]&&G[2]===this.current[2]||(this.current=G,this.gl.uniform3f(this.location,G[0],G[1],G[2]))}},t.aO=class extends Fo{constructor(G,D){super(G,D),this.current=[0,0]}set(G){G[0]===this.current[0]&&G[1]===this.current[1]||(this.current=G,this.gl.uniform2f(this.location,G[0],G[1]))}},t.aP=function(G,D,nt,_t,Rt,Kt,Qt){var be=1/(D-nt),Fe=1/(_t-Rt),er=1/(Kt-Qt);return G[0]=-2*be,G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=-2*Fe,G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[10]=2*er,G[11]=0,G[12]=(D+nt)*be,G[13]=(Rt+_t)*Fe,G[14]=(Qt+Kt)*er,G[15]=1,G},t.aQ=qi,t.aR=class extends Ze{},t.aS=Ig,t.aT=class extends Ir{},t.aU=wu,t.aV=function(G){return G<=1?1:Math.pow(2,Math.ceil(Math.log(G)/Math.LN2))},t.aW=us,t.aX=Ws,t.aY=ir,t.aZ=class extends Fi{},t.a_=function(G,D){return G[0]===D[0]&&G[1]===D[1]&&G[2]===D[2]&&G[3]===D[3]&&G[4]===D[4]&&G[5]===D[5]&&G[6]===D[6]&&G[7]===D[7]&&G[8]===D[8]&&G[9]===D[9]&&G[10]===D[10]&&G[11]===D[11]&&G[12]===D[12]&&G[13]===D[13]&&G[14]===D[14]&&G[15]===D[15]},t.aa=function(G){let D={};if(G.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(nt,_t,Rt,Kt)=>{let Qt=Rt||Kt;return D[_t]=!Qt||Qt.toLowerCase(),""}),D["max-age"]){let nt=parseInt(D["max-age"],10);isNaN(nt)?delete D["max-age"]:D["max-age"]=nt}return D},t.ab=function(G,D){let nt=[];for(let _t in G)_t in D||nt.push(_t);return nt},t.ac=_,t.ad=function(G,D,nt){var _t=Math.sin(nt),Rt=Math.cos(nt),Kt=D[0],Qt=D[1],be=D[2],Fe=D[3],er=D[4],yr=D[5],Er=D[6],Zr=D[7];return D!==G&&(G[8]=D[8],G[9]=D[9],G[10]=D[10],G[11]=D[11],G[12]=D[12],G[13]=D[13],G[14]=D[14],G[15]=D[15]),G[0]=Kt*Rt+er*_t,G[1]=Qt*Rt+yr*_t,G[2]=be*Rt+Er*_t,G[3]=Fe*Rt+Zr*_t,G[4]=er*Rt-Kt*_t,G[5]=yr*Rt-Qt*_t,G[6]=Er*Rt-be*_t,G[7]=Zr*Rt-Fe*_t,G},t.ae=function(G){var D=new vi(16);return D[0]=G[0],D[1]=G[1],D[2]=G[2],D[3]=G[3],D[4]=G[4],D[5]=G[5],D[6]=G[6],D[7]=G[7],D[8]=G[8],D[9]=G[9],D[10]=G[10],D[11]=G[11],D[12]=G[12],D[13]=G[13],D[14]=G[14],D[15]=G[15],D},t.af=$i,t.ag=function(G,D){let nt=0,_t=0;if(G.kind==="constant")_t=G.layoutSize;else if(G.kind!=="source"){let{interpolationType:Rt,minZoom:Kt,maxZoom:Qt}=G,be=Rt?_(Ia.interpolationFactor(Rt,D,Kt,Qt),0,1):0;G.kind==="camera"?_t=Do.number(G.minSize,G.maxSize,be):nt=be}return{uSizeT:nt,uSize:_t}},t.ai=function(G,{uSize:D,uSizeT:nt},{lowerSize:_t,upperSize:Rt}){return G.kind==="source"?_t/tm:G.kind==="composite"?Do.number(_t/tm,Rt/tm,nt):D},t.aj=Ym,t.ak=function(G,D,nt,_t){let Rt=D.y-G.y,Kt=D.x-G.x,Qt=_t.y-nt.y,be=_t.x-nt.x,Fe=Qt*Kt-be*Rt;if(Fe===0)return null;let er=(be*(G.y-nt.y)-Qt*(G.x-nt.x))/Fe;return new o(G.x+er*Kt,G.y+er*Rt)},t.al=$3,t.am=Jn,t.an=ti,t.ao=function(G){let D=1/0,nt=1/0,_t=-1/0,Rt=-1/0;for(let Kt of G)D=Math.min(D,Kt.x),nt=Math.min(nt,Kt.y),_t=Math.max(_t,Kt.x),Rt=Math.max(Rt,Kt.y);return[D,nt,_t,Rt]},t.ap=bc,t.ar=bb,t.as=function(G,D){var nt=D[0],_t=D[1],Rt=D[2],Kt=D[3],Qt=D[4],be=D[5],Fe=D[6],er=D[7],yr=D[8],Er=D[9],Zr=D[10],sn=D[11],xn=D[12],Ln=D[13],$n=D[14],ki=D[15],Aa=nt*be-_t*Qt,Xi=nt*Fe-Rt*Qt,ma=nt*er-Kt*Qt,Ga=_t*Fe-Rt*be,To=_t*er-Kt*be,As=Rt*er-Kt*Fe,Sl=yr*Ln-Er*xn,ys=yr*$n-Zr*xn,cs=yr*ki-sn*xn,Ys=Er*$n-Zr*Ln,Bs=Er*ki-sn*Ln,Is=Zr*ki-sn*$n,oo=Aa*Is-Xi*Bs+ma*Ys+Ga*cs-To*ys+As*Sl;return oo?(G[0]=(be*Is-Fe*Bs+er*Ys)*(oo=1/oo),G[1]=(Rt*Bs-_t*Is-Kt*Ys)*oo,G[2]=(Ln*As-$n*To+ki*Ga)*oo,G[3]=(Zr*To-Er*As-sn*Ga)*oo,G[4]=(Fe*cs-Qt*Is-er*ys)*oo,G[5]=(nt*Is-Rt*cs+Kt*ys)*oo,G[6]=($n*ma-xn*As-ki*Xi)*oo,G[7]=(yr*As-Zr*ma+sn*Xi)*oo,G[8]=(Qt*Bs-be*cs+er*Sl)*oo,G[9]=(_t*cs-nt*Bs-Kt*Sl)*oo,G[10]=(xn*To-Ln*ma+ki*Aa)*oo,G[11]=(Er*ma-yr*To-sn*Aa)*oo,G[12]=(be*ys-Qt*Ys-Fe*Sl)*oo,G[13]=(nt*Ys-_t*ys+Rt*Sl)*oo,G[14]=(Ln*Xi-xn*Ga-$n*Aa)*oo,G[15]=(yr*Ga-Er*Xi+Zr*Aa)*oo,G):null},t.at=Pb,t.au=_b,t.av=zb,t.aw=function(){let G={},D=ut.$version;for(let nt in ut.$root){let _t=ut.$root[nt];if(_t.required){let Rt=null;Rt=nt==="version"?D:_t.type==="array"?[]:{},Rt!=null&&(G[nt]=Rt)}}return G},t.ax=no,t.ay=tt,t.az=function(G){G=G.slice();let D=Object.create(null);for(let nt=0;nt<G.length;nt++)D[G[nt].id]=G[nt];for(let nt=0;nt<G.length;nt++)"ref"in G[nt]&&(G[nt]=zt(G[nt],D[G[nt].ref]));return G},t.b=V,t.b0=function(G,D){return G[0]=D[0],G[1]=D[1],G[2]=D[2],G[3]=D[3],G[4]=D[4],G[5]=D[5],G[6]=D[6],G[7]=D[7],G[8]=D[8],G[9]=D[9],G[10]=D[10],G[11]=D[11],G[12]=D[12],G[13]=D[13],G[14]=D[14],G[15]=D[15],G},t.b1=function(G,D,nt){return G[0]=D[0]*nt[0],G[1]=D[1]*nt[1],G[2]=D[2]*nt[2],G[3]=D[3]*nt[3],G},t.b2=function(G,D){return G[0]*D[0]+G[1]*D[1]+G[2]*D[2]+G[3]*D[3]},t.b3=C,t.b4=U3,t.b5=w0,t.b6=function(G,D,nt,_t,Rt){var Kt,Qt=1/Math.tan(D/2);return G[0]=Qt/nt,G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=Qt,G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[11]=-1,G[12]=0,G[13]=0,G[15]=0,Rt!=null&&Rt!==1/0?(G[10]=(Rt+_t)*(Kt=1/(_t-Rt)),G[14]=2*Rt*_t*Kt):(G[10]=-1,G[14]=-2*_t),G},t.b7=function(G,D,nt){var _t=Math.sin(nt),Rt=Math.cos(nt),Kt=D[4],Qt=D[5],be=D[6],Fe=D[7],er=D[8],yr=D[9],Er=D[10],Zr=D[11];return D!==G&&(G[0]=D[0],G[1]=D[1],G[2]=D[2],G[3]=D[3],G[12]=D[12],G[13]=D[13],G[14]=D[14],G[15]=D[15]),G[4]=Kt*Rt+er*_t,G[5]=Qt*Rt+yr*_t,G[6]=be*Rt+Er*_t,G[7]=Fe*Rt+Zr*_t,G[8]=er*Rt-Kt*_t,G[9]=yr*Rt-Qt*_t,G[10]=Er*Rt-be*_t,G[11]=Zr*Rt-Fe*_t,G},t.b8=u,t.b9=b,t.bA=Og,t.bB=function(G){return G.message===q},t.bC=lu,t.bD=$l,t.ba=function(G){return G*Math.PI/180},t.bb=function(G,D){let{x:nt,y:_t}=Q1.fromLngLat(D);return!(G<0||G>25||_t<0||_t>=1||nt<0||nt>=1)},t.bc=function(G,D){return G[0]=D[0],G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=D[1],G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[10]=D[2],G[11]=0,G[12]=0,G[13]=0,G[14]=0,G[15]=1,G},t.bd=class extends gr{},t.be=Mb,t.bf=o5,t.bh=st,t.bi=function(G,D){lt.REGISTERED_PROTOCOLS[G]=D},t.bj=function(G){delete lt.REGISTERED_PROTOCOLS[G]},t.bk=function(G,D){let nt={};for(let Rt=0;Rt<G.length;Rt++){let Kt=D&&D[G[Rt].id]||Pf(G[Rt]);D&&(D[G[Rt].id]=Kt);let Qt=nt[Kt];Qt||(Qt=nt[Kt]=[]),Qt.push(G[Rt])}let _t=[];for(let Rt in nt)_t.push(nt[Rt]);return _t},t.bl=Ji,t.bm=V3,t.bn=W3,t.bo=P3,t.bp=function(G){G.bucket.createArrays(),G.bucket.tilePixelRatio=Ql/(512*G.bucket.overscaling),G.bucket.compareText={},G.bucket.iconsNeedLinear=!1;let D=G.bucket.layers[0],nt=D.layout,_t=D._unevaluatedLayout._values,Rt={layoutIconSize:_t["icon-size"].possiblyEvaluate(new Fl(G.bucket.zoom+1),G.canonical),layoutTextSize:_t["text-size"].possiblyEvaluate(new Fl(G.bucket.zoom+1),G.canonical),textMaxSize:_t["text-size"].possiblyEvaluate(new Fl(18))};if(G.bucket.textSizeData.kind==="composite"){let{minZoom:er,maxZoom:yr}=G.bucket.textSizeData;Rt.compositeTextSizes=[_t["text-size"].possiblyEvaluate(new Fl(er),G.canonical),_t["text-size"].possiblyEvaluate(new Fl(yr),G.canonical)]}if(G.bucket.iconSizeData.kind==="composite"){let{minZoom:er,maxZoom:yr}=G.bucket.iconSizeData;Rt.compositeIconSizes=[_t["icon-size"].possiblyEvaluate(new Fl(er),G.canonical),_t["icon-size"].possiblyEvaluate(new Fl(yr),G.canonical)]}let Kt=nt.get("text-line-height")*bc,Qt=nt.get("text-rotation-alignment")!=="viewport"&&nt.get("symbol-placement")!=="point",be=nt.get("text-keep-upright"),Fe=nt.get("text-size");for(let er of G.bucket.features){let yr=nt.get("text-font").evaluate(er,{},G.canonical).join(","),Er=Fe.evaluate(er,{},G.canonical),Zr=Rt.layoutTextSize.evaluate(er,{},G.canonical),sn=Rt.layoutIconSize.evaluate(er,{},G.canonical),xn={horizontal:{},vertical:void 0},Ln=er.text,$n,ki=[0,0];if(Ln){let ma=Ln.toString(),Ga=nt.get("text-letter-spacing").evaluate(er,{},G.canonical)*bc,To=tl(ma)?Ga:0,As=nt.get("text-anchor").evaluate(er,{},G.canonical),Sl=t5(D,er,G.canonical);if(!Sl){let Bs=nt.get("text-radial-offset").evaluate(er,{},G.canonical);ki=Bs?Q3(As,[Bs*bc,Lb]):nt.get("text-offset").evaluate(er,{},G.canonical).map(Is=>Is*bc)}let ys=Qt?"center":nt.get("text-justify").evaluate(er,{},G.canonical),cs=nt.get("symbol-placement")==="point"?nt.get("text-max-width").evaluate(er,{},G.canonical)*bc:1/0,Ys=()=>{G.bucket.allowVerticalPlacement&&ds(ma)&&(xn.vertical=Tx(Ln,G.glyphMap,G.glyphPositions,G.imagePositions,yr,cs,Kt,As,"left",To,ki,t.ah.vertical,!0,Zr,Er))};if(!Qt&&Sl){let Bs=new Set;if(ys==="auto")for(let oo=0;oo<Sl.values.length;oo+=2)Bs.add(Pb(Sl.values[oo]));else Bs.add(ys);let Is=!1;for(let oo of Bs)if(!xn.horizontal[oo])if(Is)xn.horizontal[oo]=xn.horizontal[0];else{let nl=Tx(Ln,G.glyphMap,G.glyphPositions,G.imagePositions,yr,cs,Kt,"center",oo,To,ki,t.ah.horizontal,!1,Zr,Er);nl&&(xn.horizontal[oo]=nl,Is=nl.positionedLines.length===1)}Ys()}else{ys==="auto"&&(ys=Pb(As));let Bs=Tx(Ln,G.glyphMap,G.glyphPositions,G.imagePositions,yr,cs,Kt,As,ys,To,ki,t.ah.horizontal,!1,Zr,Er);Bs&&(xn.horizontal[ys]=Bs),Ys(),ds(ma)&&Qt&&be&&(xn.vertical=Tx(Ln,G.glyphMap,G.glyphPositions,G.imagePositions,yr,cs,Kt,As,ys,To,ki,t.ah.vertical,!1,Zr,Er))}}let Aa=!1;if(er.icon&&er.icon.name){let ma=G.imageMap[er.icon.name];ma&&($n=UT(G.imagePositions[er.icon.name],nt.get("icon-offset").evaluate(er,{},G.canonical),nt.get("icon-anchor").evaluate(er,{},G.canonical)),Aa=!!ma.sdf,G.bucket.sdfIcons===void 0?G.bucket.sdfIcons=Aa:G.bucket.sdfIcons!==Aa&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(ma.pixelRatio!==G.bucket.pixelRatio||nt.get("icon-rotate").constantOr(1)!==0)&&(G.bucket.iconsNeedLinear=!0))}let Xi=r5(xn.horizontal)||xn.vertical;G.bucket.iconsInText=!!Xi&&Xi.iconsInText,(Xi||$n)&&KT(G.bucket,er,xn,$n,G.imageMap,Rt,Zr,sn,ki,Aa,G.canonical)}G.showCollisionBoxes&&G.bucket.generateCollisionDebugBuffers()},t.bq=ep,t.br=$e,t.bs=Au,t.bt=di,t.bu=gb,t.bv=class{constructor(G){this._marks={start:[G.url,"start"].join("#"),end:[G.url,"end"].join("#"),measure:G.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let G=performance.getEntriesByName(this._marks.measure);return G.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),G=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),G}},t.bw=function(G,D,nt,_t,Rt){return e(this,void 0,void 0,function*(){if(T())try{return yield F(G,D,nt,_t,Rt)}catch{}return function(Kt,Qt,be,Fe,er){let yr=Kt.width,Er=Kt.height;U&&W||(U=new OffscreenCanvas(yr,Er),W=U.getContext("2d",{willReadFrequently:!0})),U.width=yr,U.height=Er,W.drawImage(Kt,0,0,yr,Er);let Zr=W.getImageData(Qt,be,Fe,er);return W.clearRect(0,0,yr,Er),Zr.data}(G,D,nt,_t,Rt)})},t.bx=Bg,t.by=r,t.bz=a,t.c=X,t.d=G=>e(void 0,void 0,void 0,function*(){if(G.byteLength===0)return createImageBitmap(new ImageData(1,1));let D=new Blob([new Uint8Array(G)],{type:"image/png"});try{return createImageBitmap(D)}catch(nt){throw new Error(`Could not load image because of ${nt.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),t.e=M,t.f=G=>new Promise((D,nt)=>{let _t=new Image;_t.onload=()=>{D(_t),URL.revokeObjectURL(_t.src),_t.onload=null,window.requestAnimationFrame(()=>{_t.src=H})},_t.onerror=()=>nt(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 Rt=new Blob([new Uint8Array(G)],{type:"image/png"});_t.src=G.byteLength?URL.createObjectURL(Rt):H}),t.g=yt,t.h=(G,D)=>dt(M(G,{type:"json"}),D),t.i=O,t.j=Y,t.k=it,t.l=(G,D)=>dt(M(G,{type:"arrayBuffer"}),D),t.m=dt,t.n=function(G){return new gb(G).readFields(RT,[])},t.o=Nl,t.p=kx,t.q=qt,t.r=ea,t.s=rt,t.t=ua,t.u=hi,t.v=ut,t.w=w,t.x=function([G,D,nt]){return D+=90,D*=Math.PI/180,nt*=Math.PI/180,{x:G*Math.cos(D)*Math.sin(nt),y:G*Math.sin(D)*Math.sin(nt),z:G*Math.cos(nt)}},t.y=Do,t.z=Fl}),P("worker",["./shared"],function(t){class e{constructor($t){this.keyCache={},$t&&this.replace($t)}replace($t){this._layerConfigs={},this._layers={},this.update($t,[])}update($t,ne){for(let gt of $t){this._layerConfigs[gt.id]=gt;let St=this._layers[gt.id]=t.aA(gt);St._featureFilter=t.a7(St.filter),this.keyCache[gt.id]&&delete this.keyCache[gt.id]}for(let gt of ne)delete this.keyCache[gt],delete this._layerConfigs[gt],delete this._layers[gt];this.familiesBySource={};let Ct=t.bk(Object.values(this._layerConfigs),this.keyCache);for(let gt of Ct){let St=gt.map(qe=>this._layers[qe.id]),Nt=St[0];if(Nt.visibility==="none")continue;let ee=Nt.source||"",le=this.familiesBySource[ee];le||(le=this.familiesBySource[ee]={});let we=Nt.sourceLayer||"_geojsonTileLayer",Ue=le[we];Ue||(Ue=le[we]=[]),Ue.push(St)}}}class r{constructor($t){let ne={},Ct=[];for(let ee in $t){let le=$t[ee],we=ne[ee]={};for(let Ue in le){let qe=le[+Ue];if(!qe||qe.bitmap.width===0||qe.bitmap.height===0)continue;let ar={x:0,y:0,w:qe.bitmap.width+2,h:qe.bitmap.height+2};Ct.push(ar),we[Ue]={rect:ar,metrics:qe.metrics}}}let{w:gt,h:St}=t.p(Ct),Nt=new t.o({width:gt||1,height:St||1});for(let ee in $t){let le=$t[ee];for(let we in le){let Ue=le[+we];if(!Ue||Ue.bitmap.width===0||Ue.bitmap.height===0)continue;let qe=ne[ee][we].rect;t.o.copy(Ue.bitmap,Nt,{x:0,y:0},{x:qe.x+1,y:qe.y+1},Ue.bitmap)}}this.image=Nt,this.positions=ne}}t.bl("GlyphAtlas",r);class a{constructor($t){this.tileID=new t.S($t.tileID.overscaledZ,$t.tileID.wrap,$t.tileID.canonical.z,$t.tileID.canonical.x,$t.tileID.canonical.y),this.uid=$t.uid,this.zoom=$t.zoom,this.pixelRatio=$t.pixelRatio,this.tileSize=$t.tileSize,this.source=$t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=$t.showCollisionBoxes,this.collectResourceTiming=!!$t.collectResourceTiming,this.returnDependencies=!!$t.returnDependencies,this.promoteId=$t.promoteId,this.inFlightDependencies=[]}parse($t,ne,Ct,gt){return t._(this,void 0,void 0,function*(){this.status="parsing",this.data=$t,this.collisionBoxArray=new t.a5;let St=new t.bm(Object.keys($t.layers).sort()),Nt=new t.bn(this.tileID,this.promoteId);Nt.bucketLayerIDs=[];let ee={},le={featureIndex:Nt,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Ct},we=ne.familiesBySource[this.source];for(let ii in we){let qn=$t.layers[ii];if(!qn)continue;qn.version===1&&t.w(`Vector tile source "${this.source}" layer "${ii}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let oa=St.encode(ii),Hi=[];for(let We=0;We<qn.length;We++){let rr=qn.feature(We),fr=Nt.getId(rr,ii);Hi.push({feature:rr,id:fr,index:We,sourceLayerIndex:oa})}for(let We of we[ii]){let rr=We[0];rr.source!==this.source&&t.w(`layer.source = ${rr.source} does not equal this.source = ${this.source}`),rr.minzoom&&this.zoom<Math.floor(rr.minzoom)||rr.maxzoom&&this.zoom>=rr.maxzoom||rr.visibility!=="none"&&(n(We,this.zoom,Ct),(ee[rr.id]=rr.createBucket({index:Nt.bucketLayerIDs.length,layers:We,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:oa,sourceID:this.source})).populate(Hi,le,this.tileID.canonical),Nt.bucketLayerIDs.push(We.map(fr=>fr.id)))}}let Ue=t.aF(le.glyphDependencies,ii=>Object.keys(ii).map(Number));this.inFlightDependencies.forEach(ii=>ii?.abort()),this.inFlightDependencies=[];let qe=Promise.resolve({});if(Object.keys(Ue).length){let ii=new AbortController;this.inFlightDependencies.push(ii),qe=gt.sendAsync({type:"GG",data:{stacks:Ue,source:this.source,tileID:this.tileID,type:"glyphs"}},ii)}let ar=Object.keys(le.iconDependencies),Ar=Promise.resolve({});if(ar.length){let ii=new AbortController;this.inFlightDependencies.push(ii),Ar=gt.sendAsync({type:"GI",data:{icons:ar,source:this.source,tileID:this.tileID,type:"icons"}},ii)}let Tr=Object.keys(le.patternDependencies),pr=Promise.resolve({});if(Tr.length){let ii=new AbortController;this.inFlightDependencies.push(ii),pr=gt.sendAsync({type:"GI",data:{icons:Tr,source:this.source,tileID:this.tileID,type:"patterns"}},ii)}let[Jr,Vn,Hn]=yield Promise.all([qe,Ar,pr]),Kn=new r(Jr),Ci=new t.bo(Vn,Hn);for(let ii in ee){let qn=ee[ii];qn instanceof t.a6?(n(qn.layers,this.zoom,Ct),t.bp({bucket:qn,glyphMap:Jr,glyphPositions:Kn.positions,imageMap:Vn,imagePositions:Ci.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):qn.hasPattern&&(qn instanceof t.bq||qn instanceof t.br||qn instanceof t.bs)&&(n(qn.layers,this.zoom,Ct),qn.addFeatures(le,this.tileID.canonical,Ci.patternPositions))}return this.status="done",{buckets:Object.values(ee).filter(ii=>!ii.isEmpty()),featureIndex:Nt,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Kn.image,imageAtlas:Ci,glyphMap:this.returnDependencies?Jr:null,iconMap:this.returnDependencies?Vn:null,glyphPositions:this.returnDependencies?Kn.positions:null}})}}function n(Ce,$t,ne){let Ct=new t.z($t);for(let gt of Ce)gt.recalculate(Ct,ne)}class o{constructor($t,ne,Ct){this.actor=$t,this.layerIndex=ne,this.availableImages=Ct,this.fetching={},this.loading={},this.loaded={}}loadVectorTile($t,ne){return t._(this,void 0,void 0,function*(){let Ct=yield t.l($t.request,ne);try{return{vectorTile:new t.bt.VectorTile(new t.bu(Ct.data)),rawData:Ct.data,cacheControl:Ct.cacheControl,expires:Ct.expires}}catch(gt){let St=new Uint8Array(Ct.data),Nt=`Unable to parse the tile at ${$t.request.url}, `;throw Nt+=St[0]===31&&St[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${gt.message}`,new Error(Nt)}})}loadTile($t){return t._(this,void 0,void 0,function*(){let ne=$t.uid,Ct=!!($t&&$t.request&&$t.request.collectResourceTiming)&&new t.bv($t.request),gt=new a($t);this.loading[ne]=gt;let St=new AbortController;gt.abort=St;try{let Nt=yield this.loadVectorTile($t,St);if(delete this.loading[ne],!Nt)return null;let ee=Nt.rawData,le={};Nt.expires&&(le.expires=Nt.expires),Nt.cacheControl&&(le.cacheControl=Nt.cacheControl);let we={};if(Ct){let qe=Ct.finish();qe&&(we.resourceTiming=JSON.parse(JSON.stringify(qe)))}gt.vectorTile=Nt.vectorTile;let Ue=gt.parse(Nt.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[ne]=gt,this.fetching[ne]={rawTileData:ee,cacheControl:le,resourceTiming:we};try{let qe=yield Ue;return t.e({rawTileData:ee.slice(0)},qe,le,we)}finally{delete this.fetching[ne]}}catch(Nt){throw delete this.loading[ne],gt.status="done",this.loaded[ne]=gt,Nt}})}reloadTile($t){return t._(this,void 0,void 0,function*(){let ne=$t.uid;if(!this.loaded||!this.loaded[ne])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let Ct=this.loaded[ne];if(Ct.showCollisionBoxes=$t.showCollisionBoxes,Ct.status==="parsing"){let gt=yield Ct.parse(Ct.vectorTile,this.layerIndex,this.availableImages,this.actor),St;if(this.fetching[ne]){let{rawTileData:Nt,cacheControl:ee,resourceTiming:le}=this.fetching[ne];delete this.fetching[ne],St=t.e({rawTileData:Nt.slice(0)},gt,ee,le)}else St=gt;return St}if(Ct.status==="done"&&Ct.vectorTile)return Ct.parse(Ct.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile($t){return t._(this,void 0,void 0,function*(){let ne=this.loading,Ct=$t.uid;ne&&ne[Ct]&&ne[Ct].abort&&(ne[Ct].abort.abort(),delete ne[Ct])})}removeTile($t){return t._(this,void 0,void 0,function*(){this.loaded&&this.loaded[$t.uid]&&delete this.loaded[$t.uid]})}}class i{constructor(){this.loaded={}}loadTile($t){return t._(this,void 0,void 0,function*(){let{uid:ne,encoding:Ct,rawImageData:gt,redFactor:St,greenFactor:Nt,blueFactor:ee,baseShift:le}=$t,we=gt.width+2,Ue=gt.height+2,qe=t.b(gt)?new t.R({width:we,height:Ue},yield t.bw(gt,-1,-1,we,Ue)):gt,ar=new t.bx(ne,qe,Ct,St,Nt,ee,le);return this.loaded=this.loaded||{},this.loaded[ne]=ar,ar})}removeTile($t){let ne=this.loaded,Ct=$t.uid;ne&&ne[Ct]&&delete ne[Ct]}}function s(Ce,$t){if(Ce.length!==0){f(Ce[0],$t);for(var ne=1;ne<Ce.length;ne++)f(Ce[ne],!$t)}}function f(Ce,$t){for(var ne=0,Ct=0,gt=0,St=Ce.length,Nt=St-1;gt<St;Nt=gt++){var ee=(Ce[gt][0]-Ce[Nt][0])*(Ce[Nt][1]+Ce[gt][1]),le=ne+ee;Ct+=Math.abs(ne)>=Math.abs(ee)?ne-le+ee:ee-le+ne,ne=le}ne+Ct>=0!=!!$t&&Ce.reverse()}var x=t.by(function Ce($t,ne){var Ct,gt=$t&&$t.type;if(gt==="FeatureCollection")for(Ct=0;Ct<$t.features.length;Ct++)Ce($t.features[Ct],ne);else if(gt==="GeometryCollection")for(Ct=0;Ct<$t.geometries.length;Ct++)Ce($t.geometries[Ct],ne);else if(gt==="Feature")Ce($t.geometry,ne);else if(gt==="Polygon")s($t.coordinates,ne);else if(gt==="MultiPolygon")for(Ct=0;Ct<$t.coordinates.length;Ct++)s($t.coordinates[Ct],ne);return $t});let y=t.bt.VectorTileFeature.prototype.toGeoJSON;var v={exports:{}},T=t.bz,u=t.bt.VectorTileFeature,b=_;function _(Ce,$t){this.options=$t||{},this.features=Ce,this.length=Ce.length}function C(Ce,$t){this.id=typeof Ce.id=="number"?Ce.id:void 0,this.type=Ce.type,this.rawGeometry=Ce.type===1?[Ce.geometry]:Ce.geometry,this.properties=Ce.tags,this.extent=$t||4096}_.prototype.feature=function(Ce){return new C(this.features[Ce],this.options.extent)},C.prototype.loadGeometry=function(){var Ce=this.rawGeometry;this.geometry=[];for(var $t=0;$t<Ce.length;$t++){for(var ne=Ce[$t],Ct=[],gt=0;gt<ne.length;gt++)Ct.push(new T(ne[gt][0],ne[gt][1]));this.geometry.push(Ct)}return this.geometry},C.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Ce=this.geometry,$t=1/0,ne=-1/0,Ct=1/0,gt=-1/0,St=0;St<Ce.length;St++)for(var Nt=Ce[St],ee=0;ee<Nt.length;ee++){var le=Nt[ee];$t=Math.min($t,le.x),ne=Math.max(ne,le.x),Ct=Math.min(Ct,le.y),gt=Math.max(gt,le.y)}return[$t,Ct,ne,gt]},C.prototype.toGeoJSON=u.prototype.toGeoJSON;var M=t.bA,E=b;function A(Ce){var $t=new M;return function(ne,Ct){for(var gt in ne.layers)Ct.writeMessage(3,h,ne.layers[gt])}(Ce,$t),$t.finish()}function h(Ce,$t){var ne;$t.writeVarintField(15,Ce.version||1),$t.writeStringField(1,Ce.name||""),$t.writeVarintField(5,Ce.extent||4096);var Ct={keys:[],values:[],keycache:{},valuecache:{}};for(ne=0;ne<Ce.length;ne++)Ct.feature=Ce.feature(ne),$t.writeMessage(2,p,Ct);var gt=Ct.keys;for(ne=0;ne<gt.length;ne++)$t.writeStringField(3,gt[ne]);var St=Ct.values;for(ne=0;ne<St.length;ne++)$t.writeMessage(4,N,St[ne])}function p(Ce,$t){var ne=Ce.feature;ne.id!==void 0&&$t.writeVarintField(1,ne.id),$t.writeMessage(2,k,Ce),$t.writeVarintField(3,ne.type),$t.writeMessage(4,O,ne)}function k(Ce,$t){var ne=Ce.feature,Ct=Ce.keys,gt=Ce.values,St=Ce.keycache,Nt=Ce.valuecache;for(var ee in ne.properties){var le=ne.properties[ee],we=St[ee];if(le!==null){we===void 0&&(Ct.push(ee),St[ee]=we=Ct.length-1),$t.writeVarint(we);var Ue=typeof le;Ue!=="string"&&Ue!=="boolean"&&Ue!=="number"&&(le=JSON.stringify(le));var qe=Ue+":"+le,ar=Nt[qe];ar===void 0&&(gt.push(le),Nt[qe]=ar=gt.length-1),$t.writeVarint(ar)}}}function w(Ce,$t){return($t<<3)+(7&Ce)}function R(Ce){return Ce<<1^Ce>>31}function O(Ce,$t){for(var ne=Ce.loadGeometry(),Ct=Ce.type,gt=0,St=0,Nt=ne.length,ee=0;ee<Nt;ee++){var le=ne[ee],we=1;Ct===1&&(we=le.length),$t.writeVarint(w(1,we));for(var Ue=Ct===3?le.length-1:le.length,qe=0;qe<Ue;qe++){qe===1&&Ct!==1&&$t.writeVarint(w(2,Ue-1));var ar=le[qe].x-gt,Ar=le[qe].y-St;$t.writeVarint(R(ar)),$t.writeVarint(R(Ar)),gt+=ar,St+=Ar}Ct===3&&$t.writeVarint(w(7,1))}}function N(Ce,$t){var ne=typeof Ce;ne==="string"?$t.writeStringField(1,Ce):ne==="boolean"?$t.writeBooleanField(7,Ce):ne==="number"&&(Ce%1!=0?$t.writeDoubleField(3,Ce):Ce<0?$t.writeSVarintField(6,Ce):$t.writeVarintField(5,Ce))}v.exports=A,v.exports.fromVectorTileJs=A,v.exports.fromGeojsonVt=function(Ce,$t){$t=$t||{};var ne={};for(var Ct in Ce)ne[Ct]=new E(Ce[Ct].features,$t),ne[Ct].name=Ct,ne[Ct].version=$t.version,ne[Ct].extent=$t.extent;return A({layers:ne})},v.exports.GeoJSONWrapper=E;var V=t.by(v.exports);let H={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Ce=>Ce},F=Math.fround||(U=new Float32Array(1),Ce=>(U[0]=+Ce,U[0]));var U;let W=3,q=5,X=6;class lt{constructor($t){this.options=Object.assign(Object.create(H),$t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load($t){let{log:ne,minZoom:Ct,maxZoom:gt}=this.options;ne&&console.time("total time");let St=`prepare ${$t.length} points`;ne&&console.time(St),this.points=$t;let Nt=[];for(let le=0;le<$t.length;le++){let we=$t[le];if(!we.geometry)continue;let[Ue,qe]=we.geometry.coordinates,ar=F(st(Ue)),Ar=F(tt(qe));Nt.push(ar,Ar,1/0,le,-1,1),this.options.reduce&&Nt.push(0)}let ee=this.trees[gt+1]=this._createTree(Nt);ne&&console.timeEnd(St);for(let le=gt;le>=Ct;le--){let we=+Date.now();ee=this.trees[le]=this._createTree(this._cluster(ee,le)),ne&&console.log("z%d: %d clusters in %dms",le,ee.numItems,+Date.now()-we)}return ne&&console.timeEnd("total time"),this}getClusters($t,ne){let Ct=(($t[0]+180)%360+360)%360-180,gt=Math.max(-90,Math.min(90,$t[1])),St=$t[2]===180?180:(($t[2]+180)%360+360)%360-180,Nt=Math.max(-90,Math.min(90,$t[3]));if($t[2]-$t[0]>=360)Ct=-180,St=180;else if(Ct>St){let qe=this.getClusters([Ct,gt,180,Nt],ne),ar=this.getClusters([-180,gt,St,Nt],ne);return qe.concat(ar)}let ee=this.trees[this._limitZoom(ne)],le=ee.range(st(Ct),tt(Nt),st(St),tt(gt)),we=ee.data,Ue=[];for(let qe of le){let ar=this.stride*qe;Ue.push(we[ar+q]>1?yt(we,ar,this.clusterProps):this.points[we[ar+W]])}return Ue}getChildren($t){let ne=this._getOriginId($t),Ct=this._getOriginZoom($t),gt="No cluster with the specified id.",St=this.trees[Ct];if(!St)throw new Error(gt);let Nt=St.data;if(ne*this.stride>=Nt.length)throw new Error(gt);let ee=this.options.radius/(this.options.extent*Math.pow(2,Ct-1)),le=St.within(Nt[ne*this.stride],Nt[ne*this.stride+1],ee),we=[];for(let Ue of le){let qe=Ue*this.stride;Nt[qe+4]===$t&&we.push(Nt[qe+q]>1?yt(Nt,qe,this.clusterProps):this.points[Nt[qe+W]])}if(we.length===0)throw new Error(gt);return we}getLeaves($t,ne,Ct){let gt=[];return this._appendLeaves(gt,$t,ne=ne||10,Ct=Ct||0,0),gt}getTile($t,ne,Ct){let gt=this.trees[this._limitZoom($t)],St=Math.pow(2,$t),{extent:Nt,radius:ee}=this.options,le=ee/Nt,we=(Ct-le)/St,Ue=(Ct+1+le)/St,qe={features:[]};return this._addTileFeatures(gt.range((ne-le)/St,we,(ne+1+le)/St,Ue),gt.data,ne,Ct,St,qe),ne===0&&this._addTileFeatures(gt.range(1-le/St,we,1,Ue),gt.data,St,Ct,St,qe),ne===St-1&&this._addTileFeatures(gt.range(0,we,le/St,Ue),gt.data,-1,Ct,St,qe),qe.features.length?qe:null}getClusterExpansionZoom($t){let ne=this._getOriginZoom($t)-1;for(;ne<=this.options.maxZoom;){let Ct=this.getChildren($t);if(ne++,Ct.length!==1)break;$t=Ct[0].properties.cluster_id}return ne}_appendLeaves($t,ne,Ct,gt,St){let Nt=this.getChildren(ne);for(let ee of Nt){let le=ee.properties;if(le&&le.cluster?St+le.point_count<=gt?St+=le.point_count:St=this._appendLeaves($t,le.cluster_id,Ct,gt,St):St<gt?St++:$t.push(ee),$t.length===Ct)break}return St}_createTree($t){let ne=new t.av($t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let Ct=0;Ct<$t.length;Ct+=this.stride)ne.add($t[Ct],$t[Ct+1]);return ne.finish(),ne.data=$t,ne}_addTileFeatures($t,ne,Ct,gt,St,Nt){for(let ee of $t){let le=ee*this.stride,we=ne[le+q]>1,Ue,qe,ar;if(we)Ue=pt(ne,le,this.clusterProps),qe=ne[le],ar=ne[le+1];else{let pr=this.points[ne[le+W]];Ue=pr.properties;let[Jr,Vn]=pr.geometry.coordinates;qe=st(Jr),ar=tt(Vn)}let Ar={type:1,geometry:[[Math.round(this.options.extent*(qe*St-Ct)),Math.round(this.options.extent*(ar*St-gt))]],tags:Ue},Tr;Tr=we||this.options.generateId?ne[le+W]:this.points[ne[le+W]].id,Tr!==void 0&&(Ar.id=Tr),Nt.features.push(Ar)}}_limitZoom($t){return Math.max(this.options.minZoom,Math.min(Math.floor(+$t),this.options.maxZoom+1))}_cluster($t,ne){let{radius:Ct,extent:gt,reduce:St,minPoints:Nt}=this.options,ee=Ct/(gt*Math.pow(2,ne)),le=$t.data,we=[],Ue=this.stride;for(let qe=0;qe<le.length;qe+=Ue){if(le[qe+2]<=ne)continue;le[qe+2]=ne;let ar=le[qe],Ar=le[qe+1],Tr=$t.within(le[qe],le[qe+1],ee),pr=le[qe+q],Jr=pr;for(let Vn of Tr){let Hn=Vn*Ue;le[Hn+2]>ne&&(Jr+=le[Hn+q])}if(Jr>pr&&Jr>=Nt){let Vn,Hn=ar*pr,Kn=Ar*pr,Ci=-1,ii=((qe/Ue|0)<<5)+(ne+1)+this.points.length;for(let qn of Tr){let oa=qn*Ue;if(le[oa+2]<=ne)continue;le[oa+2]=ne;let Hi=le[oa+q];Hn+=le[oa]*Hi,Kn+=le[oa+1]*Hi,le[oa+4]=ii,St&&(Vn||(Vn=this._map(le,qe,!0),Ci=this.clusterProps.length,this.clusterProps.push(Vn)),St(Vn,this._map(le,oa)))}le[qe+4]=ii,we.push(Hn/Jr,Kn/Jr,1/0,ii,-1,Jr),St&&we.push(Ci)}else{for(let Vn=0;Vn<Ue;Vn++)we.push(le[qe+Vn]);if(Jr>1)for(let Vn of Tr){let Hn=Vn*Ue;if(!(le[Hn+2]<=ne)){le[Hn+2]=ne;for(let Kn=0;Kn<Ue;Kn++)we.push(le[Hn+Kn])}}}}return we}_getOriginId($t){return $t-this.points.length>>5}_getOriginZoom($t){return($t-this.points.length)%32}_map($t,ne,Ct){if($t[ne+q]>1){let Nt=this.clusterProps[$t[ne+X]];return Ct?Object.assign({},Nt):Nt}let gt=this.points[$t[ne+W]].properties,St=this.options.map(gt);return Ct&&St===gt?Object.assign({},St):St}}function yt(Ce,$t,ne){return{type:"Feature",id:Ce[$t+W],properties:pt(Ce,$t,ne),geometry:{type:"Point",coordinates:[(Ct=Ce[$t],360*(Ct-.5)),dt(Ce[$t+1])]}};var Ct}function pt(Ce,$t,ne){let Ct=Ce[$t+q],gt=Ct>=1e4?`${Math.round(Ct/1e3)}k`:Ct>=1e3?Math.round(Ct/100)/10+"k":Ct,St=Ce[$t+X],Nt=St===-1?{}:Object.assign({},ne[St]);return Object.assign(Nt,{cluster:!0,cluster_id:Ce[$t+W],point_count:Ct,point_count_abbreviated:gt})}function st(Ce){return Ce/360+.5}function tt(Ce){let $t=Math.sin(Ce*Math.PI/180),ne=.5-.25*Math.log((1+$t)/(1-$t))/Math.PI;return ne<0?0:ne>1?1:ne}function dt(Ce){let $t=(180-360*Ce)*Math.PI/180;return 360*Math.atan(Math.exp($t))/Math.PI-90}function rt(Ce,$t,ne,Ct){let gt=Ct,St=$t+(ne-$t>>1),Nt,ee=ne-$t,le=Ce[$t],we=Ce[$t+1],Ue=Ce[ne],qe=Ce[ne+1];for(let ar=$t+3;ar<ne;ar+=3){let Ar=at(Ce[ar],Ce[ar+1],le,we,Ue,qe);if(Ar>gt)Nt=ar,gt=Ar;else if(Ar===gt){let Tr=Math.abs(ar-St);Tr<ee&&(Nt=ar,ee=Tr)}}gt>Ct&&(Nt-$t>3&&rt(Ce,$t,Nt,Ct),Ce[Nt+2]=gt,ne-Nt>3&&rt(Ce,Nt,ne,Ct))}function at(Ce,$t,ne,Ct,gt,St){let Nt=gt-ne,ee=St-Ct;if(Nt!==0||ee!==0){let le=((Ce-ne)*Nt+($t-Ct)*ee)/(Nt*Nt+ee*ee);le>1?(ne=gt,Ct=St):le>0&&(ne+=Nt*le,Ct+=ee*le)}return Nt=Ce-ne,ee=$t-Ct,Nt*Nt+ee*ee}function vt(Ce,$t,ne,Ct){let gt={id:Ce??null,type:$t,geometry:ne,tags:Ct,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if($t==="Point"||$t==="MultiPoint"||$t==="LineString")it(gt,ne);else if($t==="Polygon")it(gt,ne[0]);else if($t==="MultiLineString")for(let St of ne)it(gt,St);else if($t==="MultiPolygon")for(let St of ne)it(gt,St[0]);return gt}function it(Ce,$t){for(let ne=0;ne<$t.length;ne+=3)Ce.minX=Math.min(Ce.minX,$t[ne]),Ce.minY=Math.min(Ce.minY,$t[ne+1]),Ce.maxX=Math.max(Ce.maxX,$t[ne]),Ce.maxY=Math.max(Ce.maxY,$t[ne+1])}function Y(Ce,$t,ne,Ct){if(!$t.geometry)return;let gt=$t.geometry.coordinates;if(gt&&gt.length===0)return;let St=$t.geometry.type,Nt=Math.pow(ne.tolerance/((1<<ne.maxZoom)*ne.extent),2),ee=[],le=$t.id;if(ne.promoteId?le=$t.properties[ne.promoteId]:ne.generateId&&(le=Ct||0),St==="Point")ft(gt,ee);else if(St==="MultiPoint")for(let we of gt)ft(we,ee);else if(St==="LineString")ut(gt,ee,Nt,!1);else if(St==="MultiLineString"){if(ne.lineMetrics){for(let we of gt)ee=[],ut(we,ee,Nt,!1),Ce.push(vt(le,"LineString",ee,$t.properties));return}wt(gt,ee,Nt,!1)}else if(St==="Polygon")wt(gt,ee,Nt,!0);else{if(St!=="MultiPolygon"){if(St==="GeometryCollection"){for(let we of $t.geometry.geometries)Y(Ce,{id:le,geometry:we,properties:$t.properties},ne,Ct);return}throw new Error("Input data is not a valid GeoJSON object.")}for(let we of gt){let Ue=[];wt(we,Ue,Nt,!0),ee.push(Ue)}}Ce.push(vt(le,St,ee,$t.properties))}function ft(Ce,$t){$t.push(zt(Ce[0]),Pt(Ce[1]),0)}function ut(Ce,$t,ne,Ct){let gt,St,Nt=0;for(let le=0;le<Ce.length;le++){let we=zt(Ce[le][0]),Ue=Pt(Ce[le][1]);$t.push(we,Ue,0),le>0&&(Nt+=Ct?(gt*Ue-we*St)/2:Math.sqrt(Math.pow(we-gt,2)+Math.pow(Ue-St,2))),gt=we,St=Ue}let ee=$t.length-3;$t[2]=1,rt($t,0,ee,ne),$t[ee+2]=1,$t.size=Math.abs(Nt),$t.start=0,$t.end=$t.size}function wt(Ce,$t,ne,Ct){for(let gt=0;gt<Ce.length;gt++){let St=[];ut(Ce[gt],St,ne,Ct),$t.push(St)}}function zt(Ce){return Ce/360+.5}function Pt(Ce){let $t=Math.sin(Ce*Math.PI/180),ne=.5-.25*Math.log((1+$t)/(1-$t))/Math.PI;return ne<0?0:ne>1?1:ne}function Wt(Ce,$t,ne,Ct,gt,St,Nt,ee){if(Ct/=$t,St>=(ne/=$t)&&Nt<Ct)return Ce;if(Nt<ne||St>=Ct)return null;let le=[];for(let we of Ce){let Ue=we.geometry,qe=we.type,ar=gt===0?we.minX:we.minY,Ar=gt===0?we.maxX:we.maxY;if(ar>=ne&&Ar<Ct){le.push(we);continue}if(Ar<ne||ar>=Ct)continue;let Tr=[];if(qe==="Point"||qe==="MultiPoint")Ht(Ue,Tr,ne,Ct,gt);else if(qe==="LineString")Jt(Ue,Tr,ne,Ct,gt,!1,ee.lineMetrics);else if(qe==="MultiLineString")he(Ue,Tr,ne,Ct,gt,!1);else if(qe==="Polygon")he(Ue,Tr,ne,Ct,gt,!0);else if(qe==="MultiPolygon")for(let pr of Ue){let Jr=[];he(pr,Jr,ne,Ct,gt,!0),Jr.length&&Tr.push(Jr)}if(Tr.length){if(ee.lineMetrics&&qe==="LineString"){for(let pr of Tr)le.push(vt(we.id,qe,pr,we.tags));continue}qe!=="LineString"&&qe!=="MultiLineString"||(Tr.length===1?(qe="LineString",Tr=Tr[0]):qe="MultiLineString"),qe!=="Point"&&qe!=="MultiPoint"||(qe=Tr.length===3?"Point":"MultiPoint"),le.push(vt(we.id,qe,Tr,we.tags))}}return le.length?le:null}function Ht(Ce,$t,ne,Ct,gt){for(let St=0;St<Ce.length;St+=3){let Nt=Ce[St+gt];Nt>=ne&&Nt<=Ct&&de($t,Ce[St],Ce[St+1],Ce[St+2])}}function Jt(Ce,$t,ne,Ct,gt,St,Nt){let ee=ge(Ce),le=gt===0?se:Tt,we,Ue,qe=Ce.start;for(let Jr=0;Jr<Ce.length-3;Jr+=3){let Vn=Ce[Jr],Hn=Ce[Jr+1],Kn=Ce[Jr+2],Ci=Ce[Jr+3],ii=Ce[Jr+4],qn=gt===0?Vn:Hn,oa=gt===0?Ci:ii,Hi=!1;Nt&&(we=Math.sqrt(Math.pow(Vn-Ci,2)+Math.pow(Hn-ii,2))),qn<ne?oa>ne&&(Ue=le(ee,Vn,Hn,Ci,ii,ne),Nt&&(ee.start=qe+we*Ue)):qn>Ct?oa<Ct&&(Ue=le(ee,Vn,Hn,Ci,ii,Ct),Nt&&(ee.start=qe+we*Ue)):de(ee,Vn,Hn,Kn),oa<ne&&qn>=ne&&(Ue=le(ee,Vn,Hn,Ci,ii,ne),Hi=!0),oa>Ct&&qn<=Ct&&(Ue=le(ee,Vn,Hn,Ci,ii,Ct),Hi=!0),!St&&Hi&&(Nt&&(ee.end=qe+we*Ue),$t.push(ee),ee=ge(Ce)),Nt&&(qe+=we)}let ar=Ce.length-3,Ar=Ce[ar],Tr=Ce[ar+1],pr=gt===0?Ar:Tr;pr>=ne&&pr<=Ct&&de(ee,Ar,Tr,Ce[ar+2]),ar=ee.length-3,St&&ar>=3&&(ee[ar]!==ee[0]||ee[ar+1]!==ee[1])&&de(ee,ee[0],ee[1],ee[2]),ee.length&&$t.push(ee)}function ge(Ce){let $t=[];return $t.size=Ce.size,$t.start=Ce.start,$t.end=Ce.end,$t}function he(Ce,$t,ne,Ct,gt,St){for(let Nt of Ce)Jt(Nt,$t,ne,Ct,gt,St,!1)}function de(Ce,$t,ne,Ct){Ce.push($t,ne,Ct)}function se(Ce,$t,ne,Ct,gt,St){let Nt=(St-$t)/(Ct-$t);return de(Ce,St,ne+(gt-ne)*Nt,1),Nt}function Tt(Ce,$t,ne,Ct,gt,St){let Nt=(St-ne)/(gt-ne);return de(Ce,$t+(Ct-$t)*Nt,St,1),Nt}function Lt(Ce,$t){let ne=[];for(let Ct=0;Ct<Ce.length;Ct++){let gt=Ce[Ct],St=gt.type,Nt;if(St==="Point"||St==="MultiPoint"||St==="LineString")Nt=Mt(gt.geometry,$t);else if(St==="MultiLineString"||St==="Polygon"){Nt=[];for(let ee of gt.geometry)Nt.push(Mt(ee,$t))}else if(St==="MultiPolygon"){Nt=[];for(let ee of gt.geometry){let le=[];for(let we of ee)le.push(Mt(we,$t));Nt.push(le)}}ne.push(vt(gt.id,St,Nt,gt.tags))}return ne}function Mt(Ce,$t){let ne=[];ne.size=Ce.size,Ce.start!==void 0&&(ne.start=Ce.start,ne.end=Ce.end);for(let Ct=0;Ct<Ce.length;Ct+=3)ne.push(Ce[Ct]+$t,Ce[Ct+1],Ce[Ct+2]);return ne}function te(Ce,$t){if(Ce.transformed)return Ce;let ne=1<<Ce.z,Ct=Ce.x,gt=Ce.y;for(let St of Ce.features){let Nt=St.geometry,ee=St.type;if(St.geometry=[],ee===1)for(let le=0;le<Nt.length;le+=2)St.geometry.push(ve(Nt[le],Nt[le+1],$t,ne,Ct,gt));else for(let le=0;le<Nt.length;le++){let we=[];for(let Ue=0;Ue<Nt[le].length;Ue+=2)we.push(ve(Nt[le][Ue],Nt[le][Ue+1],$t,ne,Ct,gt));St.geometry.push(we)}}return Ce.transformed=!0,Ce}function ve(Ce,$t,ne,Ct,gt,St){return[Math.round(ne*(Ce*Ct-gt)),Math.round(ne*($t*Ct-St))]}function oe(Ce,$t,ne,Ct,gt){let St=$t===gt.maxZoom?0:gt.tolerance/((1<<$t)*gt.extent),Nt={features:[],numPoints:0,numSimplified:0,numFeatures:Ce.length,source:null,x:ne,y:Ct,z:$t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let ee of Ce)Te(Nt,ee,St,gt);return Nt}function Te(Ce,$t,ne,Ct){let gt=$t.geometry,St=$t.type,Nt=[];if(Ce.minX=Math.min(Ce.minX,$t.minX),Ce.minY=Math.min(Ce.minY,$t.minY),Ce.maxX=Math.max(Ce.maxX,$t.maxX),Ce.maxY=Math.max(Ce.maxY,$t.maxY),St==="Point"||St==="MultiPoint")for(let ee=0;ee<gt.length;ee+=3)Nt.push(gt[ee],gt[ee+1]),Ce.numPoints++,Ce.numSimplified++;else if(St==="LineString")He(Nt,gt,Ce,ne,!1,!1);else if(St==="MultiLineString"||St==="Polygon")for(let ee=0;ee<gt.length;ee++)He(Nt,gt[ee],Ce,ne,St==="Polygon",ee===0);else if(St==="MultiPolygon")for(let ee=0;ee<gt.length;ee++){let le=gt[ee];for(let we=0;we<le.length;we++)He(Nt,le[we],Ce,ne,!0,we===0)}if(Nt.length){let ee=$t.tags||null;if(St==="LineString"&&Ct.lineMetrics){ee={};for(let we in $t.tags)ee[we]=$t.tags[we];ee.mapbox_clip_start=gt.start/gt.size,ee.mapbox_clip_end=gt.end/gt.size}let le={geometry:Nt,type:St==="Polygon"||St==="MultiPolygon"?3:St==="LineString"||St==="MultiLineString"?2:1,tags:ee};$t.id!==null&&(le.id=$t.id),Ce.features.push(le)}}function He(Ce,$t,ne,Ct,gt,St){let Nt=Ct*Ct;if(Ct>0&&$t.size<(gt?Nt:Ct))return void(ne.numPoints+=$t.length/3);let ee=[];for(let le=0;le<$t.length;le+=3)(Ct===0||$t[le+2]>Nt)&&(ne.numSimplified++,ee.push($t[le],$t[le+1])),ne.numPoints++;gt&&function(le,we){let Ue=0;for(let qe=0,ar=le.length,Ar=ar-2;qe<ar;Ar=qe,qe+=2)Ue+=(le[qe]-le[Ar])*(le[qe+1]+le[Ar+1]);if(Ue>0===we)for(let qe=0,ar=le.length;qe<ar/2;qe+=2){let Ar=le[qe],Tr=le[qe+1];le[qe]=le[ar-2-qe],le[qe+1]=le[ar-1-qe],le[ar-2-qe]=Ar,le[ar-1-qe]=Tr}}(ee,St),Ce.push(ee)}let Ge={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class cr{constructor($t,ne){let Ct=(ne=this.options=function(St,Nt){for(let ee in Nt)St[ee]=Nt[ee];return St}(Object.create(Ge),ne)).debug;if(Ct&&console.time("preprocess data"),ne.maxZoom<0||ne.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(ne.promoteId&&ne.generateId)throw new Error("promoteId and generateId cannot be used together.");let gt=function(St,Nt){let ee=[];if(St.type==="FeatureCollection")for(let le=0;le<St.features.length;le++)Y(ee,St.features[le],Nt,le);else Y(ee,St.type==="Feature"?St:{geometry:St},Nt);return ee}($t,ne);this.tiles={},this.tileCoords=[],Ct&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",ne.indexMaxZoom,ne.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),gt=function(St,Nt){let ee=Nt.buffer/Nt.extent,le=St,we=Wt(St,1,-1-ee,ee,0,-1,2,Nt),Ue=Wt(St,1,1-ee,2+ee,0,-1,2,Nt);return(we||Ue)&&(le=Wt(St,1,-ee,1+ee,0,-1,2,Nt)||[],we&&(le=Lt(we,1).concat(le)),Ue&&(le=le.concat(Lt(Ue,-1)))),le}(gt,ne),gt.length&&this.splitTile(gt,0,0,0),Ct&&(gt.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($t,ne,Ct,gt,St,Nt,ee){let le=[$t,ne,Ct,gt],we=this.options,Ue=we.debug;for(;le.length;){gt=le.pop(),Ct=le.pop(),ne=le.pop(),$t=le.pop();let qe=1<<ne,ar=ur(ne,Ct,gt),Ar=this.tiles[ar];if(!Ar&&(Ue>1&&console.time("creation"),Ar=this.tiles[ar]=oe($t,ne,Ct,gt,we),this.tileCoords.push({z:ne,x:Ct,y:gt}),Ue)){Ue>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ne,Ct,gt,Ar.numFeatures,Ar.numPoints,Ar.numSimplified),console.timeEnd("creation"));let Hi=`z${ne}`;this.stats[Hi]=(this.stats[Hi]||0)+1,this.total++}if(Ar.source=$t,St==null){if(ne===we.indexMaxZoom||Ar.numPoints<=we.indexMaxPoints)continue}else{if(ne===we.maxZoom||ne===St)continue;if(St!=null){let Hi=St-ne;if(Ct!==Nt>>Hi||gt!==ee>>Hi)continue}}if(Ar.source=null,$t.length===0)continue;Ue>1&&console.time("clipping");let Tr=.5*we.buffer/we.extent,pr=.5-Tr,Jr=.5+Tr,Vn=1+Tr,Hn=null,Kn=null,Ci=null,ii=null,qn=Wt($t,qe,Ct-Tr,Ct+Jr,0,Ar.minX,Ar.maxX,we),oa=Wt($t,qe,Ct+pr,Ct+Vn,0,Ar.minX,Ar.maxX,we);$t=null,qn&&(Hn=Wt(qn,qe,gt-Tr,gt+Jr,1,Ar.minY,Ar.maxY,we),Kn=Wt(qn,qe,gt+pr,gt+Vn,1,Ar.minY,Ar.maxY,we),qn=null),oa&&(Ci=Wt(oa,qe,gt-Tr,gt+Jr,1,Ar.minY,Ar.maxY,we),ii=Wt(oa,qe,gt+pr,gt+Vn,1,Ar.minY,Ar.maxY,we),oa=null),Ue>1&&console.timeEnd("clipping"),le.push(Hn||[],ne+1,2*Ct,2*gt),le.push(Kn||[],ne+1,2*Ct,2*gt+1),le.push(Ci||[],ne+1,2*Ct+1,2*gt),le.push(ii||[],ne+1,2*Ct+1,2*gt+1)}}getTile($t,ne,Ct){$t=+$t,ne=+ne,Ct=+Ct;let gt=this.options,{extent:St,debug:Nt}=gt;if($t<0||$t>24)return null;let ee=1<<$t,le=ur($t,ne=ne+ee&ee-1,Ct);if(this.tiles[le])return te(this.tiles[le],St);Nt>1&&console.log("drilling down to z%d-%d-%d",$t,ne,Ct);let we,Ue=$t,qe=ne,ar=Ct;for(;!we&&Ue>0;)Ue--,qe>>=1,ar>>=1,we=this.tiles[ur(Ue,qe,ar)];return we&&we.source?(Nt>1&&(console.log("found parent tile z%d-%d-%d",Ue,qe,ar),console.time("drilling down")),this.splitTile(we.source,Ue,qe,ar,$t,ne,Ct),Nt>1&&console.timeEnd("drilling down"),this.tiles[le]?te(this.tiles[le],St):null):null}}function ur(Ce,$t,ne){return 32*((1<<Ce)*ne+$t)+Ce}function jr(Ce,$t){return $t?Ce.properties[$t]:Ce.id}function Hr(Ce,$t){if(Ce==null)return!0;if(Ce.type==="Feature")return jr(Ce,$t)!=null;if(Ce.type==="FeatureCollection"){let ne=new Set;for(let Ct of Ce.features){let gt=jr(Ct,$t);if(gt==null||ne.has(gt))return!1;ne.add(gt)}return!0}return!1}function br(Ce,$t){let ne=new Map;if(Ce!=null)if(Ce.type==="Feature")ne.set(jr(Ce,$t),Ce);else for(let Ct of Ce.features)ne.set(jr(Ct,$t),Ct);return ne}class Kr extends o{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile($t,ne){return t._(this,void 0,void 0,function*(){let Ct=$t.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let gt=this._geoJSONIndex.getTile(Ct.z,Ct.x,Ct.y);if(!gt)return null;let St=new class{constructor(ee){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.X,this.length=ee.length,this._features=ee}feature(ee){return new class{constructor(le){this._feature=le,this.extent=t.X,this.type=le.type,this.properties=le.tags,"id"in le&&!isNaN(le.id)&&(this.id=parseInt(le.id,10))}loadGeometry(){if(this._feature.type===1){let le=[];for(let we of this._feature.geometry)le.push([new t.P(we[0],we[1])]);return le}{let le=[];for(let we of this._feature.geometry){let Ue=[];for(let qe of we)Ue.push(new t.P(qe[0],qe[1]));le.push(Ue)}return le}}toGeoJSON(le,we,Ue){return y.call(this,le,we,Ue)}}(this._features[ee])}}(gt.features),Nt=V(St);return Nt.byteOffset===0&&Nt.byteLength===Nt.buffer.byteLength||(Nt=new Uint8Array(Nt)),{vectorTile:St,rawData:Nt.buffer}})}loadData($t){return t._(this,void 0,void 0,function*(){var ne;(ne=this._pendingRequest)===null||ne===void 0||ne.abort();let Ct=!!($t&&$t.request&&$t.request.collectResourceTiming)&&new t.bv($t.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON($t,this._pendingRequest),this._geoJSONIndex=$t.cluster?new lt(function({superclusterOptions:Nt,clusterProperties:ee}){if(!ee||!Nt)return Nt;let le={},we={},Ue={accumulated:null,zoom:0},qe={properties:null},ar=Object.keys(ee);for(let Ar of ar){let[Tr,pr]=ee[Ar],Jr=t.bC(pr),Vn=t.bC(typeof Tr=="string"?[Tr,["accumulated"],["get",Ar]]:Tr);le[Ar]=Jr.value,we[Ar]=Vn.value}return Nt.map=Ar=>{qe.properties=Ar;let Tr={};for(let pr of ar)Tr[pr]=le[pr].evaluate(Ue,qe);return Tr},Nt.reduce=(Ar,Tr)=>{qe.properties=Tr;for(let pr of ar)Ue.accumulated=Ar[pr],Ar[pr]=we[pr].evaluate(Ue,qe)},Nt}($t)).load((yield this._pendingData).features):(gt=yield this._pendingData,new cr(gt,$t.geojsonVtOptions)),this.loaded={};let St={};if(Ct){let Nt=Ct.finish();Nt&&(St.resourceTiming={},St.resourceTiming[$t.source]=JSON.parse(JSON.stringify(Nt)))}return St}catch(St){if(delete this._pendingRequest,t.bB(St))return{abandoned:!0};throw St}var gt})}getData(){return t._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile($t){let ne=this.loaded;return ne&&ne[$t.uid]?super.reloadTile($t):this.loadTile($t)}loadAndProcessGeoJSON($t,ne){return t._(this,void 0,void 0,function*(){let Ct=yield this.loadGeoJSON($t,ne);if(delete this._pendingRequest,typeof Ct!="object")throw new Error(`Input data given to '${$t.source}' is not a valid GeoJSON object.`);if(x(Ct,!0),$t.filter){let gt=t.bC($t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(gt.result==="error")throw new Error(gt.value.map(St=>`${St.key}: ${St.message}`).join(", "));Ct={type:"FeatureCollection",features:Ct.features.filter(St=>gt.value.evaluate({zoom:0},St))}}return Ct})}loadGeoJSON($t,ne){return t._(this,void 0,void 0,function*(){let{promoteId:Ct}=$t;if($t.request){let gt=yield t.h($t.request,ne);return this._dataUpdateable=Hr(gt.data,Ct)?br(gt.data,Ct):void 0,gt.data}if(typeof $t.data=="string")try{let gt=JSON.parse($t.data);return this._dataUpdateable=Hr(gt,Ct)?br(gt,Ct):void 0,gt}catch{throw new Error(`Input data given to '${$t.source}' is not a valid GeoJSON object.`)}if(!$t.dataDiff)throw new Error(`Input data given to '${$t.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${$t.source}`);return function(gt,St,Nt){var ee,le,we,Ue;if(St.removeAll&&gt.clear(),St.remove)for(let qe of St.remove)gt.delete(qe);if(St.add)for(let qe of St.add){let ar=jr(qe,Nt);ar!=null&&gt.set(ar,qe)}if(St.update)for(let qe of St.update){let ar=gt.get(qe.id);if(ar==null)continue;let Ar=!qe.removeAllProperties&&(((ee=qe.removeProperties)===null||ee===void 0?void 0:ee.length)>0||((le=qe.addOrUpdateProperties)===null||le===void 0?void 0:le.length)>0);if((qe.newGeometry||qe.removeAllProperties||Ar)&&(ar=Object.assign({},ar),gt.set(qe.id,ar),Ar&&(ar.properties=Object.assign({},ar.properties))),qe.newGeometry&&(ar.geometry=qe.newGeometry),qe.removeAllProperties)ar.properties={};else if(((we=qe.removeProperties)===null||we===void 0?void 0:we.length)>0)for(let Tr of qe.removeProperties)Object.prototype.hasOwnProperty.call(ar.properties,Tr)&&delete ar.properties[Tr];if(((Ue=qe.addOrUpdateProperties)===null||Ue===void 0?void 0:Ue.length)>0)for(let{key:Tr,value:pr}of qe.addOrUpdateProperties)ar.properties[Tr]=pr}}(this._dataUpdateable,$t.dataDiff,Ct),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource($t){return t._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom($t){return this._geoJSONIndex.getClusterExpansionZoom($t.clusterId)}getClusterChildren($t){return this._geoJSONIndex.getChildren($t.clusterId)}getClusterLeaves($t){return this._geoJSONIndex.getLeaves($t.clusterId,$t.limit,$t.offset)}}class rn{constructor($t){this.self=$t,this.actor=new t.F($t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(ne,Ct)=>{if(this.externalWorkerSourceTypes[ne])throw new Error(`Worker source with name "${ne}" already registered.`);this.externalWorkerSourceTypes[ne]=Ct},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=ne=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(ne)},this.actor.registerMessageHandler("LDT",(ne,Ct)=>this._getDEMWorkerSource(ne,Ct.source).loadTile(Ct)),this.actor.registerMessageHandler("RDT",(ne,Ct)=>t._(this,void 0,void 0,function*(){this._getDEMWorkerSource(ne,Ct.source).removeTile(Ct)})),this.actor.registerMessageHandler("GCEZ",(ne,Ct)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(ne,Ct.type,Ct.source).getClusterExpansionZoom(Ct)})),this.actor.registerMessageHandler("GCC",(ne,Ct)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(ne,Ct.type,Ct.source).getClusterChildren(Ct)})),this.actor.registerMessageHandler("GCL",(ne,Ct)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(ne,Ct.type,Ct.source).getClusterLeaves(Ct)})),this.actor.registerMessageHandler("LD",(ne,Ct)=>this._getWorkerSource(ne,Ct.type,Ct.source).loadData(Ct)),this.actor.registerMessageHandler("GD",(ne,Ct)=>this._getWorkerSource(ne,Ct.type,Ct.source).getData()),this.actor.registerMessageHandler("LT",(ne,Ct)=>this._getWorkerSource(ne,Ct.type,Ct.source).loadTile(Ct)),this.actor.registerMessageHandler("RT",(ne,Ct)=>this._getWorkerSource(ne,Ct.type,Ct.source).reloadTile(Ct)),this.actor.registerMessageHandler("AT",(ne,Ct)=>this._getWorkerSource(ne,Ct.type,Ct.source).abortTile(Ct)),this.actor.registerMessageHandler("RMT",(ne,Ct)=>this._getWorkerSource(ne,Ct.type,Ct.source).removeTile(Ct)),this.actor.registerMessageHandler("RS",(ne,Ct)=>t._(this,void 0,void 0,function*(){if(!this.workerSources[ne]||!this.workerSources[ne][Ct.type]||!this.workerSources[ne][Ct.type][Ct.source])return;let gt=this.workerSources[ne][Ct.type][Ct.source];delete this.workerSources[ne][Ct.type][Ct.source],gt.removeSource!==void 0&&gt.removeSource(Ct)})),this.actor.registerMessageHandler("RM",ne=>t._(this,void 0,void 0,function*(){delete this.layerIndexes[ne],delete this.availableImages[ne],delete this.workerSources[ne],delete this.demWorkerSources[ne]})),this.actor.registerMessageHandler("SR",(ne,Ct)=>t._(this,void 0,void 0,function*(){this.referrer=Ct})),this.actor.registerMessageHandler("SRPS",(ne,Ct)=>this._syncRTLPluginState(ne,Ct)),this.actor.registerMessageHandler("IS",(ne,Ct)=>t._(this,void 0,void 0,function*(){this.self.importScripts(Ct)})),this.actor.registerMessageHandler("SI",(ne,Ct)=>this._setImages(ne,Ct)),this.actor.registerMessageHandler("UL",(ne,Ct)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(ne).update(Ct.layers,Ct.removedIds)})),this.actor.registerMessageHandler("SL",(ne,Ct)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(ne).replace(Ct)}))}_setImages($t,ne){return t._(this,void 0,void 0,function*(){this.availableImages[$t]=ne;for(let Ct in this.workerSources[$t]){let gt=this.workerSources[$t][Ct];for(let St in gt)gt[St].availableImages=ne}})}_syncRTLPluginState($t,ne){return t._(this,void 0,void 0,function*(){if(t.bD.isParsed())return t.bD.getState();if(ne.pluginStatus!=="loading")return t.bD.setState(ne),ne;let Ct=ne.pluginURL;if(this.self.importScripts(Ct),t.bD.isParsed()){let gt={pluginStatus:"loaded",pluginURL:Ct};return t.bD.setState(gt),gt}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Ct}`)})}_getAvailableImages($t){let ne=this.availableImages[$t];return ne||(ne=[]),ne}_getLayerIndex($t){let ne=this.layerIndexes[$t];return ne||(ne=this.layerIndexes[$t]=new e),ne}_getWorkerSource($t,ne,Ct){if(this.workerSources[$t]||(this.workerSources[$t]={}),this.workerSources[$t][ne]||(this.workerSources[$t][ne]={}),!this.workerSources[$t][ne][Ct]){let gt={sendAsync:(St,Nt)=>(St.targetMapId=$t,this.actor.sendAsync(St,Nt))};switch(ne){case"vector":this.workerSources[$t][ne][Ct]=new o(gt,this._getLayerIndex($t),this._getAvailableImages($t));break;case"geojson":this.workerSources[$t][ne][Ct]=new Kr(gt,this._getLayerIndex($t),this._getAvailableImages($t));break;default:this.workerSources[$t][ne][Ct]=new this.externalWorkerSourceTypes[ne](gt,this._getLayerIndex($t),this._getAvailableImages($t))}}return this.workerSources[$t][ne][Ct]}_getDEMWorkerSource($t,ne){return this.demWorkerSources[$t]||(this.demWorkerSources[$t]={}),this.demWorkerSources[$t][ne]||(this.demWorkerSources[$t][ne]=new i),this.demWorkerSources[$t][ne]}}return t.i(self)&&(self.worker=new rn(self)),rn}),P("index",["exports","./shared"],function(t,e){var r="4.7.1";let a,n,o={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:qt=>new Promise((I,ht)=>{let Et=requestAnimationFrame(I);qt.signal.addEventListener("abort",()=>{cancelAnimationFrame(Et),ht(e.c())})}),getImageData(qt,I=0){return this.getImageCanvasContext(qt).getImageData(-I,-I,qt.width+2*I,qt.height+2*I)},getImageCanvasContext(qt){let I=window.document.createElement("canvas"),ht=I.getContext("2d",{willReadFrequently:!0});if(!ht)throw new Error("failed to create canvas 2d context");return I.width=qt.width,I.height=qt.height,ht.drawImage(qt,0,0,qt.width,qt.height),ht},resolveURL:qt=>(a||(a=document.createElement("a")),a.href=qt,a.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(n==null&&(n=matchMedia("(prefers-reduced-motion: reduce)")),n.matches)}};class i{static testProp(I){if(!i.docStyle)return I[0];for(let ht=0;ht<I.length;ht++)if(I[ht]in i.docStyle)return I[ht];return I[0]}static create(I,ht,Et){let It=window.document.createElement(I);return ht!==void 0&&(It.className=ht),Et&&Et.appendChild(It),It}static createNS(I,ht){return window.document.createElementNS(I,ht)}static disableDrag(){i.docStyle&&i.selectProp&&(i.userSelect=i.docStyle[i.selectProp],i.docStyle[i.selectProp]="none")}static enableDrag(){i.docStyle&&i.selectProp&&(i.docStyle[i.selectProp]=i.userSelect)}static setTransform(I,ht){I.style[i.transformProp]=ht}static addEventListener(I,ht,Et,It={}){I.addEventListener(ht,Et,"passive"in It?It:It.capture)}static removeEventListener(I,ht,Et,It={}){I.removeEventListener(ht,Et,"passive"in It?It:It.capture)}static suppressClickInternal(I){I.preventDefault(),I.stopPropagation(),window.removeEventListener("click",i.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",i.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",i.suppressClickInternal,!0)},0)}static getScale(I){let ht=I.getBoundingClientRect();return{x:ht.width/I.offsetWidth||1,y:ht.height/I.offsetHeight||1,boundingClientRect:ht}}static getPoint(I,ht,Et){let It=ht.boundingClientRect;return new e.P((Et.clientX-It.left)/ht.x-I.clientLeft,(Et.clientY-It.top)/ht.y-I.clientTop)}static mousePos(I,ht){let Et=i.getScale(I);return i.getPoint(I,Et,ht)}static touchPos(I,ht){let Et=[],It=i.getScale(I);for(let Vt=0;Vt<ht.length;Vt++)Et.push(i.getPoint(I,It,ht[Vt]));return Et}static mouseButton(I){return I.button}static remove(I){I.parentNode&&I.parentNode.removeChild(I)}}i.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,i.selectProp=i.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),i.transformProp=i.testProp(["transform","WebkitTransform"]);let s={supported:!1,testSupport:function(qt){!y&&x&&(v?T(qt):f=qt)}},f,x,y=!1,v=!1;function T(qt){let I=qt.createTexture();qt.bindTexture(qt.TEXTURE_2D,I);try{if(qt.texImage2D(qt.TEXTURE_2D,0,qt.RGBA,qt.RGBA,qt.UNSIGNED_BYTE,x),qt.isContextLost())return;s.supported=!0}catch{}qt.deleteTexture(I),y=!0}var u;typeof document<"u"&&(x=document.createElement("img"),x.onload=()=>{f&&T(f),f=null,v=!0},x.onerror=()=>{y=!0,f=null},x.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(qt){let I,ht,Et,It;qt.resetRequestQueue=()=>{I=[],ht=0,Et=0,It={}},qt.addThrottleControl=Ke=>{let gr=Et++;return It[gr]=Ke,gr},qt.removeThrottleControl=Ke=>{delete It[Ke],ke()},qt.getImage=(Ke,gr,Or=!0)=>new Promise((Dr,ln)=>{s.supported&&(Ke.headers||(Ke.headers={}),Ke.headers.accept="image/webp,*/*"),e.e(Ke,{type:"image"}),I.push({abortController:gr,requestParameters:Ke,supportImageRefresh:Or,state:"queued",onError:Sn=>{ln(Sn)},onSuccess:Sn=>{Dr(Sn)}}),ke()});let Vt=Ke=>e._(this,void 0,void 0,function*(){Ke.state="running";let{requestParameters:gr,supportImageRefresh:Or,onError:Dr,onSuccess:ln,abortController:Sn}=Ke,Xt=Or===!1&&!e.i(self)&&!e.g(gr.url)&&(!gr.headers||Object.keys(gr.headers).reduce((Ae,je)=>Ae&&je==="accept",!0));ht++;let ae=Xt?Oe(gr,Sn):e.m(gr,Sn);try{let Ae=yield ae;delete Ke.abortController,Ke.state="completed",Ae.data instanceof HTMLImageElement||e.b(Ae.data)?ln(Ae):Ae.data&&ln({data:yield(xe=Ae.data,typeof createImageBitmap=="function"?e.d(xe):e.f(xe)),cacheControl:Ae.cacheControl,expires:Ae.expires})}catch(Ae){delete Ke.abortController,Dr(Ae)}finally{ht--,ke()}var xe}),ke=()=>{let Ke=(()=>{for(let gr of Object.keys(It))if(It[gr]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let gr=ht;gr<Ke&&I.length>0;gr++){let Or=I.shift();Or.abortController.signal.aborted?gr--:Vt(Or)}},Oe=(Ke,gr)=>new Promise((Or,Dr)=>{let ln=new Image,Sn=Ke.url,Xt=Ke.credentials;Xt&&Xt==="include"?ln.crossOrigin="use-credentials":(Xt&&Xt==="same-origin"||!e.s(Sn))&&(ln.crossOrigin="anonymous"),gr.signal.addEventListener("abort",()=>{ln.src="",Dr(e.c())}),ln.fetchPriority="high",ln.onload=()=>{ln.onerror=ln.onload=null,Or({data:ln})},ln.onerror=()=>{ln.onerror=ln.onload=null,gr.signal.aborted||Dr(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."))},ln.src=Sn})}(u||(u={})),u.resetRequestQueue();class b{constructor(I){this._transformRequestFn=I}transformRequest(I,ht){return this._transformRequestFn&&this._transformRequestFn(I,ht)||{url:I}}setTransformRequest(I){this._transformRequestFn=I}}function _(qt){var I=new e.A(3);return I[0]=qt[0],I[1]=qt[1],I[2]=qt[2],I}var C,M=function(qt,I,ht){return qt[0]=I[0]-ht[0],qt[1]=I[1]-ht[1],qt[2]=I[2]-ht[2],qt};C=new e.A(3),e.A!=Float32Array&&(C[0]=0,C[1]=0,C[2]=0);var E=function(qt){var I=qt[0],ht=qt[1];return I*I+ht*ht};function A(qt){let I=[];if(typeof qt=="string")I.push({id:"default",url:qt});else if(qt&&qt.length>0){let ht=[];for(let{id:Et,url:It}of qt){let Vt=`${Et}${It}`;ht.indexOf(Vt)===-1&&(ht.push(Vt),I.push({id:Et,url:It}))}}return I}function h(qt,I,ht){let Et=qt.split("?");return Et[0]+=`${I}${ht}`,Et.join("?")}(function(){var qt=new e.A(2);e.A!=Float32Array&&(qt[0]=0,qt[1]=0)})();class p{constructor(I,ht,Et,It){this.context=I,this.format=Et,this.texture=I.gl.createTexture(),this.update(ht,It)}update(I,ht,Et){let{width:It,height:Vt}=I,ke=!(this.size&&this.size[0]===It&&this.size[1]===Vt||Et),{context:Oe}=this,{gl:Ke}=Oe;if(this.useMipmap=!!(ht&&ht.useMipmap),Ke.bindTexture(Ke.TEXTURE_2D,this.texture),Oe.pixelStoreUnpackFlipY.set(!1),Oe.pixelStoreUnpack.set(1),Oe.pixelStoreUnpackPremultiplyAlpha.set(this.format===Ke.RGBA&&(!ht||ht.premultiply!==!1)),ke)this.size=[It,Vt],I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||e.b(I)?Ke.texImage2D(Ke.TEXTURE_2D,0,this.format,this.format,Ke.UNSIGNED_BYTE,I):Ke.texImage2D(Ke.TEXTURE_2D,0,this.format,It,Vt,0,this.format,Ke.UNSIGNED_BYTE,I.data);else{let{x:gr,y:Or}=Et||{x:0,y:0};I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||e.b(I)?Ke.texSubImage2D(Ke.TEXTURE_2D,0,gr,Or,Ke.RGBA,Ke.UNSIGNED_BYTE,I):Ke.texSubImage2D(Ke.TEXTURE_2D,0,gr,Or,It,Vt,Ke.RGBA,Ke.UNSIGNED_BYTE,I.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Ke.generateMipmap(Ke.TEXTURE_2D)}bind(I,ht,Et){let{context:It}=this,{gl:Vt}=It;Vt.bindTexture(Vt.TEXTURE_2D,this.texture),Et!==Vt.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Et=Vt.LINEAR),I!==this.filter&&(Vt.texParameteri(Vt.TEXTURE_2D,Vt.TEXTURE_MAG_FILTER,I),Vt.texParameteri(Vt.TEXTURE_2D,Vt.TEXTURE_MIN_FILTER,Et||I),this.filter=I),ht!==this.wrap&&(Vt.texParameteri(Vt.TEXTURE_2D,Vt.TEXTURE_WRAP_S,ht),Vt.texParameteri(Vt.TEXTURE_2D,Vt.TEXTURE_WRAP_T,ht),this.wrap=ht)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:I}=this.context;I.deleteTexture(this.texture),this.texture=null}}function k(qt){let{userImage:I}=qt;return!!(I&&I.render&&I.render())&&(qt.data.replace(new Uint8Array(I.data.buffer)),!0)}class w 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(I){if(this.loaded!==I&&(this.loaded=I,I)){for(let{ids:ht,promiseResolve:Et}of this.requestors)Et(this._getImagesForIds(ht));this.requestors=[]}}getImage(I){let ht=this.images[I];if(ht&&!ht.data&&ht.spriteData){let Et=ht.spriteData;ht.data=new e.R({width:Et.width,height:Et.height},Et.context.getImageData(Et.x,Et.y,Et.width,Et.height).data),ht.spriteData=null}return ht}addImage(I,ht){if(this.images[I])throw new Error(`Image id ${I} already exist, use updateImage instead`);this._validate(I,ht)&&(this.images[I]=ht)}_validate(I,ht){let Et=!0,It=ht.data||ht.spriteData;return this._validateStretch(ht.stretchX,It&&It.width)||(this.fire(new e.j(new Error(`Image "${I}" has invalid "stretchX" value`))),Et=!1),this._validateStretch(ht.stretchY,It&&It.height)||(this.fire(new e.j(new Error(`Image "${I}" has invalid "stretchY" value`))),Et=!1),this._validateContent(ht.content,ht)||(this.fire(new e.j(new Error(`Image "${I}" has invalid "content" value`))),Et=!1),Et}_validateStretch(I,ht){if(!I)return!0;let Et=0;for(let It of I){if(It[0]<Et||It[1]<It[0]||ht<It[1])return!1;Et=It[1]}return!0}_validateContent(I,ht){if(!I)return!0;if(I.length!==4)return!1;let Et=ht.spriteData,It=Et&&Et.width||ht.data.width,Vt=Et&&Et.height||ht.data.height;return!(I[0]<0||It<I[0]||I[1]<0||Vt<I[1]||I[2]<0||It<I[2]||I[3]<0||Vt<I[3]||I[2]<I[0]||I[3]<I[1])}updateImage(I,ht,Et=!0){let It=this.getImage(I);if(Et&&(It.data.width!==ht.data.width||It.data.height!==ht.data.height))throw new Error(`size mismatch between old image (${It.data.width}x${It.data.height}) and new image (${ht.data.width}x${ht.data.height}).`);ht.version=It.version+1,this.images[I]=ht,this.updatedImages[I]=!0}removeImage(I){let ht=this.images[I];delete this.images[I],delete this.patterns[I],ht.userImage&&ht.userImage.onRemove&&ht.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(I){return new Promise((ht,Et)=>{let It=!0;if(!this.isLoaded())for(let Vt of I)this.images[Vt]||(It=!1);this.isLoaded()||It?ht(this._getImagesForIds(I)):this.requestors.push({ids:I,promiseResolve:ht})})}_getImagesForIds(I){let ht={};for(let Et of I){let It=this.getImage(Et);It||(this.fire(new e.k("styleimagemissing",{id:Et})),It=this.getImage(Et)),It?ht[Et]={data:It.data.clone(),pixelRatio:It.pixelRatio,sdf:It.sdf,version:It.version,stretchX:It.stretchX,stretchY:It.stretchY,content:It.content,textFitWidth:It.textFitWidth,textFitHeight:It.textFitHeight,hasRenderCallback:!!(It.userImage&&It.userImage.render)}:e.w(`Image "${Et}" 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 ht}getPixelSize(){let{width:I,height:ht}=this.atlasImage;return{width:I,height:ht}}getPattern(I){let ht=this.patterns[I],Et=this.getImage(I);if(!Et)return null;if(ht&&ht.position.version===Et.version)return ht.position;if(ht)ht.position.version=Et.version;else{let It={w:Et.data.width+2,h:Et.data.height+2,x:0,y:0},Vt=new e.I(It,Et);this.patterns[I]={bin:It,position:Vt}}return this._updatePatternAtlas(),this.patterns[I].position}bind(I){let ht=I.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new p(I,this.atlasImage,ht.RGBA),this.atlasTexture.bind(ht.LINEAR,ht.CLAMP_TO_EDGE)}_updatePatternAtlas(){let I=[];for(let Vt in this.patterns)I.push(this.patterns[Vt].bin);let{w:ht,h:Et}=e.p(I),It=this.atlasImage;It.resize({width:ht||1,height:Et||1});for(let Vt in this.patterns){let{bin:ke}=this.patterns[Vt],Oe=ke.x+1,Ke=ke.y+1,gr=this.getImage(Vt).data,Or=gr.width,Dr=gr.height;e.R.copy(gr,It,{x:0,y:0},{x:Oe,y:Ke},{width:Or,height:Dr}),e.R.copy(gr,It,{x:0,y:Dr-1},{x:Oe,y:Ke-1},{width:Or,height:1}),e.R.copy(gr,It,{x:0,y:0},{x:Oe,y:Ke+Dr},{width:Or,height:1}),e.R.copy(gr,It,{x:Or-1,y:0},{x:Oe-1,y:Ke},{width:1,height:Dr}),e.R.copy(gr,It,{x:0,y:0},{x:Oe+Or,y:Ke},{width:1,height:Dr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(I){for(let ht of I){if(this.callbackDispatchedThisFrame[ht])continue;this.callbackDispatchedThisFrame[ht]=!0;let Et=this.getImage(ht);Et||e.w(`Image with ID: "${ht}" was not found`),k(Et)&&this.updateImage(ht,Et)}}}let R=1e20;function O(qt,I,ht,Et,It,Vt,ke,Oe,Ke){for(let gr=I;gr<I+Et;gr++)N(qt,ht*Vt+gr,Vt,It,ke,Oe,Ke);for(let gr=ht;gr<ht+It;gr++)N(qt,gr*Vt+I,1,Et,ke,Oe,Ke)}function N(qt,I,ht,Et,It,Vt,ke){Vt[0]=0,ke[0]=-R,ke[1]=R,It[0]=qt[I];for(let Oe=1,Ke=0,gr=0;Oe<Et;Oe++){It[Oe]=qt[I+Oe*ht];let Or=Oe*Oe;do{let Dr=Vt[Ke];gr=(It[Oe]-It[Dr]+Or-Dr*Dr)/(Oe-Dr)/2}while(gr<=ke[Ke]&&--Ke>-1);Ke++,Vt[Ke]=Oe,ke[Ke]=gr,ke[Ke+1]=R}for(let Oe=0,Ke=0;Oe<Et;Oe++){for(;ke[Ke+1]<Oe;)Ke++;let gr=Vt[Ke],Or=Oe-gr;qt[I+Oe*ht]=It[gr]+Or*Or}}class V{constructor(I,ht){this.requestManager=I,this.localIdeographFontFamily=ht,this.entries={}}setURL(I){this.url=I}getGlyphs(I){return e._(this,void 0,void 0,function*(){let ht=[];for(let Vt in I)for(let ke of I[Vt])ht.push(this._getAndCacheGlyphsPromise(Vt,ke));let Et=yield Promise.all(ht),It={};for(let{stack:Vt,id:ke,glyph:Oe}of Et)It[Vt]||(It[Vt]={}),It[Vt][ke]=Oe&&{id:Oe.id,bitmap:Oe.bitmap.clone(),metrics:Oe.metrics};return It})}_getAndCacheGlyphsPromise(I,ht){return e._(this,void 0,void 0,function*(){let Et=this.entries[I];Et||(Et=this.entries[I]={glyphs:{},requests:{},ranges:{}});let It=Et.glyphs[ht];if(It!==void 0)return{stack:I,id:ht,glyph:It};if(It=this._tinySDF(Et,I,ht),It)return Et.glyphs[ht]=It,{stack:I,id:ht,glyph:It};let Vt=Math.floor(ht/256);if(256*Vt>65535)throw new Error("glyphs > 65535 not supported");if(Et.ranges[Vt])return{stack:I,id:ht,glyph:It};if(!this.url)throw new Error("glyphsUrl is not set");if(!Et.requests[Vt]){let Oe=V.loadGlyphRange(I,Vt,this.url,this.requestManager);Et.requests[Vt]=Oe}let ke=yield Et.requests[Vt];for(let Oe in ke)this._doesCharSupportLocalGlyph(+Oe)||(Et.glyphs[+Oe]=ke[+Oe]);return Et.ranges[Vt]=!0,{stack:I,id:ht,glyph:ke[ht]||null}})}_doesCharSupportLocalGlyph(I){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(I))}_tinySDF(I,ht,Et){let It=this.localIdeographFontFamily;if(!It||!this._doesCharSupportLocalGlyph(Et))return;let Vt=I.tinySDF;if(!Vt){let Oe="400";/bold/i.test(ht)?Oe="900":/medium/i.test(ht)?Oe="500":/light/i.test(ht)&&(Oe="200"),Vt=I.tinySDF=new V.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:It,fontWeight:Oe})}let ke=Vt.draw(String.fromCharCode(Et));return{id:Et,bitmap:new e.o({width:ke.width||60,height:ke.height||60},ke.data),metrics:{width:ke.glyphWidth/2||24,height:ke.glyphHeight/2||24,left:ke.glyphLeft/2+.5||0,top:ke.glyphTop/2-27.5||-8,advance:ke.glyphAdvance/2||24,isDoubleResolution:!0}}}}V.loadGlyphRange=function(qt,I,ht,Et){return e._(this,void 0,void 0,function*(){let It=256*I,Vt=It+255,ke=Et.transformRequest(ht.replace("{fontstack}",qt).replace("{range}",`${It}-${Vt}`),"Glyphs"),Oe=yield e.l(ke,new AbortController);if(!Oe||!Oe.data)throw new Error(`Could not load glyph range. range: ${I}, ${It}-${Vt}`);let Ke={};for(let gr of e.n(Oe.data))Ke[gr.id]=gr;return Ke})},V.TinySDF=class{constructor({fontSize:qt=24,buffer:I=3,radius:ht=8,cutoff:Et=.25,fontFamily:It="sans-serif",fontWeight:Vt="normal",fontStyle:ke="normal"}={}){this.buffer=I,this.cutoff=Et,this.radius=ht;let Oe=this.size=qt+4*I,Ke=this._createCanvas(Oe),gr=this.ctx=Ke.getContext("2d",{willReadFrequently:!0});gr.font=`${ke} ${Vt} ${qt}px ${It}`,gr.textBaseline="alphabetic",gr.textAlign="left",gr.fillStyle="black",this.gridOuter=new Float64Array(Oe*Oe),this.gridInner=new Float64Array(Oe*Oe),this.f=new Float64Array(Oe),this.z=new Float64Array(Oe+1),this.v=new Uint16Array(Oe)}_createCanvas(qt){let I=document.createElement("canvas");return I.width=I.height=qt,I}draw(qt){let{width:I,actualBoundingBoxAscent:ht,actualBoundingBoxDescent:Et,actualBoundingBoxLeft:It,actualBoundingBoxRight:Vt}=this.ctx.measureText(qt),ke=Math.ceil(ht),Oe=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Vt-It))),Ke=Math.min(this.size-this.buffer,ke+Math.ceil(Et)),gr=Oe+2*this.buffer,Or=Ke+2*this.buffer,Dr=Math.max(gr*Or,0),ln=new Uint8ClampedArray(Dr),Sn={data:ln,width:gr,height:Or,glyphWidth:Oe,glyphHeight:Ke,glyphTop:ke,glyphLeft:0,glyphAdvance:I};if(Oe===0||Ke===0)return Sn;let{ctx:Xt,buffer:ae,gridInner:xe,gridOuter:Ae}=this;Xt.clearRect(ae,ae,Oe,Ke),Xt.fillText(qt,ae,ae+ke);let je=Xt.getImageData(ae,ae,Oe,Ke);Ae.fill(R,0,Dr),xe.fill(0,0,Dr);for(let Ie=0;Ie<Ke;Ie++)for(let Ze=0;Ze<Oe;Ze++){let wr=je.data[4*(Ie*Oe+Ze)+3]/255;if(wr===0)continue;let Ir=(Ie+ae)*gr+Ze+ae;if(wr===1)Ae[Ir]=0,xe[Ir]=R;else{let Nr=.5-wr;Ae[Ir]=Nr>0?Nr*Nr:0,xe[Ir]=Nr<0?Nr*Nr:0}}O(Ae,0,0,gr,Or,gr,this.f,this.v,this.z),O(xe,ae,ae,Oe,Ke,gr,this.f,this.v,this.z);for(let Ie=0;Ie<Dr;Ie++){let Ze=Math.sqrt(Ae[Ie])-Math.sqrt(xe[Ie]);ln[Ie]=Math.round(255-255*(Ze/this.radius+this.cutoff))}return Sn}};class H{constructor(){this.specification=e.v.light.position}possiblyEvaluate(I,ht){return e.x(I.expression.evaluate(ht))}interpolate(I,ht,Et){return{x:e.y.number(I.x,ht.x,Et),y:e.y.number(I.y,ht.y,Et),z:e.y.number(I.z,ht.z,Et)}}}let F;class U extends e.E{constructor(I){super(),F=F||new e.q({anchor:new e.D(e.v.light.anchor),position:new H,color:new e.D(e.v.light.color),intensity:new e.D(e.v.light.intensity)}),this._transitionable=new e.T(F),this.setLight(I),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(I,ht={}){if(!this._validate(e.r,I,ht))for(let Et in I){let It=I[Et];Et.endsWith("-transition")?this._transitionable.setTransition(Et.slice(0,-11),It):this._transitionable.setValue(Et,It)}}updateTransitions(I){this._transitioning=this._transitionable.transitioned(I,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(I){this.properties=this._transitioning.possiblyEvaluate(I)}_validate(I,ht,Et){return(!Et||Et.validate!==!1)&&e.t(this,I.call(e.u,{value:ht,style:{glyphs:!0,sprite:!0},styleSpec:e.v}))}}let W=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 q extends e.E{constructor(I){super(),this._transitionable=new e.T(W),this.setSky(I),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.z(0))}setSky(I,ht={}){if(!this._validate(e.B,I,ht)){I||(I={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let Et in I){let It=I[Et];Et.endsWith("-transition")?this._transitionable.setTransition(Et.slice(0,-11),It):this._transitionable.setValue(Et,It)}}}getSky(){return this._transitionable.serialize()}updateTransitions(I){this._transitioning=this._transitionable.transitioned(I,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(I){this.properties=this._transitioning.possiblyEvaluate(I)}_validate(I,ht,Et={}){return Et?.validate!==!1&&e.t(this,I.call(e.u,e.e({value:ht,style:{glyphs:!0,sprite:!0},styleSpec:e.v})))}calculateFogBlendOpacity(I){return I<60?0:I<70?(I-60)/10:1}}class X{constructor(I,ht){this.width=I,this.height=ht,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(I,ht){let Et=I.join(",")+String(ht);return this.dashEntry[Et]||(this.dashEntry[Et]=this.addDash(I,ht)),this.dashEntry[Et]}getDashRanges(I,ht,Et){let It=[],Vt=I.length%2==1?-I[I.length-1]*Et:0,ke=I[0]*Et,Oe=!0;It.push({left:Vt,right:ke,isDash:Oe,zeroLength:I[0]===0});let Ke=I[0];for(let gr=1;gr<I.length;gr++){Oe=!Oe;let Or=I[gr];Vt=Ke*Et,Ke+=Or,ke=Ke*Et,It.push({left:Vt,right:ke,isDash:Oe,zeroLength:Or===0})}return It}addRoundDash(I,ht,Et){let It=ht/2;for(let Vt=-Et;Vt<=Et;Vt++){let ke=this.width*(this.nextRow+Et+Vt),Oe=0,Ke=I[Oe];for(let gr=0;gr<this.width;gr++){gr/Ke.right>1&&(Ke=I[++Oe]);let Or=Math.abs(gr-Ke.left),Dr=Math.abs(gr-Ke.right),ln=Math.min(Or,Dr),Sn,Xt=Vt/Et*(It+1);if(Ke.isDash){let ae=It-Math.abs(Xt);Sn=Math.sqrt(ln*ln+ae*ae)}else Sn=It-Math.sqrt(ln*ln+Xt*Xt);this.data[ke+gr]=Math.max(0,Math.min(255,Sn+128))}}}addRegularDash(I){for(let Oe=I.length-1;Oe>=0;--Oe){let Ke=I[Oe],gr=I[Oe+1];Ke.zeroLength?I.splice(Oe,1):gr&&gr.isDash===Ke.isDash&&(gr.left=Ke.left,I.splice(Oe,1))}let ht=I[0],Et=I[I.length-1];ht.isDash===Et.isDash&&(ht.left=Et.left-this.width,Et.right=ht.right+this.width);let It=this.width*this.nextRow,Vt=0,ke=I[Vt];for(let Oe=0;Oe<this.width;Oe++){Oe/ke.right>1&&(ke=I[++Vt]);let Ke=Math.abs(Oe-ke.left),gr=Math.abs(Oe-ke.right),Or=Math.min(Ke,gr);this.data[It+Oe]=Math.max(0,Math.min(255,(ke.isDash?Or:-Or)+128))}}addDash(I,ht){let Et=ht?7:0,It=2*Et+1;if(this.nextRow+It>this.height)return e.w("LineAtlas out of space"),null;let Vt=0;for(let Oe=0;Oe<I.length;Oe++)Vt+=I[Oe];if(Vt!==0){let Oe=this.width/Vt,Ke=this.getDashRanges(I,this.width,Oe);ht?this.addRoundDash(Ke,Oe,Et):this.addRegularDash(Ke)}let ke={y:(this.nextRow+Et+.5)/this.height,height:2*Et/this.height,width:Vt};return this.nextRow+=It,this.dirty=!0,ke}bind(I){let ht=I.gl;this.texture?(ht.bindTexture(ht.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,ht.texSubImage2D(ht.TEXTURE_2D,0,0,0,this.width,this.height,ht.ALPHA,ht.UNSIGNED_BYTE,this.data))):(this.texture=ht.createTexture(),ht.bindTexture(ht.TEXTURE_2D,this.texture),ht.texParameteri(ht.TEXTURE_2D,ht.TEXTURE_WRAP_S,ht.REPEAT),ht.texParameteri(ht.TEXTURE_2D,ht.TEXTURE_WRAP_T,ht.REPEAT),ht.texParameteri(ht.TEXTURE_2D,ht.TEXTURE_MIN_FILTER,ht.LINEAR),ht.texParameteri(ht.TEXTURE_2D,ht.TEXTURE_MAG_FILTER,ht.LINEAR),ht.texImage2D(ht.TEXTURE_2D,0,ht.ALPHA,this.width,this.height,0,ht.ALPHA,ht.UNSIGNED_BYTE,this.data))}}let lt="maplibre_preloaded_worker_pool";class yt{constructor(){this.active={}}acquire(I){if(!this.workers)for(this.workers=[];this.workers.length<yt.workerCount;)this.workers.push(new Worker(e.a.WORKER_URL));return this.active[I]=!0,this.workers.slice()}release(I){delete this.active[I],this.numActive()===0&&(this.workers.forEach(ht=>{ht.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[lt]}numActive(){return Object.keys(this.active).length}}let pt=Math.floor(o.hardwareConcurrency/2),st,tt;function dt(){return st||(st=new yt),st}yt.workerCount=e.C(globalThis)?Math.max(Math.min(pt,3),1):1;class rt{constructor(I,ht){this.workerPool=I,this.actors=[],this.currentActor=0,this.id=ht;let Et=this.workerPool.acquire(ht);for(let It=0;It<Et.length;It++){let Vt=new e.F(Et[It],ht);Vt.name=`Worker ${It}`,this.actors.push(Vt)}if(!this.actors.length)throw new Error("No actors found")}broadcast(I,ht){let Et=[];for(let It of this.actors)Et.push(It.sendAsync({type:I,data:ht}));return Promise.all(Et)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(I=!0){this.actors.forEach(ht=>{ht.remove()}),this.actors=[],I&&this.workerPool.release(this.id)}registerMessageHandler(I,ht){for(let Et of this.actors)Et.registerMessageHandler(I,ht)}}function at(){return tt||(tt=new rt(dt(),e.G),tt.registerMessageHandler("GR",(qt,I,ht)=>e.m(I,ht))),tt}function vt(qt,I){let ht=e.H();return e.J(ht,ht,[1,1,0]),e.K(ht,ht,[.5*qt.width,.5*qt.height,1]),e.L(ht,ht,qt.calculatePosMatrix(I.toUnwrapped()))}function it(qt,I,ht,Et,It,Vt){let ke=function(Dr,ln,Sn){if(Dr)for(let Xt of Dr){let ae=ln[Xt];if(ae&&ae.source===Sn&&ae.type==="fill-extrusion")return!0}else for(let Xt in ln){let ae=ln[Xt];if(ae.source===Sn&&ae.type==="fill-extrusion")return!0}return!1}(It&&It.layers,I,qt.id),Oe=Vt.maxPitchScaleFactor(),Ke=qt.tilesIn(Et,Oe,ke);Ke.sort(Y);let gr=[];for(let Dr of Ke)gr.push({wrappedTileID:Dr.tileID.wrapped().key,queryResults:Dr.tile.queryRenderedFeatures(I,ht,qt._state,Dr.queryGeometry,Dr.cameraQueryGeometry,Dr.scale,It,Vt,Oe,vt(qt.transform,Dr.tileID))});let Or=function(Dr){let ln={},Sn={};for(let Xt of Dr){let ae=Xt.queryResults,xe=Xt.wrappedTileID,Ae=Sn[xe]=Sn[xe]||{};for(let je in ae){let Ie=ae[je],Ze=Ae[je]=Ae[je]||{},wr=ln[je]=ln[je]||[];for(let Ir of Ie)Ze[Ir.featureIndex]||(Ze[Ir.featureIndex]=!0,wr.push(Ir))}}return ln}(gr);for(let Dr in Or)Or[Dr].forEach(ln=>{let Sn=ln.feature,Xt=qt.getFeatureState(Sn.layer["source-layer"],Sn.id);Sn.source=Sn.layer.source,Sn.layer["source-layer"]&&(Sn.sourceLayer=Sn.layer["source-layer"]),Sn.state=Xt});return Or}function Y(qt,I){let ht=qt.tileID,Et=I.tileID;return ht.overscaledZ-Et.overscaledZ||ht.canonical.y-Et.canonical.y||ht.wrap-Et.wrap||ht.canonical.x-Et.canonical.x}function ft(qt,I,ht){return e._(this,void 0,void 0,function*(){let Et=qt;if(qt.url?Et=(yield e.h(I.transformRequest(qt.url,"Source"),ht)).data:yield o.frameAsync(ht),!Et)return null;let It=e.M(e.e(Et,qt),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Et&&Et.vector_layers&&(It.vectorLayerIds=Et.vector_layers.map(Vt=>Vt.id)),It})}class ut{constructor(I,ht){I&&(ht?this.setSouthWest(I).setNorthEast(ht):Array.isArray(I)&&(I.length===4?this.setSouthWest([I[0],I[1]]).setNorthEast([I[2],I[3]]):this.setSouthWest(I[0]).setNorthEast(I[1])))}setNorthEast(I){return this._ne=I instanceof e.N?new e.N(I.lng,I.lat):e.N.convert(I),this}setSouthWest(I){return this._sw=I instanceof e.N?new e.N(I.lng,I.lat):e.N.convert(I),this}extend(I){let ht=this._sw,Et=this._ne,It,Vt;if(I instanceof e.N)It=I,Vt=I;else{if(!(I instanceof ut))return Array.isArray(I)?I.length===4||I.every(Array.isArray)?this.extend(ut.convert(I)):this.extend(e.N.convert(I)):I&&("lng"in I||"lon"in I)&&"lat"in I?this.extend(e.N.convert(I)):this;if(It=I._sw,Vt=I._ne,!It||!Vt)return this}return ht||Et?(ht.lng=Math.min(It.lng,ht.lng),ht.lat=Math.min(It.lat,ht.lat),Et.lng=Math.max(Vt.lng,Et.lng),Et.lat=Math.max(Vt.lat,Et.lat)):(this._sw=new e.N(It.lng,It.lat),this._ne=new e.N(Vt.lng,Vt.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(I){let{lng:ht,lat:Et}=e.N.convert(I),It=this._sw.lng<=ht&&ht<=this._ne.lng;return this._sw.lng>this._ne.lng&&(It=this._sw.lng>=ht&&ht>=this._ne.lng),this._sw.lat<=Et&&Et<=this._ne.lat&&It}static convert(I){return I instanceof ut?I:I&&new ut(I)}static fromLngLat(I,ht=0){let Et=360*ht/40075017,It=Et/Math.cos(Math.PI/180*I.lat);return new ut(new e.N(I.lng-It,I.lat-Et),new e.N(I.lng+It,I.lat+Et))}adjustAntiMeridian(){let I=new e.N(this._sw.lng,this._sw.lat),ht=new e.N(this._ne.lng,this._ne.lat);return new ut(I,I.lng>ht.lng?new e.N(ht.lng+360,ht.lat):ht)}}class wt{constructor(I,ht,Et){this.bounds=ut.convert(this.validateBounds(I)),this.minzoom=ht||0,this.maxzoom=Et||24}validateBounds(I){return Array.isArray(I)&&I.length===4?[Math.max(-180,I[0]),Math.max(-90,I[1]),Math.min(180,I[2]),Math.min(90,I[3])]:[-180,-90,180,90]}contains(I){let ht=Math.pow(2,I.z),Et=Math.floor(e.O(this.bounds.getWest())*ht),It=Math.floor(e.Q(this.bounds.getNorth())*ht),Vt=Math.ceil(e.O(this.bounds.getEast())*ht),ke=Math.ceil(e.Q(this.bounds.getSouth())*ht);return I.x>=Et&&I.x<Vt&&I.y>=It&&I.y<ke}}class zt extends e.E{constructor(I,ht,Et,It){if(super(),this.id=I,this.dispatcher=Et,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(ht,["url","scheme","tileSize","promoteId"])),this._options=e.e({type:"vector"},ht),this._collectResourceTiming=ht.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(It)}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 I=yield ft(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),I&&(e.e(this,I),I.bounds&&(this.tileBounds=new wt(I.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(I){this._tileJSONRequest=null,this.fire(new e.j(I))}})}loaded(){return this._loaded}hasTile(I){return!this.tileBounds||this.tileBounds.contains(I.canonical)}onAdd(I){this.map=I,this.load()}setSourceProperty(I){this._tileJSONRequest&&this._tileJSONRequest.abort(),I(),this.load()}setTiles(I){return this.setSourceProperty(()=>{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(I){return e._(this,void 0,void 0,function*(){let ht=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Et={request:this.map._requestManager.transformRequest(ht,"Tile"),uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,tileSize:this.tileSize*I.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Et.request.collectResourceTiming=this._collectResourceTiming;let It="RT";if(I.actor&&I.state!=="expired"){if(I.state==="loading")return new Promise((Vt,ke)=>{I.reloadPromise={resolve:Vt,reject:ke}})}else I.actor=this.dispatcher.getActor(),It="LT";I.abortController=new AbortController;try{let Vt=yield I.actor.sendAsync({type:It,data:Et},I.abortController);if(delete I.abortController,I.aborted)return;this._afterTileLoadWorkerResponse(I,Vt)}catch(Vt){if(delete I.abortController,I.aborted)return;if(Vt&&Vt.status!==404)throw Vt;this._afterTileLoadWorkerResponse(I,null)}})}_afterTileLoadWorkerResponse(I,ht){if(ht&&ht.resourceTiming&&(I.resourceTiming=ht.resourceTiming),ht&&this.map._refreshExpiredTiles&&I.setExpiryData(ht),I.loadVectorData(ht,this.map.painter),I.reloadPromise){let Et=I.reloadPromise;I.reloadPromise=null,this.loadTile(I).then(Et.resolve).catch(Et.reject)}}abortTile(I){return e._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.actor&&(yield I.actor.sendAsync({type:"AT",data:{uid:I.uid,type:this.type,source:this.id}}))})}unloadTile(I){return e._(this,void 0,void 0,function*(){I.unloadVectorData(),I.actor&&(yield I.actor.sendAsync({type:"RMT",data:{uid:I.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Pt extends e.E{constructor(I,ht,Et,It){super(),this.id=I,this.dispatcher=Et,this.setEventedParent(It),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"},ht),e.e(this,e.M(ht,["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 I=yield ft(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,I&&(e.e(this,I),I.bounds&&(this.tileBounds=new wt(I.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(I){this._tileJSONRequest=null,this.fire(new e.j(I))}})}loaded(){return this._loaded}onAdd(I){this.map=I,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(I){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),I(),this.load()}setTiles(I){return this.setSourceProperty(()=>{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}serialize(){return e.e({},this._options)}hasTile(I){return!this.tileBounds||this.tileBounds.contains(I.canonical)}loadTile(I){return e._(this,void 0,void 0,function*(){let ht=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);I.abortController=new AbortController;try{let Et=yield u.getImage(this.map._requestManager.transformRequest(ht,"Tile"),I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(Et&&Et.data){this.map._refreshExpiredTiles&&Et.cacheControl&&Et.expires&&I.setExpiryData({cacheControl:Et.cacheControl,expires:Et.expires});let It=this.map.painter.context,Vt=It.gl,ke=Et.data;I.texture=this.map.painter.getTileTexture(ke.width),I.texture?I.texture.update(ke,{useMipmap:!0}):(I.texture=new p(It,ke,Vt.RGBA,{useMipmap:!0}),I.texture.bind(Vt.LINEAR,Vt.CLAMP_TO_EDGE,Vt.LINEAR_MIPMAP_NEAREST)),I.state="loaded"}}catch(Et){if(delete I.abortController,I.aborted)I.state="unloaded";else if(Et)throw I.state="errored",Et}})}abortTile(I){return e._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController)})}unloadTile(I){return e._(this,void 0,void 0,function*(){I.texture&&this.map.painter.saveTileTexture(I.texture)})}hasTransition(){return!1}}class Wt extends Pt{constructor(I,ht,Et,It){super(I,ht,Et,It),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},ht),this.encoding=ht.encoding||"mapbox",this.redFactor=ht.redFactor,this.greenFactor=ht.greenFactor,this.blueFactor=ht.blueFactor,this.baseShift=ht.baseShift}loadTile(I){return e._(this,void 0,void 0,function*(){let ht=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Et=this.map._requestManager.transformRequest(ht,"Tile");I.neighboringTiles=this._getNeighboringTiles(I.tileID),I.abortController=new AbortController;try{let It=yield u.getImage(Et,I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(It&&It.data){let Vt=It.data;this.map._refreshExpiredTiles&&It.cacheControl&&It.expires&&I.setExpiryData({cacheControl:It.cacheControl,expires:It.expires});let ke=e.b(Vt)&&e.U()?Vt:yield this.readImageNow(Vt),Oe={type:this.type,uid:I.uid,source:this.id,rawImageData:ke,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!I.actor||I.state==="expired"){I.actor=this.dispatcher.getActor();let Ke=yield I.actor.sendAsync({type:"LDT",data:Oe});I.dem=Ke,I.needsHillshadePrepare=!0,I.needsTerrainPrepare=!0,I.state="loaded"}}}catch(It){if(delete I.abortController,I.aborted)I.state="unloaded";else if(It)throw I.state="errored",It}})}readImageNow(I){return e._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&e.V()){let ht=I.width+2,Et=I.height+2;try{return new e.R({width:ht,height:Et},yield e.W(I,-1,-1,ht,Et))}catch{}}return o.getImageData(I,1)})}_getNeighboringTiles(I){let ht=I.canonical,Et=Math.pow(2,ht.z),It=(ht.x-1+Et)%Et,Vt=ht.x===0?I.wrap-1:I.wrap,ke=(ht.x+1+Et)%Et,Oe=ht.x+1===Et?I.wrap+1:I.wrap,Ke={};return Ke[new e.S(I.overscaledZ,Vt,ht.z,It,ht.y).key]={backfilled:!1},Ke[new e.S(I.overscaledZ,Oe,ht.z,ke,ht.y).key]={backfilled:!1},ht.y>0&&(Ke[new e.S(I.overscaledZ,Vt,ht.z,It,ht.y-1).key]={backfilled:!1},Ke[new e.S(I.overscaledZ,I.wrap,ht.z,ht.x,ht.y-1).key]={backfilled:!1},Ke[new e.S(I.overscaledZ,Oe,ht.z,ke,ht.y-1).key]={backfilled:!1}),ht.y+1<Et&&(Ke[new e.S(I.overscaledZ,Vt,ht.z,It,ht.y+1).key]={backfilled:!1},Ke[new e.S(I.overscaledZ,I.wrap,ht.z,ht.x,ht.y+1).key]={backfilled:!1},Ke[new e.S(I.overscaledZ,Oe,ht.z,ke,ht.y+1).key]={backfilled:!1}),Ke}unloadTile(I){return e._(this,void 0,void 0,function*(){I.demTexture&&this.map.painter.saveTileTexture(I.demTexture),I.fbo&&(I.fbo.destroy(),delete I.fbo),I.dem&&delete I.dem,delete I.neighboringTiles,I.state="unloaded",I.actor&&(yield I.actor.sendAsync({type:"RDT",data:{type:this.type,uid:I.uid,source:this.id}}))})}}class Ht extends e.E{constructor(I,ht,Et,It){super(),this.id=I,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=Et.getActor(),this.setEventedParent(It),this._data=ht.data,this._options=e.e({},ht),this._collectResourceTiming=ht.collectResourceTiming,ht.maxzoom!==void 0&&(this.maxzoom=ht.maxzoom),ht.type&&(this.type=ht.type),ht.attribution&&(this.attribution=ht.attribution),this.promoteId=ht.promoteId;let Vt=e.X/this.tileSize;ht.clusterMaxZoom!==void 0&&this.maxzoom<=ht.clusterMaxZoom&&e.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${ht.clusterMaxZoom}".`),this.workerOptions=e.e({source:this.id,cluster:ht.cluster||!1,geojsonVtOptions:{buffer:(ht.buffer!==void 0?ht.buffer:128)*Vt,tolerance:(ht.tolerance!==void 0?ht.tolerance:.375)*Vt,extent:e.X,maxZoom:this.maxzoom,lineMetrics:ht.lineMetrics||!1,generateId:ht.generateId||!1},superclusterOptions:{maxZoom:ht.clusterMaxZoom!==void 0?ht.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,ht.clusterMinPoints||2),extent:e.X,radius:(ht.clusterRadius||50)*Vt,log:!1,generateId:ht.generateId||!1},clusterProperties:ht.clusterProperties,filter:ht.filter},ht.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}load(){return e._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(I){this.map=I,this.load()}setData(I){return this._data=I,this._updateWorkerData(),this}updateData(I){return this._updateWorkerData(I),this}getData(){return e._(this,void 0,void 0,function*(){let I=e.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:I})})}setClusterOptions(I){return this.workerOptions.cluster=I.cluster,I&&(I.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=I.clusterRadius),I.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=I.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(I){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:I,source:this.id}})}getClusterChildren(I){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:I,source:this.id}})}getClusterLeaves(I,ht,Et){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:I,limit:ht,offset:Et}})}_updateWorkerData(I){return e._(this,void 0,void 0,function*(){let ht=e.e({type:this.type},this.workerOptions);I?ht.dataDiff=I:typeof this._data=="string"?(ht.request=this.map._requestManager.transformRequest(o.resolveURL(this._data),"Source"),ht.request.collectResourceTiming=this._collectResourceTiming):ht.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new e.k("dataloading",{dataType:"source"}));try{let Et=yield this.actor.sendAsync({type:"LD",data:ht});if(this._pendingLoads--,this._removed||Et.abandoned)return void this.fire(new e.k("dataabort",{dataType:"source"}));let It=null;Et.resourceTiming&&Et.resourceTiming[this.id]&&(It=Et.resourceTiming[this.id].slice(0));let Vt={dataType:"source"};this._collectResourceTiming&&It&&It.length>0&&e.e(Vt,{resourceTiming:It}),this.fire(new e.k("data",Object.assign(Object.assign({},Vt),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},Vt),{sourceDataType:"content"})))}catch(Et){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(Et))}})}loaded(){return this._pendingLoads===0}loadTile(I){return e._(this,void 0,void 0,function*(){let ht=I.actor?"RT":"LT";I.actor=this.actor;let Et={type:this.type,uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};I.abortController=new AbortController;let It=yield this.actor.sendAsync({type:ht,data:Et},I.abortController);delete I.abortController,I.unloadVectorData(),I.aborted||I.loadVectorData(It,this.map.painter,ht==="RT")})}abortTile(I){return e._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.aborted=!0})}unloadTile(I){return e._(this,void 0,void 0,function*(){I.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:I.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 Jt=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class ge extends e.E{constructor(I,ht,Et,It){super(),this.id=I,this.dispatcher=Et,this.coordinates=ht.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(It),this.options=ht}load(I){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 ht=yield u.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,ht&&ht.data&&(this.image=ht.data,I&&(this.coordinates=I),this._finishLoading())}catch(ht){this._request=null,this._loaded=!0,this.fire(new e.j(ht))}})}loaded(){return this._loaded}updateImage(I){return I.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=I.url,this.load(I.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(I){this.map=I,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(I){this.coordinates=I;let ht=I.map(e.Z.fromLngLat);this.tileID=function(It){let Vt=1/0,ke=1/0,Oe=-1/0,Ke=-1/0;for(let ln of It)Vt=Math.min(Vt,ln.x),ke=Math.min(ke,ln.y),Oe=Math.max(Oe,ln.x),Ke=Math.max(Ke,ln.y);let gr=Math.max(Oe-Vt,Ke-ke),Or=Math.max(0,Math.floor(-Math.log(gr)/Math.LN2)),Dr=Math.pow(2,Or);return new e.a1(Or,Math.floor((Vt+Oe)/2*Dr),Math.floor((ke+Ke)/2*Dr))}(ht),this.minzoom=this.maxzoom=this.tileID.z;let Et=ht.map(It=>this.tileID.getTilePoint(It)._round());return this._boundsArray=new e.$,this._boundsArray.emplaceBack(Et[0].x,Et[0].y,0,0),this._boundsArray.emplaceBack(Et[1].x,Et[1].y,e.X,0),this._boundsArray.emplaceBack(Et[3].x,Et[3].y,0,e.X),this._boundsArray.emplaceBack(Et[2].x,Et[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 I=this.map.painter.context,ht=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,Jt.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new p(I,this.image,ht.RGBA),this.texture.bind(ht.LINEAR,ht.CLAMP_TO_EDGE));let Et=!1;for(let It in this.tiles){let Vt=this.tiles[It];Vt.state!=="loaded"&&(Vt.state="loaded",Vt.texture=this.texture,Et=!0)}Et&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(I){return e._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(I.tileID.canonical)?(this.tiles[String(I.tileID.wrap)]=I,I.buckets={}):I.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class he extends ge{constructor(I,ht,Et,It){super(I,ht,Et,It),this.roundZoom=!0,this.type="video",this.options=ht}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1;let I=this.options;this.urls=[];for(let ht of I.urls)this.urls.push(this.map._requestManager.transformRequest(ht,"Source").url);try{let ht=yield e.a3(this.urls);if(this._loaded=!0,!ht)return;this.video=ht,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(ht){this.fire(new e.j(ht))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(I){if(this.video){let ht=this.video.seekable;I<ht.start(0)||I>ht.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${ht.start(0)} and ${ht.end(0)}-second mark.`))):this.video.currentTime=I}}getVideo(){return this.video}onAdd(I){this.map||(this.map=I,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 I=this.map.painter.context,ht=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,Jt.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ht.LINEAR,ht.CLAMP_TO_EDGE),ht.texSubImage2D(ht.TEXTURE_2D,0,0,0,ht.RGBA,ht.UNSIGNED_BYTE,this.video)):(this.texture=new p(I,this.video,ht.RGBA),this.texture.bind(ht.LINEAR,ht.CLAMP_TO_EDGE));let Et=!1;for(let It in this.tiles){let Vt=this.tiles[It];Vt.state!=="loaded"&&(Vt.state="loaded",Vt.texture=this.texture,Et=!0)}Et&&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 de extends ge{constructor(I,ht,Et,It){super(I,ht,Et,It),ht.coordinates?Array.isArray(ht.coordinates)&&ht.coordinates.length===4&&!ht.coordinates.some(Vt=>!Array.isArray(Vt)||Vt.length!==2||Vt.some(ke=>typeof ke!="number"))||this.fire(new e.j(new e.a2(`sources.${I}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${I}`,null,'missing required property "coordinates"'))),ht.animate&&typeof ht.animate!="boolean"&&this.fire(new e.j(new e.a2(`sources.${I}`,null,'optional "animate" property must be a boolean value'))),ht.canvas?typeof ht.canvas=="string"||ht.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`sources.${I}`,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.${I}`,null,'missing required property "canvas"'))),this.options=ht,this.animate=ht.animate===void 0||ht.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(I){this.map=I,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let I=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,I=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,I=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let ht=this.map.painter.context,Et=ht.gl;this.boundsBuffer||(this.boundsBuffer=ht.createVertexBuffer(this._boundsArray,Jt.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(I||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new p(ht,this.canvas,Et.RGBA,{premultiply:!0});let It=!1;for(let Vt in this.tiles){let ke=this.tiles[Vt];ke.state!=="loaded"&&(ke.state="loaded",ke.texture=this.texture,It=!0)}It&&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 I of[this.canvas.width,this.canvas.height])if(isNaN(I)||I<=0)return!0;return!1}}let se={},Tt=qt=>{switch(qt){case"geojson":return Ht;case"image":return ge;case"raster":return Pt;case"raster-dem":return Wt;case"vector":return zt;case"video":return he;case"canvas":return de}return se[qt]},Lt="RTLPluginLoaded";class Mt extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=at()}_syncState(I){return this.status=I,this.dispatcher.broadcast("SRPS",{pluginStatus:I,pluginURL:this.url}).catch(ht=>{throw this.status="error",ht})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(I){return e._(this,arguments,void 0,function*(ht,Et=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=o.resolveURL(ht),!this.url)throw new Error(`requested url ${ht} is invalid`);if(this.status==="unavailable"){if(!Et)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(Lt))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let te=null;function ve(){return te||(te=new Mt),te}class oe{constructor(I,ht){this.timeAdded=0,this.fadeEndTime=0,this.tileID=I,this.uid=e.a4(),this.uses=0,this.tileSize=ht,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(I){let ht=I+this.timeAdded;ht<this.fadeEndTime||(this.fadeEndTime=ht)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(I){this.demTexture&&I.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(I,ht,Et){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",I){I.featureIndex&&(this.latestFeatureIndex=I.featureIndex,I.rawTileData?(this.latestRawTileData=I.rawTileData,this.latestFeatureIndex.rawTileData=I.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=I.collisionBoxArray,this.buckets=function(It,Vt){let ke={};if(!Vt)return ke;for(let Oe of It){let Ke=Oe.layerIds.map(gr=>Vt.getLayer(gr)).filter(Boolean);if(Ke.length!==0){Oe.layers=Ke,Oe.stateDependentLayerIds&&(Oe.stateDependentLayers=Oe.stateDependentLayerIds.map(gr=>Ke.filter(Or=>Or.id===gr)[0]));for(let gr of Ke)ke[gr.id]=Oe}}return ke}(I.buckets,ht.style),this.hasSymbolBuckets=!1;for(let It in this.buckets){let Vt=this.buckets[It];if(Vt instanceof e.a6){if(this.hasSymbolBuckets=!0,!Et)break;Vt.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let It in this.buckets){let Vt=this.buckets[It];if(Vt instanceof e.a6&&Vt.hasRTLText){this.hasRTLText=!0,ve().lazyLoad();break}}this.queryPadding=0;for(let It in this.buckets){let Vt=this.buckets[It];this.queryPadding=Math.max(this.queryPadding,ht.style.getLayer(It).queryRadius(Vt))}I.imageAtlas&&(this.imageAtlas=I.imageAtlas),I.glyphAtlasImage&&(this.glyphAtlasImage=I.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(let I in this.buckets)this.buckets[I].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(I){return this.buckets[I.id]}upload(I){for(let Et in this.buckets){let It=this.buckets[Et];It.uploadPending()&&It.upload(I)}let ht=I.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new p(I,this.imageAtlas.image,ht.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new p(I,this.glyphAtlasImage,ht.ALPHA),this.glyphAtlasImage=null)}prepare(I){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(I,this.imageAtlasTexture)}queryRenderedFeatures(I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:It,cameraQueryGeometry:Vt,scale:ke,tileSize:this.tileSize,pixelPosMatrix:Or,transform:Ke,params:Oe,queryPadding:this.queryPadding*gr},I,ht,Et):{}}querySourceFeatures(I,ht){let Et=this.latestFeatureIndex;if(!Et||!Et.rawTileData)return;let It=Et.loadVTLayers(),Vt=ht&&ht.sourceLayer?ht.sourceLayer:"",ke=It._geojsonTileLayer||It[Vt];if(!ke)return;let Oe=e.a7(ht&&ht.filter),{z:Ke,x:gr,y:Or}=this.tileID.canonical,Dr={z:Ke,x:gr,y:Or};for(let ln=0;ln<ke.length;ln++){let Sn=ke.feature(ln);if(Oe.needGeometry){let xe=e.a8(Sn,!0);if(!Oe.filter(new e.z(this.tileID.overscaledZ),xe,this.tileID.canonical))continue}else if(!Oe.filter(new e.z(this.tileID.overscaledZ),Sn))continue;let Xt=Et.getId(Sn,Vt),ae=new e.a9(Sn,Ke,gr,Or,Xt);ae.tile=Dr,I.push(ae)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(I){let ht=this.expirationTime;if(I.cacheControl){let Et=e.aa(I.cacheControl);Et["max-age"]&&(this.expirationTime=Date.now()+1e3*Et["max-age"])}else I.expires&&(this.expirationTime=new Date(I.expires).getTime());if(this.expirationTime){let Et=Date.now(),It=!1;if(this.expirationTime>Et)It=!1;else if(ht)if(this.expirationTime<ht)It=!0;else{let Vt=this.expirationTime-ht;Vt?this.expirationTime=Et+Math.max(Vt,3e4):It=!0}else It=!0;It?(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(I,ht){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(I).length===0)return;let Et=this.latestFeatureIndex.loadVTLayers();for(let It in this.buckets){if(!ht.style.hasLayer(It))continue;let Vt=this.buckets[It],ke=Vt.layers[0].sourceLayer||"_geojsonTileLayer",Oe=Et[ke],Ke=I[ke];if(!Oe||!Ke||Object.keys(Ke).length===0)continue;Vt.update(Ke,Oe,this.imageAtlas&&this.imageAtlas.patternPositions||{});let gr=ht&&ht.style&&ht.style.getLayer(It);gr&&(this.queryPadding=Math.max(this.queryPadding,gr.queryRadius(Vt)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<o.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(I){this.symbolFadeHoldUntil=o.now()+I}setDependencies(I,ht){let Et={};for(let It of ht)Et[It]=!0;this.dependencies[I]=Et}hasDependency(I,ht){for(let Et of I){let It=this.dependencies[Et];if(It){for(let Vt of ht)if(It[Vt])return!0}}return!1}}class Te{constructor(I,ht){this.max=I,this.onRemove=ht,this.reset()}reset(){for(let I in this.data)for(let ht of this.data[I])ht.timeout&&clearTimeout(ht.timeout),this.onRemove(ht.value);return this.data={},this.order=[],this}add(I,ht,Et){let It=I.wrapped().key;this.data[It]===void 0&&(this.data[It]=[]);let Vt={value:ht,timeout:void 0};if(Et!==void 0&&(Vt.timeout=setTimeout(()=>{this.remove(I,Vt)},Et)),this.data[It].push(Vt),this.order.push(It),this.order.length>this.max){let ke=this._getAndRemoveByKey(this.order[0]);ke&&this.onRemove(ke)}return this}has(I){return I.wrapped().key in this.data}getAndRemove(I){return this.has(I)?this._getAndRemoveByKey(I.wrapped().key):null}_getAndRemoveByKey(I){let ht=this.data[I].shift();return ht.timeout&&clearTimeout(ht.timeout),this.data[I].length===0&&delete this.data[I],this.order.splice(this.order.indexOf(I),1),ht.value}getByKey(I){let ht=this.data[I];return ht?ht[0].value:null}get(I){return this.has(I)?this.data[I.wrapped().key][0].value:null}remove(I,ht){if(!this.has(I))return this;let Et=I.wrapped().key,It=ht===void 0?0:this.data[Et].indexOf(ht),Vt=this.data[Et][It];return this.data[Et].splice(It,1),Vt.timeout&&clearTimeout(Vt.timeout),this.data[Et].length===0&&delete this.data[Et],this.onRemove(Vt.value),this.order.splice(this.order.indexOf(Et),1),this}setMaxSize(I){for(this.max=I;this.order.length>this.max;){let ht=this._getAndRemoveByKey(this.order[0]);ht&&this.onRemove(ht)}return this}filter(I){let ht=[];for(let Et in this.data)for(let It of this.data[Et])I(It.value)||ht.push(It);for(let Et of ht)this.remove(Et.value.tileID,Et)}}class He{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(I,ht,Et){let It=String(ht);if(this.stateChanges[I]=this.stateChanges[I]||{},this.stateChanges[I][It]=this.stateChanges[I][It]||{},e.e(this.stateChanges[I][It],Et),this.deletedStates[I]===null){this.deletedStates[I]={};for(let Vt in this.state[I])Vt!==It&&(this.deletedStates[I][Vt]=null)}else if(this.deletedStates[I]&&this.deletedStates[I][It]===null){this.deletedStates[I][It]={};for(let Vt in this.state[I][It])Et[Vt]||(this.deletedStates[I][It][Vt]=null)}else for(let Vt in Et)this.deletedStates[I]&&this.deletedStates[I][It]&&this.deletedStates[I][It][Vt]===null&&delete this.deletedStates[I][It][Vt]}removeFeatureState(I,ht,Et){if(this.deletedStates[I]===null)return;let It=String(ht);if(this.deletedStates[I]=this.deletedStates[I]||{},Et&&ht!==void 0)this.deletedStates[I][It]!==null&&(this.deletedStates[I][It]=this.deletedStates[I][It]||{},this.deletedStates[I][It][Et]=null);else if(ht!==void 0)if(this.stateChanges[I]&&this.stateChanges[I][It])for(Et in this.deletedStates[I][It]={},this.stateChanges[I][It])this.deletedStates[I][It][Et]=null;else this.deletedStates[I][It]=null;else this.deletedStates[I]=null}getState(I,ht){let Et=String(ht),It=e.e({},(this.state[I]||{})[Et],(this.stateChanges[I]||{})[Et]);if(this.deletedStates[I]===null)return{};if(this.deletedStates[I]){let Vt=this.deletedStates[I][ht];if(Vt===null)return{};for(let ke in Vt)delete It[ke]}return It}initializeTileState(I,ht){I.setFeatureState(this.state,ht)}coalesceChanges(I,ht){let Et={};for(let It in this.stateChanges){this.state[It]=this.state[It]||{};let Vt={};for(let ke in this.stateChanges[It])this.state[It][ke]||(this.state[It][ke]={}),e.e(this.state[It][ke],this.stateChanges[It][ke]),Vt[ke]=this.state[It][ke];Et[It]=Vt}for(let It in this.deletedStates){this.state[It]=this.state[It]||{};let Vt={};if(this.deletedStates[It]===null)for(let ke in this.state[It])Vt[ke]={},this.state[It][ke]={};else for(let ke in this.deletedStates[It]){if(this.deletedStates[It][ke]===null)this.state[It][ke]={};else for(let Oe of Object.keys(this.deletedStates[It][ke]))delete this.state[It][ke][Oe];Vt[ke]=this.state[It][ke]}Et[It]=Et[It]||{},e.e(Et[It],Vt)}if(this.stateChanges={},this.deletedStates={},Object.keys(Et).length!==0)for(let It in I)I[It].setFeatureState(Et,ht)}}class Ge extends e.E{constructor(I,ht,Et){super(),this.id=I,this.dispatcher=Et,this.on("data",It=>this._dataHandler(It)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((It,Vt,ke,Oe)=>{let Ke=new(Tt(Vt.type))(It,Vt,ke,Oe);if(Ke.id!==It)throw new Error(`Expected Source id to be ${It} instead of ${Ke.id}`);return Ke})(I,ht,Et,this),this._tiles={},this._cache=new Te(0,It=>this._unloadTile(It)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new He,this._didEmitContent=!1,this._updated=!1}onAdd(I){this.map=I,this._maxTileCacheSize=I?I._maxTileCacheSize:null,this._maxTileCacheZoomLevels=I?I._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(I)}onRemove(I){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(I)}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 I in this._tiles){let ht=this._tiles[I];if(ht.state!=="loaded"&&ht.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let I=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,I&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(I,ht,Et){return e._(this,void 0,void 0,function*(){try{yield this._source.loadTile(I),this._tileLoaded(I,ht,Et)}catch(It){I.state="errored",It.status!==404?this._source.fire(new e.j(It,{tile:I})):this.update(this.transform,this.terrain)}})}_unloadTile(I){this._source.unloadTile&&this._source.unloadTile(I)}_abortTile(I){this._source.abortTile&&this._source.abortTile(I),this._source.fire(new e.k("dataabort",{tile:I,coord:I.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(I){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let ht in this._tiles){let Et=this._tiles[ht];Et.upload(I),Et.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(I=>I.tileID).sort(cr).map(I=>I.key)}getRenderableIds(I){let ht=[];for(let Et in this._tiles)this._isIdRenderable(Et,I)&&ht.push(this._tiles[Et]);return I?ht.sort((Et,It)=>{let Vt=Et.tileID,ke=It.tileID,Oe=new e.P(Vt.canonical.x,Vt.canonical.y)._rotate(this.transform.angle),Ke=new e.P(ke.canonical.x,ke.canonical.y)._rotate(this.transform.angle);return Vt.overscaledZ-ke.overscaledZ||Ke.y-Oe.y||Ke.x-Oe.x}).map(Et=>Et.tileID.key):ht.map(Et=>Et.tileID).sort(cr).map(Et=>Et.key)}hasRenderableParent(I){let ht=this.findLoadedParent(I,0);return!!ht&&this._isIdRenderable(ht.tileID.key)}_isIdRenderable(I,ht){return this._tiles[I]&&this._tiles[I].hasData()&&!this._coveredTiles[I]&&(ht||!this._tiles[I].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let I in this._tiles)this._tiles[I].state!=="errored"&&this._reloadTile(I,"reloading")}}_reloadTile(I,ht){return e._(this,void 0,void 0,function*(){let Et=this._tiles[I];Et&&(Et.state!=="loading"&&(Et.state=ht),yield this._loadTile(Et,I,ht))})}_tileLoaded(I,ht,Et){I.timeAdded=o.now(),Et==="expired"&&(I.refreshedUponExpiration=!0),this._setTileReloadTimer(ht,I),this.getSource().type==="raster-dem"&&I.dem&&this._backfillDEM(I),this._state.initializeTileState(I,this.map?this.map.painter:null),I.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:I,coord:I.tileID}))}_backfillDEM(I){let ht=this.getRenderableIds();for(let It=0;It<ht.length;It++){let Vt=ht[It];if(I.neighboringTiles&&I.neighboringTiles[Vt]){let ke=this.getTileByID(Vt);Et(I,ke),Et(ke,I)}}function Et(It,Vt){It.needsHillshadePrepare=!0,It.needsTerrainPrepare=!0;let ke=Vt.tileID.canonical.x-It.tileID.canonical.x,Oe=Vt.tileID.canonical.y-It.tileID.canonical.y,Ke=Math.pow(2,It.tileID.canonical.z),gr=Vt.tileID.key;ke===0&&Oe===0||Math.abs(Oe)>1||(Math.abs(ke)>1&&(Math.abs(ke+Ke)===1?ke+=Ke:Math.abs(ke-Ke)===1&&(ke-=Ke)),Vt.dem&&It.dem&&(It.dem.backfillBorder(Vt.dem,ke,Oe),It.neighboringTiles&&It.neighboringTiles[gr]&&(It.neighboringTiles[gr].backfilled=!0)))}}getTile(I){return this.getTileByID(I.key)}getTileByID(I){return this._tiles[I]}_retainLoadedChildren(I,ht,Et,It){for(let Vt in this._tiles){let ke=this._tiles[Vt];if(It[Vt]||!ke.hasData()||ke.tileID.overscaledZ<=ht||ke.tileID.overscaledZ>Et)continue;let Oe=ke.tileID;for(;ke&&ke.tileID.overscaledZ>ht+1;){let gr=ke.tileID.scaledTo(ke.tileID.overscaledZ-1);ke=this._tiles[gr.key],ke&&ke.hasData()&&(Oe=gr)}let Ke=Oe;for(;Ke.overscaledZ>ht;)if(Ke=Ke.scaledTo(Ke.overscaledZ-1),I[Ke.key]){It[Oe.key]=Oe;break}}}findLoadedParent(I,ht){if(I.key in this._loadedParentTiles){let Et=this._loadedParentTiles[I.key];return Et&&Et.tileID.overscaledZ>=ht?Et:null}for(let Et=I.overscaledZ-1;Et>=ht;Et--){let It=I.scaledTo(Et),Vt=this._getLoadedTile(It);if(Vt)return Vt}}findLoadedSibling(I){return this._getLoadedTile(I)}_getLoadedTile(I){let ht=this._tiles[I.key];return ht&&ht.hasData()?ht:this._cache.getByKey(I.wrapped().key)}updateCacheSize(I){let ht=Math.ceil(I.width/this._source.tileSize)+1,Et=Math.ceil(I.height/this._source.tileSize)+1,It=Math.floor(ht*Et*(this._maxTileCacheZoomLevels===null?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Vt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,It):It;this._cache.setMaxSize(Vt)}handleWrapJump(I){let ht=Math.round((I-(this._prevLng===void 0?I:this._prevLng))/360);if(this._prevLng=I,ht){let Et={};for(let It in this._tiles){let Vt=this._tiles[It];Vt.tileID=Vt.tileID.unwrapTo(Vt.tileID.wrap+ht),Et[Vt.tileID.key]=Vt}this._tiles=Et;for(let It in this._timers)clearTimeout(this._timers[It]),delete this._timers[It];for(let It in this._tiles)this._setTileReloadTimer(It,this._tiles[It])}}_updateCoveredAndRetainedTiles(I,ht,Et,It,Vt,ke){let Oe={},Ke={},gr=Object.keys(I),Or=o.now();for(let Dr of gr){let ln=I[Dr],Sn=this._tiles[Dr];if(!Sn||Sn.fadeEndTime!==0&&Sn.fadeEndTime<=Or)continue;let Xt=this.findLoadedParent(ln,ht),ae=this.findLoadedSibling(ln),xe=Xt||ae||null;xe&&(this._addTile(xe.tileID),Oe[xe.tileID.key]=xe.tileID),Ke[Dr]=ln}this._retainLoadedChildren(Ke,It,Et,I);for(let Dr in Oe)I[Dr]||(this._coveredTiles[Dr]=!0,I[Dr]=Oe[Dr]);if(ke){let Dr={},ln={};for(let Sn of Vt)this._tiles[Sn.key].hasData()?Dr[Sn.key]=Sn:ln[Sn.key]=Sn;for(let Sn in ln){let Xt=ln[Sn].children(this._source.maxzoom);this._tiles[Xt[0].key]&&this._tiles[Xt[1].key]&&this._tiles[Xt[2].key]&&this._tiles[Xt[3].key]&&(Dr[Xt[0].key]=I[Xt[0].key]=Xt[0],Dr[Xt[1].key]=I[Xt[1].key]=Xt[1],Dr[Xt[2].key]=I[Xt[2].key]=Xt[2],Dr[Xt[3].key]=I[Xt[3].key]=Xt[3],delete ln[Sn])}for(let Sn in ln){let Xt=ln[Sn],ae=this.findLoadedParent(Xt,this._source.minzoom),xe=this.findLoadedSibling(Xt),Ae=ae||xe||null;if(Ae){Dr[Ae.tileID.key]=I[Ae.tileID.key]=Ae.tileID;for(let je in Dr)Dr[je].isChildOf(Ae.tileID)&&delete Dr[je]}}for(let Sn in this._tiles)Dr[Sn]||(this._coveredTiles[Sn]=!0)}}update(I,ht){if(!this._sourceLoaded||this._paused)return;let Et;this.transform=I,this.terrain=ht,this.updateCacheSize(I),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Et=I.getVisibleUnwrappedCoordinates(this._source.tileID).map(Or=>new e.S(Or.canonical.z,Or.wrap,Or.canonical.z,Or.canonical.x,Or.canonical.y)):(Et=I.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:ht}),this._source.hasTile&&(Et=Et.filter(Or=>this._source.hasTile(Or)))):Et=[];let It=I.coveringZoomLevel(this._source),Vt=Math.max(It-Ge.maxOverzooming,this._source.minzoom),ke=Math.max(It+Ge.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let Or={};for(let Dr of Et)if(Dr.canonical.z>this._source.minzoom){let ln=Dr.scaledTo(Dr.canonical.z-1);Or[ln.key]=ln;let Sn=Dr.scaledTo(Math.max(this._source.minzoom,Math.min(Dr.canonical.z,5)));Or[Sn.key]=Sn}Et=Et.concat(Object.values(Or))}let Oe=Et.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,Oe&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let Ke=this._updateRetainedTiles(Et,It);ur(this._source.type)&&this._updateCoveredAndRetainedTiles(Ke,Vt,ke,It,Et,ht);for(let Or in Ke)this._tiles[Or].clearFadeHold();let gr=e.ab(this._tiles,Ke);for(let Or of gr){let Dr=this._tiles[Or];Dr.hasSymbolBuckets&&!Dr.holdingForFade()?Dr.setHoldDuration(this.map._fadeDuration):Dr.hasSymbolBuckets&&!Dr.symbolFadeFinished()||this._removeTile(Or)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let I in this._tiles)this._tiles[I].holdingForFade()&&this._removeTile(I)}_updateRetainedTiles(I,ht){var Et;let It={},Vt={},ke=Math.max(ht-Ge.maxOverzooming,this._source.minzoom),Oe=Math.max(ht+Ge.maxUnderzooming,this._source.minzoom),Ke={};for(let gr of I){let Or=this._addTile(gr);It[gr.key]=gr,Or.hasData()||ht<this._source.maxzoom&&(Ke[gr.key]=gr)}this._retainLoadedChildren(Ke,ht,Oe,It);for(let gr of I){let Or=this._tiles[gr.key];if(Or.hasData())continue;if(ht+1>this._source.maxzoom){let ln=gr.children(this._source.maxzoom)[0],Sn=this.getTile(ln);if(Sn&&Sn.hasData()){It[ln.key]=ln;continue}}else{let ln=gr.children(this._source.maxzoom);if(It[ln[0].key]&&It[ln[1].key]&&It[ln[2].key]&&It[ln[3].key])continue}let Dr=Or.wasRequested();for(let ln=gr.overscaledZ-1;ln>=ke;--ln){let Sn=gr.scaledTo(ln);if(Vt[Sn.key])break;if(Vt[Sn.key]=!0,Or=this.getTile(Sn),!Or&&Dr&&(Or=this._addTile(Sn)),Or){let Xt=Or.hasData();if((Xt||!(!((Et=this.map)===null||Et===void 0)&&Et.cancelPendingTileRequestsWhileZooming)||Dr)&&(It[Sn.key]=Sn),Dr=Or.wasRequested(),Xt)break}}}return It}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let I in this._tiles){let ht=[],Et,It=this._tiles[I].tileID;for(;It.overscaledZ>0;){if(It.key in this._loadedParentTiles){Et=this._loadedParentTiles[It.key];break}ht.push(It.key);let Vt=It.scaledTo(It.overscaledZ-1);if(Et=this._getLoadedTile(Vt),Et)break;It=Vt}for(let Vt of ht)this._loadedParentTiles[Vt]=Et}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let I in this._tiles){let ht=this._tiles[I].tileID,Et=this._getLoadedTile(ht);this._loadedSiblingTiles[ht.key]=Et}}_addTile(I){let ht=this._tiles[I.key];if(ht)return ht;ht=this._cache.getAndRemove(I),ht&&(this._setTileReloadTimer(I.key,ht),ht.tileID=I,this._state.initializeTileState(ht,this.map?this.map.painter:null),this._cacheTimers[I.key]&&(clearTimeout(this._cacheTimers[I.key]),delete this._cacheTimers[I.key],this._setTileReloadTimer(I.key,ht)));let Et=ht;return ht||(ht=new oe(I,this._source.tileSize*I.overscaleFactor()),this._loadTile(ht,I.key,ht.state)),ht.uses++,this._tiles[I.key]=ht,Et||this._source.fire(new e.k("dataloading",{tile:ht,coord:ht.tileID,dataType:"source"})),ht}_setTileReloadTimer(I,ht){I in this._timers&&(clearTimeout(this._timers[I]),delete this._timers[I]);let Et=ht.getExpiryTimeout();Et&&(this._timers[I]=setTimeout(()=>{this._reloadTile(I,"expired"),delete this._timers[I]},Et))}_removeTile(I){let ht=this._tiles[I];ht&&(ht.uses--,delete this._tiles[I],this._timers[I]&&(clearTimeout(this._timers[I]),delete this._timers[I]),ht.uses>0||(ht.hasData()&&ht.state!=="reloading"?this._cache.add(ht.tileID,ht,ht.getExpiryTimeout()):(ht.aborted=!0,this._abortTile(ht),this._unloadTile(ht))))}_dataHandler(I){let ht=I.sourceDataType;I.dataType==="source"&&ht==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&I.dataType==="source"&&ht==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let I in this._tiles)this._removeTile(I);this._cache.reset()}tilesIn(I,ht,Et){let It=[],Vt=this.transform;if(!Vt)return It;let ke=Et?Vt.getCameraQueryGeometry(I):I,Oe=I.map(Xt=>Vt.pointCoordinate(Xt,this.terrain)),Ke=ke.map(Xt=>Vt.pointCoordinate(Xt,this.terrain)),gr=this.getIds(),Or=1/0,Dr=1/0,ln=-1/0,Sn=-1/0;for(let Xt of Ke)Or=Math.min(Or,Xt.x),Dr=Math.min(Dr,Xt.y),ln=Math.max(ln,Xt.x),Sn=Math.max(Sn,Xt.y);for(let Xt=0;Xt<gr.length;Xt++){let ae=this._tiles[gr[Xt]];if(ae.holdingForFade())continue;let xe=ae.tileID,Ae=Math.pow(2,Vt.zoom-ae.tileID.overscaledZ),je=ht*ae.queryPadding*e.X/ae.tileSize/Ae,Ie=[xe.getTilePoint(new e.Z(Or,Dr)),xe.getTilePoint(new e.Z(ln,Sn))];if(Ie[0].x-je<e.X&&Ie[0].y-je<e.X&&Ie[1].x+je>=0&&Ie[1].y+je>=0){let Ze=Oe.map(Ir=>xe.getTilePoint(Ir)),wr=Ke.map(Ir=>xe.getTilePoint(Ir));It.push({tile:ae,tileID:xe,queryGeometry:Ze,cameraQueryGeometry:wr,scale:Ae})}}return It}getVisibleCoordinates(I){let ht=this.getRenderableIds(I).map(Et=>this._tiles[Et].tileID);for(let Et of ht)Et.posMatrix=this.transform.calculatePosMatrix(Et.toUnwrapped());return ht}hasTransition(){if(this._source.hasTransition())return!0;if(ur(this._source.type)){let I=o.now();for(let ht in this._tiles)if(this._tiles[ht].fadeEndTime>=I)return!0}return!1}setFeatureState(I,ht,Et){this._state.updateState(I=I||"_geojsonTileLayer",ht,Et)}removeFeatureState(I,ht,Et){this._state.removeFeatureState(I=I||"_geojsonTileLayer",ht,Et)}getFeatureState(I,ht){return this._state.getState(I=I||"_geojsonTileLayer",ht)}setDependencies(I,ht,Et){let It=this._tiles[I];It&&It.setDependencies(ht,Et)}reloadTilesForDependencies(I,ht){for(let Et in this._tiles)this._tiles[Et].hasDependency(I,ht)&&this._reloadTile(Et,"reloading");this._cache.filter(Et=>!Et.hasDependency(I,ht))}}function cr(qt,I){let ht=Math.abs(2*qt.wrap)-+(qt.wrap<0),Et=Math.abs(2*I.wrap)-+(I.wrap<0);return qt.overscaledZ-I.overscaledZ||Et-ht||I.canonical.y-qt.canonical.y||I.canonical.x-qt.canonical.x}function ur(qt){return qt==="raster"||qt==="image"||qt==="video"}Ge.maxOverzooming=10,Ge.maxUnderzooming=3;class jr{constructor(I,ht){this.reset(I,ht)}reset(I,ht){this.points=I||[],this._distances=[0];for(let Et=1;Et<this.points.length;Et++)this._distances[Et]=this._distances[Et-1]+this.points[Et].dist(this.points[Et-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(ht||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(I){if(this.points.length===1)return this.points[0];I=e.ac(I,0,1);let ht=1,Et=this._distances[ht],It=I*this.paddedLength+this.padding;for(;Et<It&&ht<this._distances.length;)Et=this._distances[++ht];let Vt=ht-1,ke=this._distances[Vt],Oe=Et-ke,Ke=Oe>0?(It-ke)/Oe:0;return this.points[Vt].mult(1-Ke).add(this.points[ht].mult(Ke))}}function Hr(qt,I){let ht=!0;return qt==="always"||qt!=="never"&&I!=="never"||(ht=!1),ht}class br{constructor(I,ht,Et){let It=this.boxCells=[],Vt=this.circleCells=[];this.xCellCount=Math.ceil(I/Et),this.yCellCount=Math.ceil(ht/Et);for(let ke=0;ke<this.xCellCount*this.yCellCount;ke++)It.push([]),Vt.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=I,this.height=ht,this.xScale=this.xCellCount/I,this.yScale=this.yCellCount/ht,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(I,ht,Et,It,Vt){this._forEachCell(ht,Et,It,Vt,this._insertBoxCell,this.boxUid++),this.boxKeys.push(I),this.bboxes.push(ht),this.bboxes.push(Et),this.bboxes.push(It),this.bboxes.push(Vt)}insertCircle(I,ht,Et,It){this._forEachCell(ht-It,Et-It,ht+It,Et+It,this._insertCircleCell,this.circleUid++),this.circleKeys.push(I),this.circles.push(ht),this.circles.push(Et),this.circles.push(It)}_insertBoxCell(I,ht,Et,It,Vt,ke){this.boxCells[Vt].push(ke)}_insertCircleCell(I,ht,Et,It,Vt,ke){this.circleCells[Vt].push(ke)}_query(I,ht,Et,It,Vt,ke,Oe){if(Et<0||I>this.width||It<0||ht>this.height)return[];let Ke=[];if(I<=0&&ht<=0&&this.width<=Et&&this.height<=It){if(Vt)return[{key:null,x1:I,y1:ht,x2:Et,y2:It}];for(let gr=0;gr<this.boxKeys.length;gr++)Ke.push({key:this.boxKeys[gr],x1:this.bboxes[4*gr],y1:this.bboxes[4*gr+1],x2:this.bboxes[4*gr+2],y2:this.bboxes[4*gr+3]});for(let gr=0;gr<this.circleKeys.length;gr++){let Or=this.circles[3*gr],Dr=this.circles[3*gr+1],ln=this.circles[3*gr+2];Ke.push({key:this.circleKeys[gr],x1:Or-ln,y1:Dr-ln,x2:Or+ln,y2:Dr+ln})}}else this._forEachCell(I,ht,Et,It,this._queryCell,Ke,{hitTest:Vt,overlapMode:ke,seenUids:{box:{},circle:{}}},Oe);return Ke}query(I,ht,Et,It){return this._query(I,ht,Et,It,!1,null)}hitTest(I,ht,Et,It,Vt,ke){return this._query(I,ht,Et,It,!0,Vt,ke).length>0}hitTestCircle(I,ht,Et,It,Vt){let ke=I-Et,Oe=I+Et,Ke=ht-Et,gr=ht+Et;if(Oe<0||ke>this.width||gr<0||Ke>this.height)return!1;let Or=[];return this._forEachCell(ke,Ke,Oe,gr,this._queryCellCircle,Or,{hitTest:!0,overlapMode:It,circle:{x:I,y:ht,radius:Et},seenUids:{box:{},circle:{}}},Vt),Or.length>0}_queryCell(I,ht,Et,It,Vt,ke,Oe,Ke){let{seenUids:gr,hitTest:Or,overlapMode:Dr}=Oe,ln=this.boxCells[Vt];if(ln!==null){let Xt=this.bboxes;for(let ae of ln)if(!gr.box[ae]){gr.box[ae]=!0;let xe=4*ae,Ae=this.boxKeys[ae];if(I<=Xt[xe+2]&&ht<=Xt[xe+3]&&Et>=Xt[xe+0]&&It>=Xt[xe+1]&&(!Ke||Ke(Ae))&&(!Or||!Hr(Dr,Ae.overlapMode))&&(ke.push({key:Ae,x1:Xt[xe],y1:Xt[xe+1],x2:Xt[xe+2],y2:Xt[xe+3]}),Or))return!0}}let Sn=this.circleCells[Vt];if(Sn!==null){let Xt=this.circles;for(let ae of Sn)if(!gr.circle[ae]){gr.circle[ae]=!0;let xe=3*ae,Ae=this.circleKeys[ae];if(this._circleAndRectCollide(Xt[xe],Xt[xe+1],Xt[xe+2],I,ht,Et,It)&&(!Ke||Ke(Ae))&&(!Or||!Hr(Dr,Ae.overlapMode))){let je=Xt[xe],Ie=Xt[xe+1],Ze=Xt[xe+2];if(ke.push({key:Ae,x1:je-Ze,y1:Ie-Ze,x2:je+Ze,y2:Ie+Ze}),Or)return!0}}}return!1}_queryCellCircle(I,ht,Et,It,Vt,ke,Oe,Ke){let{circle:gr,seenUids:Or,overlapMode:Dr}=Oe,ln=this.boxCells[Vt];if(ln!==null){let Xt=this.bboxes;for(let ae of ln)if(!Or.box[ae]){Or.box[ae]=!0;let xe=4*ae,Ae=this.boxKeys[ae];if(this._circleAndRectCollide(gr.x,gr.y,gr.radius,Xt[xe+0],Xt[xe+1],Xt[xe+2],Xt[xe+3])&&(!Ke||Ke(Ae))&&!Hr(Dr,Ae.overlapMode))return ke.push(!0),!0}}let Sn=this.circleCells[Vt];if(Sn!==null){let Xt=this.circles;for(let ae of Sn)if(!Or.circle[ae]){Or.circle[ae]=!0;let xe=3*ae,Ae=this.circleKeys[ae];if(this._circlesCollide(Xt[xe],Xt[xe+1],Xt[xe+2],gr.x,gr.y,gr.radius)&&(!Ke||Ke(Ae))&&!Hr(Dr,Ae.overlapMode))return ke.push(!0),!0}}}_forEachCell(I,ht,Et,It,Vt,ke,Oe,Ke){let gr=this._convertToXCellCoord(I),Or=this._convertToYCellCoord(ht),Dr=this._convertToXCellCoord(Et),ln=this._convertToYCellCoord(It);for(let Sn=gr;Sn<=Dr;Sn++)for(let Xt=Or;Xt<=ln;Xt++)if(Vt.call(this,I,ht,Et,It,this.xCellCount*Xt+Sn,ke,Oe,Ke))return}_convertToXCellCoord(I){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(I*this.xScale)))}_convertToYCellCoord(I){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(I*this.yScale)))}_circlesCollide(I,ht,Et,It,Vt,ke){let Oe=It-I,Ke=Vt-ht,gr=Et+ke;return gr*gr>Oe*Oe+Ke*Ke}_circleAndRectCollide(I,ht,Et,It,Vt,ke,Oe){let Ke=(ke-It)/2,gr=Math.abs(I-(It+Ke));if(gr>Ke+Et)return!1;let Or=(Oe-Vt)/2,Dr=Math.abs(ht-(Vt+Or));if(Dr>Or+Et)return!1;if(gr<=Ke||Dr<=Or)return!0;let ln=gr-Ke,Sn=Dr-Or;return ln*ln+Sn*Sn<=Et*Et}}function Kr(qt,I,ht,Et,It){let Vt=e.H();return I?(e.K(Vt,Vt,[1/It,1/It,1]),ht||e.ad(Vt,Vt,Et.angle)):e.L(Vt,Et.labelPlaneMatrix,qt),Vt}function rn(qt,I,ht,Et,It){if(I){let Vt=e.ae(qt);return e.K(Vt,Vt,[It,It,1]),ht||e.ad(Vt,Vt,-Et.angle),Vt}return Et.glCoordMatrix}function Ce(qt,I,ht,Et){let It;Et?(It=[qt,I,Et(qt,I),1],e.af(It,It,ht)):(It=[qt,I,0,1],pr(It,It,ht));let Vt=It[3];return{point:new e.P(It[0]/Vt,It[1]/Vt),signedDistanceFromCamera:Vt,isOccluded:!1}}function $t(qt,I){return .5+qt/I*.5}function ne(qt,I){return qt.x>=-I[0]&&qt.x<=I[0]&&qt.y>=-I[1]&&qt.y<=I[1]}function Ct(qt,I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr,ln,Sn,Xt){let ae=Et?qt.textSizeData:qt.iconSizeData,xe=e.ag(ae,ht.transform.zoom),Ae=[256/ht.width*2+1,256/ht.height*2+1],je=Et?qt.text.dynamicLayoutVertexArray:qt.icon.dynamicLayoutVertexArray;je.clear();let Ie=qt.lineVertexArray,Ze=Et?qt.text.placedSymbolArray:qt.icon.placedSymbolArray,wr=ht.transform.width/ht.transform.height,Ir=!1;for(let Nr=0;Nr<Ze.length;Nr++){let tn=Ze.get(Nr);if(tn.hidden||tn.writingMode===e.ah.vertical&&!Ir){Tr(tn.numGlyphs,je);continue}Ir=!1;let mn=Ce(tn.anchorX,tn.anchorY,I,Xt);if(!ne(mn.point,Ae)){Tr(tn.numGlyphs,je);continue}let zn=$t(ht.transform.cameraToCenterDistance,mn.signedDistanceFromCamera),Bn=e.ai(ae,xe,tn),ri=ke?Bn/zn:Bn*zn,Fi={getElevation:Xt,labelPlaneMatrix:It,lineVertexArray:Ie,pitchWithMap:ke,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:gr,tileAnchorPoint:new e.P(tn.anchorX,tn.anchorY),unwrappedTileID:Or,width:Dr,height:ln,translation:Sn},da=Nt(Fi,tn,ri,!1,Oe,I,Vt,qt.glyphOffsetArray,je,wr,Ke);Ir=da.useVertical,(da.notEnoughRoom||Ir||da.needsFlipping&&Nt(Fi,tn,ri,!0,Oe,I,Vt,qt.glyphOffsetArray,je,wr,Ke).notEnoughRoom)&&Tr(tn.numGlyphs,je)}Et?qt.text.dynamicLayoutVertexBuffer.updateData(je):qt.icon.dynamicLayoutVertexBuffer.updateData(je)}function gt(qt,I,ht,Et,It,Vt,ke,Oe){let Ke=Vt.glyphStartIndex+Vt.numGlyphs,gr=Vt.lineStartIndex,Or=Vt.lineStartIndex+Vt.lineLength,Dr=I.getoffsetX(Vt.glyphStartIndex),ln=I.getoffsetX(Ke-1),Sn=ar(qt*Dr,ht,Et,It,Vt.segment,gr,Or,Oe,ke);if(!Sn)return null;let Xt=ar(qt*ln,ht,Et,It,Vt.segment,gr,Or,Oe,ke);return Xt?Oe.projectionCache.anyProjectionOccluded?null:{first:Sn,last:Xt}:null}function St(qt,I,ht,Et){return qt===e.ah.horizontal&&Math.abs(ht.y-I.y)>Math.abs(ht.x-I.x)*Et?{useVertical:!0}:(qt===e.ah.vertical?I.y<ht.y:I.x>ht.x)?{needsFlipping:!0}:null}function Nt(qt,I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or){let Dr=ht/24,ln=I.lineOffsetX*Dr,Sn=I.lineOffsetY*Dr,Xt;if(I.numGlyphs>1){let ae=I.glyphStartIndex+I.numGlyphs,xe=I.lineStartIndex,Ae=I.lineStartIndex+I.lineLength,je=gt(Dr,Oe,ln,Sn,Et,I,Or,qt);if(!je)return{notEnoughRoom:!0};let Ie=Ce(je.first.point.x,je.first.point.y,ke,qt.getElevation).point,Ze=Ce(je.last.point.x,je.last.point.y,ke,qt.getElevation).point;if(It&&!Et){let wr=St(I.writingMode,Ie,Ze,gr);if(wr)return wr}Xt=[je.first];for(let wr=I.glyphStartIndex+1;wr<ae-1;wr++)Xt.push(ar(Dr*Oe.getoffsetX(wr),ln,Sn,Et,I.segment,xe,Ae,qt,Or));Xt.push(je.last)}else{if(It&&!Et){let xe=Ce(qt.tileAnchorPoint.x,qt.tileAnchorPoint.y,Vt,qt.getElevation).point,Ae=I.lineStartIndex+I.segment+1,je=new e.P(qt.lineVertexArray.getx(Ae),qt.lineVertexArray.gety(Ae)),Ie=Ce(je.x,je.y,Vt,qt.getElevation),Ze=Ie.signedDistanceFromCamera>0?Ie.point:function(Ir,Nr,tn,mn,zn,Bn){return ee(Ir,Nr,tn,1,zn,Bn)}(qt.tileAnchorPoint,je,xe,0,Vt,qt),wr=St(I.writingMode,xe,Ze,gr);if(wr)return wr}let ae=ar(Dr*Oe.getoffsetX(I.glyphStartIndex),ln,Sn,Et,I.segment,I.lineStartIndex,I.lineStartIndex+I.lineLength,qt,Or);if(!ae||qt.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};Xt=[ae]}for(let ae of Xt)e.aj(Ke,ae.point,ae.angle);return{}}function ee(qt,I,ht,Et,It,Vt){let ke=qt.add(qt.sub(I)._unit()),Oe=It!==void 0?Ce(ke.x,ke.y,It,Vt.getElevation).point:we(ke.x,ke.y,Vt).point,Ke=ht.sub(Oe);return ht.add(Ke._mult(Et/Ke.mag()))}function le(qt,I,ht){let Et=I.projectionCache;if(Et.projections[qt])return Et.projections[qt];let It=new e.P(I.lineVertexArray.getx(qt),I.lineVertexArray.gety(qt)),Vt=we(It.x,It.y,I);if(Vt.signedDistanceFromCamera>0)return Et.projections[qt]=Vt.point,Et.anyProjectionOccluded=Et.anyProjectionOccluded||Vt.isOccluded,Vt.point;let ke=qt-ht.direction;return function(Oe,Ke,gr,Or,Dr){return ee(Oe,Ke,gr,Or,void 0,Dr)}(ht.distanceFromAnchor===0?I.tileAnchorPoint:new e.P(I.lineVertexArray.getx(ke),I.lineVertexArray.gety(ke)),It,ht.previousVertex,ht.absOffsetX-ht.distanceFromAnchor+1,I)}function we(qt,I,ht){let Et=qt+ht.translation[0],It=I+ht.translation[1],Vt;return!ht.pitchWithMap&&ht.projection.useSpecialProjectionForSymbols?(Vt=ht.projection.projectTileCoordinates(Et,It,ht.unwrappedTileID,ht.getElevation),Vt.point.x=(.5*Vt.point.x+.5)*ht.width,Vt.point.y=(.5*-Vt.point.y+.5)*ht.height):(Vt=Ce(Et,It,ht.labelPlaneMatrix,ht.getElevation),Vt.isOccluded=!1),Vt}function Ue(qt,I,ht){return qt._unit()._perp()._mult(I*ht)}function qe(qt,I,ht,Et,It,Vt,ke,Oe,Ke){if(Oe.projectionCache.offsets[qt])return Oe.projectionCache.offsets[qt];let gr=ht.add(I);if(qt+Ke.direction<Et||qt+Ke.direction>=It)return Oe.projectionCache.offsets[qt]=gr,gr;let Or=le(qt+Ke.direction,Oe,Ke),Dr=Ue(Or.sub(ht),ke,Ke.direction),ln=ht.add(Dr),Sn=Or.add(Dr);return Oe.projectionCache.offsets[qt]=e.ak(Vt,gr,ln,Sn)||gr,Oe.projectionCache.offsets[qt]}function ar(qt,I,ht,Et,It,Vt,ke,Oe,Ke){let gr=Et?qt-I:qt+I,Or=gr>0?1:-1,Dr=0;Et&&(Or*=-1,Dr=Math.PI),Or<0&&(Dr+=Math.PI);let ln,Sn=Or>0?Vt+It:Vt+It+1;Oe.projectionCache.cachedAnchorPoint?ln=Oe.projectionCache.cachedAnchorPoint:(ln=we(Oe.tileAnchorPoint.x,Oe.tileAnchorPoint.y,Oe).point,Oe.projectionCache.cachedAnchorPoint=ln);let Xt,ae,xe=ln,Ae=ln,je=0,Ie=0,Ze=Math.abs(gr),wr=[],Ir;for(;je+Ie<=Ze;){if(Sn+=Or,Sn<Vt||Sn>=ke)return null;je+=Ie,Ae=xe,ae=Xt;let mn={absOffsetX:Ze,direction:Or,distanceFromAnchor:je,previousVertex:Ae};if(xe=le(Sn,Oe,mn),ht===0)wr.push(Ae),Ir=xe.sub(Ae);else{let zn,Bn=xe.sub(Ae);zn=Bn.mag()===0?Ue(le(Sn+Or,Oe,mn).sub(xe),ht,Or):Ue(Bn,ht,Or),ae||(ae=Ae.add(zn)),Xt=qe(Sn,zn,xe,Vt,ke,ae,ht,Oe,mn),wr.push(ae),Ir=Xt.sub(ae)}Ie=Ir.mag()}let Nr=Ir._mult((Ze-je)/Ie)._add(ae||Ae),tn=Dr+Math.atan2(xe.y-Ae.y,xe.x-Ae.x);return wr.push(Nr),{point:Nr,angle:Ke?tn:0,path:wr}}let Ar=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Tr(qt,I){for(let ht=0;ht<qt;ht++){let Et=I.length;I.resize(Et+4),I.float32.set(Ar,3*Et)}}function pr(qt,I,ht){let Et=I[0],It=I[1];return qt[0]=ht[0]*Et+ht[4]*It+ht[12],qt[1]=ht[1]*Et+ht[5]*It+ht[13],qt[3]=ht[3]*Et+ht[7]*It+ht[15],qt}let Jr=100;class Vn{constructor(I,ht,Et=new br(I.width+200,I.height+200,25),It=new br(I.width+200,I.height+200,25)){this.transform=I,this.mapProjection=ht,this.grid=Et,this.ignoredGrid=It,this.pitchFactor=Math.cos(I._pitch)*I.cameraToCenterDistance,this.screenRightBoundary=I.width+Jr,this.screenBottomBoundary=I.height+Jr,this.gridRightBoundary=I.width+200,this.gridBottomBoundary=I.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr){let ln=I.anchorPointX+Ke[0],Sn=I.anchorPointY+Ke[1],Xt=this.projectAndGetPerspectiveRatio(It,ln,Sn,Vt,Or),ae=Et*Xt.perspectiveRatio,xe;if(ke||Oe)xe=this._projectCollisionBox(I,ae,It,Vt,ke,Oe,Ke,Xt,Or,Dr);else{let wr=Xt.point.x+(Dr?Dr.x*ae:0),Ir=Xt.point.y+(Dr?Dr.y*ae:0);xe={allPointsOccluded:!1,box:[wr+I.x1*ae,Ir+I.y1*ae,wr+I.x2*ae,Ir+I.y2*ae]}}let[Ae,je,Ie,Ze]=xe.box;return this.mapProjection.useSpecialProjectionForSymbols&&(ke?xe.allPointsOccluded:this.mapProjection.isOccluded(ln,Sn,Vt))||Xt.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(Ae,je,Ie,Ze)||ht!=="always"&&this.grid.hitTest(Ae,je,Ie,Ze,ht,gr)?{box:[Ae,je,Ie,Ze],placeable:!1,offscreen:!1}:{box:[Ae,je,Ie,Ze],placeable:!0,offscreen:this.isOffscreen(Ae,je,Ie,Ze)}}placeCollisionCircles(I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr,ln,Sn,Xt,ae,xe){let Ae=[],je=new e.P(ht.anchorX,ht.anchorY),Ie=this.getPerspectiveRatio(ke,je.x,je.y,Oe,xe),Ze=(Dr?Vt/Ie:Vt*Ie)/e.ap,wr={getElevation:xe,labelPlaneMatrix:Ke,lineVertexArray:Et,pitchWithMap:Dr,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:je,unwrappedTileID:Oe,width:this.transform.width,height:this.transform.height,translation:ae},Ir=gt(Ze,It,ht.lineOffsetX*Ze,ht.lineOffsetY*Ze,!1,ht,!1,wr),Nr=!1,tn=!1,mn=!0;if(Ir){let zn=.5*Sn*Ie+Xt,Bn=new e.P(-100,-100),ri=new e.P(this.screenRightBoundary,this.screenBottomBoundary),Fi=new jr,da=Ir.first,ha=Ir.last,ka=[];for(let Mo=da.path.length-1;Mo>=1;Mo--)ka.push(da.path[Mo]);for(let Mo=1;Mo<ha.path.length;Mo++)ka.push(ha.path[Mo]);let io=2.5*zn;if(gr){let Mo=this.projectPathToScreenSpace(ka,wr,gr);ka=Mo.some(hs=>hs.signedDistanceFromCamera<=0)?[]:Mo.map(hs=>hs.point)}let Ro=[];if(ka.length>0){let Mo=ka[0].clone(),hs=ka[0].clone();for(let hl=1;hl<ka.length;hl++)Mo.x=Math.min(Mo.x,ka[hl].x),Mo.y=Math.min(Mo.y,ka[hl].y),hs.x=Math.max(hs.x,ka[hl].x),hs.y=Math.max(hs.y,ka[hl].y);Ro=Mo.x>=Bn.x&&hs.x<=ri.x&&Mo.y>=Bn.y&&hs.y<=ri.y?[ka]:hs.x<Bn.x||Mo.x>ri.x||hs.y<Bn.y||Mo.y>ri.y?[]:e.al([ka],Bn.x,Bn.y,ri.x,ri.y)}for(let Mo of Ro){Fi.reset(Mo,.25*zn);let hs=0;hs=Fi.length<=.5*zn?1:Math.ceil(Fi.paddedLength/io)+1;for(let hl=0;hl<hs;hl++){let vl=hl/Math.max(hs-1,1),Os=Fi.lerp(vl),bl=Os.x+Jr,Su=Os.y+Jr;Ae.push(bl,Su,zn,0);let mu=bl-zn,Ws=Su-zn,qs=bl+zn,Yu=Su+zn;if(mn=mn&&this.isOffscreen(mu,Ws,qs,Yu),tn=tn||this.isInsideGrid(mu,Ws,qs,Yu),I!=="always"&&this.grid.hitTestCircle(bl,Su,zn,I,ln)&&(Nr=!0,!Or))return{circles:[],offscreen:!1,collisionDetected:Nr}}}}return{circles:!Or&&Nr||!tn||Ie<this.perspectiveRatioCutoff?[]:Ae,offscreen:mn,collisionDetected:Nr}}projectPathToScreenSpace(I,ht,Et){return I.map(It=>Ce(It.x,It.y,Et,ht.getElevation))}queryRenderedSymbols(I){if(I.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let ht=[],Et=1/0,It=1/0,Vt=-1/0,ke=-1/0;for(let Or of I){let Dr=new e.P(Or.x+Jr,Or.y+Jr);Et=Math.min(Et,Dr.x),It=Math.min(It,Dr.y),Vt=Math.max(Vt,Dr.x),ke=Math.max(ke,Dr.y),ht.push(Dr)}let Oe=this.grid.query(Et,It,Vt,ke).concat(this.ignoredGrid.query(Et,It,Vt,ke)),Ke={},gr={};for(let Or of Oe){let Dr=Or.key;if(Ke[Dr.bucketInstanceId]===void 0&&(Ke[Dr.bucketInstanceId]={}),Ke[Dr.bucketInstanceId][Dr.featureIndex])continue;let ln=[new e.P(Or.x1,Or.y1),new e.P(Or.x2,Or.y1),new e.P(Or.x2,Or.y2),new e.P(Or.x1,Or.y2)];e.am(ht,ln)&&(Ke[Dr.bucketInstanceId][Dr.featureIndex]=!0,gr[Dr.bucketInstanceId]===void 0&&(gr[Dr.bucketInstanceId]=[]),gr[Dr.bucketInstanceId].push(Dr.featureIndex))}return gr}insertCollisionBox(I,ht,Et,It,Vt,ke){(Et?this.ignoredGrid:this.grid).insert({bucketInstanceId:It,featureIndex:Vt,collisionGroupID:ke,overlapMode:ht},I[0],I[1],I[2],I[3])}insertCollisionCircles(I,ht,Et,It,Vt,ke){let Oe=Et?this.ignoredGrid:this.grid,Ke={bucketInstanceId:It,featureIndex:Vt,collisionGroupID:ke,overlapMode:ht};for(let gr=0;gr<I.length;gr+=4)Oe.insertCircle(Ke,I[gr],I[gr+1],I[gr+2])}projectAndGetPerspectiveRatio(I,ht,Et,It,Vt){let ke;Vt?(ke=[ht,Et,Vt(ht,Et),1],e.af(ke,ke,I)):(ke=[ht,Et,0,1],pr(ke,ke,I));let Oe=ke[3];return{point:new e.P((ke[0]/Oe+1)/2*this.transform.width+Jr,(-ke[1]/Oe+1)/2*this.transform.height+Jr),perspectiveRatio:.5+this.transform.cameraToCenterDistance/Oe*.5,isOccluded:!1,signedDistanceFromCamera:Oe}}getPerspectiveRatio(I,ht,Et,It,Vt){let ke=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(ht,Et,It,Vt):Ce(ht,Et,I,Vt);return .5+this.transform.cameraToCenterDistance/ke.signedDistanceFromCamera*.5}isOffscreen(I,ht,Et,It){return Et<Jr||I>=this.screenRightBoundary||It<Jr||ht>this.screenBottomBoundary}isInsideGrid(I,ht,Et,It){return Et>=0&&I<this.gridRightBoundary&&It>=0&&ht<this.gridBottomBoundary}getViewportMatrix(){let I=e.an([]);return e.J(I,I,[-100,-100,0]),I}_projectCollisionBox(I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or){let Dr=new e.P(1,0),ln=new e.P(0,1),Sn=new e.P(I.anchorPointX+Oe[0],I.anchorPointY+Oe[1]);if(ke&&!Vt){let mn=this.projectAndGetPerspectiveRatio(Et,Sn.x+1,Sn.y,It,gr).point.sub(Ke.point).unit(),zn=Math.atan(mn.y/mn.x)+(mn.x<0?Math.PI:0),Bn=Math.sin(zn),ri=Math.cos(zn);Dr=new e.P(ri,Bn),ln=new e.P(-Bn,ri)}else if(!ke&&Vt){let mn=-this.transform.angle,zn=Math.sin(mn),Bn=Math.cos(mn);Dr=new e.P(Bn,zn),ln=new e.P(-zn,Bn)}let Xt=Ke.point,ae=ht;if(Vt){Xt=Sn;let mn=this.transform.zoom-Math.floor(this.transform.zoom);ae=Math.pow(2,-mn),ae*=this.mapProjection.getPitchedTextCorrection(this.transform,Sn,It),Or||(ae*=e.ac(.5+Ke.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}Or&&(Xt=Xt.add(Dr.mult(Or.x*ae)).add(ln.mult(Or.y*ae)));let xe=I.x1*ae,Ae=I.x2*ae,je=(xe+Ae)/2,Ie=I.y1*ae,Ze=I.y2*ae,wr=(Ie+Ze)/2,Ir=[{offsetX:xe,offsetY:Ie},{offsetX:je,offsetY:Ie},{offsetX:Ae,offsetY:Ie},{offsetX:Ae,offsetY:wr},{offsetX:Ae,offsetY:Ze},{offsetX:je,offsetY:Ze},{offsetX:xe,offsetY:Ze},{offsetX:xe,offsetY:wr}],Nr=[];for(let{offsetX:mn,offsetY:zn}of Ir)Nr.push(new e.P(Xt.x+Dr.x*mn+ln.x*zn,Xt.y+Dr.y*mn+ln.y*zn));let tn=!1;if(Vt){let mn=Nr.map(zn=>this.projectAndGetPerspectiveRatio(Et,zn.x,zn.y,It,gr));tn=mn.some(zn=>!zn.isOccluded),Nr=mn.map(zn=>zn.point)}else tn=!0;return{box:e.ao(Nr),allPointsOccluded:!tn}}}function Hn(qt,I,ht){return I*(e.X/(qt.tileSize*Math.pow(2,ht-qt.tileID.overscaledZ)))}class Kn{constructor(I,ht,Et,It){this.opacity=I?Math.max(0,Math.min(1,I.opacity+(I.placed?ht:-ht))):It&&Et?1:0,this.placed=Et}isHidden(){return this.opacity===0&&!this.placed}}class Ci{constructor(I,ht,Et,It,Vt){this.text=new Kn(I?I.text:null,ht,Et,Vt),this.icon=new Kn(I?I.icon:null,ht,It,Vt)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class ii{constructor(I,ht,Et){this.text=I,this.icon=ht,this.skipFade=Et}}class qn{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class oa{constructor(I,ht,Et,It,Vt){this.bucketInstanceId=I,this.featureIndex=ht,this.sourceLayerIndex=Et,this.bucketIndex=It,this.tileID=Vt}}class Hi{constructor(I){this.crossSourceCollisions=I,this.maxGroupID=0,this.collisionGroups={}}get(I){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[I]){let ht=++this.maxGroupID;this.collisionGroups[I]={ID:ht,predicate:Et=>Et.collisionGroupID===ht}}return this.collisionGroups[I]}}function We(qt,I,ht,Et,It){let{horizontalAlign:Vt,verticalAlign:ke}=e.au(qt);return new e.P(-(Vt-.5)*I+Et[0]*It,-(ke-.5)*ht+Et[1]*It)}class rr{constructor(I,ht,Et,It,Vt,ke){this.transform=I.clone(),this.terrain=Et,this.collisionIndex=new Vn(this.transform,ht),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=It,this.retainedQueryData={},this.collisionGroups=new Hi(Vt),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=ke,ke&&(ke.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(I){let ht=this.terrain;return ht?(Et,It)=>ht.getElevation(I,Et,It):null}getBucketParts(I,ht,Et,It){let Vt=Et.getBucket(ht),ke=Et.latestFeatureIndex;if(!Vt||!ke||ht.id!==Vt.layerIds[0])return;let Oe=Et.collisionBoxArray,Ke=Vt.layers[0].layout,gr=Vt.layers[0].paint,Or=Math.pow(2,this.transform.zoom-Et.tileID.overscaledZ),Dr=Et.tileSize/e.X,ln=Et.tileID.toUnwrapped(),Sn=this.transform.calculatePosMatrix(ln),Xt=Ke.get("text-pitch-alignment")==="map",ae=Ke.get("text-rotation-alignment")==="map",xe=Hn(Et,1,this.transform.zoom),Ae=this.collisionIndex.mapProjection.translatePosition(this.transform,Et,gr.get("text-translate"),gr.get("text-translate-anchor")),je=this.collisionIndex.mapProjection.translatePosition(this.transform,Et,gr.get("icon-translate"),gr.get("icon-translate-anchor")),Ie=Kr(Sn,Xt,ae,this.transform,xe),Ze=null;if(Xt){let Ir=rn(Sn,Xt,ae,this.transform,xe);Ze=e.L([],this.transform.labelPlaneMatrix,Ir)}this.retainedQueryData[Vt.bucketInstanceId]=new oa(Vt.bucketInstanceId,ke,Vt.sourceLayerIndex,Vt.index,Et.tileID);let wr={bucket:Vt,layout:Ke,translationText:Ae,translationIcon:je,posMatrix:Sn,unwrappedTileID:ln,textLabelPlaneMatrix:Ie,labelToScreenMatrix:Ze,scale:Or,textPixelRatio:Dr,holdingForFade:Et.holdingForFade(),collisionBoxArray:Oe,partiallyEvaluatedTextSize:e.ag(Vt.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Vt.sourceID)};if(It)for(let Ir of Vt.sortKeyRanges){let{sortKey:Nr,symbolInstanceStart:tn,symbolInstanceEnd:mn}=Ir;I.push({sortKey:Nr,symbolInstanceStart:tn,symbolInstanceEnd:mn,parameters:wr})}else I.push({symbolInstanceStart:0,symbolInstanceEnd:Vt.symbolInstances.length,parameters:wr})}attemptAnchorPlacement(I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr,ln,Sn,Xt,ae,xe,Ae,je,Ie){let Ze=e.aq[I.textAnchor],wr=[I.textOffset0,I.textOffset1],Ir=We(Ze,Et,It,wr,Vt),Nr=this.collisionIndex.placeCollisionBox(ht,ln,Ke,gr,Or,Oe,ke,xe,Dr.predicate,Ie,Ir);if((!je||this.collisionIndex.placeCollisionBox(je,ln,Ke,gr,Or,Oe,ke,Ae,Dr.predicate,Ie,Ir).placeable)&&Nr.placeable){let tn;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Sn.crossTileID]&&this.prevPlacement.placements[Sn.crossTileID]&&this.prevPlacement.placements[Sn.crossTileID].text&&(tn=this.prevPlacement.variableOffsets[Sn.crossTileID].anchor),Sn.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Sn.crossTileID]={textOffset:wr,width:Et,height:It,anchor:Ze,textBoxScale:Vt,prevAnchor:tn},this.markUsedJustification(Xt,Ze,Sn,ae),Xt.allowVerticalPlacement&&(this.markUsedOrientation(Xt,ae,Sn),this.placedOrientations[Sn.crossTileID]=ae),{shift:Ir,placedGlyphBoxes:Nr}}}placeLayerBucketPart(I,ht,Et){let{bucket:It,layout:Vt,translationText:ke,translationIcon:Oe,posMatrix:Ke,unwrappedTileID:gr,textLabelPlaneMatrix:Or,labelToScreenMatrix:Dr,textPixelRatio:ln,holdingForFade:Sn,collisionBoxArray:Xt,partiallyEvaluatedTextSize:ae,collisionGroup:xe}=I.parameters,Ae=Vt.get("text-optional"),je=Vt.get("icon-optional"),Ie=e.ar(Vt,"text-overlap","text-allow-overlap"),Ze=Ie==="always",wr=e.ar(Vt,"icon-overlap","icon-allow-overlap"),Ir=wr==="always",Nr=Vt.get("text-rotation-alignment")==="map",tn=Vt.get("text-pitch-alignment")==="map",mn=Vt.get("icon-text-fit")!=="none",zn=Vt.get("symbol-z-order")==="viewport-y",Bn=Ze&&(Ir||!It.hasIconData()||je),ri=Ir&&(Ze||!It.hasTextData()||Ae);!It.collisionArrays&&Xt&&It.deserializeCollisionBoxes(Xt);let Fi=this._getTerrainElevationFunc(this.retainedQueryData[It.bucketInstanceId].tileID),da=(ha,ka,io)=>{var Ro,Mo;if(ht[ha.crossTileID])return;if(Sn)return void(this.placements[ha.crossTileID]=new ii(!1,!1,!1));let hs=!1,hl=!1,vl=!0,Os=null,bl={box:null,placeable:!1,offscreen:null},Su={placeable:!1},mu=null,Ws=null,qs=null,Yu=0,dc=0,Zc=0;ka.textFeatureIndex?Yu=ka.textFeatureIndex:ha.useRuntimeCollisionCircles&&(Yu=ha.featureIndex),ka.verticalTextFeatureIndex&&(dc=ka.verticalTextFeatureIndex);let At=ka.textBox;if(At){let Le=Mr=>{let en=e.ah.horizontal;if(It.allowVerticalPlacement&&!Mr&&this.prevPlacement){let Xr=this.prevPlacement.placedOrientations[ha.crossTileID];Xr&&(this.placedOrientations[ha.crossTileID]=Xr,en=Xr,this.markUsedOrientation(It,en,ha))}return en},Be=(Mr,en)=>{if(It.allowVerticalPlacement&&ha.numVerticalGlyphVertices>0&&ka.verticalTextBox){for(let Xr of It.writingModes)if(Xr===e.ah.vertical?(bl=en(),Su=bl):bl=Mr(),bl&&bl.placeable)break}else bl=Mr()},sr=ha.textAnchorOffsetStartIndex,ir=ha.textAnchorOffsetEndIndex;if(ir===sr){let Mr=(en,Xr)=>{let vn=this.collisionIndex.placeCollisionBox(en,Ie,ln,Ke,gr,tn,Nr,ke,xe.predicate,Fi);return vn&&vn.placeable&&(this.markUsedOrientation(It,Xr,ha),this.placedOrientations[ha.crossTileID]=Xr),vn};Be(()=>Mr(At,e.ah.horizontal),()=>{let en=ka.verticalTextBox;return It.allowVerticalPlacement&&ha.numVerticalGlyphVertices>0&&en?Mr(en,e.ah.vertical):{box:null,offscreen:null}}),Le(bl&&bl.placeable)}else{let Mr=e.aq[(Mo=(Ro=this.prevPlacement)===null||Ro===void 0?void 0:Ro.variableOffsets[ha.crossTileID])===null||Mo===void 0?void 0:Mo.anchor],en=(vn,In,On)=>{let Bi=vn.x2-vn.x1,Un=vn.y2-vn.y1,mi=ha.textBoxScale,Ti=mn&&wr==="never"?In:null,Ii=null,Wi=Ie==="never"?1:2,Yn="never";Mr&&Wi++;for(let ja=0;ja<Wi;ja++){for(let Ha=sr;Ha<ir;Ha++){let ro=It.textAnchorOffsets.get(Ha);if(Mr&&ro.textAnchor!==Mr)continue;let Lo=this.attemptAnchorPlacement(ro,vn,Bi,Un,mi,Nr,tn,ln,Ke,gr,xe,Yn,ha,It,On,ke,Oe,Ti,Fi);if(Lo&&(Ii=Lo.placedGlyphBoxes,Ii&&Ii.placeable))return hs=!0,Os=Lo.shift,Ii}Mr?Mr=null:Yn=Ie}return Et&&!Ii&&(Ii={box:this.collisionIndex.placeCollisionBox(At,"always",ln,Ke,gr,tn,Nr,ke,xe.predicate,Fi,new e.P(0,0)).box,offscreen:!1,placeable:!1}),Ii};Be(()=>en(At,ka.iconBox,e.ah.horizontal),()=>{let vn=ka.verticalTextBox;return It.allowVerticalPlacement&&(!bl||!bl.placeable)&&ha.numVerticalGlyphVertices>0&&vn?en(vn,ka.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}}),bl&&(hs=bl.placeable,vl=bl.offscreen);let Xr=Le(bl&&bl.placeable);if(!hs&&this.prevPlacement){let vn=this.prevPlacement.variableOffsets[ha.crossTileID];vn&&(this.variableOffsets[ha.crossTileID]=vn,this.markUsedJustification(It,vn.anchor,ha,Xr))}}}if(mu=bl,hs=mu&&mu.placeable,vl=mu&&mu.offscreen,ha.useRuntimeCollisionCircles){let Le=It.text.placedSymbolArray.get(ha.centerJustifiedTextSymbolIndex),Be=e.ai(It.textSizeData,ae,Le),sr=Vt.get("text-padding");Ws=this.collisionIndex.placeCollisionCircles(Ie,Le,It.lineVertexArray,It.glyphOffsetArray,Be,Ke,gr,Or,Dr,Et,tn,xe.predicate,ha.collisionCircleDiameter,sr,ke,Fi),Ws.circles.length&&Ws.collisionDetected&&!Et&&e.w("Collisions detected, but collision boxes are not shown"),hs=Ze||Ws.circles.length>0&&!Ws.collisionDetected,vl=vl&&Ws.offscreen}if(ka.iconFeatureIndex&&(Zc=ka.iconFeatureIndex),ka.iconBox){let Le=Be=>this.collisionIndex.placeCollisionBox(Be,wr,ln,Ke,gr,tn,Nr,Oe,xe.predicate,Fi,mn&&Os?Os:void 0);Su&&Su.placeable&&ka.verticalIconBox?(qs=Le(ka.verticalIconBox),hl=qs.placeable):(qs=Le(ka.iconBox),hl=qs.placeable),vl=vl&&qs.offscreen}let jt=Ae||ha.numHorizontalGlyphVertices===0&&ha.numVerticalGlyphVertices===0,ue=je||ha.numIconVertices===0;jt||ue?ue?jt||(hl=hl&&hs):hs=hl&&hs:hl=hs=hl&&hs;let Me=hl&&qs.placeable;if(hs&&mu.placeable&&this.collisionIndex.insertCollisionBox(mu.box,Ie,Vt.get("text-ignore-placement"),It.bucketInstanceId,Su&&Su.placeable&&dc?dc:Yu,xe.ID),Me&&this.collisionIndex.insertCollisionBox(qs.box,wr,Vt.get("icon-ignore-placement"),It.bucketInstanceId,Zc,xe.ID),Ws&&hs&&this.collisionIndex.insertCollisionCircles(Ws.circles,Ie,Vt.get("text-ignore-placement"),It.bucketInstanceId,Yu,xe.ID),Et&&this.storeCollisionData(It.bucketInstanceId,io,ka,mu,qs,Ws),ha.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(It.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[ha.crossTileID]=new ii(hs||Bn,hl||ri,vl||It.justReloaded),ht[ha.crossTileID]=!0};if(zn){if(I.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let ha=It.getSortedSymbolIndexes(this.transform.angle);for(let ka=ha.length-1;ka>=0;--ka){let io=ha[ka];da(It.symbolInstances.get(io),It.collisionArrays[io],io)}}else for(let ha=I.symbolInstanceStart;ha<I.symbolInstanceEnd;ha++)da(It.symbolInstances.get(ha),It.collisionArrays[ha],ha);if(Et&&It.bucketInstanceId in this.collisionCircleArrays){let ha=this.collisionCircleArrays[It.bucketInstanceId];e.as(ha.invProjMatrix,Ke),ha.viewportMatrix=this.collisionIndex.getViewportMatrix()}It.justReloaded=!1}storeCollisionData(I,ht,Et,It,Vt,ke){if(Et.textBox||Et.iconBox){let Oe,Ke;this.collisionBoxArrays.has(I)?Oe=this.collisionBoxArrays.get(I):(Oe=new Map,this.collisionBoxArrays.set(I,Oe)),Oe.has(ht)?Ke=Oe.get(ht):(Ke={text:null,icon:null},Oe.set(ht,Ke)),Et.textBox&&(Ke.text=It.box),Et.iconBox&&(Ke.icon=Vt.box)}if(ke){let Oe=this.collisionCircleArrays[I];Oe===void 0&&(Oe=this.collisionCircleArrays[I]=new qn);for(let Ke=0;Ke<ke.circles.length;Ke+=4)Oe.circles.push(ke.circles[Ke+0]),Oe.circles.push(ke.circles[Ke+1]),Oe.circles.push(ke.circles[Ke+2]),Oe.circles.push(ke.collisionDetected?1:0)}}markUsedJustification(I,ht,Et,It){let Vt;Vt=It===e.ah.vertical?Et.verticalPlacedTextSymbolIndex:{left:Et.leftJustifiedTextSymbolIndex,center:Et.centerJustifiedTextSymbolIndex,right:Et.rightJustifiedTextSymbolIndex}[e.at(ht)];let ke=[Et.leftJustifiedTextSymbolIndex,Et.centerJustifiedTextSymbolIndex,Et.rightJustifiedTextSymbolIndex,Et.verticalPlacedTextSymbolIndex];for(let Oe of ke)Oe>=0&&(I.text.placedSymbolArray.get(Oe).crossTileID=Vt>=0&&Oe!==Vt?0:Et.crossTileID)}markUsedOrientation(I,ht,Et){let It=ht===e.ah.horizontal||ht===e.ah.horizontalOnly?ht:0,Vt=ht===e.ah.vertical?ht:0,ke=[Et.leftJustifiedTextSymbolIndex,Et.centerJustifiedTextSymbolIndex,Et.rightJustifiedTextSymbolIndex];for(let Oe of ke)I.text.placedSymbolArray.get(Oe).placedOrientation=It;Et.verticalPlacedTextSymbolIndex&&(I.text.placedSymbolArray.get(Et.verticalPlacedTextSymbolIndex).placedOrientation=Vt)}commit(I){this.commitTime=I,this.zoomAtLastRecencyCheck=this.transform.zoom;let ht=this.prevPlacement,Et=!1;this.prevZoomAdjustment=ht?ht.zoomAdjustment(this.transform.zoom):0;let It=ht?ht.symbolFadeChange(I):1,Vt=ht?ht.opacities:{},ke=ht?ht.variableOffsets:{},Oe=ht?ht.placedOrientations:{};for(let Ke in this.placements){let gr=this.placements[Ke],Or=Vt[Ke];Or?(this.opacities[Ke]=new Ci(Or,It,gr.text,gr.icon),Et=Et||gr.text!==Or.text.placed||gr.icon!==Or.icon.placed):(this.opacities[Ke]=new Ci(null,It,gr.text,gr.icon,gr.skipFade),Et=Et||gr.text||gr.icon)}for(let Ke in Vt){let gr=Vt[Ke];if(!this.opacities[Ke]){let Or=new Ci(gr,It,!1,!1);Or.isHidden()||(this.opacities[Ke]=Or,Et=Et||gr.text.placed||gr.icon.placed)}}for(let Ke in ke)this.variableOffsets[Ke]||!this.opacities[Ke]||this.opacities[Ke].isHidden()||(this.variableOffsets[Ke]=ke[Ke]);for(let Ke in Oe)this.placedOrientations[Ke]||!this.opacities[Ke]||this.opacities[Ke].isHidden()||(this.placedOrientations[Ke]=Oe[Ke]);if(ht&&ht.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Et?this.lastPlacementChangeTime=I:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ht?ht.lastPlacementChangeTime:I)}updateLayerOpacities(I,ht){let Et={};for(let It of ht){let Vt=It.getBucket(I);Vt&&It.latestFeatureIndex&&I.id===Vt.layerIds[0]&&this.updateBucketOpacities(Vt,It.tileID,Et,It.collisionBoxArray)}}updateBucketOpacities(I,ht,Et,It){I.hasTextData()&&(I.text.opacityVertexArray.clear(),I.text.hasVisibleVertices=!1),I.hasIconData()&&(I.icon.opacityVertexArray.clear(),I.icon.hasVisibleVertices=!1),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexArray.clear(),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexArray.clear();let Vt=I.layers[0],ke=Vt.layout,Oe=new Ci(null,0,!1,!1,!0),Ke=ke.get("text-allow-overlap"),gr=ke.get("icon-allow-overlap"),Or=Vt._unevaluatedLayout.hasValue("text-variable-anchor")||Vt._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Dr=ke.get("text-rotation-alignment")==="map",ln=ke.get("text-pitch-alignment")==="map",Sn=ke.get("icon-text-fit")!=="none",Xt=new Ci(null,0,Ke&&(gr||!I.hasIconData()||ke.get("icon-optional")),gr&&(Ke||!I.hasTextData()||ke.get("text-optional")),!0);!I.collisionArrays&&It&&(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData())&&I.deserializeCollisionBoxes(It);let ae=(Ae,je,Ie)=>{for(let Ze=0;Ze<je/4;Ze++)Ae.opacityVertexArray.emplaceBack(Ie);Ae.hasVisibleVertices=Ae.hasVisibleVertices||Ie!==Di},xe=this.collisionBoxArrays.get(I.bucketInstanceId);for(let Ae=0;Ae<I.symbolInstances.length;Ae++){let je=I.symbolInstances.get(Ae),{numHorizontalGlyphVertices:Ie,numVerticalGlyphVertices:Ze,crossTileID:wr}=je,Ir=this.opacities[wr];Et[wr]?Ir=Oe:Ir||(Ir=Xt,this.opacities[wr]=Ir),Et[wr]=!0;let Nr=je.numIconVertices>0,tn=this.placedOrientations[je.crossTileID],mn=tn===e.ah.vertical,zn=tn===e.ah.horizontal||tn===e.ah.horizontalOnly;if(Ie>0||Ze>0){let ri=Pi(Ir.text);ae(I.text,Ie,mn?Di:ri),ae(I.text,Ze,zn?Di:ri);let Fi=Ir.text.isHidden();[je.rightJustifiedTextSymbolIndex,je.centerJustifiedTextSymbolIndex,je.leftJustifiedTextSymbolIndex].forEach(ka=>{ka>=0&&(I.text.placedSymbolArray.get(ka).hidden=Fi||mn?1:0)}),je.verticalPlacedTextSymbolIndex>=0&&(I.text.placedSymbolArray.get(je.verticalPlacedTextSymbolIndex).hidden=Fi||zn?1:0);let da=this.variableOffsets[je.crossTileID];da&&this.markUsedJustification(I,da.anchor,je,tn);let ha=this.placedOrientations[je.crossTileID];ha&&(this.markUsedJustification(I,"left",je,ha),this.markUsedOrientation(I,ha,je))}if(Nr){let ri=Pi(Ir.icon),Fi=!(Sn&&je.verticalPlacedIconSymbolIndex&&mn);je.placedIconSymbolIndex>=0&&(ae(I.icon,je.numIconVertices,Fi?ri:Di),I.icon.placedSymbolArray.get(je.placedIconSymbolIndex).hidden=Ir.icon.isHidden()),je.verticalPlacedIconSymbolIndex>=0&&(ae(I.icon,je.numVerticalIconVertices,Fi?Di:ri),I.icon.placedSymbolArray.get(je.verticalPlacedIconSymbolIndex).hidden=Ir.icon.isHidden())}let Bn=xe&&xe.has(Ae)?xe.get(Ae):{text:null,icon:null};if(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData()){let ri=I.collisionArrays[Ae];if(ri){let Fi=new e.P(0,0);if(ri.textBox||ri.verticalTextBox){let da=!0;if(Or){let ha=this.variableOffsets[wr];ha?(Fi=We(ha.anchor,ha.width,ha.height,ha.textOffset,ha.textBoxScale),Dr&&Fi._rotate(ln?this.transform.angle:-this.transform.angle)):da=!1}if(ri.textBox||ri.verticalTextBox){let ha;ri.textBox&&(ha=mn),ri.verticalTextBox&&(ha=zn),fr(I.textCollisionBox.collisionVertexArray,Ir.text.placed,!da||ha,Bn.text,Fi.x,Fi.y)}}if(ri.iconBox||ri.verticalIconBox){let da=!!(!zn&&ri.verticalIconBox),ha;ri.iconBox&&(ha=da),ri.verticalIconBox&&(ha=!da),fr(I.iconCollisionBox.collisionVertexArray,Ir.icon.placed,ha,Bn.icon,Sn?Fi.x:0,Sn?Fi.y:0)}}}}if(I.sortFeatures(this.transform.angle),this.retainedQueryData[I.bucketInstanceId]&&(this.retainedQueryData[I.bucketInstanceId].featureSortOrder=I.featureSortOrder),I.hasTextData()&&I.text.opacityVertexBuffer&&I.text.opacityVertexBuffer.updateData(I.text.opacityVertexArray),I.hasIconData()&&I.icon.opacityVertexBuffer&&I.icon.opacityVertexBuffer.updateData(I.icon.opacityVertexArray),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexBuffer&&I.iconCollisionBox.collisionVertexBuffer.updateData(I.iconCollisionBox.collisionVertexArray),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexBuffer&&I.textCollisionBox.collisionVertexBuffer.updateData(I.textCollisionBox.collisionVertexArray),I.text.opacityVertexArray.length!==I.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${I.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${I.text.layoutVertexArray.length}) / 4`);if(I.icon.opacityVertexArray.length!==I.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${I.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${I.icon.layoutVertexArray.length}) / 4`);if(I.bucketInstanceId in this.collisionCircleArrays){let Ae=this.collisionCircleArrays[I.bucketInstanceId];I.placementInvProjMatrix=Ae.invProjMatrix,I.placementViewportMatrix=Ae.viewportMatrix,I.collisionCircleArray=Ae.circles,delete this.collisionCircleArrays[I.bucketInstanceId]}}symbolFadeChange(I){return this.fadeDuration===0?1:(I-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(I){return Math.max(0,(this.transform.zoom-I)/1.5)}hasTransitions(I){return this.stale||I-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(I,ht){let Et=this.zoomAtLastRecencyCheck===ht?1-this.zoomAdjustment(ht):1;return this.zoomAtLastRecencyCheck=ht,this.commitTime+this.fadeDuration*Et>I}setStale(){this.stale=!0}}function fr(qt,I,ht,Et,It,Vt){Et&&Et.length!==0||(Et=[0,0,0,0]);let ke=Et[0]-Jr,Oe=Et[1]-Jr,Ke=Et[2]-Jr,gr=Et[3]-Jr;qt.emplaceBack(I?1:0,ht?1:0,It||0,Vt||0,ke,Oe),qt.emplaceBack(I?1:0,ht?1:0,It||0,Vt||0,Ke,Oe),qt.emplaceBack(I?1:0,ht?1:0,It||0,Vt||0,Ke,gr),qt.emplaceBack(I?1:0,ht?1:0,It||0,Vt||0,ke,gr)}let xr=Math.pow(2,25),Qr=Math.pow(2,24),Cn=Math.pow(2,17),wn=Math.pow(2,16),Mn=Math.pow(2,9),ci=Math.pow(2,8),xi=Math.pow(2,1);function Pi(qt){if(qt.opacity===0&&!qt.placed)return 0;if(qt.opacity===1&&qt.placed)return 4294967295;let I=qt.placed?1:0,ht=Math.floor(127*qt.opacity);return ht*xr+I*Qr+ht*Cn+I*wn+ht*Mn+I*ci+ht*xi+I}let Di=0;function Zi(){return{isOccluded:(qt,I,ht)=>!1,getPitchedTextCorrection:(qt,I,ht)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(qt,I,ht,Et){throw new Error("Not implemented.")},translatePosition:(qt,I,ht,Et)=>function(It,Vt,ke,Oe,Ke=!1){if(!ke[0]&&!ke[1])return[0,0];let gr=Ke?Oe==="map"?It.angle:0:Oe==="viewport"?-It.angle:0;if(gr){let Or=Math.sin(gr),Dr=Math.cos(gr);ke=[ke[0]*Dr-ke[1]*Or,ke[0]*Or+ke[1]*Dr]}return[Ke?ke[0]:Hn(Vt,ke[0],It.zoom),Ke?ke[1]:Hn(Vt,ke[1],It.zoom)]}(qt,I,ht,Et),getCircleRadiusCorrection:qt=>1}}class ui{constructor(I){this._sortAcrossTiles=I.layout.get("symbol-z-order")!=="viewport-y"&&!I.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(I,ht,Et,It,Vt){let ke=this._bucketParts;for(;this._currentTileIndex<I.length;)if(ht.getBucketParts(ke,It,I[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,Vt())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,ke.sort((Oe,Ke)=>Oe.sortKey-Ke.sortKey));this._currentPartIndex<ke.length;)if(ht.placeLayerBucketPart(ke[this._currentPartIndex],this._seenCrossTileIDs,Et),this._currentPartIndex++,Vt())return!0;return!1}}class Pa{constructor(I,ht,Et,It,Vt,ke,Oe,Ke){this.placement=new rr(I,Zi(),ht,ke,Oe,Ke),this._currentPlacementIndex=Et.length-1,this._forceFullPlacement=It,this._showCollisionBoxes=Vt,this._done=!1}isDone(){return this._done}continuePlacement(I,ht,Et){let It=o.now(),Vt=()=>!this._forceFullPlacement&&o.now()-It>2;for(;this._currentPlacementIndex>=0;){let ke=ht[I[this._currentPlacementIndex]],Oe=this.placement.collisionIndex.transform.zoom;if(ke.type==="symbol"&&(!ke.minzoom||ke.minzoom<=Oe)&&(!ke.maxzoom||ke.maxzoom>Oe)){if(this._inProgressLayer||(this._inProgressLayer=new ui(ke)),this._inProgressLayer.continuePlacement(Et[ke.source],this.placement,this._showCollisionBoxes,ke,Vt))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(I){return this.placement.commit(I),this.placement}}let Wa=512/e.X/2;class ze{constructor(I,ht,Et){this.tileID=I,this.bucketInstanceId=Et,this._symbolsByKey={};let It=new Map;for(let Vt=0;Vt<ht.length;Vt++){let ke=ht.get(Vt),Oe=ke.key,Ke=It.get(Oe);Ke?Ke.push(ke):It.set(Oe,[ke])}for(let[Vt,ke]of It){let Oe={positions:ke.map(Ke=>({x:Math.floor(Ke.anchorX*Wa),y:Math.floor(Ke.anchorY*Wa)})),crossTileIDs:ke.map(Ke=>Ke.crossTileID)};if(Oe.positions.length>128){let Ke=new e.av(Oe.positions.length,16,Uint16Array);for(let{x:gr,y:Or}of Oe.positions)Ke.add(gr,Or);Ke.finish(),delete Oe.positions,Oe.index=Ke}this._symbolsByKey[Vt]=Oe}}getScaledCoordinates(I,ht){let{x:Et,y:It,z:Vt}=this.tileID.canonical,{x:ke,y:Oe,z:Ke}=ht.canonical,gr=Wa/Math.pow(2,Ke-Vt),Or=(Oe*e.X+I.anchorY)*gr,Dr=It*e.X*Wa;return{x:Math.floor((ke*e.X+I.anchorX)*gr-Et*e.X*Wa),y:Math.floor(Or-Dr)}}findMatches(I,ht,Et){let It=this.tileID.canonical.z<ht.canonical.z?1:Math.pow(2,this.tileID.canonical.z-ht.canonical.z);for(let Vt=0;Vt<I.length;Vt++){let ke=I.get(Vt);if(ke.crossTileID)continue;let Oe=this._symbolsByKey[ke.key];if(!Oe)continue;let Ke=this.getScaledCoordinates(ke,ht);if(Oe.index){let gr=Oe.index.range(Ke.x-It,Ke.y-It,Ke.x+It,Ke.y+It).sort();for(let Or of gr){let Dr=Oe.crossTileIDs[Or];if(!Et[Dr]){Et[Dr]=!0,ke.crossTileID=Dr;break}}}else if(Oe.positions)for(let gr=0;gr<Oe.positions.length;gr++){let Or=Oe.positions[gr],Dr=Oe.crossTileIDs[gr];if(Math.abs(Or.x-Ke.x)<=It&&Math.abs(Or.y-Ke.y)<=It&&!Et[Dr]){Et[Dr]=!0,ke.crossTileID=Dr;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:I})=>I)}}class Pe{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Rr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(I){let ht=Math.round((I-this.lng)/360);if(ht!==0)for(let Et in this.indexes){let It=this.indexes[Et],Vt={};for(let ke in It){let Oe=It[ke];Oe.tileID=Oe.tileID.unwrapTo(Oe.tileID.wrap+ht),Vt[Oe.tileID.key]=Oe}this.indexes[Et]=Vt}this.lng=I}addBucket(I,ht,Et){if(this.indexes[I.overscaledZ]&&this.indexes[I.overscaledZ][I.key]){if(this.indexes[I.overscaledZ][I.key].bucketInstanceId===ht.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(I.overscaledZ,this.indexes[I.overscaledZ][I.key])}for(let Vt=0;Vt<ht.symbolInstances.length;Vt++)ht.symbolInstances.get(Vt).crossTileID=0;this.usedCrossTileIDs[I.overscaledZ]||(this.usedCrossTileIDs[I.overscaledZ]={});let It=this.usedCrossTileIDs[I.overscaledZ];for(let Vt in this.indexes){let ke=this.indexes[Vt];if(Number(Vt)>I.overscaledZ)for(let Oe in ke){let Ke=ke[Oe];Ke.tileID.isChildOf(I)&&Ke.findMatches(ht.symbolInstances,I,It)}else{let Oe=ke[I.scaledTo(Number(Vt)).key];Oe&&Oe.findMatches(ht.symbolInstances,I,It)}}for(let Vt=0;Vt<ht.symbolInstances.length;Vt++){let ke=ht.symbolInstances.get(Vt);ke.crossTileID||(ke.crossTileID=Et.generate(),It[ke.crossTileID]=!0)}return this.indexes[I.overscaledZ]===void 0&&(this.indexes[I.overscaledZ]={}),this.indexes[I.overscaledZ][I.key]=new ze(I,ht.symbolInstances,ht.bucketInstanceId),!0}removeBucketCrossTileIDs(I,ht){for(let Et of ht.getCrossTileIDsLists())for(let It of Et)delete this.usedCrossTileIDs[I][It]}removeStaleBuckets(I){let ht=!1;for(let Et in this.indexes){let It=this.indexes[Et];for(let Vt in It)I[It[Vt].bucketInstanceId]||(this.removeBucketCrossTileIDs(Et,It[Vt]),delete It[Vt],ht=!0)}return ht}}class qr{constructor(){this.layerIndexes={},this.crossTileIDs=new Pe,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(I,ht,Et){let It=this.layerIndexes[I.id];It===void 0&&(It=this.layerIndexes[I.id]=new Rr);let Vt=!1,ke={};It.handleWrapJump(Et);for(let Oe of ht){let Ke=Oe.getBucket(I);Ke&&I.id===Ke.layerIds[0]&&(Ke.bucketInstanceId||(Ke.bucketInstanceId=++this.maxBucketInstanceId),It.addBucket(Oe.tileID,Ke,this.crossTileIDs)&&(Vt=!0),ke[Ke.bucketInstanceId]=!0)}return It.removeStaleBuckets(ke)&&(Vt=!0),Vt}pruneUnusedLayers(I){let ht={};I.forEach(Et=>{ht[Et]=!0});for(let Et in this.layerIndexes)ht[Et]||delete this.layerIndexes[Et]}}let $r=(qt,I)=>e.t(qt,I&&I.filter(ht=>ht.identifier!=="source.canvas")),Br=e.aw();class Gr extends e.E{constructor(I,ht={}){super(),this._rtlPluginLoaded=()=>{for(let Et in this.sourceCaches){let It=this.sourceCaches[Et].getSource().type;It!=="vector"&&It!=="geojson"||this.sourceCaches[Et].reload()}},this.map=I,this.dispatcher=new rt(dt(),I._getMapId()),this.dispatcher.registerMessageHandler("GG",(Et,It)=>this.getGlyphs(Et,It)),this.dispatcher.registerMessageHandler("GI",(Et,It)=>this.getImages(Et,It)),this.imageManager=new w,this.imageManager.setEventedParent(this),this.glyphManager=new V(I._requestManager,ht.localIdeographFontFamily),this.lineAtlas=new X(256,512),this.crossTileSymbolIndex=new qr,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()),ve().on(Lt,this._rtlPluginLoaded),this.on("data",Et=>{if(Et.dataType!=="source"||Et.sourceDataType!=="metadata")return;let It=this.sourceCaches[Et.sourceId];if(!It)return;let Vt=It.getSource();if(Vt&&Vt.vectorLayerIds)for(let ke in this._layers){let Oe=this._layers[ke];Oe.source===Vt.id&&this._validateLayer(Oe)}})}loadURL(I,ht={},Et){this.fire(new e.k("dataloading",{dataType:"style"})),ht.validate=typeof ht.validate!="boolean"||ht.validate;let It=this.map._requestManager.transformRequest(I,"Style");this._loadStyleRequest=new AbortController;let Vt=this._loadStyleRequest;e.h(It,this._loadStyleRequest).then(ke=>{this._loadStyleRequest=null,this._load(ke.data,ht,Et)}).catch(ke=>{this._loadStyleRequest=null,ke&&!Vt.signal.aborted&&this.fire(new e.j(ke))})}loadJSON(I,ht={},Et){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,o.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,ht.validate=ht.validate!==!1,this._load(I,ht,Et)}).catch(()=>{})}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(Br,{validate:!1})}_load(I,ht,Et){var It;let Vt=ht.transformStyle?ht.transformStyle(Et,I):I;if(!ht.validate||!$r(this,e.u(Vt))){this._loaded=!0,this.stylesheet=Vt;for(let ke in Vt.sources)this.addSource(ke,Vt.sources[ke],{validate:!1});Vt.sprite?this._loadSprite(Vt.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Vt.glyphs),this._createLayers(),this.light=new U(this.stylesheet.light),this.sky=new q(this.stylesheet.sky),this.map.setTerrain((It=this.stylesheet.terrain)!==null&&It!==void 0?It:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){let I=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",I),this._order=I.map(ht=>ht.id),this._layers={},this._serializedLayers=null;for(let ht of I){let Et=e.aA(ht);Et.setEventedParent(this,{layer:{id:ht.id}}),this._layers[ht.id]=Et}}_loadSprite(I,ht=!1,Et=void 0){let It;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(Vt,ke,Oe,Ke){return e._(this,void 0,void 0,function*(){let gr=A(Vt),Or=Oe>1?"@2x":"",Dr={},ln={};for(let{id:Sn,url:Xt}of gr){let ae=ke.transformRequest(h(Xt,Or,".json"),"SpriteJSON");Dr[Sn]=e.h(ae,Ke);let xe=ke.transformRequest(h(Xt,Or,".png"),"SpriteImage");ln[Sn]=u.getImage(xe,Ke)}return yield Promise.all([...Object.values(Dr),...Object.values(ln)]),function(Sn,Xt){return e._(this,void 0,void 0,function*(){let ae={};for(let xe in Sn){ae[xe]={};let Ae=o.getImageCanvasContext((yield Xt[xe]).data),je=(yield Sn[xe]).data;for(let Ie in je){let{width:Ze,height:wr,x:Ir,y:Nr,sdf:tn,pixelRatio:mn,stretchX:zn,stretchY:Bn,content:ri,textFitWidth:Fi,textFitHeight:da}=je[Ie];ae[xe][Ie]={data:null,pixelRatio:mn,sdf:tn,stretchX:zn,stretchY:Bn,content:ri,textFitWidth:Fi,textFitHeight:da,spriteData:{width:Ze,height:wr,x:Ir,y:Nr,context:Ae}}}}return ae})}(Dr,ln)})}(I,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Vt=>{if(this._spriteRequest=null,Vt)for(let ke in Vt){this._spritesImagesIds[ke]=[];let Oe=this._spritesImagesIds[ke]?this._spritesImagesIds[ke].filter(Ke=>!(Ke in Vt)):[];for(let Ke of Oe)this.imageManager.removeImage(Ke),this._changedImages[Ke]=!0;for(let Ke in Vt[ke]){let gr=ke==="default"?Ke:`${ke}:${Ke}`;this._spritesImagesIds[ke].push(gr),gr in this.imageManager.images?this.imageManager.updateImage(gr,Vt[ke][Ke],!1):this.imageManager.addImage(gr,Vt[ke][Ke]),ht&&(this._changedImages[gr]=!0)}}}).catch(Vt=>{this._spriteRequest=null,It=Vt,this.fire(new e.j(It))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),ht&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),Et&&Et(It)})}_unloadSprite(){for(let I of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(I),this._changedImages[I]=!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(I){let ht=this.sourceCaches[I.source];if(!ht)return;let Et=I.sourceLayer;if(!Et)return;let It=ht.getSource();(It.type==="geojson"||It.vectorLayerIds&&It.vectorLayerIds.indexOf(Et)===-1)&&this.fire(new e.j(new Error(`Source layer "${Et}" does not exist on source "${It.id}" as specified by style layer "${I.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let I in this.sourceCaches)if(!this.sourceCaches[I].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(I,ht=!1){let Et=this._serializedAllLayers();if(!I||I.length===0)return Object.values(ht?e.aB(Et):Et);let It=[];for(let Vt of I)if(Et[Vt]){let ke=ht?e.aB(Et[Vt]):Et[Vt];It.push(ke)}return It}_serializedAllLayers(){let I=this._serializedLayers;if(I)return I;I=this._serializedLayers={};let ht=Object.keys(this._layers);for(let Et of ht){let It=this._layers[Et];It.type!=="custom"&&(I[Et]=It.serialize())}return I}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let I in this.sourceCaches)if(this.sourceCaches[I].hasTransition())return!0;for(let I in this._layers)if(this._layers[I].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(I){if(!this._loaded)return;let ht=this._changed;if(ht){let It=Object.keys(this._updatedLayers),Vt=Object.keys(this._removedLayers);(It.length||Vt.length)&&this._updateWorkerLayers(It,Vt);for(let ke in this._updatedSources){let Oe=this._updatedSources[ke];if(Oe==="reload")this._reloadSource(ke);else{if(Oe!=="clear")throw new Error(`Invalid action ${Oe}`);this._clearSource(ke)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let ke in this._updatedPaintProps)this._layers[ke].updateTransitions(I);this.light.updateTransitions(I),this.sky.updateTransitions(I),this._resetUpdates()}let Et={};for(let It in this.sourceCaches){let Vt=this.sourceCaches[It];Et[It]=Vt.used,Vt.used=!1}for(let It of this._order){let Vt=this._layers[It];Vt.recalculate(I,this._availableImages),!Vt.isHidden(I.zoom)&&Vt.source&&(this.sourceCaches[Vt.source].used=!0)}for(let It in Et){let Vt=this.sourceCaches[It];!!Et[It]!=!!Vt.used&&Vt.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:It}))}this.light.recalculate(I),this.sky.recalculate(I),this.z=I.zoom,ht&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let I=Object.keys(this._changedImages);if(I.length){for(let ht in this.sourceCaches)this.sourceCaches[ht].reloadTilesForDependencies(["icons","patterns"],I);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let I in this.sourceCaches)this.sourceCaches[I].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(I,ht){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(I,!1),removedIds:ht})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(I,ht={}){var Et;this._checkLoaded();let It=this.serialize();if(I=ht.transformStyle?ht.transformStyle(It,I):I,((Et=ht.validate)===null||Et===void 0||Et)&&$r(this,e.u(I)))return!1;(I=e.aB(I)).layers=e.az(I.layers);let Vt=e.aC(It,I),ke=this._getOperationsToPerform(Vt);if(ke.unimplemented.length>0)throw new Error(`Unimplemented: ${ke.unimplemented.join(", ")}.`);if(ke.operations.length===0)return!1;for(let Oe of ke.operations)Oe();return this.stylesheet=I,this._serializedLayers=null,!0}_getOperationsToPerform(I){let ht=[],Et=[];for(let It of I)switch(It.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":ht.push(()=>this.addLayer.apply(this,It.args));break;case"removeLayer":ht.push(()=>this.removeLayer.apply(this,It.args));break;case"setPaintProperty":ht.push(()=>this.setPaintProperty.apply(this,It.args));break;case"setLayoutProperty":ht.push(()=>this.setLayoutProperty.apply(this,It.args));break;case"setFilter":ht.push(()=>this.setFilter.apply(this,It.args));break;case"addSource":ht.push(()=>this.addSource.apply(this,It.args));break;case"removeSource":ht.push(()=>this.removeSource.apply(this,It.args));break;case"setLayerZoomRange":ht.push(()=>this.setLayerZoomRange.apply(this,It.args));break;case"setLight":ht.push(()=>this.setLight.apply(this,It.args));break;case"setGeoJSONSourceData":ht.push(()=>this.setGeoJSONSourceData.apply(this,It.args));break;case"setGlyphs":ht.push(()=>this.setGlyphs.apply(this,It.args));break;case"setSprite":ht.push(()=>this.setSprite.apply(this,It.args));break;case"setSky":ht.push(()=>this.setSky.apply(this,It.args));break;case"setTerrain":ht.push(()=>this.map.setTerrain.apply(this,It.args));break;case"setTransition":ht.push(()=>{});break;default:Et.push(It.command)}return{operations:ht,unimplemented:Et}}addImage(I,ht){if(this.getImage(I))return this.fire(new e.j(new Error(`An image named "${I}" already exists.`)));this.imageManager.addImage(I,ht),this._afterImageUpdated(I)}updateImage(I,ht){this.imageManager.updateImage(I,ht)}getImage(I){return this.imageManager.getImage(I)}removeImage(I){if(!this.getImage(I))return this.fire(new e.j(new Error(`An image named "${I}" does not exist.`)));this.imageManager.removeImage(I),this._afterImageUpdated(I)}_afterImageUpdated(I){this._availableImages=this.imageManager.listImages(),this._changedImages[I]=!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(I,ht,Et={}){if(this._checkLoaded(),this.sourceCaches[I]!==void 0)throw new Error(`Source "${I}" already exists.`);if(!ht.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(ht).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(ht.type)>=0&&this._validate(e.u.source,`sources.${I}`,ht,null,Et))return;this.map&&this.map._collectResourceTiming&&(ht.collectResourceTiming=!0);let It=this.sourceCaches[I]=new Ge(I,ht,this.dispatcher);It.style=this,It.setEventedParent(this,()=>({isSourceLoaded:It.loaded(),source:It.serialize(),sourceId:I})),It.onAdd(this.map),this._changed=!0}removeSource(I){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error("There is no source with this ID");for(let Et in this._layers)if(this._layers[Et].source===I)return this.fire(new e.j(new Error(`Source "${I}" cannot be removed while layer "${Et}" is using it.`)));let ht=this.sourceCaches[I];delete this.sourceCaches[I],delete this._updatedSources[I],ht.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:I})),ht.setEventedParent(null),ht.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(I,ht){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error(`There is no source with this ID=${I}`);let Et=this.sourceCaches[I].getSource();if(Et.type!=="geojson")throw new Error(`geojsonSource.type is ${Et.type}, which is !== 'geojson`);Et.setData(ht),this._changed=!0}getSource(I){return this.sourceCaches[I]&&this.sourceCaches[I].getSource()}addLayer(I,ht,Et={}){this._checkLoaded();let It=I.id;if(this.getLayer(It))return void this.fire(new e.j(new Error(`Layer "${It}" already exists on this map.`)));let Vt;if(I.type==="custom"){if($r(this,e.aD(I)))return;Vt=e.aA(I)}else{if("source"in I&&typeof I.source=="object"&&(this.addSource(It,I.source),I=e.aB(I),I=e.e(I,{source:It})),this._validate(e.u.layer,`layers.${It}`,I,{arrayIndex:-1},Et))return;Vt=e.aA(I),this._validateLayer(Vt),Vt.setEventedParent(this,{layer:{id:It}})}let ke=ht?this._order.indexOf(ht):this._order.length;if(ht&&ke===-1)this.fire(new e.j(new Error(`Cannot add layer "${It}" before non-existing layer "${ht}".`)));else{if(this._order.splice(ke,0,It),this._layerOrderChanged=!0,this._layers[It]=Vt,this._removedLayers[It]&&Vt.source&&Vt.type!=="custom"){let Oe=this._removedLayers[It];delete this._removedLayers[It],Oe.type!==Vt.type?this._updatedSources[Vt.source]="clear":(this._updatedSources[Vt.source]="reload",this.sourceCaches[Vt.source].pause())}this._updateLayer(Vt),Vt.onAdd&&Vt.onAdd(this.map)}}moveLayer(I,ht){if(this._checkLoaded(),this._changed=!0,!this._layers[I])return void this.fire(new e.j(new Error(`The layer '${I}' does not exist in the map's style and cannot be moved.`)));if(I===ht)return;let Et=this._order.indexOf(I);this._order.splice(Et,1);let It=ht?this._order.indexOf(ht):this._order.length;ht&&It===-1?this.fire(new e.j(new Error(`Cannot move layer "${I}" before non-existing layer "${ht}".`))):(this._order.splice(It,0,I),this._layerOrderChanged=!0)}removeLayer(I){this._checkLoaded();let ht=this._layers[I];if(!ht)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${I}".`)));ht.setEventedParent(null);let Et=this._order.indexOf(I);this._order.splice(Et,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[I]=ht,delete this._layers[I],this._serializedLayers&&delete this._serializedLayers[I],delete this._updatedLayers[I],delete this._updatedPaintProps[I],ht.onRemove&&ht.onRemove(this.map)}getLayer(I){return this._layers[I]}getLayersOrder(){return[...this._order]}hasLayer(I){return I in this._layers}setLayerZoomRange(I,ht,Et){this._checkLoaded();let It=this.getLayer(I);It?It.minzoom===ht&&It.maxzoom===Et||(ht!=null&&(It.minzoom=ht),Et!=null&&(It.maxzoom=Et),this._updateLayer(It)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${I}".`)))}setFilter(I,ht,Et={}){this._checkLoaded();let It=this.getLayer(I);if(It){if(!e.aE(It.filter,ht))return ht==null?(It.filter=void 0,void this._updateLayer(It)):void(this._validate(e.u.filter,`layers.${It.id}.filter`,ht,null,Et)||(It.filter=e.aB(ht),this._updateLayer(It)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${I}".`)))}getFilter(I){return e.aB(this.getLayer(I).filter)}setLayoutProperty(I,ht,Et,It={}){this._checkLoaded();let Vt=this.getLayer(I);Vt?e.aE(Vt.getLayoutProperty(ht),Et)||(Vt.setLayoutProperty(ht,Et,It),this._updateLayer(Vt)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${I}".`)))}getLayoutProperty(I,ht){let Et=this.getLayer(I);if(Et)return Et.getLayoutProperty(ht);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${I}".`)))}setPaintProperty(I,ht,Et,It={}){this._checkLoaded();let Vt=this.getLayer(I);Vt?e.aE(Vt.getPaintProperty(ht),Et)||(Vt.setPaintProperty(ht,Et,It)&&this._updateLayer(Vt),this._changed=!0,this._updatedPaintProps[I]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${I}".`)))}getPaintProperty(I,ht){return this.getLayer(I).getPaintProperty(ht)}setFeatureState(I,ht){this._checkLoaded();let Et=I.source,It=I.sourceLayer,Vt=this.sourceCaches[Et];if(Vt===void 0)return void this.fire(new e.j(new Error(`The source '${Et}' does not exist in the map's style.`)));let ke=Vt.getSource().type;ke==="geojson"&&It?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):ke!=="vector"||It?(I.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),Vt.setFeatureState(It,I.id,ht)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(I,ht){this._checkLoaded();let Et=I.source,It=this.sourceCaches[Et];if(It===void 0)return void this.fire(new e.j(new Error(`The source '${Et}' does not exist in the map's style.`)));let Vt=It.getSource().type,ke=Vt==="vector"?I.sourceLayer:void 0;Vt!=="vector"||ke?ht&&typeof I.id!="string"&&typeof I.id!="number"?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):It.removeFeatureState(ke,I.id,ht):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(I){this._checkLoaded();let ht=I.source,Et=I.sourceLayer,It=this.sourceCaches[ht];if(It!==void 0)return It.getSource().type!=="vector"||Et?(I.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),It.getFeatureState(Et,I.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 '${ht}' 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 I=e.aF(this.sourceCaches,Vt=>Vt.serialize()),ht=this._serializeByIds(this._order,!0),Et=this.map.getTerrain()||void 0,It=this.stylesheet;return e.aG({version:It.version,name:It.name,metadata:It.metadata,light:It.light,sky:It.sky,center:It.center,zoom:It.zoom,bearing:It.bearing,pitch:It.pitch,sprite:It.sprite,glyphs:It.glyphs,transition:It.transition,sources:I,layers:ht,terrain:Et},Vt=>Vt!==void 0)}_updateLayer(I){this._updatedLayers[I.id]=!0,I.source&&!this._updatedSources[I.source]&&this.sourceCaches[I.source].getSource().type!=="raster"&&(this._updatedSources[I.source]="reload",this.sourceCaches[I.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(I){let ht=ke=>this._layers[ke].type==="fill-extrusion",Et={},It=[];for(let ke=this._order.length-1;ke>=0;ke--){let Oe=this._order[ke];if(ht(Oe)){Et[Oe]=ke;for(let Ke of I){let gr=Ke[Oe];if(gr)for(let Or of gr)It.push(Or)}}}It.sort((ke,Oe)=>Oe.intersectionZ-ke.intersectionZ);let Vt=[];for(let ke=this._order.length-1;ke>=0;ke--){let Oe=this._order[ke];if(ht(Oe))for(let Ke=It.length-1;Ke>=0;Ke--){let gr=It[Ke].feature;if(Et[gr.layer.id]<ke)break;Vt.push(gr),It.pop()}else for(let Ke of I){let gr=Ke[Oe];if(gr)for(let Or of gr)Vt.push(Or.feature)}}return Vt}queryRenderedFeatures(I,ht,Et){ht&&ht.filter&&this._validate(e.u.filter,"queryRenderedFeatures.filter",ht.filter,null,ht);let It={};if(ht&&ht.layers){if(!Array.isArray(ht.layers))return this.fire(new e.j(new Error("parameters.layers must be an Array."))),[];for(let Oe of ht.layers){let Ke=this._layers[Oe];if(!Ke)return this.fire(new e.j(new Error(`The layer '${Oe}' does not exist in the map's style and cannot be queried for features.`))),[];It[Ke.source]=!0}}let Vt=[];ht.availableImages=this._availableImages;let ke=this._serializedAllLayers();for(let Oe in this.sourceCaches)ht.layers&&!It[Oe]||Vt.push(it(this.sourceCaches[Oe],this._layers,ke,I,ht,Et));return this.placement&&Vt.push(function(Oe,Ke,gr,Or,Dr,ln,Sn){let Xt={},ae=ln.queryRenderedSymbols(Or),xe=[];for(let Ae of Object.keys(ae).map(Number))xe.push(Sn[Ae]);xe.sort(Y);for(let Ae of xe){let je=Ae.featureIndex.lookupSymbolFeatures(ae[Ae.bucketInstanceId],Ke,Ae.bucketIndex,Ae.sourceLayerIndex,Dr.filter,Dr.layers,Dr.availableImages,Oe);for(let Ie in je){let Ze=Xt[Ie]=Xt[Ie]||[],wr=je[Ie];wr.sort((Ir,Nr)=>{let tn=Ae.featureSortOrder;if(tn){let mn=tn.indexOf(Ir.featureIndex);return tn.indexOf(Nr.featureIndex)-mn}return Nr.featureIndex-Ir.featureIndex});for(let Ir of wr)Ze.push(Ir)}}for(let Ae in Xt)Xt[Ae].forEach(je=>{let Ie=je.feature,Ze=gr[Oe[Ae].source].getFeatureState(Ie.layer["source-layer"],Ie.id);Ie.source=Ie.layer.source,Ie.layer["source-layer"]&&(Ie.sourceLayer=Ie.layer["source-layer"]),Ie.state=Ze});return Xt}(this._layers,ke,this.sourceCaches,I,ht,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Vt)}querySourceFeatures(I,ht){ht&&ht.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",ht.filter,null,ht);let Et=this.sourceCaches[I];return Et?function(It,Vt){let ke=It.getRenderableIds().map(gr=>It.getTileByID(gr)),Oe=[],Ke={};for(let gr=0;gr<ke.length;gr++){let Or=ke[gr],Dr=Or.tileID.canonical.key;Ke[Dr]||(Ke[Dr]=!0,Or.querySourceFeatures(Oe,Vt))}return Oe}(Et,ht):[]}getLight(){return this.light.getLight()}setLight(I,ht={}){this._checkLoaded();let Et=this.light.getLight(),It=!1;for(let ke in I)if(!e.aE(I[ke],Et[ke])){It=!0;break}if(!It)return;let Vt={now:o.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(I,ht),this.light.updateTransitions(Vt)}getSky(){var I;return(I=this.stylesheet)===null||I===void 0?void 0:I.sky}setSky(I,ht={}){let Et=this.getSky(),It=!1;if(!I&&!Et)return;if(I&&!Et)It=!0;else if(!I&&Et)It=!0;else for(let ke in I)if(!e.aE(I[ke],Et[ke])){It=!0;break}if(!It)return;let Vt={now:o.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=I,this.sky.setSky(I,ht),this.sky.updateTransitions(Vt)}_validate(I,ht,Et,It,Vt={}){return(!Vt||Vt.validate!==!1)&&$r(this,I.call(e.u,e.e({key:ht,style:this.serialize(),value:Et,styleSpec:e.v},It)))}_remove(I=!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),ve().off(Lt,this._rtlPluginLoaded);for(let ht in this._layers)this._layers[ht].setEventedParent(null);for(let ht in this.sourceCaches){let Et=this.sourceCaches[ht];Et.setEventedParent(null),Et.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),I&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(I)}_clearSource(I){this.sourceCaches[I].clearTiles()}_reloadSource(I){this.sourceCaches[I].resume(),this.sourceCaches[I].reload()}_updateSources(I){for(let ht in this.sourceCaches)this.sourceCaches[ht].update(I,this.map.terrain)}_generateCollisionBoxes(){for(let I in this.sourceCaches)this._reloadSource(I)}_updatePlacement(I,ht,Et,It,Vt=!1){let ke=!1,Oe=!1,Ke={};for(let gr of this._order){let Or=this._layers[gr];if(Or.type!=="symbol")continue;if(!Ke[Or.source]){let ln=this.sourceCaches[Or.source];Ke[Or.source]=ln.getRenderableIds(!0).map(Sn=>ln.getTileByID(Sn)).sort((Sn,Xt)=>Xt.tileID.overscaledZ-Sn.tileID.overscaledZ||(Sn.tileID.isLessThan(Xt.tileID)?-1:1))}let Dr=this.crossTileSymbolIndex.addLayer(Or,Ke[Or.source],I.center.lng);ke=ke||Dr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Vt=Vt||this._layerOrderChanged||Et===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.now(),I.zoom))&&(this.pauseablePlacement=new Pa(I,this.map.terrain,this._order,Vt,ht,Et,It,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Ke),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.now()),Oe=!0),ke&&this.pauseablePlacement.placement.setStale()),Oe||ke)for(let gr of this._order){let Or=this._layers[gr];Or.type==="symbol"&&this.placement.updateLayerOpacities(Or,Ke[Or.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.now())}_releaseSymbolFadeTiles(){for(let I in this.sourceCaches)this.sourceCaches[I].releaseSymbolFadeTiles()}getImages(I,ht){return e._(this,void 0,void 0,function*(){let Et=yield this.imageManager.getImages(ht.icons);this._updateTilesForChangedImages();let It=this.sourceCaches[ht.source];return It&&It.setDependencies(ht.tileID.key,ht.type,ht.icons),Et})}getGlyphs(I,ht){return e._(this,void 0,void 0,function*(){let Et=yield this.glyphManager.getGlyphs(ht.stacks),It=this.sourceCaches[ht.source];return It&&It.setDependencies(ht.tileID.key,ht.type,[""]),Et})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(I,ht={}){this._checkLoaded(),I&&this._validate(e.u.glyphs,"glyphs",I,null,ht)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=I,this.glyphManager.entries={},this.glyphManager.setURL(I))}addSprite(I,ht,Et={},It){this._checkLoaded();let Vt=[{id:I,url:ht}],ke=[...A(this.stylesheet.sprite),...Vt];this._validate(e.u.sprite,"sprite",ke,null,Et)||(this.stylesheet.sprite=ke,this._loadSprite(Vt,!0,It))}removeSprite(I){this._checkLoaded();let ht=A(this.stylesheet.sprite);if(ht.find(Et=>Et.id===I)){if(this._spritesImagesIds[I])for(let Et of this._spritesImagesIds[I])this.imageManager.removeImage(Et),this._changedImages[Et]=!0;ht.splice(ht.findIndex(Et=>Et.id===I),1),this.stylesheet.sprite=ht.length>0?ht:void 0,delete this._spritesImagesIds[I],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 "${I}" doesn't exists on this map.`)))}getSprite(){return A(this.stylesheet.sprite)}setSprite(I,ht={},Et){this._checkLoaded(),I&&this._validate(e.u.sprite,"sprite",I,null,ht)||(this.stylesheet.sprite=I,I?this._loadSprite(I,!0,Et):(this._unloadSprite(),Et&&Et(null)))}}var dn=e.Y([{name:"a_pos",type:"Int16",components:2}]);let an={prelude:Ee(`#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:Ee(`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:Ee(`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:Ee(`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:Ee("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:Ee(`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:Ee(`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:Ee("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:Ee("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:Ee("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:Ee(`#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:Ee(`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:Ee(`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:Ee(`#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:Ee(`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:Ee(`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:Ee(`#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:Ee(`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:Ee(`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:Ee(`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:Ee(`#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:Ee(`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:Ee(`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:Ee(`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:Ee(`#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:Ee(`#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:Ee("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:Ee("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:Ee("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:Ee("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 Ee(qt,I){let ht=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Et=I.match(/attribute ([\w]+) ([\w]+)/g),It=qt.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Vt=I.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ke=Vt?Vt.concat(It):It,Oe={};return{fragmentSource:qt=qt.replace(ht,(Ke,gr,Or,Dr,ln)=>(Oe[ln]=!0,gr==="define"?`
#ifndef HAS_UNIFORM_u_${ln}
varying ${Or} ${Dr} ${ln};
#else
uniform ${Or} ${Dr} u_${ln};
#endif
`:`
#ifdef HAS_UNIFORM_u_${ln}
${Or} ${Dr} ${ln} = u_${ln};
#endif
`)),vertexSource:I=I.replace(ht,(Ke,gr,Or,Dr,ln)=>{let Sn=Dr==="float"?"vec2":"vec4",Xt=ln.match(/color/)?"color":Sn;return Oe[ln]?gr==="define"?`
#ifndef HAS_UNIFORM_u_${ln}
uniform lowp float u_${ln}_t;
attribute ${Or} ${Sn} a_${ln};
varying ${Or} ${Dr} ${ln};
#else
uniform ${Or} ${Dr} u_${ln};
#endif
`:Xt==="vec4"?`
#ifndef HAS_UNIFORM_u_${ln}
${ln} = a_${ln};
#else
${Or} ${Dr} ${ln} = u_${ln};
#endif
`:`
#ifndef HAS_UNIFORM_u_${ln}
${ln} = unpack_mix_${Xt}(a_${ln}, u_${ln}_t);
#else
${Or} ${Dr} ${ln} = u_${ln};
#endif
`:gr==="define"?`
#ifndef HAS_UNIFORM_u_${ln}
uniform lowp float u_${ln}_t;
attribute ${Or} ${Sn} a_${ln};
#else
uniform ${Or} ${Dr} u_${ln};
#endif
`:Xt==="vec4"?`
#ifndef HAS_UNIFORM_u_${ln}
${Or} ${Dr} ${ln} = a_${ln};
#else
${Or} ${Dr} ${ln} = u_${ln};
#endif
`:`
#ifndef HAS_UNIFORM_u_${ln}
${Or} ${Dr} ${ln} = unpack_mix_${Xt}(a_${ln}, u_${ln}_t);
#else
${Or} ${Dr} ${ln} = u_${ln};
#endif
`}),staticAttributes:Et,staticUniforms:ke}}class dr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(I,ht,Et,It,Vt,ke,Oe,Ke,gr){this.context=I;let Or=this.boundPaintVertexBuffers.length!==It.length;for(let Dr=0;!Or&&Dr<It.length;Dr++)this.boundPaintVertexBuffers[Dr]!==It[Dr]&&(Or=!0);!this.vao||this.boundProgram!==ht||this.boundLayoutVertexBuffer!==Et||Or||this.boundIndexBuffer!==Vt||this.boundVertexOffset!==ke||this.boundDynamicVertexBuffer!==Oe||this.boundDynamicVertexBuffer2!==Ke||this.boundDynamicVertexBuffer3!==gr?this.freshBind(ht,Et,It,Vt,ke,Oe,Ke,gr):(I.bindVertexArray.set(this.vao),Oe&&Oe.bind(),Vt&&Vt.dynamicDraw&&Vt.bind(),Ke&&Ke.bind(),gr&&gr.bind())}freshBind(I,ht,Et,It,Vt,ke,Oe,Ke){let gr=I.numAttributes,Or=this.context,Dr=Or.gl;this.vao&&this.destroy(),this.vao=Or.createVertexArray(),Or.bindVertexArray.set(this.vao),this.boundProgram=I,this.boundLayoutVertexBuffer=ht,this.boundPaintVertexBuffers=Et,this.boundIndexBuffer=It,this.boundVertexOffset=Vt,this.boundDynamicVertexBuffer=ke,this.boundDynamicVertexBuffer2=Oe,this.boundDynamicVertexBuffer3=Ke,ht.enableAttributes(Dr,I);for(let ln of Et)ln.enableAttributes(Dr,I);ke&&ke.enableAttributes(Dr,I),Oe&&Oe.enableAttributes(Dr,I),Ke&&Ke.enableAttributes(Dr,I),ht.bind(),ht.setVertexAttribPointers(Dr,I,Vt);for(let ln of Et)ln.bind(),ln.setVertexAttribPointers(Dr,I,Vt);ke&&(ke.bind(),ke.setVertexAttribPointers(Dr,I,Vt)),It&&It.bind(),Oe&&(Oe.bind(),Oe.setVertexAttribPointers(Dr,I,Vt)),Ke&&(Ke.bind(),Ke.setVertexAttribPointers(Dr,I,Vt)),Or.currentNumAttributes=gr}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let Vr=(qt,I,ht,Et,It)=>({u_matrix:qt,u_texture:0,u_ele_delta:I,u_fog_matrix:ht,u_fog_color:Et?Et.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:Et?Et.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Et?Et.calculateFogBlendOpacity(It):0,u_horizon_color:Et?Et.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:Et?Et.properties.get("horizon-fog-blend"):1});function yn(qt){let I=[];for(let ht=0;ht<qt.length;ht++){if(qt[ht]===null)continue;let Et=qt[ht].split(" ");I.push(Et.pop())}return I}class Fn{constructor(I,ht,Et,It,Vt,ke){let Oe=I.gl;this.program=Oe.createProgram();let Ke=yn(ht.staticAttributes),gr=Et?Et.getBinderAttributes():[],Or=Ke.concat(gr),Dr=an.prelude.staticUniforms?yn(an.prelude.staticUniforms):[],ln=ht.staticUniforms?yn(ht.staticUniforms):[],Sn=Et?Et.getBinderUniforms():[],Xt=Dr.concat(ln).concat(Sn),ae=[];for(let Ir of Xt)ae.indexOf(Ir)<0&&ae.push(Ir);let xe=Et?Et.defines():[];Vt&&xe.push("#define OVERDRAW_INSPECTOR;"),ke&&xe.push("#define TERRAIN3D;");let Ae=xe.concat(an.prelude.fragmentSource,ht.fragmentSource).join(`
`),je=xe.concat(an.prelude.vertexSource,ht.vertexSource).join(`
`),Ie=Oe.createShader(Oe.FRAGMENT_SHADER);if(Oe.isContextLost())return void(this.failedToCreate=!0);if(Oe.shaderSource(Ie,Ae),Oe.compileShader(Ie),!Oe.getShaderParameter(Ie,Oe.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${Oe.getShaderInfoLog(Ie)}`);Oe.attachShader(this.program,Ie);let Ze=Oe.createShader(Oe.VERTEX_SHADER);if(Oe.isContextLost())return void(this.failedToCreate=!0);if(Oe.shaderSource(Ze,je),Oe.compileShader(Ze),!Oe.getShaderParameter(Ze,Oe.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${Oe.getShaderInfoLog(Ze)}`);Oe.attachShader(this.program,Ze),this.attributes={};let wr={};this.numAttributes=Or.length;for(let Ir=0;Ir<this.numAttributes;Ir++)Or[Ir]&&(Oe.bindAttribLocation(this.program,Ir,Or[Ir]),this.attributes[Or[Ir]]=Ir);if(Oe.linkProgram(this.program),!Oe.getProgramParameter(this.program,Oe.LINK_STATUS))throw new Error(`Program failed to link: ${Oe.getProgramInfoLog(this.program)}`);Oe.deleteShader(Ze),Oe.deleteShader(Ie);for(let Ir=0;Ir<ae.length;Ir++){let Nr=ae[Ir];if(Nr&&!wr[Nr]){let tn=Oe.getUniformLocation(this.program,Nr);tn&&(wr[Nr]=tn)}}this.fixedUniforms=It(I,wr),this.terrainUniforms=((Ir,Nr)=>({u_depth:new e.aH(Ir,Nr.u_depth),u_terrain:new e.aH(Ir,Nr.u_terrain),u_terrain_dim:new e.aI(Ir,Nr.u_terrain_dim),u_terrain_matrix:new e.aJ(Ir,Nr.u_terrain_matrix),u_terrain_unpack:new e.aK(Ir,Nr.u_terrain_unpack),u_terrain_exaggeration:new e.aI(Ir,Nr.u_terrain_exaggeration)}))(I,wr),this.binderUniforms=Et?Et.getUniforms(I,wr):[]}draw(I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr,ln,Sn,Xt,ae,xe,Ae,je){let Ie=I.gl;if(this.failedToCreate)return;if(I.program.set(this.program),I.setDepthMode(Et),I.setStencilMode(It),I.setColorMode(Vt),I.setCullFace(ke),Ke){I.activeTexture.set(Ie.TEXTURE2),Ie.bindTexture(Ie.TEXTURE_2D,Ke.depthTexture),I.activeTexture.set(Ie.TEXTURE3),Ie.bindTexture(Ie.TEXTURE_2D,Ke.texture);for(let wr in this.terrainUniforms)this.terrainUniforms[wr].set(Ke[wr])}for(let wr in this.fixedUniforms)this.fixedUniforms[wr].set(Oe[wr]);ae&&ae.setUniforms(I,this.binderUniforms,Sn,{zoom:Xt});let Ze=0;switch(ht){case Ie.LINES:Ze=2;break;case Ie.TRIANGLES:Ze=3;break;case Ie.LINE_STRIP:Ze=1}for(let wr of ln.get()){let Ir=wr.vaos||(wr.vaos={});(Ir[gr]||(Ir[gr]=new dr)).bind(I,this,Or,ae?ae.getPaintVertexBuffers():[],Dr,wr.vertexOffset,xe,Ae,je),Ie.drawElements(ht,wr.primitiveLength*Ze,Ie.UNSIGNED_SHORT,wr.primitiveOffset*Ze*2)}}}function Xn(qt,I,ht){let Et=1/Hn(ht,1,I.transform.tileZoom),It=Math.pow(2,ht.tileID.overscaledZ),Vt=ht.tileSize*Math.pow(2,I.transform.tileZoom)/It,ke=Vt*(ht.tileID.canonical.x+ht.tileID.wrap*It),Oe=Vt*ht.tileID.canonical.y;return{u_image:0,u_texsize:ht.imageAtlasTexture.size,u_scale:[Et,qt.fromScale,qt.toScale],u_fade:qt.t,u_pixel_coord_upper:[ke>>16,Oe>>16],u_pixel_coord_lower:[65535&ke,65535&Oe]}}let Pn=(qt,I,ht,Et)=>{let It=I.style.light,Vt=It.properties.get("position"),ke=[Vt.x,Vt.y,Vt.z],Oe=function(){var gr=new e.A(9);return e.A!=Float32Array&&(gr[1]=0,gr[2]=0,gr[3]=0,gr[5]=0,gr[6]=0,gr[7]=0),gr[0]=1,gr[4]=1,gr[8]=1,gr}();It.properties.get("anchor")==="viewport"&&function(gr,Or){var Dr=Math.sin(Or),ln=Math.cos(Or);gr[0]=ln,gr[1]=Dr,gr[2]=0,gr[3]=-Dr,gr[4]=ln,gr[5]=0,gr[6]=0,gr[7]=0,gr[8]=1}(Oe,-I.transform.angle),function(gr,Or,Dr){var ln=Or[0],Sn=Or[1],Xt=Or[2];gr[0]=ln*Dr[0]+Sn*Dr[3]+Xt*Dr[6],gr[1]=ln*Dr[1]+Sn*Dr[4]+Xt*Dr[7],gr[2]=ln*Dr[2]+Sn*Dr[5]+Xt*Dr[8]}(ke,ke,Oe);let Ke=It.properties.get("color");return{u_matrix:qt,u_lightpos:ke,u_lightintensity:It.properties.get("intensity"),u_lightcolor:[Ke.r,Ke.g,Ke.b],u_vertical_gradient:+ht,u_opacity:Et}},En=(qt,I,ht,Et,It,Vt,ke)=>e.e(Pn(qt,I,ht,Et),Xn(Vt,I,ke),{u_height_factor:-Math.pow(2,It.overscaledZ)/ke.tileSize/8}),Zn=qt=>({u_matrix:qt}),Ca=(qt,I,ht,Et)=>e.e(Zn(qt),Xn(ht,I,Et)),Ri=(qt,I)=>({u_matrix:qt,u_world:I}),Ja=(qt,I,ht,Et,It)=>e.e(Ca(qt,I,ht,Et),{u_world:It}),Xa=(qt,I,ht,Et)=>{let It=qt.transform,Vt,ke;if(Et.paint.get("circle-pitch-alignment")==="map"){let Oe=Hn(ht,1,It.zoom);Vt=!0,ke=[Oe,Oe]}else Vt=!1,ke=It.pixelsToGLUnits;return{u_camera_to_center_distance:It.cameraToCenterDistance,u_scale_with_map:+(Et.paint.get("circle-pitch-scale")==="map"),u_matrix:qt.translatePosMatrix(I.posMatrix,ht,Et.paint.get("circle-translate"),Et.paint.get("circle-translate-anchor")),u_pitch_with_map:+Vt,u_device_pixel_ratio:qt.pixelRatio,u_extrude_scale:ke}},Io=(qt,I,ht)=>({u_matrix:qt,u_inv_matrix:I,u_camera_to_center_distance:ht.cameraToCenterDistance,u_viewport_size:[ht.width,ht.height]}),po=(qt,I,ht=1)=>({u_matrix:qt,u_color:I,u_overlay:0,u_overlay_scale:ht}),Do=qt=>({u_matrix:qt}),Ia=(qt,I,ht,Et)=>({u_matrix:qt,u_extrude_scale:Hn(I,1,ht),u_intensity:Et}),gs=(qt,I,ht,Et)=>{let It=e.H();e.aP(It,0,qt.width,qt.height,0,0,1);let Vt=qt.context.gl;return{u_matrix:It,u_world:[Vt.drawingBufferWidth,Vt.drawingBufferHeight],u_image:ht,u_color_ramp:Et,u_opacity:I.paint.get("heatmap-opacity")}};function is(qt,I){let ht=Math.pow(2,I.canonical.z),Et=I.canonical.y;return[new e.Z(0,Et/ht).toLngLat().lat,new e.Z(0,(Et+1)/ht).toLngLat().lat]}let ll=(qt,I,ht,Et)=>{let It=qt.transform;return{u_matrix:Js(qt,I,ht,Et),u_ratio:1/Hn(I,1,It.zoom),u_device_pixel_ratio:qt.pixelRatio,u_units_to_pixels:[1/It.pixelsToGLUnits[0],1/It.pixelsToGLUnits[1]]}},Ho=(qt,I,ht,Et,It)=>e.e(ll(qt,I,ht,It),{u_image:0,u_image_height:Et}),Gs=(qt,I,ht,Et,It)=>{let Vt=qt.transform,ke=ul(I,Vt);return{u_matrix:Js(qt,I,ht,It),u_texsize:I.imageAtlasTexture.size,u_ratio:1/Hn(I,1,Vt.zoom),u_device_pixel_ratio:qt.pixelRatio,u_image:0,u_scale:[ke,Et.fromScale,Et.toScale],u_fade:Et.t,u_units_to_pixels:[1/Vt.pixelsToGLUnits[0],1/Vt.pixelsToGLUnits[1]]}},as=(qt,I,ht,Et,It,Vt)=>{let ke=qt.lineAtlas,Oe=ul(I,qt.transform),Ke=ht.layout.get("line-cap")==="round",gr=ke.getDash(Et.from,Ke),Or=ke.getDash(Et.to,Ke),Dr=gr.width*It.fromScale,ln=Or.width*It.toScale;return e.e(ll(qt,I,ht,Vt),{u_patternscale_a:[Oe/Dr,-gr.height/2],u_patternscale_b:[Oe/ln,-Or.height/2],u_sdfgamma:ke.width/(256*Math.min(Dr,ln)*qt.pixelRatio)/2,u_image:0,u_tex_y_a:gr.y,u_tex_y_b:Or.y,u_mix:It.t})};function ul(qt,I){return 1/Hn(qt,1,I.tileZoom)}function Js(qt,I,ht,Et){return qt.translatePosMatrix(Et?Et.posMatrix:I.tileID.posMatrix,I,ht.paint.get("line-translate"),ht.paint.get("line-translate-anchor"))}let Rl=(qt,I,ht,Et,It)=>{return{u_matrix:qt,u_tl_parent:I,u_scale_parent:ht,u_buffer_scale:1,u_fade_t:Et.mix,u_opacity:Et.opacity*It.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:It.paint.get("raster-brightness-min"),u_brightness_high:It.paint.get("raster-brightness-max"),u_saturation_factor:(ke=It.paint.get("raster-saturation"),ke>0?1-1/(1.001-ke):-ke),u_contrast_factor:(Vt=It.paint.get("raster-contrast"),Vt>0?1/(1-Vt):1+Vt),u_spin_weights:ls(It.paint.get("raster-hue-rotate"))};var Vt,ke};function ls(qt){qt*=Math.PI/180;let I=Math.sin(qt),ht=Math.cos(qt);return[(2*ht+1)/3,(-Math.sqrt(3)*I-ht+1)/3,(Math.sqrt(3)*I-ht+1)/3]}let Cs=(qt,I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr,ln,Sn)=>{let Xt=ke.transform;return{u_is_size_zoom_constant:+(qt==="constant"||qt==="source"),u_is_size_feature_constant:+(qt==="constant"||qt==="camera"),u_size_t:I?I.uSizeT:0,u_size:I?I.uSize:0,u_camera_to_center_distance:Xt.cameraToCenterDistance,u_pitch:Xt.pitch/360*2*Math.PI,u_rotate_symbol:+ht,u_aspect_ratio:Xt.width/Xt.height,u_fade_change:ke.options.fadeDuration?ke.symbolFadeChange:1,u_matrix:Oe,u_label_plane_matrix:Ke,u_coord_matrix:gr,u_is_text:+Dr,u_pitch_with_map:+Et,u_is_along_line:It,u_is_variable_anchor:Vt,u_texsize:ln,u_texture:0,u_translation:Or,u_pitched_scale:Sn}},Co=(qt,I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr,ln,Sn,Xt)=>{let ae=ke.transform;return e.e(Cs(qt,I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr,ln,Xt),{u_gamma_scale:Et?Math.cos(ae._pitch)*ae.cameraToCenterDistance:1,u_device_pixel_ratio:ke.pixelRatio,u_is_halo:1})},ks=(qt,I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr,ln,Sn)=>e.e(Co(qt,I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,!0,Dr,!0,Sn),{u_texsize_icon:ln,u_texture_icon:1}),kl=(qt,I,ht)=>({u_matrix:qt,u_opacity:I,u_color:ht}),Vl=(qt,I,ht,Et,It,Vt)=>e.e(function(ke,Oe,Ke,gr){let Or=Ke.imageManager.getPattern(ke.from.toString()),Dr=Ke.imageManager.getPattern(ke.to.toString()),{width:ln,height:Sn}=Ke.imageManager.getPixelSize(),Xt=Math.pow(2,gr.tileID.overscaledZ),ae=gr.tileSize*Math.pow(2,Ke.transform.tileZoom)/Xt,xe=ae*(gr.tileID.canonical.x+gr.tileID.wrap*Xt),Ae=ae*gr.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Or.tl,u_pattern_br_a:Or.br,u_pattern_tl_b:Dr.tl,u_pattern_br_b:Dr.br,u_texsize:[ln,Sn],u_mix:Oe.t,u_pattern_size_a:Or.displaySize,u_pattern_size_b:Dr.displaySize,u_scale_a:Oe.fromScale,u_scale_b:Oe.toScale,u_tile_units_to_pixels:1/Hn(gr,1,Ke.transform.tileZoom),u_pixel_coord_upper:[xe>>16,Ae>>16],u_pixel_coord_lower:[65535&xe,65535&Ae]}}(Et,Vt,ht,It),{u_matrix:qt,u_opacity:I}),Yl={fillExtrusion:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_lightpos:new e.aN(qt,I.u_lightpos),u_lightintensity:new e.aI(qt,I.u_lightintensity),u_lightcolor:new e.aN(qt,I.u_lightcolor),u_vertical_gradient:new e.aI(qt,I.u_vertical_gradient),u_opacity:new e.aI(qt,I.u_opacity)}),fillExtrusionPattern:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_lightpos:new e.aN(qt,I.u_lightpos),u_lightintensity:new e.aI(qt,I.u_lightintensity),u_lightcolor:new e.aN(qt,I.u_lightcolor),u_vertical_gradient:new e.aI(qt,I.u_vertical_gradient),u_height_factor:new e.aI(qt,I.u_height_factor),u_image:new e.aH(qt,I.u_image),u_texsize:new e.aO(qt,I.u_texsize),u_pixel_coord_upper:new e.aO(qt,I.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(qt,I.u_pixel_coord_lower),u_scale:new e.aN(qt,I.u_scale),u_fade:new e.aI(qt,I.u_fade),u_opacity:new e.aI(qt,I.u_opacity)}),fill:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix)}),fillPattern:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_image:new e.aH(qt,I.u_image),u_texsize:new e.aO(qt,I.u_texsize),u_pixel_coord_upper:new e.aO(qt,I.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(qt,I.u_pixel_coord_lower),u_scale:new e.aN(qt,I.u_scale),u_fade:new e.aI(qt,I.u_fade)}),fillOutline:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_world:new e.aO(qt,I.u_world)}),fillOutlinePattern:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_world:new e.aO(qt,I.u_world),u_image:new e.aH(qt,I.u_image),u_texsize:new e.aO(qt,I.u_texsize),u_pixel_coord_upper:new e.aO(qt,I.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(qt,I.u_pixel_coord_lower),u_scale:new e.aN(qt,I.u_scale),u_fade:new e.aI(qt,I.u_fade)}),circle:(qt,I)=>({u_camera_to_center_distance:new e.aI(qt,I.u_camera_to_center_distance),u_scale_with_map:new e.aH(qt,I.u_scale_with_map),u_pitch_with_map:new e.aH(qt,I.u_pitch_with_map),u_extrude_scale:new e.aO(qt,I.u_extrude_scale),u_device_pixel_ratio:new e.aI(qt,I.u_device_pixel_ratio),u_matrix:new e.aJ(qt,I.u_matrix)}),collisionBox:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_pixel_extrude_scale:new e.aO(qt,I.u_pixel_extrude_scale)}),collisionCircle:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_inv_matrix:new e.aJ(qt,I.u_inv_matrix),u_camera_to_center_distance:new e.aI(qt,I.u_camera_to_center_distance),u_viewport_size:new e.aO(qt,I.u_viewport_size)}),debug:(qt,I)=>({u_color:new e.aL(qt,I.u_color),u_matrix:new e.aJ(qt,I.u_matrix),u_overlay:new e.aH(qt,I.u_overlay),u_overlay_scale:new e.aI(qt,I.u_overlay_scale)}),clippingMask:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix)}),heatmap:(qt,I)=>({u_extrude_scale:new e.aI(qt,I.u_extrude_scale),u_intensity:new e.aI(qt,I.u_intensity),u_matrix:new e.aJ(qt,I.u_matrix)}),heatmapTexture:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_world:new e.aO(qt,I.u_world),u_image:new e.aH(qt,I.u_image),u_color_ramp:new e.aH(qt,I.u_color_ramp),u_opacity:new e.aI(qt,I.u_opacity)}),hillshade:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_image:new e.aH(qt,I.u_image),u_latrange:new e.aO(qt,I.u_latrange),u_light:new e.aO(qt,I.u_light),u_shadow:new e.aL(qt,I.u_shadow),u_highlight:new e.aL(qt,I.u_highlight),u_accent:new e.aL(qt,I.u_accent)}),hillshadePrepare:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_image:new e.aH(qt,I.u_image),u_dimension:new e.aO(qt,I.u_dimension),u_zoom:new e.aI(qt,I.u_zoom),u_unpack:new e.aK(qt,I.u_unpack)}),line:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_ratio:new e.aI(qt,I.u_ratio),u_device_pixel_ratio:new e.aI(qt,I.u_device_pixel_ratio),u_units_to_pixels:new e.aO(qt,I.u_units_to_pixels)}),lineGradient:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_ratio:new e.aI(qt,I.u_ratio),u_device_pixel_ratio:new e.aI(qt,I.u_device_pixel_ratio),u_units_to_pixels:new e.aO(qt,I.u_units_to_pixels),u_image:new e.aH(qt,I.u_image),u_image_height:new e.aI(qt,I.u_image_height)}),linePattern:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_texsize:new e.aO(qt,I.u_texsize),u_ratio:new e.aI(qt,I.u_ratio),u_device_pixel_ratio:new e.aI(qt,I.u_device_pixel_ratio),u_image:new e.aH(qt,I.u_image),u_units_to_pixels:new e.aO(qt,I.u_units_to_pixels),u_scale:new e.aN(qt,I.u_scale),u_fade:new e.aI(qt,I.u_fade)}),lineSDF:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_ratio:new e.aI(qt,I.u_ratio),u_device_pixel_ratio:new e.aI(qt,I.u_device_pixel_ratio),u_units_to_pixels:new e.aO(qt,I.u_units_to_pixels),u_patternscale_a:new e.aO(qt,I.u_patternscale_a),u_patternscale_b:new e.aO(qt,I.u_patternscale_b),u_sdfgamma:new e.aI(qt,I.u_sdfgamma),u_image:new e.aH(qt,I.u_image),u_tex_y_a:new e.aI(qt,I.u_tex_y_a),u_tex_y_b:new e.aI(qt,I.u_tex_y_b),u_mix:new e.aI(qt,I.u_mix)}),raster:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_tl_parent:new e.aO(qt,I.u_tl_parent),u_scale_parent:new e.aI(qt,I.u_scale_parent),u_buffer_scale:new e.aI(qt,I.u_buffer_scale),u_fade_t:new e.aI(qt,I.u_fade_t),u_opacity:new e.aI(qt,I.u_opacity),u_image0:new e.aH(qt,I.u_image0),u_image1:new e.aH(qt,I.u_image1),u_brightness_low:new e.aI(qt,I.u_brightness_low),u_brightness_high:new e.aI(qt,I.u_brightness_high),u_saturation_factor:new e.aI(qt,I.u_saturation_factor),u_contrast_factor:new e.aI(qt,I.u_contrast_factor),u_spin_weights:new e.aN(qt,I.u_spin_weights)}),symbolIcon:(qt,I)=>({u_is_size_zoom_constant:new e.aH(qt,I.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(qt,I.u_is_size_feature_constant),u_size_t:new e.aI(qt,I.u_size_t),u_size:new e.aI(qt,I.u_size),u_camera_to_center_distance:new e.aI(qt,I.u_camera_to_center_distance),u_pitch:new e.aI(qt,I.u_pitch),u_rotate_symbol:new e.aH(qt,I.u_rotate_symbol),u_aspect_ratio:new e.aI(qt,I.u_aspect_ratio),u_fade_change:new e.aI(qt,I.u_fade_change),u_matrix:new e.aJ(qt,I.u_matrix),u_label_plane_matrix:new e.aJ(qt,I.u_label_plane_matrix),u_coord_matrix:new e.aJ(qt,I.u_coord_matrix),u_is_text:new e.aH(qt,I.u_is_text),u_pitch_with_map:new e.aH(qt,I.u_pitch_with_map),u_is_along_line:new e.aH(qt,I.u_is_along_line),u_is_variable_anchor:new e.aH(qt,I.u_is_variable_anchor),u_texsize:new e.aO(qt,I.u_texsize),u_texture:new e.aH(qt,I.u_texture),u_translation:new e.aO(qt,I.u_translation),u_pitched_scale:new e.aI(qt,I.u_pitched_scale)}),symbolSDF:(qt,I)=>({u_is_size_zoom_constant:new e.aH(qt,I.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(qt,I.u_is_size_feature_constant),u_size_t:new e.aI(qt,I.u_size_t),u_size:new e.aI(qt,I.u_size),u_camera_to_center_distance:new e.aI(qt,I.u_camera_to_center_distance),u_pitch:new e.aI(qt,I.u_pitch),u_rotate_symbol:new e.aH(qt,I.u_rotate_symbol),u_aspect_ratio:new e.aI(qt,I.u_aspect_ratio),u_fade_change:new e.aI(qt,I.u_fade_change),u_matrix:new e.aJ(qt,I.u_matrix),u_label_plane_matrix:new e.aJ(qt,I.u_label_plane_matrix),u_coord_matrix:new e.aJ(qt,I.u_coord_matrix),u_is_text:new e.aH(qt,I.u_is_text),u_pitch_with_map:new e.aH(qt,I.u_pitch_with_map),u_is_along_line:new e.aH(qt,I.u_is_along_line),u_is_variable_anchor:new e.aH(qt,I.u_is_variable_anchor),u_texsize:new e.aO(qt,I.u_texsize),u_texture:new e.aH(qt,I.u_texture),u_gamma_scale:new e.aI(qt,I.u_gamma_scale),u_device_pixel_ratio:new e.aI(qt,I.u_device_pixel_ratio),u_is_halo:new e.aH(qt,I.u_is_halo),u_translation:new e.aO(qt,I.u_translation),u_pitched_scale:new e.aI(qt,I.u_pitched_scale)}),symbolTextAndIcon:(qt,I)=>({u_is_size_zoom_constant:new e.aH(qt,I.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(qt,I.u_is_size_feature_constant),u_size_t:new e.aI(qt,I.u_size_t),u_size:new e.aI(qt,I.u_size),u_camera_to_center_distance:new e.aI(qt,I.u_camera_to_center_distance),u_pitch:new e.aI(qt,I.u_pitch),u_rotate_symbol:new e.aH(qt,I.u_rotate_symbol),u_aspect_ratio:new e.aI(qt,I.u_aspect_ratio),u_fade_change:new e.aI(qt,I.u_fade_change),u_matrix:new e.aJ(qt,I.u_matrix),u_label_plane_matrix:new e.aJ(qt,I.u_label_plane_matrix),u_coord_matrix:new e.aJ(qt,I.u_coord_matrix),u_is_text:new e.aH(qt,I.u_is_text),u_pitch_with_map:new e.aH(qt,I.u_pitch_with_map),u_is_along_line:new e.aH(qt,I.u_is_along_line),u_is_variable_anchor:new e.aH(qt,I.u_is_variable_anchor),u_texsize:new e.aO(qt,I.u_texsize),u_texsize_icon:new e.aO(qt,I.u_texsize_icon),u_texture:new e.aH(qt,I.u_texture),u_texture_icon:new e.aH(qt,I.u_texture_icon),u_gamma_scale:new e.aI(qt,I.u_gamma_scale),u_device_pixel_ratio:new e.aI(qt,I.u_device_pixel_ratio),u_is_halo:new e.aH(qt,I.u_is_halo),u_translation:new e.aO(qt,I.u_translation),u_pitched_scale:new e.aI(qt,I.u_pitched_scale)}),background:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_opacity:new e.aI(qt,I.u_opacity),u_color:new e.aL(qt,I.u_color)}),backgroundPattern:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_opacity:new e.aI(qt,I.u_opacity),u_image:new e.aH(qt,I.u_image),u_pattern_tl_a:new e.aO(qt,I.u_pattern_tl_a),u_pattern_br_a:new e.aO(qt,I.u_pattern_br_a),u_pattern_tl_b:new e.aO(qt,I.u_pattern_tl_b),u_pattern_br_b:new e.aO(qt,I.u_pattern_br_b),u_texsize:new e.aO(qt,I.u_texsize),u_mix:new e.aI(qt,I.u_mix),u_pattern_size_a:new e.aO(qt,I.u_pattern_size_a),u_pattern_size_b:new e.aO(qt,I.u_pattern_size_b),u_scale_a:new e.aI(qt,I.u_scale_a),u_scale_b:new e.aI(qt,I.u_scale_b),u_pixel_coord_upper:new e.aO(qt,I.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(qt,I.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(qt,I.u_tile_units_to_pixels)}),terrain:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_texture:new e.aH(qt,I.u_texture),u_ele_delta:new e.aI(qt,I.u_ele_delta),u_fog_matrix:new e.aJ(qt,I.u_fog_matrix),u_fog_color:new e.aL(qt,I.u_fog_color),u_fog_ground_blend:new e.aI(qt,I.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(qt,I.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(qt,I.u_horizon_color),u_horizon_fog_blend:new e.aI(qt,I.u_horizon_fog_blend)}),terrainDepth:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_ele_delta:new e.aI(qt,I.u_ele_delta)}),terrainCoords:(qt,I)=>({u_matrix:new e.aJ(qt,I.u_matrix),u_texture:new e.aH(qt,I.u_texture),u_terrain_coords_id:new e.aI(qt,I.u_terrain_coords_id),u_ele_delta:new e.aI(qt,I.u_ele_delta)}),sky:(qt,I)=>({u_sky_color:new e.aL(qt,I.u_sky_color),u_horizon_color:new e.aL(qt,I.u_horizon_color),u_horizon:new e.aI(qt,I.u_horizon),u_sky_horizon_blend:new e.aI(qt,I.u_sky_horizon_blend)})};class Ns{constructor(I,ht,Et){this.context=I;let It=I.gl;this.buffer=It.createBuffer(),this.dynamicDraw=!!Et,this.context.unbindVAO(),I.bindElementBuffer.set(this.buffer),It.bufferData(It.ELEMENT_ARRAY_BUFFER,ht.arrayBuffer,this.dynamicDraw?It.DYNAMIC_DRAW:It.STATIC_DRAW),this.dynamicDraw||delete ht.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(I){let ht=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),ht.bufferSubData(ht.ELEMENT_ARRAY_BUFFER,0,I.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let La={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class uo{constructor(I,ht,Et,It){this.length=ht.length,this.attributes=Et,this.itemSize=ht.bytesPerElement,this.dynamicDraw=It,this.context=I;let Vt=I.gl;this.buffer=Vt.createBuffer(),I.bindVertexBuffer.set(this.buffer),Vt.bufferData(Vt.ARRAY_BUFFER,ht.arrayBuffer,this.dynamicDraw?Vt.DYNAMIC_DRAW:Vt.STATIC_DRAW),this.dynamicDraw||delete ht.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(I){if(I.length!==this.length)throw new Error(`Length of new data is ${I.length}, which doesn't match current length of ${this.length}`);let ht=this.context.gl;this.bind(),ht.bufferSubData(ht.ARRAY_BUFFER,0,I.arrayBuffer)}enableAttributes(I,ht){for(let Et=0;Et<this.attributes.length;Et++){let It=ht.attributes[this.attributes[Et].name];It!==void 0&&I.enableVertexAttribArray(It)}}setVertexAttribPointers(I,ht,Et){for(let It=0;It<this.attributes.length;It++){let Vt=this.attributes[It],ke=ht.attributes[Vt.name];ke!==void 0&&I.vertexAttribPointer(ke,Vt.components,I[La[Vt.type]],!1,this.itemSize,Vt.offset+this.itemSize*(Et||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Hs=new WeakMap;function Kl(qt){var I;if(Hs.has(qt))return Hs.get(qt);{let ht=(I=qt.getParameter(qt.VERSION))===null||I===void 0?void 0:I.startsWith("WebGL 2.0");return Hs.set(qt,ht),ht}}class Go{constructor(I){this.gl=I.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(I){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class ql extends Go{getDefault(){return e.aM.transparent}set(I){let ht=this.current;(I.r!==ht.r||I.g!==ht.g||I.b!==ht.b||I.a!==ht.a||this.dirty)&&(this.gl.clearColor(I.r,I.g,I.b,I.a),this.current=I,this.dirty=!1)}}class il extends Go{getDefault(){return 1}set(I){(I!==this.current||this.dirty)&&(this.gl.clearDepth(I),this.current=I,this.dirty=!1)}}class Cl extends Go{getDefault(){return 0}set(I){(I!==this.current||this.dirty)&&(this.gl.clearStencil(I),this.current=I,this.dirty=!1)}}class Fu extends Go{getDefault(){return[!0,!0,!0,!0]}set(I){let ht=this.current;(I[0]!==ht[0]||I[1]!==ht[1]||I[2]!==ht[2]||I[3]!==ht[3]||this.dirty)&&(this.gl.colorMask(I[0],I[1],I[2],I[3]),this.current=I,this.dirty=!1)}}class ao extends Go{getDefault(){return!0}set(I){(I!==this.current||this.dirty)&&(this.gl.depthMask(I),this.current=I,this.dirty=!1)}}class Ts extends Go{getDefault(){return 255}set(I){(I!==this.current||this.dirty)&&(this.gl.stencilMask(I),this.current=I,this.dirty=!1)}}class Ls extends Go{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(I){let ht=this.current;(I.func!==ht.func||I.ref!==ht.ref||I.mask!==ht.mask||this.dirty)&&(this.gl.stencilFunc(I.func,I.ref,I.mask),this.current=I,this.dirty=!1)}}class nu extends Go{getDefault(){let I=this.gl;return[I.KEEP,I.KEEP,I.KEEP]}set(I){let ht=this.current;(I[0]!==ht[0]||I[1]!==ht[1]||I[2]!==ht[2]||this.dirty)&&(this.gl.stencilOp(I[0],I[1],I[2]),this.current=I,this.dirty=!1)}}class cl extends Go{getDefault(){return!1}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;I?ht.enable(ht.STENCIL_TEST):ht.disable(ht.STENCIL_TEST),this.current=I,this.dirty=!1}}class Qo extends Go{getDefault(){return[0,1]}set(I){let ht=this.current;(I[0]!==ht[0]||I[1]!==ht[1]||this.dirty)&&(this.gl.depthRange(I[0],I[1]),this.current=I,this.dirty=!1)}}class Mu extends Go{getDefault(){return!1}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;I?ht.enable(ht.DEPTH_TEST):ht.disable(ht.DEPTH_TEST),this.current=I,this.dirty=!1}}class Gu extends Go{getDefault(){return this.gl.LESS}set(I){(I!==this.current||this.dirty)&&(this.gl.depthFunc(I),this.current=I,this.dirty=!1)}}class _l extends Go{getDefault(){return!1}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;I?ht.enable(ht.BLEND):ht.disable(ht.BLEND),this.current=I,this.dirty=!1}}class Ol extends Go{getDefault(){let I=this.gl;return[I.ONE,I.ZERO]}set(I){let ht=this.current;(I[0]!==ht[0]||I[1]!==ht[1]||this.dirty)&&(this.gl.blendFunc(I[0],I[1]),this.current=I,this.dirty=!1)}}class Xl extends Go{getDefault(){return e.aM.transparent}set(I){let ht=this.current;(I.r!==ht.r||I.g!==ht.g||I.b!==ht.b||I.a!==ht.a||this.dirty)&&(this.gl.blendColor(I.r,I.g,I.b,I.a),this.current=I,this.dirty=!1)}}class tu extends Go{getDefault(){return this.gl.FUNC_ADD}set(I){(I!==this.current||this.dirty)&&(this.gl.blendEquation(I),this.current=I,this.dirty=!1)}}class ac extends Go{getDefault(){return!1}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;I?ht.enable(ht.CULL_FACE):ht.disable(ht.CULL_FACE),this.current=I,this.dirty=!1}}class ph extends Go{getDefault(){return this.gl.BACK}set(I){(I!==this.current||this.dirty)&&(this.gl.cullFace(I),this.current=I,this.dirty=!1)}}class Jc extends Go{getDefault(){return this.gl.CCW}set(I){(I!==this.current||this.dirty)&&(this.gl.frontFace(I),this.current=I,this.dirty=!1)}}class ah extends Go{getDefault(){return null}set(I){(I!==this.current||this.dirty)&&(this.gl.useProgram(I),this.current=I,this.dirty=!1)}}class Nf extends Go{getDefault(){return this.gl.TEXTURE0}set(I){(I!==this.current||this.dirty)&&(this.gl.activeTexture(I),this.current=I,this.dirty=!1)}}class Sf extends Go{getDefault(){let I=this.gl;return[0,0,I.drawingBufferWidth,I.drawingBufferHeight]}set(I){let ht=this.current;(I[0]!==ht[0]||I[1]!==ht[1]||I[2]!==ht[2]||I[3]!==ht[3]||this.dirty)&&(this.gl.viewport(I[0],I[1],I[2],I[3]),this.current=I,this.dirty=!1)}}class Dl extends Go{getDefault(){return null}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;ht.bindFramebuffer(ht.FRAMEBUFFER,I),this.current=I,this.dirty=!1}}class Bc extends Go{getDefault(){return null}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;ht.bindRenderbuffer(ht.RENDERBUFFER,I),this.current=I,this.dirty=!1}}class jf extends Go{getDefault(){return null}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;ht.bindTexture(ht.TEXTURE_2D,I),this.current=I,this.dirty=!1}}class hc extends Go{getDefault(){return null}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;ht.bindBuffer(ht.ARRAY_BUFFER,I),this.current=I,this.dirty=!1}}class oc extends Go{getDefault(){return null}set(I){let ht=this.gl;ht.bindBuffer(ht.ELEMENT_ARRAY_BUFFER,I),this.current=I,this.dirty=!1}}class fc extends Go{getDefault(){return null}set(I){var ht;if(I===this.current&&!this.dirty)return;let Et=this.gl;Kl(Et)?Et.bindVertexArray(I):(ht=Et.getExtension("OES_vertex_array_object"))===null||ht===void 0||ht.bindVertexArrayOES(I),this.current=I,this.dirty=!1}}class oh extends Go{getDefault(){return 4}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;ht.pixelStorei(ht.UNPACK_ALIGNMENT,I),this.current=I,this.dirty=!1}}class su extends Go{getDefault(){return!1}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;ht.pixelStorei(ht.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I),this.current=I,this.dirty=!1}}class sc extends Go{getDefault(){return!1}set(I){if(I===this.current&&!this.dirty)return;let ht=this.gl;ht.pixelStorei(ht.UNPACK_FLIP_Y_WEBGL,I),this.current=I,this.dirty=!1}}class el extends Go{constructor(I,ht){super(I),this.context=I,this.parent=ht}getDefault(){return null}}class Zl extends el{setDirty(){this.dirty=!0}set(I){if(I===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let ht=this.gl;ht.framebufferTexture2D(ht.FRAMEBUFFER,ht.COLOR_ATTACHMENT0,ht.TEXTURE_2D,I,0),this.current=I,this.dirty=!1}}class Mh extends el{set(I){if(I===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let ht=this.gl;ht.framebufferRenderbuffer(ht.FRAMEBUFFER,ht.DEPTH_ATTACHMENT,ht.RENDERBUFFER,I),this.current=I,this.dirty=!1}}class Lc extends el{set(I){if(I===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let ht=this.gl;ht.framebufferRenderbuffer(ht.FRAMEBUFFER,ht.DEPTH_STENCIL_ATTACHMENT,ht.RENDERBUFFER,I),this.current=I,this.dirty=!1}}class jh{constructor(I,ht,Et,It,Vt){this.context=I,this.width=ht,this.height=Et;let ke=I.gl,Oe=this.framebuffer=ke.createFramebuffer();if(this.colorAttachment=new Zl(I,Oe),It)this.depthAttachment=Vt?new Lc(I,Oe):new Mh(I,Oe);else if(Vt)throw new Error("Stencil cannot be set without depth");if(ke.checkFramebufferStatus(ke.FRAMEBUFFER)!==ke.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){let I=this.context.gl,ht=this.colorAttachment.get();if(ht&&I.deleteTexture(ht),this.depthAttachment){let Et=this.depthAttachment.get();Et&&I.deleteRenderbuffer(Et)}I.deleteFramebuffer(this.framebuffer)}}class xu{constructor(I,ht,Et){this.blendFunction=I,this.blendColor=ht,this.mask=Et}}xu.Replace=[1,0],xu.disabled=new xu(xu.Replace,e.aM.transparent,[!1,!1,!1,!1]),xu.unblended=new xu(xu.Replace,e.aM.transparent,[!0,!0,!0,!0]),xu.alphaBlended=new xu([1,771],e.aM.transparent,[!0,!0,!0,!0]);class Cd{constructor(I){var ht,Et;if(this.gl=I,this.clearColor=new ql(this),this.clearDepth=new il(this),this.clearStencil=new Cl(this),this.colorMask=new Fu(this),this.depthMask=new ao(this),this.stencilMask=new Ts(this),this.stencilFunc=new Ls(this),this.stencilOp=new nu(this),this.stencilTest=new cl(this),this.depthRange=new Qo(this),this.depthTest=new Mu(this),this.depthFunc=new Gu(this),this.blend=new _l(this),this.blendFunc=new Ol(this),this.blendColor=new Xl(this),this.blendEquation=new tu(this),this.cullFace=new ac(this),this.cullFaceSide=new ph(this),this.frontFace=new Jc(this),this.program=new ah(this),this.activeTexture=new Nf(this),this.viewport=new Sf(this),this.bindFramebuffer=new Dl(this),this.bindRenderbuffer=new Bc(this),this.bindTexture=new jf(this),this.bindVertexBuffer=new hc(this),this.bindElementBuffer=new oc(this),this.bindVertexArray=new fc(this),this.pixelStoreUnpack=new oh(this),this.pixelStoreUnpackPremultiplyAlpha=new su(this),this.pixelStoreUnpackFlipY=new sc(this),this.extTextureFilterAnisotropic=I.getExtension("EXT_texture_filter_anisotropic")||I.getExtension("MOZ_EXT_texture_filter_anisotropic")||I.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=I.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=I.getParameter(I.MAX_TEXTURE_SIZE),Kl(I)){this.HALF_FLOAT=I.HALF_FLOAT;let It=I.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(ht=I.RGBA16F)!==null&&ht!==void 0?ht:It?.RGBA16F_EXT,this.RGB16F=(Et=I.RGB16F)!==null&&Et!==void 0?Et:It?.RGB16F_EXT,I.getExtension("EXT_color_buffer_float")}else{I.getExtension("EXT_color_buffer_half_float"),I.getExtension("OES_texture_half_float_linear");let It=I.getExtension("OES_texture_half_float");this.HALF_FLOAT=It?.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(I,ht){return new Ns(this,I,ht)}createVertexBuffer(I,ht,Et){return new uo(this,I,ht,Et)}createRenderbuffer(I,ht,Et){let It=this.gl,Vt=It.createRenderbuffer();return this.bindRenderbuffer.set(Vt),It.renderbufferStorage(It.RENDERBUFFER,I,ht,Et),this.bindRenderbuffer.set(null),Vt}createFramebuffer(I,ht,Et,It){return new jh(this,I,ht,Et,It)}clear({color:I,depth:ht,stencil:Et}){let It=this.gl,Vt=0;I&&(Vt|=It.COLOR_BUFFER_BIT,this.clearColor.set(I),this.colorMask.set([!0,!0,!0,!0])),ht!==void 0&&(Vt|=It.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(ht),this.depthMask.set(!0)),Et!==void 0&&(Vt|=It.STENCIL_BUFFER_BIT,this.clearStencil.set(Et),this.stencilMask.set(255)),It.clear(Vt)}setCullFace(I){I.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(I.mode),this.frontFace.set(I.frontFace))}setDepthMode(I){I.func!==this.gl.ALWAYS||I.mask?(this.depthTest.set(!0),this.depthFunc.set(I.func),this.depthMask.set(I.mask),this.depthRange.set(I.range)):this.depthTest.set(!1)}setStencilMode(I){I.test.func!==this.gl.ALWAYS||I.mask?(this.stencilTest.set(!0),this.stencilMask.set(I.mask),this.stencilOp.set([I.fail,I.depthFail,I.pass]),this.stencilFunc.set({func:I.test.func,ref:I.ref,mask:I.test.mask})):this.stencilTest.set(!1)}setColorMode(I){e.aE(I.blendFunction,xu.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(I.blendFunction),this.blendColor.set(I.blendColor)),this.colorMask.set(I.mask)}createVertexArray(){var I;return Kl(this.gl)?this.gl.createVertexArray():(I=this.gl.getExtension("OES_vertex_array_object"))===null||I===void 0?void 0:I.createVertexArrayOES()}deleteVertexArray(I){var ht;return Kl(this.gl)?this.gl.deleteVertexArray(I):(ht=this.gl.getExtension("OES_vertex_array_object"))===null||ht===void 0?void 0:ht.deleteVertexArrayOES(I)}unbindVAO(){this.bindVertexArray.set(null)}}class Qs{constructor(I,ht,Et){this.func=I,this.mask=ht,this.range=Et}}Qs.ReadOnly=!1,Qs.ReadWrite=!0,Qs.disabled=new Qs(519,Qs.ReadOnly,[0,1]);let Wd=7680;class Ll{constructor(I,ht,Et,It,Vt,ke){this.test=I,this.ref=ht,this.mask=Et,this.fail=It,this.depthFail=Vt,this.pass=ke}}Ll.disabled=new Ll({func:519,mask:0},0,0,Wd,Wd,Wd);class Jo{constructor(I,ht,Et){this.enable=I,this.mode=ht,this.frontFace=Et}}let lf;function sh(qt,I,ht,Et,It){let Vt=qt.context,ke=Vt.gl,Oe=qt.useProgram("collisionBox"),Ke=[],gr=0,Or=0;for(let Ae=0;Ae<Et.length;Ae++){let je=Et[Ae],Ie=I.getTile(je).getBucket(ht);if(!Ie)continue;let Ze=It?Ie.textCollisionBox:Ie.iconCollisionBox,wr=Ie.collisionCircleArray;if(wr.length>0){let Ir=e.H();e.aQ(Ir,Ie.placementInvProjMatrix,qt.transform.glCoordMatrix),e.aQ(Ir,Ir,Ie.placementViewportMatrix),Ke.push({circleArray:wr,circleOffset:Or,transform:je.posMatrix,invTransform:Ir,coord:je}),gr+=wr.length/4,Or=gr}Ze&&Oe.draw(Vt,ke.LINES,Qs.disabled,Ll.disabled,qt.colorModeForRenderPass(),Jo.disabled,{u_matrix:je.posMatrix,u_pixel_extrude_scale:[1/(Dr=qt.transform).width,1/Dr.height]},qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(je),ht.id,Ze.layoutVertexBuffer,Ze.indexBuffer,Ze.segments,null,qt.transform.zoom,null,null,Ze.collisionVertexBuffer)}var Dr;if(!It||!Ke.length)return;let ln=qt.useProgram("collisionCircle"),Sn=new e.aR;Sn.resize(4*gr),Sn._trim();let Xt=0;for(let Ae of Ke)for(let je=0;je<Ae.circleArray.length/4;je++){let Ie=4*je,Ze=Ae.circleArray[Ie+0],wr=Ae.circleArray[Ie+1],Ir=Ae.circleArray[Ie+2],Nr=Ae.circleArray[Ie+3];Sn.emplace(Xt++,Ze,wr,Ir,Nr,0),Sn.emplace(Xt++,Ze,wr,Ir,Nr,1),Sn.emplace(Xt++,Ze,wr,Ir,Nr,2),Sn.emplace(Xt++,Ze,wr,Ir,Nr,3)}(!lf||lf.length<2*gr)&&(lf=function(Ae){let je=2*Ae,Ie=new e.aT;Ie.resize(je),Ie._trim();for(let Ze=0;Ze<je;Ze++){let wr=6*Ze;Ie.uint16[wr+0]=4*Ze+0,Ie.uint16[wr+1]=4*Ze+1,Ie.uint16[wr+2]=4*Ze+2,Ie.uint16[wr+3]=4*Ze+2,Ie.uint16[wr+4]=4*Ze+3,Ie.uint16[wr+5]=4*Ze+0}return Ie}(gr));let ae=Vt.createIndexBuffer(lf,!0),xe=Vt.createVertexBuffer(Sn,e.aS.members,!0);for(let Ae of Ke){let je=Io(Ae.transform,Ae.invTransform,qt.transform);ln.draw(Vt,ke.TRIANGLES,Qs.disabled,Ll.disabled,qt.colorModeForRenderPass(),Jo.disabled,je,qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(Ae.coord),ht.id,xe,ae,e.a0.simpleSegment(0,2*Ae.circleOffset,Ae.circleArray.length,Ae.circleArray.length/2),null,qt.transform.zoom,null,null,null)}xe.destroy(),ae.destroy()}Jo.disabled=new Jo(!1,1029,2305),Jo.backCCW=new Jo(!0,1029,2305);let ec=e.an(new Float32Array(16));function Uf(qt,I,ht,Et,It,Vt){let{horizontalAlign:ke,verticalAlign:Oe}=e.au(qt);return new e.P((-(ke-.5)*I/It+Et[0])*Vt,(-(Oe-.5)*ht/It+Et[1])*Vt)}function Uh(qt,I,ht,Et,It,Vt){let ke=I.tileAnchorPoint.add(new e.P(I.translation[0],I.translation[1]));if(I.pitchWithMap){let Oe=Et.mult(Vt);ht||(Oe=Oe.rotate(-It));let Ke=ke.add(Oe);return Ce(Ke.x,Ke.y,I.labelPlaneMatrix,I.getElevation).point}if(ht){let Oe=we(I.tileAnchorPoint.x+1,I.tileAnchorPoint.y,I).point.sub(qt),Ke=Math.atan(Oe.y/Oe.x)+(Oe.x<0?Math.PI:0);return qt.add(Et.rotate(Ke))}return qt.add(Et)}function yf(qt,I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr,ln,Sn){let Xt=qt.text.placedSymbolArray,ae=qt.text.dynamicLayoutVertexArray,xe=qt.icon.dynamicLayoutVertexArray,Ae={};ae.clear();for(let je=0;je<Xt.length;je++){let Ie=Xt.get(je),Ze=Ie.hidden||!Ie.crossTileID||qt.allowVerticalPlacement&&!Ie.placedOrientation?null:Et[Ie.crossTileID];if(Ze){let wr=new e.P(Ie.anchorX,Ie.anchorY),Ir={getElevation:Sn,width:It.width,height:It.height,labelPlaneMatrix:Vt,pitchWithMap:ht,projection:Or,tileAnchorPoint:wr,translation:Dr,unwrappedTileID:ln},Nr=ht?Ce(wr.x,wr.y,ke,Sn):we(wr.x,wr.y,Ir),tn=$t(It.cameraToCenterDistance,Nr.signedDistanceFromCamera),mn=e.ai(qt.textSizeData,Ke,Ie)*tn/e.ap;ht&&(mn*=qt.tilePixelRatio/Oe);let{width:zn,height:Bn,anchor:ri,textOffset:Fi,textBoxScale:da}=Ze,ha=Uf(ri,zn,Bn,Fi,da,mn),ka=Or.getPitchedTextCorrection(It,wr.add(new e.P(Dr[0],Dr[1])),ln),io=Uh(Nr.point,Ir,I,ha,It.angle,ka),Ro=qt.allowVerticalPlacement&&Ie.placedOrientation===e.ah.vertical?Math.PI/2:0;for(let Mo=0;Mo<Ie.numGlyphs;Mo++)e.aj(ae,io,Ro);gr&&Ie.associatedIconIndex>=0&&(Ae[Ie.associatedIconIndex]={shiftedAnchor:io,angle:Ro})}else Tr(Ie.numGlyphs,ae)}if(gr){xe.clear();let je=qt.icon.placedSymbolArray;for(let Ie=0;Ie<je.length;Ie++){let Ze=je.get(Ie);if(Ze.hidden)Tr(Ze.numGlyphs,xe);else{let wr=Ae[Ie];if(wr)for(let Ir=0;Ir<Ze.numGlyphs;Ir++)e.aj(xe,wr.shiftedAnchor,wr.angle);else Tr(Ze.numGlyphs,xe)}}qt.icon.dynamicLayoutVertexBuffer.updateData(xe)}qt.text.dynamicLayoutVertexBuffer.updateData(ae)}function lc(qt,I,ht){return ht.iconsInText&&I?"symbolTextAndIcon":qt?"symbolSDF":"symbolIcon"}function hd(qt,I,ht,Et,It,Vt,ke,Oe,Ke,gr,Or,Dr){let ln=qt.context,Sn=ln.gl,Xt=qt.transform,ae=Zi(),xe=Oe==="map",Ae=Ke==="map",je=Oe!=="viewport"&&ht.layout.get("symbol-placement")!=="point",Ie=xe&&!Ae&&!je,Ze=!Ae&&je,wr=!ht.layout.get("symbol-sort-key").isConstant(),Ir=!1,Nr=qt.depthModeForSublayer(0,Qs.ReadOnly),tn=ht._unevaluatedLayout.hasValue("text-variable-anchor")||ht._unevaluatedLayout.hasValue("text-variable-anchor-offset"),mn=[],zn=ae.getCircleRadiusCorrection(Xt);for(let Bn of Et){let ri=I.getTile(Bn),Fi=ri.getBucket(ht);if(!Fi)continue;let da=It?Fi.text:Fi.icon;if(!da||!da.segments.get().length||!da.hasVisibleVertices)continue;let ha=da.programConfigurations.get(ht.id),ka=It||Fi.sdfIcons,io=It?Fi.textSizeData:Fi.iconSizeData,Ro=Ae||Xt.pitch!==0,Mo=qt.useProgram(lc(ka,It,Fi),ha),hs=e.ag(io,Xt.zoom),hl=qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(Bn),vl,Os,bl,Su,mu=[0,0],Ws=null;if(It)Os=ri.glyphAtlasTexture,bl=Sn.LINEAR,vl=ri.glyphAtlasTexture.size,Fi.iconsInText&&(mu=ri.imageAtlasTexture.size,Ws=ri.imageAtlasTexture,Su=Ro||qt.options.rotating||qt.options.zooming||io.kind==="composite"||io.kind==="camera"?Sn.LINEAR:Sn.NEAREST);else{let vn=ht.layout.get("icon-size").constantOr(0)!==1||Fi.iconsNeedLinear;Os=ri.imageAtlasTexture,bl=ka||qt.options.rotating||qt.options.zooming||vn||Ro?Sn.LINEAR:Sn.NEAREST,vl=ri.imageAtlasTexture.size}let qs=Hn(ri,1,qt.transform.zoom),Yu=Ze?Bn.posMatrix:ec,dc=Kr(Yu,Ae,xe,qt.transform,qs),Zc=rn(Yu,Ae,xe,qt.transform,qs),At=rn(Bn.posMatrix,Ae,xe,qt.transform,qs),jt=ae.translatePosition(qt.transform,ri,Vt,ke),ue=tn&&Fi.hasTextData(),Me=ht.layout.get("icon-text-fit")!=="none"&&ue&&Fi.hasIconData();if(je){let vn=qt.style.map.terrain?(On,Bi)=>qt.style.map.terrain.getElevation(Bn,On,Bi):null,In=ht.layout.get("text-rotation-alignment")==="map";Ct(Fi,Bn.posMatrix,qt,It,dc,At,Ae,gr,In,ae,Bn.toUnwrapped(),Xt.width,Xt.height,jt,vn)}let Le=Bn.posMatrix,Be=It&&tn||Me,sr=je||Be?ec:dc,ir=Zc,Mr=ka&&ht.paint.get(It?"text-halo-width":"icon-halo-width").constantOr(1)!==0,en;en=ka?Fi.iconsInText?ks(io.kind,hs,Ie,Ae,je,Be,qt,Le,sr,ir,jt,vl,mu,zn):Co(io.kind,hs,Ie,Ae,je,Be,qt,Le,sr,ir,jt,It,vl,!0,zn):Cs(io.kind,hs,Ie,Ae,je,Be,qt,Le,sr,ir,jt,It,vl,zn);let Xr={program:Mo,buffers:da,uniformValues:en,atlasTexture:Os,atlasTextureIcon:Ws,atlasInterpolation:bl,atlasInterpolationIcon:Su,isSDF:ka,hasHalo:Mr};if(wr&&Fi.canOverlap){Ir=!0;let vn=da.segments.get();for(let In of vn)mn.push({segments:new e.a0([In]),sortKey:In.sortKey,state:Xr,terrainData:hl})}else mn.push({segments:da.segments,sortKey:0,state:Xr,terrainData:hl})}Ir&&mn.sort((Bn,ri)=>Bn.sortKey-ri.sortKey);for(let Bn of mn){let ri=Bn.state;if(ln.activeTexture.set(Sn.TEXTURE0),ri.atlasTexture.bind(ri.atlasInterpolation,Sn.CLAMP_TO_EDGE),ri.atlasTextureIcon&&(ln.activeTexture.set(Sn.TEXTURE1),ri.atlasTextureIcon&&ri.atlasTextureIcon.bind(ri.atlasInterpolationIcon,Sn.CLAMP_TO_EDGE)),ri.isSDF){let Fi=ri.uniformValues;ri.hasHalo&&(Fi.u_is_halo=1,$f(ri.buffers,Bn.segments,ht,qt,ri.program,Nr,Or,Dr,Fi,Bn.terrainData)),Fi.u_is_halo=0}$f(ri.buffers,Bn.segments,ht,qt,ri.program,Nr,Or,Dr,ri.uniformValues,Bn.terrainData)}}function $f(qt,I,ht,Et,It,Vt,ke,Oe,Ke,gr){let Or=Et.context;It.draw(Or,Or.gl.TRIANGLES,Vt,ke,Oe,Jo.disabled,Ke,gr,ht.id,qt.layoutVertexBuffer,qt.indexBuffer,I,ht.paint,Et.transform.zoom,qt.programConfigurations.get(ht.id),qt.dynamicLayoutVertexBuffer,qt.opacityVertexBuffer)}function xf(qt,I,ht,Et){let It=qt.context,Vt=It.gl,ke=Ll.disabled,Oe=new xu([Vt.ONE,Vt.ONE],e.aM.transparent,[!0,!0,!0,!0]),Ke=I.getBucket(ht);if(!Ke)return;let gr=Et.key,Or=ht.heatmapFbos.get(gr);Or||(Or=Vf(It,I.tileSize,I.tileSize),ht.heatmapFbos.set(gr,Or)),It.bindFramebuffer.set(Or.framebuffer),It.viewport.set([0,0,I.tileSize,I.tileSize]),It.clear({color:e.aM.transparent});let Dr=Ke.programConfigurations.get(ht.id),ln=qt.useProgram("heatmap",Dr),Sn=qt.style.map.terrain.getTerrainData(Et);ln.draw(It,Vt.TRIANGLES,Qs.disabled,ke,Oe,Jo.disabled,Ia(Et.posMatrix,I,qt.transform.zoom,ht.paint.get("heatmap-intensity")),Sn,ht.id,Ke.layoutVertexBuffer,Ke.indexBuffer,Ke.segments,ht.paint,qt.transform.zoom,Dr)}function Vh(qt,I,ht){let Et=qt.context,It=Et.gl;Et.setColorMode(qt.colorModeForRenderPass());let Vt=Hf(Et,I),ke=ht.key,Oe=I.heatmapFbos.get(ke);Oe&&(Et.activeTexture.set(It.TEXTURE0),It.bindTexture(It.TEXTURE_2D,Oe.colorAttachment.get()),Et.activeTexture.set(It.TEXTURE1),Vt.bind(It.LINEAR,It.CLAMP_TO_EDGE),qt.useProgram("heatmapTexture").draw(Et,It.TRIANGLES,Qs.disabled,Ll.disabled,qt.colorModeForRenderPass(),Jo.disabled,gs(qt,I,0,1),null,I.id,qt.rasterBoundsBuffer,qt.quadTriangleIndexBuffer,qt.rasterBoundsSegments,I.paint,qt.transform.zoom),Oe.destroy(),I.heatmapFbos.delete(ke))}function Vf(qt,I,ht){var Et,It;let Vt=qt.gl,ke=Vt.createTexture();Vt.bindTexture(Vt.TEXTURE_2D,ke),Vt.texParameteri(Vt.TEXTURE_2D,Vt.TEXTURE_WRAP_S,Vt.CLAMP_TO_EDGE),Vt.texParameteri(Vt.TEXTURE_2D,Vt.TEXTURE_WRAP_T,Vt.CLAMP_TO_EDGE),Vt.texParameteri(Vt.TEXTURE_2D,Vt.TEXTURE_MIN_FILTER,Vt.LINEAR),Vt.texParameteri(Vt.TEXTURE_2D,Vt.TEXTURE_MAG_FILTER,Vt.LINEAR);let Oe=(Et=qt.HALF_FLOAT)!==null&&Et!==void 0?Et:Vt.UNSIGNED_BYTE,Ke=(It=qt.RGBA16F)!==null&&It!==void 0?It:Vt.RGBA;Vt.texImage2D(Vt.TEXTURE_2D,0,Ke,I,ht,0,Vt.RGBA,Oe,null);let gr=qt.createFramebuffer(I,ht,!1,!1);return gr.colorAttachment.set(ke),gr}function Hf(qt,I){return I.colorRampTexture||(I.colorRampTexture=new p(qt,I.colorRamp,qt.gl.RGBA)),I.colorRampTexture}function lh(qt,I,ht,Et,It){if(!ht||!Et||!Et.imageAtlas)return;let Vt=Et.imageAtlas.patternPositions,ke=Vt[ht.to.toString()],Oe=Vt[ht.from.toString()];if(!ke&&Oe&&(ke=Oe),!Oe&&ke&&(Oe=ke),!ke||!Oe){let Ke=It.getPaintProperty(I);ke=Vt[Ke],Oe=Vt[Ke]}ke&&Oe&&qt.setConstantPatternPositions(ke,Oe)}function Gf(qt,I,ht,Et,It,Vt,ke){let Oe=qt.context.gl,Ke="fill-pattern",gr=ht.paint.get(Ke),Or=gr&&gr.constantOr(1),Dr=ht.getCrossfadeParameters(),ln,Sn,Xt,ae,xe;ke?(Sn=Or&&!ht.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ln=Oe.LINES):(Sn=Or?"fillPattern":"fill",ln=Oe.TRIANGLES);let Ae=gr.constantOr(null);for(let je of Et){let Ie=I.getTile(je);if(Or&&!Ie.patternsLoaded())continue;let Ze=Ie.getBucket(ht);if(!Ze)continue;let wr=Ze.programConfigurations.get(ht.id),Ir=qt.useProgram(Sn,wr),Nr=qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(je);Or&&(qt.context.activeTexture.set(Oe.TEXTURE0),Ie.imageAtlasTexture.bind(Oe.LINEAR,Oe.CLAMP_TO_EDGE),wr.updatePaintBuffers(Dr)),lh(wr,Ke,Ae,Ie,ht);let tn=Nr?je:null,mn=qt.translatePosMatrix(tn?tn.posMatrix:je.posMatrix,Ie,ht.paint.get("fill-translate"),ht.paint.get("fill-translate-anchor"));if(ke){ae=Ze.indexBuffer2,xe=Ze.segments2;let zn=[Oe.drawingBufferWidth,Oe.drawingBufferHeight];Xt=Sn==="fillOutlinePattern"&&Or?Ja(mn,qt,Dr,Ie,zn):Ri(mn,zn)}else ae=Ze.indexBuffer,xe=Ze.segments,Xt=Or?Ca(mn,qt,Dr,Ie):Zn(mn);Ir.draw(qt.context,ln,It,qt.stencilModeForClipping(je),Vt,Jo.disabled,Xt,Nr,ht.id,Ze.layoutVertexBuffer,ae,xe,ht.paint,qt.transform.zoom,wr)}}function Sh(qt,I,ht,Et,It,Vt,ke){let Oe=qt.context,Ke=Oe.gl,gr="fill-extrusion-pattern",Or=ht.paint.get(gr),Dr=Or.constantOr(1),ln=ht.getCrossfadeParameters(),Sn=ht.paint.get("fill-extrusion-opacity"),Xt=Or.constantOr(null);for(let ae of Et){let xe=I.getTile(ae),Ae=xe.getBucket(ht);if(!Ae)continue;let je=qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(ae),Ie=Ae.programConfigurations.get(ht.id),Ze=qt.useProgram(Dr?"fillExtrusionPattern":"fillExtrusion",Ie);Dr&&(qt.context.activeTexture.set(Ke.TEXTURE0),xe.imageAtlasTexture.bind(Ke.LINEAR,Ke.CLAMP_TO_EDGE),Ie.updatePaintBuffers(ln)),lh(Ie,gr,Xt,xe,ht);let wr=qt.translatePosMatrix(ae.posMatrix,xe,ht.paint.get("fill-extrusion-translate"),ht.paint.get("fill-extrusion-translate-anchor")),Ir=ht.paint.get("fill-extrusion-vertical-gradient"),Nr=Dr?En(wr,qt,Ir,Sn,ae,ln,xe):Pn(wr,qt,Ir,Sn);Ze.draw(Oe,Oe.gl.TRIANGLES,It,Vt,ke,Jo.backCCW,Nr,je,ht.id,Ae.layoutVertexBuffer,Ae.indexBuffer,Ae.segments,ht.paint,qt.transform.zoom,Ie,qt.style.map.terrain&&Ae.centroidVertexBuffer)}}function mh(qt,I,ht,Et,It,Vt,ke){let Oe=qt.context,Ke=Oe.gl,gr=ht.fbo;if(!gr)return;let Or=qt.useProgram("hillshade"),Dr=qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(I);Oe.activeTexture.set(Ke.TEXTURE0),Ke.bindTexture(Ke.TEXTURE_2D,gr.colorAttachment.get()),Or.draw(Oe,Ke.TRIANGLES,It,Vt,ke,Jo.disabled,((ln,Sn,Xt,ae)=>{let xe=Xt.paint.get("hillshade-shadow-color"),Ae=Xt.paint.get("hillshade-highlight-color"),je=Xt.paint.get("hillshade-accent-color"),Ie=Xt.paint.get("hillshade-illumination-direction")*(Math.PI/180);Xt.paint.get("hillshade-illumination-anchor")==="viewport"&&(Ie-=ln.transform.angle);let Ze=!ln.options.moving;return{u_matrix:ae?ae.posMatrix:ln.transform.calculatePosMatrix(Sn.tileID.toUnwrapped(),Ze),u_image:0,u_latrange:is(0,Sn.tileID),u_light:[Xt.paint.get("hillshade-exaggeration"),Ie],u_shadow:xe,u_highlight:Ae,u_accent:je}})(qt,ht,Et,Dr?I:null),Dr,Et.id,qt.rasterBoundsBuffer,qt.quadTriangleIndexBuffer,qt.rasterBoundsSegments)}function uc(qt,I,ht,Et,It,Vt){let ke=qt.context,Oe=ke.gl,Ke=I.dem;if(Ke&&Ke.data){let gr=Ke.dim,Or=Ke.stride,Dr=Ke.getPixels();if(ke.activeTexture.set(Oe.TEXTURE1),ke.pixelStoreUnpackPremultiplyAlpha.set(!1),I.demTexture=I.demTexture||qt.getTileTexture(Or),I.demTexture){let Sn=I.demTexture;Sn.update(Dr,{premultiply:!1}),Sn.bind(Oe.NEAREST,Oe.CLAMP_TO_EDGE)}else I.demTexture=new p(ke,Dr,Oe.RGBA,{premultiply:!1}),I.demTexture.bind(Oe.NEAREST,Oe.CLAMP_TO_EDGE);ke.activeTexture.set(Oe.TEXTURE0);let ln=I.fbo;if(!ln){let Sn=new p(ke,{width:gr,height:gr,data:null},Oe.RGBA);Sn.bind(Oe.LINEAR,Oe.CLAMP_TO_EDGE),ln=I.fbo=ke.createFramebuffer(gr,gr,!0,!1),ln.colorAttachment.set(Sn.texture)}ke.bindFramebuffer.set(ln.framebuffer),ke.viewport.set([0,0,gr,gr]),qt.useProgram("hillshadePrepare").draw(ke,Oe.TRIANGLES,Et,It,Vt,Jo.disabled,((Sn,Xt)=>{let ae=Xt.stride,xe=e.H();return e.aP(xe,0,e.X,-e.X,0,0,1),e.J(xe,xe,[0,-e.X,0]),{u_matrix:xe,u_image:1,u_dimension:[ae,ae],u_zoom:Sn.overscaledZ,u_unpack:Xt.getUnpackVector()}})(I.tileID,Ke),null,ht.id,qt.rasterBoundsBuffer,qt.quadTriangleIndexBuffer,qt.rasterBoundsSegments),I.needsHillshadePrepare=!1}}function ef(qt,I,ht,Et,It,Vt){let ke=Et.paint.get("raster-fade-duration");if(!Vt&&ke>0){let Oe=o.now(),Ke=(Oe-qt.timeAdded)/ke,gr=I?(Oe-I.timeAdded)/ke:-1,Or=ht.getSource(),Dr=It.coveringZoomLevel({tileSize:Or.tileSize,roundZoom:Or.roundZoom}),ln=!I||Math.abs(I.tileID.overscaledZ-Dr)>Math.abs(qt.tileID.overscaledZ-Dr),Sn=ln&&qt.refreshedUponExpiration?1:e.ac(ln?Ke:1-gr,0,1);return qt.refreshedUponExpiration&&Ke>=1&&(qt.refreshedUponExpiration=!1),I?{opacity:1,mix:1-Sn}:{opacity:Sn,mix:0}}return{opacity:1,mix:0}}let Wf=new e.aM(1,0,0,1),Jl=new e.aM(0,1,0,1),Ef=new e.aM(0,0,1,1),Ld=new e.aM(1,0,1,1),Yf=new e.aM(0,1,1,1);function _f(qt,I,ht,Et){Nc(qt,0,I+ht/2,qt.transform.width,ht,Et)}function Kf(qt,I,ht,Et){Nc(qt,I-ht/2,0,ht,qt.transform.height,Et)}function Nc(qt,I,ht,Et,It,Vt){let ke=qt.context,Oe=ke.gl;Oe.enable(Oe.SCISSOR_TEST),Oe.scissor(I*qt.pixelRatio,ht*qt.pixelRatio,Et*qt.pixelRatio,It*qt.pixelRatio),ke.clear({color:Vt}),Oe.disable(Oe.SCISSOR_TEST)}function Xf(qt,I,ht){let Et=qt.context,It=Et.gl,Vt=ht.posMatrix,ke=qt.useProgram("debug"),Oe=Qs.disabled,Ke=Ll.disabled,gr=qt.colorModeForRenderPass(),Or="$debug",Dr=qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(ht);Et.activeTexture.set(It.TEXTURE0);let ln=I.getTileByID(ht.key).latestRawTileData,Sn=Math.floor((ln&&ln.byteLength||0)/1024),Xt=I.getTile(ht).tileSize,ae=512/Math.min(Xt,512)*(ht.overscaledZ/qt.transform.zoom)*.5,xe=ht.canonical.toString();ht.overscaledZ!==ht.canonical.z&&(xe+=` => ${ht.overscaledZ}`),function(Ae,je){Ae.initDebugOverlayCanvas();let Ie=Ae.debugOverlayCanvas,Ze=Ae.context.gl,wr=Ae.debugOverlayCanvas.getContext("2d");wr.clearRect(0,0,Ie.width,Ie.height),wr.shadowColor="white",wr.shadowBlur=2,wr.lineWidth=1.5,wr.strokeStyle="white",wr.textBaseline="top",wr.font="bold 36px Open Sans, sans-serif",wr.fillText(je,5,5),wr.strokeText(je,5,5),Ae.debugOverlayTexture.update(Ie),Ae.debugOverlayTexture.bind(Ze.LINEAR,Ze.CLAMP_TO_EDGE)}(qt,`${xe} ${Sn}kB`),ke.draw(Et,It.TRIANGLES,Oe,Ke,xu.alphaBlended,Jo.disabled,po(Vt,e.aM.transparent,ae),null,Or,qt.debugBuffer,qt.quadTriangleIndexBuffer,qt.debugSegments),ke.draw(Et,It.LINE_STRIP,Oe,Ke,gr,Jo.disabled,po(Vt,e.aM.red),Dr,Or,qt.debugBuffer,qt.tileBorderIndexBuffer,qt.debugSegments)}function zu(qt,I,ht){let Et=qt.context,It=Et.gl,Vt=qt.colorModeForRenderPass(),ke=new Qs(It.LEQUAL,Qs.ReadWrite,qt.depthRangeFor3D),Oe=qt.useProgram("terrain"),Ke=I.getTerrainMesh();Et.bindFramebuffer.set(null),Et.viewport.set([0,0,qt.width,qt.height]);for(let gr of ht){let Or=qt.renderToTexture.getTexture(gr),Dr=I.getTerrainData(gr.tileID);Et.activeTexture.set(It.TEXTURE0),It.bindTexture(It.TEXTURE_2D,Or.texture);let ln=qt.transform.calculatePosMatrix(gr.tileID.toUnwrapped()),Sn=I.getMeshFrameDelta(qt.transform.zoom),Xt=qt.transform.calculateFogMatrix(gr.tileID.toUnwrapped()),ae=Vr(ln,Sn,Xt,qt.style.sky,qt.transform.pitch);Oe.draw(Et,It.TRIANGLES,ke,Ll.disabled,Vt,Jo.backCCW,ae,Dr,"terrain",Ke.vertexBuffer,Ke.indexBuffer,Ke.segments)}}class jc{constructor(I,ht,Et){this.vertexBuffer=I,this.indexBuffer=ht,this.segments=Et}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Hh{constructor(I,ht){this.context=new Cd(I),this.transform=ht,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ge.maxUnderzooming+Ge.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new qr}resize(I,ht,Et){if(this.width=Math.floor(I*Et),this.height=Math.floor(ht*Et),this.pixelRatio=Et,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let It of this.style._order)this.style._layers[It].resize()}setup(){let I=this.context,ht=new e.aX;ht.emplaceBack(0,0),ht.emplaceBack(e.X,0),ht.emplaceBack(0,e.X),ht.emplaceBack(e.X,e.X),this.tileExtentBuffer=I.createVertexBuffer(ht,dn.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);let Et=new e.aX;Et.emplaceBack(0,0),Et.emplaceBack(e.X,0),Et.emplaceBack(0,e.X),Et.emplaceBack(e.X,e.X),this.debugBuffer=I.createVertexBuffer(Et,dn.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);let It=new e.$;It.emplaceBack(0,0,0,0),It.emplaceBack(e.X,0,e.X,0),It.emplaceBack(0,e.X,0,e.X),It.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=I.createVertexBuffer(It,Jt.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);let Vt=new e.aX;Vt.emplaceBack(0,0),Vt.emplaceBack(1,0),Vt.emplaceBack(0,1),Vt.emplaceBack(1,1),this.viewportBuffer=I.createVertexBuffer(Vt,dn.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);let ke=new e.aZ;ke.emplaceBack(0),ke.emplaceBack(1),ke.emplaceBack(3),ke.emplaceBack(2),ke.emplaceBack(0),this.tileBorderIndexBuffer=I.createIndexBuffer(ke);let Oe=new e.aY;Oe.emplaceBack(0,1,2),Oe.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=I.createIndexBuffer(Oe);let Ke=this.context.gl;this.stencilClearMode=new Ll({func:Ke.ALWAYS,mask:0},0,255,Ke.ZERO,Ke.ZERO,Ke.ZERO)}clearStencil(){let I=this.context,ht=I.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let Et=e.H();e.aP(Et,0,this.width,this.height,0,0,1),e.K(Et,Et,[ht.drawingBufferWidth,ht.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(I,ht.TRIANGLES,Qs.disabled,this.stencilClearMode,xu.disabled,Jo.disabled,Do(Et),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(I,ht){if(this.currentStencilSource===I.source||!I.isTileClipped()||!ht||!ht.length)return;this.currentStencilSource=I.source;let Et=this.context,It=Et.gl;this.nextStencilID+ht.length>256&&this.clearStencil(),Et.setColorMode(xu.disabled),Et.setDepthMode(Qs.disabled);let Vt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let ke of ht){let Oe=this._tileClippingMaskIDs[ke.key]=this.nextStencilID++,Ke=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ke);Vt.draw(Et,It.TRIANGLES,Qs.disabled,new Ll({func:It.ALWAYS,mask:0},Oe,255,It.KEEP,It.KEEP,It.REPLACE),xu.disabled,Jo.disabled,Do(ke.posMatrix),Ke,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let I=this.nextStencilID++,ht=this.context.gl;return new Ll({func:ht.NOTEQUAL,mask:255},I,255,ht.KEEP,ht.KEEP,ht.REPLACE)}stencilModeForClipping(I){let ht=this.context.gl;return new Ll({func:ht.EQUAL,mask:255},this._tileClippingMaskIDs[I.key],0,ht.KEEP,ht.KEEP,ht.REPLACE)}stencilConfigForOverlap(I){let ht=this.context.gl,Et=I.sort((ke,Oe)=>Oe.overscaledZ-ke.overscaledZ),It=Et[Et.length-1].overscaledZ,Vt=Et[0].overscaledZ-It+1;if(Vt>1){this.currentStencilSource=void 0,this.nextStencilID+Vt>256&&this.clearStencil();let ke={};for(let Oe=0;Oe<Vt;Oe++)ke[Oe+It]=new Ll({func:ht.GEQUAL,mask:255},Oe+this.nextStencilID,255,ht.KEEP,ht.KEEP,ht.REPLACE);return this.nextStencilID+=Vt,[ke,Et]}return[{[It]:Ll.disabled},Et]}colorModeForRenderPass(){let I=this.context.gl;return this._showOverdrawInspector?new xu([I.CONSTANT_COLOR,I.ONE],new e.aM(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?xu.unblended:xu.alphaBlended}depthModeForSublayer(I,ht,Et){if(!this.opaquePassEnabledForLayer())return Qs.disabled;let It=1-((1+this.currentLayer)*this.numSublayers+I)*this.depthEpsilon;return new Qs(Et||this.context.gl.LEQUAL,ht,[It,It])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(I,ht){this.style=I,this.options=ht,this.lineAtlas=I.lineAtlas,this.imageManager=I.imageManager,this.glyphManager=I.glyphManager,this.symbolFadeChange=I.placement.symbolFadeChange(o.now()),this.imageManager.beginFrame();let Et=this.style._order,It=this.style.sourceCaches,Vt={},ke={},Oe={};for(let Ke in It){let gr=It[Ke];gr.used&&gr.prepare(this.context),Vt[Ke]=gr.getVisibleCoordinates(),ke[Ke]=Vt[Ke].slice().reverse(),Oe[Ke]=gr.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Ke=0;Ke<Et.length;Ke++)if(this.style._layers[Et[Ke]].is3D()){this.opaquePassCutoff=Ke;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let Ke of Et){let gr=this.style._layers[Ke];if(!gr.hasOffscreenPass()||gr.isHidden(this.transform.zoom))continue;let Or=ke[gr.source];(gr.type==="custom"||Or.length)&&this.renderLayer(this,It[gr.source],gr,Or)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:ht.showOverdrawInspector?e.aM.black:e.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(Ke,gr){let Or=Ke.context,Dr=Or.gl,ln=((Ae,je,Ie)=>({u_sky_color:Ae.properties.get("sky-color"),u_horizon_color:Ae.properties.get("horizon-color"),u_horizon:(je.height/2+je.getHorizon())*Ie,u_sky_horizon_blend:Ae.properties.get("sky-horizon-blend")*je.height/2*Ie}))(gr,Ke.style.map.transform,Ke.pixelRatio),Sn=new Qs(Dr.LEQUAL,Qs.ReadWrite,[0,1]),Xt=Ll.disabled,ae=Ke.colorModeForRenderPass(),xe=Ke.useProgram("sky");if(!gr.mesh){let Ae=new e.aX;Ae.emplaceBack(-1,-1),Ae.emplaceBack(1,-1),Ae.emplaceBack(1,1),Ae.emplaceBack(-1,1);let je=new e.aY;je.emplaceBack(0,1,2),je.emplaceBack(0,2,3),gr.mesh=new jc(Or.createVertexBuffer(Ae,dn.members),Or.createIndexBuffer(je),e.a0.simpleSegment(0,0,Ae.length,je.length))}xe.draw(Or,Dr.TRIANGLES,Sn,Xt,ae,Jo.disabled,ln,void 0,"sky",gr.mesh.vertexBuffer,gr.mesh.indexBuffer,gr.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=ht.showOverdrawInspector,this.depthRangeFor3D=[0,1-(I._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Et.length-1;this.currentLayer>=0;this.currentLayer--){let Ke=this.style._layers[Et[this.currentLayer]],gr=It[Ke.source],Or=Vt[Ke.source];this._renderTileClippingMasks(Ke,Or),this.renderLayer(this,gr,Ke,Or)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<Et.length;this.currentLayer++){let Ke=this.style._layers[Et[this.currentLayer]],gr=It[Ke.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(Ke))continue;let Or=(Ke.type==="symbol"?Oe:ke)[Ke.source];this._renderTileClippingMasks(Ke,Vt[Ke.source]),this.renderLayer(this,gr,Ke,Or)}if(this.options.showTileBoundaries){let Ke=function(gr,Or){let Dr=null,ln=Object.values(gr._layers).flatMap(xe=>xe.source&&!xe.isHidden(Or)?[gr.sourceCaches[xe.source]]:[]),Sn=ln.filter(xe=>xe.getSource().type==="vector"),Xt=ln.filter(xe=>xe.getSource().type!=="vector"),ae=xe=>{(!Dr||Dr.getSource().maxzoom<xe.getSource().maxzoom)&&(Dr=xe)};return Sn.forEach(xe=>ae(xe)),Dr||Xt.forEach(xe=>ae(xe)),Dr}(this.style,this.transform.zoom);Ke&&function(gr,Or,Dr){for(let ln=0;ln<Dr.length;ln++)Xf(gr,Or,Dr[ln])}(this,Ke,Ke.getVisibleCoordinates())}this.options.showPadding&&function(Ke){let gr=Ke.transform.padding;_f(Ke,Ke.transform.height-(gr.top||0),3,Wf),_f(Ke,gr.bottom||0,3,Jl),Kf(Ke,gr.left||0,3,Ef),Kf(Ke,Ke.transform.width-(gr.right||0),3,Ld);let Or=Ke.transform.centerPoint;(function(Dr,ln,Sn,Xt){Nc(Dr,ln-1,Sn-10,2,20,Xt),Nc(Dr,ln-10,Sn-1,20,2,Xt)})(Ke,Or.x,Ke.transform.height-Or.y,Yf)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(I){if(!this.style||!this.style.map||!this.style.map.terrain)return;let ht=this.terrainFacilitator.matrix,Et=this.transform.modelViewProjectionMatrix,It=this.terrainFacilitator.dirty;It||(It=I?!e.a_(ht,Et):!e.a$(ht,Et)),It||(It=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),It&&(e.b0(ht,Et),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Vt,ke){let Oe=Vt.context,Ke=Oe.gl,gr=xu.unblended,Or=new Qs(Ke.LEQUAL,Qs.ReadWrite,[0,1]),Dr=ke.getTerrainMesh(),ln=ke.sourceCache.getRenderableTiles(),Sn=Vt.useProgram("terrainDepth");Oe.bindFramebuffer.set(ke.getFramebuffer("depth").framebuffer),Oe.viewport.set([0,0,Vt.width/devicePixelRatio,Vt.height/devicePixelRatio]),Oe.clear({color:e.aM.transparent,depth:1});for(let Xt of ln){let ae=ke.getTerrainData(Xt.tileID),xe={u_matrix:Vt.transform.calculatePosMatrix(Xt.tileID.toUnwrapped()),u_ele_delta:ke.getMeshFrameDelta(Vt.transform.zoom)};Sn.draw(Oe,Ke.TRIANGLES,Or,Ll.disabled,gr,Jo.backCCW,xe,ae,"terrain",Dr.vertexBuffer,Dr.indexBuffer,Dr.segments)}Oe.bindFramebuffer.set(null),Oe.viewport.set([0,0,Vt.width,Vt.height])}(this,this.style.map.terrain),function(Vt,ke){let Oe=Vt.context,Ke=Oe.gl,gr=xu.unblended,Or=new Qs(Ke.LEQUAL,Qs.ReadWrite,[0,1]),Dr=ke.getTerrainMesh(),ln=ke.getCoordsTexture(),Sn=ke.sourceCache.getRenderableTiles(),Xt=Vt.useProgram("terrainCoords");Oe.bindFramebuffer.set(ke.getFramebuffer("coords").framebuffer),Oe.viewport.set([0,0,Vt.width/devicePixelRatio,Vt.height/devicePixelRatio]),Oe.clear({color:e.aM.transparent,depth:1}),ke.coordsIndex=[];for(let ae of Sn){let xe=ke.getTerrainData(ae.tileID);Oe.activeTexture.set(Ke.TEXTURE0),Ke.bindTexture(Ke.TEXTURE_2D,ln.texture);let Ae={u_matrix:Vt.transform.calculatePosMatrix(ae.tileID.toUnwrapped()),u_terrain_coords_id:(255-ke.coordsIndex.length)/255,u_texture:0,u_ele_delta:ke.getMeshFrameDelta(Vt.transform.zoom)};Xt.draw(Oe,Ke.TRIANGLES,Or,Ll.disabled,gr,Jo.backCCW,Ae,xe,"terrain",Dr.vertexBuffer,Dr.indexBuffer,Dr.segments),ke.coordsIndex.push(ae.tileID.key)}Oe.bindFramebuffer.set(null),Oe.viewport.set([0,0,Vt.width,Vt.height])}(this,this.style.map.terrain))}renderLayer(I,ht,Et,It){if(!Et.isHidden(this.transform.zoom)&&(Et.type==="background"||Et.type==="custom"||(It||[]).length))switch(this.id=Et.id,Et.type){case"symbol":(function(Vt,ke,Oe,Ke,gr){if(Vt.renderPass!=="translucent")return;let Or=Ll.disabled,Dr=Vt.colorModeForRenderPass();(Oe._unevaluatedLayout.hasValue("text-variable-anchor")||Oe._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(ln,Sn,Xt,ae,xe,Ae,je,Ie,Ze){let wr=Sn.transform,Ir=Zi(),Nr=xe==="map",tn=Ae==="map";for(let mn of ln){let zn=ae.getTile(mn),Bn=zn.getBucket(Xt);if(!Bn||!Bn.text||!Bn.text.segments.get().length)continue;let ri=e.ag(Bn.textSizeData,wr.zoom),Fi=Hn(zn,1,Sn.transform.zoom),da=Kr(mn.posMatrix,tn,Nr,Sn.transform,Fi),ha=Xt.layout.get("icon-text-fit")!=="none"&&Bn.hasIconData();if(ri){let ka=Math.pow(2,wr.zoom-zn.tileID.overscaledZ),io=Sn.style.map.terrain?(Mo,hs)=>Sn.style.map.terrain.getElevation(mn,Mo,hs):null,Ro=Ir.translatePosition(wr,zn,je,Ie);yf(Bn,Nr,tn,Ze,wr,da,mn.posMatrix,ka,ri,ha,Ir,Ro,mn.toUnwrapped(),io)}}}(Ke,Vt,Oe,ke,Oe.layout.get("text-rotation-alignment"),Oe.layout.get("text-pitch-alignment"),Oe.paint.get("text-translate"),Oe.paint.get("text-translate-anchor"),gr),Oe.paint.get("icon-opacity").constantOr(1)!==0&&hd(Vt,ke,Oe,Ke,!1,Oe.paint.get("icon-translate"),Oe.paint.get("icon-translate-anchor"),Oe.layout.get("icon-rotation-alignment"),Oe.layout.get("icon-pitch-alignment"),Oe.layout.get("icon-keep-upright"),Or,Dr),Oe.paint.get("text-opacity").constantOr(1)!==0&&hd(Vt,ke,Oe,Ke,!0,Oe.paint.get("text-translate"),Oe.paint.get("text-translate-anchor"),Oe.layout.get("text-rotation-alignment"),Oe.layout.get("text-pitch-alignment"),Oe.layout.get("text-keep-upright"),Or,Dr),ke.map.showCollisionBoxes&&(sh(Vt,ke,Oe,Ke,!0),sh(Vt,ke,Oe,Ke,!1))})(I,ht,Et,It,this.style.placement.variableOffsets);break;case"circle":(function(Vt,ke,Oe,Ke){if(Vt.renderPass!=="translucent")return;let gr=Oe.paint.get("circle-opacity"),Or=Oe.paint.get("circle-stroke-width"),Dr=Oe.paint.get("circle-stroke-opacity"),ln=!Oe.layout.get("circle-sort-key").isConstant();if(gr.constantOr(1)===0&&(Or.constantOr(1)===0||Dr.constantOr(1)===0))return;let Sn=Vt.context,Xt=Sn.gl,ae=Vt.depthModeForSublayer(0,Qs.ReadOnly),xe=Ll.disabled,Ae=Vt.colorModeForRenderPass(),je=[];for(let Ie=0;Ie<Ke.length;Ie++){let Ze=Ke[Ie],wr=ke.getTile(Ze),Ir=wr.getBucket(Oe);if(!Ir)continue;let Nr=Ir.programConfigurations.get(Oe.id),tn=Vt.useProgram("circle",Nr),mn=Ir.layoutVertexBuffer,zn=Ir.indexBuffer,Bn=Vt.style.map.terrain&&Vt.style.map.terrain.getTerrainData(Ze),ri={programConfiguration:Nr,program:tn,layoutVertexBuffer:mn,indexBuffer:zn,uniformValues:Xa(Vt,Ze,wr,Oe),terrainData:Bn};if(ln){let Fi=Ir.segments.get();for(let da of Fi)je.push({segments:new e.a0([da]),sortKey:da.sortKey,state:ri})}else je.push({segments:Ir.segments,sortKey:0,state:ri})}ln&&je.sort((Ie,Ze)=>Ie.sortKey-Ze.sortKey);for(let Ie of je){let{programConfiguration:Ze,program:wr,layoutVertexBuffer:Ir,indexBuffer:Nr,uniformValues:tn,terrainData:mn}=Ie.state;wr.draw(Sn,Xt.TRIANGLES,ae,xe,Ae,Jo.disabled,tn,mn,Oe.id,Ir,Nr,Ie.segments,Oe.paint,Vt.transform.zoom,Ze)}})(I,ht,Et,It);break;case"heatmap":(function(Vt,ke,Oe,Ke){if(Oe.paint.get("heatmap-opacity")===0)return;let gr=Vt.context;if(Vt.style.map.terrain){for(let Or of Ke){let Dr=ke.getTile(Or);ke.hasRenderableParent(Or)||(Vt.renderPass==="offscreen"?xf(Vt,Dr,Oe,Or):Vt.renderPass==="translucent"&&Vh(Vt,Oe,Or))}gr.viewport.set([0,0,Vt.width,Vt.height])}else Vt.renderPass==="offscreen"?function(Or,Dr,ln,Sn){let Xt=Or.context,ae=Xt.gl,xe=Ll.disabled,Ae=new xu([ae.ONE,ae.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(je,Ie,Ze){let wr=je.gl;je.activeTexture.set(wr.TEXTURE1),je.viewport.set([0,0,Ie.width/4,Ie.height/4]);let Ir=Ze.heatmapFbos.get(e.aU);Ir?(wr.bindTexture(wr.TEXTURE_2D,Ir.colorAttachment.get()),je.bindFramebuffer.set(Ir.framebuffer)):(Ir=Vf(je,Ie.width/4,Ie.height/4),Ze.heatmapFbos.set(e.aU,Ir))})(Xt,Or,ln),Xt.clear({color:e.aM.transparent});for(let je=0;je<Sn.length;je++){let Ie=Sn[je];if(Dr.hasRenderableParent(Ie))continue;let Ze=Dr.getTile(Ie),wr=Ze.getBucket(ln);if(!wr)continue;let Ir=wr.programConfigurations.get(ln.id),Nr=Or.useProgram("heatmap",Ir),{zoom:tn}=Or.transform;Nr.draw(Xt,ae.TRIANGLES,Qs.disabled,xe,Ae,Jo.disabled,Ia(Ie.posMatrix,Ze,tn,ln.paint.get("heatmap-intensity")),null,ln.id,wr.layoutVertexBuffer,wr.indexBuffer,wr.segments,ln.paint,Or.transform.zoom,Ir)}Xt.viewport.set([0,0,Or.width,Or.height])}(Vt,ke,Oe,Ke):Vt.renderPass==="translucent"&&function(Or,Dr){let ln=Or.context,Sn=ln.gl;ln.setColorMode(Or.colorModeForRenderPass());let Xt=Dr.heatmapFbos.get(e.aU);Xt&&(ln.activeTexture.set(Sn.TEXTURE0),Sn.bindTexture(Sn.TEXTURE_2D,Xt.colorAttachment.get()),ln.activeTexture.set(Sn.TEXTURE1),Hf(ln,Dr).bind(Sn.LINEAR,Sn.CLAMP_TO_EDGE),Or.useProgram("heatmapTexture").draw(ln,Sn.TRIANGLES,Qs.disabled,Ll.disabled,Or.colorModeForRenderPass(),Jo.disabled,gs(Or,Dr,0,1),null,Dr.id,Or.viewportBuffer,Or.quadTriangleIndexBuffer,Or.viewportSegments,Dr.paint,Or.transform.zoom))}(Vt,Oe)})(I,ht,Et,It);break;case"line":(function(Vt,ke,Oe,Ke){if(Vt.renderPass!=="translucent")return;let gr=Oe.paint.get("line-opacity"),Or=Oe.paint.get("line-width");if(gr.constantOr(1)===0||Or.constantOr(1)===0)return;let Dr=Vt.depthModeForSublayer(0,Qs.ReadOnly),ln=Vt.colorModeForRenderPass(),Sn=Oe.paint.get("line-dasharray"),Xt=Oe.paint.get("line-pattern"),ae=Xt.constantOr(1),xe=Oe.paint.get("line-gradient"),Ae=Oe.getCrossfadeParameters(),je=ae?"linePattern":Sn?"lineSDF":xe?"lineGradient":"line",Ie=Vt.context,Ze=Ie.gl,wr=!0;for(let Ir of Ke){let Nr=ke.getTile(Ir);if(ae&&!Nr.patternsLoaded())continue;let tn=Nr.getBucket(Oe);if(!tn)continue;let mn=tn.programConfigurations.get(Oe.id),zn=Vt.context.program.get(),Bn=Vt.useProgram(je,mn),ri=wr||Bn.program!==zn,Fi=Vt.style.map.terrain&&Vt.style.map.terrain.getTerrainData(Ir),da=Xt.constantOr(null);if(da&&Nr.imageAtlas){let io=Nr.imageAtlas,Ro=io.patternPositions[da.to.toString()],Mo=io.patternPositions[da.from.toString()];Ro&&Mo&&mn.setConstantPatternPositions(Ro,Mo)}let ha=Fi?Ir:null,ka=ae?Gs(Vt,Nr,Oe,Ae,ha):Sn?as(Vt,Nr,Oe,Sn,Ae,ha):xe?Ho(Vt,Nr,Oe,tn.lineClipsArray.length,ha):ll(Vt,Nr,Oe,ha);if(ae)Ie.activeTexture.set(Ze.TEXTURE0),Nr.imageAtlasTexture.bind(Ze.LINEAR,Ze.CLAMP_TO_EDGE),mn.updatePaintBuffers(Ae);else if(Sn&&(ri||Vt.lineAtlas.dirty))Ie.activeTexture.set(Ze.TEXTURE0),Vt.lineAtlas.bind(Ie);else if(xe){let io=tn.gradients[Oe.id],Ro=io.texture;if(Oe.gradientVersion!==io.version){let Mo=256;if(Oe.stepInterpolant){let hs=ke.getSource().maxzoom,hl=Ir.canonical.z===hs?Math.ceil(1<<Vt.transform.maxZoom-Ir.canonical.z):1;Mo=e.ac(e.aV(tn.maxLineLength/e.X*1024*hl),256,Ie.maxTextureSize)}io.gradient=e.aW({expression:Oe.gradientExpression(),evaluationKey:"lineProgress",resolution:Mo,image:io.gradient||void 0,clips:tn.lineClipsArray}),io.texture?io.texture.update(io.gradient):io.texture=new p(Ie,io.gradient,Ze.RGBA),io.version=Oe.gradientVersion,Ro=io.texture}Ie.activeTexture.set(Ze.TEXTURE0),Ro.bind(Oe.stepInterpolant?Ze.NEAREST:Ze.LINEAR,Ze.CLAMP_TO_EDGE)}Bn.draw(Ie,Ze.TRIANGLES,Dr,Vt.stencilModeForClipping(Ir),ln,Jo.disabled,ka,Fi,Oe.id,tn.layoutVertexBuffer,tn.indexBuffer,tn.segments,Oe.paint,Vt.transform.zoom,mn,tn.layoutVertexBuffer2),wr=!1}})(I,ht,Et,It);break;case"fill":(function(Vt,ke,Oe,Ke){let gr=Oe.paint.get("fill-color"),Or=Oe.paint.get("fill-opacity");if(Or.constantOr(1)===0)return;let Dr=Vt.colorModeForRenderPass(),ln=Oe.paint.get("fill-pattern"),Sn=Vt.opaquePassEnabledForLayer()&&!ln.constantOr(1)&&gr.constantOr(e.aM.transparent).a===1&&Or.constantOr(0)===1?"opaque":"translucent";if(Vt.renderPass===Sn){let Xt=Vt.depthModeForSublayer(1,Vt.renderPass==="opaque"?Qs.ReadWrite:Qs.ReadOnly);Gf(Vt,ke,Oe,Ke,Xt,Dr,!1)}if(Vt.renderPass==="translucent"&&Oe.paint.get("fill-antialias")){let Xt=Vt.depthModeForSublayer(Oe.getPaintProperty("fill-outline-color")?2:0,Qs.ReadOnly);Gf(Vt,ke,Oe,Ke,Xt,Dr,!0)}})(I,ht,Et,It);break;case"fill-extrusion":(function(Vt,ke,Oe,Ke){let gr=Oe.paint.get("fill-extrusion-opacity");if(gr!==0&&Vt.renderPass==="translucent"){let Or=new Qs(Vt.context.gl.LEQUAL,Qs.ReadWrite,Vt.depthRangeFor3D);if(gr!==1||Oe.paint.get("fill-extrusion-pattern").constantOr(1))Sh(Vt,ke,Oe,Ke,Or,Ll.disabled,xu.disabled),Sh(Vt,ke,Oe,Ke,Or,Vt.stencilModeFor3D(),Vt.colorModeForRenderPass());else{let Dr=Vt.colorModeForRenderPass();Sh(Vt,ke,Oe,Ke,Or,Ll.disabled,Dr)}}})(I,ht,Et,It);break;case"hillshade":(function(Vt,ke,Oe,Ke){if(Vt.renderPass!=="offscreen"&&Vt.renderPass!=="translucent")return;let gr=Vt.context,Or=Vt.depthModeForSublayer(0,Qs.ReadOnly),Dr=Vt.colorModeForRenderPass(),[ln,Sn]=Vt.renderPass==="translucent"?Vt.stencilConfigForOverlap(Ke):[{},Ke];for(let Xt of Sn){let ae=ke.getTile(Xt);ae.needsHillshadePrepare!==void 0&&ae.needsHillshadePrepare&&Vt.renderPass==="offscreen"?uc(Vt,ae,Oe,Or,Ll.disabled,Dr):Vt.renderPass==="translucent"&&mh(Vt,Xt,ae,Oe,Or,ln[Xt.overscaledZ],Dr)}gr.viewport.set([0,0,Vt.width,Vt.height])})(I,ht,Et,It);break;case"raster":(function(Vt,ke,Oe,Ke){if(Vt.renderPass!=="translucent"||Oe.paint.get("raster-opacity")===0||!Ke.length)return;let gr=Vt.context,Or=gr.gl,Dr=ke.getSource(),ln=Vt.useProgram("raster"),Sn=Vt.colorModeForRenderPass(),[Xt,ae]=Dr instanceof ge?[{},Ke]:Vt.stencilConfigForOverlap(Ke),xe=ae[ae.length-1].overscaledZ,Ae=!Vt.options.moving;for(let je of ae){let Ie=Vt.depthModeForSublayer(je.overscaledZ-xe,Oe.paint.get("raster-opacity")===1?Qs.ReadWrite:Qs.ReadOnly,Or.LESS),Ze=ke.getTile(je);Ze.registerFadeDuration(Oe.paint.get("raster-fade-duration"));let wr=ke.findLoadedParent(je,0),Ir=ke.findLoadedSibling(je),Nr=ef(Ze,wr||Ir||null,ke,Oe,Vt.transform,Vt.style.map.terrain),tn,mn,zn=Oe.paint.get("raster-resampling")==="nearest"?Or.NEAREST:Or.LINEAR;gr.activeTexture.set(Or.TEXTURE0),Ze.texture.bind(zn,Or.CLAMP_TO_EDGE,Or.LINEAR_MIPMAP_NEAREST),gr.activeTexture.set(Or.TEXTURE1),wr?(wr.texture.bind(zn,Or.CLAMP_TO_EDGE,Or.LINEAR_MIPMAP_NEAREST),tn=Math.pow(2,wr.tileID.overscaledZ-Ze.tileID.overscaledZ),mn=[Ze.tileID.canonical.x*tn%1,Ze.tileID.canonical.y*tn%1]):Ze.texture.bind(zn,Or.CLAMP_TO_EDGE,Or.LINEAR_MIPMAP_NEAREST),Ze.texture.useMipmap&&gr.extTextureFilterAnisotropic&&Vt.transform.pitch>20&&Or.texParameterf(Or.TEXTURE_2D,gr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,gr.extTextureFilterAnisotropicMax);let Bn=Vt.style.map.terrain&&Vt.style.map.terrain.getTerrainData(je),ri=Bn?je:null,Fi=ri?ri.posMatrix:Vt.transform.calculatePosMatrix(je.toUnwrapped(),Ae),da=Rl(Fi,mn||[0,0],tn||1,Nr,Oe);Dr instanceof ge?ln.draw(gr,Or.TRIANGLES,Ie,Ll.disabled,Sn,Jo.disabled,da,Bn,Oe.id,Dr.boundsBuffer,Vt.quadTriangleIndexBuffer,Dr.boundsSegments):ln.draw(gr,Or.TRIANGLES,Ie,Xt[je.overscaledZ],Sn,Jo.disabled,da,Bn,Oe.id,Vt.rasterBoundsBuffer,Vt.quadTriangleIndexBuffer,Vt.rasterBoundsSegments)}})(I,ht,Et,It);break;case"background":(function(Vt,ke,Oe,Ke){let gr=Oe.paint.get("background-color"),Or=Oe.paint.get("background-opacity");if(Or===0)return;let Dr=Vt.context,ln=Dr.gl,Sn=Vt.transform,Xt=Sn.tileSize,ae=Oe.paint.get("background-pattern");if(Vt.isPatternMissing(ae))return;let xe=!ae&&gr.a===1&&Or===1&&Vt.opaquePassEnabledForLayer()?"opaque":"translucent";if(Vt.renderPass!==xe)return;let Ae=Ll.disabled,je=Vt.depthModeForSublayer(0,xe==="opaque"?Qs.ReadWrite:Qs.ReadOnly),Ie=Vt.colorModeForRenderPass(),Ze=Vt.useProgram(ae?"backgroundPattern":"background"),wr=Ke||Sn.coveringTiles({tileSize:Xt,terrain:Vt.style.map.terrain});ae&&(Dr.activeTexture.set(ln.TEXTURE0),Vt.imageManager.bind(Vt.context));let Ir=Oe.getCrossfadeParameters();for(let Nr of wr){let tn=Ke?Nr.posMatrix:Vt.transform.calculatePosMatrix(Nr.toUnwrapped()),mn=ae?Vl(tn,Or,Vt,ae,{tileID:Nr,tileSize:Xt},Ir):kl(tn,Or,gr),zn=Vt.style.map.terrain&&Vt.style.map.terrain.getTerrainData(Nr);Ze.draw(Dr,ln.TRIANGLES,je,Ae,Ie,Jo.disabled,mn,zn,Oe.id,Vt.tileExtentBuffer,Vt.quadTriangleIndexBuffer,Vt.tileExtentSegments)}})(I,0,Et,It);break;case"custom":(function(Vt,ke,Oe){let Ke=Vt.context,gr=Oe.implementation;if(Vt.renderPass==="offscreen"){let Or=gr.prerender;Or&&(Vt.setCustomLayerDefaults(),Ke.setColorMode(Vt.colorModeForRenderPass()),Or.call(gr,Ke.gl,Vt.transform.customLayerMatrix()),Ke.setDirty(),Vt.setBaseState())}else if(Vt.renderPass==="translucent"){Vt.setCustomLayerDefaults(),Ke.setColorMode(Vt.colorModeForRenderPass()),Ke.setStencilMode(Ll.disabled);let Or=gr.renderingMode==="3d"?new Qs(Vt.context.gl.LEQUAL,Qs.ReadWrite,Vt.depthRangeFor3D):Vt.depthModeForSublayer(0,Qs.ReadOnly);Ke.setDepthMode(Or),gr.render(Ke.gl,Vt.transform.customLayerMatrix(),{farZ:Vt.transform.farZ,nearZ:Vt.transform.nearZ,fov:Vt.transform._fov,modelViewProjectionMatrix:Vt.transform.modelViewProjectionMatrix,projectionMatrix:Vt.transform.projectionMatrix}),Ke.setDirty(),Vt.setBaseState(),Ke.bindFramebuffer.set(null)}})(I,0,Et)}}translatePosMatrix(I,ht,Et,It,Vt){if(!Et[0]&&!Et[1])return I;let ke=Vt?It==="map"?this.transform.angle:0:It==="viewport"?-this.transform.angle:0;if(ke){let gr=Math.sin(ke),Or=Math.cos(ke);Et=[Et[0]*Or-Et[1]*gr,Et[0]*gr+Et[1]*Or]}let Oe=[Vt?Et[0]:Hn(ht,Et[0],this.transform.zoom),Vt?Et[1]:Hn(ht,Et[1],this.transform.zoom),0],Ke=new Float32Array(16);return e.J(Ke,I,Oe),Ke}saveTileTexture(I){let ht=this._tileTextures[I.size[0]];ht?ht.push(I):this._tileTextures[I.size[0]]=[I]}getTileTexture(I){let ht=this._tileTextures[I];return ht&&ht.length>0?ht.pop():null}isPatternMissing(I){if(!I)return!1;if(!I.from||!I.to)return!0;let ht=this.imageManager.getPattern(I.from.toString()),Et=this.imageManager.getPattern(I.to.toString());return!ht||!Et}useProgram(I,ht){this.cache=this.cache||{};let Et=I+(ht?ht.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Et]||(this.cache[Et]=new Fn(this.context,an[I],ht,Yl[I],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Et]}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 I=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(I.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new p(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:I,drawingBufferHeight:ht}=this.context.gl;return this.width!==I||this.height!==ht}}class lu{constructor(I,ht){this.points=I,this.planes=ht}static fromInvProjectionMatrix(I,ht,Et){let It=Math.pow(2,Et),Vt=[[-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(Oe=>{let Ke=1/(Oe=e.af([],Oe,I))[3]/ht*It;return e.b1(Oe,Oe,[Ke,Ke,1/Oe[3],Ke])}),ke=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(Oe=>{let Ke=function(ln,Sn){var Xt=Sn[0],ae=Sn[1],xe=Sn[2],Ae=Xt*Xt+ae*ae+xe*xe;return Ae>0&&(Ae=1/Math.sqrt(Ae)),ln[0]=Sn[0]*Ae,ln[1]=Sn[1]*Ae,ln[2]=Sn[2]*Ae,ln}([],function(ln,Sn,Xt){var ae=Sn[0],xe=Sn[1],Ae=Sn[2],je=Xt[0],Ie=Xt[1],Ze=Xt[2];return ln[0]=xe*Ze-Ae*Ie,ln[1]=Ae*je-ae*Ze,ln[2]=ae*Ie-xe*je,ln}([],M([],Vt[Oe[0]],Vt[Oe[1]]),M([],Vt[Oe[2]],Vt[Oe[1]]))),gr=-((Or=Ke)[0]*(Dr=Vt[Oe[1]])[0]+Or[1]*Dr[1]+Or[2]*Dr[2]);var Or,Dr;return Ke.concat(gr)});return new lu(Vt,ke)}}class Eh{constructor(I,ht){this.min=I,this.max=ht,this.center=function(Et,It,Vt){return Et[0]=.5*It[0],Et[1]=.5*It[1],Et[2]=.5*It[2],Et}([],function(Et,It,Vt){return Et[0]=It[0]+Vt[0],Et[1]=It[1]+Vt[1],Et[2]=It[2]+Vt[2],Et}([],this.min,this.max))}quadrant(I){let ht=[I%2==0,I<2],Et=_(this.min),It=_(this.max);for(let Vt=0;Vt<ht.length;Vt++)Et[Vt]=ht[Vt]?this.min[Vt]:this.center[Vt],It[Vt]=ht[Vt]?this.center[Vt]:this.max[Vt];return It[2]=this.max[2],new Eh(Et,It)}distanceX(I){return Math.max(Math.min(this.max[0],I[0]),this.min[0])-I[0]}distanceY(I){return Math.max(Math.min(this.max[1],I[1]),this.min[1])-I[1]}intersects(I){let ht=[[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]],Et=!0;for(let It=0;It<I.planes.length;It++){let Vt=I.planes[It],ke=0;for(let Oe=0;Oe<ht.length;Oe++)e.b2(Vt,ht[Oe])>=0&&ke++;if(ke===0)return 0;ke!==ht.length&&(Et=!1)}if(Et)return 2;for(let It=0;It<3;It++){let Vt=Number.MAX_VALUE,ke=-Number.MAX_VALUE;for(let Oe=0;Oe<I.points.length;Oe++){let Ke=I.points[Oe][It]-this.min[It];Vt=Math.min(Vt,Ke),ke=Math.max(ke,Ke)}if(ke<0||Vt>this.max[It]-this.min[It])return 0}return 1}}class Sc{constructor(I=0,ht=0,Et=0,It=0){if(isNaN(I)||I<0||isNaN(ht)||ht<0||isNaN(Et)||Et<0||isNaN(It)||It<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=I,this.bottom=ht,this.left=Et,this.right=It}interpolate(I,ht,Et){return ht.top!=null&&I.top!=null&&(this.top=e.y.number(I.top,ht.top,Et)),ht.bottom!=null&&I.bottom!=null&&(this.bottom=e.y.number(I.bottom,ht.bottom,Et)),ht.left!=null&&I.left!=null&&(this.left=e.y.number(I.left,ht.left,Et)),ht.right!=null&&I.right!=null&&(this.right=e.y.number(I.right,ht.right,Et)),this}getCenter(I,ht){let Et=e.ac((this.left+I-this.right)/2,0,I),It=e.ac((this.top+ht-this.bottom)/2,0,ht);return new e.P(Et,It)}equals(I){return this.top===I.top&&this.bottom===I.bottom&&this.left===I.left&&this.right===I.right}clone(){return new Sc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Uc=85.051129;class _u{constructor(I,ht,Et,It,Vt){this.tileSize=512,this._renderWorldCopies=Vt===void 0||!!Vt,this._minZoom=I||0,this._maxZoom=ht||22,this._minPitch=Et??0,this._maxPitch=It??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 Sc,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let I=new _u(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return I.apply(this),I}apply(I){this.tileSize=I.tileSize,this.latRange=I.latRange,this.lngRange=I.lngRange,this.width=I.width,this.height=I.height,this._center=I._center,this._elevation=I._elevation,this.minElevationForCurrentTile=I.minElevationForCurrentTile,this.zoom=I.zoom,this.angle=I.angle,this._fov=I._fov,this._pitch=I._pitch,this._unmodified=I._unmodified,this._edgeInsets=I._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(I){this._minZoom!==I&&(this._minZoom=I,this.zoom=Math.max(this.zoom,I))}get maxZoom(){return this._maxZoom}set maxZoom(I){this._maxZoom!==I&&(this._maxZoom=I,this.zoom=Math.min(this.zoom,I))}get minPitch(){return this._minPitch}set minPitch(I){this._minPitch!==I&&(this._minPitch=I,this.pitch=Math.max(this.pitch,I))}get maxPitch(){return this._maxPitch}set maxPitch(I){this._maxPitch!==I&&(this._maxPitch=I,this.pitch=Math.min(this.pitch,I))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(I){I===void 0?I=!0:I===null&&(I=!1),this._renderWorldCopies=I}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(I){let ht=-e.b3(I,-180,180)*Math.PI/180;this.angle!==ht&&(this._unmodified=!1,this.angle=ht,this._calcMatrices(),this.rotationMatrix=function(){var Et=new e.A(4);return e.A!=Float32Array&&(Et[1]=0,Et[2]=0),Et[0]=1,Et[3]=1,Et}(),function(Et,It,Vt){var ke=It[0],Oe=It[1],Ke=It[2],gr=It[3],Or=Math.sin(Vt),Dr=Math.cos(Vt);Et[0]=ke*Dr+Ke*Or,Et[1]=Oe*Dr+gr*Or,Et[2]=ke*-Or+Ke*Dr,Et[3]=Oe*-Or+gr*Dr}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(I){let ht=e.ac(I,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ht&&(this._unmodified=!1,this._pitch=ht,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(I){I=Math.max(.01,Math.min(60,I)),this._fov!==I&&(this._unmodified=!1,this._fov=I/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(I){let ht=Math.min(Math.max(I,this.minZoom),this.maxZoom);this._zoom!==ht&&(this._unmodified=!1,this._zoom=ht,this.tileZoom=Math.max(0,Math.floor(ht)),this.scale=this.zoomScale(ht),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(I){I.lat===this._center.lat&&I.lng===this._center.lng||(this._unmodified=!1,this._center=I,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(I){I!==this._elevation&&(this._elevation=I,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(I){this._edgeInsets.equals(I)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,I,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(I){return this._edgeInsets.equals(I)}interpolatePadding(I,ht,Et){this._unmodified=!1,this._edgeInsets.interpolate(I,ht,Et),this._constrain(),this._calcMatrices()}coveringZoomLevel(I){let ht=(I.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/I.tileSize));return Math.max(0,ht)}getVisibleUnwrappedCoordinates(I){let ht=[new e.b4(0,I)];if(this._renderWorldCopies){let Et=this.pointCoordinate(new e.P(0,0)),It=this.pointCoordinate(new e.P(this.width,0)),Vt=this.pointCoordinate(new e.P(this.width,this.height)),ke=this.pointCoordinate(new e.P(0,this.height)),Oe=Math.floor(Math.min(Et.x,It.x,Vt.x,ke.x)),Ke=Math.floor(Math.max(Et.x,It.x,Vt.x,ke.x)),gr=1;for(let Or=Oe-gr;Or<=Ke+gr;Or++)Or!==0&&ht.push(new e.b4(Or,I))}return ht}coveringTiles(I){var ht,Et;let It=this.coveringZoomLevel(I),Vt=It;if(I.minzoom!==void 0&&It<I.minzoom)return[];I.maxzoom!==void 0&&It>I.maxzoom&&(It=I.maxzoom);let ke=this.pointCoordinate(this.getCameraPoint()),Oe=e.Z.fromLngLat(this.center),Ke=Math.pow(2,It),gr=[Ke*ke.x,Ke*ke.y,0],Or=[Ke*Oe.x,Ke*Oe.y,0],Dr=lu.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,It),ln=I.minzoom||0;!I.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(ln=It);let Sn=I.terrain?2/Math.min(this.tileSize,I.tileSize)*this.tileSize:3,Xt=Ie=>({aabb:new Eh([Ie*Ke,0,0],[(Ie+1)*Ke,Ke,0]),zoom:0,x:0,y:0,wrap:Ie,fullyVisible:!1}),ae=[],xe=[],Ae=It,je=I.reparseOverscaled?Vt:It;if(this._renderWorldCopies)for(let Ie=1;Ie<=3;Ie++)ae.push(Xt(-Ie)),ae.push(Xt(Ie));for(ae.push(Xt(0));ae.length>0;){let Ie=ae.pop(),Ze=Ie.x,wr=Ie.y,Ir=Ie.fullyVisible;if(!Ir){let Bn=Ie.aabb.intersects(Dr);if(Bn===0)continue;Ir=Bn===2}let Nr=I.terrain?gr:Or,tn=Ie.aabb.distanceX(Nr),mn=Ie.aabb.distanceY(Nr),zn=Math.max(Math.abs(tn),Math.abs(mn));if(Ie.zoom===Ae||zn>Sn+(1<<Ae-Ie.zoom)-2&&Ie.zoom>=ln){let Bn=Ae-Ie.zoom,ri=gr[0]-.5-(Ze<<Bn),Fi=gr[1]-.5-(wr<<Bn);xe.push({tileID:new e.S(Ie.zoom===Ae?je:Ie.zoom,Ie.wrap,Ie.zoom,Ze,wr),distanceSq:E([Or[0]-.5-Ze,Or[1]-.5-wr]),tileDistanceToCamera:Math.sqrt(ri*ri+Fi*Fi)})}else for(let Bn=0;Bn<4;Bn++){let ri=(Ze<<1)+Bn%2,Fi=(wr<<1)+(Bn>>1),da=Ie.zoom+1,ha=Ie.aabb.quadrant(Bn);if(I.terrain){let ka=new e.S(da,Ie.wrap,da,ri,Fi),io=I.terrain.getMinMaxElevation(ka),Ro=(ht=io.minElevation)!==null&&ht!==void 0?ht:this.elevation,Mo=(Et=io.maxElevation)!==null&&Et!==void 0?Et:this.elevation;ha=new Eh([ha.min[0],ha.min[1],Ro],[ha.max[0],ha.max[1],Mo])}ae.push({aabb:ha,zoom:da,x:ri,y:Fi,wrap:Ie.wrap,fullyVisible:Ir})}}return xe.sort((Ie,Ze)=>Ie.distanceSq-Ze.distanceSq).map(Ie=>Ie.tileID)}resize(I,ht){this.width=I,this.height=ht,this.pixelsToGLUnits=[2/I,-2/ht],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(I){return Math.pow(2,I)}scaleZoom(I){return Math.log(I)/Math.LN2}project(I){let ht=e.ac(I.lat,-85.051129,Uc);return new e.P(e.O(I.lng)*this.worldSize,e.Q(ht)*this.worldSize)}unproject(I){return new e.Z(I.x/this.worldSize,I.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(I){let ht=this.elevation,Et=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,It=this.pointLocation(this.centerPoint,I),Vt=I.getElevationForLngLatZoom(It,this.tileZoom);if(!(this.elevation-Vt))return;let ke=Et+ht-Vt,Oe=Math.cos(this._pitch)*this.cameraToCenterDistance/ke/e.b5(1,It.lat),Ke=this.scaleZoom(Oe/this.tileSize);this._elevation=Vt,this._center=It,this.zoom=Ke}setLocationAtPoint(I,ht){let Et=this.pointCoordinate(ht),It=this.pointCoordinate(this.centerPoint),Vt=this.locationCoordinate(I),ke=new e.Z(Vt.x-(Et.x-It.x),Vt.y-(Et.y-It.y));this.center=this.coordinateLocation(ke),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(I,ht){return ht?this.coordinatePoint(this.locationCoordinate(I),ht.getElevationForLngLatZoom(I,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(I))}pointLocation(I,ht){return this.coordinateLocation(this.pointCoordinate(I,ht))}locationCoordinate(I){return e.Z.fromLngLat(I)}coordinateLocation(I){return I&&I.toLngLat()}pointCoordinate(I,ht){if(ht){let ln=ht.pointCoordinate(I);if(ln!=null)return ln}let Et=[I.x,I.y,0,1],It=[I.x,I.y,1,1];e.af(Et,Et,this.pixelMatrixInverse),e.af(It,It,this.pixelMatrixInverse);let Vt=Et[3],ke=It[3],Oe=Et[1]/Vt,Ke=It[1]/ke,gr=Et[2]/Vt,Or=It[2]/ke,Dr=gr===Or?0:(0-gr)/(Or-gr);return new e.Z(e.y.number(Et[0]/Vt,It[0]/ke,Dr)/this.worldSize,e.y.number(Oe,Ke,Dr)/this.worldSize)}coordinatePoint(I,ht=0,Et=this.pixelMatrix){let It=[I.x*this.worldSize,I.y*this.worldSize,ht,1];return e.af(It,It,Et),new e.P(It[0]/It[3],It[1]/It[3])}getBounds(){let I=Math.max(0,this.height/2-this.getHorizon());return new ut().extend(this.pointLocation(new e.P(0,I))).extend(this.pointLocation(new e.P(this.width,I))).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 ut([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(I){I?(this.lngRange=[I.getWest(),I.getEast()],this.latRange=[I.getSouth(),I.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Uc])}calculateTileMatrix(I){let ht=I.canonical,Et=this.worldSize/this.zoomScale(ht.z),It=ht.x+Math.pow(2,ht.z)*I.wrap,Vt=e.an(new Float64Array(16));return e.J(Vt,Vt,[It*Et,ht.y*Et,0]),e.K(Vt,Vt,[Et/e.X,Et/e.X,1]),Vt}calculatePosMatrix(I,ht=!1){let Et=I.key,It=ht?this._alignedPosMatrixCache:this._posMatrixCache;if(It[Et])return It[Et];let Vt=this.calculateTileMatrix(I);return e.L(Vt,ht?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Vt),It[Et]=new Float32Array(Vt),It[Et]}calculateFogMatrix(I){let ht=I.key,Et=this._fogMatrixCache;if(Et[ht])return Et[ht];let It=this.calculateTileMatrix(I);return e.L(It,this.fogMatrix,It),Et[ht]=new Float32Array(It),Et[ht]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(I,ht){ht=e.ac(+ht,this.minZoom,this.maxZoom);let Et={center:new e.N(I.lng,I.lat),zoom:ht},It=this.lngRange;if(!this._renderWorldCopies&&It===null){let Ie=179.9999999999;It=[-Ie,Ie]}let Vt=this.tileSize*this.zoomScale(Et.zoom),ke=0,Oe=Vt,Ke=0,gr=Vt,Or=0,Dr=0,{x:ln,y:Sn}=this.size;if(this.latRange){let Ie=this.latRange;ke=e.Q(Ie[1])*Vt,Oe=e.Q(Ie[0])*Vt,Oe-ke<Sn&&(Or=Sn/(Oe-ke))}It&&(Ke=e.b3(e.O(It[0])*Vt,0,Vt),gr=e.b3(e.O(It[1])*Vt,0,Vt),gr<Ke&&(gr+=Vt),gr-Ke<ln&&(Dr=ln/(gr-Ke)));let{x:Xt,y:ae}=this.project.call({worldSize:Vt},I),xe,Ae,je=Math.max(Dr||0,Or||0);if(je){let Ie=new e.P(Dr?(gr+Ke)/2:Xt,Or?(Oe+ke)/2:ae);return Et.center=this.unproject.call({worldSize:Vt},Ie).wrap(),Et.zoom+=this.scaleZoom(je),Et}if(this.latRange){let Ie=Sn/2;ae-Ie<ke&&(Ae=ke+Ie),ae+Ie>Oe&&(Ae=Oe-Ie)}if(It){let Ie=(Ke+gr)/2,Ze=Xt;this._renderWorldCopies&&(Ze=e.b3(Xt,Ie-Vt/2,Ie+Vt/2));let wr=ln/2;Ze-wr<Ke&&(xe=Ke+wr),Ze+wr>gr&&(xe=gr-wr)}if(xe!==void 0||Ae!==void 0){let Ie=new e.P(xe??Xt,Ae??ae);Et.center=this.unproject.call({worldSize:Vt},Ie).wrap()}return Et}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let I=this._unmodified,{center:ht,zoom:Et}=this.getConstrained(this.center,this.zoom);this.center=ht,this.zoom=Et,this._unmodified=I,this._constraining=!1}_calcMatrices(){if(!this.height)return;let I=this.centerOffset,ht=this.point.x,Et=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let It=e.an(new Float64Array(16));e.K(It,It,[this.width/2,-this.height/2,1]),e.J(It,It,[1,-1,0]),this.labelPlaneMatrix=It,It=e.an(new Float64Array(16)),e.K(It,It,[1,-1,1]),e.J(It,It,[-1,-1,0]),e.K(It,It,[2/this.width,2/this.height,1]),this.glCoordMatrix=It;let Vt=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ke=Math.min(this.elevation,this.minElevationForCurrentTile),Oe=Vt-ke*this._pixelPerMeter/Math.cos(this._pitch),Ke=ke<0?Oe:Vt,gr=Math.PI/2+this._pitch,Or=this._fov*(.5+I.y/this.height),Dr=Math.sin(Or)*Ke/Math.sin(e.ac(Math.PI-gr-Or,.01,Math.PI-.01)),ln=this.getHorizon(),Sn=2*Math.atan(ln/this.cameraToCenterDistance)*(.5+I.y/(2*ln)),Xt=Math.sin(Sn)*Ke/Math.sin(e.ac(Math.PI-gr-Sn,.01,Math.PI-.01)),ae=Math.min(Dr,Xt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*ae+Ke),this.nearZ=this.height/50,It=new Float64Array(16),e.b6(It,this._fov,this.width/this.height,this.nearZ,this.farZ),It[8]=2*-I.x/this.width,It[9]=2*I.y/this.height,this.projectionMatrix=e.ae(It),e.K(It,It,[1,-1,1]),e.J(It,It,[0,0,-this.cameraToCenterDistance]),e.b7(It,It,this._pitch),e.ad(It,It,this.angle),e.J(It,It,[-ht,-Et,0]),this.mercatorMatrix=e.K([],It,[this.worldSize,this.worldSize,this.worldSize]),e.K(It,It,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,It),e.J(It,It,[0,0,-this.elevation]),this.modelViewProjectionMatrix=It,this.invModelViewProjectionMatrix=e.as([],It),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,Vt,this.farZ),this.fogMatrix[8]=2*-I.x/this.width,this.fogMatrix[9]=2*I.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,[-ht,-Et,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,It);let xe=this.width%2/2,Ae=this.height%2/2,je=Math.cos(this.angle),Ie=Math.sin(this.angle),Ze=ht-Math.round(ht)+je*xe+Ie*Ae,wr=Et-Math.round(Et)+je*Ae+Ie*xe,Ir=new Float64Array(It);if(e.J(Ir,Ir,[Ze>.5?Ze-1:Ze,wr>.5?wr-1:wr,0]),this.alignedModelViewProjectionMatrix=Ir,It=e.as(new Float64Array(16),this.pixelMatrix),!It)throw new Error("failed to invert matrix");this.pixelMatrixInverse=It,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let I=this.pointCoordinate(new e.P(0,0)),ht=[I.x*this.worldSize,I.y*this.worldSize,0,1];return e.af(ht,ht,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let I=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,I))}getCameraQueryGeometry(I){let ht=this.getCameraPoint();if(I.length===1)return[I[0],ht];{let Et=ht.x,It=ht.y,Vt=ht.x,ke=ht.y;for(let Oe of I)Et=Math.min(Et,Oe.x),It=Math.min(It,Oe.y),Vt=Math.max(Vt,Oe.x),ke=Math.max(ke,Oe.y);return[new e.P(Et,It),new e.P(Vt,It),new e.P(Vt,ke),new e.P(Et,ke),new e.P(Et,It)]}}lngLatToCameraDepth(I,ht){let Et=this.locationCoordinate(I),It=[Et.x*this.worldSize,Et.y*this.worldSize,ht,1];return e.af(It,It,this.modelViewProjectionMatrix),It[2]/It[3]}}function uf(qt,I){let ht,Et=!1,It=null,Vt=null,ke=()=>{It=null,Et&&(qt.apply(Vt,ht),It=setTimeout(ke,I),Et=!1)};return(...Oe)=>(Et=!0,Vt=this,ht=Oe,It||ke(),It)}class gh{constructor(I){this._getCurrentHash=()=>{let ht=window.location.hash.replace("#","");if(this._hashName){let Et;return ht.split("&").map(It=>It.split("=")).forEach(It=>{It[0]===this._hashName&&(Et=It)}),(Et&&Et[1]||"").split("/")}return ht.split("/")},this._onHashChange=()=>{let ht=this._getCurrentHash();if(ht.length>=3&&!ht.some(Et=>isNaN(Et))){let Et=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ht[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ht[2],+ht[1]],zoom:+ht[0],bearing:Et,pitch:+(ht[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let ht=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,ht)},this._removeHash=()=>{let ht=this._getCurrentHash();if(ht.length===0)return;let Et=ht.join("/"),It=Et;It.split("&").length>0&&(It=It.split("&")[0]),this._hashName&&(It=`${this._hashName}=${Et}`);let Vt=window.location.hash.replace(It,"");Vt.startsWith("#&")?Vt=Vt.slice(0,1)+Vt.slice(2):Vt==="#"&&(Vt="");let ke=window.location.href.replace(/(#.+)?$/,Vt);ke=ke.replace("&&","&"),window.history.replaceState(window.history.state,null,ke)},this._updateHash=uf(this._updateHashUnthrottled,300),this._hashName=I&&encodeURIComponent(I)}addTo(I){return this._map=I,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(I){let ht=this._map.getCenter(),Et=Math.round(100*this._map.getZoom())/100,It=Math.ceil((Et*Math.LN2+Math.log(512/360/.5))/Math.LN10),Vt=Math.pow(10,It),ke=Math.round(ht.lng*Vt)/Vt,Oe=Math.round(ht.lat*Vt)/Vt,Ke=this._map.getBearing(),gr=this._map.getPitch(),Or="";if(Or+=I?`/${ke}/${Oe}/${Et}`:`${Et}/${Oe}/${ke}`,(Ke||gr)&&(Or+="/"+Math.round(10*Ke)/10),gr&&(Or+=`/${Math.round(gr)}`),this._hashName){let Dr=this._hashName,ln=!1,Sn=window.location.hash.slice(1).split("&").map(Xt=>{let ae=Xt.split("=")[0];return ae===Dr?(ln=!0,`${ae}=${Or}`):Xt}).filter(Xt=>Xt);return ln||Sn.push(`${Dr}=${Or}`),`#${Sn.join("&")}`}return`#${Or}`}}let Wh={linearity:.3,easing:e.b8(0,0,.3,1)},Cf=e.e({deceleration:2500,maxSpeed:1400},Wh),Pd=e.e({deceleration:20,maxSpeed:1400},Wh),Qd=e.e({deceleration:1e3,maxSpeed:360},Wh),cf=e.e({deceleration:1e3,maxSpeed:90},Wh);class Lf{constructor(I){this._map=I,this.clear()}clear(){this._inertiaBuffer=[]}record(I){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.now(),settings:I})}_drainInertiaBuffer(){let I=this._inertiaBuffer,ht=o.now();for(;I.length>0&&ht-I[0].time>160;)I.shift()}_onMoveEnd(I){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let ht={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:Vt}of this._inertiaBuffer)ht.zoom+=Vt.zoomDelta||0,ht.bearing+=Vt.bearingDelta||0,ht.pitch+=Vt.pitchDelta||0,Vt.panDelta&&ht.pan._add(Vt.panDelta),Vt.around&&(ht.around=Vt.around),Vt.pinchAround&&(ht.pinchAround=Vt.pinchAround);let Et=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,It={};if(ht.pan.mag()){let Vt=hf(ht.pan.mag(),Et,e.e({},Cf,I||{}));It.offset=ht.pan.mult(Vt.amount/ht.pan.mag()),It.center=this._map.transform.center,wc(It,Vt)}if(ht.zoom){let Vt=hf(ht.zoom,Et,Pd);It.zoom=this._map.transform.zoom+Vt.amount,wc(It,Vt)}if(ht.bearing){let Vt=hf(ht.bearing,Et,Qd);It.bearing=this._map.transform.bearing+e.ac(Vt.amount,-179,179),wc(It,Vt)}if(ht.pitch){let Vt=hf(ht.pitch,Et,cf);It.pitch=this._map.transform.pitch+Vt.amount,wc(It,Vt)}if(It.zoom||It.bearing){let Vt=ht.pinchAround===void 0?ht.around:ht.pinchAround;It.around=Vt?this._map.unproject(Vt):this._map.getCenter()}return this.clear(),e.e(It,{noMoveStart:!0})}}function wc(qt,I){(!qt.duration||qt.duration<I.duration)&&(qt.duration=I.duration,qt.easing=I.easing)}function hf(qt,I,ht){let{maxSpeed:Et,linearity:It,deceleration:Vt}=ht,ke=e.ac(qt*It/(I/1e3),-Et,Et),Oe=Math.abs(ke)/(Vt*It);return{easing:ht.easing,duration:1e3*Oe,amount:ke*(Oe/2)}}class Qc extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(I,ht,Et,It={}){let Vt=i.mousePos(ht.getCanvas(),Et),ke=ht.unproject(Vt);super(I,e.e({point:Vt,lngLat:ke,originalEvent:Et},It)),this._defaultPrevented=!1,this.target=ht}}class ff extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(I,ht,Et){let It=I==="touchend"?Et.changedTouches:Et.touches,Vt=i.touchPos(ht.getCanvasContainer(),It),ke=Vt.map(Ke=>ht.unproject(Ke)),Oe=Vt.reduce((Ke,gr,Or,Dr)=>Ke.add(gr.div(Dr.length)),new e.P(0,0));super(I,{points:Vt,point:Oe,lngLats:ke,lngLat:ht.unproject(Oe),originalEvent:Et}),this._defaultPrevented=!1}}class Pf extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(I,ht,Et){super(I,{originalEvent:Et}),this._defaultPrevented=!1}}class vh{constructor(I,ht){this._map=I,this._clickTolerance=ht.clickTolerance}reset(){delete this._mousedownPos}wheel(I){return this._firePreventable(new Pf(I.type,this._map,I))}mousedown(I,ht){return this._mousedownPos=ht,this._firePreventable(new Qc(I.type,this._map,I))}mouseup(I){this._map.fire(new Qc(I.type,this._map,I))}click(I,ht){this._mousedownPos&&this._mousedownPos.dist(ht)>=this._clickTolerance||this._map.fire(new Qc(I.type,this._map,I))}dblclick(I){return this._firePreventable(new Qc(I.type,this._map,I))}mouseover(I){this._map.fire(new Qc(I.type,this._map,I))}mouseout(I){this._map.fire(new Qc(I.type,this._map,I))}touchstart(I){return this._firePreventable(new ff(I.type,this._map,I))}touchmove(I){this._map.fire(new ff(I.type,this._map,I))}touchend(I){this._map.fire(new ff(I.type,this._map,I))}touchcancel(I){this._map.fire(new ff(I.type,this._map,I))}_firePreventable(I){if(this._map.fire(I),I.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class bu{constructor(I){this._map=I}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(I){this._map.fire(new Qc(I.type,this._map,I))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Qc("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(I){this._delayContextMenu?this._contextMenuEvent=I:this._ignoreContextMenu||this._map.fire(new Qc(I.type,this._map,I)),this._map.listens("contextmenu")&&I.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ch{constructor(I){this._map=I}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(I){return this.transform.pointLocation(e.P.convert(I),this._map.terrain)}}class Vc{constructor(I,ht){this._map=I,this._tr=new Ch(I),this._el=I.getCanvasContainer(),this._container=I.getContainer(),this._clickTolerance=ht.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(I,ht){this.isEnabled()&&I.shiftKey&&I.button===0&&(i.disableDrag(),this._startPos=this._lastPos=ht,this._active=!0)}mousemoveWindow(I,ht){if(!this._active)return;let Et=ht;if(this._lastPos.equals(Et)||!this._box&&Et.dist(this._startPos)<this._clickTolerance)return;let It=this._startPos;this._lastPos=Et,this._box||(this._box=i.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",I));let Vt=Math.min(It.x,Et.x),ke=Math.max(It.x,Et.x),Oe=Math.min(It.y,Et.y),Ke=Math.max(It.y,Et.y);i.setTransform(this._box,`translate(${Vt}px,${Oe}px)`),this._box.style.width=ke-Vt+"px",this._box.style.height=Ke-Oe+"px"}mouseupWindow(I,ht){if(!this._active||I.button!==0)return;let Et=this._startPos,It=ht;if(this.reset(),i.suppressClick(),Et.x!==It.x||Et.y!==It.y)return this._map.fire(new e.k("boxzoomend",{originalEvent:I})),{cameraAnimation:Vt=>Vt.fitScreenCoordinates(Et,It,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",I)}keydown(I){this._active&&I.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",I))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(i.remove(this._box),this._box=null),i.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(I,ht){return this._map.fire(new e.k(I,{originalEvent:ht}))}}function fd(qt,I){if(qt.length!==I.length)throw new Error(`The number of touches and points are not equal - touches ${qt.length}, points ${I.length}`);let ht={};for(let Et=0;Et<qt.length;Et++)ht[qt[Et].identifier]=I[Et];return ht}class vu{constructor(I){this.reset(),this.numTouches=I.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(I,ht,Et){(this.centroid||Et.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=I.timeStamp),Et.length===this.numTouches&&(this.centroid=function(It){let Vt=new e.P(0,0);for(let ke of It)Vt._add(ke);return Vt.div(It.length)}(ht),this.touches=fd(Et,ht)))}touchmove(I,ht,Et){if(this.aborted||!this.centroid)return;let It=fd(Et,ht);for(let Vt in this.touches){let ke=It[Vt];(!ke||ke.dist(this.touches[Vt])>30)&&(this.aborted=!0)}}touchend(I,ht,Et){if((!this.centroid||I.timeStamp-this.startTime>500)&&(this.aborted=!0),Et.length===0){let It=!this.aborted&&this.centroid;if(this.reset(),It)return It}}}class bf{constructor(I){this.singleTap=new vu(I),this.numTaps=I.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(I,ht,Et){this.singleTap.touchstart(I,ht,Et)}touchmove(I,ht,Et){this.singleTap.touchmove(I,ht,Et)}touchend(I,ht,Et){let It=this.singleTap.touchend(I,ht,Et);if(It){let Vt=I.timeStamp-this.lastTime<500,ke=!this.lastTap||this.lastTap.dist(It)<30;if(Vt&&ke||this.reset(),this.count++,this.lastTime=I.timeStamp,this.lastTap=It,this.count===this.numTaps)return this.reset(),It}}}class qh{constructor(I){this._tr=new Ch(I),this._zoomIn=new bf({numTouches:1,numTaps:2}),this._zoomOut=new bf({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(I,ht,Et){this._zoomIn.touchstart(I,ht,Et),this._zoomOut.touchstart(I,ht,Et)}touchmove(I,ht,Et){this._zoomIn.touchmove(I,ht,Et),this._zoomOut.touchmove(I,ht,Et)}touchend(I,ht,Et){let It=this._zoomIn.touchend(I,ht,Et),Vt=this._zoomOut.touchend(I,ht,Et),ke=this._tr;return It?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Oe=>Oe.easeTo({duration:300,zoom:ke.zoom+1,around:ke.unproject(It)},{originalEvent:I})}):Vt?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Oe=>Oe.easeTo({duration:300,zoom:ke.zoom-1,around:ke.unproject(Vt)},{originalEvent:I})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class th{constructor(I){this._enabled=!!I.enable,this._moveStateManager=I.moveStateManager,this._clickTolerance=I.clickTolerance||1,this._moveFunction=I.move,this._activateOnStart=!!I.activateOnStart,I.assignEvents(this),this.reset()}reset(I){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(I)}_move(...I){let ht=this._moveFunction(...I);if(ht.bearingDelta||ht.pitchDelta||ht.around||ht.panDelta)return this._active=!0,ht}dragStart(I,ht){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(I)&&(this._moveStateManager.startMove(I),this._lastPoint=ht.length?ht[0]:ht,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(I,ht){if(!this.isEnabled())return;let Et=this._lastPoint;if(!Et)return;if(I.preventDefault(),!this._moveStateManager.isValidMoveEvent(I))return void this.reset(I);let It=ht.length?ht[0]:ht;return!this._moved&&It.dist(Et)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=It,this._move(Et,It))}dragEnd(I){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(I)&&(this._moved&&i.suppressClick(),this.reset(I))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let rf={0:1,2:2};class Zh{constructor(I){this._correctEvent=I.checkCorrectEvent}startMove(I){let ht=i.mouseButton(I);this._eventButton=ht}endMove(I){delete this._eventButton}isValidStartEvent(I){return this._correctEvent(I)}isValidMoveEvent(I){return!function(ht,Et){let It=rf[Et];return ht.buttons===void 0||(ht.buttons&It)!==It}(I,this._eventButton)}isValidEndEvent(I){return i.mouseButton(I)===this._eventButton}}class wf{constructor(){this._firstTouch=void 0}_isOneFingerTouch(I){return I.targetTouches.length===1}_isSameTouchEvent(I){return I.targetTouches[0].identifier===this._firstTouch}startMove(I){this._firstTouch=I.targetTouches[0].identifier}endMove(I){delete this._firstTouch}isValidStartEvent(I){return this._isOneFingerTouch(I)}isValidMoveEvent(I){return this._isOneFingerTouch(I)&&this._isSameTouchEvent(I)}isValidEndEvent(I){return this._isOneFingerTouch(I)&&this._isSameTouchEvent(I)}}let zd=qt=>{qt.mousedown=qt.dragStart,qt.mousemoveWindow=qt.dragMove,qt.mouseup=qt.dragEnd,qt.contextmenu=I=>{I.preventDefault()}},gc=({enable:qt,clickTolerance:I,bearingDegreesPerPixelMoved:ht=.8})=>{let Et=new Zh({checkCorrectEvent:It=>i.mouseButton(It)===0&&It.ctrlKey||i.mouseButton(It)===2});return new th({clickTolerance:I,move:(It,Vt)=>({bearingDelta:(Vt.x-It.x)*ht}),moveStateManager:Et,enable:qt,assignEvents:zd})},Jf=({enable:qt,clickTolerance:I,pitchDegreesPerPixelMoved:ht=-.5})=>{let Et=new Zh({checkCorrectEvent:It=>i.mouseButton(It)===0&&It.ctrlKey||i.mouseButton(It)===2});return new th({clickTolerance:I,move:(It,Vt)=>({pitchDelta:(Vt.y-It.y)*ht}),moveStateManager:Et,enable:qt,assignEvents:zd})};class eh{constructor(I,ht){this._clickTolerance=I.clickTolerance||1,this._map=ht,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(I){return I<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(I,ht,Et){return this._calculateTransform(I,ht,Et)}touchmove(I,ht,Et){if(this._active){if(!this._shouldBePrevented(Et.length))return I.preventDefault(),this._calculateTransform(I,ht,Et);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",I)}}touchend(I,ht,Et){this._calculateTransform(I,ht,Et),this._active&&this._shouldBePrevented(Et.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(I,ht,Et){Et.length>0&&(this._active=!0);let It=fd(Et,ht),Vt=new e.P(0,0),ke=new e.P(0,0),Oe=0;for(let gr in It){let Or=It[gr],Dr=this._touches[gr];Dr&&(Vt._add(Or),ke._add(Or.sub(Dr)),Oe++,It[gr]=Or)}if(this._touches=It,this._shouldBePrevented(Oe)||!ke.mag())return;let Ke=ke.div(Oe);return this._sum._add(Ke),this._sum.mag()<this._clickTolerance?void 0:{around:Vt.div(Oe),panDelta:Ke}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Lh{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(I,ht,Et){this._firstTwoTouches||Et.length<2||(this._firstTwoTouches=[Et[0].identifier,Et[1].identifier],this._start([ht[0],ht[1]]))}touchmove(I,ht,Et){if(!this._firstTwoTouches)return;I.preventDefault();let[It,Vt]=this._firstTwoTouches,ke=yh(Et,ht,It),Oe=yh(Et,ht,Vt);if(!ke||!Oe)return;let Ke=this._aroundCenter?null:ke.add(Oe).div(2);return this._move([ke,Oe],Ke,I)}touchend(I,ht,Et){if(!this._firstTwoTouches)return;let[It,Vt]=this._firstTwoTouches,ke=yh(Et,ht,It),Oe=yh(Et,ht,Vt);ke&&Oe||(this._active&&i.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(I){this._enabled=!0,this._aroundCenter=!!I&&I.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function yh(qt,I,ht){for(let Et=0;Et<qt.length;Et++)if(qt[Et].identifier===ht)return I[Et]}function Ru(qt,I){return Math.log(qt/I)/Math.LN2}class eu extends Lh{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(I){this._startDistance=this._distance=I[0].dist(I[1])}_move(I,ht){let Et=this._distance;if(this._distance=I[0].dist(I[1]),this._active||!(Math.abs(Ru(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ru(this._distance,Et),pinchAround:ht}}}function xh(qt,I){return 180*qt.angleWith(I)/Math.PI}class df extends Lh{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(I){this._startVector=this._vector=I[0].sub(I[1]),this._minDiameter=I[0].dist(I[1])}_move(I,ht,Et){let It=this._vector;if(this._vector=I[0].sub(I[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:xh(this._vector,It),pinchAround:ht}}_isBelowThreshold(I){this._minDiameter=Math.min(this._minDiameter,I.mag());let ht=25/(Math.PI*this._minDiameter)*360,Et=xh(I,this._startVector);return Math.abs(Et)<ht}}function _h(qt){return Math.abs(qt.y)>Math.abs(qt.x)}class qf extends Lh{constructor(I){super(),this._currentTouchCount=0,this._map=I}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(I,ht,Et){super.touchstart(I,ht,Et),this._currentTouchCount=Et.length}_start(I){this._lastPoints=I,_h(I[0].sub(I[1]))&&(this._valid=!1)}_move(I,ht,Et){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let It=I[0].sub(this._lastPoints[0]),Vt=I[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(It,Vt,Et.timeStamp),this._valid?(this._lastPoints=I,this._active=!0,{pitchDelta:(It.y+Vt.y)/2*-.5}):void 0}gestureBeginsVertically(I,ht,Et){if(this._valid!==void 0)return this._valid;let It=I.mag()>=2,Vt=ht.mag()>=2;if(!It&&!Vt)return;if(!It||!Vt)return this._firstMove===void 0&&(this._firstMove=Et),Et-this._firstMove<100&&void 0;let ke=I.y>0==ht.y>0;return _h(I)&&_h(ht)&&ke}}let mr={panStep:100,bearingStep:15,pitchStep:10};class Ur{constructor(I){this._tr=new Ch(I);let ht=mr;this._panStep=ht.panStep,this._bearingStep=ht.bearingStep,this._pitchStep=ht.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(I){if(I.altKey||I.ctrlKey||I.metaKey)return;let ht=0,Et=0,It=0,Vt=0,ke=0;switch(I.keyCode){case 61:case 107:case 171:case 187:ht=1;break;case 189:case 109:case 173:ht=-1;break;case 37:I.shiftKey?Et=-1:(I.preventDefault(),Vt=-1);break;case 39:I.shiftKey?Et=1:(I.preventDefault(),Vt=1);break;case 38:I.shiftKey?It=1:(I.preventDefault(),ke=-1);break;case 40:I.shiftKey?It=-1:(I.preventDefault(),ke=1);break;default:return}return this._rotationDisabled&&(Et=0,It=0),{cameraAnimation:Oe=>{let Ke=this._tr;Oe.easeTo({duration:300,easeId:"keyboardHandler",easing:_n,zoom:ht?Math.round(Ke.zoom)+ht*(I.shiftKey?2:1):Ke.zoom,bearing:Ke.bearing+Et*this._bearingStep,pitch:Ke.pitch+It*this._pitchStep,offset:[-Vt*this._panStep,-ke*this._panStep],center:Ke.center},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function _n(qt){return qt*(2-qt)}let cn=4.000244140625;class Wn{constructor(I,ht){this._onTimeout=Et=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Et)},this._map=I,this._tr=new Ch(I),this._triggerRenderFrame=ht,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(I){this._defaultZoomRate=I}setWheelZoomRate(I){this._wheelZoomRate=I}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(I){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!I&&I.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(I){return!!this._map.cooperativeGestures.isEnabled()&&!(I.ctrlKey||this._map.cooperativeGestures.isBypassed(I))}wheel(I){if(!this.isEnabled())return;if(this._shouldBePrevented(I))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",I);let ht=I.deltaMode===WheelEvent.DOM_DELTA_LINE?40*I.deltaY:I.deltaY,Et=o.now(),It=Et-(this._lastWheelEventTime||0);this._lastWheelEventTime=Et,ht!==0&&ht%cn==0?this._type="wheel":ht!==0&&Math.abs(ht)<4?this._type="trackpad":It>400?(this._type=null,this._lastValue=ht,this._timeout=setTimeout(this._onTimeout,40,I)):this._type||(this._type=Math.abs(It*ht)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ht+=this._lastValue)),I.shiftKey&&ht&&(ht/=4),this._type&&(this._lastWheelEvent=I,this._delta-=ht,this._active||this._start(I)),I.preventDefault()}_start(I){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let ht=i.mousePos(this._map.getCanvas(),I),Et=this._tr;this._around=ht.y>Et.transform.height/2-Et.transform.getHorizon()?e.N.convert(this._aroundCenter?Et.center:Et.unproject(ht)):e.N.convert(Et.center),this._aroundPoint=Et.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let I=this._tr.transform;if(this._delta!==0){let Ke=this._type==="wheel"&&Math.abs(this._delta)>cn?this._wheelZoomRate:this._defaultZoomRate,gr=2/(1+Math.exp(-Math.abs(this._delta*Ke)));this._delta<0&&gr!==0&&(gr=1/gr);let Or=typeof this._targetZoom=="number"?I.zoomScale(this._targetZoom):I.scale;this._targetZoom=Math.min(I.maxZoom,Math.max(I.minZoom,I.scaleZoom(Or*gr))),this._type==="wheel"&&(this._startZoom=I.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let ht=typeof this._targetZoom=="number"?this._targetZoom:I.zoom,Et=this._startZoom,It=this._easing,Vt,ke=!1,Oe=o.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Et&&It&&Oe){let Ke=Math.min(Oe/200,1),gr=It(Ke);Vt=e.y.number(Et,ht,gr),Ke<1?this._frameId||(this._frameId=!0):ke=!0}else Vt=ht,ke=!0;return this._active=!0,ke&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ke,zoomDelta:Vt-I.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(I){let ht=e.b9;if(this._prevEase){let Et=this._prevEase,It=(o.now()-Et.start)/Et.duration,Vt=Et.easing(It+.01)-Et.easing(It),ke=.27/Math.sqrt(Vt*Vt+1e-4)*.01,Oe=Math.sqrt(.0729-ke*ke);ht=e.b8(ke,Oe,.25,1)}return this._prevEase={start:o.now(),duration:I,easing:ht},ht}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class hi{constructor(I,ht){this._clickZoom=I,this._tapZoom=ht}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 ea{constructor(I){this._tr=new Ch(I),this.reset()}reset(){this._active=!1}dblclick(I,ht){return I.preventDefault(),{cameraAnimation:Et=>{Et.easeTo({duration:300,zoom:this._tr.zoom+(I.shiftKey?-1:1),around:this._tr.unproject(ht)},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ga{constructor(){this._tap=new bf({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(I,ht,Et){if(!this._swipePoint)if(this._tapTime){let It=ht[0],Vt=I.timeStamp-this._tapTime<500,ke=this._tapPoint.dist(It)<30;Vt&&ke?Et.length>0&&(this._swipePoint=It,this._swipeTouch=Et[0].identifier):this.reset()}else this._tap.touchstart(I,ht,Et)}touchmove(I,ht,Et){if(this._tapTime){if(this._swipePoint){if(Et[0].identifier!==this._swipeTouch)return;let It=ht[0],Vt=It.y-this._swipePoint.y;return this._swipePoint=It,I.preventDefault(),this._active=!0,{zoomDelta:Vt/128}}}else this._tap.touchmove(I,ht,Et)}touchend(I,ht,Et){if(this._tapTime)this._swipePoint&&Et.length===0&&this.reset();else{let It=this._tap.touchend(I,ht,Et);It&&(this._tapTime=I.timeStamp,this._tapPoint=It)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ra{constructor(I,ht,Et){this._el=I,this._mousePan=ht,this._touchPan=Et}enable(I){this._inertiaOptions=I||{},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 $a{constructor(I,ht,Et){this._pitchWithRotate=I.pitchWithRotate,this._mouseRotate=ht,this._mousePitch=Et}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 ua{constructor(I,ht,Et,It){this._el=I,this._touchZoom=ht,this._touchRotate=Et,this._tapDragZoom=It,this._rotationDisabled=!1,this._enabled=!0}enable(I){this._touchZoom.enable(I),this._rotationDisabled||this._touchRotate.enable(I),this._tapDragZoom.enable(),this._el.classList.add("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 za{constructor(I,ht){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=I,this._options=ht,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let I=this._map.getCanvasContainer();I.classList.add("maplibregl-cooperative-gestures"),this._container=i.create("div","maplibregl-cooperative-gesture-screen",I);let ht=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(ht=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let Et=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),It=document.createElement("div");It.className="maplibregl-desktop-message",It.textContent=ht,this._container.appendChild(It);let Vt=document.createElement("div");Vt.className="maplibregl-mobile-message",Vt.textContent=Et,this._container.appendChild(Vt),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(i.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(I){return I[this._bypassKey]}notifyGestureBlocked(I,ht){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:I,originalEvent:ht})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let wa=qt=>qt.zoom||qt.drag||qt.pitch||qt.rotate;class Ji extends e.k{}function eo(qt){return qt.panDelta&&qt.panDelta.mag()||qt.zoomDelta||qt.bearingDelta||qt.pitchDelta}class rs{constructor(I,ht){this.handleWindowEvent=It=>{this.handleEvent(It,`${It.type}Window`)},this.handleEvent=(It,Vt)=>{if(It.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let ke=It.type==="renderFrame"?void 0:It,Oe={needsRenderFrame:!1},Ke={},gr={},Or=It.touches,Dr=Or?this._getMapTouches(Or):void 0,ln=Dr?i.touchPos(this._map.getCanvas(),Dr):i.mousePos(this._map.getCanvas(),It);for(let{handlerName:ae,handler:xe,allowed:Ae}of this._handlers){if(!xe.isEnabled())continue;let je;this._blockedByActive(gr,Ae,ae)?xe.reset():xe[Vt||It.type]&&(je=xe[Vt||It.type](It,ln,Dr),this.mergeHandlerResult(Oe,Ke,je,ae,ke),je&&je.needsRenderFrame&&this._triggerRenderFrame()),(je||xe.isActive())&&(gr[ae]=xe)}let Sn={};for(let ae in this._previousActiveHandlers)gr[ae]||(Sn[ae]=ke);this._previousActiveHandlers=gr,(Object.keys(Sn).length||eo(Oe))&&(this._changes.push([Oe,Ke,Sn]),this._triggerRenderFrame()),(Object.keys(gr).length||eo(Oe))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:Xt}=Oe;Xt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Xt(this._map))},this._map=I,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Lf(I),this._bearingSnap=ht.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ht);let Et=this._el;this._listeners=[[Et,"touchstart",{passive:!0}],[Et,"touchmove",{passive:!1}],[Et,"touchend",void 0],[Et,"touchcancel",void 0],[Et,"mousedown",void 0],[Et,"mousemove",void 0],[Et,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Et,"mouseover",void 0],[Et,"mouseout",void 0],[Et,"dblclick",void 0],[Et,"click",void 0],[Et,"keydown",{capture:!1}],[Et,"keyup",void 0],[Et,"wheel",{passive:!1}],[Et,"contextmenu",void 0],[window,"blur",void 0]];for(let[It,Vt,ke]of this._listeners)i.addEventListener(It,Vt,It===document?this.handleWindowEvent:this.handleEvent,ke)}destroy(){for(let[I,ht,Et]of this._listeners)i.removeEventListener(I,ht,I===document?this.handleWindowEvent:this.handleEvent,Et)}_addDefaultHandlers(I){let ht=this._map,Et=ht.getCanvasContainer();this._add("mapEvent",new vh(ht,I));let It=ht.boxZoom=new Vc(ht,I);this._add("boxZoom",It),I.interactive&&I.boxZoom&&It.enable();let Vt=ht.cooperativeGestures=new za(ht,I.cooperativeGestures);this._add("cooperativeGestures",Vt),I.cooperativeGestures&&Vt.enable();let ke=new qh(ht),Oe=new ea(ht);ht.doubleClickZoom=new hi(Oe,ke),this._add("tapZoom",ke),this._add("clickZoom",Oe),I.interactive&&I.doubleClickZoom&&ht.doubleClickZoom.enable();let Ke=new ga;this._add("tapDragZoom",Ke);let gr=ht.touchPitch=new qf(ht);this._add("touchPitch",gr),I.interactive&&I.touchPitch&&ht.touchPitch.enable(I.touchPitch);let Or=gc(I),Dr=Jf(I);ht.dragRotate=new $a(I,Or,Dr),this._add("mouseRotate",Or,["mousePitch"]),this._add("mousePitch",Dr,["mouseRotate"]),I.interactive&&I.dragRotate&&ht.dragRotate.enable();let ln=(({enable:je,clickTolerance:Ie})=>{let Ze=new Zh({checkCorrectEvent:wr=>i.mouseButton(wr)===0&&!wr.ctrlKey});return new th({clickTolerance:Ie,move:(wr,Ir)=>({around:Ir,panDelta:Ir.sub(wr)}),activateOnStart:!0,moveStateManager:Ze,enable:je,assignEvents:zd})})(I),Sn=new eh(I,ht);ht.dragPan=new Ra(Et,ln,Sn),this._add("mousePan",ln),this._add("touchPan",Sn,["touchZoom","touchRotate"]),I.interactive&&I.dragPan&&ht.dragPan.enable(I.dragPan);let Xt=new df,ae=new eu;ht.touchZoomRotate=new ua(Et,ae,Xt,Ke),this._add("touchRotate",Xt,["touchPan","touchZoom"]),this._add("touchZoom",ae,["touchPan","touchRotate"]),I.interactive&&I.touchZoomRotate&&ht.touchZoomRotate.enable(I.touchZoomRotate);let xe=ht.scrollZoom=new Wn(ht,()=>this._triggerRenderFrame());this._add("scrollZoom",xe,["mousePan"]),I.interactive&&I.scrollZoom&&ht.scrollZoom.enable(I.scrollZoom);let Ae=ht.keyboard=new Ur(ht);this._add("keyboard",Ae),I.interactive&&I.keyboard&&ht.keyboard.enable(),this._add("blockableMapEvent",new bu(ht))}_add(I,ht,Et){this._handlers.push({handlerName:I,handler:ht,allowed:Et}),this._handlersById[I]=ht}stop(I){if(!this._updatingCamera){for(let{handler:ht}of this._handlers)ht.reset();this._inertia.clear(),this._fireEvents({},{},I),this._changes=[]}}isActive(){for(let{handler:I}of this._handlers)if(I.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!wa(this._eventsInProgress)||this.isZooming()}_blockedByActive(I,ht,Et){for(let It in I)if(It!==Et&&(!ht||ht.indexOf(It)<0))return!0;return!1}_getMapTouches(I){let ht=[];for(let Et of I)this._el.contains(Et.target)&&ht.push(Et);return ht}mergeHandlerResult(I,ht,Et,It,Vt){if(!Et)return;e.e(I,Et);let ke={handlerName:It,originalEvent:Et.originalEvent||Vt};Et.zoomDelta!==void 0&&(ht.zoom=ke),Et.panDelta!==void 0&&(ht.drag=ke),Et.pitchDelta!==void 0&&(ht.pitch=ke),Et.bearingDelta!==void 0&&(ht.rotate=ke)}_applyChanges(){let I={},ht={},Et={};for(let[It,Vt,ke]of this._changes)It.panDelta&&(I.panDelta=(I.panDelta||new e.P(0,0))._add(It.panDelta)),It.zoomDelta&&(I.zoomDelta=(I.zoomDelta||0)+It.zoomDelta),It.bearingDelta&&(I.bearingDelta=(I.bearingDelta||0)+It.bearingDelta),It.pitchDelta&&(I.pitchDelta=(I.pitchDelta||0)+It.pitchDelta),It.around!==void 0&&(I.around=It.around),It.pinchAround!==void 0&&(I.pinchAround=It.pinchAround),It.noInertia&&(I.noInertia=It.noInertia),e.e(ht,Vt),e.e(Et,ke);this._updateMapTransform(I,ht,Et),this._changes=[]}_updateMapTransform(I,ht,Et){let It=this._map,Vt=It._getTransformForUpdate(),ke=It.terrain;if(!(eo(I)||ke&&this._terrainMovement))return this._fireEvents(ht,Et,!0);let{panDelta:Oe,zoomDelta:Ke,bearingDelta:gr,pitchDelta:Or,around:Dr,pinchAround:ln}=I;ln!==void 0&&(Dr=ln),It._stop(!0),Dr=Dr||It.transform.centerPoint;let Sn=Vt.pointLocation(Oe?Dr.sub(Oe):Dr);gr&&(Vt.bearing+=gr),Or&&(Vt.pitch+=Or),Ke&&(Vt.zoom+=Ke),ke?this._terrainMovement||!ht.drag&&!ht.zoom?ht.drag&&this._terrainMovement?Vt.center=Vt.pointLocation(Vt.centerPoint.sub(Oe)):Vt.setLocationAtPoint(Sn,Dr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Vt.setLocationAtPoint(Sn,Dr)):Vt.setLocationAtPoint(Sn,Dr),It._applyUpdatedTransform(Vt),this._map._update(),I.noInertia||this._inertia.record(I),this._fireEvents(ht,Et,!0)}_fireEvents(I,ht,Et){let It=wa(this._eventsInProgress),Vt=wa(I),ke={};for(let Dr in I){let{originalEvent:ln}=I[Dr];this._eventsInProgress[Dr]||(ke[`${Dr}start`]=ln),this._eventsInProgress[Dr]=I[Dr]}!It&&Vt&&this._fireEvent("movestart",Vt.originalEvent);for(let Dr in ke)this._fireEvent(Dr,ke[Dr]);Vt&&this._fireEvent("move",Vt.originalEvent);for(let Dr in I){let{originalEvent:ln}=I[Dr];this._fireEvent(Dr,ln)}let Oe={},Ke;for(let Dr in this._eventsInProgress){let{handlerName:ln,originalEvent:Sn}=this._eventsInProgress[Dr];this._handlersById[ln].isActive()||(delete this._eventsInProgress[Dr],Ke=ht[ln]||Sn,Oe[`${Dr}end`]=Ke)}for(let Dr in Oe)this._fireEvent(Dr,Oe[Dr]);let gr=wa(this._eventsInProgress),Or=(It||Vt)&&!gr;if(Or&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let Dr=this._map._getTransformForUpdate();Dr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Dr)}if(Et&&Or){this._updatingCamera=!0;let Dr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ln=Sn=>Sn!==0&&-this._bearingSnap<Sn&&Sn<this._bearingSnap;!Dr||!Dr.essential&&o.prefersReducedMotion?(this._map.fire(new e.k("moveend",{originalEvent:Ke})),ln(this._map.getBearing())&&this._map.resetNorth()):(ln(Dr.bearing||this._map.getBearing())&&(Dr.bearing=0),Dr.freezeElevation=!0,this._map.easeTo(Dr,{originalEvent:Ke})),this._updatingCamera=!1}}_fireEvent(I,ht){this._map.fire(new e.k(I,ht?{originalEvent:ht}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(I=>{delete this._frameId,this.handleEvent(new Ji("renderFrame",{timeStamp:I})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Zo extends e.E{constructor(I,ht){super(),this._renderFrameCallback=()=>{let Et=Math.min((o.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Et)),Et<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=I,this._bearingSnap=ht.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(I,ht){return this.jumpTo({center:I},ht)}panBy(I,ht,Et){return I=e.P.convert(I).mult(-1),this.panTo(this.transform.center,e.e({offset:I},ht),Et)}panTo(I,ht,Et){return this.easeTo(e.e({center:I},ht),Et)}getZoom(){return this.transform.zoom}setZoom(I,ht){return this.jumpTo({zoom:I},ht),this}zoomTo(I,ht,Et){return this.easeTo(e.e({zoom:I},ht),Et)}zoomIn(I,ht){return this.zoomTo(this.getZoom()+1,I,ht),this}zoomOut(I,ht){return this.zoomTo(this.getZoom()-1,I,ht),this}getBearing(){return this.transform.bearing}setBearing(I,ht){return this.jumpTo({bearing:I},ht),this}getPadding(){return this.transform.padding}setPadding(I,ht){return this.jumpTo({padding:I},ht),this}rotateTo(I,ht,Et){return this.easeTo(e.e({bearing:I},ht),Et)}resetNorth(I,ht){return this.rotateTo(0,e.e({duration:1e3},I),ht),this}resetNorthPitch(I,ht){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},I),ht),this}snapToNorth(I,ht){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(I,ht):this}getPitch(){return this.transform.pitch}setPitch(I,ht){return this.jumpTo({pitch:I},ht),this}cameraForBounds(I,ht){I=ut.convert(I).adjustAntiMeridian();let Et=ht&&ht.bearing||0;return this._cameraForBoxAndBearing(I.getNorthWest(),I.getSouthEast(),Et,ht)}_cameraForBoxAndBearing(I,ht,Et,It){let Vt={top:0,bottom:0,right:0,left:0};if(typeof(It=e.e({padding:Vt,offset:[0,0],maxZoom:this.transform.maxZoom},It)).padding=="number"){let Bn=It.padding;It.padding={top:Bn,bottom:Bn,right:Bn,left:Bn}}It.padding=e.e(Vt,It.padding);let ke=this.transform,Oe=ke.padding,Ke=new ut(I,ht),gr=ke.project(Ke.getNorthWest()),Or=ke.project(Ke.getNorthEast()),Dr=ke.project(Ke.getSouthEast()),ln=ke.project(Ke.getSouthWest()),Sn=e.ba(-Et),Xt=gr.rotate(Sn),ae=Or.rotate(Sn),xe=Dr.rotate(Sn),Ae=ln.rotate(Sn),je=new e.P(Math.max(Xt.x,ae.x,Ae.x,xe.x),Math.max(Xt.y,ae.y,Ae.y,xe.y)),Ie=new e.P(Math.min(Xt.x,ae.x,Ae.x,xe.x),Math.min(Xt.y,ae.y,Ae.y,xe.y)),Ze=je.sub(Ie),wr=(ke.width-(Oe.left+Oe.right+It.padding.left+It.padding.right))/Ze.x,Ir=(ke.height-(Oe.top+Oe.bottom+It.padding.top+It.padding.bottom))/Ze.y;if(Ir<0||wr<0)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let Nr=Math.min(ke.scaleZoom(ke.scale*Math.min(wr,Ir)),It.maxZoom),tn=e.P.convert(It.offset),mn=new e.P((It.padding.left-It.padding.right)/2,(It.padding.top-It.padding.bottom)/2).rotate(e.ba(Et)),zn=tn.add(mn).mult(ke.scale/ke.zoomScale(Nr));return{center:ke.unproject(gr.add(Dr).div(2).sub(zn)),zoom:Nr,bearing:Et}}fitBounds(I,ht,Et){return this._fitInternal(this.cameraForBounds(I,ht),ht,Et)}fitScreenCoordinates(I,ht,Et,It,Vt){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.P.convert(I)),this.transform.pointLocation(e.P.convert(ht)),Et,It),It,Vt)}_fitInternal(I,ht,Et){return I?(delete(ht=e.e(I,ht)).padding,ht.linear?this.easeTo(ht,Et):this.flyTo(ht,Et)):this}jumpTo(I,ht){this.stop();let Et=this._getTransformForUpdate(),It=!1,Vt=!1,ke=!1;return"zoom"in I&&Et.zoom!==+I.zoom&&(It=!0,Et.zoom=+I.zoom),I.center!==void 0&&(Et.center=e.N.convert(I.center)),"bearing"in I&&Et.bearing!==+I.bearing&&(Vt=!0,Et.bearing=+I.bearing),"pitch"in I&&Et.pitch!==+I.pitch&&(ke=!0,Et.pitch=+I.pitch),I.padding==null||Et.isPaddingEqual(I.padding)||(Et.padding=I.padding),this._applyUpdatedTransform(Et),this.fire(new e.k("movestart",ht)).fire(new e.k("move",ht)),It&&this.fire(new e.k("zoomstart",ht)).fire(new e.k("zoom",ht)).fire(new e.k("zoomend",ht)),Vt&&this.fire(new e.k("rotatestart",ht)).fire(new e.k("rotate",ht)).fire(new e.k("rotateend",ht)),ke&&this.fire(new e.k("pitchstart",ht)).fire(new e.k("pitch",ht)).fire(new e.k("pitchend",ht)),this.fire(new e.k("moveend",ht))}calculateCameraOptionsFromTo(I,ht,Et,It=0){let Vt=e.Z.fromLngLat(I,ht),ke=e.Z.fromLngLat(Et,It),Oe=ke.x-Vt.x,Ke=ke.y-Vt.y,gr=ke.z-Vt.z,Or=Math.hypot(Oe,Ke,gr);if(Or===0)throw new Error("Can't calculate camera options with same From and To");let Dr=Math.hypot(Oe,Ke),ln=this.transform.scaleZoom(this.transform.cameraToCenterDistance/Or/this.transform.tileSize),Sn=180*Math.atan2(Oe,-Ke)/Math.PI,Xt=180*Math.acos(Dr/Or)/Math.PI;return Xt=gr<0?90-Xt:90+Xt,{center:ke.toLngLat(),zoom:ln,pitch:Xt,bearing:Sn}}easeTo(I,ht){var Et;this._stop(!1,I.easeId),((I=e.e({offset:[0,0],duration:500,easing:e.b9},I)).animate===!1||!I.essential&&o.prefersReducedMotion)&&(I.duration=0);let It=this._getTransformForUpdate(),Vt=It.zoom,ke=It.bearing,Oe=It.pitch,Ke=It.padding,gr="bearing"in I?this._normalizeBearing(I.bearing,ke):ke,Or="pitch"in I?+I.pitch:Oe,Dr="padding"in I?I.padding:It.padding,ln=e.P.convert(I.offset),Sn=It.centerPoint.add(ln),Xt=It.pointLocation(Sn),{center:ae,zoom:xe}=It.getConstrained(e.N.convert(I.center||Xt),(Et=I.zoom)!==null&&Et!==void 0?Et:Vt);this._normalizeCenter(ae,It);let Ae=It.project(Xt),je=It.project(ae).sub(Ae),Ie=It.zoomScale(xe-Vt),Ze,wr;I.around&&(Ze=e.N.convert(I.around),wr=It.locationPoint(Ze));let Ir={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||xe!==Vt,this._rotating=this._rotating||ke!==gr,this._pitching=this._pitching||Or!==Oe,this._padding=!It.isPaddingEqual(Dr),this._easeId=I.easeId,this._prepareEase(ht,I.noMoveStart,Ir),this.terrain&&this._prepareElevation(ae),this._ease(Nr=>{if(this._zooming&&(It.zoom=e.y.number(Vt,xe,Nr)),this._rotating&&(It.bearing=e.y.number(ke,gr,Nr)),this._pitching&&(It.pitch=e.y.number(Oe,Or,Nr)),this._padding&&(It.interpolatePadding(Ke,Dr,Nr),Sn=It.centerPoint.add(ln)),this.terrain&&!I.freezeElevation&&this._updateElevation(Nr),Ze)It.setLocationAtPoint(Ze,wr);else{let tn=It.zoomScale(It.zoom-Vt),mn=xe>Vt?Math.min(2,Ie):Math.max(.5,Ie),zn=Math.pow(mn,1-Nr),Bn=It.unproject(Ae.add(je.mult(Nr*zn)).mult(tn));It.setLocationAtPoint(It.renderWorldCopies?Bn.wrap():Bn,Sn)}this._applyUpdatedTransform(It),this._fireMoveEvents(ht)},Nr=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ht,Nr)},I),this}_prepareEase(I,ht,Et={}){this._moving=!0,ht||Et.moving||this.fire(new e.k("movestart",I)),this._zooming&&!Et.zooming&&this.fire(new e.k("zoomstart",I)),this._rotating&&!Et.rotating&&this.fire(new e.k("rotatestart",I)),this._pitching&&!Et.pitching&&this.fire(new e.k("pitchstart",I))}_prepareElevation(I){this._elevationCenter=I,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(I,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(I){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let ht=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(I<1&&ht!==this._elevationTarget){let Et=this._elevationTarget-this._elevationStart;this._elevationStart+=I*(Et-(ht-(Et*I+this._elevationStart))/(1-I)),this._elevationTarget=ht}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,I)}_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(I){let ht=I.getCameraPosition(),Et=this.terrain.getElevationForLngLatZoom(ht.lngLat,I.zoom);if(ht.altitude<Et){let It=this.calculateCameraOptionsFromTo(ht.lngLat,Et,I.center,I.elevation);return{pitch:It.pitch,zoom:It.zoom}}return{}}_applyUpdatedTransform(I){let ht=[];if(this.terrain&&ht.push(It=>this._elevateCameraIfInsideTerrain(It)),this.transformCameraUpdate&&ht.push(It=>this.transformCameraUpdate(It)),!ht.length)return;let Et=I.clone();for(let It of ht){let Vt=Et.clone(),{center:ke,zoom:Oe,pitch:Ke,bearing:gr,elevation:Or}=It(Vt);ke&&(Vt.center=ke),Oe!==void 0&&(Vt.zoom=Oe),Ke!==void 0&&(Vt.pitch=Ke),gr!==void 0&&(Vt.bearing=gr),Or!==void 0&&(Vt.elevation=Or),Et.apply(Vt)}this.transform.apply(Et)}_fireMoveEvents(I){this.fire(new e.k("move",I)),this._zooming&&this.fire(new e.k("zoom",I)),this._rotating&&this.fire(new e.k("rotate",I)),this._pitching&&this.fire(new e.k("pitch",I))}_afterEase(I,ht){if(this._easeId&&ht&&this._easeId===ht)return;delete this._easeId;let Et=this._zooming,It=this._rotating,Vt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Et&&this.fire(new e.k("zoomend",I)),It&&this.fire(new e.k("rotateend",I)),Vt&&this.fire(new e.k("pitchend",I)),this.fire(new e.k("moveend",I))}flyTo(I,ht){var Et;if(!I.essential&&o.prefersReducedMotion){let ka=e.M(I,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ka,ht)}this.stop(),I=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},I);let It=this._getTransformForUpdate(),Vt=It.zoom,ke=It.bearing,Oe=It.pitch,Ke=It.padding,gr="bearing"in I?this._normalizeBearing(I.bearing,ke):ke,Or="pitch"in I?+I.pitch:Oe,Dr="padding"in I?I.padding:It.padding,ln=e.P.convert(I.offset),Sn=It.centerPoint.add(ln),Xt=It.pointLocation(Sn),{center:ae,zoom:xe}=It.getConstrained(e.N.convert(I.center||Xt),(Et=I.zoom)!==null&&Et!==void 0?Et:Vt);this._normalizeCenter(ae,It);let Ae=It.zoomScale(xe-Vt),je=It.project(Xt),Ie=It.project(ae).sub(je),Ze=I.curve,wr=Math.max(It.width,It.height),Ir=wr/Ae,Nr=Ie.mag();if("minZoom"in I){let ka=e.ac(Math.min(I.minZoom,Vt,xe),It.minZoom,It.maxZoom),io=wr/It.zoomScale(ka-Vt);Ze=Math.sqrt(io/Nr*2)}let tn=Ze*Ze;function mn(ka){let io=(Ir*Ir-wr*wr+(ka?-1:1)*tn*tn*Nr*Nr)/(2*(ka?Ir:wr)*tn*Nr);return Math.log(Math.sqrt(io*io+1)-io)}function zn(ka){return(Math.exp(ka)-Math.exp(-ka))/2}function Bn(ka){return(Math.exp(ka)+Math.exp(-ka))/2}let ri=mn(!1),Fi=function(ka){return Bn(ri)/Bn(ri+Ze*ka)},da=function(ka){return wr*((Bn(ri)*(zn(io=ri+Ze*ka)/Bn(io))-zn(ri))/tn)/Nr;var io},ha=(mn(!0)-ri)/Ze;if(Math.abs(Nr)<1e-6||!isFinite(ha)){if(Math.abs(wr-Ir)<1e-6)return this.easeTo(I,ht);let ka=Ir<wr?-1:1;ha=Math.abs(Math.log(Ir/wr))/Ze,da=()=>0,Fi=io=>Math.exp(ka*Ze*io)}return I.duration="duration"in I?+I.duration:1e3*ha/("screenSpeed"in I?+I.screenSpeed/Ze:+I.speed),I.maxDuration&&I.duration>I.maxDuration&&(I.duration=0),this._zooming=!0,this._rotating=ke!==gr,this._pitching=Or!==Oe,this._padding=!It.isPaddingEqual(Dr),this._prepareEase(ht,!1),this.terrain&&this._prepareElevation(ae),this._ease(ka=>{let io=ka*ha,Ro=1/Fi(io);It.zoom=ka===1?xe:Vt+It.scaleZoom(Ro),this._rotating&&(It.bearing=e.y.number(ke,gr,ka)),this._pitching&&(It.pitch=e.y.number(Oe,Or,ka)),this._padding&&(It.interpolatePadding(Ke,Dr,ka),Sn=It.centerPoint.add(ln)),this.terrain&&!I.freezeElevation&&this._updateElevation(ka);let Mo=ka===1?ae:It.unproject(je.add(Ie.mult(da(io))).mult(Ro));It.setLocationAtPoint(It.renderWorldCopies?Mo.wrap():Mo,Sn),this._applyUpdatedTransform(It),this._fireMoveEvents(ht)},()=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ht)},I),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(I,ht){var Et;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let It=this._onEaseEnd;delete this._onEaseEnd,It.call(this,ht)}return I||(Et=this.handlers)===null||Et===void 0||Et.stop(!1),this}_ease(I,ht,Et){Et.animate===!1||Et.duration===0?(I(1),ht()):(this._easeStart=o.now(),this._easeOptions=Et,this._onEaseFrame=I,this._onEaseEnd=ht,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(I,ht){I=e.b3(I,-180,180);let Et=Math.abs(I-ht);return Math.abs(I-360-ht)<Et&&(I-=360),Math.abs(I+360-ht)<Et&&(I+=360),I}_normalizeCenter(I,ht){if(!ht.renderWorldCopies||ht.lngRange)return;let Et=I.lng-ht.center.lng;I.lng+=Et>180?-360:Et<-180?360:0}queryTerrainElevation(I){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(I),this.transform.tileZoom)-this.transform.elevation:null}}let os={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class fs{constructor(I=os){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=ht=>{!ht||ht.sourceDataType!=="metadata"&&ht.sourceDataType!=="visibility"&&ht.dataType!=="style"&&ht.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=I}getDefaultPosition(){return"bottom-right"}onAdd(I){return this._map=I,this._compact=this.options.compact,this._container=i.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=i.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=i.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){i.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(I,ht){let Et=this._map._getUIString(`AttributionControl.${ht}`);I.title=Et,I.setAttribute("aria-label",Et)}_updateAttributions(){if(!this._map.style)return;let I=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?I=I.concat(this.options.customAttribution.map(It=>typeof It!="string"?"":It)):typeof this.options.customAttribution=="string"&&I.push(this.options.customAttribution)),this._map.style.stylesheet){let It=this._map.style.stylesheet;this.styleOwner=It.owner,this.styleId=It.id}let ht=this._map.style.sourceCaches;for(let It in ht){let Vt=ht[It];if(Vt.used||Vt.usedForTerrain){let ke=Vt.getSource();ke.attribution&&I.indexOf(ke.attribution)<0&&I.push(ke.attribution)}}I=I.filter(It=>String(It).trim()),I.sort((It,Vt)=>It.length-Vt.length),I=I.filter((It,Vt)=>{for(let ke=Vt+1;ke<I.length;ke++)if(I[ke].indexOf(It)>=0)return!1;return!0});let Et=I.join(" | ");Et!==this._attribHTML&&(this._attribHTML=Et,I.length?(this._innerContainer.innerHTML=Et,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class no{constructor(I={}){this._updateCompact=()=>{let ht=this._container.children;if(ht.length){let Et=ht[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Et.classList.add("maplibregl-compact"):Et.classList.remove("maplibregl-compact")}},this.options=I}getDefaultPosition(){return"bottom-left"}onAdd(I){this._map=I,this._compact=this.options&&this.options.compact,this._container=i.create("div","maplibregl-ctrl");let ht=i.create("a","maplibregl-ctrl-logo");return ht.target="_blank",ht.rel="noopener nofollow",ht.href="https://maplibre.org/",ht.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ht.setAttribute("rel","noopener nofollow"),this._container.appendChild(ht),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){i.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class qa{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(I){let ht=++this._id;return this._queue.push({callback:I,id:ht,cancelled:!1}),ht}remove(I){let ht=this._currentlyRunning,Et=ht?this._queue.concat(ht):this._queue;for(let It of Et)if(It.id===I)return void(It.cancelled=!0)}run(I=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let ht=this._currentlyRunning=this._queue;this._queue=[];for(let Et of ht)if(!Et.cancelled&&(Et.callback(I),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ds=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class tl extends e.E{constructor(I){super(),this.sourceCache=I,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,I.usedForTerrain=!0,I.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(I,ht){this.sourceCache.update(I,ht),this._renderableTilesKeys=[];let Et={};for(let It of I.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:ht}))Et[It.key]=!0,this._renderableTilesKeys.push(It.key),this._tiles[It.key]||(It.posMatrix=new Float64Array(16),e.aP(It.posMatrix,0,e.X,0,e.X,0,1),this._tiles[It.key]=new oe(It,this.tileSize));for(let It in this._tiles)Et[It]||delete this._tiles[It]}freeRtt(I){for(let ht in this._tiles){let Et=this._tiles[ht];(!I||Et.tileID.equals(I)||Et.tileID.isChildOf(I)||I.isChildOf(Et.tileID))&&(Et.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(I=>this.getTileByID(I))}getTileByID(I){return this._tiles[I]}getTerrainCoords(I){let ht={};for(let Et of this._renderableTilesKeys){let It=this._tiles[Et].tileID;if(It.canonical.equals(I.canonical)){let Vt=I.clone();Vt.posMatrix=new Float64Array(16),e.aP(Vt.posMatrix,0,e.X,0,e.X,0,1),ht[Et]=Vt}else if(It.canonical.isChildOf(I.canonical)){let Vt=I.clone();Vt.posMatrix=new Float64Array(16);let ke=It.canonical.z-I.canonical.z,Oe=It.canonical.x-(It.canonical.x>>ke<<ke),Ke=It.canonical.y-(It.canonical.y>>ke<<ke),gr=e.X>>ke;e.aP(Vt.posMatrix,0,gr,0,gr,0,1),e.J(Vt.posMatrix,Vt.posMatrix,[-Oe*gr,-Ke*gr,0]),ht[Et]=Vt}else if(I.canonical.isChildOf(It.canonical)){let Vt=I.clone();Vt.posMatrix=new Float64Array(16);let ke=I.canonical.z-It.canonical.z,Oe=I.canonical.x-(I.canonical.x>>ke<<ke),Ke=I.canonical.y-(I.canonical.y>>ke<<ke),gr=e.X>>ke;e.aP(Vt.posMatrix,0,e.X,0,e.X,0,1),e.J(Vt.posMatrix,Vt.posMatrix,[Oe*gr,Ke*gr,0]),e.K(Vt.posMatrix,Vt.posMatrix,[1/2**ke,1/2**ke,0]),ht[Et]=Vt}}return ht}getSourceTile(I,ht){let Et=this.sourceCache._source,It=I.overscaledZ-this.deltaZoom;if(It>Et.maxzoom&&(It=Et.maxzoom),It<Et.minzoom)return null;this._sourceTileCache[I.key]||(this._sourceTileCache[I.key]=I.scaledTo(It).key);let Vt=this.sourceCache.getTileByID(this._sourceTileCache[I.key]);if((!Vt||!Vt.dem)&&ht)for(;It>=Et.minzoom&&(!Vt||!Vt.dem);)Vt=this.sourceCache.getTileByID(I.scaledTo(It--).key);return Vt}tilesAfterTime(I=Date.now()){return Object.values(this._tiles).filter(ht=>ht.timeAdded>=I)}}class Pl{constructor(I,ht,Et){this.painter=I,this.sourceCache=new tl(ht),this.options=Et,this.exaggeration=typeof Et.exaggeration=="number"?Et.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(I,ht,Et,It=e.X){var Vt;if(!(ht>=0&&ht<It&&Et>=0&&Et<It))return 0;let ke=this.getTerrainData(I),Oe=(Vt=ke.tile)===null||Vt===void 0?void 0:Vt.dem;if(!Oe)return 0;let Ke=function(Xt,ae,xe){var Ae=ae[0],je=ae[1];return Xt[0]=xe[0]*Ae+xe[4]*je+xe[12],Xt[1]=xe[1]*Ae+xe[5]*je+xe[13],Xt}([],[ht/It*e.X,Et/It*e.X],ke.u_terrain_matrix),gr=[Ke[0]*Oe.dim,Ke[1]*Oe.dim],Or=Math.floor(gr[0]),Dr=Math.floor(gr[1]),ln=gr[0]-Or,Sn=gr[1]-Dr;return Oe.get(Or,Dr)*(1-ln)*(1-Sn)+Oe.get(Or+1,Dr)*ln*(1-Sn)+Oe.get(Or,Dr+1)*(1-ln)*Sn+Oe.get(Or+1,Dr+1)*ln*Sn}getElevationForLngLatZoom(I,ht){if(!e.bb(ht,I.wrap()))return 0;let{tileID:Et,mercatorX:It,mercatorY:Vt}=this._getOverscaledTileIDFromLngLatZoom(I,ht);return this.getElevation(Et,It%e.X,Vt%e.X,e.X)}getElevation(I,ht,Et,It=e.X){return this.getDEMElevation(I,ht,Et,It)*this.exaggeration}getTerrainData(I){if(!this._emptyDemTexture){let It=this.painter.context,Vt=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new p(It,Vt,It.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new p(It,new e.R({width:1,height:1}),It.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(It.gl.NEAREST,It.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.an([])}let ht=this.sourceCache.getSourceTile(I,!0);if(ht&&ht.dem&&(!ht.demTexture||ht.needsTerrainPrepare)){let It=this.painter.context;ht.demTexture=this.painter.getTileTexture(ht.dem.stride),ht.demTexture?ht.demTexture.update(ht.dem.getPixels(),{premultiply:!1}):ht.demTexture=new p(It,ht.dem.getPixels(),It.gl.RGBA,{premultiply:!1}),ht.demTexture.bind(It.gl.NEAREST,It.gl.CLAMP_TO_EDGE),ht.needsTerrainPrepare=!1}let Et=ht&&ht+ht.tileID.key+I.key;if(Et&&!this._demMatrixCache[Et]){let It=this.sourceCache.sourceCache._source.maxzoom,Vt=I.canonical.z-ht.tileID.canonical.z;I.overscaledZ>I.canonical.z&&(I.canonical.z>=It?Vt=I.canonical.z-It:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let ke=I.canonical.x-(I.canonical.x>>Vt<<Vt),Oe=I.canonical.y-(I.canonical.y>>Vt<<Vt),Ke=e.bc(new Float64Array(16),[1/(e.X<<Vt),1/(e.X<<Vt),0]);e.J(Ke,Ke,[ke*e.X,Oe*e.X,0]),this._demMatrixCache[I.key]={matrix:Ke,coord:I}}return{u_depth:2,u_terrain:3,u_terrain_dim:ht&&ht.dem&&ht.dem.dim||1,u_terrain_matrix:Et?this._demMatrixCache[I.key].matrix:this._emptyDemMatrix,u_terrain_unpack:ht&&ht.dem&&ht.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(ht&&ht.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:ht}}getFramebuffer(I){let ht=this.painter,Et=ht.width/devicePixelRatio,It=ht.height/devicePixelRatio;return!this._fbo||this._fbo.width===Et&&this._fbo.height===It||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new p(ht.context,{width:Et,height:It,data:null},ht.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(ht.context.gl.NEAREST,ht.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new p(ht.context,{width:Et,height:It,data:null},ht.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(ht.context.gl.NEAREST,ht.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=ht.context.createFramebuffer(Et,It,!0,!1),this._fbo.depthAttachment.set(ht.context.createRenderbuffer(ht.context.gl.DEPTH_COMPONENT16,Et,It))),this._fbo.colorAttachment.set(I==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let I=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let ht=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let Vt=0,ke=0;Vt<this._coordsTextureSize;Vt++)for(let Oe=0;Oe<this._coordsTextureSize;Oe++,ke+=4)ht[ke+0]=255&Oe,ht[ke+1]=255&Vt,ht[ke+2]=Oe>>8<<4|Vt>>8,ht[ke+3]=0;let Et=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(ht.buffer)),It=new p(I,Et,I.gl.RGBA,{premultiply:!1});return It.bind(I.gl.NEAREST,I.gl.CLAMP_TO_EDGE),this._coordsTexture=It,It}pointCoordinate(I){this.painter.maybeDrawDepthAndCoords(!0);let ht=new Uint8Array(4),Et=this.painter.context,It=Et.gl,Vt=Math.round(I.x*this.painter.pixelRatio/devicePixelRatio),ke=Math.round(I.y*this.painter.pixelRatio/devicePixelRatio),Oe=Math.round(this.painter.height/devicePixelRatio);Et.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),It.readPixels(Vt,Oe-ke-1,1,1,It.RGBA,It.UNSIGNED_BYTE,ht),Et.bindFramebuffer.set(null);let Ke=ht[0]+(ht[2]>>4<<8),gr=ht[1]+((15&ht[2])<<8),Or=this.coordsIndex[255-ht[3]],Dr=Or&&this.sourceCache.getTileByID(Or);if(!Dr)return null;let ln=this._coordsTextureSize,Sn=(1<<Dr.tileID.canonical.z)*ln;return new e.Z((Dr.tileID.canonical.x*ln+Ke)/Sn+Dr.tileID.wrap,(Dr.tileID.canonical.y*ln+gr)/Sn,this.getElevation(Dr.tileID,Ke,gr,ln))}depthAtPoint(I){let ht=new Uint8Array(4),Et=this.painter.context,It=Et.gl;return Et.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),It.readPixels(I.x,this.painter.height/devicePixelRatio-I.y-1,1,1,It.RGBA,It.UNSIGNED_BYTE,ht),Et.bindFramebuffer.set(null),(ht[0]/16777216+ht[1]/65536+ht[2]/256+ht[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let I=this.painter.context,ht=new e.bd,Et=new e.aY,It=this.meshSize,Vt=e.X/It,ke=It*It;for(let Dr=0;Dr<=It;Dr++)for(let ln=0;ln<=It;ln++)ht.emplaceBack(ln*Vt,Dr*Vt,0);for(let Dr=0;Dr<ke;Dr+=It+1)for(let ln=0;ln<It;ln++)Et.emplaceBack(ln+Dr,It+ln+Dr+1,It+ln+Dr+2),Et.emplaceBack(ln+Dr,It+ln+Dr+2,ln+Dr+1);let Oe=ht.length,Ke=Oe+2*(It+1);for(let Dr of[0,1])for(let ln=0;ln<=It;ln++)for(let Sn of[0,1])ht.emplaceBack(ln*Vt,Dr*e.X,Sn);for(let Dr=0;Dr<2*It;Dr+=2)Et.emplaceBack(Ke+Dr,Ke+Dr+1,Ke+Dr+3),Et.emplaceBack(Ke+Dr,Ke+Dr+3,Ke+Dr+2),Et.emplaceBack(Oe+Dr,Oe+Dr+3,Oe+Dr+1),Et.emplaceBack(Oe+Dr,Oe+Dr+2,Oe+Dr+3);let gr=ht.length,Or=gr+2*(It+1);for(let Dr of[0,1])for(let ln=0;ln<=It;ln++)for(let Sn of[0,1])ht.emplaceBack(Dr*e.X,ln*Vt,Sn);for(let Dr=0;Dr<2*It;Dr+=2)Et.emplaceBack(gr+Dr,gr+Dr+1,gr+Dr+3),Et.emplaceBack(gr+Dr,gr+Dr+3,gr+Dr+2),Et.emplaceBack(Or+Dr,Or+Dr+3,Or+Dr+1),Et.emplaceBack(Or+Dr,Or+Dr+2,Or+Dr+3);return this._mesh=new jc(I.createVertexBuffer(ht,ds.members),I.createIndexBuffer(Et),e.a0.simpleSegment(0,0,ht.length,Et.length)),this._mesh}getMeshFrameDelta(I){return 2*Math.PI*e.be/Math.pow(2,I)/5}getMinTileElevationForLngLatZoom(I,ht){var Et;let{tileID:It}=this._getOverscaledTileIDFromLngLatZoom(I,ht);return(Et=this.getMinMaxElevation(It).minElevation)!==null&&Et!==void 0?Et:0}getMinMaxElevation(I){let ht=this.getTerrainData(I).tile,Et={minElevation:null,maxElevation:null};return ht&&ht.dem&&(Et.minElevation=ht.dem.min*this.exaggeration,Et.maxElevation=ht.dem.max*this.exaggeration),Et}_getOverscaledTileIDFromLngLatZoom(I,ht){let Et=e.Z.fromLngLat(I.wrap()),It=(1<<ht)*e.X,Vt=Et.x*It,ke=Et.y*It,Oe=Math.floor(Vt/e.X),Ke=Math.floor(ke/e.X);return{tileID:new e.S(ht,0,ht,Oe,Ke),mercatorX:Vt,mercatorY:ke}}}class iu{constructor(I,ht,Et){this._context=I,this._size=ht,this._tileSize=Et,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let I of this._objects)I.texture.destroy(),I.fbo.destroy()}_createObject(I){let ht=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),Et=new p(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return Et.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),ht.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),ht.colorAttachment.set(Et.texture),{id:I,fbo:ht,texture:Et,stamp:-1,inUse:!1}}getObjectForId(I){return this._objects[I]}useObject(I){I.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(ht=>I.id!==ht),this._recentlyUsed.push(I.id)}stampObject(I){I.stamp=++this._stamp}getOrCreateFreeObject(){for(let ht of this._recentlyUsed)if(!this._objects[ht].inUse)return this._objects[ht];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let I=this._createObject(this._objects.length);return this._objects.push(I),I}freeObject(I){I.inUse=!1}freeAllObjects(){for(let I of this._objects)this.freeObject(I)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(I=>!I.inUse)===!1}}let Hl={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class au{constructor(I,ht){this.painter=I,this.terrain=ht,this.pool=new iu(I.context,30,ht.sourceCache.tileSize*ht.qualityFactor)}destruct(){this.pool.destruct()}getTexture(I){return this.pool.getObjectForId(I.rtt[this._stacks.length-1].id).texture}prepareForRender(I,ht){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=I._order.filter(Et=>!I._layers[Et].isHidden(ht)),this._coordsDescendingInv={};for(let Et in I.sourceCaches){this._coordsDescendingInv[Et]={};let It=I.sourceCaches[Et].getVisibleCoordinates();for(let Vt of It){let ke=this.terrain.sourceCache.getTerrainCoords(Vt);for(let Oe in ke)this._coordsDescendingInv[Et][Oe]||(this._coordsDescendingInv[Et][Oe]=[]),this._coordsDescendingInv[Et][Oe].push(ke[Oe])}}this._coordsDescendingInvStr={};for(let Et of I._order){let It=I._layers[Et],Vt=It.source;if(Hl[It.type]&&!this._coordsDescendingInvStr[Vt]){this._coordsDescendingInvStr[Vt]={};for(let ke in this._coordsDescendingInv[Vt])this._coordsDescendingInvStr[Vt][ke]=this._coordsDescendingInv[Vt][ke].map(Oe=>Oe.key).sort().join()}}for(let Et of this._renderableTiles)for(let It in this._coordsDescendingInvStr){let Vt=this._coordsDescendingInvStr[It][Et.tileID.key];Vt&&Vt!==Et.rttCoords[It]&&(Et.rtt=[])}}renderLayer(I){if(I.isHidden(this.painter.transform.zoom))return!1;let ht=I.type,Et=this.painter,It=this._renderableLayerIds[this._renderableLayerIds.length-1]===I.id;if(Hl[ht]&&(this._prevType&&Hl[this._prevType]||this._stacks.push([]),this._prevType=ht,this._stacks[this._stacks.length-1].push(I.id),!It))return!0;if(Hl[this._prevType]||Hl[ht]&&It){this._prevType=ht;let Vt=this._stacks.length-1,ke=this._stacks[Vt]||[];for(let Oe of this._renderableTiles){if(this.pool.isFull()&&(zu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(Oe),Oe.rtt[Vt]){let gr=this.pool.getObjectForId(Oe.rtt[Vt].id);if(gr.stamp===Oe.rtt[Vt].stamp){this.pool.useObject(gr);continue}}let Ke=this.pool.getOrCreateFreeObject();this.pool.useObject(Ke),this.pool.stampObject(Ke),Oe.rtt[Vt]={id:Ke.id,stamp:Ke.stamp},Et.context.bindFramebuffer.set(Ke.fbo.framebuffer),Et.context.clear({color:e.aM.transparent,stencil:0}),Et.currentStencilSource=void 0;for(let gr=0;gr<ke.length;gr++){let Or=Et.style._layers[ke[gr]],Dr=Or.source?this._coordsDescendingInv[Or.source][Oe.tileID.key]:[Oe.tileID];Et.context.viewport.set([0,0,Ke.fbo.width,Ke.fbo.height]),Et._renderTileClippingMasks(Or,Dr),Et.renderLayer(Et,Et.style.sourceCaches[Or.source],Or,Dr),Or.source&&(Oe.rttCoords[Or.source]=this._coordsDescendingInvStr[Or.source][Oe.tileID.key])}}return zu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Hl[ht]}return!1}}let ml={"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"},qu=r,Lu={hash:!1,interactive:!0,bearingSnap:7,attributionControl:os,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},uu=qt=>{qt.touchstart=qt.dragStart,qt.touchmoveWindow=qt.dragMove,qt.touchend=qt.dragEnd},zo={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ms{constructor(I,ht,Et=!1){this.mousedown=ke=>{this.startMouse(e.e({},ke,{ctrlKey:!0,preventDefault:()=>ke.preventDefault()}),i.mousePos(this.element,ke)),i.addEventListener(window,"mousemove",this.mousemove),i.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ke=>{this.moveMouse(ke,i.mousePos(this.element,ke))},this.mouseup=ke=>{this.mouseRotate.dragEnd(ke),this.mousePitch&&this.mousePitch.dragEnd(ke),this.offTemp()},this.touchstart=ke=>{ke.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=i.touchPos(this.element,ke.targetTouches)[0],this.startTouch(ke,this._startPos),i.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),i.addEventListener(window,"touchend",this.touchend))},this.touchmove=ke=>{ke.targetTouches.length!==1?this.reset():(this._lastPos=i.touchPos(this.element,ke.targetTouches)[0],this.moveTouch(ke,this._lastPos))},this.touchend=ke=>{ke.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 It=I.dragRotate._mouseRotate.getClickTolerance(),Vt=I.dragRotate._mousePitch.getClickTolerance();this.element=ht,this.mouseRotate=gc({clickTolerance:It,enable:!0}),this.touchRotate=(({enable:ke,clickTolerance:Oe,bearingDegreesPerPixelMoved:Ke=.8})=>{let gr=new wf;return new th({clickTolerance:Oe,move:(Or,Dr)=>({bearingDelta:(Dr.x-Or.x)*Ke}),moveStateManager:gr,enable:ke,assignEvents:uu})})({clickTolerance:It,enable:!0}),this.map=I,Et&&(this.mousePitch=Jf({clickTolerance:Vt,enable:!0}),this.touchPitch=(({enable:ke,clickTolerance:Oe,pitchDegreesPerPixelMoved:Ke=-.5})=>{let gr=new wf;return new th({clickTolerance:Oe,move:(Or,Dr)=>({pitchDelta:(Dr.y-Or.y)*Ke}),moveStateManager:gr,enable:ke,assignEvents:uu})})({clickTolerance:Vt,enable:!0})),i.addEventListener(ht,"mousedown",this.mousedown),i.addEventListener(ht,"touchstart",this.touchstart,{passive:!1}),i.addEventListener(ht,"touchcancel",this.reset)}startMouse(I,ht){this.mouseRotate.dragStart(I,ht),this.mousePitch&&this.mousePitch.dragStart(I,ht),i.disableDrag()}startTouch(I,ht){this.touchRotate.dragStart(I,ht),this.touchPitch&&this.touchPitch.dragStart(I,ht),i.disableDrag()}moveMouse(I,ht){let Et=this.map,{bearingDelta:It}=this.mouseRotate.dragMove(I,ht)||{};if(It&&Et.setBearing(Et.getBearing()+It),this.mousePitch){let{pitchDelta:Vt}=this.mousePitch.dragMove(I,ht)||{};Vt&&Et.setPitch(Et.getPitch()+Vt)}}moveTouch(I,ht){let Et=this.map,{bearingDelta:It}=this.touchRotate.dragMove(I,ht)||{};if(It&&Et.setBearing(Et.getBearing()+It),this.touchPitch){let{pitchDelta:Vt}=this.touchPitch.dragMove(I,ht)||{};Vt&&Et.setPitch(Et.getPitch()+Vt)}}off(){let I=this.element;i.removeEventListener(I,"mousedown",this.mousedown),i.removeEventListener(I,"touchstart",this.touchstart,{passive:!1}),i.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),i.removeEventListener(window,"touchend",this.touchend),i.removeEventListener(I,"touchcancel",this.reset),this.offTemp()}offTemp(){i.enableDrag(),i.removeEventListener(window,"mousemove",this.mousemove),i.removeEventListener(window,"mouseup",this.mouseup),i.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),i.removeEventListener(window,"touchend",this.touchend)}}let $l;function Fl(qt,I,ht){let Et=new e.N(qt.lng,qt.lat);if(qt=new e.N(qt.lng,qt.lat),I){let It=new e.N(qt.lng-360,qt.lat),Vt=new e.N(qt.lng+360,qt.lat),ke=ht.locationPoint(qt).distSqr(I);ht.locationPoint(It).distSqr(I)<ke?qt=It:ht.locationPoint(Vt).distSqr(I)<ke&&(qt=Vt)}for(;Math.abs(qt.lng-ht.center.lng)>180;){let It=ht.locationPoint(qt);if(It.x>=0&&It.y>=0&&It.x<=ht.width&&It.y<=ht.height)break;qt.lng>ht.center.lng?qt.lng-=360:qt.lng+=360}return qt.lng!==Et.lng&&ht.locationPoint(qt).y>ht.height/2-ht.getHorizon()?qt:Et}let vc={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 Hc(qt,I,ht){let Et=qt.classList;for(let It in vc)Et.remove(`maplibregl-${ht}-anchor-${It}`);Et.add(`maplibregl-${ht}-anchor-${I}`)}class Pc extends e.E{constructor(I){if(super(),this._onKeyPress=ht=>{let Et=ht.code,It=ht.charCode||ht.keyCode;Et!=="Space"&&Et!=="Enter"&&It!==32&&It!==13||this.togglePopup()},this._onMapClick=ht=>{let Et=ht.originalEvent.target,It=this._element;this._popup&&(Et===It||It.contains(Et))&&this.togglePopup()},this._update=ht=>{var Et;if(!this._map)return;let It=this._map.loaded()&&!this._map.isMoving();(ht?.type==="terrain"||ht?.type==="render"&&!It)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Fl(this._lngLat,this._flatPos,this._map.transform):(Et=this._lngLat)===null||Et===void 0?void 0:Et.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 Vt="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Vt=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Vt=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ke="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ke="rotateX(0deg)":this._pitchAlignment==="map"&&(ke=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||ht&&ht.type!=="moveend"||(this._pos=this._pos.round()),i.setTransform(this._element,`${vc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ke} ${Vt}`),o.frameAsync(new AbortController).then(()=>{this._updateOpacity(ht&&ht.type==="moveend")}).catch(()=>{})},this._onMove=ht=>{if(!this._isDragging){let Et=this._clickTolerance||this._map._clickTolerance;this._isDragging=ht.point.dist(this._pointerdownPos)>=Et}this._isDragging&&(this._pos=ht.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=ht=>{this._element.contains(ht.originalEvent.target)&&(ht.preventDefault(),this._positionDelta=ht.point.sub(this._pos).add(this._offset),this._pointerdownPos=ht.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=I&&I.anchor||"center",this._color=I&&I.color||"#3FB1CE",this._scale=I&&I.scale||1,this._draggable=I&&I.draggable||!1,this._clickTolerance=I&&I.clickTolerance||0,this._subpixelPositioning=I&&I.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=I&&I.rotation||0,this._rotationAlignment=I&&I.rotationAlignment||"auto",this._pitchAlignment=I&&I.pitchAlignment&&I.pitchAlignment!=="auto"?I.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(I?.opacity,I?.opacityWhenCovered),I&&I.element)this._element=I.element,this._offset=e.P.convert(I&&I.offset||[0,0]);else{this._defaultMarker=!0,this._element=i.create("div");let ht=i.createNS("http://www.w3.org/2000/svg","svg"),Et=41,It=27;ht.setAttributeNS(null,"display","block"),ht.setAttributeNS(null,"height",`${Et}px`),ht.setAttributeNS(null,"width",`${It}px`),ht.setAttributeNS(null,"viewBox",`0 0 ${It} ${Et}`);let Vt=i.createNS("http://www.w3.org/2000/svg","g");Vt.setAttributeNS(null,"stroke","none"),Vt.setAttributeNS(null,"stroke-width","1"),Vt.setAttributeNS(null,"fill","none"),Vt.setAttributeNS(null,"fill-rule","evenodd");let ke=i.createNS("http://www.w3.org/2000/svg","g");ke.setAttributeNS(null,"fill-rule","nonzero");let Oe=i.createNS("http://www.w3.org/2000/svg","g");Oe.setAttributeNS(null,"transform","translate(3.0, 29.0)"),Oe.setAttributeNS(null,"fill","#000000");let Ke=[{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 Ae of Ke){let je=i.createNS("http://www.w3.org/2000/svg","ellipse");je.setAttributeNS(null,"opacity","0.04"),je.setAttributeNS(null,"cx","10.5"),je.setAttributeNS(null,"cy","5.80029008"),je.setAttributeNS(null,"rx",Ae.rx),je.setAttributeNS(null,"ry",Ae.ry),Oe.appendChild(je)}let gr=i.createNS("http://www.w3.org/2000/svg","g");gr.setAttributeNS(null,"fill",this._color);let Or=i.createNS("http://www.w3.org/2000/svg","path");Or.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"),gr.appendChild(Or);let Dr=i.createNS("http://www.w3.org/2000/svg","g");Dr.setAttributeNS(null,"opacity","0.25"),Dr.setAttributeNS(null,"fill","#000000");let ln=i.createNS("http://www.w3.org/2000/svg","path");ln.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"),Dr.appendChild(ln);let Sn=i.createNS("http://www.w3.org/2000/svg","g");Sn.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Sn.setAttributeNS(null,"fill","#FFFFFF");let Xt=i.createNS("http://www.w3.org/2000/svg","g");Xt.setAttributeNS(null,"transform","translate(8.0, 8.0)");let ae=i.createNS("http://www.w3.org/2000/svg","circle");ae.setAttributeNS(null,"fill","#000000"),ae.setAttributeNS(null,"opacity","0.25"),ae.setAttributeNS(null,"cx","5.5"),ae.setAttributeNS(null,"cy","5.5"),ae.setAttributeNS(null,"r","5.4999962");let xe=i.createNS("http://www.w3.org/2000/svg","circle");xe.setAttributeNS(null,"fill","#FFFFFF"),xe.setAttributeNS(null,"cx","5.5"),xe.setAttributeNS(null,"cy","5.5"),xe.setAttributeNS(null,"r","5.4999962"),Xt.appendChild(ae),Xt.appendChild(xe),ke.appendChild(Oe),ke.appendChild(gr),ke.appendChild(Dr),ke.appendChild(Sn),ke.appendChild(Xt),ht.appendChild(ke),ht.setAttributeNS(null,"height",Et*this._scale+"px"),ht.setAttributeNS(null,"width",It*this._scale+"px"),this._element.appendChild(ht),this._offset=e.P.convert(I&&I.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",ht=>{ht.preventDefault()}),this._element.addEventListener("mousedown",ht=>{ht.preventDefault()}),Hc(this._element,this._anchor,"marker"),I&&I.className)for(let ht of I.className.split(" "))this._element.classList.add(ht);this._popup=null}addTo(I){return this.remove(),this._map=I,this._element.setAttribute("aria-label",I._getUIString("Marker.Title")),I.getCanvasContainer().appendChild(this._element),I.on("move",this._update),I.on("moveend",this._update),I.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),i.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(I){return this._lngLat=e.N.convert(I),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(I){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),I){if(!("offset"in I.options)){let ht=Math.abs(13.5)/Math.SQRT2;I.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[ht,-1*(38.1-13.5+ht)],"bottom-right":[-ht,-1*(38.1-13.5+ht)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=I,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(I){return this._subpixelPositioning=I,this}getPopup(){return this._popup}togglePopup(){let I=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:I?(I.isOpen()?I.remove():(I.setLngLat(this._lngLat),I.addTo(this._map)),this):this}_updateOpacity(I=!1){var ht,Et;if(!(!((ht=this._map)===null||ht===void 0)&&ht.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(I)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let It=this._map,Vt=It.terrain.depthAtPoint(this._pos),ke=It.terrain.getElevationForLngLatZoom(this._lngLat,It.transform.tileZoom);if(It.transform.lngLatToCameraDepth(this._lngLat,ke)-Vt<.006)return void(this._element.style.opacity=this._opacity);let Oe=-this._offset.y/It.transform._pixelPerMeter,Ke=Math.sin(It.getPitch()*Math.PI/180)*Oe,gr=It.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),Or=It.transform.lngLatToCameraDepth(this._lngLat,ke+Ke)-gr>.006;!((Et=this._popup)===null||Et===void 0)&&Et.isOpen()&&Or&&this._popup.remove(),this._element.style.opacity=Or?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(I){return this._offset=e.P.convert(I),this._update(),this}addClassName(I){this._element.classList.add(I)}removeClassName(I){this._element.classList.remove(I)}toggleClassName(I){return this._element.classList.toggle(I)}setDraggable(I){return this._draggable=!!I,this._map&&(I?(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(I){return this._rotation=I||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(I){return this._rotationAlignment=I||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(I){return this._pitchAlignment=I&&I!=="auto"?I:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(I,ht){return I===void 0&&ht===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),I!==void 0&&(this._opacity=I),ht!==void 0&&(this._opacityWhenCovered=ht),this._map&&this._updateOpacity(!0),this}}let Ph={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Wc=0,zh=!1,Iu={maxWidth:100,unit:"metric"};function Ih(qt,I,ht){let Et=ht&&ht.maxWidth||100,It=qt._container.clientHeight/2,Vt=qt.unproject([0,It]),ke=qt.unproject([Et,It]),Oe=Vt.distanceTo(ke);if(ht&&ht.unit==="imperial"){let Ke=3.2808*Oe;Ke>5280?es(I,Et,Ke/5280,qt._getUIString("ScaleControl.Miles")):es(I,Et,Ke,qt._getUIString("ScaleControl.Feet"))}else ht&&ht.unit==="nautical"?es(I,Et,Oe/1852,qt._getUIString("ScaleControl.NauticalMiles")):Oe>=1e3?es(I,Et,Oe/1e3,qt._getUIString("ScaleControl.Kilometers")):es(I,Et,Oe,qt._getUIString("ScaleControl.Meters"))}function es(qt,I,ht,Et){let It=function(Vt){let ke=Math.pow(10,`${Math.floor(Vt)}`.length-1),Oe=Vt/ke;return Oe=Oe>=10?10:Oe>=5?5:Oe>=3?3:Oe>=2?2:Oe>=1?1:function(Ke){let gr=Math.pow(10,Math.ceil(-Math.log(Ke)/Math.LN10));return Math.round(Ke*gr)/gr}(Oe),ke*Oe}(ht);qt.style.width=I*(It/ht)+"px",qt.innerHTML=`${It}&nbsp;${Et}`}let zs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},qc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Zu(qt){if(qt){if(typeof qt=="number"){let I=Math.round(Math.abs(qt)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,qt),"top-left":new e.P(I,I),"top-right":new e.P(-I,I),bottom:new e.P(0,-qt),"bottom-left":new e.P(I,-I),"bottom-right":new e.P(-I,-I),left:new e.P(qt,0),right:new e.P(-qt,0)}}if(qt instanceof e.P||Array.isArray(qt)){let I=e.P.convert(qt);return{center:I,top:I,"top-left":I,"top-right":I,bottom:I,"bottom-left":I,"bottom-right":I,left:I,right:I}}return{center:e.P.convert(qt.center||[0,0]),top:e.P.convert(qt.top||[0,0]),"top-left":e.P.convert(qt["top-left"]||[0,0]),"top-right":e.P.convert(qt["top-right"]||[0,0]),bottom:e.P.convert(qt.bottom||[0,0]),"bottom-left":e.P.convert(qt["bottom-left"]||[0,0]),"bottom-right":e.P.convert(qt["bottom-right"]||[0,0]),left:e.P.convert(qt.left||[0,0]),right:e.P.convert(qt.right||[0,0])}}return Zu(new e.P(0,0))}let Zf=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=fs,t.BoxZoomHandler=Vc,t.CanvasSource=de,t.CooperativeGesturesHandler=za,t.DoubleClickZoomHandler=hi,t.DragPanHandler=Ra,t.DragRotateHandler=$a,t.EdgeInsets=Sc,t.FullscreenControl=class extends e.E{constructor(qt={}){super(),this._onFullscreenChange=()=>{var I;let ht=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((I=ht?.shadowRoot)===null||I===void 0)&&I.fullscreenElement;)ht=ht.shadowRoot.fullscreenElement;ht===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,qt&&qt.container&&(qt.container instanceof HTMLElement?this._container=qt.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(qt){return this._map=qt,this._container||(this._container=this._map.getContainer()),this._controlContainer=i.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){i.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let qt=this._fullscreenButton=i.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);i.create("span","maplibregl-ctrl-icon",qt).setAttribute("aria-hidden","true"),qt.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let qt=this._getTitle();this._fullscreenButton.setAttribute("aria-label",qt),this._fullscreenButton.title=qt}_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=Ht,t.GeolocateControl=class extends e.E{constructor(qt){super(),this._onSuccess=I=>{if(this._map){if(this._isOutOfMapMaxBounds(I))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",I)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=I,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(I),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(I),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",I)),this._finish()}},this._updateCamera=I=>{let ht=new e.N(I.coords.longitude,I.coords.latitude),Et=I.coords.accuracy,It=this._map.getBearing(),Vt=e.e({bearing:It},this.options.fitBoundsOptions),ke=ut.fromLngLat(ht,Et);this._map.fitBounds(ke,Vt,{geolocateSource:!0})},this._updateMarker=I=>{if(I){let ht=new e.N(I.coords.longitude,I.coords.latitude);this._accuracyCircleMarker.setLngLat(ht).addTo(this._map),this._userLocationDotMarker.setLngLat(ht).addTo(this._map),this._accuracy=I.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=I=>{if(this._map){if(this.options.trackUserLocation)if(I.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 ht=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ht,this._geolocateButton.setAttribute("aria-label",ht),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(I.code===3&&zh)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",I)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",I=>I.preventDefault()),this._geolocateButton=i.create("button","maplibregl-ctrl-geolocate",this._container),i.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=I=>{if(this._map){if(I===!1){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");let ht=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=ht,this._geolocateButton.setAttribute("aria-label",ht)}else{let ht=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=ht,this._geolocateButton.setAttribute("aria-label",ht)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=i.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Pc({element:this._dotElement}),this._circleElement=i.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Pc({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",ht=>{ht.geolocateSource||this._watchState!=="ACTIVE_LOCK"||ht.originalEvent&&ht.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({},Ph,qt)}onAdd(qt){return this._map=qt,this._container=i.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,function*(I=!1){if($l!==void 0&&!I)return $l;if(window.navigator.permissions===void 0)return $l=!!window.navigator.geolocation,$l;try{$l=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{$l=!!window.navigator.geolocation}return $l})}().then(I=>this._finishSetupUI(I)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),i.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Wc=0,zh=!1}_isOutOfMapMaxBounds(qt){let I=this._map.getMaxBounds(),ht=qt.coords;return I&&(ht.longitude<I.getWest()||ht.longitude>I.getEast()||ht.latitude<I.getSouth()||ht.latitude>I.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 qt=this._map.getBounds(),I=qt.getSouthEast(),ht=qt.getNorthEast(),Et=I.distanceTo(ht),It=Math.ceil(this._accuracy/(Et/this._map._container.clientHeight)*2);this._circleElement.style.width=`${It}px`,this._circleElement.style.height=`${It}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":Wc--,zh=!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 qt;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Wc++,Wc>1?(qt={maximumAge:6e5,timeout:0},zh=!0):(qt=this.options.positionOptions,zh=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,qt)}}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=gh,t.ImageSource=ge,t.KeyboardHandler=Ur,t.LngLatBounds=ut,t.LogoControl=no,t.Map=class extends Zo{constructor(qt){e.bf.mark(e.bg.create);let I=Object.assign(Object.assign({},Lu),qt);if(I.minZoom!=null&&I.maxZoom!=null&&I.minZoom>I.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(I.minPitch!=null&&I.maxPitch!=null&&I.minPitch>I.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(I.minPitch!=null&&I.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(I.maxPitch!=null&&I.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new _u(I.minZoom,I.maxZoom,I.minPitch,I.maxPitch,I.renderWorldCopies),{bearingSnap:I.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new qa,this._controls=[],this._mapId=e.a4(),this._contextLost=ht=>{ht.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:ht}))},this._contextRestored=ht=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("webglcontextrestored",{originalEvent:ht}))},this._onMapScroll=ht=>{if(ht.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=I.interactive,this._maxTileCacheSize=I.maxTileCacheSize,this._maxTileCacheZoomLevels=I.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=I.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=I.preserveDrawingBuffer===!0,this._antialias=I.antialias===!0,this._trackResize=I.trackResize===!0,this._bearingSnap=I.bearingSnap,this._refreshExpiredTiles=I.refreshExpiredTiles===!0,this._fadeDuration=I.fadeDuration,this._crossSourceCollisions=I.crossSourceCollisions===!0,this._collectResourceTiming=I.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ml),I.locale),this._clickTolerance=I.clickTolerance,this._overridePixelRatio=I.pixelRatio,this._maxCanvasSize=I.maxCanvasSize,this.transformCameraUpdate=I.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=I.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=u.addThrottleControl(()=>this.isMoving()),this._requestManager=new b(I.transformRequest),typeof I.container=="string"){if(this._container=document.getElementById(I.container),!this._container)throw new Error(`Container '${I.container}' not found.`)}else{if(!(I.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=I.container}if(I.maxBounds&&this.setMaxBounds(I.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 ht=!1,Et=uf(It=>{this._trackResize&&!this._removed&&(this.resize(It),this.redraw())},50);this._resizeObserver=new ResizeObserver(It=>{ht?Et(It):ht=!0}),this._resizeObserver.observe(this._container)}this.handlers=new rs(this,I),this._hash=I.hash&&new gh(typeof I.hash=="string"&&I.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:I.center,zoom:I.zoom,bearing:I.bearing,pitch:I.pitch}),I.bounds&&(this.resize(),this.fitBounds(I.bounds,e.e({},I.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=I.localIdeographFontFamily,this._validateStyle=I.validateStyle,I.style&&this.setStyle(I.style,{localIdeographFontFamily:I.localIdeographFontFamily}),I.attributionControl&&this.addControl(new fs(typeof I.attributionControl=="boolean"?void 0:I.attributionControl)),I.maplibreLogo&&this.addControl(new no,I.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",ht=>{this._update(ht.dataType==="style"),this.fire(new e.k(`${ht.dataType}data`,ht))}),this.on("dataloading",ht=>{this.fire(new e.k(`${ht.dataType}dataloading`,ht))}),this.on("dataabort",ht=>{this.fire(new e.k("sourcedataabort",ht))})}_getMapId(){return this._mapId}addControl(qt,I){if(I===void 0&&(I=qt.getDefaultPosition?qt.getDefaultPosition():"top-right"),!qt||!qt.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 ht=qt.onAdd(this);this._controls.push(qt);let Et=this._controlPositions[I];return I.indexOf("bottom")!==-1?Et.insertBefore(ht,Et.firstChild):Et.appendChild(ht),this}removeControl(qt){if(!qt||!qt.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 I=this._controls.indexOf(qt);return I>-1&&this._controls.splice(I,1),qt.onRemove(this),this}hasControl(qt){return this._controls.indexOf(qt)>-1}calculateCameraOptionsFromTo(qt,I,ht,Et){return Et==null&&this.terrain&&(Et=this.terrain.getElevationForLngLatZoom(ht,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(qt,I,ht,Et)}resize(qt){var I;let ht=this._containerDimensions(),Et=ht[0],It=ht[1],Vt=this._getClampedPixelRatio(Et,It);if(this._resizeCanvas(Et,It,Vt),this.painter.resize(Et,It,Vt),this.painter.overLimit()){let Oe=this.painter.context.gl;this._maxCanvasSize=[Oe.drawingBufferWidth,Oe.drawingBufferHeight];let Ke=this._getClampedPixelRatio(Et,It);this._resizeCanvas(Et,It,Ke),this.painter.resize(Et,It,Ke)}this.transform.resize(Et,It),(I=this._requestedCameraState)===null||I===void 0||I.resize(Et,It);let ke=!this._moving;return ke&&(this.stop(),this.fire(new e.k("movestart",qt)).fire(new e.k("move",qt))),this.fire(new e.k("resize",qt)),ke&&this.fire(new e.k("moveend",qt)),this}_getClampedPixelRatio(qt,I){let{0:ht,1:Et}=this._maxCanvasSize,It=this.getPixelRatio(),Vt=qt*It,ke=I*It;return Math.min(Vt>ht?ht/Vt:1,ke>Et?Et/ke:1)*It}getPixelRatio(){var qt;return(qt=this._overridePixelRatio)!==null&&qt!==void 0?qt:devicePixelRatio}setPixelRatio(qt){this._overridePixelRatio=qt,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(qt){return this.transform.setMaxBounds(ut.convert(qt)),this._update()}setMinZoom(qt){if((qt=qt??-2)>=-2&&qt<=this.transform.maxZoom)return this.transform.minZoom=qt,this._update(),this.getZoom()<qt&&this.setZoom(qt),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(qt){if((qt=qt??22)>=this.transform.minZoom)return this.transform.maxZoom=qt,this._update(),this.getZoom()>qt&&this.setZoom(qt),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(qt){if((qt=qt??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(qt>=0&&qt<=this.transform.maxPitch)return this.transform.minPitch=qt,this._update(),this.getPitch()<qt&&this.setPitch(qt),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(qt){if((qt=qt??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(qt>=this.transform.minPitch)return this.transform.maxPitch=qt,this._update(),this.getPitch()>qt&&this.setPitch(qt),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(qt){return this.transform.renderWorldCopies=qt,this._update()}project(qt){return this.transform.locationPoint(e.N.convert(qt),this.style&&this.terrain)}unproject(qt){return this.transform.pointLocation(e.P.convert(qt),this.terrain)}isMoving(){var qt;return this._moving||((qt=this.handlers)===null||qt===void 0?void 0:qt.isMoving())}isZooming(){var qt;return this._zooming||((qt=this.handlers)===null||qt===void 0?void 0:qt.isZooming())}isRotating(){var qt;return this._rotating||((qt=this.handlers)===null||qt===void 0?void 0:qt.isRotating())}_createDelegatedListener(qt,I,ht){if(qt==="mouseenter"||qt==="mouseover"){let Et=!1;return{layers:I,listener:ht,delegates:{mousemove:It=>{let Vt=I.filter(Oe=>this.getLayer(Oe)),ke=Vt.length!==0?this.queryRenderedFeatures(It.point,{layers:Vt}):[];ke.length?Et||(Et=!0,ht.call(this,new Qc(qt,this,It.originalEvent,{features:ke}))):Et=!1},mouseout:()=>{Et=!1}}}}if(qt==="mouseleave"||qt==="mouseout"){let Et=!1;return{layers:I,listener:ht,delegates:{mousemove:It=>{let Vt=I.filter(ke=>this.getLayer(ke));(Vt.length!==0?this.queryRenderedFeatures(It.point,{layers:Vt}):[]).length?Et=!0:Et&&(Et=!1,ht.call(this,new Qc(qt,this,It.originalEvent)))},mouseout:It=>{Et&&(Et=!1,ht.call(this,new Qc(qt,this,It.originalEvent)))}}}}{let Et=It=>{let Vt=I.filter(Oe=>this.getLayer(Oe)),ke=Vt.length!==0?this.queryRenderedFeatures(It.point,{layers:Vt}):[];ke.length&&(It.features=ke,ht.call(this,It),delete It.features)};return{layers:I,listener:ht,delegates:{[qt]:Et}}}}_saveDelegatedListener(qt,I){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[qt]=this._delegatedListeners[qt]||[],this._delegatedListeners[qt].push(I)}_removeDelegatedListener(qt,I,ht){if(!this._delegatedListeners||!this._delegatedListeners[qt])return;let Et=this._delegatedListeners[qt];for(let It=0;It<Et.length;It++){let Vt=Et[It];if(Vt.listener===ht&&Vt.layers.length===I.length&&Vt.layers.every(ke=>I.includes(ke))){for(let ke in Vt.delegates)this.off(ke,Vt.delegates[ke]);return void Et.splice(It,1)}}}on(qt,I,ht){if(ht===void 0)return super.on(qt,I);let Et=this._createDelegatedListener(qt,typeof I=="string"?[I]:I,ht);this._saveDelegatedListener(qt,Et);for(let It in Et.delegates)this.on(It,Et.delegates[It]);return this}once(qt,I,ht){if(ht===void 0)return super.once(qt,I);let Et=typeof I=="string"?[I]:I,It=this._createDelegatedListener(qt,Et,ht);for(let Vt in It.delegates){let ke=It.delegates[Vt];It.delegates[Vt]=(...Oe)=>{this._removeDelegatedListener(qt,Et,ht),ke(...Oe)}}this._saveDelegatedListener(qt,It);for(let Vt in It.delegates)this.once(Vt,It.delegates[Vt]);return this}off(qt,I,ht){return ht===void 0?super.off(qt,I):(this._removeDelegatedListener(qt,typeof I=="string"?[I]:I,ht),this)}queryRenderedFeatures(qt,I){if(!this.style)return[];let ht,Et=qt instanceof e.P||Array.isArray(qt),It=Et?qt:[[0,0],[this.transform.width,this.transform.height]];if(I=I||(Et?{}:qt)||{},It instanceof e.P||typeof It[0]=="number")ht=[e.P.convert(It)];else{let Vt=e.P.convert(It[0]),ke=e.P.convert(It[1]);ht=[Vt,new e.P(ke.x,Vt.y),ke,new e.P(Vt.x,ke.y),Vt]}return this.style.queryRenderedFeatures(ht,I,this.transform)}querySourceFeatures(qt,I){return this.style.querySourceFeatures(qt,I)}setStyle(qt,I){return(I=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},I)).diff!==!1&&I.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&qt?(this._diffStyle(qt,I),this):(this._localIdeographFontFamily=I.localIdeographFontFamily,this._updateStyle(qt,I))}setTransformRequest(qt){return this._requestManager.setTransformRequest(qt),this}_getUIString(qt){let I=this._locale[qt];if(I==null)throw new Error(`Missing UI string '${qt}'`);return I}_updateStyle(qt,I){if(I.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(qt,I));let ht=this.style&&I.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!qt)),qt?(this.style=new Gr(this,I||{}),this.style.setEventedParent(this,{style:this.style}),typeof qt=="string"?this.style.loadURL(qt,I,ht):this.style.loadJSON(qt,I,ht),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Gr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(qt,I){if(typeof qt=="string"){let ht=this._requestManager.transformRequest(qt,"Style");e.h(ht,new AbortController).then(Et=>{this._updateDiff(Et.data,I)}).catch(Et=>{Et&&this.fire(new e.j(Et))})}else typeof qt=="object"&&this._updateDiff(qt,I)}_updateDiff(qt,I){try{this.style.setState(qt,I)&&this._update(!0)}catch(ht){e.w(`Unable to perform style diff: ${ht.message||ht.error||ht}. Rebuilding the style from scratch.`),this._updateStyle(qt,I)}}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(qt,I){return this._lazyInitEmptyStyle(),this.style.addSource(qt,I),this._update(!0)}isSourceLoaded(qt){let I=this.style&&this.style.sourceCaches[qt];if(I!==void 0)return I.loaded();this.fire(new e.j(new Error(`There is no source with ID '${qt}'`)))}setTerrain(qt){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),qt){let I=this.style.sourceCaches[qt.source];if(!I)throw new Error(`cannot load terrain, because there exists no source with ID: ${qt.source}`);this.terrain===null&&I.reload();for(let ht in this.style._layers){let Et=this.style._layers[ht];Et.type==="hillshade"&&Et.source===qt.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 Pl(this.painter,I,qt),this.painter.renderToTexture=new au(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=ht=>{ht.dataType==="style"?this.terrain.sourceCache.freeRtt():ht.dataType==="source"&&ht.tile&&(ht.sourceId!==qt.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(ht.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:qt})),this}getTerrain(){var qt,I;return(I=(qt=this.terrain)===null||qt===void 0?void 0:qt.options)!==null&&I!==void 0?I:null}areTilesLoaded(){let qt=this.style&&this.style.sourceCaches;for(let I in qt){let ht=qt[I]._tiles;for(let Et in ht){let It=ht[Et];if(It.state!=="loaded"&&It.state!=="errored")return!1}}return!0}removeSource(qt){return this.style.removeSource(qt),this._update(!0)}getSource(qt){return this.style.getSource(qt)}addImage(qt,I,ht={}){let{pixelRatio:Et=1,sdf:It=!1,stretchX:Vt,stretchY:ke,content:Oe,textFitWidth:Ke,textFitHeight:gr}=ht;if(this._lazyInitEmptyStyle(),!(I instanceof HTMLImageElement||e.b(I))){if(I.width===void 0||I.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:Or,height:Dr,data:ln}=I,Sn=I;return this.style.addImage(qt,{data:new e.R({width:Or,height:Dr},new Uint8Array(ln)),pixelRatio:Et,stretchX:Vt,stretchY:ke,content:Oe,textFitWidth:Ke,textFitHeight:gr,sdf:It,version:0,userImage:Sn}),Sn.onAdd&&Sn.onAdd(this,qt),this}}{let{width:Or,height:Dr,data:ln}=o.getImageData(I);this.style.addImage(qt,{data:new e.R({width:Or,height:Dr},ln),pixelRatio:Et,stretchX:Vt,stretchY:ke,content:Oe,textFitWidth:Ke,textFitHeight:gr,sdf:It,version:0})}}updateImage(qt,I){let ht=this.style.getImage(qt);if(!ht)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 Et=I instanceof HTMLImageElement||e.b(I)?o.getImageData(I):I,{width:It,height:Vt,data:ke}=Et;if(It===void 0||Vt===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(It!==ht.data.width||Vt!==ht.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 Oe=!(I instanceof HTMLImageElement||e.b(I));return ht.data.replace(ke,Oe),this.style.updateImage(qt,ht),this}getImage(qt){return this.style.getImage(qt)}hasImage(qt){return qt?!!this.style.getImage(qt):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(qt){this.style.removeImage(qt)}loadImage(qt){return u.getImage(this._requestManager.transformRequest(qt,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(qt,I){return this._lazyInitEmptyStyle(),this.style.addLayer(qt,I),this._update(!0)}moveLayer(qt,I){return this.style.moveLayer(qt,I),this._update(!0)}removeLayer(qt){return this.style.removeLayer(qt),this._update(!0)}getLayer(qt){return this.style.getLayer(qt)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(qt,I,ht){return this.style.setLayerZoomRange(qt,I,ht),this._update(!0)}setFilter(qt,I,ht={}){return this.style.setFilter(qt,I,ht),this._update(!0)}getFilter(qt){return this.style.getFilter(qt)}setPaintProperty(qt,I,ht,Et={}){return this.style.setPaintProperty(qt,I,ht,Et),this._update(!0)}getPaintProperty(qt,I){return this.style.getPaintProperty(qt,I)}setLayoutProperty(qt,I,ht,Et={}){return this.style.setLayoutProperty(qt,I,ht,Et),this._update(!0)}getLayoutProperty(qt,I){return this.style.getLayoutProperty(qt,I)}setGlyphs(qt,I={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(qt,I),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(qt,I,ht={}){return this._lazyInitEmptyStyle(),this.style.addSprite(qt,I,ht,Et=>{Et||this._update(!0)}),this}removeSprite(qt){return this._lazyInitEmptyStyle(),this.style.removeSprite(qt),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(qt,I={}){return this._lazyInitEmptyStyle(),this.style.setSprite(qt,I,ht=>{ht||this._update(!0)}),this}setLight(qt,I={}){return this._lazyInitEmptyStyle(),this.style.setLight(qt,I),this._update(!0)}getLight(){return this.style.getLight()}setSky(qt){return this._lazyInitEmptyStyle(),this.style.setSky(qt),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(qt,I){return this.style.setFeatureState(qt,I),this._update()}removeFeatureState(qt,I){return this.style.removeFeatureState(qt,I),this._update()}getFeatureState(qt){return this.style.getFeatureState(qt)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let qt=0,I=0;return this._container&&(qt=this._container.clientWidth||400,I=this._container.clientHeight||300),[qt,I]}_setupContainer(){let qt=this._container;qt.classList.add("maplibregl-map");let I=this._canvasContainer=i.create("div","maplibregl-canvas-container",qt);this._interactive&&I.classList.add("maplibregl-interactive"),this._canvas=i.create("canvas","maplibregl-canvas",I),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 ht=this._containerDimensions(),Et=this._getClampedPixelRatio(ht[0],ht[1]);this._resizeCanvas(ht[0],ht[1],Et);let It=this._controlContainer=i.create("div","maplibregl-control-container",qt),Vt=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ke=>{Vt[ke]=i.create("div",`maplibregl-ctrl-${ke} `,It)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(qt,I,ht){this._canvas.width=Math.floor(ht*qt),this._canvas.height=Math.floor(ht*I),this._canvas.style.width=`${qt}px`,this._canvas.style.height=`${I}px`}_setupPainter(){let qt={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},I=null;this._canvas.addEventListener("webglcontextcreationerror",Et=>{I={requestedAttributes:qt},Et&&(I.statusMessage=Et.statusMessage,I.type=Et.type)},{once:!0});let ht=this._canvas.getContext("webgl2",qt)||this._canvas.getContext("webgl",qt);if(!ht){let Et="Failed to initialize WebGL";throw I?(I.message=Et,new Error(JSON.stringify(I))):new Error(Et)}this.painter=new Hh(ht,this.transform),s.testSupport(ht)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(qt){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||qt,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(qt){return this._update(),this._renderTaskQueue.add(qt)}_cancelRenderFrame(qt){this._renderTaskQueue.remove(qt)}_render(qt){let I=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(qt),this._removed)return;let ht=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let It=this.transform.zoom,Vt=o.now();this.style.zoomHistory.update(It,Vt);let ke=new e.z(It,{now:Vt,fadeDuration:I,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Oe=ke.crossFadingFactor();Oe===1&&Oe===this._crossFadingFactor||(ht=!0,this._crossFadingFactor=Oe),this.style.update(ke)}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,I,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:I,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()||ht)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let Et=this._sourcesDirty||this._styleDirty||this._placementDirty;return Et||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||Et||(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 qt;this._hash&&this._hash.remove();for(let ht of this._controls)ht.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),u.removeThrottleControl(this._imageQueueHandle),(qt=this._resizeObserver)===null||qt===void 0||qt.disconnect();let I=this.painter.context.gl.getExtension("WEBGL_lose_context");I!=null&&I.loseContext&&I.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),i.remove(this._canvasContainer),i.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(qt=>{e.bf.frame(qt),this._frameRequest=null,this._render(qt)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(qt){this._showTileBoundaries!==qt&&(this._showTileBoundaries=qt,this._update())}get showPadding(){return!!this._showPadding}set showPadding(qt){this._showPadding!==qt&&(this._showPadding=qt,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(qt){this._showCollisionBoxes!==qt&&(this._showCollisionBoxes=qt,qt?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(qt){this._showOverdrawInspector!==qt&&(this._showOverdrawInspector=qt,this._update())}get repaint(){return!!this._repaint}set repaint(qt){this._repaint!==qt&&(this._repaint=qt,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(qt){this._vertices=qt,this._update()}get version(){return qu}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Qc,t.MapTouchEvent=ff,t.MapWheelEvent=Pf,t.Marker=Pc,t.NavigationControl=class{constructor(qt){this._updateZoomButtons=()=>{let I=this._map.getZoom(),ht=I===this._map.getMaxZoom(),Et=I===this._map.getMinZoom();this._zoomInButton.disabled=ht,this._zoomOutButton.disabled=Et,this._zoomInButton.setAttribute("aria-disabled",ht.toString()),this._zoomOutButton.setAttribute("aria-disabled",Et.toString())},this._rotateCompassArrow=()=>{let I=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=I},this._setButtonTitle=(I,ht)=>{let Et=this._map._getUIString(`NavigationControl.${ht}`);I.title=Et,I.setAttribute("aria-label",Et)},this.options=e.e({},zo,qt),this._container=i.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",I=>I.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",I=>this._map.zoomIn({},{originalEvent:I})),i.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",I=>this._map.zoomOut({},{originalEvent:I})),i.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",I=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:I}):this._map.resetNorth({},{originalEvent:I})}),this._compassIcon=i.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(qt){return this._map=qt,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 Ms(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){i.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(qt,I){let ht=i.create("button",qt,this._container);return ht.type="button",ht.addEventListener("click",I),ht}},t.Popup=class extends e.E{constructor(qt){super(),this.remove=()=>(this._content&&i.remove(this._content),this._container&&(i.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=I=>{this._update(I.point)},this._onMouseMove=I=>{this._update(I.point)},this._onDrag=I=>{this._update(I.point)},this._update=I=>{var ht;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=i.create("div","maplibregl-popup",this._map.getContainer()),this._tip=i.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let Oe of this.options.className.split(" "))this._container.classList.add(Oe);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?Fl(this._lngLat,this._flatPos,this._map.transform):(ht=this._lngLat)===null||ht===void 0?void 0:ht.wrap(),this._trackPointer&&!I)return;let Et=this._flatPos=this._pos=this._trackPointer&&I?I:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&I?I:this._map.transform.locationPoint(this._lngLat));let It=this.options.anchor,Vt=Zu(this.options.offset);if(!It){let Oe=this._container.offsetWidth,Ke=this._container.offsetHeight,gr;gr=Et.y+Vt.bottom.y<Ke?["top"]:Et.y>this._map.transform.height-Ke?["bottom"]:[],Et.x<Oe/2?gr.push("left"):Et.x>this._map.transform.width-Oe/2&&gr.push("right"),It=gr.length===0?"bottom":gr.join("-")}let ke=Et.add(Vt[It]);this.options.subpixelPositioning||(ke=ke.round()),i.setTransform(this._container,`${vc[It]} translate(${ke.x}px,${ke.y}px)`),Hc(this._container,It,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(zs),qt)}addTo(qt){return this._map&&this.remove(),this._map=qt,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(qt){return this._lngLat=e.N.convert(qt),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(qt){return this.setDOMContent(document.createTextNode(qt))}setHTML(qt){let I=document.createDocumentFragment(),ht=document.createElement("body"),Et;for(ht.innerHTML=qt;Et=ht.firstChild,Et;)I.appendChild(Et);return this.setDOMContent(I)}getMaxWidth(){var qt;return(qt=this._container)===null||qt===void 0?void 0:qt.style.maxWidth}setMaxWidth(qt){return this.options.maxWidth=qt,this._update(),this}setDOMContent(qt){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=i.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(qt),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(qt){return this._container&&this._container.classList.add(qt),this}removeClassName(qt){return this._container&&this._container.classList.remove(qt),this}setOffset(qt){return this.options.offset=qt,this._update(),this}toggleClassName(qt){if(this._container)return this._container.classList.toggle(qt)}setSubpixelPositioning(qt){this.options.subpixelPositioning=qt}_createCloseButton(){this.options.closeButton&&(this._closeButton=i.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 qt=this._container.querySelector(qc);qt&&qt.focus()}},t.RasterDEMTileSource=Wt,t.RasterTileSource=Pt,t.ScaleControl=class{constructor(qt){this._onMove=()=>{Ih(this._map,this._container,this.options)},this.setUnit=I=>{this.options.unit=I,Ih(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Iu),qt)}getDefaultPosition(){return"bottom-left"}onAdd(qt){return this._map=qt,this._container=i.create("div","maplibregl-ctrl maplibregl-ctrl-scale",qt.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=Wn,t.Style=Gr,t.TerrainControl=class{constructor(qt){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=qt}onAdd(qt){return this._map=qt,this._container=i.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=i.create("button","maplibregl-ctrl-terrain",this._container),i.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(){i.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=qf,t.TwoFingersTouchRotateHandler=df,t.TwoFingersTouchZoomHandler=eu,t.TwoFingersTouchZoomRotateHandler=ua,t.VectorTileSource=zt,t.VideoSource=he,t.addSourceType=(qt,I)=>e._(void 0,void 0,void 0,function*(){if(Tt(qt))throw new Error(`A source type called "${qt}" already exists.`);((ht,Et)=>{se[ht]=Et})(qt,I)}),t.clearPrewarmedResources=function(){let qt=st;qt&&(qt.isPreloaded()&&qt.numActive()===1?(qt.release(lt),st=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 ve().getRTLTextPluginStatus()},t.getVersion=function(){return Zf},t.getWorkerCount=function(){return yt.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(qt){return at().broadcast("IS",qt)},t.prewarm=function(){dt().acquire(lt)},t.setMaxParallelImageRequests=function(qt){e.a.MAX_PARALLEL_IMAGE_REQUESTS=qt},t.setRTLTextPlugin=function(qt,I){return ve().setRTLTextPlugin(qt,I)},t.setWorkerCount=function(qt){yt.workerCount=qt},t.setWorkerUrl=function(qt){e.a.WORKER_URL=qt}});var S=c;return S})}),CW=Ft((Q,$)=>{var c=bn(),g=tc().sanitizeHTML,P=vE(),S=Z1();function t(o,i){this.subplot=o,this.uid=o.uid+"-"+i,this.index=i,this.idSource="source-"+this.uid,this.idLayer=S.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 i=this.subplot.map;return i.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 i=this.subplot.map;i.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 i=this.subplot.map;if(i.getSource(this.idSource)&&i.removeSource(this.idSource),this.sourceType=o.sourcetype,this.source=o.source,!!r(o)){var s=n(o);i.addSource(this.idSource,s)}},e.findFollowingMapLayerId=function(o){if(o==="traces")for(var i=this.subplot.getMapLayers(),s=0;s<i.length;s++){var f=i[s].id;if(typeof f=="string"&&f.indexOf(S.traceLayerPrefix)===0){o=f;break}}return o},e.updateLayer=function(o){var i=this.subplot,s=a(o),f=this.lookupBelow(),x=this.findFollowingMapLayerId(f);this.removeLayer(),r(o)&&i.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},x),this.layerType=o.type,this.below=f},e.updateStyle=function(o){if(r(o)){var i=a(o);this.subplot.setOptions(this.idLayer,"setLayoutProperty",i.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",i.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 i=o.source;if(Array.isArray(i)&&i.length>0){for(var s=0;s<i.length;s++)if(typeof i[s]!="string"||i[s].length===0)return!1;return!0}return c.isPlainObject(i)||typeof i=="string"&&i.length>0}function a(o){var i={},s={};switch(o.type){case"circle":c.extendFlat(s,{"circle-radius":o.circle.radius,"circle-color":o.color,"circle-opacity":o.opacity});break;case"line":c.extendFlat(s,{"line-width":o.line.width,"line-color":o.color,"line-opacity":o.opacity,"line-dasharray":o.line.dash});break;case"fill":c.extendFlat(s,{"fill-color":o.color,"fill-outline-color":o.fill.outlinecolor,"fill-opacity":o.opacity});break;case"symbol":var f=o.symbol,x=P(f.textposition,f.iconsize);c.extendFlat(i,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":x.anchor,"text-offset":x.offset,"symbol-placement":f.placement}),c.extendFlat(s,{"icon-color":o.color,"text-color":f.textfont.color,"text-opacity":o.opacity});break;case"raster":c.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":o.opacity});break}return{layout:i,paint:s}}function n(o){var i=o.sourcetype,s=o.source,f={type:i},x;return i==="geojson"?x="data":i==="vector"?x=typeof s=="string"?"url":"tiles":i==="raster"?(x="tiles",f.tileSize=256):i==="image"&&(x="url",f.coordinates=o.coordinates),f[x]=s,o.sourceattribution&&(f.attribution=g(o.sourceattribution)),f}$.exports=function(o,i,s){var f=new t(o,i);return f.update(s),f}}),LW=Ft((Q,$)=>{var c=EW(),g=bn(),P=V1(),S=Xo(),t=Es(),e=up(),r=Qh(),a=v0(),n=a.drawMode,o=a.selectMode,i=vf().prepSelect,s=vf().clearOutline,f=vf().clearSelectionsCache,x=vf().selectOnClick,y=Z1(),v=CW();function T(E,A){this.id=A,this.gd=E;var h=E._fullLayout,p=E._context;this.container=h._glcontainer.node(),this.isStatic=p.staticPlot,this.uid=h._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(h),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var u=T.prototype;u.plot=function(E,A,h){var p=this,k;p.map?k=new Promise(function(w,R){p.updateMap(E,A,w,R)}):k=new Promise(function(w,R){p.createMap(E,A,w,R)}),h.push(k)},u.createMap=function(E,A,h,p){var k=this,w=A[k.id],R=k.styleObj=_(w.style),O=w.bounds,N=O?[[O.west,O.south],[O.east,O.north]]:null,V=k.map=new c.Map({container:k.div,style:R.style,center:M(w.center),zoom:w.zoom,bearing:w.bearing,pitch:w.pitch,maxBounds:N,interactive:!k.isStatic,preserveDrawingBuffer:k.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new c.AttributionControl({compact:!0})),H={};V.on("styleimagemissing",function(U){var W=U.id;if(!H[W]&&W.includes("-15")){H[W]=!0;var q=new Image(15,15);q.onload=function(){V.addImage(W,q)},q.crossOrigin="Anonymous",q.src="https://unpkg.com/maki@2.1.0/icons/"+W+".svg"}}),V.setTransformRequest(function(U){return U=U.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),U=U.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),U=U.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:U}}),V._canvas.style.left="0px",V._canvas.style.top="0px",k.rejectOnError(p),k.isStatic||k.initFx(E,A);var F=[];F.push(new Promise(function(U){V.once("load",U)})),F=F.concat(P.fetchTraceGeoData(E)),Promise.all(F).then(function(){k.fillBelowLookup(E,A),k.updateData(E),k.updateLayout(A),k.resolveOnRender(h)}).catch(p)},u.updateMap=function(E,A,h,p){var k=this,w=k.map,R=A[this.id];k.rejectOnError(p);var O=[],N=_(R.style);JSON.stringify(k.styleObj)!==JSON.stringify(N)&&(k.styleObj=N,w.setStyle(N.style),k.traceHash={},O.push(new Promise(function(V){w.once("styledata",V)}))),O=O.concat(P.fetchTraceGeoData(E)),Promise.all(O).then(function(){k.fillBelowLookup(E,A),k.updateData(E),k.updateLayout(A),k.resolveOnRender(h)}).catch(p)},u.fillBelowLookup=function(E,A){var h=A[this.id],p=h.layers,k,w,R=this.belowLookup={},O=!1;for(k=0;k<E.length;k++){var N=E[k][0].trace,V=N._module;typeof N.below=="string"?w=N.below:V.getBelow&&(w=V.getBelow(N,this)),w===""&&(O=!0),R["trace-"+N.uid]=w||""}for(k=0;k<p.length;k++){var H=p[k];typeof H.below=="string"?w=H.below:O?w="traces":w="",R["layout-"+k]=w}var F={},U,W;for(U in R)w=R[U],F[w]?F[w].push(U):F[w]=[U];for(w in F){var q=F[w];if(q.length>1)for(k=0;k<q.length;k++)U=q[k],U.indexOf("trace-")===0?(W=U.split("trace-")[1],this.traceHash[W]&&(this.traceHash[W].below=null)):U.indexOf("layout-")===0&&(W=U.split("layout-")[1],this.layerList[W]&&(this.layerList[W].below=null))}};var b={choroplethmap:0,densitymap:1,scattermap:2};u.updateData=function(E){var A=this.traceHash,h,p,k,w,R=E.slice().sort(function(F,U){return b[F[0].trace.type]-b[U[0].trace.type]});for(k=0;k<R.length;k++){var O=R[k];p=O[0].trace,h=A[p.uid];var N=!1;h&&(h.type===p.type?(h.update(O),N=!0):h.dispose()),!N&&p._module&&(A[p.uid]=p._module.plot(this,O))}var V=Object.keys(A);t:for(k=0;k<V.length;k++){var H=V[k];for(w=0;w<E.length;w++)if(p=E[w][0].trace,H===p.uid)continue t;h=A[H],h.dispose(),delete A[H]}},u.updateLayout=function(E){var A=this.map,h=E[this.id];!this.dragging&&!this.wheeling&&(A.setCenter(M(h.center)),A.setZoom(h.zoom),A.setBearing(h.bearing),A.setPitch(h.pitch)),this.updateLayers(E),this.updateFramework(E),this.updateFx(E),this.map.resize(),this.gd._context._scrollZoom.map?A.scrollZoom.enable():A.scrollZoom.disable()},u.resolveOnRender=function(E){var A=this.map;A.on("render",function h(){A.loaded()&&(A.off("render",h),setTimeout(E,10))})},u.rejectOnError=function(E){var A=this.map;function h(){E(new Error(y.mapOnErrorMsg))}A.once("error",h),A.once("style.error",h),A.once("source.error",h),A.once("tile.error",h),A.once("layer.error",h)},u.createFramework=function(E){var A=this,h=A.div=document.createElement("div");h.id=A.uid,h.style.position="absolute",A.container.appendChild(h),A.xaxis={_id:"x",c2p:function(p){return A.project(p).x}},A.yaxis={_id:"y",c2p:function(p){return A.project(p).y}},A.updateFramework(E),A.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},t.setConvert(A.mockAxis,E)},u.initFx=function(E,A){var h=this,p=h.gd,k=h.map;k.on("moveend",function(O){if(h.map){var N=p._fullLayout;if(O.originalEvent||h.wheeling){var V=N[h.id];S.call("_storeDirectGUIEdit",p.layout,N._preGUI,h.getViewEdits(V));var H=h.getView();V._input.center=V.center=H.center,V._input.zoom=V.zoom=H.zoom,V._input.bearing=V.bearing=H.bearing,V._input.pitch=V.pitch=H.pitch,p.emit("plotly_relayout",h.getViewEditsWithDerived(H))}O.originalEvent&&O.originalEvent.type==="mouseup"?h.dragging=!1:h.wheeling&&(h.wheeling=!1),N&&N._rehover&&N._rehover()}}),k.on("wheel",function(){h.wheeling=!0}),k.on("mousemove",function(O){var N=h.div.getBoundingClientRect(),V=[O.originalEvent.offsetX,O.originalEvent.offsetY];O.target.getBoundingClientRect=function(){return N},h.xaxis.p2c=function(){return k.unproject(V).lng},h.yaxis.p2c=function(){return k.unproject(V).lat},p._fullLayout._rehover=function(){p._fullLayout._hoversubplot===h.id&&p._fullLayout[h.id]&&r.hover(p,O,h.id)},r.hover(p,O,h.id),p._fullLayout._hoversubplot=h.id});function w(){r.loneUnhover(A._hoverlayer)}k.on("dragstart",function(){h.dragging=!0,w()}),k.on("zoomstart",w),k.on("mouseout",function(){p._fullLayout._hoversubplot=null});function R(){var O=h.getView();p.emit("plotly_relayouting",h.getViewEditsWithDerived(O))}k.on("drag",R),k.on("zoom",R),k.on("dblclick",function(){var O=p._fullLayout[h.id];S.call("_storeDirectGUIEdit",p.layout,p._fullLayout._preGUI,h.getViewEdits(O));var N=h.viewInitial;k.setCenter(M(N.center)),k.setZoom(N.zoom),k.setBearing(N.bearing),k.setPitch(N.pitch);var V=h.getView();O._input.center=O.center=V.center,O._input.zoom=O.zoom=V.zoom,O._input.bearing=O.bearing=V.bearing,O._input.pitch=O.pitch=V.pitch,p.emit("plotly_doubleclick",null),p.emit("plotly_relayout",h.getViewEditsWithDerived(V))}),h.clearOutline=function(){f(h.dragOptions),s(h.dragOptions.gd)},h.onClickInPanFn=function(O){return function(N){var V=p._fullLayout.clickmode;V.indexOf("select")>-1&&x(N.originalEvent,p,[h.xaxis],[h.yaxis],h.id,O),V.indexOf("event")>-1&&r.click(p,N.originalEvent)}}},u.updateFx=function(E){var A=this,h=A.map,p=A.gd;if(A.isStatic)return;function k(N){var V=A.map.unproject(N);return[V.lng,V.lat]}var w=E.dragmode,R;R=function(N,V){if(V.isRect){var H=N.range={};H[A.id]=[k([V.xmin,V.ymin]),k([V.xmax,V.ymax])]}else{var F=N.lassoPoints={};F[A.id]=V.map(k)}};var O=A.dragOptions;A.dragOptions=g.extendDeep(O||{},{dragmode:E.dragmode,element:A.div,gd:p,plotinfo:{id:A.id,domain:E[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis,fillRangeItems:R},xaxes:[A.xaxis],yaxes:[A.yaxis],subplot:A.id}),h.off("click",A.onClickInPanHandler),o(w)||n(w)?(h.dragPan.disable(),h.on("zoomstart",A.clearOutline),A.dragOptions.prepFn=function(N,V,H){i(N,V,H,A.dragOptions,w)},e.init(A.dragOptions)):(h.dragPan.enable(),h.off("zoomstart",A.clearOutline),A.div.onmousedown=null,A.div.ontouchstart=null,A.div.removeEventListener("touchstart",A.div._ontouchstart),A.onClickInPanHandler=A.onClickInPanFn(A.dragOptions),h.on("click",A.onClickInPanHandler))},u.updateFramework=function(E){var A=E[this.id].domain,h=E._size,p=this.div.style;p.width=h.w*(A.x[1]-A.x[0])+"px",p.height=h.h*(A.y[1]-A.y[0])+"px",p.left=h.l+A.x[0]*h.w+"px",p.top=h.t+(1-A.y[1])*h.h+"px",this.xaxis._offset=h.l+A.x[0]*h.w,this.xaxis._length=h.w*(A.x[1]-A.x[0]),this.yaxis._offset=h.t+(1-A.y[1])*h.h,this.yaxis._length=h.h*(A.y[1]-A.y[0])},u.updateLayers=function(E){var A=E[this.id],h=A.layers,p=this.layerList,k;if(h.length!==p.length){for(k=0;k<p.length;k++)p[k].dispose();for(p=this.layerList=[],k=0;k<h.length;k++)p.push(v(this,k,h[k]))}else for(k=0;k<h.length;k++)p[k].update(h[k])},u.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},u.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},u.setOptions=function(E,A,h){for(var p in h)this.map[A](E,p,h[p])},u.getMapLayers=function(){return this.map.getStyle().layers},u.addLayer=function(E,A){var h=this.map;if(typeof A=="string"){if(A===""){h.addLayer(E,A);return}for(var p=this.getMapLayers(),k=0;k<p.length;k++)if(A===p[k].id){h.addLayer(E,A);return}g.warn(["Trying to add layer with *below* value",A,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}h.addLayer(E)},u.project=function(E){return this.map.project(new c.LngLat(E[0],E[1]))},u.getView=function(){var E=this.map,A=E.getCenter(),h=A.lng,p=A.lat,k={lon:h,lat:p},w=E.getCanvas(),R=parseInt(w.style.width),O=parseInt(w.style.height);return{center:k,zoom:E.getZoom(),bearing:E.getBearing(),pitch:E.getPitch(),_derived:{coordinates:[E.unproject([0,0]).toArray(),E.unproject([R,0]).toArray(),E.unproject([R,O]).toArray(),E.unproject([0,O]).toArray()]}}},u.getViewEdits=function(E){for(var A=this.id,h=["center","zoom","bearing","pitch"],p={},k=0;k<h.length;k++){var w=h[k];p[A+"."+w]=E[w]}return p},u.getViewEditsWithDerived=function(E){var A=this.id,h=this.getViewEdits(E);return h[A+"._derived"]=E._derived,h};function _(E){var A={};return g.isPlainObject(E)?(A.id=E.id,A.style=E):typeof E=="string"?(A.id=E,y.stylesMap[E]?A.style=y.stylesMap[E]:A.style=E):(A.id=y.styleValueDflt,A.style=C(y.styleValueDflt)),A.transition={duration:0,delay:0},A}function C(E){return y.styleUrlPrefix+E+"-"+y.styleUrlSuffix}function M(E){return[E.lon,E.lat]}$.exports=T}),PW=Ft((Q,$)=>{var c=bn(),g=P1(),P=Md(),S=S3();$.exports=function(r,a,n){g(r,a,n,{type:"map",attributes:S,handleDefaults:t,partition:"y"})};function t(r,a,n){n("style"),n("center.lon"),n("center.lat"),n("zoom"),n("bearing"),n("pitch");var o=n("bounds.west"),i=n("bounds.east"),s=n("bounds.south"),f=n("bounds.north");(o===void 0||i===void 0||s===void 0||f===void 0)&&delete a.bounds,P(r,a,{name:"layers",handleItemDefaults:e}),a._input=r}function e(r,a){function n(y,v){return c.coerce(r,a,S.layers,y,v)}var o=n("visible");if(o){var i=n("sourcetype"),s=i==="raster"||i==="image";n("source"),n("sourceattribution"),i==="vector"&&n("sourcelayer"),i==="image"&&n("coordinates");var f;s&&(f="raster");var x=n("type",f);s&&x!=="raster"&&(x=a.type="raster",c.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),x==="circle"&&n("circle.radius"),x==="line"&&(n("line.width"),n("line.dash")),x==="fill"&&n("fill.outlinecolor"),x==="symbol"&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),c.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}}),yT=Ft(Q=>{var $=bn(),c=$.strTranslate,g=$.strScale,P=ud().getSubplotCalcData,S=Op(),t=un(),e=js(),r=tc(),a=LW(),n="map";Q.name=n,Q.attr="subplot",Q.idRoot=n,Q.idRegex=Q.attrRegex=$.counterRegex(n),Q.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},Q.layoutAttributes=S3(),Q.supplyLayoutDefaults=PW(),Q.plot=function(o){for(var i=o._fullLayout,s=o.calcdata,f=i._subplots[n],x=0;x<f.length;x++){var y=f[x],v=P(s,n,y),T=i[y],u=T._subplot;u||(u=new a(o,y),i[y]._subplot=u),u.viewInitial||(u.viewInitial={center:$.extendFlat({},T.center),zoom:T.zoom,bearing:T.bearing,pitch:T.pitch}),u.plot(v,i,o._promises)}},Q.clean=function(o,i,s,f){for(var x=f._subplots[n]||[],y=0;y<x.length;y++){var v=x[y];!i[v]&&f[v]._subplot&&f[v]._subplot.destroy()}},Q.toSVG=function(o){for(var i=o._fullLayout,s=i._subplots[n],f=i._size,x=0;x<s.length;x++){var y=i[s[x]],v=y.domain,T=y._subplot,u=T.toImage("png"),b=i._glimages.append("svg:image");b.attr({xmlns:S.svg,"xlink:href":u,x:f.l+f.w*v.x[0],y:f.t+f.h*(1-v.y[1]),width:f.w*(v.x[1]-v.x[0]),height:f.h*(v.y[1]-v.y[0]),preserveAspectRatio:"none"});var _=t.select(y._subplot.div),C=_.select(".maplibregl-ctrl-attrib").text().replace("Improve this map",""),M=i._glimages.append("g"),E=M.append("text");E.text(C).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":C});var A=e.bBox(E.node()),h=f.w*(v.x[1]-v.x[0]);if(A.width>h/2){var p=C.split("|").join("<br>");E.text(p).attr("data-unformatted",p).call(r.convertToTspans,o),A=e.bBox(E.node())}E.attr("transform",c(-3,-A.height+8)),M.insert("rect",".static-attribution").attr({x:-A.width-6,y:-A.height-3,width:A.width+6,height:A.height+3,fill:"rgba(255, 255, 255, 0.75)"});var k=1;A.width+6>h&&(k=h/(A.width+6));var w=[f.l+f.w*v.x[1],f.t+f.h*(1-v.y[0])];M.attr("transform",c(w[0],w[1])+g(k))}},Q.updateFx=function(o){for(var i=o._fullLayout,s=i._subplots[n],f=0;f<s.length;f++){var x=i[s[f]]._subplot;x.updateFx(i)}}}),zW=Ft((Q,$)=>{$.exports={attributes:gT(),supplyDefaults:kW(),colorbar:xo(),formatLabels:gE(),calc:$k(),plot:AW(),hoverPoints:vT().hoverPoints,eventData:MW(),selectPoints:SW(),styleOnSelect:function(c,g){if(g){var P=g[0].trace;P._glTrace.update(g)}},moduleType:"trace",name:"scattermap",basePlotModule:yT(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}),IW=Ft((Q,$)=>{$.exports=zW()}),yE=Ft((Q,$)=>{var c=fb(),g=Tc(),{hovertemplateAttrs:P,templatefallbackAttrs:S}=$u(),t=$o(),e=Ta().extendFlat;$.exports=e({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:e({},c.featureidkey,{}),below:{valType:"string",editType:"plot"},text:c.text,hovertext:c.hovertext,marker:{line:{color:e({},c.marker.line.color,{editType:"plot"}),width:e({},c.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:e({},c.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:e({},c.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:e({},c.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:c.hoverinfo,hovertemplate:P({},{keys:["properties"]}),hovertemplatefallback:S(),showlegend:e({},t.showlegend,{dflt:!1})},g("",{cLetter:"z",editTypeOverride:"calc"}))}),OW=Ft((Q,$)=>{var c=bn(),g=mc(),P=yE();$.exports=function(S,t,e,r){function a(f,x){return c.coerce(S,t,P,f,x)}var n=a("locations"),o=a("z"),i=a("geojson");if(!c.isArrayOrTypedArray(n)||!n.length||!c.isArrayOrTypedArray(o)||!o.length||!(typeof i=="string"&&i!==""||c.isPlainObject(i))){t.visible=!1;return}a("featureidkey"),t._length=Math.min(n.length,o.length),a("below"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback");var s=a("marker.line.width");s&&a("marker.line.color"),a("marker.opacity"),g(S,t,r,a,{prefix:"",cLetter:"z"}),c.coerceSelectionMarkerOpacity(t,a)}}),xE=Ft((Q,$)=>{var c=ra(),g=bn(),P=Xc(),S=js(),t=U1().makeBlank,e=V1();function r(n){var o=n[0].trace,i=o.visible===!0&&o._length!==0,s={layout:{visibility:"none"},paint:{}},f={layout:{visibility:"none"},paint:{}},x=o._opts={fill:s,line:f,geojson:t()};if(!i)return x;var y=e.extractTraceFeature(n);if(!y)return x;var v=P.makeColorScaleFuncFromTrace(o),T=o.marker,u=T.line||{},b;g.isArrayOrTypedArray(T.opacity)&&(b=function(k){var w=k.mo;return c(w)?+g.constrain(w,0,1):0});var _;g.isArrayOrTypedArray(u.color)&&(_=function(k){return k.mlc});var C;g.isArrayOrTypedArray(u.width)&&(C=function(k){return k.mlw});for(var M=0;M<n.length;M++){var E=n[M],A=E.fOut;if(A){var h=A.properties;h.fc=v(E.z),b&&(h.mo=b(E)),_&&(h.mlc=_(E)),C&&(h.mlw=C(E)),E.ct=h.ct,E._polygons=e.feature2polygons(A)}}var p=b?{type:"identity",property:"mo"}:T.opacity;return g.extendFlat(s.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":p}),g.extendFlat(f.paint,{"line-color":_?{type:"identity",property:"mlc"}:u.color,"line-width":C?{type:"identity",property:"mlw"}:u.width,"line-opacity":p}),s.layout.visibility="visible",f.layout.visibility="visible",x.geojson={type:"FeatureCollection",features:y},a(n),x}function a(n){var o=n[0].trace,i=o._opts,s;if(o.selectedpoints){for(var f=S.makeSelectedPointStyleFns(o),x=0;x<n.length;x++){var y=n[x];y.fOut&&(y.fOut.properties.mo2=f.selectedOpacityFn(y))}s={type:"identity",property:"mo2"}}else s=g.isArrayOrTypedArray(o.marker.opacity)?{type:"identity",property:"mo"}:o.marker.opacity;return g.extendFlat(i.fill.paint,{"fill-opacity":s}),g.extendFlat(i.line.paint,{"line-opacity":s}),i}$.exports={convert:r,convertOnSelect:a}}),DW=Ft((Q,$)=>{var c=xE().convert,g=xE().convertOnSelect,P=Z1().traceLayerPrefix;function S(e,r){this.type="choroplethmap",this.subplot=e,this.uid=r,this.sourceId="source-"+r,this.layerList=[["fill",P+r+"-fill"],["line",P+r+"-line"]],this.below=null}var t=S.prototype;t.update=function(e){this._update(c(e)),e[0].trace._glTrace=this},t.updateOnSelect=function(e){this._update(g(e))},t._update=function(e){var r=this.subplot,a=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<a.length;o++){var i=a[o],s=i[0],f=i[1],x=e[s];r.setOptions(f,"setLayoutProperty",x.layout),x.layout.visibility==="visible"&&r.setOptions(f,"setPaintProperty",x.paint)}},t._addLayers=function(e,r){for(var a=this.subplot,n=this.layerList,o=this.sourceId,i=0;i<n.length;i++){var s=n[i],f=s[0],x=e[f];a.addLayer({type:f,id:s[1],source:o,layout:x.layout,paint:x.paint},r)}},t._removeLayers=function(){for(var e=this.subplot.map,r=this.layerList,a=r.length-1;a>=0;a--)e.removeLayer(r[a][1])},t.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},$.exports=function(e,r){var a=r[0].trace,n=new S(e,a.uid),o=n.sourceId,i=c(r),s=n.below=e.belowLookup["trace-"+a.uid];return e.map.addSource(o,{type:"geojson",data:i.geojson}),n._addLayers(i,s),r[0].trace._glTrace=n,n}}),FW=Ft((Q,$)=>{$.exports={attributes:yE(),supplyDefaults:OW(),colorbar:L1(),calc:Xk(),plot:DW(),hoverPoints:Qk(),eventData:tT(),selectPoints:eT(),styleOnSelect:function(c,g){if(g){var P=g[0].trace;P._glTrace.updateOnSelect(g)}},getBelow:function(c,g){for(var P=g.getMapLayers(),S=P.length-2;S>=0;S--){var t=P[S].id;if(typeof t=="string"&&t.indexOf("water")===0){for(var e=S+1;e<P.length;e++)if(t=P[e].id,typeof t=="string"&&t.indexOf("plotly-")===-1)return t}}},moduleType:"trace",name:"choroplethmap",basePlotModule:yT(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}}),RW=Ft((Q,$)=>{$.exports=FW()}),_E=Ft((Q,$)=>{var c=Tc(),{hovertemplateAttrs:g,templatefallbackAttrs:P}=$u(),S=$o(),t=gT(),e=Ta().extendFlat;$.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({},S.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:g(),hovertemplatefallback:P(),showlegend:e({},S.showlegend,{dflt:!1})},c("",{cLetter:"z",editTypeOverride:"calc"}))}),BW=Ft((Q,$)=>{var c=bn(),g=mc(),P=_E();$.exports=function(S,t,e,r){function a(s,f){return c.coerce(S,t,P,s,f)}var n=a("lon")||[],o=a("lat")||[],i=Math.min(n.length,o.length);if(!i){t.visible=!1;return}t._length=i,a("z"),a("radius"),a("below"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),g(S,t,r,a,{prefix:"",cLetter:"z"})}}),NW=Ft((Q,$)=>{var c=ra(),g=bn().isArrayOrTypedArray,P=Da().BADNUM,S=Jd(),t=bn()._;$.exports=function(e,r){for(var a=r._length,n=new Array(a),o=r.z,i=g(o)&&o.length,s=0;s<a;s++){var f=n[s]={},x=r.lon[s],y=r.lat[s];if(f.lonlat=c(x)&&c(y)?[+x,+y]:[P,P],i){var v=o[s];f.z=c(v)?v:P}}return S(e,r,{vals:i?o:[0,1],containerStr:"",cLetter:"z"}),a&&(n[0].t={labels:{lat:t(e,"lat:")+" ",lon:t(e,"lon:")+" "}}),n}}),jW=Ft((Q,$)=>{var c=ra(),g=bn(),P=li(),S=Xc(),t=Da().BADNUM,e=U1().makeBlank;$.exports=function(r){var a=r[0].trace,n=a.visible===!0&&a._length!==0,o={layout:{visibility:"none"},paint:{}},i=a._opts={heatmap:o,geojson:e()};if(!n)return i;var s=[],f,x=a.z,y=a.radius,v=g.isArrayOrTypedArray(x)&&x.length,T=g.isArrayOrTypedArray(y);for(f=0;f<r.length;f++){var u=r[f],b=u.lonlat;if(b[0]!==t){var _={};if(v){var C=u.z;_.z=C!==t?C:0}T&&(_.r=c(y[f])&&y[f]>0?+y[f]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:_})}}var M=S.extractOpts(a),E=M.reversescale?S.flipScale(M.colorscale):M.colorscale,A=E[0][1],h=P.opacity(A)<1?A:P.addOpacity(A,0),p=["interpolate",["linear"],["heatmap-density"],0,h];for(f=1;f<E.length;f++)p.push(E[f][0],E[f][1]);var k=["interpolate",["linear"],["get","z"],M.min,0,M.max,1];return g.extendFlat(i.heatmap.paint,{"heatmap-weight":v?k:1/(M.max-M.min),"heatmap-color":p,"heatmap-radius":T?{type:"identity",property:"r"}:a.radius,"heatmap-opacity":a.opacity}),i.geojson={type:"FeatureCollection",features:s},i.heatmap.layout.visibility="visible",i}}),UW=Ft((Q,$)=>{var c=jW(),g=Z1().traceLayerPrefix;function P(t,e){this.type="densitymap",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",g+e+"-heatmap"]],this.below=null}var S=P.prototype;S.update=function(t){var e=this.subplot,r=this.layerList,a=c(t),n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(a.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(a,n),this.below=n);for(var o=0;o<r.length;o++){var i=r[o],s=i[0],f=i[1],x=a[s];e.setOptions(f,"setLayoutProperty",x.layout),x.layout.visibility==="visible"&&e.setOptions(f,"setPaintProperty",x.paint)}},S._addLayers=function(t,e){for(var r=this.subplot,a=this.layerList,n=this.sourceId,o=0;o<a.length;o++){var i=a[o],s=i[0],f=t[s];r.addLayer({type:s,id:i[1],source:n,layout:f.layout,paint:f.paint},e)}},S._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},S.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},$.exports=function(t,e){var r=e[0].trace,a=new P(t,r.uid),n=a.sourceId,o=c(e),i=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(n,{type:"geojson",data:o.geojson}),a._addLayers(o,i),a}}),VW=Ft((Q,$)=>{var c=Es(),g=vT().hoverPoints,P=vT().getExtraText;$.exports=function(S,t,e){var r=g(S,t,e);if(r){var a=r[0],n=a.cd,o=n[0].trace,i=n[a.index];if(delete a.color,"z"in i){var s=a.subplot.mockAxis;a.z=i.z,a.zLabel=c.tickText(s,s.c2l(i.z),"hover").text}return a.extraText=P(o,i,n[0].t.labels),[a]}}}),HW=Ft((Q,$)=>{$.exports=function(c,g){return c.lon=g.lon,c.lat=g.lat,c.z=g.z,c}}),WW=Ft((Q,$)=>{$.exports={attributes:_E(),supplyDefaults:BW(),colorbar:L1(),formatLabels:gE(),calc:NW(),plot:UW(),hoverPoints:VW(),eventData:HW(),getBelow:function(c,g){for(var P=g.getMapLayers(),S=0;S<P.length;S++){var t=P[S],e=t.id;if(t.type==="symbol"&&typeof e=="string"&&e.indexOf("plotly-")===-1)return e}},moduleType:"trace",name:"densitymap",basePlotModule:yT(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}}),qW=Ft((Q,$)=>{$.exports=WW()}),bE=Ft((Q,$)=>{var c=Ea(),g=$o(),P=bi(),S=Ps(),t=Nh().attributes,{hovertemplateAttrs:e,templatefallbackAttrs:r}=$u(),a=Tc(),n=pu().templatedArray,o=fh().descriptionOnlyNumbers,i=Ta().extendFlat,s=Yc().overrideAll;$.exports=s({hoverinfo:i({},g.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:S.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:c({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:P.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:S.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:P.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:S.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:i(a().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}),ZW=Ft((Q,$)=>{var c=bn(),g=bE(),P=li(),S=fo(),t=Nh().defaults,e=bg(),r=pu(),a=Md();$.exports=function(o,i,s,f){function x(R,O){return c.coerce(o,i,g,R,O)}var y=c.extendDeep(f.hoverlabel,o.hoverlabel),v=o.node,T=r.newContainer(i,"node");function u(R,O){return c.coerce(v,T,g.node,R,O)}u("label"),u("groups"),u("x"),u("y"),u("pad"),u("thickness"),u("line.color"),u("line.width"),u("hoverinfo",o.hoverinfo),e(v,T,u,y),u("hovertemplate"),u("align");var b=f.colorway,_=function(R){return b[R%b.length]};u("color",T.label.map(function(R,O){return P.addOpacity(_(O),.8)})),u("customdata");var C=o.link||{},M=r.newContainer(i,"link");function E(R,O){return c.coerce(C,M,g.link,R,O)}E("label"),E("arrowlen"),E("source"),E("target"),E("value"),E("line.color"),E("line.width"),E("hoverinfo",o.hoverinfo),e(C,M,E,y),E("hovertemplate");var A=S(f.paper_bgcolor).getLuminance()<.333,h=A?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",p=E("color",h);function k(R){var O=S(R);if(!O.isValid())return R;var N=O.getAlpha();return N<=.8?O.setAlpha(N+.2):O=A?O.brighten():O.darken(),O.toRgbString()}E("hovercolor",Array.isArray(p)?p.map(k):k(p)),E("customdata"),a(C,M,{name:"colorscales",handleItemDefaults:n}),t(i,f,x),x("orientation"),x("valueformat"),x("valuesuffix");var w;T.x.length&&T.y.length&&(w="freeform"),x("arrangement",w),c.coerceFont(x,"textfont",f.font,{autoShadowDflt:!0}),i._length=null};function n(o,i){function s(f,x){return c.coerce(o,i,g.link.colorscales,f,x)}s("label"),s("cmin"),s("cmax"),s("colorscale")}}),wE=Ft((Q,$)=>{$.exports=c;function c(g){for(var P=g.length,S=new Array(P),t=new Array(P),e=new Array(P),r=new Array(P),a=new Array(P),n=new Array(P),o=0;o<P;++o)S[o]=-1,t[o]=0,e[o]=!1,r[o]=0,a[o]=-1,n[o]=[];var i=0,s=[],f=[];function x(u){var b=[u],_=[u];for(S[u]=t[u]=i,e[u]=!0,i+=1;_.length>0;){u=_[_.length-1];var C=g[u];if(r[u]<C.length){for(var M=r[u];M<C.length;++M){var E=C[M];if(S[E]<0){S[E]=t[E]=i,e[E]=!0,i+=1,b.push(E),_.push(E);break}else e[E]&&(t[u]=Math.min(t[u],t[E])|0);a[E]>=0&&n[u].push(a[E])}r[u]=M}else{if(t[u]===S[u]){for(var A=[],h=[],p=0,M=b.length-1;M>=0;--M){var k=b[M];if(e[k]=!1,A.push(k),h.push(n[k]),p+=n[k].length,a[k]=s.length,k===u){b.length=M;break}}s.push(A);for(var w=new Array(p),M=0;M<h.length;M++)for(var R=0;R<h[M].length;R++)w[--p]=h[M][R];f.push(w)}_.pop()}}}for(var o=0;o<P;++o)S[o]<0&&x(o);for(var y,o=0;o<f.length;o++){var v=f[o];if(v.length!==0){v.sort(function(b,_){return b-_}),y=[v[0]];for(var T=1;T<v.length;T++)v[T]!==v[T-1]&&y.push(v[T]);f[o]=y}}return{components:s,adjacencyList:f}}}),$W=Ft((Q,$)=>{var c=wE(),g=bn(),P=Lg().wrap,S=g.isArrayOrTypedArray,t=g.isIndex,e=Xc();function r(n){var o=n.node,i=n.link,s=[],f=S(i.color),x=S(i.hovercolor),y=S(i.customdata),v={},T={},u=i.colorscales.length,b;for(b=0;b<u;b++){var _=i.colorscales[b],C=e.extractScale(_,{cLetter:"c"}),M=e.makeColorScaleFunc(C);T[_.label]=M}var E=0;for(b=0;b<i.value.length;b++)i.source[b]>E&&(E=i.source[b]),i.target[b]>E&&(E=i.target[b]);var A=E+1;n.node._count=A;var h,p=n.node.groups,k={};for(b=0;b<p.length;b++){var w=p[b];for(h=0;h<w.length;h++){var R=w[h],O=A+b;k.hasOwnProperty(R)?g.warn("Node "+R+" is already part of a group."):k[R]=O}}var N={source:[],target:[]};for(b=0;b<i.value.length;b++){var V=i.value[b],H=i.source[b],F=i.target[b];if(V>0&&t(H,A)&&t(F,A)&&!(k.hasOwnProperty(H)&&k.hasOwnProperty(F)&&k[H]===k[F])){k.hasOwnProperty(F)&&(F=k[F]),k.hasOwnProperty(H)&&(H=k[H]),H=+H,F=+F,v[H]=v[F]=!0;var U="";i.label&&i.label[b]&&(U=i.label[b]);var W=null;U&&T.hasOwnProperty(U)&&(W=T[U]),s.push({pointNumber:b,label:U,color:f?i.color[b]:i.color,hovercolor:x?i.hovercolor[b]:i.hovercolor,customdata:y?i.customdata[b]:i.customdata,concentrationscale:W,source:H,target:F,value:+V}),N.source.push(H),N.target.push(F)}}var q=A+p.length,X=S(o.color),lt=S(o.customdata),yt=[];for(b=0;b<q;b++)if(v[b]){var pt=o.label[b];yt.push({group:b>A-1,childrenNodes:[],pointNumber:b,label:pt,color:X?o.color[b]:o.color,customdata:lt?o.customdata[b]:o.customdata})}var st=!1;return a(q,N.source,N.target)&&(st=!0),{circular:st,links:s,nodes:yt,groups:p,groupLookup:k}}function a(n,o,i){for(var s=g.init2dArray(n,0),f=0;f<Math.min(o.length,i.length);f++)if(g.isIndex(o[f],n)&&g.isIndex(i[f],n)){if(o[f]===i[f])return!0;s[o[f]].push(i[f])}var x=c(s);return x.components.some(function(y){return y.length>1})}$.exports=function(n,o){var i=r(o);return P({circular:i.circular,_nodes:i.nodes,_links:i.links,_groups:i.groups,_groupLookup:i.groupLookup})}}),GW=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=c||self,g(c.d3=c.d3||{}))})(Q,function(c){function g(A){var h=+this._x.call(null,A),p=+this._y.call(null,A);return P(this.cover(h,p),h,p,A)}function P(A,h,p,k){if(isNaN(h)||isNaN(p))return A;var w,R=A._root,O={data:k},N=A._x0,V=A._y0,H=A._x1,F=A._y1,U,W,q,X,lt,yt,pt,st;if(!R)return A._root=O,A;for(;R.length;)if((lt=h>=(U=(N+H)/2))?N=U:H=U,(yt=p>=(W=(V+F)/2))?V=W:F=W,w=R,!(R=R[pt=yt<<1|lt]))return w[pt]=O,A;if(q=+A._x.call(null,R.data),X=+A._y.call(null,R.data),h===q&&p===X)return O.next=R,w?w[pt]=O:A._root=O,A;do w=w?w[pt]=new Array(4):A._root=new Array(4),(lt=h>=(U=(N+H)/2))?N=U:H=U,(yt=p>=(W=(V+F)/2))?V=W:F=W;while((pt=yt<<1|lt)===(st=(X>=W)<<1|q>=U));return w[st]=R,w[pt]=O,A}function S(A){var h,p,k=A.length,w,R,O=new Array(k),N=new Array(k),V=1/0,H=1/0,F=-1/0,U=-1/0;for(p=0;p<k;++p)isNaN(w=+this._x.call(null,h=A[p]))||isNaN(R=+this._y.call(null,h))||(O[p]=w,N[p]=R,w<V&&(V=w),w>F&&(F=w),R<H&&(H=R),R>U&&(U=R));if(V>F||H>U)return this;for(this.cover(V,H).cover(F,U),p=0;p<k;++p)P(this,O[p],N[p],A[p]);return this}function t(A,h){if(isNaN(A=+A)||isNaN(h=+h))return this;var p=this._x0,k=this._y0,w=this._x1,R=this._y1;if(isNaN(p))w=(p=Math.floor(A))+1,R=(k=Math.floor(h))+1;else{for(var O=w-p,N=this._root,V,H;p>A||A>=w||k>h||h>=R;)switch(H=(h<k)<<1|A<p,V=new Array(4),V[H]=N,N=V,O*=2,H){case 0:w=p+O,R=k+O;break;case 1:p=w-O,R=k+O;break;case 2:w=p+O,k=R-O;break;case 3:p=w-O,k=R-O;break}this._root&&this._root.length&&(this._root=N)}return this._x0=p,this._y0=k,this._x1=w,this._y1=R,this}function e(){var A=[];return this.visit(function(h){if(!h.length)do A.push(h.data);while(h=h.next)}),A}function r(A){return arguments.length?this.cover(+A[0][0],+A[0][1]).cover(+A[1][0],+A[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function a(A,h,p,k,w){this.node=A,this.x0=h,this.y0=p,this.x1=k,this.y1=w}function n(A,h,p){var k,w=this._x0,R=this._y0,O,N,V,H,F=this._x1,U=this._y1,W=[],q=this._root,X,lt;for(q&&W.push(new a(q,w,R,F,U)),p==null?p=1/0:(w=A-p,R=h-p,F=A+p,U=h+p,p*=p);X=W.pop();)if(!(!(q=X.node)||(O=X.x0)>F||(N=X.y0)>U||(V=X.x1)<w||(H=X.y1)<R))if(q.length){var yt=(O+V)/2,pt=(N+H)/2;W.push(new a(q[3],yt,pt,V,H),new a(q[2],O,pt,yt,H),new a(q[1],yt,N,V,pt),new a(q[0],O,N,yt,pt)),(lt=(h>=pt)<<1|A>=yt)&&(X=W[W.length-1],W[W.length-1]=W[W.length-1-lt],W[W.length-1-lt]=X)}else{var st=A-+this._x.call(null,q.data),tt=h-+this._y.call(null,q.data),dt=st*st+tt*tt;if(dt<p){var rt=Math.sqrt(p=dt);w=A-rt,R=h-rt,F=A+rt,U=h+rt,k=q.data}}return k}function o(A){if(isNaN(F=+this._x.call(null,A))||isNaN(U=+this._y.call(null,A)))return this;var h,p=this._root,k,w,R,O=this._x0,N=this._y0,V=this._x1,H=this._y1,F,U,W,q,X,lt,yt,pt;if(!p)return this;if(p.length)for(;;){if((X=F>=(W=(O+V)/2))?O=W:V=W,(lt=U>=(q=(N+H)/2))?N=q:H=q,h=p,!(p=p[yt=lt<<1|X]))return this;if(!p.length)break;(h[yt+1&3]||h[yt+2&3]||h[yt+3&3])&&(k=h,pt=yt)}for(;p.data!==A;)if(w=p,!(p=p.next))return this;return(R=p.next)&&delete p.next,w?(R?w.next=R:delete w.next,this):h?(R?h[yt]=R:delete h[yt],(p=h[0]||h[1]||h[2]||h[3])&&p===(h[3]||h[2]||h[1]||h[0])&&!p.length&&(k?k[pt]=p:this._root=p),this):(this._root=R,this)}function i(A){for(var h=0,p=A.length;h<p;++h)this.remove(A[h]);return this}function s(){return this._root}function f(){var A=0;return this.visit(function(h){if(!h.length)do++A;while(h=h.next)}),A}function x(A){var h=[],p,k=this._root,w,R,O,N,V;for(k&&h.push(new a(k,this._x0,this._y0,this._x1,this._y1));p=h.pop();)if(!A(k=p.node,R=p.x0,O=p.y0,N=p.x1,V=p.y1)&&k.length){var H=(R+N)/2,F=(O+V)/2;(w=k[3])&&h.push(new a(w,H,F,N,V)),(w=k[2])&&h.push(new a(w,R,F,H,V)),(w=k[1])&&h.push(new a(w,H,O,N,F)),(w=k[0])&&h.push(new a(w,R,O,H,F))}return this}function y(A){var h=[],p=[],k;for(this._root&&h.push(new a(this._root,this._x0,this._y0,this._x1,this._y1));k=h.pop();){var w=k.node;if(w.length){var R,O=k.x0,N=k.y0,V=k.x1,H=k.y1,F=(O+V)/2,U=(N+H)/2;(R=w[0])&&h.push(new a(R,O,N,F,U)),(R=w[1])&&h.push(new a(R,F,N,V,U)),(R=w[2])&&h.push(new a(R,O,U,F,H)),(R=w[3])&&h.push(new a(R,F,U,V,H))}p.push(k)}for(;k=p.pop();)A(k.node,k.x0,k.y0,k.x1,k.y1);return this}function v(A){return A[0]}function T(A){return arguments.length?(this._x=A,this):this._x}function u(A){return A[1]}function b(A){return arguments.length?(this._y=A,this):this._y}function _(A,h,p){var k=new C(h??v,p??u,NaN,NaN,NaN,NaN);return A==null?k:k.addAll(A)}function C(A,h,p,k,w,R){this._x=A,this._y=h,this._x0=p,this._y0=k,this._x1=w,this._y1=R,this._root=void 0}function M(A){for(var h={data:A.data},p=h;A=A.next;)p=p.next={data:A.data};return h}var E=_.prototype=C.prototype;E.copy=function(){var A=new C(this._x,this._y,this._x0,this._y0,this._x1,this._y1),h=this._root,p,k;if(!h)return A;if(!h.length)return A._root=M(h),A;for(p=[{source:h,target:A._root=new Array(4)}];h=p.pop();)for(var w=0;w<4;++w)(k=h.source[w])&&(k.length?p.push({source:k,target:h.target[w]=new Array(4)}):h.target[w]=M(k));return A},E.add=g,E.addAll=S,E.cover=t,E.data=e,E.extent=r,E.find=n,E.remove=o,E.removeAll=i,E.root=s,E.size=f,E.visit=x,E.visitAfter=y,E.x=T,E.y=b,c.quadtree=_,Object.defineProperty(c,"__esModule",{value:!0})})}),xT=Ft((Q,$)=>{(function(c,g){g(typeof Q=="object"&&typeof $<"u"?Q:c.d3=c.d3||{})})(Q,function(c){var g="$";function P(){}P.prototype=S.prototype={constructor:P,has:function(v){return g+v in this},get:function(v){return this[g+v]},set:function(v,T){return this[g+v]=T,this},remove:function(v){var T=g+v;return T in this&&delete this[T]},clear:function(){for(var v in this)v[0]===g&&delete this[v]},keys:function(){var v=[];for(var T in this)T[0]===g&&v.push(T.slice(1));return v},values:function(){var v=[];for(var T in this)T[0]===g&&v.push(this[T]);return v},entries:function(){var v=[];for(var T in this)T[0]===g&&v.push({key:T.slice(1),value:this[T]});return v},size:function(){var v=0;for(var T in this)T[0]===g&&++v;return v},empty:function(){for(var v in this)if(v[0]===g)return!1;return!0},each:function(v){for(var T in this)T[0]===g&&v(this[T],T.slice(1),this)}};function S(v,T){var u=new P;if(v instanceof P)v.each(function(E,A){u.set(A,E)});else if(Array.isArray(v)){var b=-1,_=v.length,C;if(T==null)for(;++b<_;)u.set(b,v[b]);else for(;++b<_;)u.set(T(C=v[b],b,v),C)}else if(v)for(var M in v)u.set(M,v[M]);return u}function t(){var v=[],T=[],u,b,_;function C(E,A,h,p){if(A>=v.length)return u!=null&&E.sort(u),b!=null?b(E):E;for(var k=-1,w=E.length,R=v[A++],O,N,V=S(),H,F=h();++k<w;)(H=V.get(O=R(N=E[k])+""))?H.push(N):V.set(O,[N]);return V.each(function(U,W){p(F,W,C(U,A,h,p))}),F}function M(E,A){if(++A>v.length)return E;var h,p=T[A-1];return b!=null&&A>=v.length?h=E.entries():(h=[],E.each(function(k,w){h.push({key:w,values:M(k,A)})})),p!=null?h.sort(function(k,w){return p(k.key,w.key)}):h}return _={object:function(E){return C(E,0,e,r)},map:function(E){return C(E,0,a,n)},entries:function(E){return M(C(E,0,a,n),0)},key:function(E){return v.push(E),_},sortKeys:function(E){return T[v.length-1]=E,_},sortValues:function(E){return u=E,_},rollup:function(E){return b=E,_}}}function e(){return{}}function r(v,T,u){v[T]=u}function a(){return S()}function n(v,T,u){v.set(T,u)}function o(){}var i=S.prototype;o.prototype=s.prototype={constructor:o,has:i.has,add:function(v){return v+="",this[g+v]=v,this},remove:i.remove,clear:i.clear,values:i.keys,size:i.size,empty:i.empty,each:i.each};function s(v,T){var u=new o;if(v instanceof o)v.each(function(C){u.add(C)});else if(v){var b=-1,_=v.length;if(T==null)for(;++b<_;)u.add(v[b]);else for(;++b<_;)u.add(T(v[b],b,v))}return u}function f(v){var T=[];for(var u in v)T.push(u);return T}function x(v){var T=[];for(var u in v)T.push(v[u]);return T}function y(v){var T=[];for(var u in v)T.push({key:u,value:v[u]});return T}c.nest=t,c.set=s,c.map=S,c.keys=f,c.values=x,c.entries=y,Object.defineProperty(c,"__esModule",{value:!0})})}),YW=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=c||self,g(c.d3=c.d3||{}))})(Q,function(c){var g={value:function(){}};function P(){for(var a=0,n=arguments.length,o={},i;a<n;++a){if(!(i=arguments[a]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new S(o)}function S(a){this._=a}function t(a,n){return a.trim().split(/^|\s+/).map(function(o){var i="",s=o.indexOf(".");if(s>=0&&(i=o.slice(s+1),o=o.slice(0,s)),o&&!n.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}S.prototype=P.prototype={constructor:S,on:function(a,n){var o=this._,i=t(a+"",o),s,f=-1,x=i.length;if(arguments.length<2){for(;++f<x;)if((s=(a=i[f]).type)&&(s=e(o[s],a.name)))return s;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++f<x;)if(s=(a=i[f]).type)o[s]=r(o[s],a.name,n);else if(n==null)for(s in o)o[s]=r(o[s],a.name,null);return this},copy:function(){var a={},n=this._;for(var o in n)a[o]=n[o].slice();return new S(a)},call:function(a,n){if((s=arguments.length-2)>0)for(var o=new Array(s),i=0,s,f;i<s;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(a))throw new Error("unknown type: "+a);for(f=this._[a],i=0,s=f.length;i<s;++i)f[i].value.apply(n,o)},apply:function(a,n,o){if(!this._.hasOwnProperty(a))throw new Error("unknown type: "+a);for(var i=this._[a],s=0,f=i.length;s<f;++s)i[s].value.apply(n,o)}};function e(a,n){for(var o=0,i=a.length,s;o<i;++o)if((s=a[o]).name===n)return s.value}function r(a,n,o){for(var i=0,s=a.length;i<s;++i)if(a[i].name===n){a[i]=g,a=a.slice(0,i).concat(a.slice(i+1));break}return o!=null&&a.push({name:n,value:o}),a}c.dispatch=P,Object.defineProperty(c,"__esModule",{value:!0})})}),KW=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=c||self,g(c.d3=c.d3||{}))})(Q,function(c){var g=0,P=0,S=0,t=1e3,e,r,a=0,n=0,o=0,i=typeof performance=="object"&&performance.now?performance:Date,s=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(A){setTimeout(A,17)};function f(){return n||(s(x),n=i.now()+o)}function x(){n=0}function y(){this._call=this._time=this._next=null}y.prototype=v.prototype={constructor:y,restart:function(A,h,p){if(typeof A!="function")throw new TypeError("callback is not a function");p=(p==null?f():+p)+(h==null?0:+h),!this._next&&r!==this&&(r?r._next=this:e=this,r=this),this._call=A,this._time=p,C()},stop:function(){this._call&&(this._call=null,this._time=1/0,C())}};function v(A,h,p){var k=new y;return k.restart(A,h,p),k}function T(){f(),++g;for(var A=e,h;A;)(h=n-A._time)>=0&&A._call.call(null,h),A=A._next;--g}function u(){n=(a=i.now())+o,g=P=0;try{T()}finally{g=0,_(),n=0}}function b(){var A=i.now(),h=A-a;h>t&&(o-=h,a=A)}function _(){for(var A,h=e,p,k=1/0;h;)h._call?(k>h._time&&(k=h._time),A=h,h=h._next):(p=h._next,h._next=null,h=A?A._next=p:e=p);r=A,C(k)}function C(A){if(!g){P&&(P=clearTimeout(P));var h=A-n;h>24?(A<1/0&&(P=setTimeout(u,A-i.now()-o)),S&&(S=clearInterval(S))):(S||(a=i.now(),S=setInterval(b,t)),g=1,s(u))}}function M(A,h,p){var k=new y;return h=h==null?0:+h,k.restart(function(w){k.stop(),A(w+h)},h,p),k}function E(A,h,p){var k=new y,w=h;return h==null?(k.restart(A,h,p),k):(h=+h,p=p==null?f():+p,k.restart(function R(O){O+=w,k.restart(R,w+=h,p),A(O)},h,p),k)}c.interval=E,c.now=f,c.timeout=M,c.timer=v,c.timerFlush=T,Object.defineProperty(c,"__esModule",{value:!0})})}),XW=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q,GW(),xT(),YW(),KW()):g(c.d3=c.d3||{},c.d3,c.d3,c.d3,c.d3)})(Q,function(c,g,P,S,t){function e(A,h){var p;A==null&&(A=0),h==null&&(h=0);function k(){var w,R=p.length,O,N=0,V=0;for(w=0;w<R;++w)O=p[w],N+=O.x,V+=O.y;for(N=N/R-A,V=V/R-h,w=0;w<R;++w)O=p[w],O.x-=N,O.y-=V}return k.initialize=function(w){p=w},k.x=function(w){return arguments.length?(A=+w,k):A},k.y=function(w){return arguments.length?(h=+w,k):h},k}function r(A){return function(){return A}}function a(){return(Math.random()-.5)*1e-6}function n(A){return A.x+A.vx}function o(A){return A.y+A.vy}function i(A){var h,p,k=1,w=1;typeof A!="function"&&(A=r(A==null?1:+A));function R(){for(var V,H=h.length,F,U,W,q,X,lt,yt=0;yt<w;++yt)for(F=g.quadtree(h,n,o).visitAfter(O),V=0;V<H;++V)U=h[V],X=p[U.index],lt=X*X,W=U.x+U.vx,q=U.y+U.vy,F.visit(pt);function pt(st,tt,dt,rt,at){var vt=st.data,it=st.r,Y=X+it;if(vt){if(vt.index>U.index){var ft=W-vt.x-vt.vx,ut=q-vt.y-vt.vy,wt=ft*ft+ut*ut;wt<Y*Y&&(ft===0&&(ft=a(),wt+=ft*ft),ut===0&&(ut=a(),wt+=ut*ut),wt=(Y-(wt=Math.sqrt(wt)))/wt*k,U.vx+=(ft*=wt)*(Y=(it*=it)/(lt+it)),U.vy+=(ut*=wt)*Y,vt.vx-=ft*(Y=1-Y),vt.vy-=ut*Y)}return}return tt>W+Y||rt<W-Y||dt>q+Y||at<q-Y}}function O(V){if(V.data)return V.r=p[V.data.index];for(var H=V.r=0;H<4;++H)V[H]&&V[H].r>V.r&&(V.r=V[H].r)}function N(){if(h){var V,H=h.length,F;for(p=new Array(H),V=0;V<H;++V)F=h[V],p[F.index]=+A(F,V,h)}}return R.initialize=function(V){h=V,N()},R.iterations=function(V){return arguments.length?(w=+V,R):w},R.strength=function(V){return arguments.length?(k=+V,R):k},R.radius=function(V){return arguments.length?(A=typeof V=="function"?V:r(+V),N(),R):A},R}function s(A){return A.index}function f(A,h){var p=A.get(h);if(!p)throw new Error("missing: "+h);return p}function x(A){var h=s,p=F,k,w=r(30),R,O,N,V,H=1;A==null&&(A=[]);function F(lt){return 1/Math.min(N[lt.source.index],N[lt.target.index])}function U(lt){for(var yt=0,pt=A.length;yt<H;++yt)for(var st=0,tt,dt,rt,at,vt,it,Y;st<pt;++st)tt=A[st],dt=tt.source,rt=tt.target,at=rt.x+rt.vx-dt.x-dt.vx||a(),vt=rt.y+rt.vy-dt.y-dt.vy||a(),it=Math.sqrt(at*at+vt*vt),it=(it-R[st])/it*lt*k[st],at*=it,vt*=it,rt.vx-=at*(Y=V[st]),rt.vy-=vt*Y,dt.vx+=at*(Y=1-Y),dt.vy+=vt*Y}function W(){if(O){var lt,yt=O.length,pt=A.length,st=P.map(O,h),tt;for(lt=0,N=new Array(yt);lt<pt;++lt)tt=A[lt],tt.index=lt,typeof tt.source!="object"&&(tt.source=f(st,tt.source)),typeof tt.target!="object"&&(tt.target=f(st,tt.target)),N[tt.source.index]=(N[tt.source.index]||0)+1,N[tt.target.index]=(N[tt.target.index]||0)+1;for(lt=0,V=new Array(pt);lt<pt;++lt)tt=A[lt],V[lt]=N[tt.source.index]/(N[tt.source.index]+N[tt.target.index]);k=new Array(pt),q(),R=new Array(pt),X()}}function q(){if(O)for(var lt=0,yt=A.length;lt<yt;++lt)k[lt]=+p(A[lt],lt,A)}function X(){if(O)for(var lt=0,yt=A.length;lt<yt;++lt)R[lt]=+w(A[lt],lt,A)}return U.initialize=function(lt){O=lt,W()},U.links=function(lt){return arguments.length?(A=lt,W(),U):A},U.id=function(lt){return arguments.length?(h=lt,U):h},U.iterations=function(lt){return arguments.length?(H=+lt,U):H},U.strength=function(lt){return arguments.length?(p=typeof lt=="function"?lt:r(+lt),q(),U):p},U.distance=function(lt){return arguments.length?(w=typeof lt=="function"?lt:r(+lt),X(),U):w},U}function y(A){return A.x}function v(A){return A.y}var T=10,u=Math.PI*(3-Math.sqrt(5));function b(A){var h,p=1,k=.001,w=1-Math.pow(k,1/300),R=0,O=.6,N=P.map(),V=t.timer(F),H=S.dispatch("tick","end");A==null&&(A=[]);function F(){U(),H.call("tick",h),p<k&&(V.stop(),H.call("end",h))}function U(X){var lt,yt=A.length,pt;X===void 0&&(X=1);for(var st=0;st<X;++st)for(p+=(R-p)*w,N.each(function(tt){tt(p)}),lt=0;lt<yt;++lt)pt=A[lt],pt.fx==null?pt.x+=pt.vx*=O:(pt.x=pt.fx,pt.vx=0),pt.fy==null?pt.y+=pt.vy*=O:(pt.y=pt.fy,pt.vy=0);return h}function W(){for(var X=0,lt=A.length,yt;X<lt;++X){if(yt=A[X],yt.index=X,yt.fx!=null&&(yt.x=yt.fx),yt.fy!=null&&(yt.y=yt.fy),isNaN(yt.x)||isNaN(yt.y)){var pt=T*Math.sqrt(X),st=X*u;yt.x=pt*Math.cos(st),yt.y=pt*Math.sin(st)}(isNaN(yt.vx)||isNaN(yt.vy))&&(yt.vx=yt.vy=0)}}function q(X){return X.initialize&&X.initialize(A),X}return W(),h={tick:U,restart:function(){return V.restart(F),h},stop:function(){return V.stop(),h},nodes:function(X){return arguments.length?(A=X,W(),N.each(q),h):A},alpha:function(X){return arguments.length?(p=+X,h):p},alphaMin:function(X){return arguments.length?(k=+X,h):k},alphaDecay:function(X){return arguments.length?(w=+X,h):+w},alphaTarget:function(X){return arguments.length?(R=+X,h):R},velocityDecay:function(X){return arguments.length?(O=1-X,h):1-O},force:function(X,lt){return arguments.length>1?(lt==null?N.remove(X):N.set(X,q(lt)),h):N.get(X)},find:function(X,lt,yt){var pt=0,st=A.length,tt,dt,rt,at,vt;for(yt==null?yt=1/0:yt*=yt,pt=0;pt<st;++pt)at=A[pt],tt=X-at.x,dt=lt-at.y,rt=tt*tt+dt*dt,rt<yt&&(vt=at,yt=rt);return vt},on:function(X,lt){return arguments.length>1?(H.on(X,lt),h):H.on(X)}}}function _(){var A,h,p,k=r(-30),w,R=1,O=1/0,N=.81;function V(W){var q,X=A.length,lt=g.quadtree(A,y,v).visitAfter(F);for(p=W,q=0;q<X;++q)h=A[q],lt.visit(U)}function H(){if(A){var W,q=A.length,X;for(w=new Array(q),W=0;W<q;++W)X=A[W],w[X.index]=+k(X,W,A)}}function F(W){var q=0,X,lt,yt=0,pt,st,tt;if(W.length){for(pt=st=tt=0;tt<4;++tt)(X=W[tt])&&(lt=Math.abs(X.value))&&(q+=X.value,yt+=lt,pt+=lt*X.x,st+=lt*X.y);W.x=pt/yt,W.y=st/yt}else{X=W,X.x=X.data.x,X.y=X.data.y;do q+=w[X.data.index];while(X=X.next)}W.value=q}function U(W,q,X,lt){if(!W.value)return!0;var yt=W.x-h.x,pt=W.y-h.y,st=lt-q,tt=yt*yt+pt*pt;if(st*st/N<tt)return tt<O&&(yt===0&&(yt=a(),tt+=yt*yt),pt===0&&(pt=a(),tt+=pt*pt),tt<R&&(tt=Math.sqrt(R*tt)),h.vx+=yt*W.value*p/tt,h.vy+=pt*W.value*p/tt),!0;if(!(W.length||tt>=O)){(W.data!==h||W.next)&&(yt===0&&(yt=a(),tt+=yt*yt),pt===0&&(pt=a(),tt+=pt*pt),tt<R&&(tt=Math.sqrt(R*tt)));do W.data!==h&&(st=w[W.data.index]*p/tt,h.vx+=yt*st,h.vy+=pt*st);while(W=W.next)}}return V.initialize=function(W){A=W,H()},V.strength=function(W){return arguments.length?(k=typeof W=="function"?W:r(+W),H(),V):k},V.distanceMin=function(W){return arguments.length?(R=W*W,V):Math.sqrt(R)},V.distanceMax=function(W){return arguments.length?(O=W*W,V):Math.sqrt(O)},V.theta=function(W){return arguments.length?(N=W*W,V):Math.sqrt(N)},V}function C(A,h,p){var k,w=r(.1),R,O;typeof A!="function"&&(A=r(+A)),h==null&&(h=0),p==null&&(p=0);function N(H){for(var F=0,U=k.length;F<U;++F){var W=k[F],q=W.x-h||1e-6,X=W.y-p||1e-6,lt=Math.sqrt(q*q+X*X),yt=(O[F]-lt)*R[F]*H/lt;W.vx+=q*yt,W.vy+=X*yt}}function V(){if(k){var H,F=k.length;for(R=new Array(F),O=new Array(F),H=0;H<F;++H)O[H]=+A(k[H],H,k),R[H]=isNaN(O[H])?0:+w(k[H],H,k)}}return N.initialize=function(H){k=H,V()},N.strength=function(H){return arguments.length?(w=typeof H=="function"?H:r(+H),V(),N):w},N.radius=function(H){return arguments.length?(A=typeof H=="function"?H:r(+H),V(),N):A},N.x=function(H){return arguments.length?(h=+H,N):h},N.y=function(H){return arguments.length?(p=+H,N):p},N}function M(A){var h=r(.1),p,k,w;typeof A!="function"&&(A=r(A==null?0:+A));function R(N){for(var V=0,H=p.length,F;V<H;++V)F=p[V],F.vx+=(w[V]-F.x)*k[V]*N}function O(){if(p){var N,V=p.length;for(k=new Array(V),w=new Array(V),N=0;N<V;++N)k[N]=isNaN(w[N]=+A(p[N],N,p))?0:+h(p[N],N,p)}}return R.initialize=function(N){p=N,O()},R.strength=function(N){return arguments.length?(h=typeof N=="function"?N:r(+N),O(),R):h},R.x=function(N){return arguments.length?(A=typeof N=="function"?N:r(+N),O(),R):A},R}function E(A){var h=r(.1),p,k,w;typeof A!="function"&&(A=r(A==null?0:+A));function R(N){for(var V=0,H=p.length,F;V<H;++V)F=p[V],F.vy+=(w[V]-F.y)*k[V]*N}function O(){if(p){var N,V=p.length;for(k=new Array(V),w=new Array(V),N=0;N<V;++N)k[N]=isNaN(w[N]=+A(p[N],N,p))?0:+h(p[N],N,p)}}return R.initialize=function(N){p=N,O()},R.strength=function(N){return arguments.length?(h=typeof N=="function"?N:r(+N),O(),R):h},R.y=function(N){return arguments.length?(A=typeof N=="function"?N:r(+N),O(),R):A},R}c.forceCenter=e,c.forceCollide=i,c.forceLink=x,c.forceManyBody=_,c.forceRadial=C,c.forceSimulation=b,c.forceX=M,c.forceY=E,Object.defineProperty(c,"__esModule",{value:!0})})}),JW=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=c||self,g(c.d3=c.d3||{}))})(Q,function(c){var g=Math.PI,P=2*g,S=1e-6,t=P-S;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(a,n){this._+="M"+(this._x0=this._x1=+a)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(a,n){this._+="L"+(this._x1=+a)+","+(this._y1=+n)},quadraticCurveTo:function(a,n,o,i){this._+="Q"+ +a+","+ +n+","+(this._x1=+o)+","+(this._y1=+i)},bezierCurveTo:function(a,n,o,i,s,f){this._+="C"+ +a+","+ +n+","+ +o+","+ +i+","+(this._x1=+s)+","+(this._y1=+f)},arcTo:function(a,n,o,i,s){a=+a,n=+n,o=+o,i=+i,s=+s;var f=this._x1,x=this._y1,y=o-a,v=i-n,T=f-a,u=x-n,b=T*T+u*u;if(s<0)throw new Error("negative radius: "+s);if(this._x1===null)this._+="M"+(this._x1=a)+","+(this._y1=n);else if(b>S)if(!(Math.abs(u*y-v*T)>S)||!s)this._+="L"+(this._x1=a)+","+(this._y1=n);else{var _=o-f,C=i-x,M=y*y+v*v,E=_*_+C*C,A=Math.sqrt(M),h=Math.sqrt(b),p=s*Math.tan((g-Math.acos((M+b-E)/(2*A*h)))/2),k=p/h,w=p/A;Math.abs(k-1)>S&&(this._+="L"+(a+k*T)+","+(n+k*u)),this._+="A"+s+","+s+",0,0,"+ +(u*_>T*C)+","+(this._x1=a+w*y)+","+(this._y1=n+w*v)}},arc:function(a,n,o,i,s,f){a=+a,n=+n,o=+o,f=!!f;var x=o*Math.cos(i),y=o*Math.sin(i),v=a+x,T=n+y,u=1^f,b=f?i-s:s-i;if(o<0)throw new Error("negative radius: "+o);this._x1===null?this._+="M"+v+","+T:(Math.abs(this._x1-v)>S||Math.abs(this._y1-T)>S)&&(this._+="L"+v+","+T),o&&(b<0&&(b=b%P+P),b>t?this._+="A"+o+","+o+",0,1,"+u+","+(a-x)+","+(n-y)+"A"+o+","+o+",0,1,"+u+","+(this._x1=v)+","+(this._y1=T):b>S&&(this._+="A"+o+","+o+",0,"+ +(b>=g)+","+u+","+(this._x1=a+o*Math.cos(s))+","+(this._y1=n+o*Math.sin(s))))},rect:function(a,n,o,i){this._+="M"+(this._x0=this._x1=+a)+","+(this._y0=this._y1=+n)+"h"+ +o+"v"+ +i+"h"+-o+"Z"},toString:function(){return this._}},c.path=r,Object.defineProperty(c,"__esModule",{value:!0})})}),kE=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q,JW()):(c=c||self,g(c.d3=c.d3||{},c.d3))})(Q,function(c,g){function P(Ee){return function(){return Ee}}var S=Math.abs,t=Math.atan2,e=Math.cos,r=Math.max,a=Math.min,n=Math.sin,o=Math.sqrt,i=1e-12,s=Math.PI,f=s/2,x=2*s;function y(Ee){return Ee>1?0:Ee<-1?s:Math.acos(Ee)}function v(Ee){return Ee>=1?f:Ee<=-1?-f:Math.asin(Ee)}function T(Ee){return Ee.innerRadius}function u(Ee){return Ee.outerRadius}function b(Ee){return Ee.startAngle}function _(Ee){return Ee.endAngle}function C(Ee){return Ee&&Ee.padAngle}function M(Ee,dr,Vr,yn,Fn,Xn,Pn,En){var Zn=Vr-Ee,Ca=yn-dr,Ri=Pn-Fn,Ja=En-Xn,Xa=Ja*Zn-Ri*Ca;if(!(Xa*Xa<i))return Xa=(Ri*(dr-Xn)-Ja*(Ee-Fn))/Xa,[Ee+Xa*Zn,dr+Xa*Ca]}function E(Ee,dr,Vr,yn,Fn,Xn,Pn){var En=Ee-Vr,Zn=dr-yn,Ca=(Pn?Xn:-Xn)/o(En*En+Zn*Zn),Ri=Ca*Zn,Ja=-Ca*En,Xa=Ee+Ri,Io=dr+Ja,po=Vr+Ri,Do=yn+Ja,Ia=(Xa+po)/2,gs=(Io+Do)/2,is=po-Xa,ll=Do-Io,Ho=is*is+ll*ll,Gs=Fn-Xn,as=Xa*Do-po*Io,ul=(ll<0?-1:1)*o(r(0,Gs*Gs*Ho-as*as)),Js=(as*ll-is*ul)/Ho,Rl=(-as*is-ll*ul)/Ho,ls=(as*ll+is*ul)/Ho,Cs=(-as*is+ll*ul)/Ho,Co=Js-Ia,ks=Rl-gs,kl=ls-Ia,Vl=Cs-gs;return Co*Co+ks*ks>kl*kl+Vl*Vl&&(Js=ls,Rl=Cs),{cx:Js,cy:Rl,x01:-Ri,y01:-Ja,x11:Js*(Fn/Gs-1),y11:Rl*(Fn/Gs-1)}}function A(){var Ee=T,dr=u,Vr=P(0),yn=null,Fn=b,Xn=_,Pn=C,En=null;function Zn(){var Ca,Ri,Ja=+Ee.apply(this,arguments),Xa=+dr.apply(this,arguments),Io=Fn.apply(this,arguments)-f,po=Xn.apply(this,arguments)-f,Do=S(po-Io),Ia=po>Io;if(En||(En=Ca=g.path()),Xa<Ja&&(Ri=Xa,Xa=Ja,Ja=Ri),!(Xa>i))En.moveTo(0,0);else if(Do>x-i)En.moveTo(Xa*e(Io),Xa*n(Io)),En.arc(0,0,Xa,Io,po,!Ia),Ja>i&&(En.moveTo(Ja*e(po),Ja*n(po)),En.arc(0,0,Ja,po,Io,Ia));else{var gs=Io,is=po,ll=Io,Ho=po,Gs=Do,as=Do,ul=Pn.apply(this,arguments)/2,Js=ul>i&&(yn?+yn.apply(this,arguments):o(Ja*Ja+Xa*Xa)),Rl=a(S(Xa-Ja)/2,+Vr.apply(this,arguments)),ls=Rl,Cs=Rl,Co,ks;if(Js>i){var kl=v(Js/Ja*n(ul)),Vl=v(Js/Xa*n(ul));(Gs-=kl*2)>i?(kl*=Ia?1:-1,ll+=kl,Ho-=kl):(Gs=0,ll=Ho=(Io+po)/2),(as-=Vl*2)>i?(Vl*=Ia?1:-1,gs+=Vl,is-=Vl):(as=0,gs=is=(Io+po)/2)}var Yl=Xa*e(gs),Ns=Xa*n(gs),La=Ja*e(Ho),uo=Ja*n(Ho);if(Rl>i){var Hs=Xa*e(is),Kl=Xa*n(is),Go=Ja*e(ll),ql=Ja*n(ll),il;if(Do<s&&(il=M(Yl,Ns,Go,ql,Hs,Kl,La,uo))){var Cl=Yl-il[0],Fu=Ns-il[1],ao=Hs-il[0],Ts=Kl-il[1],Ls=1/n(y((Cl*ao+Fu*Ts)/(o(Cl*Cl+Fu*Fu)*o(ao*ao+Ts*Ts)))/2),nu=o(il[0]*il[0]+il[1]*il[1]);ls=a(Rl,(Ja-nu)/(Ls-1)),Cs=a(Rl,(Xa-nu)/(Ls+1))}}as>i?Cs>i?(Co=E(Go,ql,Yl,Ns,Xa,Cs,Ia),ks=E(Hs,Kl,La,uo,Xa,Cs,Ia),En.moveTo(Co.cx+Co.x01,Co.cy+Co.y01),Cs<Rl?En.arc(Co.cx,Co.cy,Cs,t(Co.y01,Co.x01),t(ks.y01,ks.x01),!Ia):(En.arc(Co.cx,Co.cy,Cs,t(Co.y01,Co.x01),t(Co.y11,Co.x11),!Ia),En.arc(0,0,Xa,t(Co.cy+Co.y11,Co.cx+Co.x11),t(ks.cy+ks.y11,ks.cx+ks.x11),!Ia),En.arc(ks.cx,ks.cy,Cs,t(ks.y11,ks.x11),t(ks.y01,ks.x01),!Ia))):(En.moveTo(Yl,Ns),En.arc(0,0,Xa,gs,is,!Ia)):En.moveTo(Yl,Ns),!(Ja>i)||!(Gs>i)?En.lineTo(La,uo):ls>i?(Co=E(La,uo,Hs,Kl,Ja,-ls,Ia),ks=E(Yl,Ns,Go,ql,Ja,-ls,Ia),En.lineTo(Co.cx+Co.x01,Co.cy+Co.y01),ls<Rl?En.arc(Co.cx,Co.cy,ls,t(Co.y01,Co.x01),t(ks.y01,ks.x01),!Ia):(En.arc(Co.cx,Co.cy,ls,t(Co.y01,Co.x01),t(Co.y11,Co.x11),!Ia),En.arc(0,0,Ja,t(Co.cy+Co.y11,Co.cx+Co.x11),t(ks.cy+ks.y11,ks.cx+ks.x11),Ia),En.arc(ks.cx,ks.cy,ls,t(ks.y11,ks.x11),t(ks.y01,ks.x01),!Ia))):En.arc(0,0,Ja,Ho,ll,Ia)}if(En.closePath(),Ca)return En=null,Ca+""||null}return Zn.centroid=function(){var Ca=(+Ee.apply(this,arguments)+ +dr.apply(this,arguments))/2,Ri=(+Fn.apply(this,arguments)+ +Xn.apply(this,arguments))/2-s/2;return[e(Ri)*Ca,n(Ri)*Ca]},Zn.innerRadius=function(Ca){return arguments.length?(Ee=typeof Ca=="function"?Ca:P(+Ca),Zn):Ee},Zn.outerRadius=function(Ca){return arguments.length?(dr=typeof Ca=="function"?Ca:P(+Ca),Zn):dr},Zn.cornerRadius=function(Ca){return arguments.length?(Vr=typeof Ca=="function"?Ca:P(+Ca),Zn):Vr},Zn.padRadius=function(Ca){return arguments.length?(yn=Ca==null?null:typeof Ca=="function"?Ca:P(+Ca),Zn):yn},Zn.startAngle=function(Ca){return arguments.length?(Fn=typeof Ca=="function"?Ca:P(+Ca),Zn):Fn},Zn.endAngle=function(Ca){return arguments.length?(Xn=typeof Ca=="function"?Ca:P(+Ca),Zn):Xn},Zn.padAngle=function(Ca){return arguments.length?(Pn=typeof Ca=="function"?Ca:P(+Ca),Zn):Pn},Zn.context=function(Ca){return arguments.length?(En=Ca??null,Zn):En},Zn}function h(Ee){this._context=Ee}h.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(Ee,dr){switch(Ee=+Ee,dr=+dr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Ee,dr):this._context.moveTo(Ee,dr);break;case 1:this._point=2;default:this._context.lineTo(Ee,dr);break}}};function p(Ee){return new h(Ee)}function k(Ee){return Ee[0]}function w(Ee){return Ee[1]}function R(){var Ee=k,dr=w,Vr=P(!0),yn=null,Fn=p,Xn=null;function Pn(En){var Zn,Ca=En.length,Ri,Ja=!1,Xa;for(yn==null&&(Xn=Fn(Xa=g.path())),Zn=0;Zn<=Ca;++Zn)!(Zn<Ca&&Vr(Ri=En[Zn],Zn,En))===Ja&&((Ja=!Ja)?Xn.lineStart():Xn.lineEnd()),Ja&&Xn.point(+Ee(Ri,Zn,En),+dr(Ri,Zn,En));if(Xa)return Xn=null,Xa+""||null}return Pn.x=function(En){return arguments.length?(Ee=typeof En=="function"?En:P(+En),Pn):Ee},Pn.y=function(En){return arguments.length?(dr=typeof En=="function"?En:P(+En),Pn):dr},Pn.defined=function(En){return arguments.length?(Vr=typeof En=="function"?En:P(!!En),Pn):Vr},Pn.curve=function(En){return arguments.length?(Fn=En,yn!=null&&(Xn=Fn(yn)),Pn):Fn},Pn.context=function(En){return arguments.length?(En==null?yn=Xn=null:Xn=Fn(yn=En),Pn):yn},Pn}function O(){var Ee=k,dr=null,Vr=P(0),yn=w,Fn=P(!0),Xn=null,Pn=p,En=null;function Zn(Ri){var Ja,Xa,Io,po=Ri.length,Do,Ia=!1,gs,is=new Array(po),ll=new Array(po);for(Xn==null&&(En=Pn(gs=g.path())),Ja=0;Ja<=po;++Ja){if(!(Ja<po&&Fn(Do=Ri[Ja],Ja,Ri))===Ia)if(Ia=!Ia)Xa=Ja,En.areaStart(),En.lineStart();else{for(En.lineEnd(),En.lineStart(),Io=Ja-1;Io>=Xa;--Io)En.point(is[Io],ll[Io]);En.lineEnd(),En.areaEnd()}Ia&&(is[Ja]=+Ee(Do,Ja,Ri),ll[Ja]=+Vr(Do,Ja,Ri),En.point(dr?+dr(Do,Ja,Ri):is[Ja],yn?+yn(Do,Ja,Ri):ll[Ja]))}if(gs)return En=null,gs+""||null}function Ca(){return R().defined(Fn).curve(Pn).context(Xn)}return Zn.x=function(Ri){return arguments.length?(Ee=typeof Ri=="function"?Ri:P(+Ri),dr=null,Zn):Ee},Zn.x0=function(Ri){return arguments.length?(Ee=typeof Ri=="function"?Ri:P(+Ri),Zn):Ee},Zn.x1=function(Ri){return arguments.length?(dr=Ri==null?null:typeof Ri=="function"?Ri:P(+Ri),Zn):dr},Zn.y=function(Ri){return arguments.length?(Vr=typeof Ri=="function"?Ri:P(+Ri),yn=null,Zn):Vr},Zn.y0=function(Ri){return arguments.length?(Vr=typeof Ri=="function"?Ri:P(+Ri),Zn):Vr},Zn.y1=function(Ri){return arguments.length?(yn=Ri==null?null:typeof Ri=="function"?Ri:P(+Ri),Zn):yn},Zn.lineX0=Zn.lineY0=function(){return Ca().x(Ee).y(Vr)},Zn.lineY1=function(){return Ca().x(Ee).y(yn)},Zn.lineX1=function(){return Ca().x(dr).y(Vr)},Zn.defined=function(Ri){return arguments.length?(Fn=typeof Ri=="function"?Ri:P(!!Ri),Zn):Fn},Zn.curve=function(Ri){return arguments.length?(Pn=Ri,Xn!=null&&(En=Pn(Xn)),Zn):Pn},Zn.context=function(Ri){return arguments.length?(Ri==null?Xn=En=null:En=Pn(Xn=Ri),Zn):Xn},Zn}function N(Ee,dr){return dr<Ee?-1:dr>Ee?1:dr>=Ee?0:NaN}function V(Ee){return Ee}function H(){var Ee=V,dr=N,Vr=null,yn=P(0),Fn=P(x),Xn=P(0);function Pn(En){var Zn,Ca=En.length,Ri,Ja,Xa=0,Io=new Array(Ca),po=new Array(Ca),Do=+yn.apply(this,arguments),Ia=Math.min(x,Math.max(-x,Fn.apply(this,arguments)-Do)),gs,is=Math.min(Math.abs(Ia)/Ca,Xn.apply(this,arguments)),ll=is*(Ia<0?-1:1),Ho;for(Zn=0;Zn<Ca;++Zn)(Ho=po[Io[Zn]=Zn]=+Ee(En[Zn],Zn,En))>0&&(Xa+=Ho);for(dr!=null?Io.sort(function(Gs,as){return dr(po[Gs],po[as])}):Vr!=null&&Io.sort(function(Gs,as){return Vr(En[Gs],En[as])}),Zn=0,Ja=Xa?(Ia-Ca*ll)/Xa:0;Zn<Ca;++Zn,Do=gs)Ri=Io[Zn],Ho=po[Ri],gs=Do+(Ho>0?Ho*Ja:0)+ll,po[Ri]={data:En[Ri],index:Zn,value:Ho,startAngle:Do,endAngle:gs,padAngle:is};return po}return Pn.value=function(En){return arguments.length?(Ee=typeof En=="function"?En:P(+En),Pn):Ee},Pn.sortValues=function(En){return arguments.length?(dr=En,Vr=null,Pn):dr},Pn.sort=function(En){return arguments.length?(Vr=En,dr=null,Pn):Vr},Pn.startAngle=function(En){return arguments.length?(yn=typeof En=="function"?En:P(+En),Pn):yn},Pn.endAngle=function(En){return arguments.length?(Fn=typeof En=="function"?En:P(+En),Pn):Fn},Pn.padAngle=function(En){return arguments.length?(Xn=typeof En=="function"?En:P(+En),Pn):Xn},Pn}var F=W(p);function U(Ee){this._curve=Ee}U.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(Ee,dr){this._curve.point(dr*Math.sin(Ee),dr*-Math.cos(Ee))}};function W(Ee){function dr(Vr){return new U(Ee(Vr))}return dr._curve=Ee,dr}function q(Ee){var dr=Ee.curve;return Ee.angle=Ee.x,delete Ee.x,Ee.radius=Ee.y,delete Ee.y,Ee.curve=function(Vr){return arguments.length?dr(W(Vr)):dr()._curve},Ee}function X(){return q(R().curve(F))}function lt(){var Ee=O().curve(F),dr=Ee.curve,Vr=Ee.lineX0,yn=Ee.lineX1,Fn=Ee.lineY0,Xn=Ee.lineY1;return Ee.angle=Ee.x,delete Ee.x,Ee.startAngle=Ee.x0,delete Ee.x0,Ee.endAngle=Ee.x1,delete Ee.x1,Ee.radius=Ee.y,delete Ee.y,Ee.innerRadius=Ee.y0,delete Ee.y0,Ee.outerRadius=Ee.y1,delete Ee.y1,Ee.lineStartAngle=function(){return q(Vr())},delete Ee.lineX0,Ee.lineEndAngle=function(){return q(yn())},delete Ee.lineX1,Ee.lineInnerRadius=function(){return q(Fn())},delete Ee.lineY0,Ee.lineOuterRadius=function(){return q(Xn())},delete Ee.lineY1,Ee.curve=function(Pn){return arguments.length?dr(W(Pn)):dr()._curve},Ee}function yt(Ee,dr){return[(dr=+dr)*Math.cos(Ee-=Math.PI/2),dr*Math.sin(Ee)]}var pt=Array.prototype.slice;function st(Ee){return Ee.source}function tt(Ee){return Ee.target}function dt(Ee){var dr=st,Vr=tt,yn=k,Fn=w,Xn=null;function Pn(){var En,Zn=pt.call(arguments),Ca=dr.apply(this,Zn),Ri=Vr.apply(this,Zn);if(Xn||(Xn=En=g.path()),Ee(Xn,+yn.apply(this,(Zn[0]=Ca,Zn)),+Fn.apply(this,Zn),+yn.apply(this,(Zn[0]=Ri,Zn)),+Fn.apply(this,Zn)),En)return Xn=null,En+""||null}return Pn.source=function(En){return arguments.length?(dr=En,Pn):dr},Pn.target=function(En){return arguments.length?(Vr=En,Pn):Vr},Pn.x=function(En){return arguments.length?(yn=typeof En=="function"?En:P(+En),Pn):yn},Pn.y=function(En){return arguments.length?(Fn=typeof En=="function"?En:P(+En),Pn):Fn},Pn.context=function(En){return arguments.length?(Xn=En??null,Pn):Xn},Pn}function rt(Ee,dr,Vr,yn,Fn){Ee.moveTo(dr,Vr),Ee.bezierCurveTo(dr=(dr+yn)/2,Vr,dr,Fn,yn,Fn)}function at(Ee,dr,Vr,yn,Fn){Ee.moveTo(dr,Vr),Ee.bezierCurveTo(dr,Vr=(Vr+Fn)/2,yn,Vr,yn,Fn)}function vt(Ee,dr,Vr,yn,Fn){var Xn=yt(dr,Vr),Pn=yt(dr,Vr=(Vr+Fn)/2),En=yt(yn,Vr),Zn=yt(yn,Fn);Ee.moveTo(Xn[0],Xn[1]),Ee.bezierCurveTo(Pn[0],Pn[1],En[0],En[1],Zn[0],Zn[1])}function it(){return dt(rt)}function Y(){return dt(at)}function ft(){var Ee=dt(vt);return Ee.angle=Ee.x,delete Ee.x,Ee.radius=Ee.y,delete Ee.y,Ee}var ut={draw:function(Ee,dr){var Vr=Math.sqrt(dr/s);Ee.moveTo(Vr,0),Ee.arc(0,0,Vr,0,x)}},wt={draw:function(Ee,dr){var Vr=Math.sqrt(dr/5)/2;Ee.moveTo(-3*Vr,-Vr),Ee.lineTo(-Vr,-Vr),Ee.lineTo(-Vr,-3*Vr),Ee.lineTo(Vr,-3*Vr),Ee.lineTo(Vr,-Vr),Ee.lineTo(3*Vr,-Vr),Ee.lineTo(3*Vr,Vr),Ee.lineTo(Vr,Vr),Ee.lineTo(Vr,3*Vr),Ee.lineTo(-Vr,3*Vr),Ee.lineTo(-Vr,Vr),Ee.lineTo(-3*Vr,Vr),Ee.closePath()}},zt=Math.sqrt(1/3),Pt=zt*2,Wt={draw:function(Ee,dr){var Vr=Math.sqrt(dr/Pt),yn=Vr*zt;Ee.moveTo(0,-Vr),Ee.lineTo(yn,0),Ee.lineTo(0,Vr),Ee.lineTo(-yn,0),Ee.closePath()}},Ht=.8908130915292852,Jt=Math.sin(s/10)/Math.sin(7*s/10),ge=Math.sin(x/10)*Jt,he=-Math.cos(x/10)*Jt,de={draw:function(Ee,dr){var Vr=Math.sqrt(dr*Ht),yn=ge*Vr,Fn=he*Vr;Ee.moveTo(0,-Vr),Ee.lineTo(yn,Fn);for(var Xn=1;Xn<5;++Xn){var Pn=x*Xn/5,En=Math.cos(Pn),Zn=Math.sin(Pn);Ee.lineTo(Zn*Vr,-En*Vr),Ee.lineTo(En*yn-Zn*Fn,Zn*yn+En*Fn)}Ee.closePath()}},se={draw:function(Ee,dr){var Vr=Math.sqrt(dr),yn=-Vr/2;Ee.rect(yn,yn,Vr,Vr)}},Tt=Math.sqrt(3),Lt={draw:function(Ee,dr){var Vr=-Math.sqrt(dr/(Tt*3));Ee.moveTo(0,Vr*2),Ee.lineTo(-Tt*Vr,-Vr),Ee.lineTo(Tt*Vr,-Vr),Ee.closePath()}},Mt=-.5,te=Math.sqrt(3)/2,ve=1/Math.sqrt(12),oe=(ve/2+1)*3,Te={draw:function(Ee,dr){var Vr=Math.sqrt(dr/oe),yn=Vr/2,Fn=Vr*ve,Xn=yn,Pn=Vr*ve+Vr,En=-Xn,Zn=Pn;Ee.moveTo(yn,Fn),Ee.lineTo(Xn,Pn),Ee.lineTo(En,Zn),Ee.lineTo(Mt*yn-te*Fn,te*yn+Mt*Fn),Ee.lineTo(Mt*Xn-te*Pn,te*Xn+Mt*Pn),Ee.lineTo(Mt*En-te*Zn,te*En+Mt*Zn),Ee.lineTo(Mt*yn+te*Fn,Mt*Fn-te*yn),Ee.lineTo(Mt*Xn+te*Pn,Mt*Pn-te*Xn),Ee.lineTo(Mt*En+te*Zn,Mt*Zn-te*En),Ee.closePath()}},He=[ut,wt,Wt,se,de,Lt,Te];function Ge(){var Ee=P(ut),dr=P(64),Vr=null;function yn(){var Fn;if(Vr||(Vr=Fn=g.path()),Ee.apply(this,arguments).draw(Vr,+dr.apply(this,arguments)),Fn)return Vr=null,Fn+""||null}return yn.type=function(Fn){return arguments.length?(Ee=typeof Fn=="function"?Fn:P(Fn),yn):Ee},yn.size=function(Fn){return arguments.length?(dr=typeof Fn=="function"?Fn:P(+Fn),yn):dr},yn.context=function(Fn){return arguments.length?(Vr=Fn??null,yn):Vr},yn}function cr(){}function ur(Ee,dr,Vr){Ee._context.bezierCurveTo((2*Ee._x0+Ee._x1)/3,(2*Ee._y0+Ee._y1)/3,(Ee._x0+2*Ee._x1)/3,(Ee._y0+2*Ee._y1)/3,(Ee._x0+4*Ee._x1+dr)/6,(Ee._y0+4*Ee._y1+Vr)/6)}function jr(Ee){this._context=Ee}jr.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:ur(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(Ee,dr){switch(Ee=+Ee,dr=+dr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Ee,dr):this._context.moveTo(Ee,dr);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:ur(this,Ee,dr);break}this._x0=this._x1,this._x1=Ee,this._y0=this._y1,this._y1=dr}};function Hr(Ee){return new jr(Ee)}function br(Ee){this._context=Ee}br.prototype={areaStart:cr,areaEnd:cr,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(Ee,dr){switch(Ee=+Ee,dr=+dr,this._point){case 0:this._point=1,this._x2=Ee,this._y2=dr;break;case 1:this._point=2,this._x3=Ee,this._y3=dr;break;case 2:this._point=3,this._x4=Ee,this._y4=dr,this._context.moveTo((this._x0+4*this._x1+Ee)/6,(this._y0+4*this._y1+dr)/6);break;default:ur(this,Ee,dr);break}this._x0=this._x1,this._x1=Ee,this._y0=this._y1,this._y1=dr}};function Kr(Ee){return new br(Ee)}function rn(Ee){this._context=Ee}rn.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(Ee,dr){switch(Ee=+Ee,dr=+dr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var Vr=(this._x0+4*this._x1+Ee)/6,yn=(this._y0+4*this._y1+dr)/6;this._line?this._context.lineTo(Vr,yn):this._context.moveTo(Vr,yn);break;case 3:this._point=4;default:ur(this,Ee,dr);break}this._x0=this._x1,this._x1=Ee,this._y0=this._y1,this._y1=dr}};function Ce(Ee){return new rn(Ee)}function $t(Ee,dr){this._basis=new jr(Ee),this._beta=dr}$t.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var Ee=this._x,dr=this._y,Vr=Ee.length-1;if(Vr>0)for(var yn=Ee[0],Fn=dr[0],Xn=Ee[Vr]-yn,Pn=dr[Vr]-Fn,En=-1,Zn;++En<=Vr;)Zn=En/Vr,this._basis.point(this._beta*Ee[En]+(1-this._beta)*(yn+Zn*Xn),this._beta*dr[En]+(1-this._beta)*(Fn+Zn*Pn));this._x=this._y=null,this._basis.lineEnd()},point:function(Ee,dr){this._x.push(+Ee),this._y.push(+dr)}};var ne=function Ee(dr){function Vr(yn){return dr===1?new jr(yn):new $t(yn,dr)}return Vr.beta=function(yn){return Ee(+yn)},Vr}(.85);function Ct(Ee,dr,Vr){Ee._context.bezierCurveTo(Ee._x1+Ee._k*(Ee._x2-Ee._x0),Ee._y1+Ee._k*(Ee._y2-Ee._y0),Ee._x2+Ee._k*(Ee._x1-dr),Ee._y2+Ee._k*(Ee._y1-Vr),Ee._x2,Ee._y2)}function gt(Ee,dr){this._context=Ee,this._k=(1-dr)/6}gt.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:Ct(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Ee,dr){switch(Ee=+Ee,dr=+dr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Ee,dr):this._context.moveTo(Ee,dr);break;case 1:this._point=2,this._x1=Ee,this._y1=dr;break;case 2:this._point=3;default:Ct(this,Ee,dr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Ee,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var St=function Ee(dr){function Vr(yn){return new gt(yn,dr)}return Vr.tension=function(yn){return Ee(+yn)},Vr}(0);function Nt(Ee,dr){this._context=Ee,this._k=(1-dr)/6}Nt.prototype={areaStart:cr,areaEnd:cr,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(Ee,dr){switch(Ee=+Ee,dr=+dr,this._point){case 0:this._point=1,this._x3=Ee,this._y3=dr;break;case 1:this._point=2,this._context.moveTo(this._x4=Ee,this._y4=dr);break;case 2:this._point=3,this._x5=Ee,this._y5=dr;break;default:Ct(this,Ee,dr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Ee,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var ee=function Ee(dr){function Vr(yn){return new Nt(yn,dr)}return Vr.tension=function(yn){return Ee(+yn)},Vr}(0);function le(Ee,dr){this._context=Ee,this._k=(1-dr)/6}le.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(Ee,dr){switch(Ee=+Ee,dr=+dr,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:Ct(this,Ee,dr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Ee,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var we=function Ee(dr){function Vr(yn){return new le(yn,dr)}return Vr.tension=function(yn){return Ee(+yn)},Vr}(0);function Ue(Ee,dr,Vr){var yn=Ee._x1,Fn=Ee._y1,Xn=Ee._x2,Pn=Ee._y2;if(Ee._l01_a>i){var En=2*Ee._l01_2a+3*Ee._l01_a*Ee._l12_a+Ee._l12_2a,Zn=3*Ee._l01_a*(Ee._l01_a+Ee._l12_a);yn=(yn*En-Ee._x0*Ee._l12_2a+Ee._x2*Ee._l01_2a)/Zn,Fn=(Fn*En-Ee._y0*Ee._l12_2a+Ee._y2*Ee._l01_2a)/Zn}if(Ee._l23_a>i){var Ca=2*Ee._l23_2a+3*Ee._l23_a*Ee._l12_a+Ee._l12_2a,Ri=3*Ee._l23_a*(Ee._l23_a+Ee._l12_a);Xn=(Xn*Ca+Ee._x1*Ee._l23_2a-dr*Ee._l12_2a)/Ri,Pn=(Pn*Ca+Ee._y1*Ee._l23_2a-Vr*Ee._l12_2a)/Ri}Ee._context.bezierCurveTo(yn,Fn,Xn,Pn,Ee._x2,Ee._y2)}function qe(Ee,dr){this._context=Ee,this._alpha=dr}qe.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(Ee,dr){if(Ee=+Ee,dr=+dr,this._point){var Vr=this._x2-Ee,yn=this._y2-dr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Vr*Vr+yn*yn,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Ee,dr):this._context.moveTo(Ee,dr);break;case 1:this._point=2;break;case 2:this._point=3;default:Ue(this,Ee,dr);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=Ee,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var ar=function Ee(dr){function Vr(yn){return dr?new qe(yn,dr):new gt(yn,0)}return Vr.alpha=function(yn){return Ee(+yn)},Vr}(.5);function Ar(Ee,dr){this._context=Ee,this._alpha=dr}Ar.prototype={areaStart:cr,areaEnd:cr,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(Ee,dr){if(Ee=+Ee,dr=+dr,this._point){var Vr=this._x2-Ee,yn=this._y2-dr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Vr*Vr+yn*yn,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=Ee,this._y3=dr;break;case 1:this._point=2,this._context.moveTo(this._x4=Ee,this._y4=dr);break;case 2:this._point=3,this._x5=Ee,this._y5=dr;break;default:Ue(this,Ee,dr);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=Ee,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var Tr=function Ee(dr){function Vr(yn){return dr?new Ar(yn,dr):new Nt(yn,0)}return Vr.alpha=function(yn){return Ee(+yn)},Vr}(.5);function pr(Ee,dr){this._context=Ee,this._alpha=dr}pr.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(Ee,dr){if(Ee=+Ee,dr=+dr,this._point){var Vr=this._x2-Ee,yn=this._y2-dr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Vr*Vr+yn*yn,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:Ue(this,Ee,dr);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=Ee,this._y0=this._y1,this._y1=this._y2,this._y2=dr}};var Jr=function Ee(dr){function Vr(yn){return dr?new pr(yn,dr):new le(yn,0)}return Vr.alpha=function(yn){return Ee(+yn)},Vr}(.5);function Vn(Ee){this._context=Ee}Vn.prototype={areaStart:cr,areaEnd:cr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(Ee,dr){Ee=+Ee,dr=+dr,this._point?this._context.lineTo(Ee,dr):(this._point=1,this._context.moveTo(Ee,dr))}};function Hn(Ee){return new Vn(Ee)}function Kn(Ee){return Ee<0?-1:1}function Ci(Ee,dr,Vr){var yn=Ee._x1-Ee._x0,Fn=dr-Ee._x1,Xn=(Ee._y1-Ee._y0)/(yn||Fn<0&&-0),Pn=(Vr-Ee._y1)/(Fn||yn<0&&-0),En=(Xn*Fn+Pn*yn)/(yn+Fn);return(Kn(Xn)+Kn(Pn))*Math.min(Math.abs(Xn),Math.abs(Pn),.5*Math.abs(En))||0}function ii(Ee,dr){var Vr=Ee._x1-Ee._x0;return Vr?(3*(Ee._y1-Ee._y0)/Vr-dr)/2:dr}function qn(Ee,dr,Vr){var yn=Ee._x0,Fn=Ee._y0,Xn=Ee._x1,Pn=Ee._y1,En=(Xn-yn)/3;Ee._context.bezierCurveTo(yn+En,Fn+En*dr,Xn-En,Pn-En*Vr,Xn,Pn)}function oa(Ee){this._context=Ee}oa.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:qn(this,this._t0,ii(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Ee,dr){var Vr=NaN;if(Ee=+Ee,dr=+dr,!(Ee===this._x1&&dr===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Ee,dr):this._context.moveTo(Ee,dr);break;case 1:this._point=2;break;case 2:this._point=3,qn(this,ii(this,Vr=Ci(this,Ee,dr)),Vr);break;default:qn(this,this._t0,Vr=Ci(this,Ee,dr));break}this._x0=this._x1,this._x1=Ee,this._y0=this._y1,this._y1=dr,this._t0=Vr}}};function Hi(Ee){this._context=new We(Ee)}(Hi.prototype=Object.create(oa.prototype)).point=function(Ee,dr){oa.prototype.point.call(this,dr,Ee)};function We(Ee){this._context=Ee}We.prototype={moveTo:function(Ee,dr){this._context.moveTo(dr,Ee)},closePath:function(){this._context.closePath()},lineTo:function(Ee,dr){this._context.lineTo(dr,Ee)},bezierCurveTo:function(Ee,dr,Vr,yn,Fn,Xn){this._context.bezierCurveTo(dr,Ee,yn,Vr,Xn,Fn)}};function rr(Ee){return new oa(Ee)}function fr(Ee){return new Hi(Ee)}function xr(Ee){this._context=Ee}xr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var Ee=this._x,dr=this._y,Vr=Ee.length;if(Vr)if(this._line?this._context.lineTo(Ee[0],dr[0]):this._context.moveTo(Ee[0],dr[0]),Vr===2)this._context.lineTo(Ee[1],dr[1]);else for(var yn=Qr(Ee),Fn=Qr(dr),Xn=0,Pn=1;Pn<Vr;++Xn,++Pn)this._context.bezierCurveTo(yn[0][Xn],Fn[0][Xn],yn[1][Xn],Fn[1][Xn],Ee[Pn],dr[Pn]);(this._line||this._line!==0&&Vr===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(Ee,dr){this._x.push(+Ee),this._y.push(+dr)}};function Qr(Ee){var dr,Vr=Ee.length-1,yn,Fn=new Array(Vr),Xn=new Array(Vr),Pn=new Array(Vr);for(Fn[0]=0,Xn[0]=2,Pn[0]=Ee[0]+2*Ee[1],dr=1;dr<Vr-1;++dr)Fn[dr]=1,Xn[dr]=4,Pn[dr]=4*Ee[dr]+2*Ee[dr+1];for(Fn[Vr-1]=2,Xn[Vr-1]=7,Pn[Vr-1]=8*Ee[Vr-1]+Ee[Vr],dr=1;dr<Vr;++dr)yn=Fn[dr]/Xn[dr-1],Xn[dr]-=yn,Pn[dr]-=yn*Pn[dr-1];for(Fn[Vr-1]=Pn[Vr-1]/Xn[Vr-1],dr=Vr-2;dr>=0;--dr)Fn[dr]=(Pn[dr]-Fn[dr+1])/Xn[dr];for(Xn[Vr-1]=(Ee[Vr]+Fn[Vr-1])/2,dr=0;dr<Vr-1;++dr)Xn[dr]=2*Ee[dr+1]-Fn[dr+1];return[Fn,Xn]}function Cn(Ee){return new xr(Ee)}function wn(Ee,dr){this._context=Ee,this._t=dr}wn.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(Ee,dr){switch(Ee=+Ee,dr=+dr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Ee,dr):this._context.moveTo(Ee,dr);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,dr),this._context.lineTo(Ee,dr);else{var Vr=this._x*(1-this._t)+Ee*this._t;this._context.lineTo(Vr,this._y),this._context.lineTo(Vr,dr)}break}}this._x=Ee,this._y=dr}};function Mn(Ee){return new wn(Ee,.5)}function ci(Ee){return new wn(Ee,0)}function xi(Ee){return new wn(Ee,1)}function Pi(Ee,dr){if((Pn=Ee.length)>1)for(var Vr=1,yn,Fn,Xn=Ee[dr[0]],Pn,En=Xn.length;Vr<Pn;++Vr)for(Fn=Xn,Xn=Ee[dr[Vr]],yn=0;yn<En;++yn)Xn[yn][1]+=Xn[yn][0]=isNaN(Fn[yn][1])?Fn[yn][0]:Fn[yn][1]}function Di(Ee){for(var dr=Ee.length,Vr=new Array(dr);--dr>=0;)Vr[dr]=dr;return Vr}function Zi(Ee,dr){return Ee[dr]}function ui(){var Ee=P([]),dr=Di,Vr=Pi,yn=Zi;function Fn(Xn){var Pn=Ee.apply(this,arguments),En,Zn=Xn.length,Ca=Pn.length,Ri=new Array(Ca),Ja;for(En=0;En<Ca;++En){for(var Xa=Pn[En],Io=Ri[En]=new Array(Zn),po=0,Do;po<Zn;++po)Io[po]=Do=[0,+yn(Xn[po],Xa,po,Xn)],Do.data=Xn[po];Io.key=Xa}for(En=0,Ja=dr(Ri);En<Ca;++En)Ri[Ja[En]].index=En;return Vr(Ri,Ja),Ri}return Fn.keys=function(Xn){return arguments.length?(Ee=typeof Xn=="function"?Xn:P(pt.call(Xn)),Fn):Ee},Fn.value=function(Xn){return arguments.length?(yn=typeof Xn=="function"?Xn:P(+Xn),Fn):yn},Fn.order=function(Xn){return arguments.length?(dr=Xn==null?Di:typeof Xn=="function"?Xn:P(pt.call(Xn)),Fn):dr},Fn.offset=function(Xn){return arguments.length?(Vr=Xn??Pi,Fn):Vr},Fn}function Pa(Ee,dr){if((yn=Ee.length)>0){for(var Vr,yn,Fn=0,Xn=Ee[0].length,Pn;Fn<Xn;++Fn){for(Pn=Vr=0;Vr<yn;++Vr)Pn+=Ee[Vr][Fn][1]||0;if(Pn)for(Vr=0;Vr<yn;++Vr)Ee[Vr][Fn][1]/=Pn}Pi(Ee,dr)}}function Wa(Ee,dr){if((Zn=Ee.length)>0)for(var Vr,yn=0,Fn,Xn,Pn,En,Zn,Ca=Ee[dr[0]].length;yn<Ca;++yn)for(Pn=En=0,Vr=0;Vr<Zn;++Vr)(Xn=(Fn=Ee[dr[Vr]][yn])[1]-Fn[0])>0?(Fn[0]=Pn,Fn[1]=Pn+=Xn):Xn<0?(Fn[1]=En,Fn[0]=En+=Xn):(Fn[0]=0,Fn[1]=Xn)}function ze(Ee,dr){if((Fn=Ee.length)>0){for(var Vr=0,yn=Ee[dr[0]],Fn,Xn=yn.length;Vr<Xn;++Vr){for(var Pn=0,En=0;Pn<Fn;++Pn)En+=Ee[Pn][Vr][1]||0;yn[Vr][1]+=yn[Vr][0]=-En/2}Pi(Ee,dr)}}function Pe(Ee,dr){if(!(!((Pn=Ee.length)>0)||!((Xn=(Fn=Ee[dr[0]]).length)>0))){for(var Vr=0,yn=1,Fn,Xn,Pn;yn<Xn;++yn){for(var En=0,Zn=0,Ca=0;En<Pn;++En){for(var Ri=Ee[dr[En]],Ja=Ri[yn][1]||0,Xa=Ri[yn-1][1]||0,Io=(Ja-Xa)/2,po=0;po<En;++po){var Do=Ee[dr[po]],Ia=Do[yn][1]||0,gs=Do[yn-1][1]||0;Io+=Ia-gs}Zn+=Ja,Ca+=Io*Ja}Fn[yn-1][1]+=Fn[yn-1][0]=Vr,Zn&&(Vr-=Ca/Zn)}Fn[yn-1][1]+=Fn[yn-1][0]=Vr,Pi(Ee,dr)}}function Rr(Ee){var dr=Ee.map(qr);return Di(Ee).sort(function(Vr,yn){return dr[Vr]-dr[yn]})}function qr(Ee){for(var dr=-1,Vr=0,yn=Ee.length,Fn,Xn=-1/0;++dr<yn;)(Fn=+Ee[dr][1])>Xn&&(Xn=Fn,Vr=dr);return Vr}function $r(Ee){var dr=Ee.map(Br);return Di(Ee).sort(function(Vr,yn){return dr[Vr]-dr[yn]})}function Br(Ee){for(var dr=0,Vr=-1,yn=Ee.length,Fn;++Vr<yn;)(Fn=+Ee[Vr][1])&&(dr+=Fn);return dr}function Gr(Ee){return $r(Ee).reverse()}function dn(Ee){var dr=Ee.length,Vr,yn,Fn=Ee.map(Br),Xn=Rr(Ee),Pn=0,En=0,Zn=[],Ca=[];for(Vr=0;Vr<dr;++Vr)yn=Xn[Vr],Pn<En?(Pn+=Fn[yn],Zn.push(yn)):(En+=Fn[yn],Ca.push(yn));return Ca.reverse().concat(Zn)}function an(Ee){return Di(Ee).reverse()}c.arc=A,c.area=O,c.areaRadial=lt,c.curveBasis=Hr,c.curveBasisClosed=Kr,c.curveBasisOpen=Ce,c.curveBundle=ne,c.curveCardinal=St,c.curveCardinalClosed=ee,c.curveCardinalOpen=we,c.curveCatmullRom=ar,c.curveCatmullRomClosed=Tr,c.curveCatmullRomOpen=Jr,c.curveLinear=p,c.curveLinearClosed=Hn,c.curveMonotoneX=rr,c.curveMonotoneY=fr,c.curveNatural=Cn,c.curveStep=Mn,c.curveStepAfter=xi,c.curveStepBefore=ci,c.line=R,c.lineRadial=X,c.linkHorizontal=it,c.linkRadial=ft,c.linkVertical=Y,c.pie=H,c.pointRadial=yt,c.radialArea=lt,c.radialLine=X,c.stack=ui,c.stackOffsetDiverging=Wa,c.stackOffsetExpand=Pa,c.stackOffsetNone=Pi,c.stackOffsetSilhouette=ze,c.stackOffsetWiggle=Pe,c.stackOrderAppearance=Rr,c.stackOrderAscending=$r,c.stackOrderDescending=Gr,c.stackOrderInsideOut=dn,c.stackOrderNone=Di,c.stackOrderReverse=an,c.symbol=Ge,c.symbolCircle=ut,c.symbolCross=wt,c.symbolDiamond=Wt,c.symbolSquare=se,c.symbolStar=de,c.symbolTriangle=Lt,c.symbolWye=Te,c.symbols=He,Object.defineProperty(c,"__esModule",{value:!0})})}),QW=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q,y3(),xT(),kE()):g(c.d3=c.d3||{},c.d3,c.d3,c.d3)})(Q,function(c,g,P,S){function t(p){return p.target.depth}function e(p){return p.depth}function r(p,k){return k-1-p.height}function a(p,k){return p.sourceLinks.length?p.depth:k-1}function n(p){return p.targetLinks.length?p.depth:p.sourceLinks.length?g.min(p.sourceLinks,t)-1:0}function o(p){return function(){return p}}function i(p,k){return f(p.source,k.source)||p.index-k.index}function s(p,k){return f(p.target,k.target)||p.index-k.index}function f(p,k){return p.y0-k.y0}function x(p){return p.value}function y(p){return(p.y0+p.y1)/2}function v(p){return y(p.source)*p.value}function T(p){return y(p.target)*p.value}function u(p){return p.index}function b(p){return p.nodes}function _(p){return p.links}function C(p,k){var w=p.get(k);if(!w)throw new Error("missing: "+k);return w}var M=function(){var p=0,k=0,w=1,R=1,O=24,N=8,V=u,H=a,F=b,U=_,W=32,q=2/3;function X(){var dt={nodes:F.apply(null,arguments),links:U.apply(null,arguments)};return lt(dt),yt(dt),pt(dt),st(dt),tt(dt),dt}X.update=function(dt){return tt(dt),dt},X.nodeId=function(dt){return arguments.length?(V=typeof dt=="function"?dt:o(dt),X):V},X.nodeAlign=function(dt){return arguments.length?(H=typeof dt=="function"?dt:o(dt),X):H},X.nodeWidth=function(dt){return arguments.length?(O=+dt,X):O},X.nodePadding=function(dt){return arguments.length?(N=+dt,X):N},X.nodes=function(dt){return arguments.length?(F=typeof dt=="function"?dt:o(dt),X):F},X.links=function(dt){return arguments.length?(U=typeof dt=="function"?dt:o(dt),X):U},X.size=function(dt){return arguments.length?(p=k=0,w=+dt[0],R=+dt[1],X):[w-p,R-k]},X.extent=function(dt){return arguments.length?(p=+dt[0][0],w=+dt[1][0],k=+dt[0][1],R=+dt[1][1],X):[[p,k],[w,R]]},X.iterations=function(dt){return arguments.length?(W=+dt,X):W};function lt(dt){dt.nodes.forEach(function(at,vt){at.index=vt,at.sourceLinks=[],at.targetLinks=[]});var rt=P.map(dt.nodes,V);dt.links.forEach(function(at,vt){at.index=vt;var it=at.source,Y=at.target;typeof it!="object"&&(it=at.source=C(rt,it)),typeof Y!="object"&&(Y=at.target=C(rt,Y)),it.sourceLinks.push(at),Y.targetLinks.push(at)})}function yt(dt){dt.nodes.forEach(function(rt){rt.value=Math.max(g.sum(rt.sourceLinks,x),g.sum(rt.targetLinks,x))})}function pt(dt){var rt,at,vt;for(rt=dt.nodes,at=[],vt=0;rt.length;++vt,rt=at,at=[])rt.forEach(function(Y){Y.depth=vt,Y.sourceLinks.forEach(function(ft){at.indexOf(ft.target)<0&&at.push(ft.target)})});for(rt=dt.nodes,at=[],vt=0;rt.length;++vt,rt=at,at=[])rt.forEach(function(Y){Y.height=vt,Y.targetLinks.forEach(function(ft){at.indexOf(ft.source)<0&&at.push(ft.source)})});var it=(w-p-O)/(vt-1);dt.nodes.forEach(function(Y){Y.x1=(Y.x0=p+Math.max(0,Math.min(vt-1,Math.floor(H.call(null,Y,vt))))*it)+O})}function st(dt){var rt=P.nest().key(function(wt){return wt.x0}).sortKeys(g.ascending).entries(dt.nodes).map(function(wt){return wt.values});it(),ut();for(var at=1,vt=W;vt>0;--vt)ft(at*=.99),ut(),Y(at),ut();function it(){var wt=g.max(rt,function(Wt){return Wt.length}),zt=q*(R-k)/(wt-1);N>zt&&(N=zt);var Pt=g.min(rt,function(Wt){return(R-k-(Wt.length-1)*N)/g.sum(Wt,x)});rt.forEach(function(Wt){Wt.forEach(function(Ht,Jt){Ht.y1=(Ht.y0=Jt)+Ht.value*Pt})}),dt.links.forEach(function(Wt){Wt.width=Wt.value*Pt})}function Y(wt){rt.forEach(function(zt){zt.forEach(function(Pt){if(Pt.targetLinks.length){var Wt=(g.sum(Pt.targetLinks,v)/g.sum(Pt.targetLinks,x)-y(Pt))*wt;Pt.y0+=Wt,Pt.y1+=Wt}})})}function ft(wt){rt.slice().reverse().forEach(function(zt){zt.forEach(function(Pt){if(Pt.sourceLinks.length){var Wt=(g.sum(Pt.sourceLinks,T)/g.sum(Pt.sourceLinks,x)-y(Pt))*wt;Pt.y0+=Wt,Pt.y1+=Wt}})})}function ut(){rt.forEach(function(wt){var zt,Pt,Wt=k,Ht=wt.length,Jt;for(wt.sort(f),Jt=0;Jt<Ht;++Jt)zt=wt[Jt],Pt=Wt-zt.y0,Pt>0&&(zt.y0+=Pt,zt.y1+=Pt),Wt=zt.y1+N;if(Pt=Wt-N-R,Pt>0)for(Wt=zt.y0-=Pt,zt.y1-=Pt,Jt=Ht-2;Jt>=0;--Jt)zt=wt[Jt],Pt=zt.y1+N-Wt,Pt>0&&(zt.y0-=Pt,zt.y1-=Pt),Wt=zt.y0})}}function tt(dt){dt.nodes.forEach(function(rt){rt.sourceLinks.sort(s),rt.targetLinks.sort(i)}),dt.nodes.forEach(function(rt){var at=rt.y0,vt=at;rt.sourceLinks.forEach(function(it){it.y0=at+it.width/2,at+=it.width}),rt.targetLinks.forEach(function(it){it.y1=vt+it.width/2,vt+=it.width})})}return X};function E(p){return[p.source.x1,p.y0]}function A(p){return[p.target.x0,p.y1]}var h=function(){return S.linkHorizontal().source(E).target(A)};c.sankey=M,c.sankeyCenter=n,c.sankeyLeft=e,c.sankeyRight=r,c.sankeyJustify=a,c.sankeyLinkHorizontal=h,Object.defineProperty(c,"__esModule",{value:!0})})}),tq=Ft((Q,$)=>{var c=wE();$.exports=function(g,P){var S=[],t=[],e=[],r={},a=[],n;function o(_){e[_]=!1,r.hasOwnProperty(_)&&Object.keys(r[_]).forEach(function(C){delete r[_][C],e[C]&&o(C)})}function i(_){var C=!1;t.push(_),e[_]=!0;var M,E;for(M=0;M<a[_].length;M++)E=a[_][M],E===n?(s(n,t),C=!0):e[E]||(C=i(E));if(C)o(_);else for(M=0;M<a[_].length;M++){E=a[_][M];var A=r[E];A||(A={},r[E]=A),A[E]=!0}return t.pop(),C}function s(_,C){var M=[].concat(C).concat(_);P?P(i):S.push(M)}function f(_){for(var C=0;C<g.length;C++)C<_&&(g[C]=[]),g[C]=g[C].filter(function(M){return M>=_})}function x(_){f(_);for(var C=g,M=c(C),E=M.components.filter(function(O){return O.length>1}),A=1/0,h,p=0;p<E.length;p++)for(var k=0;k<E[p].length;k++)E[p][k]<A&&(A=E[p][k],h=p);var w=E[h];if(!w)return!1;var R=g.map(function(O,N){return w.indexOf(N)===-1?[]:O.filter(function(V){return w.indexOf(V)!==-1})});return{leastVertex:A,adjList:R}}n=0;for(var y=g.length;n<y;){var v=x(n);if(n=v.leastVertex,a=v.adjList,a){for(var T=0;T<a.length;T++)for(var u=0;u<a[T].length;u++){var b=a[T][u];e[+b]=!1,r[b]={}}i(n),n=n+1}else n=y}if(!P)return S}}),eq=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q,y3(),xT(),kE(),tq()):g(c.d3=c.d3||{},c.d3,c.d3,c.d3,null)})(Q,function(c,g,P,S,t){t=t&&t.hasOwnProperty("default")?t.default:t;function e(Ht){return Ht.target.depth}function r(Ht){return Ht.depth}function a(Ht,Jt){return Jt-1-Ht.height}function n(Ht,Jt){return Ht.sourceLinks.length?Ht.depth:Jt-1}function o(Ht){return Ht.targetLinks.length?Ht.depth:Ht.sourceLinks.length?g.min(Ht.sourceLinks,e)-1:0}function i(Ht){return function(){return Ht}}var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ht){return typeof Ht}:function(Ht){return Ht&&typeof Symbol=="function"&&Ht.constructor===Symbol&&Ht!==Symbol.prototype?"symbol":typeof Ht};function f(Ht,Jt){return y(Ht.source,Jt.source)||Ht.index-Jt.index}function x(Ht,Jt){return y(Ht.target,Jt.target)||Ht.index-Jt.index}function y(Ht,Jt){return Ht.partOfCycle===Jt.partOfCycle?Ht.y0-Jt.y0:Ht.circularLinkType==="top"||Jt.circularLinkType==="bottom"?-1:1}function v(Ht){return Ht.value}function T(Ht){return(Ht.y0+Ht.y1)/2}function u(Ht){return T(Ht.source)}function b(Ht){return T(Ht.target)}function _(Ht){return Ht.index}function C(Ht){return Ht.nodes}function M(Ht){return Ht.links}function E(Ht,Jt){var ge=Ht.get(Jt);if(!ge)throw new Error("missing: "+Jt);return ge}function A(Ht,Jt){return Jt(Ht)}var h=25,p=10,k=.3;function w(){var Ht=0,Jt=0,ge=1,he=1,de=24,se,Tt=_,Lt=n,Mt=C,te=M,ve=32,oe=2,Te,He=null;function Ge(){var Ce={nodes:Mt.apply(null,arguments),links:te.apply(null,arguments)};cr(Ce),R(Ce,Tt,He),ur(Ce),br(Ce),O(Ce,Tt),Kr(Ce,ve,Tt),rn(Ce);for(var $t=4,ne=0;ne<$t;ne++)ft(Ce,he,Tt),ut(Ce,he,Tt),vt(Ce,Jt,he,Tt),ft(Ce,he,Tt),ut(Ce,he,Tt);return Wt(Ce,Jt,he),W(Ce,oe,he,Tt),Ce}Ge.nodeId=function(Ce){return arguments.length?(Tt=typeof Ce=="function"?Ce:i(Ce),Ge):Tt},Ge.nodeAlign=function(Ce){return arguments.length?(Lt=typeof Ce=="function"?Ce:i(Ce),Ge):Lt},Ge.nodeWidth=function(Ce){return arguments.length?(de=+Ce,Ge):de},Ge.nodePadding=function(Ce){return arguments.length?(se=+Ce,Ge):se},Ge.nodes=function(Ce){return arguments.length?(Mt=typeof Ce=="function"?Ce:i(Ce),Ge):Mt},Ge.links=function(Ce){return arguments.length?(te=typeof Ce=="function"?Ce:i(Ce),Ge):te},Ge.size=function(Ce){return arguments.length?(Ht=Jt=0,ge=+Ce[0],he=+Ce[1],Ge):[ge-Ht,he-Jt]},Ge.extent=function(Ce){return arguments.length?(Ht=+Ce[0][0],ge=+Ce[1][0],Jt=+Ce[0][1],he=+Ce[1][1],Ge):[[Ht,Jt],[ge,he]]},Ge.iterations=function(Ce){return arguments.length?(ve=+Ce,Ge):ve},Ge.circularLinkGap=function(Ce){return arguments.length?(oe=+Ce,Ge):oe},Ge.nodePaddingRatio=function(Ce){return arguments.length?(Te=+Ce,Ge):Te},Ge.sortNodes=function(Ce){return arguments.length?(He=Ce,Ge):He},Ge.update=function(Ce){return O(Ce,Tt),rn(Ce),Ce.links.forEach(function($t){$t.circular&&($t.circularLinkType=$t.y0+$t.y1<he?"top":"bottom",$t.source.circularLinkType=$t.circularLinkType,$t.target.circularLinkType=$t.circularLinkType)}),ft(Ce,he,Tt,!1),ut(Ce,he,Tt),W(Ce,oe,he,Tt),Ce};function cr(Ce){Ce.nodes.forEach(function(ne,Ct){ne.index=Ct,ne.sourceLinks=[],ne.targetLinks=[]});var $t=P.map(Ce.nodes,Tt);return Ce.links.forEach(function(ne,Ct){ne.index=Ct;var gt=ne.source,St=ne.target;(typeof gt>"u"?"undefined":s(gt))!=="object"&&(gt=ne.source=E($t,gt)),(typeof St>"u"?"undefined":s(St))!=="object"&&(St=ne.target=E($t,St)),gt.sourceLinks.push(ne),St.targetLinks.push(ne)}),Ce}function ur(Ce){Ce.nodes.forEach(function($t){$t.partOfCycle=!1,$t.value=Math.max(g.sum($t.sourceLinks,v),g.sum($t.targetLinks,v)),$t.sourceLinks.forEach(function(ne){ne.circular&&($t.partOfCycle=!0,$t.circularLinkType=ne.circularLinkType)}),$t.targetLinks.forEach(function(ne){ne.circular&&($t.partOfCycle=!0,$t.circularLinkType=ne.circularLinkType)})})}function jr(Ce){var $t=0,ne=0,Ct=0,gt=0,St=g.max(Ce.nodes,function(Nt){return Nt.column});return Ce.links.forEach(function(Nt){Nt.circular&&(Nt.circularLinkType=="top"?$t=$t+Nt.width:ne=ne+Nt.width,Nt.target.column==0&&(gt=gt+Nt.width),Nt.source.column==St&&(Ct=Ct+Nt.width))}),$t=$t>0?$t+h+p:$t,ne=ne>0?ne+h+p:ne,Ct=Ct>0?Ct+h+p:Ct,gt=gt>0?gt+h+p:gt,{top:$t,bottom:ne,left:gt,right:Ct}}function Hr(Ce,$t){var ne=g.max(Ce.nodes,function(we){return we.column}),Ct=ge-Ht,gt=he-Jt,St=Ct+$t.right+$t.left,Nt=gt+$t.top+$t.bottom,ee=Ct/St,le=gt/Nt;return Ht=Ht*ee+$t.left,ge=$t.right==0?ge:ge*ee,Jt=Jt*le+$t.top,he=he*le,Ce.nodes.forEach(function(we){we.x0=Ht+we.column*((ge-Ht-de)/ne),we.x1=we.x0+de}),le}function br(Ce){var $t,ne,Ct;for($t=Ce.nodes,ne=[],Ct=0;$t.length;++Ct,$t=ne,ne=[])$t.forEach(function(gt){gt.depth=Ct,gt.sourceLinks.forEach(function(St){ne.indexOf(St.target)<0&&!St.circular&&ne.push(St.target)})});for($t=Ce.nodes,ne=[],Ct=0;$t.length;++Ct,$t=ne,ne=[])$t.forEach(function(gt){gt.height=Ct,gt.targetLinks.forEach(function(St){ne.indexOf(St.source)<0&&!St.circular&&ne.push(St.source)})});Ce.nodes.forEach(function(gt){gt.column=Math.floor(Lt.call(null,gt,Ct))})}function Kr(Ce,$t,ne){var Ct=P.nest().key(function(we){return we.column}).sortKeys(g.ascending).entries(Ce.nodes).map(function(we){return we.values});Nt(ne),le();for(var gt=1,St=$t;St>0;--St)ee(gt*=.99,ne),le();function Nt(we){if(Te){var Ue=1/0;Ct.forEach(function(Tr){var pr=he*Te/(Tr.length+1);Ue=pr<Ue?pr:Ue}),se=Ue}var qe=g.min(Ct,function(Tr){return(he-Jt-(Tr.length-1)*se)/g.sum(Tr,v)});qe=qe*k,Ce.links.forEach(function(Tr){Tr.width=Tr.value*qe});var ar=jr(Ce),Ar=Hr(Ce,ar);qe=qe*Ar,Ce.links.forEach(function(Tr){Tr.width=Tr.value*qe}),Ct.forEach(function(Tr){var pr=Tr.length;Tr.forEach(function(Jr,Vn){Jr.depth==Ct.length-1&&pr==1||Jr.depth==0&&pr==1?(Jr.y0=he/2-Jr.value*qe,Jr.y1=Jr.y0+Jr.value*qe):Jr.partOfCycle?H(Jr,we)==0?(Jr.y0=he/2+Vn,Jr.y1=Jr.y0+Jr.value*qe):Jr.circularLinkType=="top"?(Jr.y0=Jt+Vn,Jr.y1=Jr.y0+Jr.value*qe):(Jr.y0=he-Jr.value*qe-Vn,Jr.y1=Jr.y0+Jr.value*qe):ar.top==0||ar.bottom==0?(Jr.y0=(he-Jt)/pr*Vn,Jr.y1=Jr.y0+Jr.value*qe):(Jr.y0=(he-Jt)/2-pr/2+Vn,Jr.y1=Jr.y0+Jr.value*qe)})})}function ee(we,Ue){var qe=Ct.length;Ct.forEach(function(ar){var Ar=ar.length,Tr=ar[0].depth;ar.forEach(function(pr){var Jr;if((pr.sourceLinks.length||pr.targetLinks.length)&&!(pr.partOfCycle&&H(pr,Ue)>0))if(Tr==0&&Ar==1)Jr=pr.y1-pr.y0,pr.y0=he/2-Jr/2,pr.y1=he/2+Jr/2;else if(Tr==qe-1&&Ar==1)Jr=pr.y1-pr.y0,pr.y0=he/2-Jr/2,pr.y1=he/2+Jr/2;else{var Vn=0,Hn=g.mean(pr.sourceLinks,b),Kn=g.mean(pr.targetLinks,u);Hn&&Kn?Vn=(Hn+Kn)/2:Vn=Hn||Kn;var Ci=(Vn-T(pr))*we;pr.y0+=Ci,pr.y1+=Ci}})})}function le(){Ct.forEach(function(we){var Ue,qe,ar=Jt,Ar=we.length,Tr;for(we.sort(y),Tr=0;Tr<Ar;++Tr)Ue=we[Tr],qe=ar-Ue.y0,qe>0&&(Ue.y0+=qe,Ue.y1+=qe),ar=Ue.y1+se;if(qe=ar-se-he,qe>0)for(ar=Ue.y0-=qe,Ue.y1-=qe,Tr=Ar-2;Tr>=0;--Tr)Ue=we[Tr],qe=Ue.y1+se-ar,qe>0&&(Ue.y0-=qe,Ue.y1-=qe),ar=Ue.y0})}}function rn(Ce){Ce.nodes.forEach(function($t){$t.sourceLinks.sort(x),$t.targetLinks.sort(f)}),Ce.nodes.forEach(function($t){var ne=$t.y0,Ct=ne,gt=$t.y1,St=gt;$t.sourceLinks.forEach(function(Nt){Nt.circular?(Nt.y0=gt-Nt.width/2,gt=gt-Nt.width):(Nt.y0=ne+Nt.width/2,ne+=Nt.width)}),$t.targetLinks.forEach(function(Nt){Nt.circular?(Nt.y1=St-Nt.width/2,St=St-Nt.width):(Nt.y1=Ct+Nt.width/2,Ct+=Nt.width)})})}return Ge}function R(Ht,Jt,ge){var he=0;if(ge===null){for(var de=[],se=0;se<Ht.links.length;se++){var Tt=Ht.links[se],Lt=Tt.source.index,Mt=Tt.target.index;de[Lt]||(de[Lt]=[]),de[Mt]||(de[Mt]=[]),de[Lt].indexOf(Mt)===-1&&de[Lt].push(Mt)}var te=t(de);te.sort(function(He,Ge){return He.length-Ge.length});var ve={};for(se=0;se<te.length;se++){var oe=te[se],Te=oe.slice(-2);ve[Te[0]]||(ve[Te[0]]={}),ve[Te[0]][Te[1]]=!0}Ht.links.forEach(function(He){var Ge=He.target.index,cr=He.source.index;Ge===cr||ve[cr]&&ve[cr][Ge]?(He.circular=!0,He.circularLinkID=he,he=he+1):He.circular=!1})}else Ht.links.forEach(function(He){He.source[ge]<He.target[ge]?He.circular=!1:(He.circular=!0,He.circularLinkID=he,he=he+1)})}function O(Ht,Jt){var ge=0,he=0;Ht.links.forEach(function(de){de.circular&&(de.source.circularLinkType||de.target.circularLinkType?de.circularLinkType=de.source.circularLinkType?de.source.circularLinkType:de.target.circularLinkType:de.circularLinkType=ge<he?"top":"bottom",de.circularLinkType=="top"?ge=ge+1:he=he+1,Ht.nodes.forEach(function(se){(A(se,Jt)==A(de.source,Jt)||A(se,Jt)==A(de.target,Jt))&&(se.circularLinkType=de.circularLinkType)}))}),Ht.links.forEach(function(de){de.circular&&(de.source.circularLinkType==de.target.circularLinkType&&(de.circularLinkType=de.source.circularLinkType),Pt(de,Jt)&&(de.circularLinkType=de.source.circularLinkType))})}function N(Ht){var Jt=Math.abs(Ht.y1-Ht.y0),ge=Math.abs(Ht.target.x0-Ht.source.x1);return Math.atan(ge/Jt)}function V(Ht,Jt){return Ht.source.column<Jt.target.column?!1:!(Ht.target.column>Jt.source.column)}function H(Ht,Jt){var ge=0;Ht.sourceLinks.forEach(function(de){ge=de.circular&&!Pt(de,Jt)?ge+1:ge});var he=0;return Ht.targetLinks.forEach(function(de){he=de.circular&&!Pt(de,Jt)?he+1:he}),ge+he}function F(Ht){var Jt=Ht.source.sourceLinks,ge=0;Jt.forEach(function(se){ge=se.circular?ge+1:ge});var he=Ht.target.targetLinks,de=0;return he.forEach(function(se){de=se.circular?de+1:de}),!(ge>1||de>1)}function U(Ht,Jt,ge){return Ht.sort(X),Ht.forEach(function(he,de){var se=0;if(Pt(he,ge)&&F(he))he.circularPathData.verticalBuffer=se+he.width/2;else{var Tt=0;for(Tt;Tt<de;Tt++)if(V(Ht[de],Ht[Tt])){var Lt=Ht[Tt].circularPathData.verticalBuffer+Ht[Tt].width/2+Jt;se=Lt>se?Lt:se}he.circularPathData.verticalBuffer=se+he.width/2}}),Ht}function W(Ht,Jt,ge,he){var de=5,se=g.min(Ht.links,function(Mt){return Mt.source.y0});Ht.links.forEach(function(Mt){Mt.circular&&(Mt.circularPathData={})});var Tt=Ht.links.filter(function(Mt){return Mt.circularLinkType=="top"});U(Tt,Jt,he);var Lt=Ht.links.filter(function(Mt){return Mt.circularLinkType=="bottom"});U(Lt,Jt,he),Ht.links.forEach(function(Mt){if(Mt.circular){if(Mt.circularPathData.arcRadius=Mt.width+p,Mt.circularPathData.leftNodeBuffer=de,Mt.circularPathData.rightNodeBuffer=de,Mt.circularPathData.sourceWidth=Mt.source.x1-Mt.source.x0,Mt.circularPathData.sourceX=Mt.source.x0+Mt.circularPathData.sourceWidth,Mt.circularPathData.targetX=Mt.target.x0,Mt.circularPathData.sourceY=Mt.y0,Mt.circularPathData.targetY=Mt.y1,Pt(Mt,he)&&F(Mt))Mt.circularPathData.leftSmallArcRadius=p+Mt.width/2,Mt.circularPathData.leftLargeArcRadius=p+Mt.width/2,Mt.circularPathData.rightSmallArcRadius=p+Mt.width/2,Mt.circularPathData.rightLargeArcRadius=p+Mt.width/2,Mt.circularLinkType=="bottom"?(Mt.circularPathData.verticalFullExtent=Mt.source.y1+h+Mt.circularPathData.verticalBuffer,Mt.circularPathData.verticalLeftInnerExtent=Mt.circularPathData.verticalFullExtent-Mt.circularPathData.leftLargeArcRadius,Mt.circularPathData.verticalRightInnerExtent=Mt.circularPathData.verticalFullExtent-Mt.circularPathData.rightLargeArcRadius):(Mt.circularPathData.verticalFullExtent=Mt.source.y0-h-Mt.circularPathData.verticalBuffer,Mt.circularPathData.verticalLeftInnerExtent=Mt.circularPathData.verticalFullExtent+Mt.circularPathData.leftLargeArcRadius,Mt.circularPathData.verticalRightInnerExtent=Mt.circularPathData.verticalFullExtent+Mt.circularPathData.rightLargeArcRadius);else{var te=Mt.source.column,ve=Mt.circularLinkType,oe=Ht.links.filter(function(Ge){return Ge.source.column==te&&Ge.circularLinkType==ve});Mt.circularLinkType=="bottom"?oe.sort(yt):oe.sort(lt);var Te=0;oe.forEach(function(Ge,cr){Ge.circularLinkID==Mt.circularLinkID&&(Mt.circularPathData.leftSmallArcRadius=p+Mt.width/2+Te,Mt.circularPathData.leftLargeArcRadius=p+Mt.width/2+cr*Jt+Te),Te=Te+Ge.width}),te=Mt.target.column,oe=Ht.links.filter(function(Ge){return Ge.target.column==te&&Ge.circularLinkType==ve}),Mt.circularLinkType=="bottom"?oe.sort(st):oe.sort(pt),Te=0,oe.forEach(function(Ge,cr){Ge.circularLinkID==Mt.circularLinkID&&(Mt.circularPathData.rightSmallArcRadius=p+Mt.width/2+Te,Mt.circularPathData.rightLargeArcRadius=p+Mt.width/2+cr*Jt+Te),Te=Te+Ge.width}),Mt.circularLinkType=="bottom"?(Mt.circularPathData.verticalFullExtent=Math.max(ge,Mt.source.y1,Mt.target.y1)+h+Mt.circularPathData.verticalBuffer,Mt.circularPathData.verticalLeftInnerExtent=Mt.circularPathData.verticalFullExtent-Mt.circularPathData.leftLargeArcRadius,Mt.circularPathData.verticalRightInnerExtent=Mt.circularPathData.verticalFullExtent-Mt.circularPathData.rightLargeArcRadius):(Mt.circularPathData.verticalFullExtent=se-h-Mt.circularPathData.verticalBuffer,Mt.circularPathData.verticalLeftInnerExtent=Mt.circularPathData.verticalFullExtent+Mt.circularPathData.leftLargeArcRadius,Mt.circularPathData.verticalRightInnerExtent=Mt.circularPathData.verticalFullExtent+Mt.circularPathData.rightLargeArcRadius)}Mt.circularPathData.leftInnerExtent=Mt.circularPathData.sourceX+Mt.circularPathData.leftNodeBuffer,Mt.circularPathData.rightInnerExtent=Mt.circularPathData.targetX-Mt.circularPathData.rightNodeBuffer,Mt.circularPathData.leftFullExtent=Mt.circularPathData.sourceX+Mt.circularPathData.leftLargeArcRadius+Mt.circularPathData.leftNodeBuffer,Mt.circularPathData.rightFullExtent=Mt.circularPathData.targetX-Mt.circularPathData.rightLargeArcRadius-Mt.circularPathData.rightNodeBuffer}if(Mt.circular)Mt.path=q(Mt);else{var He=S.linkHorizontal().source(function(Ge){var cr=Ge.source.x0+(Ge.source.x1-Ge.source.x0),ur=Ge.y0;return[cr,ur]}).target(function(Ge){var cr=Ge.target.x0,ur=Ge.y1;return[cr,ur]});Mt.path=He(Mt)}})}function q(Ht){var Jt="";return Ht.circularLinkType=="top"?Jt="M"+Ht.circularPathData.sourceX+" "+Ht.circularPathData.sourceY+" L"+Ht.circularPathData.leftInnerExtent+" "+Ht.circularPathData.sourceY+" A"+Ht.circularPathData.leftLargeArcRadius+" "+Ht.circularPathData.leftSmallArcRadius+" 0 0 0 "+Ht.circularPathData.leftFullExtent+" "+(Ht.circularPathData.sourceY-Ht.circularPathData.leftSmallArcRadius)+" L"+Ht.circularPathData.leftFullExtent+" "+Ht.circularPathData.verticalLeftInnerExtent+" A"+Ht.circularPathData.leftLargeArcRadius+" "+Ht.circularPathData.leftLargeArcRadius+" 0 0 0 "+Ht.circularPathData.leftInnerExtent+" "+Ht.circularPathData.verticalFullExtent+" L"+Ht.circularPathData.rightInnerExtent+" "+Ht.circularPathData.verticalFullExtent+" A"+Ht.circularPathData.rightLargeArcRadius+" "+Ht.circularPathData.rightLargeArcRadius+" 0 0 0 "+Ht.circularPathData.rightFullExtent+" "+Ht.circularPathData.verticalRightInnerExtent+" L"+Ht.circularPathData.rightFullExtent+" "+(Ht.circularPathData.targetY-Ht.circularPathData.rightSmallArcRadius)+" A"+Ht.circularPathData.rightLargeArcRadius+" "+Ht.circularPathData.rightSmallArcRadius+" 0 0 0 "+Ht.circularPathData.rightInnerExtent+" "+Ht.circularPathData.targetY+" L"+Ht.circularPathData.targetX+" "+Ht.circularPathData.targetY:Jt="M"+Ht.circularPathData.sourceX+" "+Ht.circularPathData.sourceY+" L"+Ht.circularPathData.leftInnerExtent+" "+Ht.circularPathData.sourceY+" A"+Ht.circularPathData.leftLargeArcRadius+" "+Ht.circularPathData.leftSmallArcRadius+" 0 0 1 "+Ht.circularPathData.leftFullExtent+" "+(Ht.circularPathData.sourceY+Ht.circularPathData.leftSmallArcRadius)+" L"+Ht.circularPathData.leftFullExtent+" "+Ht.circularPathData.verticalLeftInnerExtent+" A"+Ht.circularPathData.leftLargeArcRadius+" "+Ht.circularPathData.leftLargeArcRadius+" 0 0 1 "+Ht.circularPathData.leftInnerExtent+" "+Ht.circularPathData.verticalFullExtent+" L"+Ht.circularPathData.rightInnerExtent+" "+Ht.circularPathData.verticalFullExtent+" A"+Ht.circularPathData.rightLargeArcRadius+" "+Ht.circularPathData.rightLargeArcRadius+" 0 0 1 "+Ht.circularPathData.rightFullExtent+" "+Ht.circularPathData.verticalRightInnerExtent+" L"+Ht.circularPathData.rightFullExtent+" "+(Ht.circularPathData.targetY+Ht.circularPathData.rightSmallArcRadius)+" A"+Ht.circularPathData.rightLargeArcRadius+" "+Ht.circularPathData.rightSmallArcRadius+" 0 0 1 "+Ht.circularPathData.rightInnerExtent+" "+Ht.circularPathData.targetY+" L"+Ht.circularPathData.targetX+" "+Ht.circularPathData.targetY,Jt}function X(Ht,Jt){return tt(Ht)==tt(Jt)?Ht.circularLinkType=="bottom"?yt(Ht,Jt):lt(Ht,Jt):tt(Jt)-tt(Ht)}function lt(Ht,Jt){return Ht.y0-Jt.y0}function yt(Ht,Jt){return Jt.y0-Ht.y0}function pt(Ht,Jt){return Ht.y1-Jt.y1}function st(Ht,Jt){return Jt.y1-Ht.y1}function tt(Ht){return Ht.target.column-Ht.source.column}function dt(Ht){return Ht.target.x0-Ht.source.x1}function rt(Ht,Jt){var ge=N(Ht),he=dt(Jt)/Math.tan(ge),de=zt(Ht)=="up"?Ht.y1+he:Ht.y1-he;return de}function at(Ht,Jt){var ge=N(Ht),he=dt(Jt)/Math.tan(ge),de=zt(Ht)=="up"?Ht.y1-he:Ht.y1+he;return de}function vt(Ht,Jt,ge,he){Ht.links.forEach(function(de){if(!de.circular&&de.target.column-de.source.column>1){var se=de.source.column+1,Tt=de.target.column-1,Lt=1,Mt=Tt-se+1;for(Lt=1;se<=Tt;se++,Lt++)Ht.nodes.forEach(function(te){if(te.column==se){var ve=Lt/(Mt+1),oe=Math.pow(1-ve,3),Te=3*ve*Math.pow(1-ve,2),He=3*Math.pow(ve,2)*(1-ve),Ge=Math.pow(ve,3),cr=oe*de.y0+Te*de.y0+He*de.y1+Ge*de.y1,ur=cr-de.width/2,jr=cr+de.width/2,Hr;ur>te.y0&&ur<te.y1?(Hr=te.y1-ur+10,Hr=te.circularLinkType=="bottom"?Hr:-Hr,te=Y(te,Hr,Jt,ge),Ht.nodes.forEach(function(br){A(br,he)==A(te,he)||br.column!=te.column||it(te,br)&&Y(br,Hr,Jt,ge)})):jr>te.y0&&jr<te.y1?(Hr=jr-te.y0+10,te=Y(te,Hr,Jt,ge),Ht.nodes.forEach(function(br){A(br,he)==A(te,he)||br.column!=te.column||br.y0<te.y1&&br.y1>te.y1&&Y(br,Hr,Jt,ge)})):ur<te.y0&&jr>te.y1&&(Hr=jr-te.y0+10,te=Y(te,Hr,Jt,ge),Ht.nodes.forEach(function(br){A(br,he)==A(te,he)||br.column!=te.column||br.y0<te.y1&&br.y1>te.y1&&Y(br,Hr,Jt,ge)}))}})}})}function it(Ht,Jt){return Ht.y0>Jt.y0&&Ht.y0<Jt.y1||Ht.y1>Jt.y0&&Ht.y1<Jt.y1?!0:Ht.y0<Jt.y0&&Ht.y1>Jt.y1}function Y(Ht,Jt,ge,he){return Ht.y0+Jt>=ge&&Ht.y1+Jt<=he&&(Ht.y0=Ht.y0+Jt,Ht.y1=Ht.y1+Jt,Ht.targetLinks.forEach(function(de){de.y1=de.y1+Jt}),Ht.sourceLinks.forEach(function(de){de.y0=de.y0+Jt})),Ht}function ft(Ht,Jt,ge,he){Ht.nodes.forEach(function(de){he&&de.y+(de.y1-de.y0)>Jt&&(de.y=de.y-(de.y+(de.y1-de.y0)-Jt));var se=Ht.links.filter(function(Mt){return A(Mt.source,ge)==A(de,ge)}),Tt=se.length;Tt>1&&se.sort(function(Mt,te){if(!Mt.circular&&!te.circular){if(Mt.target.column==te.target.column)return Mt.y1-te.y1;if(wt(Mt,te)){if(Mt.target.column>te.target.column){var ve=at(te,Mt);return Mt.y1-ve}if(te.target.column>Mt.target.column){var oe=at(Mt,te);return oe-te.y1}}else return Mt.y1-te.y1}if(Mt.circular&&!te.circular)return Mt.circularLinkType=="top"?-1:1;if(te.circular&&!Mt.circular)return te.circularLinkType=="top"?1:-1;if(Mt.circular&&te.circular)return Mt.circularLinkType===te.circularLinkType&&Mt.circularLinkType=="top"?Mt.target.column===te.target.column?Mt.target.y1-te.target.y1:te.target.column-Mt.target.column:Mt.circularLinkType===te.circularLinkType&&Mt.circularLinkType=="bottom"?Mt.target.column===te.target.column?te.target.y1-Mt.target.y1:Mt.target.column-te.target.column:Mt.circularLinkType=="top"?-1:1});var Lt=de.y0;se.forEach(function(Mt){Mt.y0=Lt+Mt.width/2,Lt=Lt+Mt.width}),se.forEach(function(Mt,te){if(Mt.circularLinkType=="bottom"){var ve=te+1,oe=0;for(ve;ve<Tt;ve++)oe=oe+se[ve].width;Mt.y0=de.y1-oe-Mt.width/2}})})}function ut(Ht,Jt,ge){Ht.nodes.forEach(function(he){var de=Ht.links.filter(function(Lt){return A(Lt.target,ge)==A(he,ge)}),se=de.length;se>1&&de.sort(function(Lt,Mt){if(!Lt.circular&&!Mt.circular){if(Lt.source.column==Mt.source.column)return Lt.y0-Mt.y0;if(wt(Lt,Mt)){if(Mt.source.column<Lt.source.column){var te=rt(Mt,Lt);return Lt.y0-te}if(Lt.source.column<Mt.source.column){var ve=rt(Lt,Mt);return ve-Mt.y0}}else return Lt.y0-Mt.y0}if(Lt.circular&&!Mt.circular)return Lt.circularLinkType=="top"?-1:1;if(Mt.circular&&!Lt.circular)return Mt.circularLinkType=="top"?1:-1;if(Lt.circular&&Mt.circular)return Lt.circularLinkType===Mt.circularLinkType&&Lt.circularLinkType=="top"?Lt.source.column===Mt.source.column?Lt.source.y1-Mt.source.y1:Lt.source.column-Mt.source.column:Lt.circularLinkType===Mt.circularLinkType&&Lt.circularLinkType=="bottom"?Lt.source.column===Mt.source.column?Lt.source.y1-Mt.source.y1:Mt.source.column-Lt.source.column:Lt.circularLinkType=="top"?-1:1});var Tt=he.y0;de.forEach(function(Lt){Lt.y1=Tt+Lt.width/2,Tt=Tt+Lt.width}),de.forEach(function(Lt,Mt){if(Lt.circularLinkType=="bottom"){var te=Mt+1,ve=0;for(te;te<se;te++)ve=ve+de[te].width;Lt.y1=he.y1-ve-Lt.width/2}})})}function wt(Ht,Jt){return zt(Ht)==zt(Jt)}function zt(Ht){return Ht.y0-Ht.y1>0?"up":"down"}function Pt(Ht,Jt){return A(Ht.source,Jt)==A(Ht.target,Jt)}function Wt(Ht,Jt,ge){var he=Ht.nodes,de=Ht.links,se=!1,Tt=!1;if(de.forEach(function(Te){Te.circularLinkType=="top"?se=!0:Te.circularLinkType=="bottom"&&(Tt=!0)}),se==!1||Tt==!1){var Lt=g.min(he,function(Te){return Te.y0}),Mt=g.max(he,function(Te){return Te.y1}),te=Mt-Lt,ve=ge-Jt,oe=ve/te;he.forEach(function(Te){var He=(Te.y1-Te.y0)*oe;Te.y0=(Te.y0-Lt)*oe,Te.y1=Te.y0+He}),de.forEach(function(Te){Te.y0=(Te.y0-Lt)*oe,Te.y1=(Te.y1-Lt)*oe,Te.width=Te.width*oe})}}c.sankeyCircular=w,c.sankeyCenter=o,c.sankeyLeft=r,c.sankeyRight=a,c.sankeyJustify=n,Object.defineProperty(c,"__esModule",{value:!0})})}),TE=Ft((Q,$)=>{$.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"}}}),rq=Ft((Q,$)=>{var c=XW(),g=(hx(),ai(B1)).interpolateNumber,P=un(),S=QW(),t=eq(),e=TE(),r=fo(),a=li(),n=js(),o=bn(),i=o.strTranslate,s=o.strRotate,f=Lg(),x=f.keyFun,y=f.repeat,v=f.unwrap,T=tc(),u=Xo(),b=Af(),_=b.CAP_SHIFT,C=b.LINE_SPACING,M=3;function E(rt,at,vt){var it=v(at),Y=it.trace,ft=Y.domain,ut=Y.orientation==="h",wt=Y.node.pad,zt=Y.node.thickness,Pt={justify:S.sankeyJustify,left:S.sankeyLeft,right:S.sankeyRight,center:S.sankeyCenter}[Y.node.align],Wt=rt.width*(ft.x[1]-ft.x[0]),Ht=rt.height*(ft.y[1]-ft.y[0]),Jt=it._nodes,ge=it._links,he=it.circular,de;he?de=t.sankeyCircular().circularLinkGap(0):de=S.sankey(),de.iterations(e.sankeyIterations).size(ut?[Wt,Ht]:[Ht,Wt]).nodeWidth(zt).nodePadding(wt).nodeId(function(br){return br.pointNumber}).nodeAlign(Pt).nodes(Jt).links(ge);var se=de();de.nodePadding()<wt&&o.warn("node.pad was reduced to ",de.nodePadding()," to fit within the figure.");var Tt,Lt,Mt;for(var te in it._groupLookup){var ve=parseInt(it._groupLookup[te]),oe;for(Tt=0;Tt<se.nodes.length;Tt++)if(se.nodes[Tt].pointNumber===ve){oe=se.nodes[Tt];break}if(oe){var Te={pointNumber:parseInt(te),x0:oe.x0,x1:oe.x1,y0:oe.y0,y1:oe.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};se.nodes.unshift(Te),oe.childrenNodes.unshift(Te)}}function He(){for(Tt=0;Tt<se.nodes.length;Tt++){var br=se.nodes[Tt],Kr={},rn,Ce;for(Lt=0;Lt<br.targetLinks.length;Lt++)Ce=br.targetLinks[Lt],rn=Ce.source.pointNumber+":"+Ce.target.pointNumber,Kr.hasOwnProperty(rn)||(Kr[rn]=[]),Kr[rn].push(Ce);var $t=Object.keys(Kr);for(Lt=0;Lt<$t.length;Lt++){rn=$t[Lt];var ne=Kr[rn],Ct=0,gt={};for(Mt=0;Mt<ne.length;Mt++)Ce=ne[Mt],gt[Ce.label]||(gt[Ce.label]=0),gt[Ce.label]+=Ce.value,Ct+=Ce.value;for(Mt=0;Mt<ne.length;Mt++)Ce=ne[Mt],Ce.flow={value:Ct,labelConcentration:gt[Ce.label]/Ct,concentration:Ce.value/Ct,links:ne},Ce.concentrationscale&&(Ce.color=r(Ce.concentrationscale(Ce.flow.labelConcentration)))}var St=0;for(Lt=0;Lt<br.sourceLinks.length;Lt++)St+=br.sourceLinks[Lt].value;for(Lt=0;Lt<br.sourceLinks.length;Lt++)Ce=br.sourceLinks[Lt],Ce.concentrationOut=Ce.value/St;var Nt=0;for(Lt=0;Lt<br.targetLinks.length;Lt++)Nt+=br.targetLinks[Lt].value;for(Lt=0;Lt<br.targetLinks.length;Lt++)Ce=br.targetLinks[Lt],Ce.concenrationIn=Ce.value/Nt}}He();function Ge(br){br.forEach(function(Kr){var rn,Ce,$t=0,ne=Kr.length,Ct;for(Kr.sort(function(gt,St){return gt.y0-St.y0}),Ct=0;Ct<ne;++Ct)rn=Kr[Ct],rn.y0>=$t||(Ce=$t-rn.y0,Ce>1e-6&&(rn.y0+=Ce,rn.y1+=Ce)),$t=rn.y1+wt})}function cr(br){var Kr=br.map(function(St,Nt){return{x0:St.x0,index:Nt}}).sort(function(St,Nt){return St.x0-Nt.x0}),rn=[],Ce=-1,$t,ne=-1/0,Ct;for(Tt=0;Tt<Kr.length;Tt++){var gt=br[Kr[Tt].index];gt.x0>ne+zt&&(Ce+=1,$t=gt.x0),ne=gt.x0,rn[Ce]||(rn[Ce]=[]),rn[Ce].push(gt),Ct=$t-gt.x0,gt.x0+=Ct,gt.x1+=Ct}return rn}if(Y.node.x.length&&Y.node.y.length){for(Tt=0;Tt<Math.min(Y.node.x.length,Y.node.y.length,se.nodes.length);Tt++)if(Y.node.x[Tt]&&Y.node.y[Tt]){var ur=[Y.node.x[Tt]*Wt,Y.node.y[Tt]*Ht];se.nodes[Tt].x0=ur[0]-zt/2,se.nodes[Tt].x1=ur[0]+zt/2;var jr=se.nodes[Tt].y1-se.nodes[Tt].y0;se.nodes[Tt].y0=ur[1]-jr/2,se.nodes[Tt].y1=ur[1]+jr/2}if(Y.arrangement==="snap"){Jt=se.nodes;var Hr=cr(Jt);Ge(Hr)}de.update(se)}return{circular:he,key:vt,trace:Y,guid:o.randstr(),horizontal:ut,width:Wt,height:Ht,nodePad:Y.node.pad,nodeLineColor:Y.node.line.color,nodeLineWidth:Y.node.line.width,linkLineColor:Y.link.line.color,linkLineWidth:Y.link.line.width,linkArrowLength:Y.link.arrowlen,valueFormat:Y.valueformat,valueSuffix:Y.valuesuffix,textFont:Y.textfont,translateX:ft.x[0]*rt.width+rt.margin.l,translateY:rt.height-ft.y[1]*rt.height+rt.margin.t,dragParallel:ut?Ht:Wt,dragPerpendicular:ut?Wt:Ht,arrangement:Y.arrangement,sankey:de,graph:se,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function A(rt,at,vt){var it=r(at.color),Y=r(at.hovercolor),ft=at.source.label+"|"+at.target.label,ut=ft+"__"+vt;return at.trace=rt.trace,at.curveNumber=rt.trace.index,{circular:rt.circular,key:ut,traceId:rt.key,pointNumber:at.pointNumber,link:at,tinyColorHue:a.tinyRGB(it),tinyColorAlpha:it.getAlpha(),tinyColorHoverHue:a.tinyRGB(Y),tinyColorHoverAlpha:Y.getAlpha(),linkPath:p,linkLineColor:rt.linkLineColor,linkLineWidth:rt.linkLineWidth,linkArrowLength:rt.linkArrowLength,valueFormat:rt.valueFormat,valueSuffix:rt.valueSuffix,sankey:rt.sankey,parent:rt,interactionState:rt.interactionState,flow:at.flow}}function h(rt,at){var vt="",it=rt.width/2,Y=rt.circularPathData,ft=Y.sourceX+Y.verticalBuffer<Y.targetX,ut=Y.rightFullExtent-Y.rightLargeArcRadius-at<=Y.leftFullExtent-it;return Math.abs(Y.rightFullExtent-Y.leftFullExtent-it)<it,rt.circularLinkType==="top"?(vt="M "+(Y.targetX-at)+" "+(Y.targetY+it)+" L "+(Y.rightInnerExtent-at)+" "+(Y.targetY+it)+"A "+(Y.rightLargeArcRadius+it)+" "+(Y.rightSmallArcRadius+it)+" 0 0 1 "+(Y.rightFullExtent-it-at)+" "+(Y.targetY-Y.rightSmallArcRadius)+"L "+(Y.rightFullExtent-it-at)+" "+Y.verticalRightInnerExtent,ft&&ut?vt+=" A "+(Y.rightLargeArcRadius+it)+" "+(Y.rightLargeArcRadius+it)+" 0 0 1 "+(Y.rightFullExtent+it-at-(Y.rightLargeArcRadius-it))+" "+(Y.verticalRightInnerExtent-(Y.rightLargeArcRadius+it))+" L "+(Y.rightFullExtent+it-(Y.rightLargeArcRadius-it)-at)+" "+(Y.verticalRightInnerExtent-(Y.rightLargeArcRadius+it))+" A "+(Y.leftLargeArcRadius+it)+" "+(Y.leftLargeArcRadius+it)+" 0 0 1 "+(Y.leftFullExtent+it)+" "+Y.verticalRightInnerExtent:ft?vt+=" A "+(Y.rightLargeArcRadius-it)+" "+(Y.rightLargeArcRadius-it)+" 0 0 0 "+(Y.rightFullExtent-it-at-(Y.rightLargeArcRadius-it))+" "+(Y.verticalRightInnerExtent-(Y.rightLargeArcRadius-it))+" L "+(Y.leftFullExtent+it+(Y.rightLargeArcRadius-it))+" "+(Y.verticalRightInnerExtent-(Y.rightLargeArcRadius-it))+" A "+(Y.leftLargeArcRadius-it)+" "+(Y.leftLargeArcRadius-it)+" 0 0 0 "+(Y.leftFullExtent+it)+" "+Y.verticalLeftInnerExtent:vt+=" A "+(Y.rightLargeArcRadius+it)+" "+(Y.rightLargeArcRadius+it)+" 0 0 1 "+(Y.rightInnerExtent-at)+" "+(Y.verticalFullExtent-it)+" L "+Y.leftInnerExtent+" "+(Y.verticalFullExtent-it)+" A "+(Y.leftLargeArcRadius+it)+" "+(Y.leftLargeArcRadius+it)+" 0 0 1 "+(Y.leftFullExtent+it)+" "+Y.verticalLeftInnerExtent,vt+=" L "+(Y.leftFullExtent+it)+" "+(Y.sourceY-Y.leftSmallArcRadius)+" A "+(Y.leftLargeArcRadius+it)+" "+(Y.leftSmallArcRadius+it)+" 0 0 1 "+Y.leftInnerExtent+" "+(Y.sourceY+it)+" L "+Y.sourceX+" "+(Y.sourceY+it)+" L "+Y.sourceX+" "+(Y.sourceY-it)+" L "+Y.leftInnerExtent+" "+(Y.sourceY-it)+" A "+(Y.leftLargeArcRadius-it)+" "+(Y.leftSmallArcRadius-it)+" 0 0 0 "+(Y.leftFullExtent-it)+" "+(Y.sourceY-Y.leftSmallArcRadius)+" L "+(Y.leftFullExtent-it)+" "+Y.verticalLeftInnerExtent,ft&&ut?vt+=" A "+(Y.leftLargeArcRadius+it)+" "+(Y.leftSmallArcRadius+it)+" 0 0 0 "+(Y.leftFullExtent-it)+" "+(Y.verticalFullExtent+it)+"L"+(Y.rightFullExtent+it-at)+" "+(Y.verticalFullExtent+it)+" A "+(Y.leftLargeArcRadius+it)+" "+(Y.leftSmallArcRadius+it)+" 0 0 0 "+(Y.rightFullExtent+it-at)+" "+Y.verticalRightInnerExtent:ft?vt+=" A "+(Y.leftLargeArcRadius+it)+" "+(Y.leftSmallArcRadius+it)+" 0 0 1 "+(Y.leftFullExtent+it)+" "+(Y.verticalFullExtent-it)+" L "+(Y.rightFullExtent-it-at)+" "+(Y.verticalFullExtent-it)+" A "+(Y.leftLargeArcRadius+it)+" "+(Y.leftSmallArcRadius+it)+" 0 0 1 "+(Y.rightFullExtent+it-at)+" "+Y.verticalRightInnerExtent:vt+=" A "+(Y.leftLargeArcRadius-it)+" "+(Y.leftLargeArcRadius-it)+" 0 0 0 "+Y.leftInnerExtent+" "+(Y.verticalFullExtent+it)+" L "+(Y.rightInnerExtent-at)+" "+(Y.verticalFullExtent+it)+" A "+(Y.rightLargeArcRadius-it)+" "+(Y.rightLargeArcRadius-it)+" 0 0 0 "+(Y.rightFullExtent+it-at)+" "+Y.verticalRightInnerExtent,vt+=" L "+(Y.rightFullExtent+it-at)+" "+(Y.targetY-Y.rightSmallArcRadius)+" A "+(Y.rightLargeArcRadius-it)+" "+(Y.rightSmallArcRadius-it)+" 0 0 0 "+(Y.rightInnerExtent-at)+" "+(Y.targetY-it)+" L "+(Y.targetX-at)+" "+(Y.targetY-it)+(at>0?" L "+Y.targetX+" "+Y.targetY:"")+"Z"):(vt="M "+(Y.targetX-at)+" "+(Y.targetY-it)+" L "+(Y.rightInnerExtent-at)+" "+(Y.targetY-it)+" A "+(Y.rightLargeArcRadius+it)+" "+(Y.rightSmallArcRadius+it)+" 0 0 0 "+(Y.rightFullExtent-it-at)+" "+(Y.targetY+Y.rightSmallArcRadius)+" L "+(Y.rightFullExtent-it-at)+" "+Y.verticalRightInnerExtent,ft&&ut?vt+=" A "+(Y.rightLargeArcRadius+it)+" "+(Y.rightLargeArcRadius+it)+" 0 0 0 "+(Y.rightInnerExtent-it-at)+" "+(Y.verticalFullExtent+it)+" L "+(Y.rightFullExtent+it-at-(Y.rightLargeArcRadius-it))+" "+(Y.verticalFullExtent+it)+" A "+(Y.rightLargeArcRadius+it)+" "+(Y.rightLargeArcRadius+it)+" 0 0 0 "+(Y.leftFullExtent+it)+" "+Y.verticalLeftInnerExtent:ft?vt+=" A "+(Y.rightLargeArcRadius-it)+" "+(Y.rightSmallArcRadius-it)+" 0 0 1 "+(Y.rightFullExtent-at-it-(Y.rightLargeArcRadius-it))+" "+(Y.verticalFullExtent-it)+" L "+(Y.leftFullExtent+it+(Y.rightLargeArcRadius-it))+" "+(Y.verticalFullExtent-it)+" A "+(Y.rightLargeArcRadius-it)+" "+(Y.rightSmallArcRadius-it)+" 0 0 1 "+(Y.leftFullExtent+it)+" "+Y.verticalLeftInnerExtent:vt+=" A "+(Y.rightLargeArcRadius+it)+" "+(Y.rightLargeArcRadius+it)+" 0 0 0 "+(Y.rightInnerExtent-at)+" "+(Y.verticalFullExtent+it)+" L "+Y.leftInnerExtent+" "+(Y.verticalFullExtent+it)+" A "+(Y.leftLargeArcRadius+it)+" "+(Y.leftLargeArcRadius+it)+" 0 0 0 "+(Y.leftFullExtent+it)+" "+Y.verticalLeftInnerExtent,vt+=" L "+(Y.leftFullExtent+it)+" "+(Y.sourceY+Y.leftSmallArcRadius)+" A "+(Y.leftLargeArcRadius+it)+" "+(Y.leftSmallArcRadius+it)+" 0 0 0 "+Y.leftInnerExtent+" "+(Y.sourceY-it)+" L "+Y.sourceX+" "+(Y.sourceY-it)+" L "+Y.sourceX+" "+(Y.sourceY+it)+" L "+Y.leftInnerExtent+" "+(Y.sourceY+it)+" A "+(Y.leftLargeArcRadius-it)+" "+(Y.leftSmallArcRadius-it)+" 0 0 1 "+(Y.leftFullExtent-it)+" "+(Y.sourceY+Y.leftSmallArcRadius)+" L "+(Y.leftFullExtent-it)+" "+Y.verticalLeftInnerExtent,ft&&ut?vt+=" A "+(Y.rightLargeArcRadius-it)+" "+(Y.rightSmallArcRadius-it)+" 0 0 1 "+(Y.leftFullExtent-it-(Y.rightLargeArcRadius-it))+" "+(Y.verticalFullExtent-it)+" L "+(Y.rightFullExtent+it-at+(Y.rightLargeArcRadius-it))+" "+(Y.verticalFullExtent-it)+" A "+(Y.rightLargeArcRadius-it)+" "+(Y.rightSmallArcRadius-it)+" 0 0 1 "+(Y.rightFullExtent+it-at)+" "+Y.verticalRightInnerExtent:ft?vt+=" A "+(Y.rightLargeArcRadius+it)+" "+(Y.rightLargeArcRadius+it)+" 0 0 0 "+(Y.leftFullExtent+it)+" "+(Y.verticalFullExtent+it)+" L "+(Y.rightFullExtent-at-it)+" "+(Y.verticalFullExtent+it)+" A "+(Y.rightLargeArcRadius+it)+" "+(Y.rightLargeArcRadius+it)+" 0 0 0 "+(Y.rightFullExtent+it-at)+" "+Y.verticalRightInnerExtent:vt+=" A "+(Y.leftLargeArcRadius-it)+" "+(Y.leftLargeArcRadius-it)+" 0 0 1 "+Y.leftInnerExtent+" "+(Y.verticalFullExtent-it)+" L "+(Y.rightInnerExtent-at)+" "+(Y.verticalFullExtent-it)+" A "+(Y.rightLargeArcRadius-it)+" "+(Y.rightLargeArcRadius-it)+" 0 0 1 "+(Y.rightFullExtent+it-at)+" "+Y.verticalRightInnerExtent,vt+=" L "+(Y.rightFullExtent+it-at)+" "+(Y.targetY+Y.rightSmallArcRadius)+" A "+(Y.rightLargeArcRadius-it)+" "+(Y.rightSmallArcRadius-it)+" 0 0 1 "+(Y.rightInnerExtent-at)+" "+(Y.targetY+it)+" L "+(Y.targetX-at)+" "+(Y.targetY+it)+(at>0?" L "+Y.targetX+" "+Y.targetY:"")+"Z"),vt}function p(){var rt=.5;function at(vt){var it=vt.linkArrowLength;if(vt.link.circular)return h(vt.link,it);var Y=Math.abs((vt.link.target.x0-vt.link.source.x1)/2);it>Y&&(it=Y);var ft=vt.link.source.x1,ut=vt.link.target.x0-it,wt=g(ft,ut),zt=wt(rt),Pt=wt(1-rt),Wt=vt.link.y0-vt.link.width/2,Ht=vt.link.y0+vt.link.width/2,Jt=vt.link.y1-vt.link.width/2,ge=vt.link.y1+vt.link.width/2,he="M"+ft+","+Wt,de="C"+zt+","+Wt+" "+Pt+","+Jt+" "+ut+","+Jt,se="C"+Pt+","+ge+" "+zt+","+Ht+" "+ft+","+Ht,Tt=it>0?"L"+(ut+it)+","+(Jt+vt.link.width/2):"";return Tt+="L"+ut+","+ge,he+de+Tt+se+"Z"}return at}function k(rt,at){var vt=r(at.color),it=e.nodePadAcross,Y=rt.nodePad/2;at.dx=at.x1-at.x0,at.dy=at.y1-at.y0;var ft=at.dx,ut=Math.max(.5,at.dy),wt="node_"+at.pointNumber;return at.group&&(wt=o.randstr()),at.trace=rt.trace,at.curveNumber=rt.trace.index,{index:at.pointNumber,key:wt,partOfGroup:at.partOfGroup||!1,group:at.group,traceId:rt.key,trace:rt.trace,node:at,nodePad:rt.nodePad,nodeLineColor:rt.nodeLineColor,nodeLineWidth:rt.nodeLineWidth,textFont:rt.textFont,size:rt.horizontal?rt.height:rt.width,visibleWidth:Math.ceil(ft),visibleHeight:ut,zoneX:-it,zoneY:-Y,zoneWidth:ft+2*it,zoneHeight:ut+2*Y,labelY:rt.horizontal?at.dy/2+1:at.dx/2+1,left:at.originalLayer===1,sizeAcross:rt.width,forceLayouts:rt.forceLayouts,horizontal:rt.horizontal,darkBackground:vt.getBrightness()<=128,tinyColorHue:a.tinyRGB(vt),tinyColorAlpha:vt.getAlpha(),valueFormat:rt.valueFormat,valueSuffix:rt.valueSuffix,sankey:rt.sankey,graph:rt.graph,arrangement:rt.arrangement,uniqueNodeLabelPathId:[rt.guid,rt.key,wt].join("_"),interactionState:rt.interactionState,figure:rt}}function w(rt){rt.attr("transform",function(at){return i(at.node.x0.toFixed(3),at.node.y0.toFixed(3))})}function R(rt){rt.call(w)}function O(rt,at){rt.call(R),at.attr("d",p())}function N(rt){rt.attr("width",function(at){return at.node.x1-at.node.x0}).attr("height",function(at){return at.visibleHeight})}function V(rt){return rt.link.width>1||rt.linkLineWidth>0}function H(rt){var at=i(rt.translateX,rt.translateY);return at+(rt.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function F(rt,at,vt){rt.on(".basic",null).on("mouseover.basic",function(it){!it.interactionState.dragInProgress&&!it.partOfGroup&&(vt.hover(this,it,at),it.interactionState.hovered=[this,it])}).on("mousemove.basic",function(it){!it.interactionState.dragInProgress&&!it.partOfGroup&&(vt.follow(this,it),it.interactionState.hovered=[this,it])}).on("mouseout.basic",function(it){!it.interactionState.dragInProgress&&!it.partOfGroup&&(vt.unhover(this,it,at),it.interactionState.hovered=!1)}).on("click.basic",function(it){it.interactionState.hovered&&(vt.unhover(this,it,at),it.interactionState.hovered=!1),!it.interactionState.dragInProgress&&!it.partOfGroup&&vt.select(this,it,at)})}function U(rt,at,vt,it){var Y=P.behavior.drag().origin(function(ft){return{x:ft.node.x0+ft.visibleWidth/2,y:ft.node.y0+ft.visibleHeight/2}}).on("dragstart",function(ft){if(ft.arrangement!=="fixed"&&(o.ensureSingle(it._fullLayout._infolayer,"g","dragcover",function(wt){it._fullLayout._dragCover=wt}),o.raiseToTop(this),ft.interactionState.dragInProgress=ft.node,pt(ft.node),ft.interactionState.hovered&&(vt.nodeEvents.unhover.apply(0,ft.interactionState.hovered),ft.interactionState.hovered=!1),ft.arrangement==="snap")){var ut=ft.traceId+"|"+ft.key;ft.forceLayouts[ut]?ft.forceLayouts[ut].alpha(1):W(rt,ut,ft),q(rt,at,ft,ut,it)}}).on("drag",function(ft){if(ft.arrangement!=="fixed"){var ut=P.event.x,wt=P.event.y;ft.arrangement==="snap"?(ft.node.x0=ut-ft.visibleWidth/2,ft.node.x1=ut+ft.visibleWidth/2,ft.node.y0=wt-ft.visibleHeight/2,ft.node.y1=wt+ft.visibleHeight/2):(ft.arrangement==="freeform"&&(ft.node.x0=ut-ft.visibleWidth/2,ft.node.x1=ut+ft.visibleWidth/2),wt=Math.max(0,Math.min(ft.size-ft.visibleHeight/2,wt)),ft.node.y0=wt-ft.visibleHeight/2,ft.node.y1=wt+ft.visibleHeight/2),pt(ft.node),ft.arrangement!=="snap"&&(ft.sankey.update(ft.graph),O(rt.filter(st(ft)),at))}}).on("dragend",function(ft){if(ft.arrangement!=="fixed"){ft.interactionState.dragInProgress=!1;for(var ut=0;ut<ft.node.childrenNodes.length;ut++)ft.node.childrenNodes[ut].x=ft.node.x,ft.node.childrenNodes[ut].y=ft.node.y;ft.arrangement!=="snap"&&lt(ft,it)}});rt.on(".drag",null).call(Y)}function W(rt,at,vt,it){tt(vt.graph.nodes);var Y=vt.graph.nodes.filter(function(ft){return ft.originalX===vt.node.originalX}).filter(function(ft){return!ft.partOfGroup});vt.forceLayouts[at]=c.forceSimulation(Y).alphaDecay(0).force("collide",c.forceCollide().radius(function(ft){return ft.dy/2+vt.nodePad/2}).strength(1).iterations(e.forceIterations)).force("constrain",X(rt,at,Y,vt)).stop()}function q(rt,at,vt,it,Y){window.requestAnimationFrame(function ft(){var ut;for(ut=0;ut<e.forceTicksPerFrame;ut++)vt.forceLayouts[it].tick();var wt=vt.graph.nodes;if(dt(wt),vt.sankey.update(vt.graph),O(rt.filter(st(vt)),at),vt.forceLayouts[it].alpha()>0)window.requestAnimationFrame(ft);else{var zt=vt.node.originalX;vt.node.x0=zt-vt.visibleWidth/2,vt.node.x1=zt+vt.visibleWidth/2,lt(vt,Y)}})}function X(rt,at,vt,it){return function(){for(var Y=0,ft=0;ft<vt.length;ft++){var ut=vt[ft];ut===it.interactionState.dragInProgress?(ut.x=ut.lastDraggedX,ut.y=ut.lastDraggedY):(ut.vx=(ut.originalX-ut.x)/e.forceTicksPerFrame,ut.y=Math.min(it.size-ut.dy/2,Math.max(ut.dy/2,ut.y))),Y=Math.max(Y,Math.abs(ut.vx),Math.abs(ut.vy))}!it.interactionState.dragInProgress&&Y<.1&&it.forceLayouts[at].alpha()>0&&it.forceLayouts[at].alpha(0)}}function lt(rt,at){for(var vt=[],it=[],Y=0;Y<rt.graph.nodes.length;Y++){var ft=(rt.graph.nodes[Y].x0+rt.graph.nodes[Y].x1)/2,ut=(rt.graph.nodes[Y].y0+rt.graph.nodes[Y].y1)/2;vt.push(ft/rt.figure.width),it.push(ut/rt.figure.height)}u.call("_guiRestyle",at,{"node.x":[vt],"node.y":[it]},rt.trace.index).then(function(){at._fullLayout._dragCover&&at._fullLayout._dragCover.remove()})}function yt(rt){var at=[],vt;for(vt=0;vt<rt.length;vt++)rt[vt].originalX=(rt[vt].x0+rt[vt].x1)/2,rt[vt].originalY=(rt[vt].y0+rt[vt].y1)/2,at.indexOf(rt[vt].originalX)===-1&&at.push(rt[vt].originalX);for(at.sort(function(it,Y){return it-Y}),vt=0;vt<rt.length;vt++)rt[vt].originalLayerIndex=at.indexOf(rt[vt].originalX),rt[vt].originalLayer=rt[vt].originalLayerIndex/(at.length-1)}function pt(rt){rt.lastDraggedX=rt.x0+rt.dx/2,rt.lastDraggedY=rt.y0+rt.dy/2}function st(rt){return function(at){return at.node.originalX===rt.node.originalX}}function tt(rt){for(var at=0;at<rt.length;at++)rt[at].y=(rt[at].y0+rt[at].y1)/2,rt[at].x=(rt[at].x0+rt[at].x1)/2}function dt(rt){for(var at=0;at<rt.length;at++)rt[at].y0=rt[at].y-rt[at].dy/2,rt[at].y1=rt[at].y0+rt[at].dy,rt[at].x0=rt[at].x-rt[at].dx/2,rt[at].x1=rt[at].x0+rt[at].dx}$.exports=function(rt,at,vt,it,Y){var ft=rt._context.staticPlot,ut=!1;o.ensureSingle(rt._fullLayout._infolayer,"g","first-render",function(){ut=!0});var wt=rt._fullLayout._dragCover,zt=vt.filter(function(se){return v(se).trace.visible}).map(E.bind(null,it)),Pt=at.selectAll("."+e.cn.sankey).data(zt,x);Pt.exit().remove(),Pt.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",ft?"none":"auto").attr("transform",H),Pt.each(function(se,Tt){rt._fullData[Tt]._sankey=se;var Lt="bgsankey-"+se.trace.uid+"-"+Tt;o.ensureSingle(rt._fullLayout._draggers,"rect",Lt),rt._fullData[Tt]._bgRect=P.select("."+Lt),rt._fullData[Tt]._bgRect.style("pointer-events",ft?"none":"all").attr("width",se.width).attr("height",se.height).attr("x",se.translateX).attr("y",se.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),Pt.transition().ease(e.ease).duration(e.duration).attr("transform",H);var Wt=Pt.selectAll("."+e.cn.sankeyLinks).data(y,x);Wt.enter().append("g").classed(e.cn.sankeyLinks,!0).style("fill","none");var Ht=Wt.selectAll("."+e.cn.sankeyLink).data(function(se){var Tt=se.graph.links;return Tt.filter(function(Lt){return Lt.value}).map(A.bind(null,se))},x);Ht.enter().append("path").classed(e.cn.sankeyLink,!0).call(F,Pt,Y.linkEvents),Ht.style("stroke",function(se){return V(se)?a.tinyRGB(r(se.linkLineColor)):se.tinyColorHue}).style("stroke-opacity",function(se){return V(se)?a.opacity(se.linkLineColor):se.tinyColorAlpha}).style("fill",function(se){return se.tinyColorHue}).style("fill-opacity",function(se){return se.tinyColorAlpha}).style("stroke-width",function(se){return V(se)?se.linkLineWidth:1}).attr("d",p()),Ht.style("opacity",function(){return rt._context.staticPlot||ut||wt?1:0}).transition().ease(e.ease).duration(e.duration).style("opacity",1),Ht.exit().transition().ease(e.ease).duration(e.duration).style("opacity",0).remove();var Jt=Pt.selectAll("."+e.cn.sankeyNodeSet).data(y,x);Jt.enter().append("g").classed(e.cn.sankeyNodeSet,!0),Jt.style("cursor",function(se){switch(se.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var ge=Jt.selectAll("."+e.cn.sankeyNode).data(function(se){var Tt=se.graph.nodes;return yt(Tt),Tt.map(k.bind(null,se))},x);ge.enter().append("g").classed(e.cn.sankeyNode,!0).call(w).style("opacity",function(se){return(rt._context.staticPlot||ut)&&!se.partOfGroup?1:0}),ge.call(F,Pt,Y.nodeEvents).call(U,Ht,Y,rt),ge.transition().ease(e.ease).duration(e.duration).call(w).style("opacity",function(se){return se.partOfGroup?0:1}),ge.exit().transition().ease(e.ease).duration(e.duration).style("opacity",0).remove();var he=ge.selectAll("."+e.cn.nodeRect).data(y);he.enter().append("rect").classed(e.cn.nodeRect,!0).call(N),he.style("stroke-width",function(se){return se.nodeLineWidth}).style("stroke",function(se){return a.tinyRGB(r(se.nodeLineColor))}).style("stroke-opacity",function(se){return a.opacity(se.nodeLineColor)}).style("fill",function(se){return se.tinyColorHue}).style("fill-opacity",function(se){return se.tinyColorAlpha}),he.transition().ease(e.ease).duration(e.duration).call(N);var de=ge.selectAll("."+e.cn.nodeLabel).data(y);de.enter().append("text").classed(e.cn.nodeLabel,!0).style("cursor","default"),de.attr("data-notex",1).text(function(se){return se.node.label}).each(function(se){var Tt=P.select(this);n.font(Tt,se.textFont),T.convertToTspans(Tt,rt)}).attr("text-anchor",function(se){return se.horizontal&&se.left?"end":"start"}).attr("transform",function(se){var Tt=P.select(this),Lt=T.lineCount(Tt),Mt=se.textFont.size*((Lt-1)*C-_),te=se.nodeLineWidth/2+M,ve=((se.horizontal?se.visibleHeight:se.visibleWidth)-Mt)/2;se.horizontal&&(se.left?te=-te:te+=se.visibleWidth);var oe=se.horizontal?"":"scale(-1,1)"+s(90);return i(se.horizontal?te:ve,se.horizontal?ve:te)+oe}),de.transition().ease(e.ease).duration(e.duration)}}),AE=Ft((Q,$)=>{var c=un(),g=bn(),P=g.numberFormat,S=rq(),t=Qh(),e=li(),r=TE().cn,a=g._;function n(_){return _!==""}function o(_,C){return _.filter(function(M){return M.key===C.traceId})}function i(_,C){c.select(_).select("path").style("fill-opacity",C),c.select(_).select("rect").style("fill-opacity",C)}function s(_){c.select(_).select("text.name").style("fill","black")}function f(_){return function(C){return _.node.sourceLinks.indexOf(C.link)!==-1||_.node.targetLinks.indexOf(C.link)!==-1}}function x(_){return function(C){return C.node.sourceLinks.indexOf(_.link)!==-1||C.node.targetLinks.indexOf(_.link)!==-1}}function y(_,C,M){C&&M&&o(M,C).selectAll("."+r.sankeyLink).filter(f(C)).call(T.bind(0,C,M,!1))}function v(_,C,M){C&&M&&o(M,C).selectAll("."+r.sankeyLink).filter(f(C)).call(u.bind(0,C,M,!1))}function T(_,C,M,E){E.style("fill",function(A){if(!A.link.concentrationscale)return A.tinyColorHoverHue}).style("fill-opacity",function(A){if(!A.link.concentrationscale)return A.tinyColorHoverAlpha}),E.each(function(A){var h=A.link.label;h!==""&&o(C,_).selectAll("."+r.sankeyLink).filter(function(p){return p.link.label===h}).style("fill",function(p){if(!p.link.concentrationscale)return p.tinyColorHoverHue}).style("fill-opacity",function(p){if(!p.link.concentrationscale)return p.tinyColorHoverAlpha})}),M&&o(C,_).selectAll("."+r.sankeyNode).filter(x(_)).call(y)}function u(_,C,M,E){E.style("fill",function(A){return A.tinyColorHue}).style("fill-opacity",function(A){return A.tinyColorAlpha}),E.each(function(A){var h=A.link.label;h!==""&&o(C,_).selectAll("."+r.sankeyLink).filter(function(p){return p.link.label===h}).style("fill",function(p){return p.tinyColorHue}).style("fill-opacity",function(p){return p.tinyColorAlpha})}),M&&o(C,_).selectAll(r.sankeyNode).filter(x(_)).call(v)}function b(_,C){var M=_.hoverlabel||{},E=g.nestedProperty(M,C).get();return Array.isArray(E)?!1:E}$.exports=function(_,C){for(var M=_._fullLayout,E=M._paper,A=M._size,h=0;h<_._fullData.length;h++)if(_._fullData[h].visible&&_._fullData[h].type===r.sankey&&!_._fullData[h]._viewInitial){var p=_._fullData[h].node;_._fullData[h]._viewInitial={node:{groups:p.groups.slice(),x:p.x.slice(),y:p.y.slice()}}}var k=function(yt,pt){var st=pt.link;st.originalEvent=c.event,_._hoverdata=[st],t.click(_,{target:!0})},w=function(yt,pt,st){_._fullLayout.hovermode!==!1&&(c.select(yt).call(T.bind(0,pt,st,!0)),pt.link.trace.link.hoverinfo!=="skip"&&(pt.link.fullData=pt.link.trace,_.emit("plotly_hover",{event:c.event,points:[pt.link]})))},R=a(_,"source:")+" ",O=a(_,"target:")+" ",N=a(_,"concentration:")+" ",V=a(_,"incoming flow count:")+" ",H=a(_,"outgoing flow count:")+" ",F=function(yt,pt){if(_._fullLayout.hovermode===!1)return;var st=pt.link.trace.link;if(st.hoverinfo==="none"||st.hoverinfo==="skip")return;var tt=[];function dt(ut){var wt,zt;ut.circular?(wt=(ut.circularPathData.leftInnerExtent+ut.circularPathData.rightInnerExtent)/2,zt=ut.circularPathData.verticalFullExtent):(wt=(ut.source.x1+ut.target.x0)/2,zt=(ut.y0+ut.y1)/2);var Pt=[wt,zt];return ut.trace.orientation==="v"&&Pt.reverse(),Pt[0]+=pt.parent.translateX,Pt[1]+=pt.parent.translateY,Pt}for(var rt=0,at=0;at<pt.flow.links.length;at++){var vt=pt.flow.links[at];if(!(_._fullLayout.hovermode==="closest"&&pt.link.pointNumber!==vt.pointNumber)){pt.link.pointNumber===vt.pointNumber&&(rt=at),vt.fullData=vt.trace,st=pt.link.trace.link;var it=dt(vt),Y={valueLabel:P(pt.valueFormat)(vt.value)+pt.valueSuffix};tt.push({x:it[0],y:it[1],name:Y.valueLabel,text:[vt.label||"",R+vt.source.label,O+vt.target.label,vt.concentrationscale?N+P("%0.2f")(vt.flow.labelConcentration):""].filter(n).join("<br>"),color:b(st,"bgcolor")||e.addOpacity(vt.color,1),borderColor:b(st,"bordercolor"),fontFamily:b(st,"font.family"),fontSize:b(st,"font.size"),fontColor:b(st,"font.color"),fontWeight:b(st,"font.weight"),fontStyle:b(st,"font.style"),fontVariant:b(st,"font.variant"),fontTextcase:b(st,"font.textcase"),fontLineposition:b(st,"font.lineposition"),fontShadow:b(st,"font.shadow"),nameLength:b(st,"namelength"),textAlign:b(st,"align"),idealAlign:c.event.x<it[0]?"right":"left",hovertemplate:st.hovertemplate,hovertemplateLabels:Y,eventData:[vt]})}}var ft=t.loneHover(tt,{container:M._hoverlayer.node(),outerContainer:M._paper.node(),gd:_,anchorIndex:rt});ft.each(function(){var ut=this;pt.link.concentrationscale||i(ut,.65),s(ut)})},U=function(yt,pt,st){_._fullLayout.hovermode!==!1&&(c.select(yt).call(u.bind(0,pt,st,!0)),pt.link.trace.link.hoverinfo!=="skip"&&(pt.link.fullData=pt.link.trace,_.emit("plotly_unhover",{event:c.event,points:[pt.link]})),t.loneUnhover(M._hoverlayer.node()))},W=function(yt,pt,st){var tt=pt.node;tt.originalEvent=c.event,_._hoverdata=[tt],c.select(yt).call(v,pt,st),t.click(_,{target:!0})},q=function(yt,pt,st){_._fullLayout.hovermode!==!1&&(c.select(yt).call(y,pt,st),pt.node.trace.node.hoverinfo!=="skip"&&(pt.node.fullData=pt.node.trace,_.emit("plotly_hover",{event:c.event,points:[pt.node]})))},X=function(yt,pt){if(_._fullLayout.hovermode!==!1){var st=pt.node.trace.node;if(!(st.hoverinfo==="none"||st.hoverinfo==="skip")){var tt=c.select(yt).select("."+r.nodeRect),dt=_._fullLayout._paperdiv.node().getBoundingClientRect(),rt=tt.node().getBoundingClientRect(),at=rt.left-2-dt.left,vt=rt.right+2-dt.left,it=rt.top+rt.height/4-dt.top,Y={valueLabel:P(pt.valueFormat)(pt.node.value)+pt.valueSuffix};pt.node.fullData=pt.node.trace,_._fullLayout._calcInverseTransform(_);var ft=_._fullLayout._invScaleX,ut=_._fullLayout._invScaleY,wt=t.loneHover({x0:ft*at,x1:ft*vt,y:ut*it,name:P(pt.valueFormat)(pt.node.value)+pt.valueSuffix,text:[pt.node.label,V+pt.node.targetLinks.length,H+pt.node.sourceLinks.length].filter(n).join("<br>"),color:b(st,"bgcolor")||pt.tinyColorHue,borderColor:b(st,"bordercolor"),fontFamily:b(st,"font.family"),fontSize:b(st,"font.size"),fontColor:b(st,"font.color"),fontWeight:b(st,"font.weight"),fontStyle:b(st,"font.style"),fontVariant:b(st,"font.variant"),fontTextcase:b(st,"font.textcase"),fontLineposition:b(st,"font.lineposition"),fontShadow:b(st,"font.shadow"),nameLength:b(st,"namelength"),textAlign:b(st,"align"),idealAlign:"left",hovertemplate:st.hovertemplate,hovertemplateLabels:Y,eventData:[pt.node]},{container:M._hoverlayer.node(),outerContainer:M._paper.node(),gd:_});i(wt,.85),s(wt)}}},lt=function(yt,pt,st){_._fullLayout.hovermode!==!1&&(c.select(yt).call(v,pt,st),pt.node.trace.node.hoverinfo!=="skip"&&(pt.node.fullData=pt.node.trace,_.emit("plotly_unhover",{event:c.event,points:[pt.node]})),t.loneUnhover(M._hoverlayer.node()))};S(_,E,C,{width:A.w,height:A.h,margin:{t:A.t,r:A.r,b:A.b,l:A.l}},{linkEvents:{hover:w,follow:F,unhover:U,select:k},nodeEvents:{hover:q,follow:X,unhover:lt,select:W}})}}),nq=Ft(Q=>{var $=Yc().overrideAll,c=ud().getModuleCalcData,g=AE(),P=Ao(),S=P0(),t=up(),e=vf().prepSelect,r=bn(),a=Xo(),n="sankey";Q.name=n,Q.baseLayoutAttrOverrides=$({hoverlabel:P.hoverlabel},"plot","nested"),Q.plot=function(i){var s=c(i.calcdata,n)[0];g(i,s),Q.updateFx(i)},Q.clean=function(i,s,f,x){var y=x._has&&x._has(n),v=s._has&&s._has(n);y&&!v&&(x._paperdiv.selectAll(".sankey").remove(),x._paperdiv.selectAll(".bgsankey").remove())},Q.updateFx=function(i){for(var s=0;s<i._fullData.length;s++)o(i,s)};function o(i,s){var f=i._fullData[s],x=i._fullLayout,y=x.dragmode,v=x.dragmode==="pan"?"move":"crosshair",T=f._bgRect;if(T&&!(y==="pan"||y==="zoom")){S(T,v);var u={_id:"x",c2p:r.identity,_offset:f._sankey.translateX,_length:f._sankey.width},b={_id:"y",c2p:r.identity,_offset:f._sankey.translateY,_length:f._sankey.height},_={gd:i,element:T.node(),plotinfo:{id:s,xaxis:u,yaxis:b,fillRangeItems:r.noop},subplot:s,xaxes:[u],yaxes:[b],doneFnCompleted:function(C){var M=i._fullData[s],E,A=M.node.groups.slice(),h=[];function p(O){for(var N=M._sankey.graph.nodes,V=0;V<N.length;V++)if(N[V].pointNumber===O)return N[V]}for(var k=0;k<C.length;k++){var w=p(C[k].pointNumber);if(w)if(w.group){for(var R=0;R<w.childrenNodes.length;R++)h.push(w.childrenNodes[R].pointNumber);A[w.pointNumber-M.node._count]=!1}else h.push(w.pointNumber)}E=A.filter(Boolean).concat([h]),a.call("_guiRestyle",i,{"node.groups":[E]},s)}};_.prepFn=function(C,M,E){e(C,M,E,_,y)},t.init(_)}}}),iq=Ft((Q,$)=>{$.exports=function(c,g){for(var P=c.cd,S=[],t=P[0].trace,e=t._sankey.graph.nodes,r=0;r<e.length;r++){var a=e[r];if(!a.partOfGroup){var n=[(a.x0+a.x1)/2,(a.y0+a.y1)/2];t.orientation==="v"&&n.reverse(),g&&g.contains(n,!1,r,c)&&S.push({pointNumber:a.pointNumber})}}return S}}),aq=Ft((Q,$)=>{$.exports={attributes:bE(),supplyDefaults:ZW(),calc:$W(),plot:AE(),moduleType:"trace",name:"sankey",basePlotModule:nq(),selectPoints:iq(),categories:["noOpacity"],meta:{}}}),oq=Ft((Q,$)=>{$.exports=aq()}),sq=Ft(Q=>{var $=Kc();Q.name="indicator",Q.plot=function(c,g,P,S){$.plotBasePlot(Q.name,c,g,P,S)},Q.clean=function(c,g,P,S){$.cleanBasePlot(Q.name,c,g,P,S)}}),ME=Ft((Q,$)=>{var c=Ta().extendFlat,g=Ta().extendDeep,P=Yc().overrideAll,S=Ea(),t=bi(),e=Nh().attributes,r=Ad(),a=pu().templatedArray,n=J_(),o=fh().descriptionOnlyNumbers,i=S({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"},x=a("step",g({},s,{range:f}));$.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:e({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:c({},i,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:o("value")},font:c({},i,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:o("value")},increasing:{symbol:{valType:"string",dflt:n.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:n.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:n.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:n.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:c({},i,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:g({},s,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:t.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:P({range:f,visible:c({},r.visible,{dflt:!0}),tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:c({},r.ticks,{dflt:"outside"}),ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,ticklabelstep:r.ticklabelstep,showticklabels:r.showticklabels,labelalias:r.labelalias,tickfont:S({}),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:x,threshold:{line:{color:c({},s.line.color,{}),width:c({},s.line.width,{dflt:1}),editType:"plot"},thickness:c({},s.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}),SE=Ft((Q,$)=>{$.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}),lq=Ft((Q,$)=>{var c=bn(),g=ME(),P=Nh().defaults,S=pu(),t=Md(),e=SE(),r=mg(),a=gg(),n=n0(),o=dm();function i(f,x,y,v){function T(U,W){return c.coerce(f,x,g,U,W)}P(x,v,T),T("mode"),x._hasNumber=x.mode.indexOf("number")!==-1,x._hasDelta=x.mode.indexOf("delta")!==-1,x._hasGauge=x.mode.indexOf("gauge")!==-1;var u=T("value");x._range=[0,typeof u=="number"?1.5*u:1];var b=new Array(2),_;if(x._hasNumber){T("number.valueformat");var C=c.extendFlat({},v.font);C.size=void 0,c.coerceFont(T,"number.font",C),x.number.font.size===void 0&&(x.number.font.size=e.defaultNumberFontSize,b[0]=!0),T("number.prefix"),T("number.suffix"),_=x.number.font.size}var M;if(x._hasDelta){var E=c.extendFlat({},v.font);E.size=void 0,c.coerceFont(T,"delta.font",E),x.delta.font.size===void 0&&(x.delta.font.size=(x._hasNumber?.5:1)*(_||e.defaultNumberFontSize),b[1]=!0),T("delta.reference",x.value),T("delta.relative"),T("delta.valueformat",x.delta.relative?"2%":""),T("delta.increasing.symbol"),T("delta.increasing.color"),T("delta.decreasing.symbol"),T("delta.decreasing.color"),T("delta.position"),T("delta.prefix"),T("delta.suffix"),M=x.delta.font.size}x._scaleNumbers=(!x._hasNumber||b[0])&&(!x._hasDelta||b[1])||!1;var A=c.extendFlat({},v.font);A.size=.25*(_||M||e.defaultNumberFontSize),c.coerceFont(T,"title.font",A),T("title.text");var h,p,k,w;function R(U,W){return c.coerce(h,p,g.gauge,U,W)}function O(U,W){return c.coerce(k,w,g.gauge.axis,U,W)}if(x._hasGauge){h=f.gauge,h||(h={}),p=S.newContainer(x,"gauge"),R("shape");var N=x._isBullet=x.gauge.shape==="bullet";N||T("title.align","center");var V=x._isAngular=x.gauge.shape==="angular";V||T("align","center"),R("bgcolor",v.paper_bgcolor),R("borderwidth"),R("bordercolor"),R("bar.color"),R("bar.line.color"),R("bar.line.width");var H=e.valueThickness*(x.gauge.shape==="bullet"?.5:1);R("bar.thickness",H),t(h,p,{name:"steps",handleItemDefaults:s}),R("threshold.value"),R("threshold.thickness"),R("threshold.line.width"),R("threshold.line.color"),k={},h&&(k=h.axis||{}),w=S.newContainer(p,"axis"),O("visible"),x._range=O("range",x._range);var F={font:v.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};r(k,w,O,"linear"),o(k,w,O,"linear",F),n(k,w,O,"linear",F),a(k,w,O,F)}else T("title.align","center"),T("align","center"),x._isAngular=x._isBullet=!1;x._length=null}function s(f,x){function y(v,T){return c.coerce(f,x,g.gauge.steps,v,T)}y("color"),y("line.color"),y("line.width"),y("range"),y("thickness")}$.exports={supplyDefaults:i}}),uq=Ft((Q,$)=>{function c(g,P){var S=[],t=P.value;typeof P._lastValue!="number"&&(P._lastValue=P.value);var e=P._lastValue,r=e;return P._hasDelta&&typeof P.delta.reference=="number"&&(r=P.delta.reference),S[0]={y:t,lastY:e,delta:t-r,relativeDelta:(t-r)/r},S}$.exports={calc:c}}),cq=Ft((Q,$)=>{var c=un(),g=(hx(),ai(B1)).interpolate,P=(hx(),ai(B1)).interpolateNumber,S=bn(),t=S.strScale,e=S.strTranslate,r=S.rad2deg,a=Af().MID_SHIFT,n=js(),o=SE(),i=tc(),s=Es(),f=Ky(),x=Z_(),y=Ad(),v=li(),T={left:"start",center:"middle",right:"end"},u={left:0,center:.5,right:1},b=/[yzafpnµmkMGTPEZY]/;function _(N){return N&&N.duration>0}$.exports=function(N,V,H,F){var U=N._fullLayout,W;_(H)&&F&&(W=F()),S.makeTraceGroups(U._indicatorlayer,V,"trace").each(function(q){var X=q[0],lt=X.trace,yt=c.select(this),pt=lt._hasGauge,st=lt._isAngular,tt=lt._isBullet,dt=lt.domain,rt={w:U._size.w*(dt.x[1]-dt.x[0]),h:U._size.h*(dt.y[1]-dt.y[0]),l:U._size.l+U._size.w*dt.x[0],r:U._size.r+U._size.w*(1-dt.x[1]),t:U._size.t+U._size.h*(1-dt.y[1]),b:U._size.b+U._size.h*dt.y[0]},at=rt.l+rt.w/2,vt=rt.t+rt.h/2,it=Math.min(rt.w/2,rt.h),Y=o.innerRadius*it,ft,ut,wt,zt=lt.align||"center";if(ut=vt,!pt)ft=rt.l+u[zt]*rt.w,wt=function(Lt){return k(Lt,rt.w,rt.h)};else if(st&&(ft=at,ut=vt+it/2,wt=function(Lt){return w(Lt,.9*Y)}),tt){var Pt=o.bulletPadding,Wt=1-o.bulletNumberDomainSize+Pt;ft=rt.l+(Wt+(1-Wt)*u[zt])*rt.w,wt=function(Lt){return k(Lt,(o.bulletNumberDomainSize-Pt)*rt.w,rt.h)}}E(N,yt,q,{numbersX:ft,numbersY:ut,numbersScaler:wt,transitionOpts:H,onComplete:W});var Ht,Jt;pt&&(Ht={range:lt.gauge.axis.range,color:lt.gauge.bgcolor,line:{color:lt.gauge.bordercolor,width:0},thickness:1},Jt={range:lt.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:lt.gauge.bordercolor,width:lt.gauge.borderwidth},thickness:1});var ge=yt.selectAll("g.angular").data(st?q:[]);ge.exit().remove();var he=yt.selectAll("g.angularaxis").data(st?q:[]);he.exit().remove(),st&&M(N,yt,q,{radius:it,innerRadius:Y,gauge:ge,layer:he,size:rt,gaugeBg:Ht,gaugeOutline:Jt,transitionOpts:H,onComplete:W});var de=yt.selectAll("g.bullet").data(tt?q:[]);de.exit().remove();var se=yt.selectAll("g.bulletaxis").data(tt?q:[]);se.exit().remove(),tt&&C(N,yt,q,{gauge:de,layer:se,size:rt,gaugeBg:Ht,gaugeOutline:Jt,transitionOpts:H,onComplete:W});var Tt=yt.selectAll("text.title").data(q);Tt.exit().remove(),Tt.enter().append("text").classed("title",!0),Tt.attr("text-anchor",function(){return tt?T.right:T[lt.title.align]}).text(lt.title.text).call(n.font,lt.title.font).call(i.convertToTspans,N),Tt.attr("transform",function(){var Lt=rt.l+rt.w*u[lt.title.align],Mt,te=o.titlePadding,ve=n.bBox(Tt.node());if(pt){if(st)if(lt.gauge.axis.visible){var oe=n.bBox(he.node());Mt=oe.top-te-ve.bottom}else Mt=rt.t+rt.h/2-it/2-ve.bottom-te;tt&&(Mt=ut-(ve.top+ve.bottom)/2,Lt=rt.l-o.bulletPadding*rt.w)}else Mt=lt._numbersTop-te-ve.bottom;return e(Lt,Mt)})})};function C(N,V,H,F){var U=H[0].trace,W=F.gauge,q=F.layer,X=F.gaugeBg,lt=F.gaugeOutline,yt=F.size,pt=U.domain,st=F.transitionOpts,tt=F.onComplete,dt,rt,at,vt,it;W.enter().append("g").classed("bullet",!0),W.attr("transform",e(yt.l,yt.t)),q.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),q.selectAll("g.xbulletaxistick,path,text").remove();var Y=yt.h,ft=U.gauge.bar.thickness*Y,ut=pt.x[0],wt=pt.x[0]+(pt.x[1]-pt.x[0])*(U._hasNumber||U._hasDelta?1-o.bulletNumberDomainSize:1);dt=p(N,U.gauge.axis),dt._id="xbulletaxis",dt.domain=[ut,wt],dt.setScale(),rt=s.calcTicks(dt),at=s.makeTransTickFn(dt),vt=s.getTickSigns(dt)[2],it=yt.t+yt.h,dt.visible&&(s.drawTicks(N,dt,{vals:dt.ticks==="inside"?s.clipEnds(dt,rt):rt,layer:q,path:s.makeTickPath(dt,it,vt),transFn:at}),s.drawLabels(N,dt,{vals:rt,layer:q,transFn:at,labelFns:s.makeLabelFns(dt,it)}));function zt(de){de.attr("width",function(se){return Math.max(0,dt.c2p(se.range[1])-dt.c2p(se.range[0]))}).attr("x",function(se){return dt.c2p(se.range[0])}).attr("y",function(se){return .5*(1-se.thickness)*Y}).attr("height",function(se){return se.thickness*Y})}var Pt=[X].concat(U.gauge.steps),Wt=W.selectAll("g.bg-bullet").data(Pt);Wt.enter().append("g").classed("bg-bullet",!0).append("rect"),Wt.select("rect").call(zt).call(A),Wt.exit().remove();var Ht=W.selectAll("g.value-bullet").data([U.gauge.bar]);Ht.enter().append("g").classed("value-bullet",!0).append("rect"),Ht.select("rect").attr("height",ft).attr("y",(Y-ft)/2).call(A),_(st)?Ht.select("rect").transition().duration(st.duration).ease(st.easing).each("end",function(){tt&&tt()}).each("interrupt",function(){tt&&tt()}).attr("width",Math.max(0,dt.c2p(Math.min(U.gauge.axis.range[1],H[0].y)))):Ht.select("rect").attr("width",typeof H[0].y=="number"?Math.max(0,dt.c2p(Math.min(U.gauge.axis.range[1],H[0].y))):0),Ht.exit().remove();var Jt=H.filter(function(){return U.gauge.threshold.value||U.gauge.threshold.value===0}),ge=W.selectAll("g.threshold-bullet").data(Jt);ge.enter().append("g").classed("threshold-bullet",!0).append("line"),ge.select("line").attr("x1",dt.c2p(U.gauge.threshold.value)).attr("x2",dt.c2p(U.gauge.threshold.value)).attr("y1",(1-U.gauge.threshold.thickness)/2*Y).attr("y2",(1-(1-U.gauge.threshold.thickness)/2)*Y).call(v.stroke,U.gauge.threshold.line.color).style("stroke-width",U.gauge.threshold.line.width),ge.exit().remove();var he=W.selectAll("g.gauge-outline").data([lt]);he.enter().append("g").classed("gauge-outline",!0).append("rect"),he.select("rect").call(zt).call(A),he.exit().remove()}function M(N,V,H,F){var U=H[0].trace,W=F.size,q=F.radius,X=F.innerRadius,lt=F.gaugeBg,yt=F.gaugeOutline,pt=[W.l+W.w/2,W.t+W.h/2+q/2],st=F.gauge,tt=F.layer,dt=F.transitionOpts,rt=F.onComplete,at=Math.PI/2;function vt(He){var Ge=U.gauge.axis.range[0],cr=U.gauge.axis.range[1],ur=(He-Ge)/(cr-Ge)*Math.PI-at;return ur<-at?-at:ur>at?at:ur}function it(He){return c.svg.arc().innerRadius((X+q)/2-He/2*(q-X)).outerRadius((X+q)/2+He/2*(q-X)).startAngle(-at)}function Y(He){He.attr("d",function(Ge){return it(Ge.thickness).startAngle(vt(Ge.range[0])).endAngle(vt(Ge.range[1]))()})}var ft,ut,wt,zt;st.enter().append("g").classed("angular",!0),st.attr("transform",e(pt[0],pt[1])),tt.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),tt.selectAll("g.xangularaxistick,path,text").remove(),ft=p(N,U.gauge.axis),ft.type="linear",ft.range=U.gauge.axis.range,ft._id="xangularaxis",ft.ticklabeloverflow="allow",ft.setScale();var Pt=function(He){return(ft.range[0]-He.x)/(ft.range[1]-ft.range[0])*Math.PI+Math.PI},Wt={},Ht=s.makeLabelFns(ft,0),Jt=Ht.labelStandoff;Wt.xFn=function(He){var Ge=Pt(He);return Math.cos(Ge)*Jt},Wt.yFn=function(He){var Ge=Pt(He),cr=Math.sin(Ge)>0?.2:1;return-Math.sin(Ge)*(Jt+He.fontSize*cr)+Math.abs(Math.cos(Ge))*(He.fontSize*a)},Wt.anchorFn=function(He){var Ge=Pt(He),cr=Math.cos(Ge);return Math.abs(cr)<.1?"middle":cr>0?"start":"end"},Wt.heightFn=function(He,Ge,cr){var ur=Pt(He);return-.5*(1+Math.sin(ur))*cr};var ge=function(He){return e(pt[0]+q*Math.cos(He),pt[1]-q*Math.sin(He))};wt=function(He){return ge(Pt(He))};var he=function(He){var Ge=Pt(He);return ge(Ge)+"rotate("+-r(Ge)+")"};if(ut=s.calcTicks(ft),zt=s.getTickSigns(ft)[2],ft.visible){zt=ft.ticks==="inside"?-1:1;var de=(ft.linewidth||1)/2;s.drawTicks(N,ft,{vals:ut,layer:tt,path:"M"+zt*de+",0h"+zt*ft.ticklen,transFn:he}),s.drawLabels(N,ft,{vals:ut,layer:tt,transFn:wt,labelFns:Wt})}var se=[lt].concat(U.gauge.steps),Tt=st.selectAll("g.bg-arc").data(se);Tt.enter().append("g").classed("bg-arc",!0).append("path"),Tt.select("path").call(Y).call(A),Tt.exit().remove();var Lt=it(U.gauge.bar.thickness),Mt=st.selectAll("g.value-arc").data([U.gauge.bar]);Mt.enter().append("g").classed("value-arc",!0).append("path");var te=Mt.select("path");_(dt)?(te.transition().duration(dt.duration).ease(dt.easing).each("end",function(){rt&&rt()}).each("interrupt",function(){rt&&rt()}).attrTween("d",h(Lt,vt(H[0].lastY),vt(H[0].y))),U._lastValue=H[0].y):te.attr("d",typeof H[0].y=="number"?Lt.endAngle(vt(H[0].y)):"M0,0Z"),te.call(A),Mt.exit().remove(),se=[];var ve=U.gauge.threshold.value;(ve||ve===0)&&se.push({range:[ve,ve],color:U.gauge.threshold.color,line:{color:U.gauge.threshold.line.color,width:U.gauge.threshold.line.width},thickness:U.gauge.threshold.thickness});var oe=st.selectAll("g.threshold-arc").data(se);oe.enter().append("g").classed("threshold-arc",!0).append("path"),oe.select("path").call(Y).call(A),oe.exit().remove();var Te=st.selectAll("g.gauge-outline").data([yt]);Te.enter().append("g").classed("gauge-outline",!0).append("path"),Te.select("path").call(Y).call(A),Te.exit().remove()}function E(N,V,H,F){var U=H[0].trace,W=F.numbersX,q=F.numbersY,X=U.align||"center",lt=T[X],yt=F.transitionOpts,pt=F.onComplete,st=S.ensureSingle(V,"g","numbers"),tt,dt,rt,at=[];U._hasNumber&&at.push("number"),U._hasDelta&&(at.push("delta"),U.delta.position==="left"&&at.reverse());var vt=st.selectAll("text").data(at);vt.enter().append("text"),vt.attr("text-anchor",function(){return lt}).attr("class",function(ge){return ge}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),vt.exit().remove();function it(ge,he,de,se){if(ge.match("s")&&de>=0!=se>=0&&!he(de).slice(-1).match(b)&&!he(se).slice(-1).match(b)){var Tt=ge.slice().replace("s","f").replace(/\d+/,function(Mt){return parseInt(Mt)-1}),Lt=p(N,{tickformat:Tt});return function(Mt){return Math.abs(Mt)<1?s.tickText(Lt,Mt).text:he(Mt)}}else return he}function Y(){var ge=p(N,{tickformat:U.number.valueformat},U._range);ge.setScale(),s.prepTicks(ge);var he=function(Mt){return s.tickText(ge,Mt).text},de=U.number.suffix,se=U.number.prefix,Tt=st.select("text.number");function Lt(){var Mt=typeof H[0].y=="number"?se+he(H[0].y)+de:"-";Tt.text(Mt).call(n.font,U.number.font).call(i.convertToTspans,N)}return _(yt)?Tt.transition().duration(yt.duration).ease(yt.easing).each("end",function(){Lt(),pt&&pt()}).each("interrupt",function(){Lt(),pt&&pt()}).attrTween("text",function(){var Mt=c.select(this),te=P(H[0].lastY,H[0].y);U._lastValue=H[0].y;var ve=it(U.number.valueformat,he,H[0].lastY,H[0].y);return function(oe){Mt.text(se+ve(te(oe))+de)}}):Lt(),tt=R(se+he(H[0].y)+de,U.number.font,lt,N),Tt}function ft(){var ge=p(N,{tickformat:U.delta.valueformat},U._range);ge.setScale(),s.prepTicks(ge);var he=function(oe){return s.tickText(ge,oe).text},de=U.delta.suffix,se=U.delta.prefix,Tt=function(oe){var Te=U.delta.relative?oe.relativeDelta:oe.delta;return Te},Lt=function(oe,Te){return oe===0||typeof oe!="number"||isNaN(oe)?"-":(oe>0?U.delta.increasing.symbol:U.delta.decreasing.symbol)+se+Te(oe)+de},Mt=function(oe){return oe.delta>=0?U.delta.increasing.color:U.delta.decreasing.color};U._deltaLastValue===void 0&&(U._deltaLastValue=Tt(H[0]));var te=st.select("text.delta");te.call(n.font,U.delta.font).call(v.fill,Mt({delta:U._deltaLastValue}));function ve(){te.text(Lt(Tt(H[0]),he)).call(v.fill,Mt(H[0])).call(i.convertToTspans,N)}return _(yt)?te.transition().duration(yt.duration).ease(yt.easing).tween("text",function(){var oe=c.select(this),Te=Tt(H[0]),He=U._deltaLastValue,Ge=it(U.delta.valueformat,he,He,Te),cr=P(He,Te);return U._deltaLastValue=Te,function(ur){oe.text(Lt(cr(ur),Ge)),oe.call(v.fill,Mt({delta:cr(ur)}))}}).each("end",function(){ve(),pt&&pt()}).each("interrupt",function(){ve(),pt&&pt()}):ve(),dt=R(Lt(Tt(H[0]),he),U.delta.font,lt,N),te}var ut=U.mode+U.align,wt;if(U._hasDelta&&(wt=ft(),ut+=U.delta.position+U.delta.font.size+U.delta.font.family+U.delta.valueformat,ut+=U.delta.increasing.symbol+U.delta.decreasing.symbol,rt=dt),U._hasNumber&&(Y(),ut+=U.number.font.size+U.number.font.family+U.number.valueformat+U.number.suffix+U.number.prefix,rt=tt),U._hasDelta&&U._hasNumber){var zt=[(tt.left+tt.right)/2,(tt.top+tt.bottom)/2],Pt=[(dt.left+dt.right)/2,(dt.top+dt.bottom)/2],Wt,Ht,Jt=.75*U.delta.font.size;U.delta.position==="left"&&(Wt=O(U,"deltaPos",0,-1*(tt.width*u[U.align]+dt.width*(1-u[U.align])+Jt),ut,Math.min),Ht=zt[1]-Pt[1],rt={width:tt.width+dt.width+Jt,height:Math.max(tt.height,dt.height),left:dt.left+Wt,right:tt.right,top:Math.min(tt.top,dt.top+Ht),bottom:Math.max(tt.bottom,dt.bottom+Ht)}),U.delta.position==="right"&&(Wt=O(U,"deltaPos",0,tt.width*(1-u[U.align])+dt.width*u[U.align]+Jt,ut,Math.max),Ht=zt[1]-Pt[1],rt={width:tt.width+dt.width+Jt,height:Math.max(tt.height,dt.height),left:tt.left,right:dt.right+Wt,top:Math.min(tt.top,dt.top+Ht),bottom:Math.max(tt.bottom,dt.bottom+Ht)}),U.delta.position==="bottom"&&(Wt=null,Ht=dt.height,rt={width:Math.max(tt.width,dt.width),height:tt.height+dt.height,left:Math.min(tt.left,dt.left),right:Math.max(tt.right,dt.right),top:tt.bottom-tt.height,bottom:tt.bottom+dt.height}),U.delta.position==="top"&&(Wt=null,Ht=tt.top,rt={width:Math.max(tt.width,dt.width),height:tt.height+dt.height,left:Math.min(tt.left,dt.left),right:Math.max(tt.right,dt.right),top:tt.bottom-tt.height-dt.height,bottom:tt.bottom}),wt.attr({dx:Wt,dy:Ht})}(U._hasNumber||U._hasDelta)&&st.attr("transform",function(){var ge=F.numbersScaler(rt);ut+=ge[2];var he=O(U,"numbersScale",1,ge[0],ut,Math.min),de;U._scaleNumbers||(he=1),U._isAngular?de=q-he*rt.bottom:de=q-he*(rt.top+rt.bottom)/2,U._numbersTop=he*rt.top+de;var se=rt[X];X==="center"&&(se=(rt.left+rt.right)/2);var Tt=W-he*se;return Tt=O(U,"numbersTranslate",0,Tt,ut,Math.max),e(Tt,de)+t(he)})}function A(N){N.each(function(V){v.stroke(c.select(this),V.line.color)}).each(function(V){v.fill(c.select(this),V.color)}).style("stroke-width",function(V){return V.line.width})}function h(N,V,H){return function(){var F=g(V,H);return function(U){return N.endAngle(F(U))()}}}function p(N,V,H){var F=N._fullLayout,U=S.extendFlat({type:"linear",ticks:"outside",range:H,showline:!0},V),W={type:"linear",_id:"x"+V._id},q={letter:"x",font:F.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function X(lt,yt){return S.coerce(U,W,y,lt,yt)}return f(U,W,X,q,F),x(U,W,X,q),W}function k(N,V,H){var F=Math.min(V/N.width,H/N.height);return[F,N,V+"x"+H]}function w(N,V){var H=Math.sqrt(N.width/2*(N.width/2)+N.height*N.height),F=V/H;return[F,N,V]}function R(N,V,H,F){var U=document.createElementNS("http://www.w3.org/2000/svg","text"),W=c.select(U);return W.text(N).attr("x",0).attr("y",0).attr("text-anchor",H).attr("data-unformatted",N).call(i.convertToTspans,F).call(n.font,V),n.bBox(W.node())}function O(N,V,H,F,U,W){var q="_cache"+V;N[q]&&N[q].key===U||(N[q]={key:U,value:H});var X=S.aggNums(W,null,[N[q].value,F],2);return N[q].value=X,X}}),hq=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"indicator",basePlotModule:sq(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:ME(),supplyDefaults:lq().supplyDefaults,calc:uq().calc,plot:cq(),meta:{}}}),fq=Ft((Q,$)=>{$.exports=hq()}),EE=Ft((Q,$)=>{var c=gm(),g=Ta().extendFlat,P=Yc().overrideAll,S=Ea(),t=Nh().attributes,e=fh().descriptionOnlyNumbers;$.exports=P({domain:t({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:e("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:g({},c.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:g({},S({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:e("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:g({},c.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:g({},S({arrayOk:!0}))}},"calc","from-root")}),dq=Ft((Q,$)=>{var c=bn(),g=EE(),P=Nh().defaults;function S(t,e){for(var r=t.columnorder||[],a=t.header.values.length,n=r.slice(0,a),o=n.slice().sort(function(f,x){return f-x}),i=n.map(function(f){return o.indexOf(f)}),s=i.length;s<a;s++)i.push(s);e("columnorder",i)}$.exports=function(t,e,r,a){function n(o,i){return c.coerce(t,e,g,o,i)}P(e,a,n),n("columnwidth"),n("header.values"),n("header.format"),n("header.align"),n("header.prefix"),n("header.suffix"),n("header.height"),n("header.line.width"),n("header.line.color"),n("header.fill.color"),c.coerceFont(n,"header.font",a.font),S(e,n),n("cells.values"),n("cells.format"),n("cells.align"),n("cells.prefix"),n("cells.suffix"),n("cells.height"),n("cells.line.width"),n("cells.line.color"),n("cells.fill.color"),c.coerceFont(n,"cells.font",a.font),e._length=null}}),pq=Ft((Q,$)=>{var c=Lg().wrap;$.exports=function(){return c({})}}),CE=Ft((Q,$)=>{$.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"}}}),mq=Ft((Q,$)=>{var c=CE(),g=Ta().extendFlat,P=ra(),S=Va().isTypedArray,t=Va().isArrayOrTypedArray;$.exports=function(x,y){var v=a(y.cells.values),T=function(X){return X.slice(y.header.values.length,X.length)},u=a(y.header.values);u.length&&!u[0].length&&(u[0]=[""],u=a(u));var b=u.concat(T(v).map(function(){return n((u[0]||[""]).length)})),_=y.domain,C=Math.floor(x._fullLayout._size.w*(_.x[1]-_.x[0])),M=Math.floor(x._fullLayout._size.h*(_.y[1]-_.y[0])),E=y.header.values.length?b[0].map(function(){return y.header.height}):[c.emptyHeaderHeight],A=v.length?v[0].map(function(){return y.cells.height}):[],h=E.reduce(r,0),p=M-h,k=p+c.uplift,w=s(A,k),R=s(E,h),O=i(R,[]),N=i(w,O),V={},H=y._fullInput.columnorder;t(H)&&(H=Array.from(H)),H=H.concat(T(v.map(function(X,lt){return lt})));var F=b.map(function(X,lt){var yt=t(y.columnwidth)?y.columnwidth[Math.min(lt,y.columnwidth.length-1)]:y.columnwidth;return P(yt)?Number(yt):1}),U=F.reduce(r,0);F=F.map(function(X){return X/U*C});var W=Math.max(e(y.header.line.width),e(y.cells.line.width)),q={key:y.uid+x._context.staticPlot,translateX:_.x[0]*x._fullLayout._size.w,translateY:x._fullLayout._size.h*(1-_.y[1]),size:x._fullLayout._size,width:C,maxLineWidth:W,height:M,columnOrder:H,groupHeight:M,rowBlocks:N,headerRowBlocks:O,scrollY:0,cells:g({},y.cells,{values:v}),headerCells:g({},y.header,{values:b}),gdColumns:b.map(function(X){return X[0]}),gdColumnsOriginalOrder:b.map(function(X){return X[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:b.map(function(X,lt){var yt=V[X];V[X]=(yt||0)+1;var pt=X+"__"+V[X];return{key:pt,label:X,specIndex:lt,xIndex:H[lt],xScale:o,x:void 0,calcdata:void 0,columnWidth:F[lt]}})};return q.columns.forEach(function(X){X.calcdata=q,X.x=o(X)}),q};function e(x){if(t(x)){for(var y=0,v=0;v<x.length;v++)y=Math.max(y,e(x[v]));return y}return x}function r(x,y){return x+y}function a(x){var y=x.slice(),v=1/0,T=0,u;for(u=0;u<y.length;u++)S(y[u])?y[u]=Array.from(y[u]):t(y[u])||(y[u]=[y[u]]),v=Math.min(v,y[u].length),T=Math.max(T,y[u].length);if(v!==T)for(u=0;u<y.length;u++){var b=T-y[u].length;b&&(y[u]=y[u].concat(n(b)))}return y}function n(x){for(var y=new Array(x),v=0;v<x;v++)y[v]="";return y}function o(x){return x.calcdata.columns.reduce(function(y,v){return v.xIndex<x.xIndex?y+v.columnWidth:y},0)}function i(x,y){var v=Object.keys(x);return v.map(function(T){return g({},x[T],{auxiliaryBlocks:y})})}function s(x,y){for(var v={},T,u=0,b=0,_=f(),C=0,M=0,E=0;E<x.length;E++)T=x[E],_.rows.push({rowIndex:E,rowHeight:T}),b+=T,(b>=y||E===x.length-1)&&(v[u]=_,_.key=M++,_.firstRowIndex=C,_.lastRowIndex=E,_=f(),u+=b,C=E+1,b=0);return v}function f(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}),gq=Ft(Q=>{var $=Ta().extendFlat;Q.splitToPanels=function(g){var P=[0,0],S=$({},g,{key:"header",type:"header",page:0,prevPages:P,currentRepaint:[null,null],dragHandle:!0,values:g.calcdata.headerCells.values[g.specIndex],rowBlocks:g.calcdata.headerRowBlocks,calcdata:$({},g.calcdata,{cells:g.calcdata.headerCells})}),t=$({},g,{key:"cells1",type:"cells",page:0,prevPages:P,currentRepaint:[null,null],dragHandle:!1,values:g.calcdata.cells.values[g.specIndex],rowBlocks:g.calcdata.rowBlocks}),e=$({},g,{key:"cells2",type:"cells",page:1,prevPages:P,currentRepaint:[null,null],dragHandle:!1,values:g.calcdata.cells.values[g.specIndex],rowBlocks:g.calcdata.rowBlocks});return[t,e,S]},Q.splitToCells=function(g){var P=c(g);return(g.values||[]).slice(P[0],P[1]).map(function(S,t){var e=typeof S=="string"&&S.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:t+e,key:P[0]+t,column:g,calcdata:g.calcdata,page:g.page,rowBlocks:g.rowBlocks,value:S}})};function c(g){var P=g.rowBlocks[g.page],S=P?P.rows[0].rowIndex:0,t=P?S+P.rows.length:0;return[S,t]}}),LE=Ft((Q,$)=>{var c=CE(),g=un(),P=bn(),S=P.numberFormat,t=Lg(),e=js(),r=tc(),a=bn().raiseToTop,n=bn().strTranslate,o=bn().cancelTransition,i=mq(),s=gq(),f=li();$.exports=function(ft,ut){var wt=!ft._context.staticPlot,zt=ft._fullLayout._paper.selectAll("."+c.cn.table).data(ut.map(function(oe){var Te=t.unwrap(oe),He=Te.trace;return i(ft,He)}),t.keyFun);zt.exit().remove(),zt.enter().append("g").classed(c.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),zt.attr("width",function(oe){return oe.width+oe.size.l+oe.size.r}).attr("height",function(oe){return oe.height+oe.size.t+oe.size.b}).attr("transform",function(oe){return n(oe.translateX,oe.translateY)});var Pt=zt.selectAll("."+c.cn.tableControlView).data(t.repeat,t.keyFun),Wt=Pt.enter().append("g").classed(c.cn.tableControlView,!0).style("box-sizing","content-box");if(wt){var Ht="onwheel"in document?"wheel":"mousewheel";Wt.on("mousemove",function(oe){Pt.filter(function(Te){return oe===Te}).call(u,ft)}).on(Ht,function(oe){if(!oe.scrollbarState.wheeling){oe.scrollbarState.wheeling=!0;var Te=oe.scrollY+g.event.deltaY,He=lt(ft,Pt,null,Te)(oe);He||(g.event.stopPropagation(),g.event.preventDefault()),oe.scrollbarState.wheeling=!1}}).call(u,ft,!0)}Pt.attr("transform",function(oe){return n(oe.size.l,oe.size.t)});var Jt=Pt.selectAll("."+c.cn.scrollBackground).data(t.repeat,t.keyFun);Jt.enter().append("rect").classed(c.cn.scrollBackground,!0).attr("fill","none"),Jt.attr("width",function(oe){return oe.width}).attr("height",function(oe){return oe.height}),Pt.each(function(oe){e.setClipUrl(g.select(this),y(ft,oe),ft)});var ge=Pt.selectAll("."+c.cn.yColumn).data(function(oe){return oe.columns},t.keyFun);ge.enter().append("g").classed(c.cn.yColumn,!0),ge.exit().remove(),ge.attr("transform",function(oe){return n(oe.x,0)}),wt&&ge.call(g.behavior.drag().origin(function(oe){var Te=g.select(this);return H(Te,oe,-c.uplift),a(this),oe.calcdata.columnDragInProgress=!0,u(Pt.filter(function(He){return oe.calcdata.key===He.key}),ft),oe}).on("drag",function(oe){var Te=g.select(this),He=function(ur){return(oe===ur?g.event.x:ur.x)+ur.columnWidth/2};oe.x=Math.max(-c.overdrag,Math.min(oe.calcdata.width+c.overdrag-oe.columnWidth,g.event.x));var Ge=T(ge).filter(function(ur){return ur.calcdata.key===oe.calcdata.key}),cr=Ge.sort(function(ur,jr){return He(ur)-He(jr)});cr.forEach(function(ur,jr){ur.xIndex=jr,ur.x=oe===ur?ur.x:ur.xScale(ur)}),ge.filter(function(ur){return oe!==ur}).transition().ease(c.transitionEase).duration(c.transitionDuration).attr("transform",function(ur){return n(ur.x,0)}),Te.call(o).attr("transform",n(oe.x,-c.uplift))}).on("dragend",function(oe){var Te=g.select(this),He=oe.calcdata;oe.x=oe.xScale(oe),oe.calcdata.columnDragInProgress=!1,H(Te,oe,0),N(ft,He,He.columns.map(function(Ge){return Ge.xIndex}))})),ge.each(function(oe){e.setClipUrl(g.select(this),v(ft,oe),ft)});var he=ge.selectAll("."+c.cn.columnBlock).data(s.splitToPanels,t.keyFun);he.enter().append("g").classed(c.cn.columnBlock,!0).attr("id",function(oe){return oe.key}),he.style("cursor",function(oe){return oe.dragHandle?"ew-resize":oe.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var de=he.filter(U),se=he.filter(F);wt&&se.call(g.behavior.drag().origin(function(oe){return g.event.stopPropagation(),oe}).on("drag",lt(ft,Pt,-1)).on("dragend",function(){})),b(ft,Pt,de,he),b(ft,Pt,se,he);var Tt=Pt.selectAll("."+c.cn.scrollAreaClip).data(t.repeat,t.keyFun);Tt.enter().append("clipPath").classed(c.cn.scrollAreaClip,!0).attr("id",function(oe){return y(ft,oe)});var Lt=Tt.selectAll("."+c.cn.scrollAreaClipRect).data(t.repeat,t.keyFun);Lt.enter().append("rect").classed(c.cn.scrollAreaClipRect,!0).attr("x",-c.overdrag).attr("y",-c.uplift).attr("fill","none"),Lt.attr("width",function(oe){return oe.width+2*c.overdrag}).attr("height",function(oe){return oe.height+c.uplift});var Mt=ge.selectAll("."+c.cn.columnBoundary).data(t.repeat,t.keyFun);Mt.enter().append("g").classed(c.cn.columnBoundary,!0);var te=ge.selectAll("."+c.cn.columnBoundaryClippath).data(t.repeat,t.keyFun);te.enter().append("clipPath").classed(c.cn.columnBoundaryClippath,!0),te.attr("id",function(oe){return v(ft,oe)});var ve=te.selectAll("."+c.cn.columnBoundaryRect).data(t.repeat,t.keyFun);ve.enter().append("rect").classed(c.cn.columnBoundaryRect,!0).attr("fill","none"),ve.attr("width",function(oe){return oe.columnWidth+2*x(oe)}).attr("height",function(oe){return oe.calcdata.height+2*x(oe)+c.uplift}).attr("x",function(oe){return-x(oe)}).attr("y",function(oe){return-x(oe)}),X(null,se,Pt)};function x(ft){return Math.ceil(ft.calcdata.maxLineWidth/2)}function y(ft,ut){return"clip"+ft._fullLayout._uid+"_scrollAreaBottomClip_"+ut.key}function v(ft,ut){return"clip"+ft._fullLayout._uid+"_columnBoundaryClippath_"+ut.calcdata.key+"_"+ut.specIndex}function T(ft){return[].concat.apply([],ft.map(function(ut){return ut})).map(function(ut){return ut.__data__})}function u(ft,ut,wt){function zt(he){var de=he.rowBlocks;return rt(de,de.length-1)+(de.length?at(de[de.length-1],1/0):1)}var Pt=ft.selectAll("."+c.cn.scrollbarKit).data(t.repeat,t.keyFun);Pt.enter().append("g").classed(c.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Pt.each(function(he){var de=he.scrollbarState;de.totalHeight=zt(he),de.scrollableAreaHeight=he.groupHeight-W(he),de.currentlyVisibleHeight=Math.min(de.totalHeight,de.scrollableAreaHeight),de.ratio=de.currentlyVisibleHeight/de.totalHeight,de.barLength=Math.max(de.ratio*de.currentlyVisibleHeight,c.goldenRatio*c.scrollbarWidth),de.barWiggleRoom=de.currentlyVisibleHeight-de.barLength,de.wiggleRoom=Math.max(0,de.totalHeight-de.scrollableAreaHeight),de.topY=de.barWiggleRoom===0?0:he.scrollY/de.wiggleRoom*de.barWiggleRoom,de.bottomY=de.topY+de.barLength,de.dragMultiplier=de.wiggleRoom/de.barWiggleRoom}).attr("transform",function(he){var de=he.width+c.scrollbarWidth/2+c.scrollbarOffset;return n(de,W(he))});var Wt=Pt.selectAll("."+c.cn.scrollbar).data(t.repeat,t.keyFun);Wt.enter().append("g").classed(c.cn.scrollbar,!0);var Ht=Wt.selectAll("."+c.cn.scrollbarSlider).data(t.repeat,t.keyFun);Ht.enter().append("g").classed(c.cn.scrollbarSlider,!0),Ht.attr("transform",function(he){return n(0,he.scrollbarState.topY||0)});var Jt=Ht.selectAll("."+c.cn.scrollbarGlyph).data(t.repeat,t.keyFun);Jt.enter().append("line").classed(c.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",c.scrollbarWidth).attr("stroke-linecap","round").attr("y1",c.scrollbarWidth/2),Jt.attr("y2",function(he){return he.scrollbarState.barLength-c.scrollbarWidth/2}).attr("stroke-opacity",function(he){return he.columnDragInProgress||!he.scrollbarState.barWiggleRoom||wt?0:.4}),Jt.transition().delay(0).duration(0),Jt.transition().delay(c.scrollbarHideDelay).duration(c.scrollbarHideDuration).attr("stroke-opacity",0);var ge=Wt.selectAll("."+c.cn.scrollbarCaptureZone).data(t.repeat,t.keyFun);ge.enter().append("line").classed(c.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",c.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(he){var de=g.event.y,se=this.getBoundingClientRect(),Tt=he.scrollbarState,Lt=de-se.top,Mt=g.scale.linear().domain([0,Tt.scrollableAreaHeight]).range([0,Tt.totalHeight]).clamp(!0);Tt.topY<=Lt&&Lt<=Tt.bottomY||lt(ut,ft,null,Mt(Lt-Tt.barLength/2))(he)}).call(g.behavior.drag().origin(function(he){return g.event.stopPropagation(),he.scrollbarState.scrollbarScrollInProgress=!0,he}).on("drag",lt(ut,ft)).on("dragend",function(){})),ge.attr("y2",function(he){return he.scrollbarState.scrollableAreaHeight}),ut._context.staticPlot&&(Jt.remove(),ge.remove())}function b(ft,ut,wt,zt){var Pt=_(wt),Wt=C(Pt);h(Wt);var Ht=M(Wt);k(Ht);var Jt=A(Wt),ge=E(Jt);p(ge),w(ge,ut,zt,ft),dt(Wt)}function _(ft){var ut=ft.selectAll("."+c.cn.columnCells).data(t.repeat,t.keyFun);return ut.enter().append("g").classed(c.cn.columnCells,!0),ut.exit().remove(),ut}function C(ft){var ut=ft.selectAll("."+c.cn.columnCell).data(s.splitToCells,function(wt){return wt.keyWithinBlock});return ut.enter().append("g").classed(c.cn.columnCell,!0),ut.exit().remove(),ut}function M(ft){var ut=ft.selectAll("."+c.cn.cellRect).data(t.repeat,function(wt){return wt.keyWithinBlock});return ut.enter().append("rect").classed(c.cn.cellRect,!0),ut}function E(ft){var ut=ft.selectAll("."+c.cn.cellText).data(t.repeat,function(wt){return wt.keyWithinBlock});return ut.enter().append("text").classed(c.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){g.event.stopPropagation()}),ut}function A(ft){var ut=ft.selectAll("."+c.cn.cellTextHolder).data(t.repeat,function(wt){return wt.keyWithinBlock});return ut.enter().append("g").classed(c.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),ut}function h(ft){ft.each(function(ut,wt){var zt=ut.calcdata.cells.font,Pt=ut.column.specIndex,Wt={size:V(zt.size,Pt,wt),color:V(zt.color,Pt,wt),family:V(zt.family,Pt,wt),weight:V(zt.weight,Pt,wt),style:V(zt.style,Pt,wt),variant:V(zt.variant,Pt,wt),textcase:V(zt.textcase,Pt,wt),lineposition:V(zt.lineposition,Pt,wt),shadow:V(zt.shadow,Pt,wt)};ut.rowNumber=ut.key,ut.align=V(ut.calcdata.cells.align,Pt,wt),ut.cellBorderWidth=V(ut.calcdata.cells.line.width,Pt,wt),ut.font=Wt})}function p(ft){ft.each(function(ut){e.font(g.select(this),ut.font)})}function k(ft){ft.attr("width",function(ut){return ut.column.columnWidth}).attr("stroke-width",function(ut){return ut.cellBorderWidth}).each(function(ut){var wt=g.select(this);f.stroke(wt,V(ut.calcdata.cells.line.color,ut.column.specIndex,ut.rowNumber)),f.fill(wt,V(ut.calcdata.cells.fill.color,ut.column.specIndex,ut.rowNumber))})}function w(ft,ut,wt,zt){ft.text(function(Pt){var Wt=Pt.column.specIndex,Ht=Pt.rowNumber,Jt=Pt.value,ge=typeof Jt=="string",he=ge&&Jt.match(/<br>/i),de=!ge||he;Pt.mayHaveMarkup=ge&&Jt.match(/[<&>]/);var se=R(Jt);Pt.latex=se;var Tt=se?"":V(Pt.calcdata.cells.prefix,Wt,Ht)||"",Lt=se?"":V(Pt.calcdata.cells.suffix,Wt,Ht)||"",Mt=se?null:V(Pt.calcdata.cells.format,Wt,Ht)||null,te=Tt+(Mt?S(Mt)(Pt.value):Pt.value)+Lt,ve;Pt.wrappingNeeded=!Pt.wrapped&&!de&&!se&&(ve=O(te)),Pt.cellHeightMayIncrease=he||se||Pt.mayHaveMarkup||(ve===void 0?O(te):ve),Pt.needsConvertToTspans=Pt.mayHaveMarkup||Pt.wrappingNeeded||Pt.latex;var oe;if(Pt.wrappingNeeded){var Te=c.wrapSplitCharacter===" "?te.replace(/<a href=/ig,"<a_href="):te,He=Te.split(c.wrapSplitCharacter),Ge=c.wrapSplitCharacter===" "?He.map(function(cr){return cr.replace(/<a_href=/ig,"<a href=")}):He;Pt.fragments=Ge.map(function(cr){return{text:cr,width:null}}),Pt.fragments.push({fragment:c.wrapSpacer,width:null}),oe=Ge.join(c.lineBreaker)+c.lineBreaker+c.wrapSpacer}else delete Pt.fragments,oe=te;return oe}).attr("dy",function(Pt){return Pt.needsConvertToTspans?0:"0.75em"}).each(function(Pt){var Wt=this,Ht=g.select(Wt),Jt=Pt.wrappingNeeded?pt:st;Pt.needsConvertToTspans?r.convertToTspans(Ht,zt,Jt(wt,Wt,ut,zt,Pt)):g.select(Wt.parentNode).attr("transform",function(ge){return n(tt(ge),c.cellPad)}).attr("text-anchor",function(ge){return{left:"start",center:"middle",right:"end"}[ge.align]})})}function R(ft){return typeof ft=="string"&&ft.match(c.latexCheck)}function O(ft){return ft.indexOf(c.wrapSplitCharacter)!==-1}function N(ft,ut,wt){var zt=ut.gdColumnsOriginalOrder;ut.gdColumns.sort(function(Pt,Wt){return wt[zt.indexOf(Pt)]-wt[zt.indexOf(Wt)]}),ut.columnorder=wt,ft.emit("plotly_restyle")}function V(ft,ut,wt){if(P.isArrayOrTypedArray(ft)){var zt=ft[Math.min(ut,ft.length-1)];return P.isArrayOrTypedArray(zt)?zt[Math.min(wt,zt.length-1)]:zt}else return ft}function H(ft,ut,wt){ft.transition().ease(c.releaseTransitionEase).duration(c.releaseTransitionDuration).attr("transform",n(ut.x,wt))}function F(ft){return ft.type==="cells"}function U(ft){return ft.type==="header"}function W(ft){var ut=ft.rowBlocks.length?ft.rowBlocks[0].auxiliaryBlocks:[];return ut.reduce(function(wt,zt){return wt+at(zt,1/0)},0)}function q(ft,ut,wt){for(var zt=[],Pt=0,Wt=0;Wt<ft.length;Wt++){for(var Ht=ft[Wt],Jt=Ht.rows,ge=0,he=0;he<Jt.length;he++)ge+=Jt[he].rowHeight;Ht.allRowsHeight=ge;var de=Pt+ge,se=ut,Tt=se+wt;se<de&&Tt>Pt&&zt.push(Wt),Pt+=ge}return zt}function X(ft,ut,wt){var zt=T(ut)[0];if(zt!==void 0){var Pt=zt.rowBlocks,Wt=zt.calcdata,Ht=rt(Pt,Pt.length),Jt=zt.calcdata.groupHeight-W(zt),ge=Wt.scrollY=Math.max(0,Math.min(Ht-Jt,Wt.scrollY)),he=q(Pt,ge,Jt);he.length===1&&(he[0]===Pt.length-1?he.unshift(he[0]-1):he.push(he[0]+1)),he[0]%2&&he.reverse(),ut.each(function(de,se){de.page=he[se],de.scrollY=ge}),ut.attr("transform",function(de){var se=rt(de.rowBlocks,de.page)-de.scrollY;return n(0,se)}),ft&&(yt(ft,wt,ut,he,zt.prevPages,zt,0),yt(ft,wt,ut,he,zt.prevPages,zt,1),u(wt,ft))}}function lt(ft,ut,wt,zt){return function(Pt){var Wt=Pt.calcdata?Pt.calcdata:Pt,Ht=ut.filter(function(de){return Wt.key===de.key}),Jt=wt||Wt.scrollbarState.dragMultiplier,ge=Wt.scrollY;Wt.scrollY=zt===void 0?Wt.scrollY+Jt*g.event.dy:zt;var he=Ht.selectAll("."+c.cn.yColumn).selectAll("."+c.cn.columnBlock).filter(F);return X(ft,he,Ht),Wt.scrollY===ge}}function yt(ft,ut,wt,zt,Pt,Wt,Ht){var Jt=zt[Ht]!==Pt[Ht];Jt&&(clearTimeout(Wt.currentRepaint[Ht]),Wt.currentRepaint[Ht]=setTimeout(function(){var ge=wt.filter(function(he,de){return de===Ht&&zt[de]!==Pt[de]});b(ft,ut,ge,wt),Pt[Ht]=zt[Ht]}))}function pt(ft,ut,wt,zt){return function(){var Pt=g.select(ut.parentNode);Pt.each(function(Wt){var Ht=Wt.fragments;Pt.selectAll("tspan.line").each(function(Mt,te){Ht[te].width=this.getComputedTextLength()});var Jt=Ht[Ht.length-1].width,ge=Ht.slice(0,-1),he=[],de,se,Tt=0,Lt=Wt.column.columnWidth-2*c.cellPad;for(Wt.value="";ge.length;)de=ge.shift(),se=de.width+Jt,Tt+se>Lt&&(Wt.value+=he.join(c.wrapSpacer)+c.lineBreaker,he=[],Tt=0),he.push(de.text),Tt+=se;Tt&&(Wt.value+=he.join(c.wrapSpacer)),Wt.wrapped=!0}),Pt.selectAll("tspan.line").remove(),w(Pt.select("."+c.cn.cellText),wt,ft,zt),g.select(ut.parentNode.parentNode).call(dt)}}function st(ft,ut,wt,zt,Pt){return function(){if(!Pt.settledY){var Wt=g.select(ut.parentNode),Ht=it(Pt),Jt=Pt.key-Ht.firstRowIndex,ge=Ht.rows[Jt].rowHeight,he=Pt.cellHeightMayIncrease?ut.parentNode.getBoundingClientRect().height+2*c.cellPad:ge,de=Math.max(he,ge),se=de-Ht.rows[Jt].rowHeight;se&&(Ht.rows[Jt].rowHeight=de,ft.selectAll("."+c.cn.columnCell).call(dt),X(null,ft.filter(F),0),u(wt,zt,!0)),Wt.attr("transform",function(){var Tt=this,Lt=Tt.parentNode,Mt=Lt.getBoundingClientRect(),te=g.select(Tt.parentNode).select("."+c.cn.cellRect).node().getBoundingClientRect(),ve=Tt.transform.baseVal.consolidate(),oe=te.top-Mt.top+(ve?ve.matrix.f:c.cellPad);return n(tt(Pt,g.select(Tt.parentNode).select("."+c.cn.cellTextHolder).node().getBoundingClientRect().width),oe)}),Pt.settledY=!0}}}function tt(ft,ut){switch(ft.align){case"left":return c.cellPad;case"right":return ft.column.columnWidth-(ut||0)-c.cellPad;case"center":return(ft.column.columnWidth-(ut||0))/2;default:return c.cellPad}}function dt(ft){ft.attr("transform",function(ut){var wt=ut.rowBlocks[0].auxiliaryBlocks.reduce(function(Ht,Jt){return Ht+at(Jt,1/0)},0),zt=it(ut),Pt=at(zt,ut.key),Wt=Pt+wt;return n(0,Wt)}).selectAll("."+c.cn.cellRect).attr("height",function(ut){return Y(it(ut),ut.key).rowHeight})}function rt(ft,ut){for(var wt=0,zt=ut-1;zt>=0;zt--)wt+=vt(ft[zt]);return wt}function at(ft,ut){for(var wt=0,zt=0;zt<ft.rows.length&&ft.rows[zt].rowIndex<ut;zt++)wt+=ft.rows[zt].rowHeight;return wt}function vt(ft){var ut=ft.allRowsHeight;if(ut!==void 0)return ut;for(var wt=0,zt=0;zt<ft.rows.length;zt++)wt+=ft.rows[zt].rowHeight;return ft.allRowsHeight=wt,wt}function it(ft){return ft.rowBlocks[ft.page]}function Y(ft,ut){return ft.rows[ut-ft.firstRowIndex]}}),vq=Ft(Q=>{var $=ud().getModuleCalcData,c=LE(),g="table";Q.name=g,Q.plot=function(P){var S=$(P.calcdata,g)[0];S.length&&c(P,S)},Q.clean=function(P,S,t,e){var r=e._has&&e._has(g),a=S._has&&S._has(g);r&&!a&&e._paperdiv.selectAll(".table").remove()}}),yq=Ft((Q,$)=>{$.exports={attributes:EE(),supplyDefaults:dq(),calc:pq(),plot:LE(),moduleType:"trace",name:"table",basePlotModule:vq(),categories:["noOpacity"],meta:{}}}),xq=Ft((Q,$)=>{$.exports=yq()}),_q=Ft((Q,$)=>{var c=Ea(),g=bi(),P=Ad(),S=fh().descriptionWithDates,t=Yc().overrideAll,e=Td().dash,r=Ta().extendFlat;$.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:c({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:P.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({},P.labelalias,{editType:"calc"}),tickfont:c({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","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:S("tick label")},tickformatstops:t(P.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:g.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:r({},e,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:r({},e,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:g.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}),_T=Ft((Q,$)=>{var c=Ea(),g=_q(),P=bi(),S=c({editType:"calc"}),t=tf().zorder;S.family.dflt='"Open Sans", verdana, arial, sans-serif',S.size.dflt=12,S.color.dflt=P.defaultLine,$.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:g,baxis:g,font:S,color:{valType:"color",dflt:P.defaultLine,editType:"plot"},zorder:t}}),bq=Ft((Q,$)=>{var c=bn().isArray1D;$.exports=function(g,P,S){var t=S("x"),e=t&&t.length,r=S("y"),a=r&&r.length;if(!e&&!a)return!1;if(P._cheater=!t,(!e||c(t))&&(!a||c(r))){var n=e?t.length:1/0;a&&(n=Math.min(n,r.length)),P.a&&P.a.length&&(n=Math.min(n,P.a.length)),P.b&&P.b.length&&(n=Math.min(n,P.b.length)),P._length=n}else P._length=null;return!0}}),wq=Ft((Q,$)=>{var c=_T(),g=li().addOpacity,P=Xo(),S=bn(),t=mg(),e=n0(),r=dm(),a=jm(),n=i0(),o=dv();$.exports=function(s,f,x){var y=x.letter,v=x.font||{},T=c[y+"axis"];function u(W,q){return S.coerce(s,f,T,W,q)}function b(W,q){return S.coerce2(s,f,T,W,q)}x.name&&(f._name=x.name,f._id=x.name),u("autotypenumbers",x.autotypenumbersDflt);var _=u("type");if(_==="-"&&(x.data&&i(f,x.data),f.type==="-"?f.type="linear":_=s.type=f.type),u("smoothing"),u("cheatertype"),u("showticklabels"),u("labelprefix",y+" = "),u("labelsuffix"),u("showtickprefix"),u("showticksuffix"),u("separatethousands"),u("tickformat"),u("exponentformat"),u("minexponent"),u("showexponent"),u("categoryorder"),u("tickmode"),u("tickvals"),u("ticktext"),u("tick0"),u("dtick"),f.tickmode==="array"&&(u("arraytick0"),u("arraydtick")),u("labelpadding"),f._hovertitle=y,_==="date"){var C=P.getComponentMethod("calendars","handleDefaults");C(s,f,"calendar",x.calendar)}n(f,x.fullLayout),f.c2p=S.identity;var M=u("color",x.dfltColor),E=M===s.color?M:v.color,A=u("title.text");A&&(S.coerceFont(u,"title.font",v,{overrideDflt:{size:S.bigFont(v.size),color:E}}),u("title.offset")),u("tickangle");var h=u("autorange",!f.isValidRange(s.range));h&&u("rangemode"),u("range"),f.cleanRange(),u("fixedrange"),t(s,f,u,_),r(s,f,u,_,x),e(s,f,u,_,x),a(s,f,u,{data:x.data,dataAttr:y});var p=b("gridcolor",g(M,.3)),k=b("gridwidth"),w=b("griddash"),R=u("showgrid");R||(delete f.gridcolor,delete f.gridwidth,delete f.griddash);var O=b("startlinecolor",M),N=b("startlinewidth",k),V=u("startline",f.showgrid||!!O||!!N);V||(delete f.startlinecolor,delete f.startlinewidth);var H=b("endlinecolor",M),F=b("endlinewidth",k),U=u("endline",f.showgrid||!!H||!!F);return U||(delete f.endlinecolor,delete f.endlinewidth),R?(u("minorgridcount"),u("minorgridwidth",k),u("minorgriddash",w),u("minorgridcolor",g(p,.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,u("tickmode"),f};function i(s,f){if(s.type==="-"){var x=s._id,y=x.charAt(0),v=y+"calendar",T=s[v];s.type=o(f,T,{autotypenumbers:s.autotypenumbers})}}}),kq=Ft((Q,$)=>{var c=wq(),g=pu();$.exports=function(S,t,e,r,a){var n=r("a");n||(r("da"),r("a0"));var o=r("b");o||(r("db"),r("b0")),P(S,t,e,a)};function P(S,t,e,r){var a=["aaxis","baxis"];a.forEach(function(n){var o=n.charAt(0),i=S[n]||{},s=g.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:S[o],calendar:t.calendar,dfltColor:r,bgColor:e.paper_bgcolor,autotypenumbersDflt:e.autotypenumbers,fullLayout:e};c(i,s,f),s._categories=s._categories||[],!S[n]&&i.type!=="-"&&(S[n]={type:i.type})})}}),Tq=Ft((Q,$)=>{var c=bn(),g=bq(),P=kq(),S=_T(),t=bi();$.exports=function(e,r,a,n){function o(f,x){return c.coerce(e,r,S,f,x)}r._clipPathId="clip"+r.uid+"carpet";var i=o("color",t.defaultLine);if(c.coerceFont(o,"font",n.font),o("carpet"),P(e,r,n,o,i),!r.a||!r.b){r.visible=!1;return}r.a.length<3&&(r.aaxis.smoothing=0),r.b.length<3&&(r.baxis.smoothing=0);var s=g(e,r,o);s||(r.visible=!1),r._cheater&&o("cheaterslope"),o("zorder")}}),PE=Ft((Q,$)=>{var c=bn().isArrayOrTypedArray;$.exports=function(g,P,S){var t;for(c(g)?g.length>P.length&&(g=g.slice(0,P.length)):g=[],t=0;t<P.length;t++)g[t]=S(P[t]);return g}}),zE=Ft((Q,$)=>{$.exports=function(c,g,P){if(c.length===0)return"";var S,t=[],e=P?3:1;for(S=0;S<c.length;S+=e)t.push(c[S]+","+g[S]),P&&S<c.length-e&&(t.push("C"),t.push([c[S+1]+","+g[S+1],c[S+2]+","+g[S+2]+" "].join(" ")));return t.join(P?"":"L")}}),Aq=Ft((Q,$)=>{$.exports=function(c,g,P,S,t,e){var r=t[0]*c.dpdx(g),a=t[1]*c.dpdy(P),n=1,o=1;if(e){var i=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])/i/s;o=Math.max(0,f)}var x=Math.atan2(a,r)*180/Math.PI;return x<-90?(x+=180,n=-n):x>90&&(x-=180,n=-n),{angle:x,flip:n,p:c.c2p(S,g,P),offsetMultplier:o}}}),Mq=Ft((Q,$)=>{var c=un(),g=js(),P=PE(),S=zE(),t=Aq(),e=tc(),r=bn(),a=r.strRotate,n=r.strTranslate,o=Af();$.exports=function(u,b,_,C){var M=u._context.staticPlot,E=b.xaxis,A=b.yaxis,h=u._fullLayout,p=h._clips;r.makeTraceGroups(C,_,"trace").each(function(k){var w=c.select(this),R=k[0],O=R.trace,N=O.aaxis,V=O.baxis,H=r.ensureSingle(w,"g","minorlayer"),F=r.ensureSingle(w,"g","majorlayer"),U=r.ensureSingle(w,"g","boundarylayer"),W=r.ensureSingle(w,"g","labellayer");w.style("opacity",O.opacity),s(E,A,F,N,"a",N._gridlines,!0),s(E,A,F,V,"b",V._gridlines,!0),s(E,A,H,N,"a",N._minorgridlines,!0),s(E,A,H,V,"b",V._minorgridlines,!0),s(E,A,U,N,"a-boundary",N._boundarylines,M),s(E,A,U,V,"b-boundary",V._boundarylines,M);var q=f(u,E,A,O,R,W,N._labels,"a-label"),X=f(u,E,A,O,R,W,V._labels,"b-label");x(u,W,O,R,E,A,q,X),i(O,R,p,E,A)})};function i(u,b,_,C,M){var E,A,h,p,k=_.select("#"+u._clipPathId);k.size()||(k=_.append("clipPath").classed("carpetclip",!0));var w=r.ensureSingle(k,"path","carpetboundary"),R=b.clipsegments,O=[];for(p=0;p<R.length;p++)E=R[p],A=P([],E.x,C.c2p),h=P([],E.y,M.c2p),O.push(S(A,h,E.bicubic));var N="M"+O.join("L")+"Z";k.attr("id",u._clipPathId),w.attr("d",N)}function s(u,b,_,C,M,E,A){var h="const-"+M+"-lines",p=_.selectAll("."+h).data(E);p.enter().append("path").classed(h,!0).style("vector-effect",A?"none":"non-scaling-stroke"),p.each(function(k){var w=k,R=w.x,O=w.y,N=P([],R,u.c2p),V=P([],O,b.c2p),H="M"+S(N,V,w.smoothing),F=c.select(this);F.attr("d",H).style("stroke-width",w.width).style("stroke",w.color).style("stroke-dasharray",g.dashStyle(w.dash,w.width)).style("fill","none")}),p.exit().remove()}function f(u,b,_,C,M,E,A,h){var p=E.selectAll("text."+h).data(A);p.enter().append("text").classed(h,!0);var k=0,w={};return p.each(function(R,O){var N;if(R.axis.tickangle==="auto")N=t(C,b,_,R.xy,R.dxy);else{var V=(R.axis.tickangle+180)*Math.PI/180;N=t(C,b,_,R.xy,[Math.cos(V),Math.sin(V)])}O||(w={angle:N.angle,flip:N.flip});var H=(R.endAnchor?-1:1)*N.flip,F=c.select(this).attr({"text-anchor":H>0?"start":"end","data-notex":1}).call(g.font,R.font).text(R.text).call(e.convertToTspans,u),U=g.bBox(this);F.attr("transform",n(N.p[0],N.p[1])+a(N.angle)+n(R.axis.labelpadding*H,U.height*.3)),k=Math.max(k,U.width+R.axis.labelpadding)}),p.exit().remove(),w.maxExtent=k,w}function x(u,b,_,C,M,E,A,h){var p,k,w,R,O=r.aggNums(Math.min,null,_.a),N=r.aggNums(Math.max,null,_.a),V=r.aggNums(Math.min,null,_.b),H=r.aggNums(Math.max,null,_.b);p=.5*(O+N),k=V,w=_.ab2xy(p,k,!0),R=_.dxyda_rough(p,k),A.angle===void 0&&r.extendFlat(A,t(_,M,E,w,_.dxydb_rough(p,k))),T(u,b,_,C,w,R,_.aaxis,M,E,A,"a-title"),p=O,k=.5*(V+H),w=_.ab2xy(p,k,!0),R=_.dxydb_rough(p,k),h.angle===void 0&&r.extendFlat(h,t(_,M,E,w,_.dxyda_rough(p,k))),T(u,b,_,C,w,R,_.baxis,M,E,h,"b-title")}var y=o.LINE_SPACING,v=(1-o.MID_SHIFT)/y+1;function T(u,b,_,C,M,E,A,h,p,k,w){var R=[];A.title.text&&R.push(A.title.text);var O=b.selectAll("text."+w).data(R),N=k.maxExtent;O.enter().append("text").classed(w,!0),O.each(function(){var V=t(_,h,p,M,E);["start","both"].indexOf(A.showticklabels)===-1&&(N=0);var H=A.title.font.size;N+=H+A.title.offset;var F=k.angle+(k.flip<0?180:0),U=(F-V.angle+450)%360,W=U>90&&U<270,q=c.select(this);q.text(A.title.text).call(e.convertToTspans,u),W&&(N=(-e.lineCount(q)+v)*y*H-N),q.attr("transform",n(V.p[0],V.p[1])+a(V.angle)+n(0,N)).attr("text-anchor","middle").call(g.font,A.title.font)}),O.exit().remove()}}),Sq=Ft((Q,$)=>{var c=bn().isArrayOrTypedArray;$.exports=function(g,P,S){var t,e,r,a,n,o,i=[],s=c(g)?g.length:g,f=c(P)?P.length:P,x=c(g)?g:null,y=c(P)?P:null;x&&(r=(x.length-1)/(x[x.length-1]-x[0])/(s-1)),y&&(a=(y.length-1)/(y[y.length-1]-y[0])/(f-1));var v,T=1/0,u=-1/0;for(e=0;e<f;e++)for(i[e]=[],o=y?(y[e]-y[0])*a:e/(f-1),t=0;t<s;t++)n=x?(x[t]-x[0])*r:t/(s-1),v=n-o*S,T=Math.min(v,T),u=Math.max(v,u),i[e][t]=v;var b=1/(u-T),_=-T*b;for(e=0;e<f;e++)for(t=0;t<s;t++)i[e][t]=b*i[e][t]+_;return i}}),Eq=Ft((Q,$)=>{var c=bn().isArrayOrTypedArray;$.exports=function(P){return g(P,0)};function g(P,S){if(!c(P)||S>=10)return null;for(var t=1/0,e=-1/0,r=P.length,a=0;a<r;a++){var n=P[a];if(c(n)){var o=g(n,S+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]}}),Cq=Ft((Q,$)=>{var c=Es(),g=Ta().extendFlat;$.exports=function(P,S,t){var e,r,a,n,o,i,s,f,x,y,v,T,u,b,_=P["_"+S],C=P[S+"axis"],M=C._gridlines=[],E=C._minorgridlines=[],A=C._boundarylines=[],h=P["_"+t],p=P[t+"axis"];C.tickmode==="array"&&(C.tickvals=_.slice());var k=P._xctrl,w=P._yctrl,R=k[0].length,O=k.length,N=P._a.length,V=P._b.length;c.prepTicks(C),C.tickmode==="array"&&delete C.tickvals;var H=C.smoothing?3:1;function F(W){var q,X,lt,yt,pt,st,tt,dt,rt,at,vt,it,Y=[],ft=[],ut={};if(S==="b")for(X=P.b2j(W),lt=Math.floor(Math.max(0,Math.min(V-2,X))),yt=X-lt,ut.length=V,ut.crossLength=N,ut.xy=function(wt){return P.evalxy([],wt,X)},ut.dxy=function(wt,zt){return P.dxydi([],wt,lt,zt,yt)},q=0;q<N;q++)st=Math.min(N-2,q),tt=q-st,dt=P.evalxy([],q,X),p.smoothing&&q>0&&(rt=P.dxydi([],q-1,lt,0,yt),Y.push(pt[0]+rt[0]/3),ft.push(pt[1]+rt[1]/3),at=P.dxydi([],q-1,lt,1,yt),Y.push(dt[0]-at[0]/3),ft.push(dt[1]-at[1]/3)),Y.push(dt[0]),ft.push(dt[1]),pt=dt;else for(q=P.a2i(W),st=Math.floor(Math.max(0,Math.min(N-2,q))),tt=q-st,ut.length=N,ut.crossLength=V,ut.xy=function(wt){return P.evalxy([],q,wt)},ut.dxy=function(wt,zt){return P.dxydj([],st,wt,tt,zt)},X=0;X<V;X++)lt=Math.min(V-2,X),yt=X-lt,dt=P.evalxy([],q,X),p.smoothing&&X>0&&(vt=P.dxydj([],st,X-1,tt,0),Y.push(pt[0]+vt[0]/3),ft.push(pt[1]+vt[1]/3),it=P.dxydj([],st,X-1,tt,1),Y.push(dt[0]-it[0]/3),ft.push(dt[1]-it[1]/3)),Y.push(dt[0]),ft.push(dt[1]),pt=dt;return ut.axisLetter=S,ut.axis=C,ut.crossAxis=p,ut.value=W,ut.constvar=t,ut.index=f,ut.x=Y,ut.y=ft,ut.smoothing=p.smoothing,ut}function U(W){var q,X,lt,yt,pt,st=[],tt=[],dt={};if(dt.length=_.length,dt.crossLength=h.length,S==="b")for(lt=Math.max(0,Math.min(V-2,W)),pt=Math.min(1,Math.max(0,W-lt)),dt.xy=function(rt){return P.evalxy([],rt,W)},dt.dxy=function(rt,at){return P.dxydi([],rt,lt,at,pt)},q=0;q<R;q++)st[q]=k[W*H][q],tt[q]=w[W*H][q];else for(X=Math.max(0,Math.min(N-2,W)),yt=Math.min(1,Math.max(0,W-X)),dt.xy=function(rt){return P.evalxy([],W,rt)},dt.dxy=function(rt,at){return P.dxydj([],X,rt,yt,at)},q=0;q<O;q++)st[q]=k[q][W*H],tt[q]=w[q][W*H];return dt.axisLetter=S,dt.axis=C,dt.crossAxis=p,dt.value=_[W],dt.constvar=t,dt.index=W,dt.x=st,dt.y=tt,dt.smoothing=p.smoothing,dt}if(C.tickmode==="array"){for(n=5e-15,o=[Math.floor((_.length-1-C.arraytick0)/C.arraydtick*(1+n)),Math.ceil(-C.arraytick0/C.arraydtick/(1+n))].sort(function(W,q){return W-q}),i=o[0]-1,s=o[1]+1,f=i;f<s;f++)r=C.arraytick0+C.arraydtick*f,!(r<0||r>_.length-1)&&M.push(g(U(r),{color:C.gridcolor,width:C.gridwidth,dash:C.griddash}));for(f=i;f<s;f++)if(a=C.arraytick0+C.arraydtick*f,v=Math.min(a+C.arraydtick,_.length-1),!(a<0||a>_.length-1)&&!(v<0||v>_.length-1))for(T=_[a],u=_[v],e=0;e<C.minorgridcount;e++)b=v-a,!(b<=0)&&(y=T+(u-T)*(e+1)/(C.minorgridcount+1)*(C.arraydtick/b),!(y<_[0]||y>_[_.length-1])&&E.push(g(F(y),{color:C.minorgridcolor,width:C.minorgridwidth,dash:C.minorgriddash})));C.startline&&A.push(g(U(0),{color:C.startlinecolor,width:C.startlinewidth})),C.endline&&A.push(g(U(_.length-1),{color:C.endlinecolor,width:C.endlinewidth}))}else{for(n=5e-15,o=[Math.floor((_[_.length-1]-C.tick0)/C.dtick*(1+n)),Math.ceil((_[0]-C.tick0)/C.dtick/(1+n))].sort(function(W,q){return W-q}),i=o[0],s=o[1],f=i;f<=s;f++)x=C.tick0+C.dtick*f,M.push(g(F(x),{color:C.gridcolor,width:C.gridwidth,dash:C.griddash}));for(f=i-1;f<s+1;f++)for(x=C.tick0+C.dtick*f,e=0;e<C.minorgridcount;e++)y=x+C.dtick*(e+1)/(C.minorgridcount+1),!(y<_[0]||y>_[_.length-1])&&E.push(g(F(y),{color:C.minorgridcolor,width:C.minorgridwidth,dash:C.minorgriddash}));C.startline&&A.push(g(F(_[0]),{color:C.startlinecolor,width:C.startlinewidth})),C.endline&&A.push(g(F(_[_.length-1]),{color:C.endlinecolor,width:C.endlinewidth}))}}}),Lq=Ft((Q,$)=>{var c=Es(),g=Ta().extendFlat;$.exports=function(P,S){var t,e,r,a,n,o=S._labels=[],i=S._gridlines;for(t=0;t<i.length;t++)n=i[t],["start","both"].indexOf(S.showticklabels)!==-1&&(e=c.tickText(S,n.value),g(e,{prefix:r,suffix:a,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===i.length-1}),o.push(e)),["end","both"].indexOf(S.showticklabels)!==-1&&(e=c.tickText(S,n.value),g(e,{endAnchor:!1,xy:n.xy(n.crossLength-1),dxy:n.dxy(n.crossLength-2,1),axis:n.axis,length:n.crossAxis.length,font:n.axis.tickfont,isFirst:t===0,isLast:t===i.length-1}),o.push(e))}}),Pq=Ft((Q,$)=>{$.exports=function(c,g,P,S){var t,e,r,a=[],n=!!P.smoothing,o=!!S.smoothing,i=c[0].length-1,s=c.length-1;for(t=0,e=[],r=[];t<=i;t++)e[t]=c[0][t],r[t]=g[0][t];for(a.push({x:e,y:r,bicubic:n}),t=0,e=[],r=[];t<=s;t++)e[t]=c[t][i],r[t]=g[t][i];for(a.push({x:e,y:r,bicubic:o}),t=i,e=[],r=[];t>=0;t--)e[i-t]=c[s][t],r[i-t]=g[s][t];for(a.push({x:e,y:r,bicubic:n}),t=s,e=[],r=[];t>=0;t--)e[s-t]=c[t][0],r[s-t]=g[t][0];return a.push({x:e,y:r,bicubic:o}),a}}),zq=Ft((Q,$)=>{var c=bn();$.exports=function(g,P,S){var t,e,r,a=[],n=[],o=g[0].length,i=g.length;function s(X,lt){var yt=0,pt,st=0;return X>0&&(pt=g[lt][X-1])!==void 0&&(st++,yt+=pt),X<o-1&&(pt=g[lt][X+1])!==void 0&&(st++,yt+=pt),lt>0&&(pt=g[lt-1][X])!==void 0&&(st++,yt+=pt),lt<i-1&&(pt=g[lt+1][X])!==void 0&&(st++,yt+=pt),yt/Math.max(1,st)}var f=0;for(t=0;t<o;t++)for(e=0;e<i;e++)g[e][t]===void 0&&(a.push(t),n.push(e),g[e][t]=s(t,e)),f=Math.max(f,Math.abs(g[e][t]));if(!a.length)return g;var x,y,v,T,u,b,_,C,M,E,A,h=1e-5,p=0,k=100,w=0,R=a.length;do{for(p=0,r=0;r<R;r++){t=a[r],e=n[r];var O=0,N=0,V,H,F,U,W,q;t===0?(W=Math.min(o-1,2),F=P[W],U=P[1],V=g[e][W],H=g[e][1],N+=H+(H-V)*(P[0]-U)/(U-F),O++):t===o-1&&(W=Math.max(0,o-3),F=P[W],U=P[o-2],V=g[e][W],H=g[e][o-2],N+=H+(H-V)*(P[o-1]-U)/(U-F),O++),(t===0||t===o-1)&&e>0&&e<i-1&&(x=S[e+1]-S[e],y=S[e]-S[e-1],N+=(y*g[e+1][t]+x*g[e-1][t])/(y+x),O++),e===0?(q=Math.min(i-1,2),F=S[q],U=S[1],V=g[q][t],H=g[1][t],N+=H+(H-V)*(S[0]-U)/(U-F),O++):e===i-1&&(q=Math.max(0,i-3),F=S[q],U=S[i-2],V=g[q][t],H=g[i-2][t],N+=H+(H-V)*(S[i-1]-U)/(U-F),O++),(e===0||e===i-1)&&t>0&&t<o-1&&(x=P[t+1]-P[t],y=P[t]-P[t-1],N+=(y*g[e][t+1]+x*g[e][t-1])/(y+x),O++),O?N/=O:(v=P[t+1]-P[t],T=P[t]-P[t-1],u=S[e+1]-S[e],b=S[e]-S[e-1],_=v*T*(v+T),C=u*b*(u+b),N=(_*(b*g[e+1][t]+u*g[e-1][t])+C*(T*g[e][t+1]+v*g[e][t-1]))/(C*(T+v)+_*(b+u))),M=N-g[e][t],E=M/f,p+=E*E,A=O?0:.85,g[e][t]+=M*(1+A)}p=Math.sqrt(p)}while(w++<k&&p>h);return c.log("Smoother converged to",p,"after",w,"iterations"),g}}),Iq=Ft((Q,$)=>{$.exports={RELATIVE_CULL_TOLERANCE:1e-6}}),Oq=Ft((Q,$)=>{var c=.5;$.exports=function(g,P,S,t){var e=g[0]-P[0],r=g[1]-P[1],a=S[0]-P[0],n=S[1]-P[1],o=Math.pow(e*e+r*r,c/2),i=Math.pow(a*a+n*n,c/2),s=(i*i*e-o*o*a)*t,f=(i*i*r-o*o*n)*t,x=i*(o+i)*3,y=o*(o+i)*3;return[[P[0]+(x&&s/x),P[1]+(x&&f/x)],[P[0]-(y&&s/y),P[1]-(y&&f/y)]]}}),Dq=Ft((Q,$)=>{var c=Oq(),g=bn().ensureArray;function P(S,t,e){var r=-.5*e[0]+1.5*t[0],a=-.5*e[1]+1.5*t[1];return[(2*r+S[0])/3,(2*a+S[1])/3]}$.exports=function(S,t,e,r,a,n){var o,i,s,f,x,y,v,T,u,b,_=e[0].length,C=e.length,M=a?3*_-2:_,E=n?3*C-2:C;for(S=g(S,E),t=g(t,E),s=0;s<E;s++)S[s]=g(S[s],M),t[s]=g(t[s],M);for(i=0,f=0;i<C;i++,f+=n?3:1)for(x=S[f],y=t[f],v=e[i],T=r[i],o=0,s=0;o<_;o++,s+=a?3:1)x[s]=v[o],y[s]=T[o];if(a)for(i=0,f=0;i<C;i++,f+=n?3:1){for(o=1,s=3;o<_-1;o++,s+=3)u=c([e[i][o-1],r[i][o-1]],[e[i][o],r[i][o]],[e[i][o+1],r[i][o+1]],a),S[f][s-1]=u[0][0],t[f][s-1]=u[0][1],S[f][s+1]=u[1][0],t[f][s+1]=u[1][1];b=P([S[f][0],t[f][0]],[S[f][2],t[f][2]],[S[f][3],t[f][3]]),S[f][1]=b[0],t[f][1]=b[1],b=P([S[f][M-1],t[f][M-1]],[S[f][M-3],t[f][M-3]],[S[f][M-4],t[f][M-4]]),S[f][M-2]=b[0],t[f][M-2]=b[1]}if(n)for(s=0;s<M;s++){for(f=3;f<E-3;f+=3)u=c([S[f-3][s],t[f-3][s]],[S[f][s],t[f][s]],[S[f+3][s],t[f+3][s]],n),S[f-1][s]=u[0][0],t[f-1][s]=u[0][1],S[f+1][s]=u[1][0],t[f+1][s]=u[1][1];b=P([S[0][s],t[0][s]],[S[2][s],t[2][s]],[S[3][s],t[3][s]]),S[1][s]=b[0],t[1][s]=b[1],b=P([S[E-1][s],t[E-1][s]],[S[E-3][s],t[E-3][s]],[S[E-4][s],t[E-4][s]]),S[E-2][s]=b[0],t[E-2][s]=b[1]}if(a&&n)for(f=1;f<E;f+=(f+1)%3===0?2:1){for(s=3;s<M-3;s+=3)u=c([S[f][s-3],t[f][s-3]],[S[f][s],t[f][s]],[S[f][s+3],t[f][s+3]],a),S[f][s-1]=.5*(S[f][s-1]+u[0][0]),t[f][s-1]=.5*(t[f][s-1]+u[0][1]),S[f][s+1]=.5*(S[f][s+1]+u[1][0]),t[f][s+1]=.5*(t[f][s+1]+u[1][1]);b=P([S[f][0],t[f][0]],[S[f][2],t[f][2]],[S[f][3],t[f][3]]),S[f][1]=.5*(S[f][1]+b[0]),t[f][1]=.5*(t[f][1]+b[1]),b=P([S[f][M-1],t[f][M-1]],[S[f][M-3],t[f][M-3]],[S[f][M-4],t[f][M-4]]),S[f][M-2]=.5*(S[f][M-2]+b[0]),t[f][M-2]=.5*(t[f][M-2]+b[1])}return[S,t]}}),Fq=Ft((Q,$)=>{$.exports=function(c,g,P,S,t){var e=g-2,r=P-2;return S&&t?function(a,n,o){a||(a=[]);var i,s,f,x,y,v,T=Math.max(0,Math.min(Math.floor(n),e)),u=Math.max(0,Math.min(Math.floor(o),r)),b=Math.max(0,Math.min(1,n-T)),_=Math.max(0,Math.min(1,o-u));T*=3,u*=3;var C=b*b,M=C*b,E=1-b,A=E*E,h=A*E,p=_*_,k=p*_,w=1-_,R=w*w,O=R*w;for(v=0;v<c.length;v++)y=c[v],i=h*y[u][T]+3*(A*b*y[u][T+1]+E*C*y[u][T+2])+M*y[u][T+3],s=h*y[u+1][T]+3*(A*b*y[u+1][T+1]+E*C*y[u+1][T+2])+M*y[u+1][T+3],f=h*y[u+2][T]+3*(A*b*y[u+2][T+1]+E*C*y[u+2][T+2])+M*y[u+2][T+3],x=h*y[u+3][T]+3*(A*b*y[u+3][T+1]+E*C*y[u+3][T+2])+M*y[u+3][T+3],a[v]=O*i+3*(R*_*s+w*p*f)+k*x;return a}:S?function(a,n,o){a||(a=[]);var i=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-i)),x=Math.max(0,Math.min(1,o-s)),y,v,T,u,b,_;i*=3;var C=f*f,M=C*f,E=1-f,A=E*E,h=A*E,p=1-x;for(b=0;b<c.length;b++)_=c[b],y=p*_[s][i]+x*_[s+1][i],v=p*_[s][i+1]+x*_[s+1][i+1],T=p*_[s][i+2]+x*_[s+1][i+1],u=p*_[s][i+3]+x*_[s+1][i+1],a[b]=h*y+3*(A*f*v+E*C*T)+M*u;return a}:t?function(a,n,o){a||(a=[]);var i=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-i)),x=Math.max(0,Math.min(1,o-s)),y,v,T,u,b,_;s*=3;var C=x*x,M=C*x,E=1-x,A=E*E,h=A*E,p=1-f;for(b=0;b<c.length;b++)_=c[b],y=p*_[s][i]+f*_[s][i+1],v=p*_[s+1][i]+f*_[s+1][i+1],T=p*_[s+2][i]+f*_[s+2][i+1],u=p*_[s+3][i]+f*_[s+3][i+1],a[b]=h*y+3*(A*x*v+E*C*T)+M*u;return a}:function(a,n,o){a||(a=[]);var i=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-i)),x=Math.max(0,Math.min(1,o-s)),y,v,T,u,b=1-x,_=1-f;for(T=0;T<c.length;T++)u=c[T],y=_*u[s][i]+f*u[s][i+1],v=_*u[s+1][i]+f*u[s+1][i+1],a[T]=b*y+x*v;return a}}}),Rq=Ft((Q,$)=>{$.exports=function(c,g,P){return g&&P?function(S,t,e,r,a){S||(S=[]);var n,o,i,s,f,x;t*=3,e*=3;var y=r*r,v=1-r,T=v*v,u=v*r*2,b=-3*T,_=3*(T-u),C=3*(u-y),M=3*y,E=a*a,A=E*a,h=1-a,p=h*h,k=p*h;for(x=0;x<c.length;x++)f=c[x],n=b*f[e][t]+_*f[e][t+1]+C*f[e][t+2]+M*f[e][t+3],o=b*f[e+1][t]+_*f[e+1][t+1]+C*f[e+1][t+2]+M*f[e+1][t+3],i=b*f[e+2][t]+_*f[e+2][t+1]+C*f[e+2][t+2]+M*f[e+2][t+3],s=b*f[e+3][t]+_*f[e+3][t+1]+C*f[e+3][t+2]+M*f[e+3][t+3],S[x]=k*n+3*(p*a*o+h*E*i)+A*s;return S}:g?function(S,t,e,r,a){S||(S=[]);var n,o,i,s;t*=3;var f=r*r,x=1-r,y=x*x,v=x*r*2,T=-3*y,u=3*(y-v),b=3*(v-f),_=3*f,C=1-a;for(i=0;i<c.length;i++)s=c[i],n=T*s[e][t]+u*s[e][t+1]+b*s[e][t+2]+_*s[e][t+3],o=T*s[e+1][t]+u*s[e+1][t+1]+b*s[e+1][t+2]+_*s[e+1][t+3],S[i]=C*n+a*o;return S}:P?function(S,t,e,r,a){S||(S=[]);var n,o,i,s,f,x;e*=3;var y=a*a,v=y*a,T=1-a,u=T*T,b=u*T;for(f=0;f<c.length;f++)x=c[f],n=x[e][t+1]-x[e][t],o=x[e+1][t+1]-x[e+1][t],i=x[e+2][t+1]-x[e+2][t],s=x[e+3][t+1]-x[e+3][t],S[f]=b*n+3*(u*a*o+T*y*i)+v*s;return S}:function(S,t,e,r,a){S||(S=[]);var n,o,i,s,f=1-a;for(i=0;i<c.length;i++)s=c[i],n=s[e][t+1]-s[e][t],o=s[e+1][t+1]-s[e+1][t],S[i]=f*n+a*o;return S}}}),Bq=Ft((Q,$)=>{$.exports=function(c,g,P){return g&&P?function(S,t,e,r,a){S||(S=[]);var n,o,i,s,f,x;t*=3,e*=3;var y=r*r,v=y*r,T=1-r,u=T*T,b=u*T,_=a*a,C=1-a,M=C*C,E=C*a*2,A=-3*M,h=3*(M-E),p=3*(E-_),k=3*_;for(x=0;x<c.length;x++)f=c[x],n=A*f[e][t]+h*f[e+1][t]+p*f[e+2][t]+k*f[e+3][t],o=A*f[e][t+1]+h*f[e+1][t+1]+p*f[e+2][t+1]+k*f[e+3][t+1],i=A*f[e][t+2]+h*f[e+1][t+2]+p*f[e+2][t+2]+k*f[e+3][t+2],s=A*f[e][t+3]+h*f[e+1][t+3]+p*f[e+2][t+3]+k*f[e+3][t+3],S[x]=b*n+3*(u*r*o+T*y*i)+v*s;return S}:g?function(S,t,e,r,a){S||(S=[]);var n,o,i,s,f,x;t*=3;var y=a*a,v=y*a,T=1-a,u=T*T,b=u*T;for(f=0;f<c.length;f++)x=c[f],n=x[e+1][t]-x[e][t],o=x[e+1][t+1]-x[e][t+1],i=x[e+1][t+2]-x[e][t+2],s=x[e+1][t+3]-x[e][t+3],S[f]=b*n+3*(u*a*o+T*y*i)+v*s;return S}:P?function(S,t,e,r,a){S||(S=[]);var n,o,i,s;e*=3;var f=1-r,x=a*a,y=1-a,v=y*y,T=y*a*2,u=-3*v,b=3*(v-T),_=3*(T-x),C=3*x;for(i=0;i<c.length;i++)s=c[i],n=u*s[e][t]+b*s[e+1][t]+_*s[e+2][t]+C*s[e+3][t],o=u*s[e][t+1]+b*s[e+1][t+1]+_*s[e+2][t+1]+C*s[e+3][t+1],S[i]=f*n+r*o;return S}:function(S,t,e,r,a){S||(S=[]);var n,o,i,s,f=1-r;for(i=0;i<c.length;i++)s=c[i],n=s[e+1][t]-s[e][t],o=s[e+1][t+1]-s[e][t+1],S[i]=f*n+r*o;return S}}}),Nq=Ft((Q,$)=>{var c=Iq(),g=T_().findBin,P=Dq(),S=Fq(),t=Rq(),e=Bq();$.exports=function(r){var a=r._a,n=r._b,o=a.length,i=n.length,s=r.aaxis,f=r.baxis,x=a[0],y=a[o-1],v=n[0],T=n[i-1],u=a[a.length-1]-a[0],b=n[n.length-1]-n[0],_=u*c.RELATIVE_CULL_TOLERANCE,C=b*c.RELATIVE_CULL_TOLERANCE;x-=_,y+=_,v-=C,T+=C,r.isVisible=function(M,E){return M>x&&M<y&&E>v&&E<T},r.isOccluded=function(M,E){return M<x||M>y||E<v||E>T},r.setScale=function(){var M=r._x,E=r._y,A=P(r._xctrl,r._yctrl,M,E,s.smoothing,f.smoothing);r._xctrl=A[0],r._yctrl=A[1],r.evalxy=S([r._xctrl,r._yctrl],o,i,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(M){var E=Math.max(0,Math.floor(M[0]),o-2),A=M[0]-E;return(1-A)*a[E]+A*a[E+1]},r.j2b=function(M){var E=Math.max(0,Math.floor(M[1]),o-2),A=M[1]-E;return(1-A)*n[E]+A*n[E+1]},r.ij2ab=function(M){return[r.i2a(M[0]),r.j2b(M[1])]},r.a2i=function(M){var E=Math.max(0,Math.min(g(M,a),o-2)),A=a[E],h=a[E+1];return Math.max(0,Math.min(o-1,E+(M-A)/(h-A)))},r.b2j=function(M){var E=Math.max(0,Math.min(g(M,n),i-2)),A=n[E],h=n[E+1];return Math.max(0,Math.min(i-1,E+(M-A)/(h-A)))},r.ab2ij=function(M){return[r.a2i(M[0]),r.b2j(M[1])]},r.i2c=function(M,E){return r.evalxy([],M,E)},r.ab2xy=function(M,E,A){if(!A&&(M<a[0]||M>a[o-1]|E<n[0]||E>n[i-1]))return[!1,!1];var h=r.a2i(M),p=r.b2j(E),k=r.evalxy([],h,p);if(A){var w=0,R=0,O=[],N,V,H,F;M<a[0]?(N=0,V=0,w=(M-a[0])/(a[1]-a[0])):M>a[o-1]?(N=o-2,V=1,w=(M-a[o-1])/(a[o-1]-a[o-2])):(N=Math.max(0,Math.min(o-2,Math.floor(h))),V=h-N),E<n[0]?(H=0,F=0,R=(E-n[0])/(n[1]-n[0])):E>n[i-1]?(H=i-2,F=1,R=(E-n[i-1])/(n[i-1]-n[i-2])):(H=Math.max(0,Math.min(i-2,Math.floor(p))),F=p-H),w&&(r.dxydi(O,N,H,V,F),k[0]+=O[0]*w,k[1]+=O[1]*w),R&&(r.dxydj(O,N,H,V,F),k[0]+=O[0]*R,k[1]+=O[1]*R)}return k},r.c2p=function(M,E,A){return[E.c2p(M[0]),A.c2p(M[1])]},r.p2x=function(M,E,A){return[E.p2c(M[0]),A.p2c(M[1])]},r.dadi=function(M){var E=Math.max(0,Math.min(a.length-2,M));return a[E+1]-a[E]},r.dbdj=function(M){var E=Math.max(0,Math.min(n.length-2,M));return n[E+1]-n[E]},r.dxyda=function(M,E,A,h){var p=r.dxydi(null,M,E,A,h),k=r.dadi(M,A);return[p[0]/k,p[1]/k]},r.dxydb=function(M,E,A,h){var p=r.dxydj(null,M,E,A,h),k=r.dbdj(E,h);return[p[0]/k,p[1]/k]},r.dxyda_rough=function(M,E,A){var h=u*(A||.1),p=r.ab2xy(M+h,E,!0),k=r.ab2xy(M-h,E,!0);return[(p[0]-k[0])*.5/h,(p[1]-k[1])*.5/h]},r.dxydb_rough=function(M,E,A){var h=b*(A||.1),p=r.ab2xy(M,E+h,!0),k=r.ab2xy(M,E-h,!0);return[(p[0]-k[0])*.5/h,(p[1]-k[1])*.5/h]},r.dpdx=function(M){return M._m},r.dpdy=function(M){return M._m}}}),jq=Ft((Q,$)=>{var c=Es(),g=bn().isArray1D,P=Sq(),S=Eq(),t=Cq(),e=Lq(),r=Pq(),a=B6(),n=zq(),o=R6(),i=Nq();$.exports=function(s,f){var x=c.getFromId(s,f.xaxis),y=c.getFromId(s,f.yaxis),v=f.aaxis,T=f.baxis,u=f.x,b=f.y,_=[];u&&g(u)&&_.push("x"),b&&g(b)&&_.push("y"),_.length&&o(f,v,T,"a","b",_);var C=f._a=f._a||f.a,M=f._b=f._b||f.b;u=f._x||f.x,b=f._y||f.y;var E={};if(f._cheater){var A=v.cheatertype==="index"?C.length:C,h=T.cheatertype==="index"?M.length:M;u=P(A,h,f.cheaterslope)}f._x=u=a(u),f._y=b=a(b),n(u,C,M),n(b,C,M),i(f),f.setScale();var p=S(u),k=S(b),w=.5*(p[1]-p[0]),R=.5*(p[1]+p[0]),O=.5*(k[1]-k[0]),N=.5*(k[1]+k[0]),V=1.3;return p=[R-w*V,R+w*V],k=[N-O*V,N+O*V],f._extremes[x._id]=c.findExtremes(x,p,{padded:!0}),f._extremes[y._id]=c.findExtremes(y,k,{padded:!0}),t(f,"a","b"),t(f,"b","a"),e(f,v),e(f,T),E.clipsegments=r(f._xctrl,f._yctrl,v,T),E.x=u,E.y=b,E.a=C,E.b=M,[E]}}),Uq=Ft((Q,$)=>{$.exports={attributes:_T(),supplyDefaults:Tq(),plot:Mq(),calc:jq(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Mf(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}),Vq=Ft((Q,$)=>{$.exports=Uq()}),IE=Ft((Q,$)=>{var c=z0(),g=tf(),P=$o(),{hovertemplateAttrs:S,texttemplateAttrs:t,templatefallbackAttrs:e}=$u(),r=Tc(),a=Ta().extendFlat,n=g.marker,o=g.line,i=n.line;$.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:a({},g.mode,{dflt:"markers"}),text:a({},g.text,{}),texttemplate:t({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:e({editType:"plot"}),hovertext:a({},g.hovertext,{}),line:{color:o.color,width:o.width,dash:o.dash,backoff:o.backoff,shape:a({},o.shape,{values:["linear","spline"]}),smoothing:o.smoothing,editType:"calc"},connectgaps:g.connectgaps,fill:a({},g.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:c(),marker:a({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:a({width:i.width,editType:"calc"},r("marker.line")),gradient:n.gradient,editType:"calc"},r("marker")),textfont:g.textfont,textposition:g.textposition,selected:g.selected,unselected:g.unselected,hoverinfo:a({},P.hoverinfo,{flags:["a","b","text","name"]}),hoveron:g.hoveron,hovertemplate:S(),hovertemplatefallback:e(),zorder:g.zorder}}),Hq=Ft((Q,$)=>{var c=bn(),g=vm(),P=Ac(),S=s0(),t=I0(),e=xv(),r=x0(),a=O0(),n=IE();$.exports=function(o,i,s,f){function x(C,M){return c.coerce(o,i,n,C,M)}x("carpet"),i.xaxis="x",i.yaxis="y";var y=x("a"),v=x("b"),T=Math.min(y.length,v.length);if(!T){i.visible=!1;return}i._length=T,x("text"),x("texttemplate"),x("texttemplatefallback"),x("hovertext");var u=T<g.PTS_LINESONLY?"lines+markers":"lines";x("mode",u),P.hasMarkers(i)&&S(o,i,s,f,x,{gradient:!0}),P.hasLines(i)&&(t(o,i,s,f,x,{backoff:!0}),e(o,i,x),x("connectgaps")),P.hasText(i)&&r(o,i,f,x);var b=[];(P.hasMarkers(i)||P.hasText(i))&&(x("marker.maxdisplayed"),b.push("points")),x("fill"),i.fill!=="none"&&(a(o,i,s,x),P.hasLines(i)||e(o,i,x)),(i.fill==="tonext"||i.fill==="toself")&&b.push("fills");var _=x("hoveron",b.join("+")||"points");_!=="fills"&&(x("hovertemplate"),x("hovertemplatefallback")),x("zorder"),c.coerceSelectionMarkerOpacity(i,x)}}),Wq=Ft((Q,$)=>{$.exports=function(c,g){var P={},S=g._carpet,t=S.ab2ij([c.a,c.b]),e=Math.floor(t[0]),r=t[0]-e,a=Math.floor(t[1]),n=t[1]-a,o=S.evalxy([],e,a,r,n);return P.yLabel=o[1].toFixed(3),P}}),bT=Ft((Q,$)=>{$.exports=function(c,g){for(var P=c._fullData.length,S,t=0;t<P;t++){var e=c._fullData[t];if(e.index!==g.index&&e.type==="carpet"&&(S||(S=e),e.carpet===g.carpet))return e}return S}}),qq=Ft((Q,$)=>{var c=ra(),g=F0(),P=ct(),S=Bt(),t=me().calcMarkerSize,e=bT();$.exports=function(r,a){var n=a._carpetTrace=e(r,a);if(!(!n||!n.visible||n.visible==="legendonly")){var o;a.xaxis=n.xaxis,a.yaxis=n.yaxis;var i=a._length,s=new Array(i),f,x,y=!1;for(o=0;o<i;o++)if(f=a.a[o],x=a.b[o],c(f)&&c(x)){var v=n.ab2xy(+f,+x,!0),T=n.isVisible(+f,+x);T||(y=!0),s[o]={x:v[0],y:v[1],a:f,b:x,vis:T}}else s[o]={x:!1,y:!1};return a._needsCull=y,s[0].carpet=n,s[0].trace=a,t(a,i),g(r,a),P(s,a),S(s,a),s}}}),Zq=Ft((Q,$)=>{var c=Ya(),g=Es(),P=js();$.exports=function(S,t,e,r){var a,n,o,i=e[0][0].carpet,s=g.getFromId(S,i.xaxis||"x"),f=g.getFromId(S,i.yaxis||"y"),x={xaxis:s,yaxis:f,plot:t.plot};for(a=0;a<e.length;a++)n=e[a][0].trace,n._xA=s,n._yA=f;for(c(S,x,e,r),a=0;a<e.length;a++)n=e[a][0].trace,o=r.selectAll("g.trace"+n.uid+" .js-line"),P.setClipUrl(o,e[a][0].carpet._clipPathId,S)}}),$q=Ft((Q,$)=>{var c=Sd(),g=bn().fillText;$.exports=function(P,S,t,e){var r=c(P,S,t,e);if(!r||r[0].index===!1)return;var a=r[0];if(a.index===void 0){var n=1-a.y0/P.ya._length,o=P.xa._length,i=o*n/2,s=o-i;return a.x0=Math.max(Math.min(a.x0,s),i),a.x1=Math.max(Math.min(a.x1,s),i),r}var f=a.cd[a.index];a.a=f.a,a.b=f.b,a.xLabelVal=void 0,a.yLabelVal=void 0;var x=a.trace,y=x._carpet,v=x._module.formatLabels(f,x);a.yLabel=v.yLabel,delete a.text;var T=[];function u(C,M){var E;C.labelprefix&&C.labelprefix.length>0?E=C.labelprefix.replace(/ = $/,""):E=C._hovertitle,T.push(E+": "+M.toFixed(3)+C.labelsuffix)}if(!x.hovertemplate){var b=f.hi||x.hoverinfo,_=b.split("+");_.indexOf("all")!==-1&&(_=["a","b","text"]),_.indexOf("a")!==-1&&u(y.aaxis,f.a),_.indexOf("b")!==-1&&u(y.baxis,f.b),T.push("y: "+a.yLabel),_.indexOf("text")!==-1&&g(f,x,T),a.extraText=T.join("<br>")}return r}}),Gq=Ft((Q,$)=>{$.exports=function(c,g,P,S,t){var e=S[t];return c.a=e.a,c.b=e.b,c.y=e.y,c}}),Yq=Ft((Q,$)=>{$.exports={attributes:IE(),supplyDefaults:Hq(),colorbar:xo(),formatLabels:Wq(),calc:qq(),plot:Zq(),style:xl().style,styleOnSelect:xl().styleOnSelect,hoverPoints:$q(),selectPoints:Bf(),eventData:Gq(),moduleType:"trace",name:"scattercarpet",basePlotModule:Mf(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}),Kq=Ft((Q,$)=>{$.exports=Yq()}),OE=Ft((Q,$)=>{var c=X_(),g=Vw(),P=Tc(),S=Ta().extendFlat,t=g.contours;$.exports=S({carpet:{valType:"string",editType:"calc"},z:c.z,a:c.x,a0:c.x0,da:c.dx,b:c.y,b0:c.y0,db:c.dy,text:c.text,hovertext:c.hovertext,transpose:c.transpose,atype:c.xtype,btype:c.ytype,fillcolor:g.fillcolor,autocontour:g.autocontour,ncontours:g.ncontours,contours:{type:t.type,start:t.start,end:t.end,size:t.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:t.showlines,showlabels:t.showlabels,labelfont:t.labelfont,labelformat:t.labelformat,operation:t.operation,value:t.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:g.line.color,width:g.line.width,dash:g.line.dash,smoothing:g.line.smoothing,editType:"plot"},zorder:g.zorder},P("",{cLetter:"z",autoColorDflt:!1}))}),DE=Ft((Q,$)=>{var c=bn(),g=F6(),P=OE(),S=o7(),t=K6(),e=X6();$.exports=function(r,a,n,o){function i(y,v){return c.coerce(r,a,P,y,v)}function s(y){return c.coerce2(r,a,P,y)}if(i("carpet"),r.a&&r.b){var f=g(r,a,i,o,"a","b");if(!f){a.visible=!1;return}i("text");var x=i("contours.type")==="constraint";x?S(r,a,i,o,n,{hasHover:!1}):(t(r,a,i,s),e(r,a,i,o,{hasHover:!1}))}else a._defaultColor=n,a._length=null;i("zorder")}}),Xq=Ft((Q,$)=>{var c=Jd(),g=bn(),P=R6(),S=B6(),t=N6(),e=j6(),r=WM(),a=DE(),n=bT(),o=XM();$.exports=function(s,f){var x=f._carpetTrace=n(s,f);if(!(!x||!x.visible||x.visible==="legendonly")){if(!f.a||!f.b){var y=s.data[x.index],v=s.data[f.index];v.a||(v.a=y.a),v.b||(v.b=y.b),a(v,f,f._defaultColor,s._fullLayout)}var T=i(s,f);return o(f,f._z),T}};function i(s,f){var x=f._carpetTrace,y=x.aaxis,v=x.baxis,T,u,b,_,C,M,E;y._minDtick=0,v._minDtick=0,g.isArray1D(f.z)&&P(f,y,v,"a","b",["z"]),T=f._a=f._a||f.a,_=f._b=f._b||f.b,T=T?y.makeCalcdata(f,"_a"):[],_=_?v.makeCalcdata(f,"_b"):[],u=f.a0||0,b=f.da||1,C=f.b0||0,M=f.db||1,E=f._z=S(f._z||f.z,f.transpose),f._emptypoints=e(E),t(E,f._emptypoints);var A=g.maxRowLength(E),h=f.xtype==="scaled"?"":T,p=r(f,h,u,b,A,y),k=f.ytype==="scaled"?"":_,w=r(f,k,C,M,E.length,v),R={a:p,b:w,z:E};return f.contours.type==="levels"&&f.contours.coloring!=="none"&&c(s,f,{vals:E,containerStr:"",cLetter:"z"}),[R]}}),Jq=Ft((Q,$)=>{var c=bn().isArrayOrTypedArray;$.exports=function(g,P,S,t){var e,r,a,n,o,i,s,f,x,y,v,T,u,b=c(S)?"a":"b",_=b==="a"?g.aaxis:g.baxis,C=_.smoothing,M=b==="a"?g.a2i:g.b2j,E=b==="a"?S:t,A=b==="a"?t:S,h=b==="a"?P.a.length:P.b.length,p=b==="a"?P.b.length:P.a.length,k=Math.floor(b==="a"?g.b2j(A):g.a2i(A)),w=b==="a"?function(yt){return g.evalxy([],yt,k)}:function(yt){return g.evalxy([],k,yt)};C&&(a=Math.max(0,Math.min(p-2,k)),n=k-a,r=b==="a"?function(yt,pt){return g.dxydi([],yt,a,pt,n)}:function(yt,pt){return g.dxydj([],a,yt,n,pt)});var R=M(E[0]),O=M(E[1]),N=R<O?1:-1,V=(O-R)*1e-8,H=N>0?Math.floor:Math.ceil,F=N>0?Math.ceil:Math.floor,U=N>0?Math.min:Math.max,W=N>0?Math.max:Math.min,q=H(R+V),X=F(O-V);s=w(R);var lt=[[s]];for(e=q;e*N<X*N;e+=N)o=[],v=W(R,e),T=U(O,e+N),u=T-v,i=Math.max(0,Math.min(h-2,Math.floor(.5*(v+T)))),f=w(T),C&&(x=r(i,v-i),y=r(i,T-i),o.push([s[0]+x[0]/3*u,s[1]+x[1]/3*u]),o.push([f[0]-y[0]/3*u,f[1]-y[1]/3*u])),o.push(f),lt.push(o),s=f;return lt}}),Qq=Ft((Q,$)=>{var c=un(),g=PE(),P=zE(),S=js(),t=bn(),e=QM(),r=t7(),a=J6(),n=Ww(),o=r7(),i=e7(),s=n7(),f=bT(),x=Jq();$.exports=function(A,h,p,k){var w=h.xaxis,R=h.yaxis;t.makeTraceGroups(k,p,"contour").each(function(O){var N=c.select(this),V=O[0],H=V.trace,F=H._carpetTrace=f(A,H),U=A.calcdata[F.index][0];if(!F.visible||F.visible==="legendonly")return;var W=V.a,q=V.b,X=H.contours,lt=i(X,h,V),yt=X.type==="constraint",pt=X._operation,st=yt?pt==="="?"lines":"fill":X.coloring;function tt(Pt){var Wt=F.ab2xy(Pt[0],Pt[1],!0);return[w.c2p(Wt[0]),R.c2p(Wt[1])]}var dt=[[W[0],q[q.length-1]],[W[W.length-1],q[q.length-1]],[W[W.length-1],q[0]],[W[0],q[0]]];e(lt);var rt=(W[W.length-1]-W[0])*1e-8,at=(q[q.length-1]-q[0])*1e-8;r(lt,rt,at);var vt=lt;X.type==="constraint"&&(vt=o(lt,pt)),y(lt,tt);var it,Y,ft,ut,wt=[];for(ut=U.clipsegments.length-1;ut>=0;ut--)it=U.clipsegments[ut],Y=g([],it.x,w.c2p),ft=g([],it.y,R.c2p),Y.reverse(),ft.reverse(),wt.push(P(Y,ft,it.bicubic));var zt="M"+wt.join("L")+"Z";C(N,U.clipsegments,w,R,yt,st),M(H,N,w,R,vt,dt,tt,F,U,st,zt),v(N,lt,A,V,X,h,F),S.setClipUrl(N,F._clipPathId,A)})};function y(A,h){var p,k,w,R,O,N,V,H,F;for(p=0;p<A.length;p++){for(R=A[p],O=R.pedgepaths=[],N=R.ppaths=[],k=0;k<R.edgepaths.length;k++){for(F=R.edgepaths[k],V=[],w=0;w<F.length;w++)V[w]=h(F[w]);O.push(V)}for(k=0;k<R.paths.length;k++){for(F=R.paths[k],H=[],w=0;w<F.length;w++)H[w]=h(F[w]);N.push(H)}}}function v(A,h,p,k,w,R,O){var N=p._context.staticPlot,V=t.ensureSingle(A,"g","contourlines"),H=w.showlines!==!1,F=w.showlabels,U=H&&F,W=a.createLines(V,H||F,h,N),q=a.createLineClip(V,U,p,k.trace.uid),X=A.selectAll("g.contourlabels").data(F?[0]:[]);if(X.exit().remove(),X.enter().append("g").classed("contourlabels",!0),F){var lt=R.xaxis,yt=R.yaxis,pt=lt._length,st=yt._length,tt=[[[0,0],[pt,0],[pt,st],[0,st]]],dt=[];t.clearLocationCache();var rt=a.labelFormatter(p,k),at=S.tester.append("text").attr("data-notex",1).call(S.font,w.labelfont),vt={left:0,right:pt,center:pt/2,top:0,bottom:st,middle:st/2},it=Math.sqrt(pt*pt+st*st),Y=n.LABELDISTANCE*it/Math.max(1,h.length/n.LABELINCREASE);W.each(function(ft){var ut=a.calcTextOpts(ft.level,rt,at,p);c.select(this).selectAll("path").each(function(wt){var zt=this,Pt=t.getVisibleSegment(zt,vt,ut.height/2);if(Pt&&(T(zt,wt,ft,Pt,O,ut.height),!(Pt.len<(ut.width+ut.height)*n.LABELMIN)))for(var Wt=Math.min(Math.ceil(Pt.len/Y),n.LABELMAX),Ht=0;Ht<Wt;Ht++){var Jt=a.findBestTextLocation(zt,Pt,ut,dt,vt);if(!Jt)break;a.addLabelData(Jt,ut,dt,tt)}})}),at.remove(),a.drawLabels(X,dt,p,q,U?tt:null)}F&&!H&&W.remove()}function T(A,h,p,k,w,R){for(var O,N=0;N<p.pedgepaths.length;N++)h===p.pedgepaths[N]&&(O=p.edgepaths[N]);if(!O)return;var V=w.a[0],H=w.a[w.a.length-1],F=w.b[0],U=w.b[w.b.length-1];function W(pt,st){var tt=0,dt,rt=.1;return(Math.abs(pt[0]-V)<rt||Math.abs(pt[0]-H)<rt)&&(dt=b(w.dxydb_rough(pt[0],pt[1],rt)),tt=Math.max(tt,R*_(st,dt)/2)),(Math.abs(pt[1]-F)<rt||Math.abs(pt[1]-U)<rt)&&(dt=b(w.dxyda_rough(pt[0],pt[1],rt)),tt=Math.max(tt,R*_(st,dt)/2)),tt}var q=u(A,0,1),X=u(A,k.total,k.total-1),lt=W(O[0],q),yt=k.total-W(O[O.length-1],X);k.min<lt&&(k.min=lt),k.max>yt&&(k.max=yt),k.len=k.max-k.min}function u(A,h,p){var k=A.getPointAtLength(h),w=A.getPointAtLength(p),R=w.x-k.x,O=w.y-k.y,N=Math.sqrt(R*R+O*O);return[R/N,O/N]}function b(A){var h=Math.sqrt(A[0]*A[0]+A[1]*A[1]);return[A[0]/h,A[1]/h]}function _(A,h){var p=Math.abs(A[0]*h[0]+A[1]*h[1]),k=Math.sqrt(1-p*p);return k/p}function C(A,h,p,k,w,R){var O,N,V,H,F=t.ensureSingle(A,"g","contourbg"),U=F.selectAll("path").data(R==="fill"&&!w?[0]:[]);U.enter().append("path"),U.exit().remove();var W=[];for(H=0;H<h.length;H++)O=h[H],N=g([],O.x,p.c2p),V=g([],O.y,k.c2p),W.push(P(N,V,O.bicubic));U.attr("d","M"+W.join("L")+"Z").style("stroke","none")}function M(A,h,p,k,w,R,O,N,V,H,F){var U=H==="fill";U&&s(w,A.contours);var W=t.ensureSingle(h,"g","contourfill"),q=W.selectAll("path").data(U?w:[]);q.enter().append("path"),q.exit().remove(),q.each(function(X){var lt=(X.prefixBoundary?F:"")+E(A,X,R,O,N,V,p,k);lt?c.select(this).attr("d",lt).style("stroke","none"):c.select(this).remove()})}function E(A,h,p,k,w,R,O,N){var V,H="",F=h.edgepaths.map(function(ut,wt){return wt}),U=!0,W,q,X,lt,yt,pt,st=Math.abs(p[0][0]-p[2][0])*1e-4,tt=Math.abs(p[0][1]-p[2][1])*1e-4;function dt(ut){return Math.abs(ut[1]-p[0][1])<tt}function rt(ut){return Math.abs(ut[1]-p[2][1])<tt}function at(ut){return Math.abs(ut[0]-p[0][0])<st}function vt(ut){return Math.abs(ut[0]-p[2][0])<st}function it(ut,wt){var zt,Pt,Wt,Ht,Jt="";for(dt(ut)&&!vt(ut)||rt(ut)&&!at(ut)?(Ht=w.aaxis,Wt=x(w,R,[ut[0],wt[0]],.5*(ut[1]+wt[1]))):(Ht=w.baxis,Wt=x(w,R,.5*(ut[0]+wt[0]),[ut[1],wt[1]])),zt=1;zt<Wt.length;zt++)for(Jt+=Ht.smoothing?"C":"L",Pt=0;Pt<Wt[zt].length;Pt++){var ge=Wt[zt][Pt];Jt+=[O.c2p(ge[0]),N.c2p(ge[1])]+" "}return Jt}for(V=0,W=null;F.length;){var Y=h.edgepaths[V][0];for(W&&(H+=it(W,Y)),pt=S.smoothopen(h.edgepaths[V].map(k),h.smoothing),H+=U?pt:pt.replace(/^M/,"L"),F.splice(F.indexOf(V),1),W=h.edgepaths[V][h.edgepaths[V].length-1],lt=-1,X=0;X<4;X++){if(!W){t.log("Missing end?",V,h);break}for(dt(W)&&!vt(W)?q=p[1]:at(W)?q=p[0]:rt(W)?q=p[3]:vt(W)&&(q=p[2]),yt=0;yt<h.edgepaths.length;yt++){var ft=h.edgepaths[yt][0];Math.abs(W[0]-q[0])<st?Math.abs(W[0]-ft[0])<st&&(ft[1]-W[1])*(q[1]-ft[1])>=0&&(q=ft,lt=yt):Math.abs(W[1]-q[1])<tt?Math.abs(W[1]-ft[1])<tt&&(ft[0]-W[0])*(q[0]-ft[0])>=0&&(q=ft,lt=yt):t.log("endpt to newendpt is not vert. or horz.",W,q,ft)}if(lt>=0)break;H+=it(W,q),W=q}if(lt===h.edgepaths.length){t.log("unclosed perimeter path");break}V=lt,U=F.indexOf(V)===-1,U&&(V=F[0],H+=it(W,q)+"Z",W=null)}for(V=0;V<h.paths.length;V++)H+=S.smoothclosed(h.paths[V].map(k),h.smoothing);return H}}),tZ=Ft((Q,$)=>{$.exports={attributes:OE(),supplyDefaults:DE(),colorbar:tk(),calc:Xq(),plot:Qq(),style:Q6(),moduleType:"trace",name:"contourcarpet",basePlotModule:Mf(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}),eZ=Ft((Q,$)=>{$.exports=tZ()}),wT=Ft((Q,$)=>{var c=bn().extendFlat,g=tf(),P=fh().axisHoverFormat,S=Td().dash,t=Ps(),e=J_(),r=e.INCREASING.COLOR,a=e.DECREASING.COLOR,n=g.line;function o(i){return{line:{color:c({},n.color,{dflt:i}),width:n.width,dash:S,editType:"style"},editType:"style"}}$.exports={xperiod:g.xperiod,xperiod0:g.xperiod0,xperiodalignment:g.xperiodalignment,xhoverformat:P("x"),yhoverformat:P("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:c({},n.width,{}),dash:c({},S,{}),editType:"style"},increasing:o(r),decreasing:o(a),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:c({},t.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:g.zorder}}),FE=Ft((Q,$)=>{var c=Xo(),g=bn();$.exports=function(P,S,t,e){var r=t("x"),a=t("open"),n=t("high"),o=t("low"),i=t("close");t("hoverlabel.split");var s=c.getComponentMethod("calendars","handleTraceDefaults");if(s(P,S,["x"],e),!!(a&&n&&o&&i)){var f=Math.min(a.length,n.length,o.length,i.length);return r&&(f=Math.min(f,g.minRowLength(r))),S._length=f,f}}}),rZ=Ft((Q,$)=>{var c=bn(),g=FE(),P=Fp(),S=wT();$.exports=function(e,r,a,n){function o(s,f){return c.coerce(e,r,S,s,f)}var i=g(e,r,o,n);if(!i){r.visible=!1;return}P(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,a,n){a(n+".line.color"),a(n+".line.width",r.line.width),a(n+".line.dash",r.line.dash)}}),RE=Ft((Q,$)=>{var c=bn(),g=c._,P=Es(),S=D0(),t=Da().BADNUM;function e(o,i){var s=P.getFromId(o,i.xaxis),f=P.getFromId(o,i.yaxis),x=n(o,s,i),y=i._minDiff;i._minDiff=null;var v=i._origX;i._origX=null;var T=i._xcalc;i._xcalc=null;var u=a(o,i,v,T,f,r);return i._extremes[s._id]=P.findExtremes(s,T,{vpad:y/2}),u.length?(c.extendFlat(u[0].t,{wHover:y/2,tickLen:x}),u):[{t:{empty:!0}}]}function r(o,i,s,f){return{o,h:i,l:s,c:f}}function a(o,i,s,f,x,y){for(var v=x.makeCalcdata(i,"open"),T=x.makeCalcdata(i,"high"),u=x.makeCalcdata(i,"low"),b=x.makeCalcdata(i,"close"),_=c.isArrayOrTypedArray(i.text),C=c.isArrayOrTypedArray(i.hovertext),M=!0,E=null,A=!!i.xperiodalignment,h=[],p=0;p<f.length;p++){var k=f[p],w=v[p],R=T[p],O=u[p],N=b[p];if(k!==t&&w!==t&&R!==t&&O!==t&&N!==t){N===w?E!==null&&N!==E&&(M=N>E):M=N>w,E=N;var V=y(w,R,O,N);V.pos=k,V.yc=(w+N)/2,V.i=p,V.dir=M?"increasing":"decreasing",V.x=V.pos,V.y=[O,R],A&&(V.orig_p=s[p]),_&&(V.tx=i.text[p]),C&&(V.htx=i.hovertext[p]),h.push(V)}else h.push({pos:k,empty:!0})}return i._extremes[x._id]=P.findExtremes(x,c.concat(u,T),{padded:!0}),h.length&&(h[0].t={labels:{open:g(o,"open:")+" ",high:g(o,"high:")+" ",low:g(o,"low:")+" ",close:g(o,"close:")+" "}}),h}function n(o,i,s){var f=s._minDiff;if(!f){var x=o._fullData,y=[];f=1/0;var v;for(v=0;v<x.length;v++){var T=x[v];if(T.type==="ohlc"&&T.visible===!0&&T.xaxis===i._id){y.push(T);var u=i.makeCalcdata(T,"x");T._origX=u;var b=S(s,i,"x",u).vals;T._xcalc=b;var _=c.distinctVals(b).minDiff;_&&isFinite(_)&&(f=Math.min(f,_))}}for(f===1/0&&(f=1),v=0;v<y.length;v++)y[v]._minDiff=f}return f*s.tickwidth}$.exports={calc:e,calcCommon:a}}),nZ=Ft((Q,$)=>{var c=un(),g=bn();$.exports=function(P,S,t,e){var r=S.yaxis,a=S.xaxis,n=!!a.rangebreaks;g.makeTraceGroups(e,t,"trace ohlc").each(function(o){var i=c.select(this),s=o[0],f=s.t,x=s.trace;if(x.visible!==!0||f.empty){i.remove();return}var y=f.tickLen,v=i.selectAll("path").data(g.identity);v.enter().append("path"),v.exit().remove(),v.attr("d",function(T){if(T.empty)return"M0,0Z";var u=a.c2p(T.pos-y,!0),b=a.c2p(T.pos+y,!0),_=n?(u+b)/2:a.c2p(T.pos,!0),C=r.c2p(T.o,!0),M=r.c2p(T.h,!0),E=r.c2p(T.l,!0),A=r.c2p(T.c,!0);return"M"+u+","+C+"H"+_+"M"+_+","+M+"V"+E+"M"+b+","+A+"H"+_})})}}),iZ=Ft((Q,$)=>{var c=un(),g=js(),P=li();$.exports=function(S,t,e){var r=e||c.select(S).selectAll("g.ohlclayer").selectAll("g.trace");r.style("opacity",function(a){return a[0].trace.opacity}),r.each(function(a){var n=a[0].trace;c.select(this).selectAll("path").each(function(o){if(!o.empty){var i=n[o.dir].line;c.select(this).style("fill","none").call(P.stroke,i.color).call(g.dashLine,i.dash,i.width).style("opacity",n.selectedpoints&&!o.selected?.3:1)}})})}}),BE=Ft((Q,$)=>{var c=Es(),g=bn(),P=Qh(),S=li(),t=bn().fillText,e=J_(),r={increasing:e.INCREASING.SYMBOL,decreasing:e.DECREASING.SYMBOL};function a(s,f,x,y){var v=s.cd,T=v[0].trace;return T.hoverlabel.split?o(s,f,x,y):i(s,f,x,y)}function n(s,f,x,y){var v=s.cd,T=s.xa,u=v[0].trace,b=v[0].t,_=u.type,C=_==="ohlc"?"l":"min",M=_==="ohlc"?"h":"max",E,A,h=b.bPos||0,p=function(X){return X.pos+h-f},k=b.bdPos||b.tickLen,w=b.wHover,R=Math.min(1,k/Math.abs(T.r2c(T.range[1])-T.r2c(T.range[0])));E=s.maxHoverDistance-R,A=s.maxSpikeDistance-R;function O(X){var lt=p(X);return P.inbox(lt-w,lt+w,E)}function N(X){var lt=X[C],yt=X[M];return lt===yt||P.inbox(lt-x,yt-x,E)}function V(X){return(O(X)+N(X))/2}var H=P.getDistanceFunction(y,O,N,V);if(P.getClosest(v,H,s),s.index===!1)return null;var F=v[s.index];if(F.empty)return null;var U=F.dir,W=u[U],q=W.line.color;return S.opacity(q)&&W.line.width?s.color=q:s.color=W.fillcolor,s.x0=T.c2p(F.pos+h-k,!0),s.x1=T.c2p(F.pos+h+k,!0),s.xLabelVal=F.orig_p!==void 0?F.orig_p:F.pos,s.spikeDistance=V(F)*A/E,s.xSpike=T.c2p(F.pos,!0),s}function o(s,f,x,y){var v=s.cd,T=s.ya,u=v[0].trace,b=v[0].t,_=[],C=n(s,f,x,y);if(!C)return[];var M=C.index,E=v[M],A=E.hi||u.hoverinfo,h=A.split("+"),p=A==="all",k=p||h.indexOf("y")!==-1;if(!k)return[];for(var w=["high","open","close","low"],R={},O=0;O<w.length;O++){var N=w[O],V=u[N][C.index],H=T.c2p(V,!0),F;V in R?(F=R[V],F.yLabel+="<br>"+b.labels[N]+c.hoverLabelText(T,V,u.yhoverformat)):(F=g.extendFlat({},C),F.y0=F.y1=H,F.yLabelVal=V,F.yLabel=b.labels[N]+c.hoverLabelText(T,V,u.yhoverformat),F.name="",_.push(F),R[V]=F)}return _}function i(s,f,x,y){var v=s.cd,T=s.ya,u=v[0].trace,b=v[0].t,_=n(s,f,x,y);if(!_)return[];var C=_.index,M=v[C],E=_.index=M.i,A=M.dir;function h(V){return b.labels[V]+c.hoverLabelText(T,u[V][E],u.yhoverformat)}var p=M.hi||u.hoverinfo,k=p.split("+"),w=p==="all",R=w||k.indexOf("y")!==-1,O=w||k.indexOf("text")!==-1,N=R?[h("open"),h("high"),h("low"),h("close")+" "+r[A]]:[];return O&&t(M,u,N),_.extraText=N.join("<br>"),_.y0=_.y1=T.c2p(M.yc,!0),[_]}$.exports={hoverPoints:a,hoverSplit:o,hoverOnPoints:i}}),NE=Ft((Q,$)=>{$.exports=function(c,g){var P=c.cd,S=c.xaxis,t=c.yaxis,e=[],r,a=P[0].t.bPos||0;if(g===!1)for(r=0;r<P.length;r++)P[r].selected=0;else for(r=0;r<P.length;r++){var n=P[r];g.contains([S.c2p(n.pos+a),t.c2p(n.yc)],null,n.i,c)?(e.push({pointNumber:n.i,x:S.c2d(n.pos),y:t.c2d(n.yc)}),n.selected=1):n.selected=0}return e}}),aZ=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"ohlc",basePlotModule:Mf(),categories:["cartesian","svg","showLegend"],meta:{},attributes:wT(),supplyDefaults:rZ(),calc:RE().calc,plot:nZ(),style:iZ(),hoverPoints:BE().hoverPoints,selectPoints:NE()}}),oZ=Ft((Q,$)=>{$.exports=aZ()}),jE=Ft((Q,$)=>{var c=bn().extendFlat,g=fh().axisHoverFormat,P=wT(),S=Bw();function t(e){return{line:{color:c({},S.line.color,{dflt:e}),width:S.line.width,editType:"style"},fillcolor:S.fillcolor,editType:"style"}}$.exports={xperiod:P.xperiod,xperiod0:P.xperiod0,xperiodalignment:P.xperiodalignment,xhoverformat:g("x"),yhoverformat:g("y"),x:P.x,open:P.open,high:P.high,low:P.low,close:P.close,line:{width:c({},S.line.width,{}),editType:"style"},increasing:t(P.increasing.line.color.dflt),decreasing:t(P.decreasing.line.color.dflt),text:P.text,hovertext:P.hovertext,whiskerwidth:c({},S.whiskerwidth,{dflt:0}),hoverlabel:P.hoverlabel,zorder:S.zorder}}),sZ=Ft((Q,$)=>{var c=bn(),g=li(),P=FE(),S=Fp(),t=jE();$.exports=function(r,a,n,o){function i(f,x){return c.coerce(r,a,t,f,x)}var s=P(r,a,i,o);if(!s){a.visible=!1;return}S(r,a,o,i,{x:!0}),i("xhoverformat"),i("yhoverformat"),i("line.width"),e(r,a,i,"increasing"),e(r,a,i,"decreasing"),i("text"),i("hovertext"),i("whiskerwidth"),o._requestRangeslider[a.xaxis]=!0,i("zorder")};function e(r,a,n,o){var i=n(o+".line.color");n(o+".line.width",a.line.width),n(o+".fillcolor",g.addOpacity(i,.5))}}),lZ=Ft((Q,$)=>{var c=bn(),g=Es(),P=D0(),S=RE().calcCommon;$.exports=function(e,r){var a=e._fullLayout,n=g.getFromId(e,r.xaxis),o=g.getFromId(e,r.yaxis),i=n.makeCalcdata(r,"x"),s=P(r,n,"x",i).vals,f=S(e,r,i,s,o,t);return f.length?(c.extendFlat(f[0].t,{num:a._numBoxes,dPos:c.distinctVals(s).minDiff/2,posLetter:"x",valLetter:"y"}),a._numBoxes++,f):[{t:{empty:!0}}]};function t(e,r,a,n){return{min:a,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:r}}}),uZ=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"candlestick",basePlotModule:Mf(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:jE(),layoutAttributes:Nw(),supplyLayoutDefaults:z6().supplyLayoutDefaults,crossTraceCalc:I6().crossTraceCalc,supplyDefaults:sZ(),calc:lZ(),plot:O6().plot,layerName:"boxlayer",style:D6().style,hoverPoints:BE().hoverPoints,selectPoints:NE()}}),cZ=Ft((Q,$)=>{$.exports=uZ()}),UE=Ft((Q,$)=>{var c=bn(),g=i0(),P=c.deg2rad,S=c.rad2deg;$.exports=function(n,o,i){switch(g(n,i),n._id){case"x":case"radialaxis":t(n,o);break;case"angularaxis":a(n,o);break}};function t(n,o){var i=o._subplot;n.setGeometry=function(){var s=n._rl[0],f=n._rl[1],x=i.innerRadius,y=(i.radius-x)/(f-s),v=x/y,T=s>f?function(u){return u<=0}:function(u){return u>=0};n.c2g=function(u){var b=n.c2l(u)-s;return(T(b)?b:0)+v},n.g2c=function(u){return n.l2c(u+s-v)},n.g2p=function(u){return u*y},n.c2p=function(u){return n.g2p(n.c2g(u))}}}function e(n,o){return o==="degrees"?P(n):n}function r(n,o){return o==="degrees"?S(n):n}function a(n,o){var i=n.type;if(i==="linear"){var s=n.d2c,f=n.c2d;n.d2c=function(x,y){return e(s(x),y)},n.c2d=function(x,y){return f(r(x,y))}}n.makeCalcdata=function(x,y){var v=x[y],T=x._length,u,b,_=function(h){return n.d2c(h,x.thetaunit)};if(v)for(u=new Array(T),b=0;b<T;b++)u[b]=_(v[b]);else{var C=y+"0",M="d"+y,E=C in x?_(x[C]):0,A=x[M]?_(x[M]):(n.period||2*Math.PI)/T;for(u=new Array(T),b=0;b<T;b++)u[b]=E+b*A}return u},n.setGeometry=function(){var x=o.sector,y=x.map(P),v={clockwise:-1,counterclockwise:1}[n.direction],T=P(n.rotation),u=function(p){return v*p+T},b=function(p){return(p-T)/v},_,C,M,E;switch(i){case"linear":C=_=c.identity,E=P,M=S,n.range=c.isFullCircle(y)?[x[0],x[0]+360]:y.map(b).map(S);break;case"category":var A=n._categories.length,h=n.period?Math.max(n.period,A):A;h===0&&(h=1),C=E=function(p){return p*2*Math.PI/h},_=M=function(p){return p*h/Math.PI/2},n.range=[0,h];break}n.c2g=function(p){return u(C(p))},n.g2c=function(p){return _(b(p))},n.t2g=function(p){return u(E(p))},n.g2t=function(p){return M(b(p))}}}}),kT=Ft((Q,$)=>{$.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}}),TT=Ft((Q,$)=>{var c=bn(),g=mm().tester,P=c.findIndexOfMin,S=c.isAngleInsideSector,t=c.angleDelta,e=c.angleDist;function r(b,_,C,M,E){if(!S(_,M))return!1;var A,h;C[0]<C[1]?(A=C[0],h=C[1]):(A=C[1],h=C[0]);var p=g(s(A,M[0],M[1],E)),k=g(s(h,M[0],M[1],E)),w=[b*Math.cos(_),b*Math.sin(_)];return k.contains(w)&&!p.contains(w)}function a(b,_,C,M){var E,A,h=M[0],p=M[1],k=y(Math.sin(_)-Math.sin(b)),w=y(Math.cos(_)-Math.cos(b)),R=Math.tan(C),O=y(1/R),N=k/w,V=p-N*h;return O?k&&w?(E=V/(R-N),A=R*E):w?(E=p*O,A=p):(E=h,A=h*R):k&&w?(E=0,A=V):w?(E=0,A=p):E=A=NaN,[E,A]}function n(b,_,C,M){var E=-_*C,A=_*_+1,h=2*(_*E-C),p=E*E+C*C-b*b,k=Math.sqrt(h*h-4*A*p),w=(-h+k)/(2*A),R=(-h-k)/(2*A);return[[w,_*w+E+M],[R,_*R+E+M]]}function o(b,_){var C=_.length,M=new Array(C+1),E;for(E=0;E<C;E++){var A=_[E];M[E]=[b*Math.cos(A),b*Math.sin(A)]}return M[E]=M[0].slice(),M}function i(b,_,C,M){var E=M.length,A=[],h,p;function k(W){return[b*Math.cos(W),b*Math.sin(W)]}function w(W,q,X){return a(W,q,X,k(W))}function R(W){return c.mod(W,E)}function O(W){return S(W,[_,C])}var N=P(M,function(W){return O(W)?e(W,_):1/0}),V=w(M[N],M[R(N-1)],_);for(A.push(V),h=N,p=0;p<E;h++,p++){var H=M[R(h)];if(!O(H))break;A.push(k(H))}var F=P(M,function(W){return O(W)?e(W,C):1/0}),U=w(M[F],M[R(F+1)],C);return A.push(U),A.push([0,0]),A.push(A[0].slice()),A}function s(b,_,C,M){return c.isFullCircle([_,C])?o(b,M):i(b,_,C,M)}function f(b,_,C,M){for(var E=1/0,A=1/0,h=s(b,_,C,M),p=0;p<h.length;p++){var k=h[p];E=Math.min(E,k[0]),A=Math.min(A,-k[1])}return[E,A]}function x(b,_){var C=function(A){var h=t(A,b);return h>0?h:1/0},M=P(_,C),E=c.mod(M+1,_.length);return[_[M],_[E]]}function y(b){return Math.abs(b)>1e-10?b:0}function v(b,_,C){_=_||0,C=C||0;for(var M=b.length,E=new Array(M),A=0;A<M;A++){var h=b[A];E[A]=[_+h[0],C-h[1]]}return E}function T(b,_,C,M,E,A){var h=s(b,_,C,M);return"M"+v(h,E,A).join("L")}function u(b,_,C,M,E,A,h){var p,k;b<_?(p=b,k=_):(p=_,k=b);var w=v(s(p,C,M,E),A,h),R=v(s(k,C,M,E),A,h);return"M"+R.reverse().join("L")+"M"+w.join("L")}$.exports={isPtInsidePolygon:r,findPolygonOffset:f,findEnclosingVertexAngles:x,findIntersectionXY:a,findXYatLength:n,clampTiny:y,pathPolygon:T,pathPolygonAnnulus:u}}),VE=Ft((Q,$)=>{function c(r){return r<0?-1:r>0?1:0}function g(r){var a=r[0],n=r[1];if(!isFinite(a)||!isFinite(n))return[1,0];var o=(a+1)*(a+1)+n*n;return[(a*a+n*n-1)/o,2*n/o]}function P(r,a){var n=a[0],o=a[1];return[n*r.radius+r.cx,-o*r.radius+r.cy]}function S(r,a){return a*r.radius}function t(r,a,n,o){var i=P(r,g([n,a])),s=i[0],f=i[1],x=P(r,g([o,a])),y=x[0],v=x[1];if(a===0)return["M"+s+","+f,"L"+y+","+v].join(" ");var T=S(r,1/Math.abs(a));return["M"+s+","+f,"A"+T+","+T+" 0 0,"+(a<0?1:0)+" "+y+","+v].join(" ")}function e(r,a,n,o){var i=S(r,1/(a+1)),s=P(r,g([a,n])),f=s[0],x=s[1],y=P(r,g([a,o])),v=y[0],T=y[1];if(c(n)!==c(o)){var u=P(r,g([a,0])),b=u[0],_=u[1];return["M"+f+","+x,"A"+i+","+i+" 0 0,"+(0<n?0:1)+" "+b+","+_,"A"+i+","+i+" 0 0,"+(o<0?0:1)+v+","+T].join(" ")}return["M"+f+","+x,"A"+i+","+i+" 0 0,"+(o<n?0:1)+" "+v+","+T].join(" ")}$.exports={smith:g,reactanceArc:t,resistanceArc:e,smithTransform:P}}),HE=Ft((Q,$)=>{var c=un(),g=fo(),P=Xo(),S=bn(),t=S.strRotate,e=S.strTranslate,r=li(),a=js(),n=Kc(),o=Es(),i=i0(),s=UE(),f=Y0().doAutoRange,x=S1(),y=up(),v=Qh(),T=lp(),u=vf().prepSelect,b=vf().selectOnClick,_=vf().clearOutline,C=P0(),M=mv(),E=y0().redrawReglTraces,A=Af().MID_SHIFT,h=kT(),p=TT(),k=VE(),w=k.smith,R=k.reactanceArc,O=k.resistanceArc,N=k.smithTransform,V=S._,H=S.mod,F=S.deg2rad,U=S.rad2deg;function W(st,tt,dt){this.isSmith=dt||!1,this.id=tt,this.gd=st,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var rt=st._fullLayout,at="clip"+rt._uid+tt;this.clipIds.forTraces=at+"-for-traces",this.clipPaths.forTraces=rt._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=rt["_"+(dt?"smith":"polar")+"layer"].append("g").attr("class",tt),this.getHole=function(vt){return this.isSmith?0:vt.hole},this.getSector=function(vt){return this.isSmith?[0,360]:vt.sector},this.getRadial=function(vt){return this.isSmith?vt.realaxis:vt.radialaxis},this.getAngular=function(vt){return this.isSmith?vt.imaginaryaxis:vt.angularaxis},dt||(this.radialTickLayout=null,this.angularTickLayout=null)}var q=W.prototype;$.exports=function(st,tt,dt){return new W(st,tt,dt)},q.plot=function(st,tt){for(var dt=this,rt=tt[dt.id],at=!1,vt=0;vt<st.length;vt++){var it=st[vt][0].trace;if(it.cliponaxis===!1){at=!0;break}}dt._hasClipOnAxisFalse=at,dt.updateLayers(tt,rt),dt.updateLayout(tt,rt),n.generalUpdatePerTraceModule(dt.gd,dt,st,rt),dt.updateFx(tt,rt),dt.isSmith&&(delete rt.realaxis.range,delete rt.imaginaryaxis.range)},q.updateLayers=function(st,tt){var dt=this,rt=dt.isSmith,at=dt.layers,vt=dt.getRadial(tt),it=dt.getAngular(tt),Y=h.layerNames,ft=Y.indexOf("frontplot"),ut=Y.slice(0,ft),wt=it.layer==="below traces",zt=vt.layer==="below traces";wt&&ut.push("angular-line"),zt&&ut.push("radial-line"),wt&&ut.push("angular-axis"),zt&&ut.push("radial-axis"),ut.push("frontplot"),wt||ut.push("angular-line"),zt||ut.push("radial-line"),wt||ut.push("angular-axis"),zt||ut.push("radial-axis");var Pt=(rt?"smith":"polar")+"sublayer",Wt=dt.framework.selectAll("."+Pt).data(ut,String);Wt.enter().append("g").attr("class",function(Ht){return Pt+" "+Ht}).each(function(Ht){var Jt=at[Ht]=c.select(this);switch(Ht){case"frontplot":rt||Jt.append("g").classed("barlayer",!0),Jt.append("g").classed("scatterlayer",!0);break;case"backplot":Jt.append("g").classed("maplayer",!0);break;case"plotbg":at.bg=Jt.append("path");break;case"radial-grid":Jt.style("fill","none");break;case"angular-grid":Jt.style("fill","none");break;case"radial-line":Jt.append("line").style("fill","none");break;case"angular-line":Jt.append("path").style("fill","none");break}}),Wt.order()},q.updateLayout=function(st,tt){var dt=this,rt=dt.layers,at=st._size,vt=dt.getRadial(tt),it=dt.getAngular(tt),Y=tt.domain.x,ft=tt.domain.y;dt.xOffset=at.l+at.w*Y[0],dt.yOffset=at.t+at.h*(1-ft[1]);var ut=dt.xLength=at.w*(Y[1]-Y[0]),wt=dt.yLength=at.h*(ft[1]-ft[0]),zt=dt.getSector(tt);dt.sectorInRad=zt.map(F);var Pt=dt.sectorBBox=lt(zt),Wt=Pt[2]-Pt[0],Ht=Pt[3]-Pt[1],Jt=wt/ut,ge=Math.abs(Ht/Wt),he,de,se,Tt,Lt;Jt>ge?(he=ut,de=ut*ge,Lt=(wt-de)/at.h/2,se=[Y[0],Y[1]],Tt=[ft[0]+Lt,ft[1]-Lt]):(he=wt/ge,de=wt,Lt=(ut-he)/at.w/2,se=[Y[0]+Lt,Y[1]-Lt],Tt=[ft[0],ft[1]]),dt.xLength2=he,dt.yLength2=de,dt.xDomain2=se,dt.yDomain2=Tt;var Mt=dt.xOffset2=at.l+at.w*se[0],te=dt.yOffset2=at.t+at.h*(1-Tt[1]),ve=dt.radius=he/Wt,oe=dt.innerRadius=dt.getHole(tt)*ve,Te=dt.cx=Mt-ve*Pt[0],He=dt.cy=te+ve*Pt[3],Ge=dt.cxx=Te-Mt,cr=dt.cyy=He-te,ur=vt.side,jr;ur==="counterclockwise"?(jr=ur,ur="top"):ur==="clockwise"&&(jr=ur,ur="bottom"),dt.radialAxis=dt.mockAxis(st,tt,vt,{_id:"x",side:ur,_trueSide:jr,domain:[oe/at.w,ve/at.w]}),dt.angularAxis=dt.mockAxis(st,tt,it,{side:"right",domain:[0,Math.PI],autorange:!1}),dt.doAutoRange(st,tt),dt.updateAngularAxis(st,tt),dt.updateRadialAxis(st,tt),dt.updateRadialAxisTitle(st,tt),dt.xaxis=dt.mockCartesianAxis(st,tt,{_id:"x",domain:se}),dt.yaxis=dt.mockCartesianAxis(st,tt,{_id:"y",domain:Tt});var Hr=dt.pathSubplot();dt.clipPaths.forTraces.select("path").attr("d",Hr).attr("transform",e(Ge,cr)),rt.frontplot.attr("transform",e(Mt,te)).call(a.setClipUrl,dt._hasClipOnAxisFalse?null:dt.clipIds.forTraces,dt.gd),rt.bg.attr("d",Hr).attr("transform",e(Te,He)).call(r.fill,tt.bgcolor)},q.mockAxis=function(st,tt,dt,rt){var at=S.extendFlat({},dt,rt);return s(at,tt,st),at},q.mockCartesianAxis=function(st,tt,dt){var rt=this,at=rt.isSmith,vt=dt._id,it=S.extendFlat({type:"linear"},dt);i(it,st);var Y={x:[0,2],y:[1,3]};return it.setRange=function(){var ft=rt.sectorBBox,ut=Y[vt],wt=rt.radialAxis._rl,zt=(wt[1]-wt[0])/(1-rt.getHole(tt));it.range=[ft[ut[0]]*zt,ft[ut[1]]*zt]},it.isPtWithinRange=vt==="x"&&!at?function(ft){return rt.isPtInside(ft)}:function(){return!0},it.setRange(),it.setScale(),it},q.doAutoRange=function(st,tt){var dt=this,rt=dt.gd,at=dt.radialAxis,vt=dt.getRadial(tt);f(rt,at);var it=at.range;if(vt.range=it.slice(),vt._input.range=it.slice(),at._rl=[at.r2l(it[0],null,"gregorian"),at.r2l(it[1],null,"gregorian")],at.minallowed!==void 0){var Y=at.r2l(at.minallowed);at._rl[0]>at._rl[1]?at._rl[1]=Math.max(at._rl[1],Y):at._rl[0]=Math.max(at._rl[0],Y)}if(at.maxallowed!==void 0){var ft=at.r2l(at.maxallowed);at._rl[0]<at._rl[1]?at._rl[1]=Math.min(at._rl[1],ft):at._rl[0]=Math.min(at._rl[0],ft)}},q.updateRadialAxis=function(st,tt){var dt=this,rt=dt.gd,at=dt.layers,vt=dt.radius,it=dt.innerRadius,Y=dt.cx,ft=dt.cy,ut=dt.getRadial(tt),wt=H(dt.getSector(tt)[0],360),zt=dt.radialAxis,Pt=it<vt,Wt=dt.isSmith;Wt||(dt.fillViewInitialKey("radialaxis.angle",ut.angle),dt.fillViewInitialKey("radialaxis.range",zt.range.slice()),zt.setGeometry()),zt.tickangle==="auto"&&wt>90&&wt<=270&&(zt.tickangle=180);var Ht=Wt?function(ve){var oe=N(dt,w([ve.x,0]));return e(oe[0]-Y,oe[1]-ft)}:function(ve){return e(zt.l2p(ve.x)+it,0)},Jt=Wt?function(ve){return O(dt,ve.x,-1/0,1/0)}:function(ve){return dt.pathArc(zt.r2p(ve.x)+it)},ge=X(ut);if(dt.radialTickLayout!==ge&&(at["radial-axis"].selectAll(".xtick").remove(),dt.radialTickLayout=ge),Pt){zt.setScale();var he=0,de=Wt?(zt.tickvals||[]).filter(function(ve){return ve>=0}).map(function(ve){return o.tickText(zt,ve,!0,!1)}):o.calcTicks(zt),se=Wt?de:o.clipEnds(zt,de),Tt=o.getTickSigns(zt)[2];Wt&&((zt.ticks==="top"&&zt.side==="bottom"||zt.ticks==="bottom"&&zt.side==="top")&&(Tt=-Tt),zt.ticks==="top"&&zt.side==="top"&&(he=-zt.ticklen),zt.ticks==="bottom"&&zt.side==="bottom"&&(he=zt.ticklen)),o.drawTicks(rt,zt,{vals:de,layer:at["radial-axis"],path:o.makeTickPath(zt,0,Tt),transFn:Ht,crisp:!1}),o.drawGrid(rt,zt,{vals:se,layer:at["radial-grid"],path:Jt,transFn:S.noop,crisp:!1}),o.drawLabels(rt,zt,{vals:de,layer:at["radial-axis"],transFn:Ht,labelFns:o.makeLabelFns(zt,he)})}var Lt=dt.radialAxisAngle=dt.vangles?U(yt(F(ut.angle),dt.vangles)):ut.angle,Mt=e(Y,ft),te=Mt+t(-Lt);pt(at["radial-axis"],Pt&&(ut.showticklabels||ut.ticks),{transform:te}),pt(at["radial-grid"],Pt&&ut.showgrid,{transform:Wt?"":Mt}),pt(at["radial-line"].select("line"),Pt&&ut.showline,{x1:Wt?-vt:it,y1:0,x2:vt,y2:0,transform:te}).attr("stroke-width",ut.linewidth).call(r.stroke,ut.linecolor)},q.updateRadialAxisTitle=function(st,tt,dt){if(!this.isSmith){var rt=this,at=rt.gd,vt=rt.radius,it=rt.cx,Y=rt.cy,ft=rt.getRadial(tt),ut=rt.id+"title",wt=0;if(ft.title){var zt=a.bBox(rt.layers["radial-axis"].node()).height,Pt=ft.title.font.size,Wt=ft.side;wt=Wt==="top"?Pt:Wt==="counterclockwise"?-(zt+Pt*.4):zt+Pt*.8}var Ht=dt!==void 0?dt:rt.radialAxisAngle,Jt=F(Ht),ge=Math.cos(Jt),he=Math.sin(Jt),de=it+vt/2*ge+wt*he,se=Y-vt/2*he+wt*ge;rt.layers["radial-axis-title"]=T.draw(at,ut,{propContainer:ft,propName:rt.id+".radialaxis.title.text",placeholder:V(at,"Click to enter radial axis title"),attributes:{x:de,y:se,"text-anchor":"middle"},transform:{rotate:-Ht}})}},q.updateAngularAxis=function(st,tt){var dt=this,rt=dt.gd,at=dt.layers,vt=dt.radius,it=dt.innerRadius,Y=dt.cx,ft=dt.cy,ut=dt.getAngular(tt),wt=dt.angularAxis,zt=dt.isSmith;zt||(dt.fillViewInitialKey("angularaxis.rotation",ut.rotation),wt.setGeometry(),wt.setScale());var Pt=zt?function(oe){var Te=N(dt,w([0,oe.x]));return Math.atan2(Te[0]-Y,Te[1]-ft)-Math.PI/2}:function(oe){return wt.t2g(oe.x)};wt.type==="linear"&&wt.thetaunit==="radians"&&(wt.tick0=U(wt.tick0),wt.dtick=U(wt.dtick));var Wt=function(oe){return e(Y+vt*Math.cos(oe),ft-vt*Math.sin(oe))},Ht=zt?function(oe){var Te=N(dt,w([0,oe.x]));return e(Te[0],Te[1])}:function(oe){return Wt(Pt(oe))},Jt=zt?function(oe){var Te=N(dt,w([0,oe.x])),He=Math.atan2(Te[0]-Y,Te[1]-ft)-Math.PI/2;return e(Te[0],Te[1])+t(-U(He))}:function(oe){var Te=Pt(oe);return Wt(Te)+t(-U(Te))},ge=zt?function(oe){return R(dt,oe.x,0,1/0)}:function(oe){var Te=Pt(oe),He=Math.cos(Te),Ge=Math.sin(Te);return"M"+[Y+it*He,ft-it*Ge]+"L"+[Y+vt*He,ft-vt*Ge]},he=o.makeLabelFns(wt,0),de=he.labelStandoff,se={};se.xFn=function(oe){var Te=Pt(oe);return Math.cos(Te)*de},se.yFn=function(oe){var Te=Pt(oe),He=Math.sin(Te)>0?.2:1;return-Math.sin(Te)*(de+oe.fontSize*He)+Math.abs(Math.cos(Te))*(oe.fontSize*A)},se.anchorFn=function(oe){var Te=Pt(oe),He=Math.cos(Te);return Math.abs(He)<.1?"middle":He>0?"start":"end"},se.heightFn=function(oe,Te,He){var Ge=Pt(oe);return-.5*(1+Math.sin(Ge))*He};var Tt=X(ut);dt.angularTickLayout!==Tt&&(at["angular-axis"].selectAll("."+wt._id+"tick").remove(),dt.angularTickLayout=Tt);var Lt=zt?[1/0].concat(wt.tickvals||[]).map(function(oe){return o.tickText(wt,oe,!0,!1)}):o.calcTicks(wt);zt&&(Lt[0].text="∞",Lt[0].fontSize*=1.75);var Mt;if(tt.gridshape==="linear"?(Mt=Lt.map(Pt),S.angleDelta(Mt[0],Mt[1])<0&&(Mt=Mt.slice().reverse())):Mt=null,dt.vangles=Mt,wt.type==="category"&&(Lt=Lt.filter(function(oe){return S.isAngleInsideSector(Pt(oe),dt.sectorInRad)})),wt.visible){var te=wt.ticks==="inside"?-1:1,ve=(wt.linewidth||1)/2;o.drawTicks(rt,wt,{vals:Lt,layer:at["angular-axis"],path:"M"+te*ve+",0h"+te*wt.ticklen,transFn:Jt,crisp:!1}),o.drawGrid(rt,wt,{vals:Lt,layer:at["angular-grid"],path:ge,transFn:S.noop,crisp:!1}),o.drawLabels(rt,wt,{vals:Lt,layer:at["angular-axis"],repositionOnUpdate:!0,transFn:Ht,labelFns:se})}pt(at["angular-line"].select("path"),ut.showline,{d:dt.pathSubplot(),transform:e(Y,ft)}).attr("stroke-width",ut.linewidth).call(r.stroke,ut.linecolor)},q.updateFx=function(st,tt){if(!this.gd._context.staticPlot){var dt=!this.isSmith;dt&&(this.updateAngularDrag(st),this.updateRadialDrag(st,tt,0),this.updateRadialDrag(st,tt,1)),this.updateHoverAndMainDrag(st)}},q.updateHoverAndMainDrag=function(st){var tt=this,dt=tt.isSmith,rt=tt.gd,at=tt.layers,vt=st._zoomlayer,it=h.MINZOOM,Y=h.OFFEDGE,ft=tt.radius,ut=tt.innerRadius,wt=tt.cx,zt=tt.cy,Pt=tt.cxx,Wt=tt.cyy,Ht=tt.sectorInRad,Jt=tt.vangles,ge=tt.radialAxis,he=p.clampTiny,de=p.findXYatLength,se=p.findEnclosingVertexAngles,Tt=h.cornerHalfWidth,Lt=h.cornerLen/2,Mt,te,ve=x.makeDragger(at,"path","maindrag",st.dragmode===!1?"none":"crosshair");c.select(ve).attr("d",tt.pathSubplot()).attr("transform",e(wt,zt)),ve.onmousemove=function(Tr){v.hover(rt,Tr,tt.id),rt._fullLayout._lasthover=ve,rt._fullLayout._hoversubplot=tt.id},ve.onmouseout=function(Tr){rt._dragging||y.unhover(rt,Tr)};var oe={element:ve,gd:rt,subplot:tt.id,plotinfo:{id:tt.id,xaxis:tt.xaxis,yaxis:tt.yaxis},xaxes:[tt.xaxis],yaxes:[tt.yaxis]},Te,He,Ge,cr,ur,jr,Hr,br,Kr;function rn(Tr,pr){return Math.sqrt(Tr*Tr+pr*pr)}function Ce(Tr,pr){return rn(Tr-Pt,pr-Wt)}function $t(Tr,pr){return Math.atan2(Wt-pr,Tr-Pt)}function ne(Tr,pr){return[Tr*Math.cos(pr),Tr*Math.sin(-pr)]}function Ct(Tr,pr){if(Tr===0)return tt.pathSector(2*Tt);var Jr=Lt/Tr,Vn=pr-Jr,Hn=pr+Jr,Kn=Math.max(0,Math.min(Tr,ft)),Ci=Kn-Tt,ii=Kn+Tt;return"M"+ne(Ci,Vn)+"A"+[Ci,Ci]+" 0,0,0 "+ne(Ci,Hn)+"L"+ne(ii,Hn)+"A"+[ii,ii]+" 0,0,1 "+ne(ii,Vn)+"Z"}function gt(Tr,pr,Jr){if(Tr===0)return tt.pathSector(2*Tt);var Vn=ne(Tr,pr),Hn=ne(Tr,Jr),Kn=he((Vn[0]+Hn[0])/2),Ci=he((Vn[1]+Hn[1])/2),ii,qn;if(Kn&&Ci){var oa=Ci/Kn,Hi=-1/oa,We=de(Tt,oa,Kn,Ci);ii=de(Lt,Hi,We[0][0],We[0][1]),qn=de(Lt,Hi,We[1][0],We[1][1])}else{var rr,fr;Ci?(rr=Lt,fr=Tt):(rr=Tt,fr=Lt),ii=[[Kn-rr,Ci-fr],[Kn+rr,Ci-fr]],qn=[[Kn-rr,Ci+fr],[Kn+rr,Ci+fr]]}return"M"+ii.join("L")+"L"+qn.reverse().join("L")+"Z"}function St(){Ge=null,cr=null,ur=tt.pathSubplot(),jr=!1;var Tr=rt._fullLayout[tt.id];Hr=g(Tr.bgcolor).getLuminance(),br=x.makeZoombox(vt,Hr,wt,zt,ur),br.attr("fill-rule","evenodd"),Kr=x.makeCorners(vt,wt,zt),_(rt)}function Nt(Tr,pr){return pr=Math.max(Math.min(pr,ft),ut),Tr<Y?Tr=0:ft-Tr<Y?Tr=ft:pr<Y?pr=0:ft-pr<Y&&(pr=ft),Math.abs(pr-Tr)>it?(Tr<pr?(Ge=Tr,cr=pr):(Ge=pr,cr=Tr),!0):(Ge=null,cr=null,!1)}function ee(Tr,pr){Tr=Tr||ur,pr=pr||"M0,0Z",br.attr("d",Tr),Kr.attr("d",pr),x.transitionZoombox(br,Kr,jr,Hr),jr=!0;var Jr={};ar(Jr),rt.emit("plotly_relayouting",Jr)}function le(Tr,pr){Tr=Tr*Mt,pr=pr*te;var Jr=Te+Tr,Vn=He+pr,Hn=Ce(Te,He),Kn=Math.min(Ce(Jr,Vn),ft),Ci=$t(Te,He),ii,qn;Nt(Hn,Kn)&&(ii=ur+tt.pathSector(cr),Ge&&(ii+=tt.pathSector(Ge)),qn=Ct(Ge,Ci)+Ct(cr,Ci)),ee(ii,qn)}function we(Tr,pr,Jr,Vn){var Hn=p.findIntersectionXY(Jr,Vn,Jr,[Tr-Pt,Wt-pr]);return rn(Hn[0],Hn[1])}function Ue(Tr,pr){var Jr=Te+Tr,Vn=He+pr,Hn=$t(Te,He),Kn=$t(Jr,Vn),Ci=se(Hn,Jt),ii=se(Kn,Jt),qn=we(Te,He,Ci[0],Ci[1]),oa=Math.min(we(Jr,Vn,ii[0],ii[1]),ft),Hi,We;Nt(qn,oa)&&(Hi=ur+tt.pathSector(cr),Ge&&(Hi+=tt.pathSector(Ge)),We=[gt(Ge,Ci[0],Ci[1]),gt(cr,Ci[0],Ci[1])].join(" ")),ee(Hi,We)}function qe(){if(x.removeZoombox(rt),!(Ge===null||cr===null)){var Tr={};ar(Tr),x.showDoubleClickNotifier(rt),P.call("_guiRelayout",rt,Tr)}}function ar(Tr){var pr=ge._rl,Jr=(pr[1]-pr[0])/(1-ut/ft)/ft,Vn=[pr[0]+(Ge-ut)*Jr,pr[0]+(cr-ut)*Jr];Tr[tt.id+".radialaxis.range"]=Vn}function Ar(Tr,pr){var Jr=rt._fullLayout.clickmode;if(x.removeZoombox(rt),Tr===2){var Vn={};for(var Hn in tt.viewInitial)Vn[tt.id+"."+Hn]=tt.viewInitial[Hn];rt.emit("plotly_doubleclick",null),P.call("_guiRelayout",rt,Vn)}Jr.indexOf("select")>-1&&Tr===1&&b(pr,rt,[tt.xaxis],[tt.yaxis],tt.id,oe),Jr.indexOf("event")>-1&&v.click(rt,pr,tt.id)}oe.prepFn=function(Tr,pr,Jr){var Vn=rt._fullLayout.dragmode,Hn=ve.getBoundingClientRect();rt._fullLayout._calcInverseTransform(rt);var Kn=rt._fullLayout._invTransform;Mt=rt._fullLayout._invScaleX,te=rt._fullLayout._invScaleY;var Ci=S.apply3DTransform(Kn)(pr-Hn.left,Jr-Hn.top);if(Te=Ci[0],He=Ci[1],Jt){var ii=p.findPolygonOffset(ft,Ht[0],Ht[1],Jt);Te+=Pt+ii[0],He+=Wt+ii[1]}switch(Vn){case"zoom":oe.clickFn=Ar,dt||(Jt?oe.moveFn=Ue:oe.moveFn=le,oe.doneFn=qe,St());break;case"select":case"lasso":u(Tr,pr,Jr,oe,Vn);break}},y.init(oe)},q.updateRadialDrag=function(st,tt,dt){var rt=this,at=rt.gd,vt=rt.layers,it=rt.radius,Y=rt.innerRadius,ft=rt.cx,ut=rt.cy,wt=rt.radialAxis,zt=h.radialDragBoxSize,Pt=zt/2;if(!wt.visible)return;var Wt=F(rt.radialAxisAngle),Ht=wt._rl,Jt=Ht[0],ge=Ht[1],he=Ht[dt],de=.75*(Ht[1]-Ht[0])/(1-rt.getHole(tt))/it,se,Tt,Lt;dt?(se=ft+(it+Pt)*Math.cos(Wt),Tt=ut-(it+Pt)*Math.sin(Wt),Lt="radialdrag"):(se=ft+(Y-Pt)*Math.cos(Wt),Tt=ut-(Y-Pt)*Math.sin(Wt),Lt="radialdrag-inner");var Mt=x.makeRectDragger(vt,Lt,"crosshair",-Pt,-Pt,zt,zt),te={element:Mt,gd:at};st.dragmode===!1&&(te.dragmode=!1),pt(c.select(Mt),wt.visible&&Y<it,{transform:e(se,Tt)});var ve,oe,Te;function He(Hr,br){if(ve)ve(Hr,br);else{var Kr=[Hr,-br],rn=[Math.cos(Wt),Math.sin(Wt)],Ce=Math.abs(S.dot(Kr,rn)/Math.sqrt(S.dot(Kr,Kr)));isNaN(Ce)||(ve=Ce<.5?ur:jr)}var $t={};Ge($t),at.emit("plotly_relayouting",$t)}function Ge(Hr){oe!==null?Hr[rt.id+".radialaxis.angle"]=oe:Te!==null&&(Hr[rt.id+".radialaxis.range["+dt+"]"]=Te)}function cr(){oe!==null?P.call("_guiRelayout",at,rt.id+".radialaxis.angle",oe):Te!==null&&P.call("_guiRelayout",at,rt.id+".radialaxis.range["+dt+"]",Te)}function ur(Hr,br){if(dt!==0){var Kr=se+Hr,rn=Tt+br;oe=Math.atan2(ut-rn,Kr-ft),rt.vangles&&(oe=yt(oe,rt.vangles)),oe=U(oe);var Ce=e(ft,ut)+t(-oe);vt["radial-axis"].attr("transform",Ce),vt["radial-line"].select("line").attr("transform",Ce);var $t=rt.gd._fullLayout,ne=$t[rt.id];rt.updateRadialAxisTitle($t,ne,oe)}}function jr(Hr,br){var Kr=S.dot([Hr,-br],[Math.cos(Wt),Math.sin(Wt)]);if(Te=he-de*Kr,de>0!=(dt?Te>Jt:Te<ge)){Te=null;return}var rn=at._fullLayout,Ce=rn[rt.id];wt.range[dt]=Te,wt._rl[dt]=Te,rt.updateRadialAxis(rn,Ce),rt.xaxis.setRange(),rt.xaxis.setScale(),rt.yaxis.setRange(),rt.yaxis.setScale();var $t=!1;for(var ne in rt.traceHash){var Ct=rt.traceHash[ne],gt=S.filterVisible(Ct),St=Ct[0][0].trace._module;St.plot(at,rt,gt,Ce),P.traceIs(ne,"gl")&&gt.length&&($t=!0)}$t&&(M(at),E(at))}te.prepFn=function(){ve=null,oe=null,Te=null,te.moveFn=He,te.doneFn=cr,_(at)},te.clampFn=function(Hr,br){return Math.sqrt(Hr*Hr+br*br)<h.MINDRAG&&(Hr=0,br=0),[Hr,br]},y.init(te)},q.updateAngularDrag=function(st){var tt=this,dt=tt.gd,rt=tt.layers,at=tt.radius,vt=tt.angularAxis,it=tt.cx,Y=tt.cy,ft=tt.cxx,ut=tt.cyy,wt=h.angularDragBoxSize,zt=x.makeDragger(rt,"path","angulardrag",st.dragmode===!1?"none":"move"),Pt={element:zt,gd:dt};st.dragmode===!1?Pt.dragmode=!1:c.select(zt).attr("d",tt.pathAnnulus(at,at+wt)).attr("transform",e(it,Y)).call(C,"move");function Wt(Te,He){return Math.atan2(ut+wt-He,Te-ft-wt)}var Ht=rt.frontplot.select(".scatterlayer").selectAll(".trace"),Jt=Ht.selectAll(".point"),ge=Ht.selectAll(".textpoint"),he,de,se,Tt,Lt,Mt;function te(Te,He){var Ge=tt.gd._fullLayout,cr=Ge[tt.id],ur=he+Te*st._invScaleX,jr=de+He*st._invScaleY,Hr=Wt(ur,jr),br=U(Hr-Mt);if(Tt=se+br,rt.frontplot.attr("transform",e(tt.xOffset2,tt.yOffset2)+t([-br,ft,ut])),tt.vangles){Lt=tt.radialAxisAngle+br;var Kr=e(it,Y)+t(-br),rn=e(it,Y)+t(-Lt);rt.bg.attr("transform",Kr),rt["radial-grid"].attr("transform",Kr),rt["radial-axis"].attr("transform",rn),rt["radial-line"].select("line").attr("transform",rn),tt.updateRadialAxisTitle(Ge,cr,Lt)}else tt.clipPaths.forTraces.select("path").attr("transform",e(ft,ut)+t(br));Jt.each(function(){var Nt=c.select(this),ee=a.getTranslate(Nt);Nt.attr("transform",e(ee.x,ee.y)+t([br]))}),ge.each(function(){var Nt=c.select(this),ee=Nt.select("text"),le=a.getTranslate(Nt);Nt.attr("transform",t([br,ee.attr("x"),ee.attr("y")])+e(le.x,le.y))}),vt.rotation=S.modHalf(Tt,360),tt.updateAngularAxis(Ge,cr),tt._hasClipOnAxisFalse&&!S.isFullCircle(tt.sectorInRad)&&Ht.call(a.hideOutsideRangePoints,tt);var Ce=!1;for(var $t in tt.traceHash)if(P.traceIs($t,"gl")){var ne=tt.traceHash[$t],Ct=S.filterVisible(ne),gt=ne[0][0].trace._module;gt.plot(dt,tt,Ct,cr),Ct.length&&(Ce=!0)}Ce&&(M(dt),E(dt));var St={};ve(St),dt.emit("plotly_relayouting",St)}function ve(Te){Te[tt.id+".angularaxis.rotation"]=Tt,tt.vangles&&(Te[tt.id+".radialaxis.angle"]=Lt)}function oe(){ge.select("text").attr("transform",null);var Te={};ve(Te),P.call("_guiRelayout",dt,Te)}Pt.prepFn=function(Te,He,Ge){var cr=st[tt.id];se=cr.angularaxis.rotation;var ur=zt.getBoundingClientRect();he=He-ur.left,de=Ge-ur.top,dt._fullLayout._calcInverseTransform(dt);var jr=S.apply3DTransform(st._invTransform)(he,de);he=jr[0],de=jr[1],Mt=Wt(he,de),Pt.moveFn=te,Pt.doneFn=oe,_(dt)},tt.vangles&&!S.isFullCircle(tt.sectorInRad)&&(Pt.prepFn=S.noop,C(c.select(zt),null)),y.init(Pt)},q.isPtInside=function(st){if(this.isSmith)return!0;var tt=this.sectorInRad,dt=this.vangles,rt=this.angularAxis.c2g(st.theta),at=this.radialAxis,vt=at.c2l(st.r),it=at._rl,Y=dt?p.isPtInsidePolygon:S.isPtInsideSector;return Y(vt,rt,it,tt,dt)},q.pathArc=function(st){var tt=this.sectorInRad,dt=this.vangles,rt=dt?p.pathPolygon:S.pathArc;return rt(st,tt[0],tt[1],dt)},q.pathSector=function(st){var tt=this.sectorInRad,dt=this.vangles,rt=dt?p.pathPolygon:S.pathSector;return rt(st,tt[0],tt[1],dt)},q.pathAnnulus=function(st,tt){var dt=this.sectorInRad,rt=this.vangles,at=rt?p.pathPolygonAnnulus:S.pathAnnulus;return at(st,tt,dt[0],dt[1],rt)},q.pathSubplot=function(){var st=this.innerRadius,tt=this.radius;return st?this.pathAnnulus(st,tt):this.pathSector(tt)},q.fillViewInitialKey=function(st,tt){st in this.viewInitial||(this.viewInitial[st]=tt)};function X(st){var tt=st.ticks+String(st.ticklen)+String(st.showticklabels);return"side"in st&&(tt+=st.side),tt}function lt(st){var tt=st[0],dt=st[1],rt=dt-tt,at=H(tt,360),vt=at+rt,it=Math.cos(F(at)),Y=Math.sin(F(at)),ft=Math.cos(F(vt)),ut=Math.sin(F(vt)),wt,zt,Pt,Wt;return at<=90&&vt>=90||at>90&&vt>=450?Wt=1:Y<=0&&ut<=0?Wt=0:Wt=Math.max(Y,ut),at<=180&&vt>=180||at>180&&vt>=540?wt=-1:it>=0&&ft>=0?wt=0:wt=Math.min(it,ft),at<=270&&vt>=270||at>270&&vt>=630?zt=-1:Y>=0&&ut>=0?zt=0:zt=Math.min(Y,ut),vt>=360?Pt=1:it<=0&&ft<=0?Pt=0:Pt=Math.max(it,ft),[wt,zt,Pt,Wt]}function yt(st,tt){var dt=function(at){return S.angleDist(st,at)},rt=S.findIndexOfMin(tt,dt);return tt[rt]}function pt(st,tt,dt){return tt?(st.attr("display",null),st.attr(dt)):st&&st.attr("display","none"),st}}),WE=Ft((Q,$)=>{var c=bi(),g=Ad(),P=Nh().attributes,S=bn().extendFlat,t=Yc().overrideAll,e=t({color:g.color,showline:S({},g.showline,{dflt:!0}),linecolor:g.linecolor,linewidth:g.linewidth,showgrid:S({},g.showgrid,{dflt:!0}),gridcolor:g.gridcolor,gridwidth:g.gridwidth,griddash:g.griddash},"plot","from-root"),r=t({tickmode:g.minor.tickmode,nticks:g.nticks,tick0:g.tick0,dtick:g.dtick,tickvals:g.tickvals,ticktext:g.ticktext,ticks:g.ticks,ticklen:g.ticklen,tickwidth:g.tickwidth,tickcolor:g.tickcolor,ticklabelstep:g.ticklabelstep,showticklabels:g.showticklabels,labelalias:g.labelalias,minorloglabels:g.minorloglabels,showtickprefix:g.showtickprefix,tickprefix:g.tickprefix,showticksuffix:g.showticksuffix,ticksuffix:g.ticksuffix,showexponent:g.showexponent,exponentformat:g.exponentformat,minexponent:g.minexponent,separatethousands:g.separatethousands,tickfont:g.tickfont,tickangle:g.tickangle,tickformat:g.tickformat,tickformatstops:g.tickformatstops,layer:g.layer},"plot","from-root"),a={visible:S({},g.visible,{dflt:!0}),type:S({},g.type,{values:["-","linear","log","date","category"]}),autotypenumbers:g.autotypenumbers,autorangeoptions:{minallowed:g.autorangeoptions.minallowed,maxallowed:g.autorangeoptions.maxallowed,clipmin:g.autorangeoptions.clipmin,clipmax:g.autorangeoptions.clipmax,include:g.autorangeoptions.include,editType:"plot"},autorange:S({},g.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:S({},g.minallowed,{editType:"plot"}),maxallowed:S({},g.maxallowed,{editType:"plot"}),range:S({},g.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:g.categoryorder,categoryarray:g.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:g.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:S({},g.title.text,{editType:"plot",dflt:""}),font:S({},g.title.font,{editType:"plot"}),editType:"plot"},hoverformat:g.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};S(a,e,r);var n={visible:S({},g.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:g.autotypenumbers,categoryorder:g.categoryorder,categoryarray:g.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:g.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};S(n,e,r),$.exports={domain:P({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:c.background},radialaxis:a,angularaxis:n,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),hZ=Ft((Q,$)=>{var c=bn(),g=li(),P=pu(),S=P1(),t=ud().getSubplotData,e=mg(),r=gg(),a=n0(),n=dm(),o=jm(),i=Yy(),s=gw(),f=dv(),x=WE(),y=UE(),v=kT(),T=v.axisNames;function u(_,C,M,E){var A=M("bgcolor");E.bgColor=g.combine(A,E.paper_bgcolor);var h=M("sector");M("hole");var p=t(E.fullData,v.name,E.id),k=E.layoutOut,w;function R(zt,Pt){return M(w+"."+zt,Pt)}for(var O=0;O<T.length;O++){w=T[O],c.isPlainObject(_[w])||(_[w]={});var N=_[w],V=P.newContainer(C,w);V._id=V._name=w,V._attr=E.id+"."+w,V._traceIndices=p.map(function(zt){return zt.index});var H=v.axisName2dataArray[w],F=b(N,V,R,p,H,E);o(N,V,R,{axData:p,dataAttr:H});var U=R("visible");switch(y(V,C,k),R("uirevision",C.uirevision),V._m=1,w){case"radialaxis":R("minallowed"),R("maxallowed");var W=R("range"),q=V.getAutorangeDflt(W),X=R("autorange",q),lt;W&&(W[0]===null&&W[1]===null||(W[0]===null||W[1]===null)&&(X==="reversed"||X===!0)||W[0]!==null&&(X==="min"||X==="max reversed")||W[1]!==null&&(X==="max"||X==="min reversed"))&&(W=void 0,delete V.range,V.autorange=!0,lt=!0),lt||(q=V.getAutorangeDflt(W),X=R("autorange",q)),N.autorange=X,X&&(s(R,X,W),(F==="linear"||F==="-")&&R("rangemode"),V.isReversed()&&(V._m=-1)),V.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if(F==="date"){c.log("Polar plots do not support date angular axes yet.");for(var yt=0;yt<p.length;yt++)p[yt].visible=!1;F=N.type=V.type="linear"}R(F==="linear"?"thetaunit":"period");var pt=R("direction");R("rotation",{counterclockwise:0,clockwise:90}[pt]);break}if(n(N,V,R,V.type,{tickSuffixDflt:V.thetaunit==="degrees"?"°":void 0}),U){var st,tt,dt,rt,at,vt,it,Y,ft,ut,wt=E.font||{};st=R("color"),tt=st===N.color?st:wt.color,dt=wt.size,rt=wt.family,at=wt.weight,vt=wt.style,it=wt.variant,Y=wt.textcase,ft=wt.lineposition,ut=wt.shadow,e(N,V,R,V.type),a(N,V,R,V.type,{font:{weight:at,style:vt,variant:it,textcase:Y,lineposition:ft,shadow:ut,color:tt,size:dt,family:rt},noAutotickangles:w==="angularaxis",noTicklabelshift:!0,noTicklabelstandoff:!0}),r(N,V,R,{outerTicks:!0}),i(N,V,R,{dfltColor:st,bgColor:E.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:x[w]}),R("layer"),w==="radialaxis"&&(R("side"),R("angle",h[0]),R("title.text"),c.coerceFont(R,"title.font",{weight:at,style:vt,variant:it,textcase:Y,lineposition:ft,shadow:ut,color:tt,size:c.bigFont(dt),family:rt}))}F!=="category"&&R("hoverformat"),V._input=N}C.angularaxis.type==="category"&&M("gridshape")}function b(_,C,M,E,A,h){var p=M("autotypenumbers",h.autotypenumbersDflt),k=M("type");if(k==="-"){for(var w,R=0;R<E.length;R++)if(E[R].visible){w=E[R];break}w&&w[A]&&(C.type=f(w[A],"gregorian",{noMultiCategory:!0,autotypenumbers:p})),C.type==="-"?C.type="linear":_.type=C.type}return C.type}$.exports=function(_,C,M){S(_,C,M,{type:v.name,attributes:x,handleDefaults:u,font:C.font,autotypenumbersDflt:C.autotypenumbers,paper_bgcolor:C.paper_bgcolor,fullData:M,layoutOut:C})}}),AT=Ft((Q,$)=>{var c=ud().getSubplotCalcData,g=bn().counterRegex,P=HE(),S=kT(),t=S.attr,e=S.name,r=g(e),a={};a[t]={valType:"subplotid",dflt:e,editType:"calc"};function n(i){for(var s=i._fullLayout,f=i.calcdata,x=s._subplots[e],y=0;y<x.length;y++){var v=x[y],T=c(f,e,v),u=s[v]._subplot;u||(u=P(i,v),s[v]._subplot=u),u.plot(T,s,i._promises)}}function o(i,s,f,x){for(var y=x._subplots[e]||[],v=x._has&&x._has("gl"),T=s._has&&s._has("gl"),u=v&&!T,b=0;b<y.length;b++){var _=y[b],C=x[_]._subplot;if(!s[_]&&C){C.framework.remove(),C.layers["radial-axis-title"].remove();for(var M in C.clipPaths)C.clipPaths[M].remove()}u&&C._scene&&(C._scene.destroy(),C._scene=null)}}$.exports={attr:t,name:e,idRoot:e,idRegex:r,attrRegex:r,attributes:a,layoutAttributes:WE(),supplyLayoutDefaults:hZ(),plot:n,clean:o,toSVG:Mf().toSVG}}),E3=Ft((Q,$)=>{var{hovertemplateAttrs:c,texttemplateAttrs:g,templatefallbackAttrs:P}=$u(),S=Ta().extendFlat,t=z0(),e=tf(),r=$o(),a=e.line;$.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:g({editType:"plot"},{keys:["r","theta","text"]}),texttemplatefallback:P({editType:"plot"}),hovertext:e.hovertext,line:{color:a.color,width:a.width,dash:a.dash,backoff:a.backoff,shape:S({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:e.connectgaps,marker:e.marker,cliponaxis:S({},e.cliponaxis,{dflt:!1}),textposition:e.textposition,textfont:e.textfont,fill:S({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:t(),hoverinfo:S({},r.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:e.hoveron,hovertemplate:c(),hovertemplatefallback:P(),selected:e.selected,unselected:e.unselected}}),MT=Ft((Q,$)=>{var c=bn(),g=Ac(),P=s0(),S=I0(),t=xv(),e=x0(),r=O0(),a=vm().PTS_LINESONLY,n=E3();function o(s,f,x,y){function v(b,_){return c.coerce(s,f,n,b,_)}var T=i(s,f,y,v);if(!T){f.visible=!1;return}v("thetaunit"),v("mode",T<a?"lines+markers":"lines"),v("text"),v("hovertext"),f.hoveron!=="fills"&&(v("hovertemplate"),v("hovertemplatefallback")),g.hasMarkers(f)&&P(s,f,x,y,v,{gradient:!0}),g.hasLines(f)&&(S(s,f,x,y,v,{backoff:!0}),t(s,f,v),v("connectgaps")),g.hasText(f)&&(v("texttemplate"),v("texttemplatefallback"),e(s,f,y,v));var u=[];(g.hasMarkers(f)||g.hasText(f))&&(v("cliponaxis"),v("marker.maxdisplayed"),u.push("points")),v("fill"),f.fill!=="none"&&(r(s,f,x,v),g.hasLines(f)||t(s,f,v)),(f.fill==="tonext"||f.fill==="toself")&&u.push("fills"),v("hoveron",u.join("+")||"points"),c.coerceSelectionMarkerOpacity(f,v)}function i(s,f,x,y){var v=y("r"),T=y("theta");c.isTypedArray(v)&&(f.r=v=Array.from(v)),c.isTypedArray(T)&&(f.theta=T=Array.from(T));var u;if(v)T?u=Math.min(v.length,T.length):(u=v.length,y("theta0"),y("dtheta"));else{if(!T)return 0;u=f.theta.length,y("r0"),y("dr")}return f._length=u,u}$.exports={handleRThetaDefaults:i,supplyDefaults:o}}),ST=Ft((Q,$)=>{var c=bn(),g=Es();$.exports=function(P,S,t){var e={},r=t[S.subplot]._subplot,a,n;r?(a=r.radialAxis,n=r.angularAxis):(r=t[S.subplot],a=r.radialaxis,n=r.angularaxis);var o=a.c2l(P.r);e.rLabel=g.tickText(a,o,!0).text;var i=n.thetaunit==="degrees"?c.rad2deg(P.theta):P.theta;return e.thetaLabel=g.tickText(n,i,!0).text,e}}),fZ=Ft((Q,$)=>{var c=ra(),g=Da().BADNUM,P=Es(),S=F0(),t=ct(),e=Bt(),r=me().calcMarkerSize;$.exports=function(a,n){for(var o=a._fullLayout,i=n.subplot,s=o[i].radialaxis,f=o[i].angularaxis,x=s.makeCalcdata(n,"r"),y=f.makeCalcdata(n,"theta"),v=n._length,T=new Array(v),u=0;u<v;u++){var b=x[u],_=y[u],C=T[u]={};c(b)&&c(_)?(C.r=b,C.theta=_):C.r=g}var M=r(n,v);return n._extremes.x=P.findExtremes(s,x,{ppad:M}),S(a,n),t(T,n),e(T,n),T}}),dZ=Ft((Q,$)=>{var c=Ya(),g=Da().BADNUM;$.exports=function(P,S,t){for(var e=S.layers.frontplot.select("g.scatterlayer"),r=S.xaxis,a=S.yaxis,n={xaxis:r,yaxis:a,plot:S.framework,layerClipId:S._hasClipOnAxisFalse?S.clipIds.forTraces:null},o=S.radialAxis,i=S.angularAxis,s=0;s<t.length;s++)for(var f=t[s],x=0;x<f.length;x++){x===0&&(f[0].trace._xA=r,f[0].trace._yA=a);var y=f[x],v=y.r;if(v===g)y.x=y.y=g;else{var T=o.c2g(v),u=i.c2g(y.theta);y.x=T*Math.cos(u),y.y=T*Math.sin(u)}}c(P,n,t,e)}}),ET=Ft((Q,$)=>{var c=Sd();function g(S,t,e,r){var a=c(S,t,e,r);if(!(!a||a[0].index===!1)){var n=a[0];if(n.index===void 0)return a;var o=S.subplot,i=n.cd[n.index],s=n.trace;if(o.isPtInside(i))return n.xLabelVal=void 0,n.yLabelVal=void 0,P(i,s,o,n),n.hovertemplate=s.hovertemplate,a}}function P(S,t,e,r){var a=e.radialAxis,n=e.angularAxis;a._hovertitle="r",n._hovertitle="θ";var o={};o[t.subplot]={_subplot:e};var i=t._module.formatLabels(S,t,o);r.rLabel=i.rLabel,r.thetaLabel=i.thetaLabel;var s=S.hi||t.hoverinfo,f=[];function x(v,T){f.push(v._hovertitle+": "+T)}if(!t.hovertemplate){var y=s.split("+");y.indexOf("all")!==-1&&(y=["r","theta","text"]),y.indexOf("r")!==-1&&x(a,r.rLabel),y.indexOf("theta")!==-1&&x(n,r.thetaLabel),y.indexOf("text")!==-1&&r.text&&(f.push(r.text),delete r.text),r.extraText=f.join("<br>")}}$.exports={hoverPoints:g,makeHoverPointText:P}}),pZ=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:AT(),categories:["polar","symbols","showLegend","scatter-like"],attributes:E3(),supplyDefaults:MT().supplyDefaults,colorbar:xo(),formatLabels:ST(),calc:fZ(),plot:dZ(),style:xl().style,styleOnSelect:xl().styleOnSelect,hoverPoints:ET().hoverPoints,selectPoints:Bf(),meta:{}}}),mZ=Ft((Q,$)=>{$.exports=pZ()}),qE=Ft((Q,$)=>{var c=E3(),{cliponaxis:g,hoveron:P}=c,S=Wr(c,["cliponaxis","hoveron"]),{connectgaps:t,line:{color:e,dash:r,width:a},fill:n,fillcolor:o,marker:i,textfont:s,textposition:f}=x3();$.exports=zr(Fr({},S),{connectgaps:t,fill:n,fillcolor:o,line:{color:e,dash:r,editType:"calc",width:a},marker:i,textfont:s,textposition:f})}),gZ=Ft((Q,$)=>{var c=bn(),g=Ac(),P=MT().handleRThetaDefaults,S=s0(),t=I0(),e=x0(),r=O0(),a=vm().PTS_LINESONLY,n=qE();$.exports=function(o,i,s,f){function x(v,T){return c.coerce(o,i,n,v,T)}var y=P(o,i,f,x);if(!y){i.visible=!1;return}x("thetaunit"),x("mode",y<a?"lines+markers":"lines"),x("text"),x("hovertext"),i.hoveron!=="fills"&&(x("hovertemplate"),x("hovertemplatefallback")),g.hasMarkers(i)&&S(o,i,s,f,x,{noAngleRef:!0,noStandOff:!0}),g.hasLines(i)&&(t(o,i,s,f,x),x("connectgaps")),g.hasText(i)&&(x("texttemplate"),x("texttemplatefallback"),e(o,i,f,x,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),x("fill"),i.fill!=="none"&&r(o,i,s,x),c.coerceSelectionMarkerOpacity(i,x)}}),vZ=Ft((Q,$)=>{var c=ST();$.exports=function(g,P,S){var t=g.i;return"r"in g||(g.r=P._r[t]),"theta"in g||(g.theta=P._theta[t]),c(g,P,S)}}),yZ=Ft((Q,$)=>{var c=F0(),g=me().calcMarkerSize,P=gx(),S=Es(),t=H1().TOO_MANY_POINTS;$.exports=function(e,r){var a=e._fullLayout,n=r.subplot,o=a[n].radialaxis,i=a[n].angularaxis,s=r._r=o.makeCalcdata(r,"r"),f=r._theta=i.makeCalcdata(r,"theta"),x=r._length,y={};x<s.length&&(s=s.slice(0,x)),x<f.length&&(f=f.slice(0,x)),y.r=s,y.theta=f,c(e,r);var v=y.opts=P.style(e,r),T;return x<t?T=g(r,x):v.marker&&(T=2*(v.marker.sizeAvg||Math.max(v.marker.size,3))),r._extremes.x=S.findExtremes(o,s,{ppad:T}),[{x:!1,y:!1,t:y,trace:r}]}}),xZ=Ft((Q,$)=>{var c=rT(),g=ET().makeHoverPointText;function P(S,t,e,r){var a=S.cd,n=a[0].t,o=n.r,i=n.theta,s=c.hoverPoints(S,t,e,r);if(!(!s||s[0].index===!1)){var f=s[0];if(f.index===void 0)return s;var x=S.subplot,y=f.cd[f.index],v=f.trace;if(y.r=o[f.index],y.theta=i[f.index],!!x.isPtInside(y))return f.xLabelVal=void 0,f.yLabelVal=void 0,g(y,v,x,f),s}}$.exports={hoverPoints:P}}),_Z=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:AT(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:qE(),supplyDefaults:gZ(),colorbar:xo(),formatLabels:vZ(),calc:yZ(),hoverPoints:xZ().hoverPoints,selectPoints:MS(),meta:{}}}),bZ=Ft((Q,$)=>{var c=iT(),g=ra(),P=KS(),S=TS(),t=gx(),e=bn(),r=H1().TOO_MANY_POINTS,a={};$.exports=function(n,o,i){if(i.length){var s=o.radialAxis,f=o.angularAxis,x=S(n,o);return i.forEach(function(y){if(!(!y||!y[0]||!y[0].trace)){var v=y[0],T=v.trace,u=v.t,b=T._length,_=u.r,C=u.theta,M=u.opts,E,A=_.slice(),h=C.slice();for(E=0;E<_.length;E++)o.isPtInside({r:_[E],theta:C[E]})||(A[E]=NaN,h[E]=NaN);var p=new Array(b*2),k=Array(b),w=Array(b);for(E=0;E<b;E++){var R=A[E],O,N;if(g(R)){var V=s.c2g(R),H=f.c2g(h[E],T.thetaunit);O=V*Math.cos(H),N=V*Math.sin(H)}else O=N=NaN;k[E]=p[E*2]=O,w[E]=p[E*2+1]=N}u.tree=c(p),M.marker&&b>=r&&(M.marker.cluster=u.tree),M.marker&&(M.markerSel.positions=M.markerUnsel.positions=M.marker.positions=p),M.line&&p.length>1&&e.extendFlat(M.line,t.linePositions(n,T,p)),M.text&&(e.extendFlat(M.text,{positions:p},t.textPosition(n,T,M.text,M.marker)),e.extendFlat(M.textSel,{positions:p},t.textPosition(n,T,M.text,M.markerSel)),e.extendFlat(M.textUnsel,{positions:p},t.textPosition(n,T,M.text,M.markerUnsel))),M.fill&&!x.fill2d&&(x.fill2d=!0),M.marker&&!x.scatter2d&&(x.scatter2d=!0),M.line&&!x.line2d&&(x.line2d=!0),M.text&&!x.glText&&(x.glText=!0),x.lineOptions.push(M.line),x.fillOptions.push(M.fill),x.markerOptions.push(M.marker),x.markerSelectedOptions.push(M.markerSel),x.markerUnselectedOptions.push(M.markerUnsel),x.textOptions.push(M.text),x.textSelectedOptions.push(M.textSel),x.textUnselectedOptions.push(M.textUnsel),x.selectBatch.push([]),x.unselectBatch.push([]),u.x=k,u.y=w,u.rawx=k,u.rawy=w,u.r=_,u.theta=C,u.positions=p,u._scene=x,u.index=x.count,x.count++}}),P(n,o,i)}},$.exports.reglPrecompiled=a}),wZ=Ft((Q,$)=>{var c=_Z();c.plot=bZ(),$.exports=c}),kZ=Ft((Q,$)=>{$.exports=wZ()}),ZE=Ft((Q,$)=>{var{hovertemplateAttrs:c,templatefallbackAttrs:g}=$u(),P=Ta().extendFlat,S=E3(),t=Sg();$.exports={r:S.r,theta:S.theta,r0:S.r0,dr:S.dr,theta0:S.theta0,dtheta:S.dtheta,thetaunit:S.thetaunit,base:P({},t.base,{}),offset:P({},t.offset,{}),width:P({},t.width,{}),text:P({},t.text,{}),hovertext:P({},t.hovertext,{}),marker:e(),hoverinfo:S.hoverinfo,hovertemplate:c(),hovertemplatefallback:g(),selected:t.selected,unselected:t.unselected};function e(){var r=P({},t.marker);return delete r.cornerradius,r}}),$E=Ft((Q,$)=>{$.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}),TZ=Ft((Q,$)=>{var c=bn(),g=MT().handleRThetaDefaults,P=L6(),S=ZE();$.exports=function(t,e,r,a){function n(i,s){return c.coerce(t,e,S,i,s)}var o=g(t,e,a,n);if(!o){e.visible=!1;return}n("thetaunit"),n("base"),n("offset"),n("width"),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback"),P(t,e,n,r,a),c.coerceSelectionMarkerOpacity(e,n)}}),AZ=Ft((Q,$)=>{var c=bn(),g=$E();$.exports=function(P,S,t){var e={},r;function a(i,s){return c.coerce(P[r]||{},S[r],g,i,s)}for(var n=0;n<t.length;n++){var o=t[n];o.type==="barpolar"&&o.visible===!0&&(r=o.subplot,e[r]||(a("barmode"),a("bargap"),e[r]=1))}}}),GE=Ft((Q,$)=>{var c=Hd().hasColorscale,g=Jd(),P=bn().isArrayOrTypedArray,S=Rw(),t=Pr().setGroupPositions,e=Bt(),r=Xo().traceIs,a=bn().extendFlat;function n(i,s){for(var f=i._fullLayout,x=s.subplot,y=f[x].radialaxis,v=f[x].angularaxis,T=y.makeCalcdata(s,"r"),u=v.makeCalcdata(s,"theta"),b=s._length,_=new Array(b),C=T,M=u,E=0;E<b;E++)_[E]={p:M[E],s:C[E]};function A(h){var p=s[h];p!==void 0&&(s["_"+h]=P(p)?v.makeCalcdata(s,h):v.d2c(p,s.thetaunit))}return v.type==="linear"&&(A("width"),A("offset")),c(s,"marker")&&g(i,s,{vals:s.marker.color,containerStr:"marker",cLetter:"c"}),c(s,"marker.line")&&g(i,s,{vals:s.marker.line.color,containerStr:"marker.line",cLetter:"c"}),S(_,s),e(_,s),_}function o(i,s,f){for(var x=i.calcdata,y=[],v=0;v<x.length;v++){var T=x[v],u=T[0].trace;u.visible===!0&&r(u,"bar")&&u.subplot===f&&y.push(T)}var b=a({},s.radialaxis,{_id:"x"}),_=s.angularaxis;t(i,_,b,y,{mode:s.barmode,norm:s.barnorm,gap:s.bargap,groupgap:s.bargroupgap})}$.exports={calc:n,crossTraceCalc:o}}),MZ=Ft((Q,$)=>{var c=un(),g=ra(),P=bn(),S=js(),t=TT();$.exports=function(r,a,n){var o=r._context.staticPlot,i=a.xaxis,s=a.yaxis,f=a.radialAxis,x=a.angularAxis,y=e(a),v=a.layers.frontplot.select("g.barlayer");P.makeTraceGroups(v,n,"trace bars").each(function(){var T=c.select(this),u=P.ensureSingle(T,"g","points"),b=u.selectAll("g.point").data(P.identity);b.enter().append("g").style("vector-effect",o?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),b.exit().remove(),b.each(function(_){var C=c.select(this),M=_.rp0=f.c2p(_.s0),E=_.rp1=f.c2p(_.s1),A=_.thetag0=x.c2g(_.p0),h=_.thetag1=x.c2g(_.p1),p;if(!g(M)||!g(E)||!g(A)||!g(h)||M===E||A===h)p="M0,0Z";else{var k=f.c2g(_.s1),w=(A+h)/2;_.ct=[i.c2p(k*Math.cos(w)),s.c2p(k*Math.sin(w))],p=y(M,E,A,h)}P.ensureSingle(C,"path").attr("d",p)}),S.setClipUrl(T,a._hasClipOnAxisFalse?a.clipIds.forTraces:null,r)})};function e(r){var a=r.cxx,n=r.cyy;return r.vangles?function(o,i,s,f){var x,y;P.angleDelta(s,f)>0?(x=s,y=f):(x=f,y=s);var v=t.findEnclosingVertexAngles(x,r.vangles)[0],T=t.findEnclosingVertexAngles(y,r.vangles)[1],u=[v,(x+y)/2,T];return t.pathPolygonAnnulus(o,i,x,y,u,a,n)}:function(o,i,s,f){return P.pathAnnulus(o,i,s,f,a,n)}}}),SZ=Ft((Q,$)=>{var c=Qh(),g=bn(),P=Y_().getTraceColor,S=g.fillText,t=ET().makeHoverPointText,e=TT().isPtInsidePolygon;$.exports=function(r,a,n){var o=r.cd,i=o[0].trace,s=r.subplot,f=s.radialAxis,x=s.angularAxis,y=s.vangles,v=y?e:g.isPtInsideSector,T=r.maxHoverDistance,u=x._period||2*Math.PI,b=Math.abs(f.g2p(Math.sqrt(a*a+n*n))),_=Math.atan2(n,a);f.range[0]>f.range[1]&&(_+=Math.PI);var C=function(h){return v(b,_,[h.rp0,h.rp1],[h.thetag0,h.thetag1],y)?T+Math.min(1,Math.abs(h.thetag1-h.thetag0)/u)-1+(h.rp1-b)/(h.rp1-h.rp0)-1:1/0};if(c.getClosest(o,C,r),r.index!==!1){var M=r.index,E=o[M];r.x0=r.x1=E.ct[0],r.y0=r.y1=E.ct[1];var A=g.extendFlat({},E,{r:E.s,theta:E.p});return S(E,i,r),t(A,i,s,r),r.hovertemplate=i.hovertemplate,r.color=P(i,E),r.xLabelVal=r.yLabelVal=void 0,E.s<0&&(r.idealAlign="left"),[r]}}}),EZ=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"barpolar",basePlotModule:AT(),categories:["polar","bar","showLegend"],attributes:ZE(),layoutAttributes:$E(),supplyDefaults:TZ(),supplyLayoutDefaults:AZ(),calc:GE().calc,crossTraceCalc:GE().crossTraceCalc,plot:MZ(),colorbar:xo(),formatLabels:ST(),style:xm().style,styleOnSelect:xm().styleOnSelect,hoverPoints:SZ(),selectPoints:K_(),meta:{}}}),CZ=Ft((Q,$)=>{$.exports=EZ()}),YE=Ft((Q,$)=>{$.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}),KE=Ft((Q,$)=>{var c=bi(),g=Ad(),P=Nh().attributes,S=bn().extendFlat,t=Yc().overrideAll,e=t({color:g.color,showline:S({},g.showline,{dflt:!0}),linecolor:g.linecolor,linewidth:g.linewidth,showgrid:S({},g.showgrid,{dflt:!0}),gridcolor:g.gridcolor,gridwidth:g.gridwidth,griddash:g.griddash},"plot","from-root"),r=t({ticklen:g.ticklen,tickwidth:S({},g.tickwidth,{dflt:2}),tickcolor:g.tickcolor,showticklabels:g.showticklabels,labelalias:g.labelalias,showtickprefix:g.showtickprefix,tickprefix:g.tickprefix,showticksuffix:g.showticksuffix,ticksuffix:g.ticksuffix,tickfont:g.tickfont,tickformat:g.tickformat,hoverformat:g.hoverformat,layer:g.layer},"plot","from-root"),a=S({visible:S({},g.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:S({},g.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},e,r),n=S({visible:S({},g.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:g.ticks,editType:"calc"},e,r);$.exports={domain:P({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:c.background},realaxis:a,imaginaryaxis:n,editType:"calc"}}),LZ=Ft((Q,$)=>{var c=bn(),g=li(),P=pu(),S=P1(),t=ud().getSubplotData,e=dm(),r=n0(),a=Yy(),n=i0(),o=KE(),i=YE(),s=i.axisNames,f=y(function(v){return c.isTypedArray(v)&&(v=Array.from(v)),v.slice().reverse().map(function(T){return-T}).concat([0]).concat(v)},String);function x(v,T,u,b){var _=u("bgcolor");b.bgColor=g.combine(_,b.paper_bgcolor);var C=t(b.fullData,i.name,b.id),M=b.layoutOut,E;function A(q,X){return u(E+"."+q,X)}for(var h=0;h<s.length;h++){E=s[h],c.isPlainObject(v[E])||(v[E]={});var p=v[E],k=P.newContainer(T,E);k._id=k._name=E,k._attr=b.id+"."+E,k._traceIndices=C.map(function(q){return q.index});var w=A("visible");if(k.type="linear",n(k,M),e(p,k,A,k.type),w){var R=E==="realaxis";if(R&&A("side"),R)A("tickvals");else{var O=f(T.realaxis.tickvals||o.realaxis.tickvals.dflt);A("tickvals",O)}c.isTypedArray(k.tickvals)&&(k.tickvals=Array.from(k.tickvals));var N,V,H,F,U=b.font||{};w&&(N=A("color"),V=N===p.color?N:U.color,H=U.size,F=U.family),r(p,k,A,k.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!R,noExp:!0,font:{color:V,size:H,family:F}}),c.coerce2(v,T,o,E+".ticklen"),c.coerce2(v,T,o,E+".tickwidth"),c.coerce2(v,T,o,E+".tickcolor",T.color);var W=A("ticks");W||(delete T[E].ticklen,delete T[E].tickwidth,delete T[E].tickcolor),a(p,k,A,{dfltColor:N,bgColor:b.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:o[E]}),A("layer")}A("hoverformat"),delete k.type,k._input=p}}$.exports=function(v,T,u){S(v,T,u,{noUirevision:!0,type:i.name,attributes:o,handleDefaults:x,font:T.font,paper_bgcolor:T.paper_bgcolor,fullData:u,layoutOut:T})};function y(v,T){var u={};return function(b){var _=T?T(b):b;if(_ in u)return u[_];var C=v(b);return u[_]=C,C}}}),PZ=Ft((Q,$)=>{var c=ud().getSubplotCalcData,g=bn().counterRegex,P=HE(),S=YE(),t=S.attr,e=S.name,r=g(e),a={};a[t]={valType:"subplotid",dflt:e,editType:"calc"};function n(i){for(var s=i._fullLayout,f=i.calcdata,x=s._subplots[e],y=0;y<x.length;y++){var v=x[y],T=c(f,e,v),u=s[v]._subplot;u||(u=P(i,v,!0),s[v]._subplot=u),u.plot(T,s,i._promises)}}function o(i,s,f,x){for(var y=x._subplots[e]||[],v=0;v<y.length;v++){var T=y[v],u=x[T]._subplot;if(!s[T]&&u){u.framework.remove();for(var b in u.clipPaths)u.clipPaths[b].remove()}}}$.exports={attr:t,name:e,idRoot:e,idRegex:r,attrRegex:r,attributes:a,layoutAttributes:KE(),supplyLayoutDefaults:LZ(),plot:n,clean:o,toSVG:Mf().toSVG}}),XE=Ft((Q,$)=>{var{hovertemplateAttrs:c,texttemplateAttrs:g,templatefallbackAttrs:P}=$u(),S=Ta().extendFlat,t=z0(),e=tf(),r=$o(),a=e.line;$.exports={mode:e.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:e.text,texttemplate:g({editType:"plot"},{keys:["real","imag","text"]}),texttemplatefallback:P({editType:"plot"}),hovertext:e.hovertext,line:{color:a.color,width:a.width,dash:a.dash,backoff:a.backoff,shape:S({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:e.connectgaps,marker:e.marker,cliponaxis:S({},e.cliponaxis,{dflt:!1}),textposition:e.textposition,textfont:e.textfont,fill:S({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:t(),hoverinfo:S({},r.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:e.hoveron,hovertemplate:c(),hovertemplatefallback:P(),selected:e.selected,unselected:e.unselected}}),zZ=Ft((Q,$)=>{var c=bn(),g=Ac(),P=s0(),S=I0(),t=xv(),e=x0(),r=O0(),a=vm().PTS_LINESONLY,n=XE();$.exports=function(i,s,f,x){function y(u,b){return c.coerce(i,s,n,u,b)}var v=o(i,s,x,y);if(!v){s.visible=!1;return}y("mode",v<a?"lines+markers":"lines"),y("text"),y("hovertext"),s.hoveron!=="fills"&&(y("hovertemplate"),y("hovertemplatefallback")),g.hasMarkers(s)&&P(i,s,f,x,y,{gradient:!0}),g.hasLines(s)&&(S(i,s,f,x,y,{backoff:!0}),t(i,s,y),y("connectgaps")),g.hasText(s)&&(y("texttemplate"),y("texttemplatefallback"),e(i,s,x,y));var T=[];(g.hasMarkers(s)||g.hasText(s))&&(y("cliponaxis"),y("marker.maxdisplayed"),T.push("points")),y("fill"),s.fill!=="none"&&(r(i,s,f,y),g.hasLines(s)||t(i,s,y)),(s.fill==="tonext"||s.fill==="toself")&&T.push("fills"),y("hoveron",T.join("+")||"points"),c.coerceSelectionMarkerOpacity(s,y)};function o(i,s,f,x){var y=x("real"),v=x("imag"),T;return y&&v&&(T=Math.min(y.length,v.length)),c.isTypedArray(y)&&(s.real=y=Array.from(y)),c.isTypedArray(v)&&(s.imag=v=Array.from(v)),s._length=T,T}}),IZ=Ft((Q,$)=>{var c=Es();$.exports=function(g,P,S){var t={},e=S[P.subplot]._subplot;return t.realLabel=c.tickText(e.radialAxis,g.real,!0).text,t.imagLabel=c.tickText(e.angularAxis,g.imag,!0).text,t}}),OZ=Ft((Q,$)=>{var c=ra(),g=Da().BADNUM,P=F0(),S=ct(),t=Bt(),e=me().calcMarkerSize;$.exports=function(r,a){for(var n=r._fullLayout,o=a.subplot,i=n[o].realaxis,s=n[o].imaginaryaxis,f=i.makeCalcdata(a,"real"),x=s.makeCalcdata(a,"imag"),y=a._length,v=new Array(y),T=0;T<y;T++){var u=f[T],b=x[T],_=v[T]={};c(u)&&c(b)?(_.real=u,_.imag=b):_.real=g}return e(a,y),P(r,a),S(v,a),t(v,a),v}}),DZ=Ft((Q,$)=>{var c=Ya(),g=Da().BADNUM,P=VE(),S=P.smith;$.exports=function(t,e,r){for(var a=e.layers.frontplot.select("g.scatterlayer"),n=e.xaxis,o=e.yaxis,i={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],x=0;x<f.length;x++){x===0&&(f[0].trace._xA=n,f[0].trace._yA=o);var y=f[x],v=y.real;if(v===g)y.x=y.y=g;else{var T=S([v,y.imag]);y.x=T[0],y.y=T[1]}}c(t,i,r,a)}}),FZ=Ft((Q,$)=>{var c=Sd();function g(S,t,e,r){var a=c(S,t,e,r);if(!(!a||a[0].index===!1)){var n=a[0];if(n.index===void 0)return a;var o=S.subplot,i=n.cd[n.index],s=n.trace;if(o.isPtInside(i))return n.xLabelVal=void 0,n.yLabelVal=void 0,P(i,s,o,n),n.hovertemplate=s.hovertemplate,a}}function P(S,t,e,r){var a=e.radialAxis,n=e.angularAxis;a._hovertitle="real",n._hovertitle="imag";var o={};o[t.subplot]={_subplot:e};var i=t._module.formatLabels(S,t,o);r.realLabel=i.realLabel,r.imagLabel=i.imagLabel;var s=S.hi||t.hoverinfo,f=[];function x(v,T){f.push(v._hovertitle+": "+T)}if(!t.hovertemplate){var y=s.split("+");y.indexOf("all")!==-1&&(y=["real","imag","text"]),y.indexOf("real")!==-1&&x(a,r.realLabel),y.indexOf("imag")!==-1&&x(n,r.imagLabel),y.indexOf("text")!==-1&&r.text&&(f.push(r.text),delete r.text),r.extraText=f.join("<br>")}}$.exports={hoverPoints:g,makeHoverPointText:P}}),RZ=Ft((Q,$)=>{$.exports={moduleType:"trace",name:"scattersmith",basePlotModule:PZ(),categories:["smith","symbols","showLegend","scatter-like"],attributes:XE(),supplyDefaults:zZ(),colorbar:xo(),formatLabels:IZ(),calc:OZ(),plot:DZ(),style:xl().style,styleOnSelect:xl().styleOnSelect,hoverPoints:FZ().hoverPoints,selectPoints:Bf(),meta:{}}}),BZ=Ft((Q,$)=>{$.exports=RZ()}),Bp=Ft((Q,$)=>{var c=Ed();function g(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}c(g.prototype,{instance:function(a,n){a=(a||"gregorian").toLowerCase(),n=n||"";var o=this._localCals[a+"-"+n];if(!o&&this.calendars[a]&&(o=new this.calendars[a](n),this._localCals[a+"-"+n]=o),!o)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,a);return o},newDate:function(a,n,o,i,s){return i=(a!=null&&a.year?a.calendar():typeof i=="string"?this.instance(i,s):i)||this.instance(),i.newDate(a,n,o)},substituteDigits:function(a){return function(n){return(n+"").replace(/[0-9]/g,function(o){return a[o]})}},substituteChineseDigits:function(a,n){return function(o){for(var i="",s=0;o>0;){var f=o%10;i=(f===0?"":a[f]+n[s])+i,s++,o=Math.floor(o/10)}return i.indexOf(a[1]+n[1])===0&&(i=i.substr(1)),i||a[0]}}});function P(a,n,o,i){if(this._calendar=a,this._year=n,this._month=o,this._day=i,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 S(a,n){return a=""+a,"000000".substring(0,n-a.length)+a}c(P.prototype,{newDate:function(a,n,o){return this._calendar.newDate(a??this,n,o)},year:function(a){return arguments.length===0?this._year:this.set(a,"y")},month:function(a){return arguments.length===0?this._month:this.set(a,"m")},day:function(a){return arguments.length===0?this._day:this.set(a,"d")},date:function(a,n,o){if(!this._calendar.isValid(a,n,o))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=a,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(a,n){return this._calendar.add(this,a,n)},set:function(a,n){return this._calendar.set(this,a,n)},compareTo:function(a){if(this._calendar.name!==a._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,a._calendar.local.name);var n=this._year!==a._year?this._year-a._year:this._month!==a._month?this.monthOfYear()-a.monthOfYear():this._day-a._day;return n===0?0:n<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(a){return this._calendar.fromJD(a)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(a){return this._calendar.fromJSDate(a)},toString:function(){return(this.year()<0?"-":"")+S(Math.abs(this.year()),4)+"-"+S(this.month(),2)+"-"+S(this.day(),2)}});function t(){this.shortYearCutoff="+10"}c(t.prototype,{_validateLevel:0,newDate:function(a,n,o){return a==null?this.today():(a.year&&(this._validate(a,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate),o=a.day(),n=a.month(),a=a.year()),new P(this,a,n,o))},today:function(){return this.fromJSDate(new Date)},epoch:function(a){var n=this._validate(a,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return n.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(a){var n=this._validate(a,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(n.year()<0?"-":"")+S(Math.abs(n.year()),4)},monthsInYear:function(a){return this._validate(a,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(a,n){var o=this._validate(a,n,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(o.month()+this.monthsInYear(o)-this.firstMonth)%this.monthsInYear(o)+this.minMonth},fromMonthOfYear:function(a,n){var o=(n+this.firstMonth-2*this.minMonth)%this.monthsInYear(a)+this.minMonth;return this._validate(a,o,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),o},daysInYear:function(a){var n=this._validate(a,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(n)?366:365},dayOfYear:function(a,n,o){var i=this._validate(a,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate);return i.toJD()-this.newDate(i.year(),this.fromMonthOfYear(i.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(a,n,o){var i=this._validate(a,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(i))+2)%this.daysInWeek()},extraInfo:function(a,n,o){return this._validate(a,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(a,n,o){return this._validate(a,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(a,this._add(a,n,o),n,o)},_add:function(a,n,o){if(this._validateLevel++,o==="d"||o==="w"){var i=a.toJD()+n*(o==="w"?this.daysInWeek():1),s=a.calendar().fromJD(i);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var f=a.year()+(o==="y"?n:0),x=a.monthOfYear()+(o==="m"?n:0),s=a.day(),y=function(u){for(;x<u.minMonth;)f--,x+=u.monthsInYear(f);for(var b=u.monthsInYear(f);x>b-1+u.minMonth;)f++,x-=b,b=u.monthsInYear(f)};o==="y"?(a.month()!==this.fromMonthOfYear(f,x)&&(x=this.newDate(f,a.month(),this.minDay).monthOfYear()),x=Math.min(x,this.monthsInYear(f)),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,x)))):o==="m"&&(y(this),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,x))));var v=[f,this.fromMonthOfYear(f,x),s];return this._validateLevel--,v}catch(T){throw this._validateLevel--,T}},_correctAdd:function(a,n,o,i){if(!this.hasYearZero&&(i==="y"||i==="m")&&(n[0]===0||a.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"]}[i],f=o<0?-1:1;n=this._add(a,o*s[0]+f*s[1],s[2])}return a.date(n[0],n[1],n[2])},set:function(a,n,o){this._validate(a,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var i=o==="y"?n:a.year(),s=o==="m"?n:a.month(),f=o==="d"?n:a.day();return(o==="y"||o==="m")&&(f=Math.min(f,this.daysInMonth(i,s))),a.date(i,s,f)},isValid:function(a,n,o){this._validateLevel++;var i=this.hasYearZero||a!==0;if(i){var s=this.newDate(a,n,this.minDay);i=n>=this.minMonth&&n-this.minMonth<this.monthsInYear(s)&&o>=this.minDay&&o-this.minDay<this.daysInMonth(s)}return this._validateLevel--,i},toJSDate:function(a,n,o){var i=this._validate(a,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate);return r.instance().fromJD(this.toJD(i)).toJSDate()},fromJSDate:function(a){return this.fromJD(r.instance().fromJSDate(a).toJD())},_validate:function(a,n,o,i){if(a.year){if(this._validateLevel===0&&this.name!==a.calendar().name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,a.calendar().local.name);return a}try{if(this._validateLevel++,this._validateLevel===1&&!this.isValid(a,n,o))throw i.replace(/\{0\}/,this.local.name);var s=this.newDate(a,n,o);return this._validateLevel--,s}catch(f){throw this._validateLevel--,f}}});function e(a){this.local=this.regionalOptions[a]||this.regionalOptions[""]}e.prototype=new t,c(e.prototype,{name:"Gregorian",jdEpoch:17214255e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),o=n.year()+(n.year()<0?1:0);return o%4===0&&(o%100!==0||o%400===0)},weekOfYear:function(a,n,o){var i=this.newDate(a,n,o);return i.add(4-(i.dayOfWeek()||7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(a,n){var o=this._validate(a,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(a,n,o){return(this.dayOfWeek(a,n,o)||7)<6},toJD:function(a,n,o){var i=this._validate(a,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate);a=i.year(),n=i.month(),o=i.day(),a<0&&a++,n<3&&(n+=12,a--);var s=Math.floor(a/100),f=2-s+Math.floor(s/4);return Math.floor(365.25*(a+4716))+Math.floor(30.6001*(n+1))+o+f-1524.5},fromJD:function(a){var n=Math.floor(a+.5),o=Math.floor((n-186721625e-2)/36524.25);o=n+1+o-Math.floor(o/4);var i=o+1524,s=Math.floor((i-122.1)/365.25),f=Math.floor(365.25*s),x=Math.floor((i-f)/30.6001),y=i-f-Math.floor(x*30.6001),v=x-(x>13.5?13:1),T=s-(v>2.5?4716:4715);return T<=0&&T--,this.newDate(T,v,y)},toJSDate:function(a,n,o){var i=this._validate(a,n,o,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(i.year(),i.month()-1,i.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(a){return this.newDate(a.getFullYear(),a.getMonth()+1,a.getDate())}});var r=$.exports=new g;r.cdate=P,r.baseCalendar=t,r.calendars.gregorian=e}),NZ=Ft(()=>{var Q=Ed(),$=Bp();Q($.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"}),$.local=$.regionalOptions[""],Q($.cdate.prototype,{formatDate:function(c,g){return typeof c!="string"&&(g=c,c=""),this._calendar.formatDate(c||"",this,g)}}),Q($.baseCalendar.prototype,{UNIX_EPOCH:$.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:$.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(c,g,P){if(typeof c!="string"&&(P=g,g=c,c=""),!g)return"";if(g.calendar()!==this)throw $.local.invalidFormat||$.regionalOptions[""].invalidFormat;c=c||this.local.dateFormat,P=P||{};for(var S=P.dayNamesShort||this.local.dayNamesShort,t=P.dayNames||this.local.dayNames,e=P.monthNumbers||this.local.monthNumbers,r=P.monthNamesShort||this.local.monthNamesShort,a=P.monthNames||this.local.monthNames,n=P.calculateWeek||this.local.calculateWeek,o=function(C,M){for(var E=1;_+E<c.length&&c.charAt(_+E)===C;)E++;return _+=E-1,Math.floor(E/(M||1))>1},i=function(C,M,E,A){var h=""+M;if(o(C,A))for(;h.length<E;)h="0"+h;return h},s=function(C,M,E,A){return o(C)?A[M]:E[M]},f=this,x=function(C){return typeof e=="function"?e.call(f,C,o("m")):T(i("m",C.month(),2))},y=function(C,M){return M?typeof a=="function"?a.call(f,C):a[C.month()-f.minMonth]:typeof r=="function"?r.call(f,C):r[C.month()-f.minMonth]},v=this.local.digits,T=function(C){return P.localNumbers&&v?v(C):C},u="",b=!1,_=0;_<c.length;_++)if(b)c.charAt(_)==="'"&&!o("'")?b=!1:u+=c.charAt(_);else switch(c.charAt(_)){case"d":u+=T(i("d",g.day(),2));break;case"D":u+=s("D",g.dayOfWeek(),S,t);break;case"o":u+=i("o",g.dayOfYear(),3);break;case"w":u+=i("w",g.weekOfYear(),2);break;case"m":u+=x(g);break;case"M":u+=y(g,o("M"));break;case"y":u+=o("y",2)?g.year():(g.year()%100<10?"0":"")+g.year()%100;break;case"Y":o("Y",2),u+=g.formatYear();break;case"J":u+=g.toJD();break;case"@":u+=(g.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":u+=(g.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":o("'")?u+="'":b=!0;break;default:u+=c.charAt(_)}return u},parseDate:function(c,g,P){if(g==null)throw $.local.invalidArguments||$.regionalOptions[""].invalidArguments;if(g=typeof g=="object"?g.toString():g+"",g==="")return null;c=c||this.local.dateFormat,P=P||{};var S=P.shortYearCutoff||this.shortYearCutoff;S=typeof S!="string"?S:this.today().year()%100+parseInt(S,10);for(var t=P.dayNamesShort||this.local.dayNamesShort,e=P.dayNames||this.local.dayNames,r=P.parseMonth||this.local.parseMonth,a=P.monthNumbers||this.local.monthNumbers,n=P.monthNamesShort||this.local.monthNamesShort,o=P.monthNames||this.local.monthNames,i=-1,s=-1,f=-1,x=-1,y=-1,v=!1,T=!1,u=function(R,O){for(var N=1;p+N<c.length&&c.charAt(p+N)===R;)N++;return p+=N-1,Math.floor(N/(O||1))>1},b=function(R,O){var N=u(R,O),V=[2,3,N?4:2,N?4:2,10,11,20]["oyYJ@!".indexOf(R)+1],H=new RegExp("^-?\\d{1,"+V+"}"),F=g.substring(h).match(H);if(!F)throw($.local.missingNumberAt||$.regionalOptions[""].missingNumberAt).replace(/\{0\}/,h);return h+=F[0].length,parseInt(F[0],10)},_=this,C=function(){if(typeof a=="function"){u("m");var R=a.call(_,g.substring(h));return h+=R.length,R}return b("m")},M=function(R,O,N,V){for(var H=u(R,V)?N:O,F=0;F<H.length;F++)if(g.substr(h,H[F].length).toLowerCase()===H[F].toLowerCase())return h+=H[F].length,F+_.minMonth;throw($.local.unknownNameAt||$.regionalOptions[""].unknownNameAt).replace(/\{0\}/,h)},E=function(){if(typeof o=="function"){var R=u("M")?o.call(_,g.substring(h)):n.call(_,g.substring(h));return h+=R.length,R}return M("M",n,o)},A=function(){if(g.charAt(h)!==c.charAt(p))throw($.local.unexpectedLiteralAt||$.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,h);h++},h=0,p=0;p<c.length;p++)if(T)c.charAt(p)==="'"&&!u("'")?T=!1:A();else switch(c.charAt(p)){case"d":x=b("d");break;case"D":M("D",t,e);break;case"o":y=b("o");break;case"w":b("w");break;case"m":f=C();break;case"M":f=E();break;case"y":var k=p;v=!u("y",2),p=k,s=b("y",2);break;case"Y":s=b("Y",2);break;case"J":i=b("J")+.5,g.charAt(h)==="."&&(h++,b("J"));break;case"@":i=b("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":i=b("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":h=g.length;break;case"'":u("'")?A():T=!0;break;default:A()}if(h<g.length)throw $.local.unexpectedText||$.regionalOptions[""].unexpectedText;if(s===-1?s=this.today().year():s<100&&v&&(s+=S===-1?1900:this.today().year()-this.today().year()%100-(s<=S?0:100)),typeof f=="string"&&(f=r.call(this,s,f)),y>-1){f=1,x=y;for(var w=this.daysInMonth(s,f);x>w;w=this.daysInMonth(s,f))f++,x-=w}return i>-1?this.fromJD(i):this.newDate(s,f,x)},determineDate:function(c,g,P,S,t){P&&typeof P!="object"&&(t=S,S=P,P=null),typeof S!="string"&&(t=S,S="");var e=this,r=function(a){try{return e.parseDate(S,a,t)}catch{}a=a.toLowerCase();for(var n=(a.match(/^c/)&&P?P.newDate():null)||e.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,i=o.exec(a);i;)n.add(parseInt(i[1],10),i[2]||"d"),i=o.exec(a);return n};return g=g?g.newDate():null,c=c==null?g:typeof c=="string"?r(c):typeof c=="number"?isNaN(c)||c===1/0||c===-1/0?g:e.today().add(c,"d"):e.newDate(c),c}})}),jZ=Ft(()=>{var Q=Bp(),$=Ed(),c=Q.instance();function g(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}g.prototype=new Q.baseCalendar,$(g.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(i,s){if(typeof i=="string"){var f=i.match(S);return f?f[0]:""}var x=this._validateYear(i),y=i.month(),v=""+this.toChineseMonth(x,y);return s&&v.length<2&&(v="0"+v),this.isIntercalaryMonth(x,y)&&(v+="i"),v},monthNames:function(i){if(typeof i=="string"){var s=i.match(t);return s?s[0]:""}var f=this._validateYear(i),x=i.month(),y=this.toChineseMonth(f,x),v=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][y-1];return this.isIntercalaryMonth(f,x)&&(v="闰"+v),v},monthNamesShort:function(i){if(typeof i=="string"){var s=i.match(e);return s?s[0]:""}var f=this._validateYear(i),x=i.month(),y=this.toChineseMonth(f,x),v=["一","二","三","四","五","六","七","八","九","十","十一","十二"][y-1];return this.isIntercalaryMonth(f,x)&&(v="闰"+v),v},parseMonth:function(i,s){i=this._validateYear(i);var f=parseInt(s),x;if(isNaN(f))s[0]==="闰"&&(x=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),f=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var y=s[s.length-1];x=y==="i"||y==="I"}var v=this.toMonthIndex(i,f,x);return v},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(i,s){if(i.year&&(i=i.year()),typeof i!="number"||i<1888||i>2111)throw s.replace(/\{0\}/,this.local.name);return i},toMonthIndex:function(i,s,f){var x=this.intercalaryMonth(i),y=f&&s!==x;if(y||s<1||s>12)throw Q.local.invalidMonth.replace(/\{0\}/,this.local.name);var v;return x?!f&&s<=x?v=s-1:v=s:v=s-1,v},toChineseMonth:function(i,s){i.year&&(i=i.year(),s=i.month());var f=this.intercalaryMonth(i),x=f?12:11;if(s<0||s>x)throw Q.local.invalidMonth.replace(/\{0\}/,this.local.name);var y;return f?s<f?y=s+1:y=s:y=s+1,y},intercalaryMonth:function(i){i=this._validateYear(i);var s=r[i-r[0]],f=s>>13;return f},isIntercalaryMonth:function(i,s){i.year&&(i=i.year(),s=i.month());var f=this.intercalaryMonth(i);return!!f&&f===s},leapYear:function(i){return this.intercalaryMonth(i)!==0},weekOfYear:function(i,s,f){var x=this._validateYear(i,Q.local.invalidyear),y=a[x-a[0]],v=y>>9&4095,T=y>>5&15,u=y&31,b;b=c.newDate(v,T,u),b.add(4-(b.dayOfWeek()||7),"d");var _=this.toJD(i,s,f)-b.toJD();return 1+Math.floor(_/7)},monthsInYear:function(i){return this.leapYear(i)?13:12},daysInMonth:function(i,s){i.year&&(s=i.month(),i=i.year()),i=this._validateYear(i);var f=r[i-r[0]],x=f>>13,y=x?12:11;if(s>y)throw Q.local.invalidMonth.replace(/\{0\}/,this.local.name);var v=f&1<<12-s?30:29;return v},weekDay:function(i,s,f){return(this.dayOfWeek(i,s,f)||7)<6},toJD:function(i,s,f){var x=this._validate(i,v,f,Q.local.invalidDate);i=this._validateYear(x.year()),s=x.month(),f=x.day();var y=this.isIntercalaryMonth(i,s),v=this.toChineseMonth(i,s),T=o(i,v,f,y);return c.toJD(T.year,T.month,T.day)},fromJD:function(i){var s=c.fromJD(i),f=n(s.year(),s.month(),s.day()),x=this.toMonthIndex(f.year,f.month,f.isIntercalary);return this.newDate(f.year,x,f.day)},fromString:function(i){var s=i.match(P),f=this._validateYear(+s[1]),x=+s[2],y=!!s[3],v=this.toMonthIndex(f,x,y),T=+s[4];return this.newDate(f,v,T)},add:function(i,s,f){var x=i.year(),y=i.month(),v=this.isIntercalaryMonth(x,y),T=this.toChineseMonth(x,y),u=Object.getPrototypeOf(g.prototype).add.call(this,i,s,f);if(f==="y"){var b=u.year(),_=u.month(),C=this.isIntercalaryMonth(b,T),M=v&&C?this.toMonthIndex(b,T,!0):this.toMonthIndex(b,T,!1);M!==_&&u.month(M)}return u}});var P=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,S=/^\d?\d[iI]?/m,t=/^闰?十?[一二三四五六七八九]?月/m,e=/^闰?十?[一二三四五六七八九]?/m;Q.calendars.chinese=g;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],a=[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(i,s,f,x){var y,v;if(typeof i=="object")y=i,v=s||{};else{var T=typeof i=="number"&&i>=1888&&i<=2111;if(!T)throw new Error("Solar year outside range 1888-2111");var u=typeof s=="number"&&s>=1&&s<=12;if(!u)throw new Error("Solar month outside range 1 - 12");var b=typeof f=="number"&&f>=1&&f<=31;if(!b)throw new Error("Solar day outside range 1 - 31");y={year:i,month:s,day:f},v={}}var _=a[y.year-a[0]],C=y.year<<9|y.month<<5|y.day;v.year=C>=_?y.year:y.year-1,_=a[v.year-a[0]];var M=_>>9&4095,E=_>>5&15,A=_&31,h,p=new Date(M,E-1,A),k=new Date(y.year,y.month-1,y.day);h=Math.round((k-p)/(24*3600*1e3));var w=r[v.year-r[0]],R;for(R=0;R<13;R++){var O=w&1<<12-R?30:29;if(h<O)break;h-=O}var N=w>>13;return!N||R<N?(v.isIntercalary=!1,v.month=1+R):R===N?(v.isIntercalary=!0,v.month=R):(v.isIntercalary=!1,v.month=R),v.day=1+h,v}function o(i,s,f,x,y){var v,T;if(typeof i=="object")T=i,v=s||{};else{var u=typeof i=="number"&&i>=1888&&i<=2111;if(!u)throw new Error("Lunar year outside range 1888-2111");var b=typeof s=="number"&&s>=1&&s<=12;if(!b)throw new Error("Lunar month outside range 1 - 12");var _=typeof f=="number"&&f>=1&&f<=30;if(!_)throw new Error("Lunar day outside range 1 - 30");var C;typeof x=="object"?(C=!1,v=x):(C=!!x,v={}),T={year:i,month:s,day:f,isIntercalary:C}}var M;M=T.day-1;var E=r[T.year-r[0]],A=E>>13,h;A&&(T.month>A||T.isIntercalary)?h=T.month:h=T.month-1;for(var p=0;p<h;p++){var k=E&1<<12-p?30:29;M+=k}var w=a[T.year-a[0]],R=w>>9&4095,O=w>>5&15,N=w&31,V=new Date(R,O-1,N+M);return v.year=V.getFullYear(),v.month=1+V.getMonth(),v.day=V.getDate(),v}}),UZ=Ft(()=>{var Q=Bp(),$=Ed();function c(g){this.local=this.regionalOptions[g||""]||this.regionalOptions[""]}c.prototype=new Q.baseCalendar,$(c.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(S){var P=this._validate(S,this.minMonth,this.minDay,Q.local.invalidYear),S=P.year()+(P.year()<0?1:0);return S%4===3||S%4===-1},monthsInYear:function(g){return this._validate(g,this.minMonth,this.minDay,Q.local.invalidYear||Q.regionalOptions[""].invalidYear),13},weekOfYear:function(g,P,S){var t=this.newDate(g,P,S);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(g,P){var S=this._validate(g,P,this.minDay,Q.local.invalidMonth);return this.daysPerMonth[S.month()-1]+(S.month()===13&&this.leapYear(S.year())?1:0)},weekDay:function(g,P,S){return(this.dayOfWeek(g,P,S)||7)<6},toJD:function(g,P,S){var t=this._validate(g,P,S,Q.local.invalidDate);return g=t.year(),g<0&&g++,t.day()+(t.month()-1)*30+(g-1)*365+Math.floor(g/4)+this.jdEpoch-1},fromJD:function(g){var P=Math.floor(g)+.5-this.jdEpoch,S=Math.floor((P-Math.floor((P+366)/1461))/365)+1;S<=0&&S--,P=Math.floor(g)+.5-this.newDate(S,1,1).toJD();var t=Math.floor(P/30)+1,e=P-(t-1)*30+1;return this.newDate(S,t,e)}}),Q.calendars.coptic=c}),VZ=Ft(()=>{var Q=Bp(),$=Ed();function c(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}c.prototype=new Q.baseCalendar,$(c.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(P){return this._validate(P,this.minMonth,this.minDay,Q.local.invalidYear),!1},monthsInYear:function(P){return this._validate(P,this.minMonth,this.minDay,Q.local.invalidYear),13},daysInYear:function(P){return this._validate(P,this.minMonth,this.minDay,Q.local.invalidYear),400},weekOfYear:function(P,S,t){var e=this.newDate(P,S,t);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/8)+1},daysInMonth:function(P,S){var t=this._validate(P,S,this.minDay,Q.local.invalidMonth);return this.daysPerMonth[t.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(P,S,t){var e=this._validate(P,S,t,Q.local.invalidDate);return(e.day()+1)%8},weekDay:function(P,S,t){var e=this.dayOfWeek(P,S,t);return e>=2&&e<=6},extraInfo:function(P,S,t){var e=this._validate(P,S,t,Q.local.invalidDate);return{century:g[Math.floor((e.year()-1)/100)+1]||""}},toJD:function(P,S,t){var e=this._validate(P,S,t,Q.local.invalidDate);return P=e.year()+(e.year()<0?1:0),S=e.month(),t=e.day(),t+(S>1?16:0)+(S>2?(S-2)*32:0)+(P-1)*400+this.jdEpoch-1},fromJD:function(P){P=Math.floor(P+.5)-Math.floor(this.jdEpoch)-1;var S=Math.floor(P/400)+1;P-=(S-1)*400,P+=P>15?16:0;var t=Math.floor(P/32)+1,e=P-(t-1)*32+1;return this.newDate(S<=0?S-1:S,t,e)}});var g={20:"Fruitbat",21:"Anchovy"};Q.calendars.discworld=c}),HZ=Ft(()=>{var Q=Bp(),$=Ed();function c(g){this.local=this.regionalOptions[g||""]||this.regionalOptions[""]}c.prototype=new Q.baseCalendar,$(c.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(S){var P=this._validate(S,this.minMonth,this.minDay,Q.local.invalidYear),S=P.year()+(P.year()<0?1:0);return S%4===3||S%4===-1},monthsInYear:function(g){return this._validate(g,this.minMonth,this.minDay,Q.local.invalidYear||Q.regionalOptions[""].invalidYear),13},weekOfYear:function(g,P,S){var t=this.newDate(g,P,S);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(g,P){var S=this._validate(g,P,this.minDay,Q.local.invalidMonth);return this.daysPerMonth[S.month()-1]+(S.month()===13&&this.leapYear(S.year())?1:0)},weekDay:function(g,P,S){return(this.dayOfWeek(g,P,S)||7)<6},toJD:function(g,P,S){var t=this._validate(g,P,S,Q.local.invalidDate);return g=t.year(),g<0&&g++,t.day()+(t.month()-1)*30+(g-1)*365+Math.floor(g/4)+this.jdEpoch-1},fromJD:function(g){var P=Math.floor(g)+.5-this.jdEpoch,S=Math.floor((P-Math.floor((P+366)/1461))/365)+1;S<=0&&S--,P=Math.floor(g)+.5-this.newDate(S,1,1).toJD();var t=Math.floor(P/30)+1,e=P-(t-1)*30+1;return this.newDate(S,t,e)}}),Q.calendars.ethiopian=c}),WZ=Ft(()=>{var Q=Bp(),$=Ed();function c(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}c.prototype=new Q.baseCalendar,$(c.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var S=this._validate(P,this.minMonth,this.minDay,Q.local.invalidYear);return this._leapYear(S.year())},_leapYear:function(P){return P=P<0?P+1:P,g(P*7+1,19)<7},monthsInYear:function(P){return this._validate(P,this.minMonth,this.minDay,Q.local.invalidYear),this._leapYear(P.year?P.year():P)?13:12},weekOfYear:function(P,S,t){var e=this.newDate(P,S,t);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(P){var S=this._validate(P,this.minMonth,this.minDay,Q.local.invalidYear);return P=S.year(),this.toJD(P===-1?1:P+1,7,1)-this.toJD(P,7,1)},daysInMonth:function(P,S){return P.year&&(S=P.month(),P=P.year()),this._validate(P,S,this.minDay,Q.local.invalidMonth),S===12&&this.leapYear(P)||S===8&&g(this.daysInYear(P),10)===5?30:S===9&&g(this.daysInYear(P),10)===3?29:this.daysPerMonth[S-1]},weekDay:function(P,S,t){return this.dayOfWeek(P,S,t)!==6},extraInfo:function(P,S,t){var e=this._validate(P,S,t,Q.local.invalidDate);return{yearType:(this.leapYear(e)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(e)%10-3]}},toJD:function(P,S,t){var e=this._validate(P,S,t,Q.local.invalidDate);P=e.year(),S=e.month(),t=e.day();var r=P<=0?P+1:P,a=this.jdEpoch+this._delay1(r)+this._delay2(r)+t+1;if(S<7){for(var n=7;n<=this.monthsInYear(P);n++)a+=this.daysInMonth(P,n);for(var n=1;n<S;n++)a+=this.daysInMonth(P,n)}else for(var n=7;n<S;n++)a+=this.daysInMonth(P,n);return a},_delay1:function(P){var S=Math.floor((235*P-234)/19),t=12084+13753*S,e=S*29+Math.floor(t/25920);return g(3*(e+1),7)<3&&e++,e},_delay2:function(P){var S=this._delay1(P-1),t=this._delay1(P),e=this._delay1(P+1);return e-t===356?2:t-S===382?1:0},fromJD:function(P){P=Math.floor(P)+.5;for(var S=Math.floor((P-this.jdEpoch)*98496/35975351)-1;P>=this.toJD(S===-1?1:S+1,7,1);)S++;for(var t=P<this.toJD(S,1,1)?7:1;P>this.toJD(S,t,this.daysInMonth(S,t));)t++;var e=P-this.toJD(S,t,1)+1;return this.newDate(S,t,e)}});function g(P,S){return P-S*Math.floor(P/S)}Q.calendars.hebrew=c}),qZ=Ft(()=>{var Q=Bp(),$=Ed();function c(g){this.local=this.regionalOptions[g||""]||this.regionalOptions[""]}c.prototype=new Q.baseCalendar,$(c.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(g){var P=this._validate(g,this.minMonth,this.minDay,Q.local.invalidYear);return(P.year()*11+14)%30<11},weekOfYear:function(g,P,S){var t=this.newDate(g,P,S);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(g){return this.leapYear(g)?355:354},daysInMonth:function(g,P){var S=this._validate(g,P,this.minDay,Q.local.invalidMonth);return this.daysPerMonth[S.month()-1]+(S.month()===12&&this.leapYear(S.year())?1:0)},weekDay:function(g,P,S){return this.dayOfWeek(g,P,S)!==5},toJD:function(g,P,S){var t=this._validate(g,P,S,Q.local.invalidDate);return g=t.year(),P=t.month(),S=t.day(),g=g<=0?g+1:g,S+Math.ceil(29.5*(P-1))+(g-1)*354+Math.floor((3+11*g)/30)+this.jdEpoch-1},fromJD:function(g){g=Math.floor(g)+.5;var P=Math.floor((30*(g-this.jdEpoch)+10646)/10631);P=P<=0?P-1:P;var S=Math.min(12,Math.ceil((g-29-this.toJD(P,1,1))/29.5)+1),t=g-this.toJD(P,S,1)+1;return this.newDate(P,S,t)}}),Q.calendars.islamic=c}),ZZ=Ft(()=>{var Q=Bp(),$=Ed();function c(g){this.local=this.regionalOptions[g||""]||this.regionalOptions[""]}c.prototype=new Q.baseCalendar,$(c.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(S){var P=this._validate(S,this.minMonth,this.minDay,Q.local.invalidYear),S=P.year()<0?P.year()+1:P.year();return S%4===0},weekOfYear:function(g,P,S){var t=this.newDate(g,P,S);return t.add(4-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(g,P){var S=this._validate(g,P,this.minDay,Q.local.invalidMonth);return this.daysPerMonth[S.month()-1]+(S.month()===2&&this.leapYear(S.year())?1:0)},weekDay:function(g,P,S){return(this.dayOfWeek(g,P,S)||7)<6},toJD:function(g,P,S){var t=this._validate(g,P,S,Q.local.invalidDate);return g=t.year(),P=t.month(),S=t.day(),g<0&&g++,P<=2&&(g--,P+=12),Math.floor(365.25*(g+4716))+Math.floor(30.6001*(P+1))+S-1524.5},fromJD:function(g){var P=Math.floor(g+.5),S=P+1524,t=Math.floor((S-122.1)/365.25),e=Math.floor(365.25*t),r=Math.floor((S-e)/30.6001),a=r-Math.floor(r<14?1:13),n=t-Math.floor(a>2?4716:4715),o=S-e-Math.floor(30.6001*r);return n<=0&&n--,this.newDate(n,a,o)}}),Q.calendars.julian=c}),$Z=Ft(()=>{var Q=Bp(),$=Ed();function c(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}c.prototype=new Q.baseCalendar,$(c.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(S){return this._validate(S,this.minMonth,this.minDay,Q.local.invalidYear),!1},formatYear:function(S){var t=this._validate(S,this.minMonth,this.minDay,Q.local.invalidYear);S=t.year();var e=Math.floor(S/400);S=S%400,S+=S<0?400:0;var r=Math.floor(S/20);return e+"."+r+"."+S%20},forYear:function(S){if(S=S.split("."),S.length<3)throw"Invalid Mayan year";for(var t=0,e=0;e<S.length;e++){var r=parseInt(S[e],10);if(Math.abs(r)>19||e>0&&r<0)throw"Invalid Mayan year";t=t*20+r}return t},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,Q.local.invalidYear),18},weekOfYear:function(S,t,e){return this._validate(S,t,e,Q.local.invalidDate),0},daysInYear:function(S){return this._validate(S,this.minMonth,this.minDay,Q.local.invalidYear),360},daysInMonth:function(S,t){return this._validate(S,t,this.minDay,Q.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(S,t,e){var r=this._validate(S,t,e,Q.local.invalidDate);return r.day()},weekDay:function(S,t,e){return this._validate(S,t,e,Q.local.invalidDate),!0},extraInfo:function(S,t,e){var r=this._validate(S,t,e,Q.local.invalidDate),a=r.toJD(),n=this._toHaab(a),o=this._toTzolkin(a);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(S){S-=this.jdEpoch;var t=g(S+8+340,365);return[Math.floor(t/20)+1,g(t,20)]},_toTzolkin:function(S){return S-=this.jdEpoch,[P(S+20,20),P(S+4,13)]},toJD:function(S,t,e){var r=this._validate(S,t,e,Q.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(S){S=Math.floor(S)+.5-this.jdEpoch;var t=Math.floor(S/360);S=S%360,S+=S<0?360:0;var e=Math.floor(S/20),r=S%20;return this.newDate(t,e,r)}});function g(S,t){return S-t*Math.floor(S/t)}function P(S,t){return g(S-1,t)+1}Q.calendars.mayan=c}),GZ=Ft(()=>{var Q=Bp(),$=Ed();function c(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}c.prototype=new Q.baseCalendar;var g=Q.instance("gregorian");$(c.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var S=this._validate(P,this.minMonth,this.minDay,Q.local.invalidYear||Q.regionalOptions[""].invalidYear);return g.leapYear(S.year()+(S.year()<1?1:0)+1469)},weekOfYear:function(P,S,t){var e=this.newDate(P,S,t);return e.add(1-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(P,S){var t=this._validate(P,S,this.minDay,Q.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(P,S,t){return(this.dayOfWeek(P,S,t)||7)<6},toJD:function(r,S,t){var e=this._validate(r,S,t,Q.local.invalidMonth),r=e.year();r<0&&r++;for(var a=e.day(),n=1;n<e.month();n++)a+=this.daysPerMonth[n-1];return a+g.toJD(r+1468,3,13)},fromJD:function(P){P=Math.floor(P+.5);for(var S=Math.floor((P-(this.jdEpoch-1))/366);P>=this.toJD(S+1,1,1);)S++;for(var t=P-Math.floor(this.toJD(S,1,1)+.5)+1,e=1;t>this.daysInMonth(S,e);)t-=this.daysInMonth(S,e),e++;return this.newDate(S,e,t)}}),Q.calendars.nanakshahi=c}),YZ=Ft(()=>{var Q=Bp(),$=Ed();function c(g){this.local=this.regionalOptions[g||""]||this.regionalOptions[""]}c.prototype=new Q.baseCalendar,$(c.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(g){return this.daysInYear(g)!==this.daysPerYear},weekOfYear:function(g,P,S){var t=this.newDate(g,P,S);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(g){var P=this._validate(g,this.minMonth,this.minDay,Q.local.invalidYear);if(g=P.year(),typeof this.NEPALI_CALENDAR_DATA[g]>"u")return this.daysPerYear;for(var S=0,t=this.minMonth;t<=12;t++)S+=this.NEPALI_CALENDAR_DATA[g][t];return S},daysInMonth:function(g,P){return g.year&&(P=g.month(),g=g.year()),this._validate(g,P,this.minDay,Q.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[g]>"u"?this.daysPerMonth[P-1]:this.NEPALI_CALENDAR_DATA[g][P]},weekDay:function(g,P,S){return this.dayOfWeek(g,P,S)!==6},toJD:function(g,P,S){var t=this._validate(g,P,S,Q.local.invalidDate);g=t.year(),P=t.month(),S=t.day();var e=Q.instance(),r=0,a=P,n=g;this._createMissingCalendarData(g);var o=g-(a>9||a===9&&S>=this.NEPALI_CALENDAR_DATA[n][0]?56:57);for(P!==9&&(r=S,a--);a!==9;)a<=0&&(a=12,n--),r+=this.NEPALI_CALENDAR_DATA[n][a],a--;return P===9?(r+=S-this.NEPALI_CALENDAR_DATA[n][0],r<0&&(r+=e.daysInYear(o))):r+=this.NEPALI_CALENDAR_DATA[n][9]-this.NEPALI_CALENDAR_DATA[n][0],e.newDate(o,1,1).add(r,"d").toJD()},fromJD:function(g){var P=Q.instance(),S=P.fromJD(g),t=S.year(),e=S.dayOfYear(),r=t+56;this._createMissingCalendarData(r);for(var a=9,n=this.NEPALI_CALENDAR_DATA[r][0],o=this.NEPALI_CALENDAR_DATA[r][a]-n+1;e>o;)a++,a>12&&(a=1,r++),o+=this.NEPALI_CALENDAR_DATA[r][a];var i=this.NEPALI_CALENDAR_DATA[r][a]-(o-e);return this.newDate(r,a,i)},_createMissingCalendarData:function(g){var P=this.daysPerMonth.slice(0);P.unshift(17);for(var S=g-1;S<g+2;S++)typeof this.NEPALI_CALENDAR_DATA[S]>"u"&&(this.NEPALI_CALENDAR_DATA[S]=P)},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]}}),Q.calendars.nepali=c}),KZ=Ft(()=>{var Q=Bp(),$=Ed();function c(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}function g(P){var S=P-475;P<0&&S++;var t=.242197,e=t*S,r=t*(S+1),a=e-Math.floor(e),n=r-Math.floor(r);return a>n}c.prototype=new Q.baseCalendar,$(c.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","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(P){var S=this._validate(P,this.minMonth,this.minDay,Q.local.invalidYear);return g(S.year())},weekOfYear:function(P,S,t){var e=this.newDate(P,S,t);return e.add(-((e.dayOfWeek()+1)%7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(P,S){var t=this._validate(P,S,this.minDay,Q.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(P,S,t){return this.dayOfWeek(P,S,t)!==5},toJD:function(P,S,t){var e=this._validate(P,S,t,Q.local.invalidDate);P=e.year(),S=e.month(),t=e.day();var r=0;if(P>0)for(var a=1;a<P;a++)g(a)&&r++;else if(P<0)for(var a=P;a<0;a++)g(a)&&r--;return t+(S<=7?(S-1)*31:(S-1)*30+6)+(P>0?P-1:P)*365+r+this.jdEpoch-1},fromJD:function(P){P=Math.floor(P)+.5;var S=475+(P-this.toJD(475,1,1))/365.242197,t=Math.floor(S);t<=0&&t--,P>this.toJD(t,12,g(t)?30:29)&&(t++,t===0&&t++);var e=P-this.toJD(t,1,1)+1,r=e<=186?Math.ceil(e/31):Math.ceil((e-6)/30),a=P-this.toJD(t,r,1)+1;return this.newDate(t,r,a)}}),Q.calendars.persian=c,Q.calendars.jalali=c}),XZ=Ft(()=>{var Q=Bp(),$=Ed(),c=Q.instance();function g(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}g.prototype=new Q.baseCalendar,$(g.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var S=this._validate(t,this.minMonth,this.minDay,Q.local.invalidYear),t=this._t2gYear(S.year());return c.leapYear(t)},weekOfYear:function(r,S,t){var e=this._validate(r,this.minMonth,this.minDay,Q.local.invalidYear),r=this._t2gYear(e.year());return c.weekOfYear(r,e.month(),e.day())},daysInMonth:function(P,S){var t=this._validate(P,S,this.minDay,Q.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(P,S,t){return(this.dayOfWeek(P,S,t)||7)<6},toJD:function(r,S,t){var e=this._validate(r,S,t,Q.local.invalidDate),r=this._t2gYear(e.year());return c.toJD(r,e.month(),e.day())},fromJD:function(P){var S=c.fromJD(P),t=this._g2tYear(S.year());return this.newDate(t,S.month(),S.day())},_t2gYear:function(P){return P+this.yearsOffset+(P>=-this.yearsOffset&&P<=-1?1:0)},_g2tYear:function(P){return P-this.yearsOffset-(P>=1&&P<=this.yearsOffset?1:0)}}),Q.calendars.taiwan=g}),JZ=Ft(()=>{var Q=Bp(),$=Ed(),c=Q.instance();function g(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}g.prototype=new Q.baseCalendar,$(g.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var S=this._validate(t,this.minMonth,this.minDay,Q.local.invalidYear),t=this._t2gYear(S.year());return c.leapYear(t)},weekOfYear:function(r,S,t){var e=this._validate(r,this.minMonth,this.minDay,Q.local.invalidYear),r=this._t2gYear(e.year());return c.weekOfYear(r,e.month(),e.day())},daysInMonth:function(P,S){var t=this._validate(P,S,this.minDay,Q.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(P,S,t){return(this.dayOfWeek(P,S,t)||7)<6},toJD:function(r,S,t){var e=this._validate(r,S,t,Q.local.invalidDate),r=this._t2gYear(e.year());return c.toJD(r,e.month(),e.day())},fromJD:function(P){var S=c.fromJD(P),t=this._g2tYear(S.year());return this.newDate(t,S.month(),S.day())},_t2gYear:function(P){return P-this.yearsOffset-(P>=1&&P<=this.yearsOffset?1:0)},_g2tYear:function(P){return P+this.yearsOffset+(P>=-this.yearsOffset&&P<=-1?1:0)}}),Q.calendars.thai=g}),QZ=Ft(()=>{var Q=Bp(),$=Ed();function c(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}c.prototype=new Q.baseCalendar,$(c.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Juma","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(P){var S=this._validate(P,this.minMonth,this.minDay,Q.local.invalidYear);return this.daysInYear(S.year())===355},weekOfYear:function(P,S,t){var e=this.newDate(P,S,t);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(P){for(var S=0,t=1;t<=12;t++)S+=this.daysInMonth(P,t);return S},daysInMonth:function(P,S){for(var t=this._validate(P,S,this.minDay,Q.local.invalidMonth),e=t.toJD()-24e5+.5,r=0,a=0;a<g.length;a++){if(g[a]>e)return g[r]-g[r-1];r++}return 30},weekDay:function(P,S,t){return this.dayOfWeek(P,S,t)!==5},toJD:function(P,S,t){var e=this._validate(P,S,t,Q.local.invalidDate),r=12*(e.year()-1)+e.month()-15292,a=e.day()+g[r-1]-1;return a+24e5-.5},fromJD:function(P){for(var S=P-24e5+.5,t=0,e=0;e<g.length&&!(g[e]>S);e++)t++;var r=t+15292,a=Math.floor((r-1)/12),n=a+1,o=r-12*a,i=S-g[t-1]+1;return this.newDate(n,o,i)},isValid:function(P,S,t){var e=Q.baseCalendar.prototype.isValid.apply(this,arguments);return e&&(P=P.year!=null?P.year:P,e=P>=1276&&P<=1500),e},_validate:function(P,S,t,e){var r=Q.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw e.replace(/\{0\}/,this.local.name);return r}}),Q.calendars.ummalqura=c;var g=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}),t$=Ft((Q,$)=>{$.exports=Bp(),NZ(),jZ(),UZ(),VZ(),HZ(),WZ(),qZ(),ZZ(),$Z(),GZ(),YZ(),KZ(),XZ(),JZ(),QZ()}),e$=Ft((Q,$)=>{var c=t$(),g=bn(),P=Da(),S=P.EPOCHJD,t=P.ONEDAY,e={valType:"enumerated",values:g.sortObjectKeys(c.calendars),editType:"calc",dflt:"gregorian"},r=function(E,A,h,p){var k={};return k[h]=e,g.coerce(E,A,k,h,p)},a=function(E,A,h,p){for(var k=0;k<h.length;k++)r(E,A,h[k]+"calendar",p.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"},i={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 x(E,A,h){for(var p=Math.floor((A+.05)/t)+S,k=v(h).fromJD(p),w=0,R,O,N,V,H;(w=E.indexOf("%",w))!==-1;)R=E.charAt(w+1),R==="0"||R==="-"||R==="_"?(N=3,O=E.charAt(w+2),R==="_"&&(R="-")):(O=R,R="0",N=2),V=f[O],V?(V===s?H=s:H=k.formatDate(V[R]),E=E.substr(0,w)+H+E.substr(w+N),w+=H.length):w+=N;return E}var y={};function v(E){var A=y[E];return A||(A=y[E]=c.instance(E),A)}function T(E){return g.extendFlat({},e,{description:E})}function u(E){return"Sets the calendar system to use with `"+E+"` date data."}var b={xcalendar:T(u("x"))},_=g.extendFlat({},b,{ycalendar:T(u("y"))}),C=g.extendFlat({},_,{zcalendar:T(u("z"))}),M=T(["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(" "));$.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:_,bar:_,box:_,heatmap:_,contour:_,histogram:_,histogram2d:_,histogram2dcontour:_,scatter3d:C,surface:C,mesh3d:C,scattergl:_,ohlc:b,candlestick:b},layout:{calendar:T(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:M},yaxis:{calendar:M},scene:{xaxis:{calendar:M},yaxis:{calendar:M},zaxis:{calendar:M}},polar:{radialaxis:{calendar:M}}}},layoutAttributes:e,handleDefaults:r,handleTraceDefaults:a,CANONICAL_SUNDAY:o,CANONICAL_TICK:n,DFLTRANGE:i,getCal:v,worldCalFmt:x}}),r$=Ft((Q,$)=>{$.exports=e$()}),n$=Ft((Q,$)=>{var c=OF();c.register([BF(),UF(),qF(),KF(),tR(),iR(),sR(),yR(),SR(),BR(),GR(),pN(),_N(),oj(),mj(),kj(),Lj(),$j(),Xj(),Qj(),nU(),lU(),dU(),vU(),zU(),DU(),yH(),IH(),ZH(),JH(),lW(),fW(),_W(),IW(),RW(),qW(),oq(),fq(),xq(),Vq(),Kq(),eZ(),oZ(),cZ(),mZ(),kZ(),CZ(),BZ(),r$()]),$.exports=c});return n$()})();/*!
* 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=z,z})}(J5)),J5.exports}var Fdt=Ddt();const l1=LO(Fdt),Rdt={class:"p-6 space-y-6"},Bdt={class:"flex justify-between items-center"},Ndt={class:"flex items-center gap-3"},jdt=["value"],Udt={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},Vdt={class:"glass-card rounded-[15px] p-6"},Hdt={class:"mb-6"},Wdt={class:"relative h-48 bg-white/5 rounded-lg p-4"},qdt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},Zdt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},$dt={class:"mb-6"},Gdt={class:"relative h-48 bg-white/5 rounded-lg p-4"},Ydt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},Kdt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},Xdt={class:"glass-card rounded-[15px] p-6"},Jdt={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Qdt={class:"lg:col-span-2"},tpt={class:"relative h-64 bg-white/5 rounded-lg p-4"},ept={class:"flex flex-col items-center justify-center"},rpt={class:"relative w-48 h-48"},npt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm rounded-full z-20"},ipt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 rounded-full z-20"},apt={key:0,class:"glass-card rounded-[15px] p-8 text-center"},opt={key:1,class:"glass-card rounded-[15px] p-8 text-center"},spt={class:"text-white/60 text-sm"},lpt=Th({name:"StatisticsView",__name:"Statistics",setup(d){d2.register(Hct,Zct,Xut,Z4,Mlt,klt,Alt,Pct,Nct,Cct,Uut,nct,kct,kA);const l=rw(),z=lo(null),j=lo(!1),J=lo(24),mt=[{value:1,label:"1 Hour"},{value:6,label:"6 Hours"},{value:12,label:"12 Hours"},{value:24,label:"24 Hours"},{value:48,label:"2 Days"},{value:168,label:"1 Week"}],kt=lo(null),Dt=lo(null),Gt=lo([]),re=lo(null),pe=lo([]),Ne=lo(!0),or=lo(null),_r=lo({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0}),Fr=lo(!1),zr=lo(!1),Wr=lo(!1),An=lo(null),Ft=lo(null),kn=lo(null),ei=lo(null),jn=lo(null),ai=lo(null),Qi=lo(null),Gi=Yo(()=>{const qo=l.packetStats;return qo?{totalRx:qo.total_packets||0,totalTx:qo.transmitted_packets||0}:{totalRx:0,totalTx:0}}),un=Yo(()=>{let qo=[],fo=[];if(kt.value?.series){const Ta=kt.value.series.find(go=>go.type==="rx_count"),Ea=kt.value.series.find(go=>go.type==="tx_count");Ta?.data&&(qo=Ta.data.map(([,go])=>go)),Ea?.data&&(fo=Ea.data.map(([,go])=>go))}return{totalPackets:qo,transmittedPackets:fo,droppedPackets:[]}}),ia=async()=>{try{Ne.value=!0,or.value=null,await Promise.all([l.fetchPacketStats({hours:J.value}),l.fetchSystemStats()]),Ne.value=!1,fa()}catch(qo){or.value=qo instanceof Error?qo.message:"Failed to fetch data",Ne.value=!1}},fa=async()=>{_r.value={packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0};const qo=[Li(),yi(),ra(),Da()];try{await Promise.allSettled(qo),await Z0(),!ei.value||!jn.value?setTimeout(()=>{Va()},100):Va()}catch(fo){console.error("Error loading chart data:",fo)}},Li=async()=>{_r.value.packetRate=!0;try{const qo=await Xh.get("/metrics_graph_data",{hours:J.value,resolution:"average",metrics:"rx_count,tx_count"});qo?.success&&(kt.value=qo.data)}catch{kt.value=null}},yi=async()=>{_r.value.packetType=!0;try{const qo=await Xh.get("/packet_type_graph_data",{hours:J.value,resolution:"average",types:"all"});if(qo?.success&&qo.data){const fo=qo.data;Gt.value=fo.series||[]}}catch{Gt.value=[]}},ra=async()=>{_r.value.routePie=!0;try{const qo=await Xh.get("/route_stats",{hours:J.value});qo?.success&&qo.data&&(re.value=qo.data)}catch{re.value=null}},Da=async()=>{try{const qo=await Xh.get("/noise_floor_history",{hours:J.value});if(qo.success&&qo.data){const Ta=qo.data.history||[];Array.isArray(Ta)&&Ta.length>0&&(Dt.value={chart_data:Ta.map(Ea=>({timestamp:Ea.timestamp||Date.now()/1e3,noise_floor_dbm:Ea.noise_floor_dbm||Ea.noise_floor||-120}))},Ei())}}catch{Dt.value={chart_data:[]}}},Ni=()=>{ss(),Fr.value=!1,zr.value=!1,Wr.value=!1,ia()},Ei=()=>{if(pe.value=[],Dt.value?.chart_data&&Dt.value.chart_data.length>0){const qo=Dt.value.chart_data,fo=Math.max(1,Math.floor(qo.length/100));pe.value=qo.filter((Ta,Ea)=>Ea%fo===0).map(Ta=>({timestamp:Ta.timestamp*1e3,snr:null,rssi:null,noiseFloor:Ta.noise_floor_dbm}))}},Va=()=>{if(!j.value){j.value=!0;try{mo(),ko(),pl(),fu(),setTimeout(()=>{_r.value.packetRate&&An.value&&(_r.value.packetRate=!1),_r.value.packetType&&Ft.value&&(_r.value.packetType=!1),_r.value.routePie&&Qi.value&&(_r.value.routePie=!1),_r.value.routePie&&Qi.value&&(_r.value.routePie=!1),setTimeout(()=>{const qo=ju(An.value),fo=ju(Ft.value),Ta=ju(kn.value);qo&&qo.update("none"),fo&&fo.update("none"),Ta&&Ta.update("none")},50)},100)}catch(qo){console.error("Error creating/updating charts:",qo),ss()}finally{j.value=!1}}},ss=()=>{try{An.value&&(An.value.destroy(),An.value=null),Ft.value&&(Ft.value.destroy(),Ft.value=null),kn.value&&(kn.value.destroy(),kn.value=null),Qi.value&&l1.purge(Qi.value)}catch(qo){console.error("Error destroying charts:",qo)}},mo=()=>{if(!ei.value){_r.value.packetRate=!1;return}const qo=ei.value.getContext("2d");if(!qo){_r.value.packetRate=!1;return}let fo=[],Ta=[];if(kt.value?.series){const Ea=kt.value.series.find(Ao=>Ao.type==="rx_count"),go=kt.value.series.find(Ao=>Ao.type==="tx_count");Ea?.data&&(fo=Ea.data.map(([Ao,Ps])=>{let $o=Ao;return Ao>1e15?$o=Ao/1e3:Ao>1e12?$o=Ao:Ao>1e9?$o=Ao*1e3:$o=Date.now(),{x:$o,y:Ps}})),go?.data&&(Ta=go.data.map(([Ao,Ps])=>{let $o=Ao;return Ao>1e15?$o=Ao/1e3:Ao>1e12?$o=Ao:Ao>1e9?$o=Ao*1e3:$o=Date.now(),{x:$o,y:Ps}}))}if(fo.length===0&&Ta.length===0){Fr.value=!0,_r.value.packetRate=!1;return}Fr.value=!1,An.value&&(An.value.destroy(),An.value=null);try{const Ea=JSON.parse(JSON.stringify(fo)),go=JSON.parse(JSON.stringify(Ta)),Ao=new d2(qo,{type:"line",data:{datasets:[{label:"RX/hr",data:Ea,borderColor:"#C084FC",backgroundColor:"rgba(192, 132, 252, 0.1)",borderWidth:2,fill:!0,tension:.4},{label:"TX/hr",data:go,borderColor:"#F59E0B",backgroundColor:"rgba(245, 158, 11, 0.1)",borderWidth:2,fill:!0,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1},title:{display:!1}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",maxTicksLimit:8}},y:{beginAtZero:!1,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",callback:function(Ps){return typeof Ps=="number"?Ps.toFixed(3):Ps},stepSize:.002},min:0,max:.012}}}});An.value=ju(Ao),_r.value.packetRate=!1,setTimeout(()=>{_r.value.packetRate&&(_r.value.packetRate=!1)},50)}catch(Ea){console.error("Error creating packet rate chart:",Ea),Fr.value=!0,_r.value.packetRate=!1}},ko=()=>{if(!jn.value){_r.value.packetType=!1;return}const qo=jn.value.getContext("2d");if(!qo){_r.value.packetType=!1;return}const fo=[],Ta=[],Ea=["#60A5FA","#34D399","#FBBF24","#A78BFA","#F87171","#06B6D4","#84CC16","#F472B6","#10B981"];if(Gt.value.length>0)Gt.value.forEach(go=>{const Ao=go.data?go.data.reduce((Ps,$o)=>Ps+$o[1],0):0;Ao>0&&(fo.push(go.name.replace(/\([^)]*\)/g,"").trim()),Ta.push(Ao))});else{zr.value=!0,_r.value.packetType=!1;return}zr.value=!1,Ft.value&&(Ft.value.destroy(),Ft.value=null);try{const go=JSON.parse(JSON.stringify(fo)),Ao=JSON.parse(JSON.stringify(Ta)),Ps=new d2(qo,{type:"bar",data:{labels:go,datasets:[{data:Ao,backgroundColor:Ea.slice(0,Ao.length),borderRadius:8,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{color:"rgba(255, 255, 255, 0.7)",font:{size:10}}},y:{beginAtZero:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)"}}}}});Ft.value=ju(Ps),_r.value.packetType=!1,setTimeout(()=>{_r.value.packetType&&(_r.value.packetType=!1)},50)}catch(go){console.error("Error creating packet type chart:",go),zr.value=!0,_r.value.packetType=!1}},pl=()=>{if(!ai.value)return;const qo=ai.value.getContext("2d");if(!qo)return;const fo=pe.value.map(go=>({x:go.timestamp,y:go.noiseFloor})).filter(go=>go.y!==null&&go.y!==void 0);if(kn.value)try{const go=ju(kn.value),Ao=JSON.parse(JSON.stringify(fo));go.data.datasets[0]&&(go.data.datasets[0].data=Ao),go.update("active");return}catch{kn.value.destroy(),kn.value=null}const Ta=JSON.parse(JSON.stringify(fo)),Ea=new d2(qo,{type:"line",data:{datasets:[{label:"Noise Floor (dBm)",data:Ta,borderColor:"#F59E0B",backgroundColor:"rgba(245, 158, 11, 0.1)",borderWidth:2,tension:.3,pointRadius:0,pointHoverRadius:3,fill:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",labels:{color:"rgba(255, 255, 255, 0.8)",usePointStyle:!0,padding:20}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",maxTicksLimit:8}},y:{type:"linear",display:!0,title:{display:!0,text:"Noise Floor (dBm)",color:"rgba(255, 255, 255, 0.8)"},grid:{color:"rgba(245, 158, 11, 0.2)"},ticks:{color:"#F59E0B",stepSize:.5,callback:function(go){return typeof go=="number"?go.toFixed(1):go}},min:-117,max:-113}}}});kn.value=ju(Ea)},fu=()=>{if(!Qi.value){_r.value.routePie=!1;return}if(!re.value||!re.value.route_totals){Wr.value=!0,_r.value.routePie=!1;return}Wr.value=!1;const qo=re.value.route_totals,fo=Object.keys(qo),Ta=Object.values(qo),Ea=["#3B82F6","#F87171","#10B981","#F59E0B","#A78BFA"];try{const go=JSON.parse(JSON.stringify(fo)),Ao=JSON.parse(JSON.stringify(Ta)),Ps=[{type:"pie",labels:go,values:Ao,marker:{colors:Ea.slice(0,Ao.length)},hovertemplate:"<b>%{label}</b><br>Count: %{value}<br>Percentage: %{percent}<extra></extra>",textinfo:"label+percent",textposition:"auto",pull:.1,hole:.3}],$o={title:{text:"",font:{color:"rgba(255, 255, 255, 0.8)"}},paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:"h",x:0,y:-.2,font:{color:"rgba(255, 255, 255, 0.8)",size:10}}},gi={responsive:!0,displayModeBar:!1,staticPlot:!1};l1.newPlot(Qi.value,Ps,$o,gi),_r.value.routePie=!1,setTimeout(()=>{_r.value.routePie&&(_r.value.routePie=!1)},50)}catch(go){console.error("Error creating 3D route pie chart:",go),Wr.value=!0,_r.value.routePie=!1}};return t0(async()=>{await Z0(),ia(),z.value=window.setInterval(ia,3e4),window.addEventListener("resize",()=>{setTimeout(()=>{ju(An.value)?.resize(),ju(Ft.value)?.resize(),ju(kn.value)?.resize(),Qi.value&&l1.Plots&&l1.Plots.resize(Qi.value)},100)})}),dg(()=>{z.value&&clearInterval(z.value),An.value?.destroy(),Ft.value?.destroy(),kn.value?.destroy(),Qi.value&&l1.purge(Qi.value),window.removeEventListener("resize",()=>{})}),(qo,fo)=>(zi(),Vi("div",Rdt,[Re("div",Bdt,[fo[2]||(fo[2]=Re("h2",{class:"text-2xl font-bold text-white"},"Statistics",-1)),Re("div",Ndt,[fo[1]||(fo[1]=Re("label",{class:"text-white/70 text-sm"},"Time Range:",-1)),$p(Re("select",{"onUpdate:modelValue":fo[0]||(fo[0]=Ta=>J.value=Ta),onChange:Ni,class:"bg-white/10 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:outline-none focus:border-accent-purple/50 transition-colors"},[(zi(),Vi(Ou,null,sf(mt,Ta=>Re("option",{key:Ta.value,value:Ta.value,class:"bg-gray-800 text-white"},aa(Ta.label),9,jdt)),64))],544),[[iA,J.value]])])]),Re("div",Udt,[gu(r_,{title:"Total RX",value:Gi.value.totalRx,color:"#AAE8E8",data:un.value.totalPackets},null,8,["value","data"]),gu(r_,{title:"Total TX",value:Gi.value.totalTx,color:"#FFC246",data:un.value.transmittedPackets},null,8,["value","data"])]),Re("div",Vdt,[fo[9]||(fo[9]=Re("h3",{class:"text-white text-xl font-semibold mb-4"},"Performance Metrics",-1)),Re("div",Hdt,[fo[5]||(fo[5]=Ff('<p class="text-white/70 text-sm uppercase tracking-wide mb-2" data-v-9766a4d1>Packet Rate (RX/TX PER HOUR)</p><div class="flex items-center gap-6 mb-4" data-v-9766a4d1><div class="flex items-center gap-2" data-v-9766a4d1><div class="w-3 h-3 rounded-full bg-purple-400" data-v-9766a4d1></div><span class="text-white/70 text-sm" data-v-9766a4d1>RX/hr</span></div><div class="flex items-center gap-2" data-v-9766a4d1><div class="w-3 h-3 rounded-full bg-amber-400" data-v-9766a4d1></div><span class="text-white/70 text-sm" data-v-9766a4d1>TX/hr</span></div></div>',2)),Re("div",Wdt,[Re("canvas",{ref_key:"packetRateCanvasRef",ref:ei,class:"w-full h-full relative z-10"},null,512),_r.value.packetRate?(zi(),Vi("div",qdt,fo[3]||(fo[3]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-purple-400 rounded-full mx-auto mb-2"}),Re("div",{class:"text-white/50 text-xs"},"Loading packet rate data...")],-1)]))):bs("",!0),Fr.value&&!_r.value.packetRate?(zi(),Vi("div",Zdt,fo[4]||(fo[4]=[Re("div",{class:"text-center"},[Re("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Re("div",{class:"text-white/50 text-xs"},"Packet rate data not found")],-1)]))):bs("",!0)])]),Re("div",$dt,[fo[8]||(fo[8]=Re("p",{class:"text-white/70 text-sm uppercase tracking-wide mb-2"},"Packet Type Distribution",-1)),Re("div",Gdt,[Re("canvas",{ref_key:"packetTypeCanvasRef",ref:jn,class:"w-full h-full relative z-10"},null,512),_r.value.packetType?(zi(),Vi("div",Ydt,fo[6]||(fo[6]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-blue-400 rounded-full mx-auto mb-2"}),Re("div",{class:"text-white/50 text-xs"},"Loading packet type data...")],-1)]))):bs("",!0),zr.value&&!_r.value.packetType?(zi(),Vi("div",Kdt,fo[7]||(fo[7]=[Re("div",{class:"text-center"},[Re("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Re("div",{class:"text-white/50 text-xs"},"Packet type data not found")],-1)]))):bs("",!0)])])]),Re("div",Xdt,[fo[13]||(fo[13]=Re("h3",{class:"text-white text-xl font-semibold mb-4"},"Noise Floor Over Time",-1)),Re("div",Jdt,[Re("div",Qdt,[Re("div",tpt,[Re("canvas",{ref_key:"signalMetricsCanvasRef",ref:ai,class:"w-full h-full"},null,512)])]),Re("div",ept,[fo[12]||(fo[12]=Re("p",{class:"text-white/70 text-sm uppercase tracking-wide mb-2"},"Route Distribution",-1)),Re("div",rpt,[Re("div",{ref_key:"signalPie3DRef",ref:Qi,class:"w-full h-full relative z-10"},null,512),_r.value.routePie?(zi(),Vi("div",npt,fo[10]||(fo[10]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-green-400 rounded-full mx-auto mb-2"}),Re("div",{class:"text-white/50 text-xs"},"Loading route data...")],-1)]))):bs("",!0),Wr.value&&!_r.value.routePie?(zi(),Vi("div",ipt,fo[11]||(fo[11]=[Re("div",{class:"text-center"},[Re("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Re("div",{class:"text-white/50 text-xs"},"Route statistics not found")],-1)]))):bs("",!0)])])])]),Ne.value?(zi(),Vi("div",apt,fo[14]||(fo[14]=[Re("div",{class:"text-white/70 mb-2"},"Loading statistics...",-1),Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-white/70 rounded-full mx-auto"},null,-1)]))):bs("",!0),or.value?(zi(),Vi("div",opt,[fo[15]||(fo[15]=Re("div",{class:"text-red-400 mb-2"},"Failed to load statistics",-1)),Re("p",spt,aa(or.value),1),Re("button",{onClick:ia,class:"mt-4 px-4 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-white rounded-lg border border-accent-purple/50 transition-colors"}," Retry ")])):bs("",!0)]))}}),upt=ld(lpt,[["__scopeId","data-v-9766a4d1"]]),cpt={class:"space-y-4"},hpt={class:"bg-white/5 rounded-lg p-4 space-y-3"},fpt={class:"flex justify-between items-center py-2 border-b border-white/10"},dpt={class:"text-white font-mono"},ppt={class:"flex justify-between items-center py-2 border-b border-white/10"},mpt={class:"text-white font-mono"},gpt={class:"flex justify-between items-center py-2 border-b border-white/10"},vpt={class:"text-white font-mono"},ypt={class:"flex justify-between items-center py-2 border-b border-white/10"},xpt={class:"text-white font-mono"},_pt={class:"flex justify-between items-center py-2 border-b border-white/10"},bpt={class:"text-white font-mono"},wpt={class:"flex justify-between items-center py-2"},kpt={class:"text-white font-mono"},Tpt=Th({__name:"RadioSettings",setup(d){const l=sv(),z=Yo(()=>l.stats?.config?.radio||{}),j=Yo(()=>{const re=z.value.frequency;return re?(re/1e6).toFixed(3)+" MHz":"Not set"}),J=Yo(()=>{const re=z.value.bandwidth;return re?(re/1e3).toFixed(1)+" kHz":"Not set"}),mt=Yo(()=>{const re=z.value.tx_power;return re!==void 0?re+" dBm":"Not set"}),kt=Yo(()=>{const re=z.value.coding_rate;return re?"4/"+re:"Not set"}),Dt=Yo(()=>{const re=z.value.preamble_length;return re?re+" symbols":"Not set"}),Gt=Yo(()=>z.value.spreading_factor??"Not set");return(re,pe)=>(zi(),Vi("div",cpt,[Re("div",hpt,[Re("div",fpt,[pe[0]||(pe[0]=Re("span",{class:"text-white/70 text-sm"},"Frequency",-1)),Re("span",dpt,aa(j.value),1)]),Re("div",ppt,[pe[1]||(pe[1]=Re("span",{class:"text-white/70 text-sm"},"Spreading Factor",-1)),Re("span",mpt,aa(Gt.value),1)]),Re("div",gpt,[pe[2]||(pe[2]=Re("span",{class:"text-white/70 text-sm"},"Bandwidth",-1)),Re("span",vpt,aa(J.value),1)]),Re("div",ypt,[pe[3]||(pe[3]=Re("span",{class:"text-white/70 text-sm"},"TX Power",-1)),Re("span",xpt,aa(mt.value),1)]),Re("div",_pt,[pe[4]||(pe[4]=Re("span",{class:"text-white/70 text-sm"},"Coding Rate",-1)),Re("span",bpt,aa(kt.value),1)]),Re("div",wpt,[pe[5]||(pe[5]=Re("span",{class:"text-white/70 text-sm"},"Preamble Length",-1)),Re("span",kpt,aa(Dt.value),1)])])]))}}),Apt={class:"space-y-4"},Mpt={class:"bg-white/5 rounded-lg p-4 space-y-3"},Spt={class:"flex justify-between items-center py-2 border-b border-white/10"},Ept={class:"text-white font-mono"},Cpt={class:"flex justify-between items-center py-2 border-b border-white/10"},Lpt={class:"text-white font-mono text-xs"},Ppt={class:"flex justify-between items-start py-2 border-b border-white/10"},zpt={class:"text-white font-mono text-xs text-right break-all max-w-xs"},Ipt={class:"flex justify-between items-center py-2 border-b border-white/10"},Opt={class:"text-white font-mono"},Dpt={class:"flex justify-between items-center py-2 border-b border-white/10"},Fpt={class:"text-white font-mono"},Rpt={class:"flex justify-between items-center py-2 border-b border-white/10"},Bpt={class:"text-white font-mono"},Npt={class:"flex justify-between items-start py-2"},jpt={class:"text-white font-mono ml-4"},Upt=Th({__name:"RepeaterSettings",setup(d){const l=sv(),z=Yo(()=>l.stats?.config||{}),j=Yo(()=>z.value.repeater||{}),J=Yo(()=>l.stats),mt=Yo(()=>z.value.node_name||"Not set"),kt=Yo(()=>J.value?.local_hash||"Not available"),Dt=Yo(()=>{const or=J.value?.public_key;return!or||or==="Not set"?"Not set":or}),Gt=Yo(()=>{const or=j.value.latitude;return or&&or!==0?or.toFixed(6):"Not set"}),re=Yo(()=>{const or=j.value.longitude;return or&&or!==0?or.toFixed(6):"Not set"}),pe=Yo(()=>{const or=j.value.mode;return or?or.charAt(0).toUpperCase()+or.slice(1):"Not set"}),Ne=Yo(()=>{const or=j.value.send_advert_interval_hours;return or===void 0?"Not set":or===0?"Disabled":or+" hour"+(or!==1?"s":"")});return(or,_r)=>(zi(),Vi("div",Apt,[Re("div",Mpt,[Re("div",Spt,[_r[0]||(_r[0]=Re("span",{class:"text-white/70 text-sm"},"Node Name",-1)),Re("span",Ept,aa(mt.value),1)]),Re("div",Cpt,[_r[1]||(_r[1]=Re("span",{class:"text-white/70 text-sm"},"Local Hash",-1)),Re("span",Lpt,aa(kt.value),1)]),Re("div",Ppt,[_r[2]||(_r[2]=Re("span",{class:"text-white/70 text-sm"},"Public Key",-1)),Re("span",zpt,aa(Dt.value),1)]),Re("div",Ipt,[_r[3]||(_r[3]=Re("span",{class:"text-white/70 text-sm"},"Latitude",-1)),Re("span",Opt,aa(Gt.value),1)]),Re("div",Dpt,[_r[4]||(_r[4]=Re("span",{class:"text-white/70 text-sm"},"Longitude",-1)),Re("span",Fpt,aa(re.value),1)]),Re("div",Rpt,[_r[5]||(_r[5]=Re("span",{class:"text-white/70 text-sm"},"Mode",-1)),Re("span",Bpt,aa(pe.value),1)]),Re("div",Npt,[_r[6]||(_r[6]=Re("div",{class:"flex flex-col"},[Re("span",{class:"text-white/70 text-sm"},"Periodic Advertisement Interval"),Re("span",{class:"text-white/50 text-xs mt-1"},"How often the repeater sends an advertisement packet (0 = disabled)")],-1)),Re("span",jpt,aa(Ne.value),1)])])]))}}),Vpt={class:"space-y-4"},Hpt={class:"bg-white/5 rounded-lg p-4 space-y-3"},Wpt={class:"flex justify-between items-center py-2 border-b border-white/10"},qpt={class:"text-white font-mono"},Zpt={class:"flex justify-between items-center py-2"},$pt={class:"text-white font-mono"},Gpt=Th({__name:"DutyCycle",setup(d){const l=sv(),z=Yo(()=>l.stats?.config?.duty_cycle||{}),j=Yo(()=>{const mt=z.value.max_airtime_percent;return typeof mt=="number"?mt.toFixed(1)+"%":mt&&typeof mt=="object"&&"parsedValue"in mt?(mt.parsedValue||0).toFixed(1)+"%":"Not set"}),J=Yo(()=>z.value.enforcement_enabled?"Enabled":"Disabled");return(mt,kt)=>(zi(),Vi("div",Vpt,[Re("div",Hpt,[Re("div",Wpt,[kt[0]||(kt[0]=Re("span",{class:"text-white/70 text-sm"},"Max Airtime %",-1)),Re("span",qpt,aa(j.value),1)]),Re("div",Zpt,[kt[1]||(kt[1]=Re("span",{class:"text-white/70 text-sm"},"Enforcement",-1)),Re("span",$pt,aa(J.value),1)])])]))}}),Ypt={class:"space-y-4"},Kpt={class:"bg-white/5 rounded-lg p-4 space-y-3"},Xpt={class:"flex justify-between items-start py-2 border-b border-white/10"},Jpt={class:"text-white font-mono ml-4"},Qpt={class:"flex justify-between items-start py-2"},t0t={class:"text-white font-mono ml-4"},e0t=Th({__name:"TransmissionDelays",setup(d){const l=sv(),z=Yo(()=>l.stats?.config?.delays||{}),j=Yo(()=>{const mt=z.value.tx_delay_factor;if(mt&&typeof mt=="object"&&mt!==null&&"parsedValue"in mt){const kt=mt.parsedValue;if(typeof kt=="number")return kt.toFixed(2)+"x"}return"Not set"}),J=Yo(()=>{const mt=z.value.direct_tx_delay_factor;return typeof mt=="number"?mt.toFixed(2)+"s":"Not set"});return(mt,kt)=>(zi(),Vi("div",Ypt,[Re("div",Kpt,[Re("div",Xpt,[kt[0]||(kt[0]=Re("div",{class:"flex flex-col"},[Re("span",{class:"text-white/70 text-sm"},"Flood TX Delay Factor"),Re("span",{class:"text-white/50 text-xs mt-1"},"Multiplier for flood packet transmission delays (collision avoidance)")],-1)),Re("span",Jpt,aa(j.value),1)]),Re("div",Qpt,[kt[1]||(kt[1]=Re("div",{class:"flex flex-col"},[Re("span",{class:"text-white/70 text-sm"},"Direct TX Delay Factor"),Re("span",{class:"text-white/50 text-xs mt-1"},"Base delay for direct-routed packet transmission (seconds)")],-1)),Re("span",t0t,aa(J.value),1)])])]))}}),WD=GA("treeState",()=>{const d=ky(new Set),l=ky({value:null}),z=Dt=>{d.add(Dt)},j=Dt=>{d.delete(Dt)};return{expandedNodes:d,selectedNodeId:l,addExpandedNode:z,removeExpandedNode:j,isNodeExpanded:Dt=>d.has(Dt),setSelectedNode:Dt=>{l.value=Dt},toggleExpanded:Dt=>{d.has(Dt)?j(Dt):z(Dt)}}}),r0t={class:"select-none"},n0t={class:"flex-shrink-0"},i0t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a0t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o0t={key:0,class:"flex items-center gap-1 ml-2"},s0t={class:"relative group"},l0t=["title"],u0t={key:0,class:"text-xs font-mono text-white/50 bg-white/5 px-1.5 py-0.5 rounded border border-white/10"},c0t={class:"flex justify-between items-start mb-4"},h0t={class:"bg-black/20 border border-white/10 rounded-md p-4 mb-4"},f0t={class:"text-sm font-mono text-white/80 break-all leading-relaxed"},d0t={class:"flex items-center gap-2 ml-auto"},p0t={key:0,class:"flex items-center gap-1"},m0t=["title"],g0t={key:1,class:"flex items-center gap-1"},v0t={key:2,class:"px-2 py-1 bg-white/10 text-white/60 text-xs rounded-full ml-1"},y0t={key:0,class:"space-y-1"},x0t=Th({__name:"TreeNode",props:{node:{},selectedNodeId:{},level:{},disabled:{type:Boolean}},emits:["select"],setup(d,{emit:l}){const z=d,j=l,J=WD(),mt=lo(!1),kt=Yo({get:()=>J.isNodeExpanded(z.node.id),set:zr=>{zr?J.addExpandedNode(z.node.id):J.removeExpandedNode(z.node.id)}}),Dt=Yo(()=>z.node.children.length>0);function Gt(zr){if(!zr)return"Never";const An=new Date().getTime()-zr.getTime(),Ft=Math.floor(An/(1e3*60)),kn=Math.floor(An/(1e3*60*60)),ei=Math.floor(An/(1e3*60*60*24)),jn=Math.floor(ei/365);return Ft<60?`${Ft}m ago`:kn<24?`${kn}h ago`:ei<365?`${ei}d ago`:`${jn}y ago`}function re(zr){return zr?zr.length<=16?zr:`${zr.slice(0,8)}...${zr.slice(-8)}`:"No key"}function pe(){if(Dt.value){const zr=!kt.value;kt.value=zr}}function Ne(){j("select",z.node.id)}function or(zr){j("select",zr)}function _r(zr){zr.stopPropagation(),mt.value=!mt.value}function Fr(zr){zr.stopPropagation(),z.node.transport_key&&window.navigator?.clipboard&&window.navigator.clipboard.writeText(z.node.transport_key)}return(zr,Wr)=>{const An=UA("TreeNode",!0);return zi(),Vi("div",r0t,[Re("div",{class:Xs(["flex items-center gap-2 py-2 px-3 rounded-lg cursor-pointer transition-all duration-200",z.disabled?"opacity-50 cursor-not-allowed":"hover:bg-white/5",zr.selectedNodeId===zr.node.id&&!z.disabled?"bg-primary/20 text-primary":"text-white/80 hover:text-white",`ml-${zr.level*4}`]),onClick:Wr[3]||(Wr[3]=Ft=>!z.disabled&&Ne())},[Re("div",{class:"flex-shrink-0 w-4 h-4 flex items-center justify-center",onClick:hg(pe,["stop"])},[Dt.value?(zi(),Vi("svg",{key:0,class:Xs(["w-3 h-3 transition-transform duration-200",kt.value?"rotate-90":"rotate-0"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Wr[4]||(Wr[4]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2)):bs("",!0)]),Re("div",n0t,[z.node.name.startsWith("#")?(zi(),Vi("svg",i0t,Wr[5]||(Wr[5]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",a0t,Wr[6]||(Wr[6]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])))]),Re("span",{class:Xs(["font-mono text-sm transition-colors duration-200",zr.selectedNodeId===zr.node.id?"text-primary font-medium":""])},aa(zr.node.name),3),zr.node.transport_key?(zi(),Vi("div",o0t,[Re("div",s0t,[Re("button",{onClick:_r,class:"p-1 rounded hover:bg-white/10 transition-colors",title:mt.value?"Hide full key":"Show full key"},Wr[7]||(Wr[7]=[Re("svg",{class:"w-3 h-3 text-white/60 hover:text-white/80",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)]),8,l0t),mt.value?bs("",!0):(zi(),Vi("span",u0t,aa(re(zr.node.transport_key)),1)),mt.value?(zi(),Vi("div",{key:1,class:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/70 backdrop-blur-md",onClick:Wr[2]||(Wr[2]=Ft=>mt.value=!1)},[Re("div",{class:"bg-black/20 border border-white/20 rounded-lg shadow-lg p-6 max-w-2xl w-full mx-4",onClick:Wr[1]||(Wr[1]=hg(()=>{},["stop"]))},[Re("div",c0t,[Wr[9]||(Wr[9]=Re("h3",{class:"text-lg font-semibold text-white"},"Transport Key",-1)),Re("button",{onClick:Wr[0]||(Wr[0]=Ft=>mt.value=!1),class:"text-white/60 hover:text-white transition-colors"},Wr[8]||(Wr[8]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("div",h0t,[Re("div",f0t,aa(zr.node.transport_key),1)]),Re("div",{class:"flex justify-end"},[Re("button",{onClick:Fr,class:"px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green rounded-lg transition-colors flex items-center gap-2",title:"Copy to clipboard"},Wr[10]||(Wr[10]=[Re("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),nc(" Copy Key ",-1)]))])])])):bs("",!0)])])):bs("",!0),Re("div",d0t,[zr.node.last_used?(zi(),Vi("div",p0t,[Wr[11]||(Wr[11]=Re("svg",{class:"w-3 h-3 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Re("span",{class:"text-xs text-white/50",title:zr.node.last_used.toLocaleString()},aa(Gt(zr.node.last_used)),9,m0t)])):(zi(),Vi("div",g0t,Wr[12]||(Wr[12]=[Re("svg",{class:"w-3 h-3 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Re("span",{class:"text-xs text-white/30 italic"},"Never",-1)]))),Re("span",{class:Xs(["px-2 py-0.5 text-xs font-medium rounded-md transition-colors",zr.node.floodPolicy==="allow"?"bg-accent-green/10 text-accent-green/90 border border-accent-green/20":"bg-accent-red/10 text-accent-red/90 border border-accent-red/20"])},aa(zr.node.floodPolicy==="allow"?"FLOOD ALLOW":"FLOOD DENY"),3),Dt.value?(zi(),Vi("span",v0t,aa(zr.node.children.length),1)):bs("",!0)])],2),gu(LI,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-screen overflow-visible","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-screen overflow-visible","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:Y2(()=>[kt.value&&zr.node.children.length>0?(zi(),Vi("div",y0t,[(zi(!0),Vi(Ou,null,sf(zr.node.children,Ft=>(zi(),hm(An,{key:Ft.id,node:Ft,"selected-node-id":zr.selectedNodeId,level:zr.level+1,disabled:z.disabled,onSelect:or},null,8,["node","selected-node-id","level","disabled"]))),128))])):bs("",!0)]),_:1})])}}}),_0t=ld(x0t,[["__scopeId","data-v-4afde13e"]]),b0t={class:"flex items-center justify-between mb-6"},w0t={class:"text-white/60 text-sm mt-1"},k0t={key:0},T0t={class:"text-primary font-mono"},A0t={key:1},M0t={for:"keyName",class:"block text-sm font-medium text-white mb-2"},S0t={class:"flex items-center gap-2"},E0t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},C0t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},L0t={class:"bg-white/5 border border-white/10 rounded-lg p-4"},P0t={class:"flex items-center gap-3 mb-2"},z0t={class:"flex items-center gap-2"},I0t={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},O0t={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},D0t={class:"text-white/70 text-sm"},F0t={class:"grid grid-cols-2 gap-3"},R0t={class:"relative cursor-pointer group"},B0t={class:"relative cursor-pointer group"},N0t={class:"flex gap-3 pt-4"},j0t=["disabled"],U0t=Th({__name:"AddKeyModal",props:{show:{type:Boolean},selectedNodeName:{},selectedNodeId:{}},emits:["close","add"],setup(d,{emit:l}){const z=d,j=l,J=lo(""),mt=lo(""),kt=lo("allow"),Dt=Yo(()=>J.value.startsWith("#")),Gt=Yo(()=>({type:Dt.value?"Region":"Private Key",description:Dt.value?"Regional organizational key":"Individual assigned key"}));um(Dt,_r=>{_r?mt.value="This will create a new region for organizing keys":mt.value="This will create a new private key entry"},{immediate:!0});const re=Yo(()=>J.value.trim().length>0),pe=()=>{re.value&&(j("add",{name:J.value.trim(),floodPolicy:kt.value,parentId:z.selectedNodeId}),J.value="",mt.value="",kt.value="allow")},Ne=()=>{J.value="",mt.value="",kt.value="allow",j("close")},or=_r=>{_r.target===_r.currentTarget&&Ne()};return(_r,Fr)=>_r.show?(zi(),Vi("div",{key:0,onClick:or,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Re("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:Fr[3]||(Fr[3]=hg(()=>{},["stop"]))},[Re("div",b0t,[Re("div",null,[Fr[5]||(Fr[5]=Re("h3",{class:"text-xl font-semibold text-white"},"Add New Entry",-1)),Re("p",w0t,[z.selectedNodeName?(zi(),Vi("span",k0t,[Fr[4]||(Fr[4]=nc(" Add to: ",-1)),Re("span",T0t,aa(z.selectedNodeName),1)])):(zi(),Vi("span",A0t," Add to root level (#uk) "))])]),Re("button",{onClick:Ne,class:"text-white/60 hover:text-white transition-colors"},Fr[6]||(Fr[6]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("form",{onSubmit:hg(pe,["prevent"]),class:"space-y-4"},[Re("div",null,[Re("label",M0t,[Re("div",S0t,[Dt.value?(zi(),Vi("svg",E0t,Fr[7]||(Fr[7]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",C0t,Fr[8]||(Fr[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))),Fr[9]||(Fr[9]=nc(" Region/Key Name ",-1))])]),$p(Re("input",{id:"keyName","onUpdate:modelValue":Fr[0]||(Fr[0]=zr=>J.value=zr),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[$A,J.value]])]),Re("div",L0t,[Re("div",P0t,[Re("div",z0t,[Dt.value?(zi(),Vi("svg",I0t,Fr[10]||(Fr[10]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",O0t,Fr[11]||(Fr[11]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1221 9z"},null,-1)]))),Re("span",{class:Xs([Dt.value?"text-secondary":"text-accent-green","font-medium"])},aa(Gt.value.type),3)]),Re("div",{class:Xs(["flex-1 h-px",Dt.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),Re("p",D0t,aa(Gt.value.description),1)]),Re("div",null,[Fr[14]||(Fr[14]=Re("label",{class:"block text-sm font-medium text-white mb-3"},[Re("div",{class:"flex items-center gap-2"},[Re("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),nc(" Flood Policy ")])],-1)),Re("div",F0t,[Re("label",R0t,[$p(Re("input",{type:"radio","onUpdate:modelValue":Fr[1]||(Fr[1]=zr=>kt.value=zr),value:"allow",class:"sr-only"},null,512),[[F2,kt.value]]),Fr[12]||(Fr[12]=Ff('<div class="flex items-center gap-3 p-3 bg-white/5 border border-white/20 rounded-lg group-has-[:checked]:border-accent-green/50 group-has-[:checked]:bg-accent-green/10 transition-colors"><div class="flex items-center justify-center w-4 h-4 border-2 border-white/30 rounded-full group-has-[:checked]:border-accent-green group-has-[:checked]:bg-accent-green transition-all"><div class="w-2 h-2 rounded-full bg-white scale-0 group-has-[:checked]:scale-100 transition-transform"></div></div><div class="flex-1"><div class="flex items-center gap-2"><svg class="w-4 h-4 text-accent-green" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg><span class="font-medium text-accent-green text-sm">Allow</span></div><p class="text-white/60 text-xs mt-1">Permit flooding</p></div></div>',1))]),Re("label",B0t,[$p(Re("input",{type:"radio","onUpdate:modelValue":Fr[2]||(Fr[2]=zr=>kt.value=zr),value:"deny",class:"sr-only"},null,512),[[F2,kt.value]]),Fr[13]||(Fr[13]=Ff('<div class="flex items-center gap-3 p-3 bg-white/5 border border-white/20 rounded-lg group-has-[:checked]:border-accent-red/50 group-has-[:checked]:bg-accent-red/10 transition-colors"><div class="flex items-center justify-center w-4 h-4 border-2 border-white/30 rounded-full group-has-[:checked]:border-accent-red group-has-[:checked]:bg-accent-red transition-all"><div class="w-2 h-2 rounded-full bg-white scale-0 group-has-[:checked]:scale-100 transition-transform"></div></div><div class="flex-1"><div class="flex items-center gap-2"><svg class="w-4 h-4 text-accent-red" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg><span class="font-medium text-accent-red text-sm">Deny</span></div><p class="text-white/60 text-xs mt-1">Block flooding</p></div></div>',1))])])]),Re("div",N0t,[Re("button",{type:"button",onClick:Ne,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Re("button",{type:"submit",disabled:!re.value,class:Xs(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",re.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-white/5 border border-white/20 text-white/40 cursor-not-allowed"])}," Add "+aa(Gt.value.type),11,j0t)])],32)])])):bs("",!0)}}),V0t={class:"flex bg-black items-center justify-between mb-6"},H0t={class:"text-white/60 text-sm mt-1"},W0t={class:"text-primary font-mono"},q0t={for:"keyName",class:"block text-sm font-medium text-white mb-2"},Z0t={class:"flex items-center gap-2"},$0t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},G0t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Y0t={class:"bg-white/5 border border-white/10 rounded-lg p-4"},K0t={class:"flex items-center gap-3 mb-2"},X0t={class:"flex items-center gap-2"},J0t={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Q0t={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},tmt={class:"text-white/70 text-sm"},emt={key:0,class:"space-y-4"},rmt={key:0,class:"bg-white/5 border border-white/10 rounded-lg p-4"},nmt={class:"bg-black/20 border border-white/10 rounded-md p-3"},imt={class:"text-xs font-mono text-white/80 break-all"},amt={key:1,class:"bg-white/5 border border-white/10 rounded-lg p-4"},omt={class:"flex items-center justify-between"},smt={class:"text-sm text-white/70"},lmt={class:"text-xs text-white/50"},umt={class:"grid grid-cols-2 gap-3"},cmt={class:"relative cursor-pointer group"},hmt={class:"relative cursor-pointer group"},fmt={class:"flex gap-3 pt-4"},dmt=["disabled"],pmt=Th({__name:"EditKeyModal",props:{show:{type:Boolean},node:{}},emits:["close","save","request-delete"],setup(d,{emit:l}){const z=d,j=l,J=lo(""),mt=lo("allow"),kt=Yo(()=>J.value.startsWith("#")),Dt=Yo(()=>({type:kt.value?"Region":"Private Key",description:kt.value?"Regional organizational key":"Individual assigned key"}));um(()=>z.node,zr=>{zr?(J.value=zr.name,mt.value=zr.floodPolicy):(J.value="",mt.value="allow")},{immediate:!0});const Gt=Yo(()=>J.value.trim().length>0&&z.node),re=zr=>{const An=new Date().getTime()-zr.getTime(),Ft=Math.floor(An/(1e3*60)),kn=Math.floor(An/(1e3*60*60)),ei=Math.floor(An/(1e3*60*60*24)),jn=Math.floor(ei/365);return Ft<60?`${Ft}m ago`:kn<24?`${kn}h ago`:ei<365?`${ei}d ago`:`${jn}y ago`},pe=zr=>{window.navigator?.clipboard&&window.navigator.clipboard.writeText(zr)},Ne=()=>{!Gt.value||!z.node||(j("save",{id:z.node.id,name:J.value.trim(),floodPolicy:mt.value}),_r())},or=()=>{z.node&&(j("request-delete",z.node),_r())},_r=()=>{j("close")},Fr=zr=>{zr.target===zr.currentTarget&&_r()};return(zr,Wr)=>zr.show?(zi(),Vi("div",{key:0,onClick:Fr,class:"fixed inset-0 bg-black/50 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Re("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:Wr[4]||(Wr[4]=hg(()=>{},["stop"]))},[Re("div",V0t,[Re("div",null,[Wr[6]||(Wr[6]=Re("h3",{class:"text-xl font-semibold text-white"},"Edit Entry",-1)),Re("p",H0t,[Wr[5]||(Wr[5]=nc(" Modify ",-1)),Re("span",W0t,aa(zr.node?.name),1)])]),Re("button",{onClick:_r,class:"text-white/60 hover:text-white transition-colors"},Wr[7]||(Wr[7]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("form",{onSubmit:hg(Ne,["prevent"]),class:"space-y-4"},[Re("div",null,[Re("label",q0t,[Re("div",Z0t,[kt.value?(zi(),Vi("svg",$0t,Wr[8]||(Wr[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",G0t,Wr[9]||(Wr[9]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Wr[10]||(Wr[10]=nc(" Region/Key Name ",-1))])]),$p(Re("input",{id:"keyName","onUpdate:modelValue":Wr[0]||(Wr[0]=An=>J.value=An),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[$A,J.value]])]),Re("div",Y0t,[Re("div",K0t,[Re("div",X0t,[kt.value?(zi(),Vi("svg",J0t,Wr[11]||(Wr[11]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",Q0t,Wr[12]||(Wr[12]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Re("span",{class:Xs([kt.value?"text-secondary":"text-accent-green","font-medium"])},aa(Dt.value.type),3)]),Re("div",{class:Xs(["flex-1 h-px",kt.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),Re("p",tmt,aa(Dt.value.description),1)]),zr.node?(zi(),Vi("div",emt,[zr.node.transport_key?(zi(),Vi("div",rmt,[Wr[14]||(Wr[14]=Ff('<div class="flex items-center gap-2 mb-3"><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path></svg><span class="text-sm font-medium text-white">Transport Key</span></div>',1)),Re("div",nmt,[Re("div",imt,aa(zr.node.transport_key),1),Re("button",{onClick:Wr[1]||(Wr[1]=An=>pe(zr.node.transport_key||"")),class:"mt-2 text-xs text-accent-green hover:text-accent-green/80 flex items-center gap-1",title:"Copy to clipboard"},Wr[13]||(Wr[13]=[Re("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),nc(" Copy Key ",-1)]))])])):bs("",!0),zr.node.last_used?(zi(),Vi("div",amt,[Wr[15]||(Wr[15]=Re("div",{class:"flex items-center gap-2 mb-3"},[Re("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})]),Re("span",{class:"text-sm font-medium text-white"},"Last Used")],-1)),Re("div",omt,[Re("div",smt,aa(zr.node.last_used.toLocaleDateString())+" at "+aa(zr.node.last_used.toLocaleTimeString()),1),Re("div",lmt,aa(re(zr.node.last_used)),1)])])):bs("",!0)])):bs("",!0),Re("div",null,[Wr[18]||(Wr[18]=Re("label",{class:"block text-sm font-medium text-white mb-3"},[Re("div",{class:"flex items-center gap-2"},[Re("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),nc(" Flood Policy ")])],-1)),Re("div",umt,[Re("label",cmt,[$p(Re("input",{type:"radio","onUpdate:modelValue":Wr[2]||(Wr[2]=An=>mt.value=An),value:"allow",class:"sr-only"},null,512),[[F2,mt.value]]),Wr[16]||(Wr[16]=Ff('<div class="flex items-center gap-3 p-3 bg-white/5 border border-white/20 rounded-lg group-has-[:checked]:border-accent-green/50 group-has-[:checked]:bg-accent-green/10 transition-colors"><div class="flex items-center justify-center w-4 h-4 border-2 border-white/30 rounded-full group-has-[:checked]:border-accent-green group-has-[:checked]:bg-accent-green transition-all"><div class="w-2 h-2 rounded-full bg-white scale-0 group-has-[:checked]:scale-100 transition-transform"></div></div><div class="flex-1"><div class="flex items-center gap-2"><svg class="w-4 h-4 text-accent-green" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg><span class="font-medium text-accent-green text-sm">Allow</span></div><p class="text-white/60 text-xs mt-1">Permit flooding</p></div></div>',1))]),Re("label",hmt,[$p(Re("input",{type:"radio","onUpdate:modelValue":Wr[3]||(Wr[3]=An=>mt.value=An),value:"deny",class:"sr-only"},null,512),[[F2,mt.value]]),Wr[17]||(Wr[17]=Ff('<div class="flex items-center gap-3 p-3 bg-white/5 border border-white/20 rounded-lg group-has-[:checked]:border-accent-red/50 group-has-[:checked]:bg-accent-red/10 transition-colors"><div class="flex items-center justify-center w-4 h-4 border-2 border-white/30 rounded-full group-has-[:checked]:border-accent-red group-has-[:checked]:bg-accent-red transition-all"><div class="w-2 h-2 rounded-full bg-white scale-0 group-has-[:checked]:scale-100 transition-transform"></div></div><div class="flex-1"><div class="flex items-center gap-2"><svg class="w-4 h-4 text-accent-red" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg><span class="font-medium text-accent-red text-sm">Deny</span></div><p class="text-white/60 text-xs mt-1">Block flooding</p></div></div>',1))])])]),Re("div",fmt,[Re("button",{type:"button",onClick:or,class:"px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors"}," Delete "),Re("button",{type:"button",onClick:_r,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Re("button",{type:"submit",disabled:!Gt.value,class:Xs(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",Gt.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-white/5 border border-white/20 text-white/40 cursor-not-allowed"])}," Save Changes ",10,dmt)])],32)])])):bs("",!0)}}),mmt={class:"flex items-center gap-3 mb-6"},gmt={class:"text-white/60 text-sm mt-1"},vmt={class:"text-accent-red font-mono"},ymt={key:0,class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},xmt={class:"flex items-start gap-3"},_mt={class:"flex-1"},bmt={class:"text-accent-red font-medium text-sm mb-2"},wmt={class:"space-y-1 max-h-32 overflow-y-auto"},kmt={key:0,class:"w-3 h-3 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Tmt={key:1,class:"w-3 h-3 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Amt={class:"font-mono"},Mmt={key:0,class:"text-white/60 text-xs"},Smt={key:1,class:"mb-6"},Emt={class:"mb-3"},Cmt={class:"relative"},Lmt={class:"space-y-2 max-h-40 overflow-y-auto border border-white/20 rounded-lg p-3 bg-white/5"},Pmt={key:0,class:"text-center py-4 text-white/60 text-sm"},zmt={class:"relative"},Imt=["value"],Omt={class:"flex items-center gap-2 flex-1"},Dmt={class:"text-white font-mono text-sm"},Fmt={key:0,class:"ml-auto px-2 py-0.5 bg-white/10 text-white/60 text-xs rounded-full"},Rmt={class:"flex gap-3"},Bmt=Th({__name:"DeleteConfirmModal",props:{show:{type:Boolean},node:{},allNodes:{}},emits:["close","delete-all","move-children"],setup(d,{emit:l}){const z=d,j=l,J=lo(null),mt=lo(""),kt=Fr=>{const zr=[],Wr=An=>{for(const Ft of An.children)zr.push(Ft),Wr(Ft)};return Wr(Fr),zr},Dt=Yo(()=>z.node?kt(z.node):[]),Gt=Yo(()=>{if(!z.node)return[];const Fr=new Set([z.node.id,...Dt.value.map(Wr=>Wr.id)]),zr=Wr=>{const An=[];for(const Ft of Wr)Ft.name.startsWith("#")&&!Fr.has(Ft.id)&&An.push(Ft),Ft.children.length>0&&An.push(...zr(Ft.children));return An};return zr(z.allNodes)}),re=Yo(()=>{if(!mt.value.trim())return Gt.value;const Fr=mt.value.toLowerCase();return Gt.value.filter(zr=>zr.name.toLowerCase().includes(Fr))}),pe=()=>{z.node&&(j("delete-all",z.node.id),or())},Ne=()=>{!z.node||!J.value||(j("move-children",{nodeId:z.node.id,targetParentId:J.value}),or())},or=()=>{J.value=null,mt.value="",j("close")},_r=Fr=>{Fr.target===Fr.currentTarget&&or()};return(Fr,zr)=>Fr.show&&Fr.node?(zi(),Vi("div",{key:0,onClick:_r,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Re("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-lg border border-white/10",onClick:zr[2]||(zr[2]=hg(()=>{},["stop"]))},[Re("div",mmt,[zr[6]||(zr[6]=Re("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Re("div",null,[zr[4]||(zr[4]=Re("h3",{class:"text-xl font-semibold text-white"},"Confirm Deletion",-1)),Re("p",gmt,[zr[3]||(zr[3]=nc(" Deleting ",-1)),Re("span",vmt,aa(Fr.node?.name),1)])]),Re("button",{onClick:or,class:"ml-auto text-white/60 hover:text-white transition-colors"},zr[5]||(zr[5]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Dt.value.length>0?(zi(),Vi("div",ymt,[Re("div",xmt,[zr[9]||(zr[9]=Re("svg",{class:"w-5 h-5 text-accent-red flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Re("div",_mt,[Re("h4",bmt," This will affect "+aa(Dt.value.length)+" child "+aa(Dt.value.length===1?"entry":"entries")+": ",1),Re("div",wmt,[(zi(!0),Vi(Ou,null,sf(Dt.value.slice(0,10),Wr=>(zi(),Vi("div",{key:Wr.id,class:"flex items-center gap-2 text-xs text-white/80"},[Wr.name.startsWith("#")?(zi(),Vi("svg",kmt,zr[7]||(zr[7]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",Tmt,zr[8]||(zr[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Re("span",Amt,aa(Wr.name),1),Re("span",{class:Xs(["px-1 py-0.5 text-xs rounded",Wr.floodPolicy==="allow"?"bg-accent-green/20 text-accent-green":"bg-accent-red/20 text-accent-red"])},aa(Wr.floodPolicy),3)]))),128)),Dt.value.length>10?(zi(),Vi("div",Mmt," ...and "+aa(Dt.value.length-10)+" more ",1)):bs("",!0)])])])])):bs("",!0),Dt.value.length>0&&Gt.value.length>0?(zi(),Vi("div",Smt,[zr[13]||(zr[13]=Re("h4",{class:"text-white font-medium text-sm mb-3"},"Move children to another region:",-1)),Re("div",Emt,[Re("div",Cmt,[zr[10]||(zr[10]=Re("svg",{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),$p(Re("input",{"onUpdate:modelValue":zr[0]||(zr[0]=Wr=>mt.value=Wr),type:"text",placeholder:"Search regions...",class:"w-full pl-9 pr-4 py-2 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors text-sm"},null,512),[[$A,mt.value]])])]),Re("div",Lmt,[re.value.length===0?(zi(),Vi("div",Pmt,aa(mt.value?"No regions match your search":"No available regions"),1)):bs("",!0),(zi(!0),Vi(Ou,null,sf(re.value,Wr=>(zi(),Vi("label",{key:Wr.id,class:"flex items-center gap-3 p-2 rounded cursor-pointer hover:bg-white/10 transition-colors group"},[Re("div",zmt,[$p(Re("input",{type:"radio",value:Wr.id,"onUpdate:modelValue":zr[1]||(zr[1]=An=>J.value=An),class:"sr-only peer"},null,8,Imt),[[F2,J.value]]),zr[11]||(zr[11]=Re("div",{class:"w-4 h-4 border-2 border-white/30 rounded-full group-hover:border-white/50 peer-checked:border-primary peer-checked:bg-primary/20 transition-all"},[Re("div",{class:"w-2 h-2 rounded-full bg-primary scale-0 peer-checked:scale-100 transition-transform absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"})],-1))]),Re("div",Omt,[zr[12]||(zr[12]=Re("svg",{class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})],-1)),Re("span",Dmt,aa(Wr.name),1),Wr.children.length>0?(zi(),Vi("span",Fmt,aa(Wr.children.length),1)):bs("",!0)])]))),128))])])):bs("",!0),Re("div",Rmt,[Re("button",{onClick:or,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Dt.value.length>0&&J.value?(zi(),Vi("button",{key:0,onClick:Ne,class:"flex-1 px-4 py-3 bg-primary/20 hover:bg-primary/30 border border-primary/50 text-primary rounded-lg transition-colors"}," Move & Delete ")):bs("",!0),Re("button",{onClick:pe,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"},aa(Dt.value.length>0?"Delete All":"Delete"),1)])])])):bs("",!0)}}),Nmt={class:"space-y-6"},jmt={class:"flex justify-between items-start"},Umt={class:"flex gap-2"},Vmt=["disabled"],Hmt=["disabled"],Wmt=["disabled"],qmt={class:"glass-card rounded-[15px] p-4 border border-white/10 bg-white/5"},Zmt={class:"flex items-center justify-between"},$mt={class:"flex items-center gap-3"},Gmt={class:"flex bg-white/5 rounded-lg border border-white/20 p-1"},Ymt={class:"glass-card rounded-[15px] p-6 border border-white/10"},Kmt={key:0,class:"flex items-center justify-center py-8"},Xmt={key:1,class:"text-center py-8"},Jmt={class:"text-white/70 text-sm"},Qmt={key:2,class:"text-center py-8"},tgt={key:3,class:"space-y-2"},egt=Th({name:"TransportKeys",__name:"TransportKeys",setup(d){const l=WD(),z=lo(!1),j=lo(!1),J=lo(!1),mt=lo(null),kt=lo(null),Dt=lo("deny"),Gt=lo([]),re=lo(!1),pe=lo(null),Ne=Li=>{const yi=new Map,ra=[];return Li.forEach(Da=>{const Ni={id:Da.id,name:Da.name,floodPolicy:Da.flood_policy,transport_key:Da.transport_key,last_used:Da.last_used?new Date(Da.last_used*1e3):void 0,parent_id:Da.parent_id,children:[]};yi.set(Da.id,Ni)}),yi.forEach(Da=>{Da.parent_id&&yi.has(Da.parent_id)?yi.get(Da.parent_id).children.push(Da):ra.push(Da)}),ra},or=async()=>{try{re.value=!0,pe.value=null;const Li=await Xh.getTransportKeys();Li.success&&Li.data?Gt.value=Ne(Li.data):pe.value=Li.error||"Failed to load transport keys"}catch(Li){pe.value=Li instanceof Error?Li.message:"Unknown error occurred",console.error("Error loading transport keys:",Li)}finally{re.value=!1}};t0(()=>{or()});function _r(Li,yi){for(const ra of Li){if(ra.id===yi)return ra;if(ra.children){const Da=_r(ra.children,yi);if(Da)return Da}}return null}function Fr(){const Li=l.selectedNodeId.value;return Li?_r(Gt.value,Li)?.name:void 0}function zr(Li){Dt.value==="deny"&&l.setSelectedNode(Li)}function Wr(){Dt.value==="deny"&&(z.value=!0)}function An(){if(Dt.value==="deny"&&l.selectedNodeId.value){const Li=_r(Gt.value,l.selectedNodeId.value);Li&&(kt.value=Li,J.value=!0)}}function Ft(){if(Dt.value==="deny"&&l.selectedNodeId.value){const Li=_r(Gt.value,l.selectedNodeId.value);Li&&(mt.value=Li,j.value=!0)}}const kn=async Li=>{try{const yi=await Xh.createTransportKey(Li.name,Li.floodPolicy,void 0,Li.parentId,void 0);yi.success?await or():(console.error("❌ Failed to add transport key:",yi.error),pe.value=yi.error||"Failed to add transport key")}catch(yi){console.error("❌ Error adding transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{z.value=!1}};function ei(){z.value=!1}async function jn(Li){try{const yi=Li==="allow",ra=await Xh.updateGlobalFloodPolicy(yi);ra.success?Dt.value=Li:(console.error("❌ Failed to update global flood policy:",ra.error),pe.value=ra.error||"Failed to update global flood policy")}catch(yi){console.error("❌ Error updating global flood policy:",yi),pe.value=yi instanceof Error?yi.message:"Failed to update global flood policy"}}function ai(){j.value=!1,mt.value=null}async function Qi(Li){try{const yi=await Xh.updateTransportKey(Li.id,Li.name,Li.floodPolicy);yi.success?await or():(console.error("❌ Failed to update transport key:",yi.error),pe.value=yi.error||"Failed to update transport key")}catch(yi){console.error("❌ Error updating transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{ai()}}function Gi(Li){j.value=!1,mt.value=null,kt.value=Li,J.value=!0}function un(){J.value=!1,kt.value=null}async function ia(Li){try{const yi=await Xh.deleteTransportKey(Li);yi.success?(await or(),l.setSelectedNode(null)):(console.error("❌ Failed to delete transport key:",yi.error),pe.value=yi.error||"Failed to delete transport key")}catch(yi){console.error("❌ Error deleting transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{un()}}async function fa(Li){try{const yi=await Xh.deleteTransportKey(Li.nodeId);yi.success?(await or(),l.setSelectedNode(null)):(console.error("❌ Failed to delete transport key:",yi.error),pe.value=yi.error||"Failed to delete transport key")}catch(yi){console.error("❌ Error deleting transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{un()}}return(Li,yi)=>(zi(),Vi("div",Nmt,[Re("div",jmt,[yi[3]||(yi[3]=Re("div",null,[Re("h3",{class:"text-lg font-semibold text-white mb-2"},"Regions/Keys"),Re("p",{class:"text-white/70 text-sm"},"Manage regional key hierarchy")],-1)),Re("div",Umt,[Re("button",{onClick:Wr,disabled:Dt.value==="allow",class:Xs(["flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors text-sm",Dt.value==="allow"?"bg-white/5 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-green/10 hover:bg-accent-green/20 text-accent-green border-accent-green/30"])},yi[2]||(yi[2]=[Re("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),nc(" Add ",-1)]),10,Vmt),Re("button",{onClick:Ft,disabled:!Ju(l).selectedNodeId.value||Dt.value==="allow",class:Xs(["px-4 py-2 rounded-lg border transition-colors",!Ju(l).selectedNodeId.value||Dt.value==="allow"?"bg-white/10 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border-accent-green/50"])}," Edit ",10,Hmt),Re("button",{onClick:An,disabled:!Ju(l).selectedNodeId.value||Dt.value==="allow",class:Xs(["px-4 py-2 rounded-lg border transition-colors",!Ju(l).selectedNodeId.value||Dt.value==="allow"?"bg-white/10 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border-accent-red/50"])}," Delete ",10,Wmt)])]),Re("div",qmt,[Re("div",Zmt,[yi[4]||(yi[4]=Re("div",null,[Re("h4",{class:"text-sm font-medium text-white mb-1"},"Global Flood Policy (*)"),Re("p",{class:"text-white/60 text-xs"},"Master control for repeater flooding")],-1)),Re("div",$mt,[Re("div",Gmt,[Re("button",{onClick:yi[0]||(yi[0]=ra=>jn("deny")),class:Xs(["px-3 py-1 text-xs font-medium rounded transition-colors",Dt.value==="deny"?"bg-accent-red/20 text-accent-red border border-accent-red/50":"text-white/60 hover:text-white/80"])}," DENY ",2),Re("button",{onClick:yi[1]||(yi[1]=ra=>jn("allow")),class:Xs(["px-3 py-1 text-xs font-medium rounded transition-colors",Dt.value==="allow"?"bg-accent-green/20 text-accent-green border border-accent-green/50":"text-white/60 hover:text-white/80"])}," ALLOW ",2)])])])]),Re("div",Ymt,[re.value?(zi(),Vi("div",Kmt,yi[5]||(yi[5]=[Re("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-accent-green"},null,-1),Re("span",{class:"ml-2 text-white/70"},"Loading transport keys...",-1)]))):pe.value?(zi(),Vi("div",Xmt,[yi[6]||(yi[6]=Re("div",{class:"text-accent-red mb-2"},"⚠️ Error loading transport keys",-1)),Re("div",Jmt,aa(pe.value),1),Re("button",{onClick:or,class:"mt-4 px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded-lg transition-colors"}," Retry ")])):Gt.value.length===0?(zi(),Vi("div",Qmt,yi[7]||(yi[7]=[Re("div",{class:"text-white/50 mb-2"},"📝 No transport keys found",-1),Re("div",{class:"text-white/30 text-sm"},"Add your first transport key to get started",-1)]))):(zi(),Vi("div",tgt,[(zi(!0),Vi(Ou,null,sf(Gt.value,ra=>(zi(),hm(_0t,{key:ra.id,node:ra,"selected-node-id":Ju(l).selectedNodeId.value,level:0,disabled:Dt.value==="allow",onSelect:zr},null,8,["node","selected-node-id","disabled"]))),128))]))]),gu(U0t,{show:z.value,"selected-node-name":Fr(),"selected-node-id":Ju(l).selectedNodeId.value||void 0,onClose:ei,onAdd:kn},null,8,["show","selected-node-name","selected-node-id"]),gu(pmt,{show:j.value,node:mt.value,onClose:ai,onSave:Qi,onRequestDelete:Gi},null,8,["show","node"]),gu(Bmt,{show:J.value,node:kt.value,"all-nodes":Gt.value,onClose:un,onDeleteAll:ia,onMoveChildren:fa},null,8,["show","node","all-nodes"])]))}}),rgt={class:"p-6 space-y-6"},ngt={class:"glass-card rounded-[15px] z-10 p-4 border border-primary/30 bg-primary/10"},igt={class:"text-primary"},agt={class:"mt-2 text-primary/80"},ogt={class:"glass-card rounded-[15px] p-6"},sgt={class:"flex flex-wrap border-b border-white/10 mb-6"},lgt=["onClick"],ugt={class:"flex items-center gap-2"},cgt={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},hgt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},fgt={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},dgt={key:3,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},pgt={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},mgt={class:"min-h-[400px]"},ggt={key:0,class:"flex items-center justify-center py-12"},vgt={key:1,class:"flex items-center justify-center py-12"},ygt={class:"text-center"},xgt={class:"text-white/60 text-sm mb-4"},_gt={key:2},bgt=Th({name:"ConfigurationView",__name:"Configuration",setup(d){const l=sv(),z=lo("radio"),j=lo(!1),J=[{id:"radio",label:"Radio Settings",icon:"radio"},{id:"repeater",label:"Repeater Settings",icon:"repeater"},{id:"duty",label:"Duty Cycle",icon:"duty"},{id:"delays",label:"TX Delays",icon:"delays"},{id:"transport",label:"Regions/Keys",icon:"keys"}];t0(async()=>{try{await l.fetchStats(),j.value=!0}catch(kt){console.error("Failed to load configuration data:",kt),j.value=!0}});function mt(kt){z.value=kt}return(kt,Dt)=>{const Gt=UA("router-link");return zi(),Vi("div",rgt,[Dt[11]||(Dt[11]=Re("div",null,[Re("h1",{class:"text-2xl font-bold text-white"},"Configuration"),Re("p",{class:"text-white/70 mt-2"},"System configuration and settings")],-1)),Dt[12]||(Dt[12]=Re("div",{class:"glass-card rounded-[15px] p-4 border border-blue-500/30 bg-blue-500/10"},[Re("div",{class:"text-blue-200"},[Re("strong",null,"Configuration is read-only."),nc(" To modify settings, edit the config file and restart the daemon. ")])],-1)),Re("div",ngt,[Re("div",igt,[Dt[3]||(Dt[3]=Re("strong",null,"CAD Calibration Tool Available",-1)),Re("p",agt,[Dt[2]||(Dt[2]=nc(" Optimize your Channel Activity Detection settings. ",-1)),gu(Gt,{to:"/cad-calibration",class:"underline hover:text-primary transition-colors"},{default:Y2(()=>Dt[1]||(Dt[1]=[nc(" Launch CAD Calibration Tool → ",-1)])),_:1,__:[1]})])])]),Re("div",ogt,[Re("div",sgt,[(zi(),Vi(Ou,null,sf(J,re=>Re("button",{key:re.id,onClick:pe=>mt(re.id),class:Xs(["px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2",z.value===re.id?"text-primary border-primary":"text-white/70 border-transparent hover:text-white hover:border-white/30"])},[Re("div",ugt,[re.icon==="radio"?(zi(),Vi("svg",cgt,Dt[4]||(Dt[4]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.822c5.716-5.716 14.976-5.716 20.692 0"},null,-1)]))):re.icon==="repeater"?(zi(),Vi("svg",hgt,Dt[5]||(Dt[5]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12l4-4m-4 4l4 4"},null,-1)]))):re.icon==="duty"?(zi(),Vi("svg",fgt,Dt[6]||(Dt[6]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):re.icon==="delays"?(zi(),Vi("svg",dgt,Dt[7]||(Dt[7]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):re.icon==="keys"?(zi(),Vi("svg",pgt,Dt[8]||(Dt[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))):bs("",!0),nc(" "+aa(re.label),1)])],10,lgt)),64))]),Re("div",mgt,[!j.value&&Ju(l).isLoading?(zi(),Vi("div",ggt,Dt[9]||(Dt[9]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Re("div",{class:"text-white/70"},"Loading configuration...")],-1)]))):Ju(l).error&&!j.value?(zi(),Vi("div",vgt,[Re("div",ygt,[Dt[10]||(Dt[10]=Re("div",{class:"text-red-400 mb-2"},"Failed to load configuration",-1)),Re("div",xgt,aa(Ju(l).error),1),Re("button",{onClick:Dt[0]||(Dt[0]=re=>Ju(l).fetchStats()),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):(zi(),Vi("div",_gt,[$p(Re("div",null,[gu(Tpt,{key:"radio-settings"})],512),[[Kb,z.value==="radio"]]),$p(Re("div",null,[gu(Upt,{key:"repeater-settings"})],512),[[Kb,z.value==="repeater"]]),$p(Re("div",null,[gu(Gpt,{key:"duty-cycle"})],512),[[Kb,z.value==="duty"]]),$p(Re("div",null,[gu(e0t,{key:"transmission-delays"})],512),[[Kb,z.value==="delays"]]),$p(Re("div",null,[gu(egt,{key:"transport-keys"})],512),[[Kb,z.value==="transport"]])]))])])])}}}),wgt={class:"p-6 space-y-6"},kgt={class:"glass-card rounded-[15px] p-6"},Tgt={class:"flex justify-center"},Agt={class:"flex gap-4"},Mgt=["disabled"],Sgt=["disabled"],Egt={class:"glass-card rounded-[15px] p-6 space-y-4"},Cgt={class:"text-white"},Lgt={key:0,class:"p-4 bg-primary/10 border border-primary/30 rounded-lg"},Pgt={class:"text-primary/90"},zgt={class:"space-y-2"},Igt={class:"w-full bg-white/10 rounded-full h-2"},Ogt={class:"text-white/70 text-sm"},Dgt={class:"grid grid-cols-2 md:grid-cols-4 gap-4"},Fgt={class:"glass-card rounded-[15px] p-4 text-center"},Rgt={class:"text-2xl font-bold text-primary"},Bgt={class:"glass-card rounded-[15px] p-4 text-center"},Ngt={class:"text-2xl font-bold text-primary"},jgt={class:"glass-card rounded-[15px] p-4 text-center"},Ugt={class:"text-2xl font-bold text-primary"},Vgt={class:"glass-card rounded-[15px] p-4 text-center"},Hgt={class:"text-2xl font-bold text-primary"},Wgt={key:0,class:"glass-card rounded-[15px] p-6 space-y-4"},qgt={key:0,class:"p-4 bg-accent-green/10 border border-accent-green/30 rounded-lg"},Zgt={class:"text-white/80 mb-4"},$gt={key:1,class:"p-4 bg-secondary/20 border border-secondary/40 rounded-lg"},Ggt=Th({name:"CADCalibrationView",__name:"CADCalibration",setup(d){const l=sv(),z=lo(!1),j=lo(null),J=lo(null),mt=lo({}),kt=lo(null),Dt=lo([]),Gt=lo({}),re=lo("Ready to start calibration"),pe=lo(0),Ne=lo(0),or=lo(0),_r=lo(0),Fr=lo(0),zr=lo(0),Wr=lo(null),An=lo(!1),Ft=lo(!1),kn=lo(!1),ei=lo(!1);let jn=null;const ai={responsive:!0,displayModeBar:!0,modeBarButtonsToRemove:["pan2d","select2d","lasso2d","autoScale2d"],displaylogo:!1,toImageButtonOptions:{format:"png",filename:"cad-calibration-heatmap",height:600,width:800,scale:2}};function Qi(){const Ni=[{x:[],y:[],z:[],mode:"markers",type:"scatter",marker:{size:12,color:[],colorscale:[[0,"rgba(75, 85, 99, 0.4)"],[.1,"rgba(6, 182, 212, 0.3)"],[.5,"rgba(6, 182, 212, 0.6)"],[1,"rgba(16, 185, 129, 0.9)"]],showscale:!0,colorbar:{title:{text:"Detection Rate (%)",font:{color:"#ffffff",size:14}},tickfont:{color:"#ffffff"},bgcolor:"rgba(0,0,0,0)",bordercolor:"rgba(255,255,255,0.2)",borderwidth:1,thickness:15},line:{color:"rgba(255,255,255,0.2)",width:1}},hovertemplate:"<b>Peak:</b> %{x}<br><b>Min:</b> %{y}<br><b>Detection Rate:</b> %{marker.color:.1f}%<br><extra></extra>",name:"Test Results"}],Ei={title:{text:'CAD Detection Rate<br><sub style="color: #94a3b8;">Channel Activity Detection Calibration</sub>',font:{color:"#ffffff",size:18},x:.5},xaxis:{title:{text:"CAD Peak Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},yaxis:{title:{text:"CAD Min Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},plot_bgcolor:"rgba(0, 0, 0, 0)",paper_bgcolor:"rgba(0, 0, 0, 0)",font:{color:"#ffffff",family:"Inter, system-ui, sans-serif"},margin:{l:80,r:80,t:100,b:80},showlegend:!1};l1.newPlot("plotly-chart",Ni,Ei,ai)}function Gi(){if(Object.keys(mt.value).length===0)return;const Ni=Object.values(mt.value),Ei=[],Va=[],ss=[];for(const ko of Ni)Ei.push(ko.det_peak),Va.push(ko.det_min),ss.push(ko.detection_rate);const mo={x:[Ei],y:[Va],"marker.color":[ss],hovertemplate:"<b>Peak:</b> %{x}<br><b>Min:</b> %{y}<br><b>Detection Rate:</b> %{marker.color:.1f}%<br><b>Status:</b> Tested<br><extra></extra>"};l1.restyle("plotly-chart",mo,[0])}async function un(){try{const Va=await Xh.post("/cad-calibration-start",{samples:10,delay_ms:50});if(Va.success)z.value=!0,j.value=Date.now(),l.setCadCalibrationRunning(!0),mt.value={},Dt.value=[],Gt.value={},kt.value=null,An.value=!1,Ft.value=!1,kn.value=!1,ei.value=!1,or.value=0,_r.value=0,Fr.value=0,zr.value=0,pe.value=0,Ne.value=0,jn=setInterval(()=>{j.value&&(zr.value=Math.floor((Date.now()-j.value)/1e3))},1e3),fa();else throw new Error(Va.error||"Failed to start calibration")}catch(Va){re.value=`Error: ${Va instanceof Error?Va.message:"Unknown error"}`}}async function ia(){try{(await Xh.post("/cad-calibration-stop")).success&&(z.value=!1,l.setCadCalibrationRunning(!1),J.value&&(J.value.close(),J.value=null),jn&&(clearInterval(jn),jn=null))}catch(Ni){console.error("Failed to stop calibration:",Ni)}}function fa(){J.value&&J.value.close(),J.value=new EventSource(`${oQ}/api/cad-calibration-stream`),J.value.onmessage=function(Ni){try{const Ei=JSON.parse(Ni.data);Li(Ei)}catch(Ei){console.error("Failed to parse SSE data:",Ei)}},J.value.onerror=function(Ni){console.error("SSE connection error:",Ni),z.value||J.value&&(J.value.close(),J.value=null)}}function Li(Ni){switch(Ni.type){case"status":re.value=Ni.message||"Status update",Ni.test_ranges&&(Wr.value=Ni.test_ranges,An.value=!0);break;case"progress":pe.value=Ni.current||0,Ne.value=Ni.total||0,or.value=Ni.current||0;break;case"result":if(Ni.det_peak!==void 0&&Ni.det_min!==void 0&&Ni.detection_rate!==void 0&&Ni.detections!==void 0&&Ni.samples!==void 0){const Ei=`${Ni.det_peak}_${Ni.det_min}`;mt.value[Ei]={det_peak:Ni.det_peak,det_min:Ni.det_min,detection_rate:Ni.detection_rate,detections:Ni.detections,samples:Ni.samples},Gi(),yi()}break;case"complete":case"completed":z.value=!1,re.value=Ni.message||"Calibration completed",l.setCadCalibrationRunning(!1),ra(),J.value&&(J.value.close(),J.value=null),jn&&(clearInterval(jn),jn=null);break;case"error":re.value=`Error: ${Ni.message}`,l.setCadCalibrationRunning(!1),ia();break}}function yi(){const Ni=Object.values(mt.value).map(Ei=>Ei.detection_rate);Ni.length!==0&&(_r.value=Math.max(...Ni),Fr.value=Ni.reduce((Ei,Va)=>Ei+Va,0)/Ni.length)}function ra(){Ft.value=!0;let Ni=null,Ei=0;for(const Va of Object.values(mt.value))Va.detection_rate>Ei&&(Ei=Va.detection_rate,Ni=Va);kt.value=Ni,Ni&&Ei>0?(kn.value=!0,ei.value=!1):(kn.value=!1,ei.value=!0)}async function Da(){if(!kt.value){re.value="Error: No calibration results to save";return}try{const Ni=await Xh.post("/save_cad_settings",{peak:kt.value.det_peak,min_val:kt.value.det_min,detection_rate:kt.value.detection_rate});if(Ni.success)re.value=`Settings saved! Peak=${kt.value.det_peak}, Min=${kt.value.det_min} applied to configuration.`;else throw new Error(Ni.error||"Failed to save settings")}catch(Ni){re.value=`Error: Failed to save settings: ${Ni instanceof Error?Ni.message:"Unknown error"}`}}return t0(()=>{Qi()}),K2(()=>{J.value&&J.value.close(),jn&&clearInterval(jn),l.setCadCalibrationRunning(!1),document.getElementById("plotly-chart")&&l1.purge("plotly-chart")}),(Ni,Ei)=>(zi(),Vi("div",wgt,[Ei[14]||(Ei[14]=Re("div",null,[Re("h1",{class:"text-2xl font-bold text-white"},"CAD Calibration Tool"),Re("p",{class:"text-white/70 mt-2"},"Channel Activity Detection calibration")],-1)),Re("div",kgt,[Re("div",Tgt,[Re("div",Agt,[Re("button",{onClick:un,disabled:z.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-green/10 hover:bg-accent-green/20 disabled:bg-gray-500/10 text-accent-green disabled:text-gray-400 rounded-lg border border-accent-green/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},Ei[0]||(Ei[0]=[Ff('<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-854f5f55><polygon points="5 3 19 12 5 21 5 3" data-v-854f5f55></polygon></svg><div class="text-left" data-v-854f5f55><div class="font-medium" data-v-854f5f55>Start Calibration</div><div class="text-xs opacity-80" data-v-854f5f55>Begin testing</div></div>',2)]),8,Mgt),Re("button",{onClick:ia,disabled:!z.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-red/10 hover:bg-accent-red/20 disabled:bg-gray-500/10 text-accent-red disabled:text-gray-400 rounded-lg border border-accent-red/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},Ei[1]||(Ei[1]=[Ff('<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-854f5f55><rect x="6" y="6" width="12" height="12" data-v-854f5f55></rect></svg><div class="text-left" data-v-854f5f55><div class="font-medium" data-v-854f5f55>Stop</div><div class="text-xs opacity-80" data-v-854f5f55>Halt calibration</div></div>',2)]),8,Sgt)])])]),Re("div",Egt,[Re("div",Cgt,aa(re.value),1),An.value&&Wr.value?(zi(),Vi("div",Lgt,[Re("div",Pgt,[Ei[2]||(Ei[2]=Re("strong",null,"Configuration:",-1)),nc(" SF"+aa(Wr.value.spreading_factor)+" | Peak: "+aa(Wr.value.peak_min)+" - "+aa(Wr.value.peak_max)+" | Min: "+aa(Wr.value.min_min)+" - "+aa(Wr.value.min_max)+" | "+aa((Wr.value.peak_max-Wr.value.peak_min+1)*(Wr.value.min_max-Wr.value.min_min+1))+" tests ",1)])])):bs("",!0),Re("div",zgt,[Re("div",Igt,[Re("div",{class:"bg-gradient-to-r from-primary to-accent-green h-2 rounded-full transition-all duration-300",style:av({width:Ne.value>0?`${pe.value/Ne.value*100}%`:"0%"})},null,4)]),Re("div",Ogt,aa(pe.value)+" / "+aa(Ne.value)+" tests completed",1)])]),Re("div",Dgt,[Re("div",Fgt,[Re("div",Rgt,aa(or.value),1),Ei[3]||(Ei[3]=Re("div",{class:"text-white/70 text-sm"},"Tests Completed",-1))]),Re("div",Bgt,[Re("div",Ngt,aa(_r.value.toFixed(1))+"%",1),Ei[4]||(Ei[4]=Re("div",{class:"text-white/70 text-sm"},"Best Detection Rate",-1))]),Re("div",jgt,[Re("div",Ugt,aa(Fr.value.toFixed(1))+"%",1),Ei[5]||(Ei[5]=Re("div",{class:"text-white/70 text-sm"},"Average Rate",-1))]),Re("div",Vgt,[Re("div",Hgt,aa(zr.value)+"s",1),Ei[6]||(Ei[6]=Re("div",{class:"text-white/70 text-sm"},"Elapsed Time",-1))])]),Ei[15]||(Ei[15]=Re("div",{class:"glass-card rounded-[15px] p-6"},[Re("div",{id:"plotly-chart",class:"w-full h-96"})],-1)),Ft.value?(zi(),Vi("div",Wgt,[Ei[13]||(Ei[13]=Re("h3",{class:"text-xl font-bold text-white"},"Calibration Results",-1)),kn.value&&kt.value?(zi(),Vi("div",qgt,[Ei[11]||(Ei[11]=Re("h4",{class:"font-medium text-accent-green mb-2"},"Optimal Settings Found:",-1)),Re("p",Zgt,[Ei[7]||(Ei[7]=nc(" Peak: ",-1)),Re("strong",null,aa(kt.value.det_peak),1),Ei[8]||(Ei[8]=nc(", Min: ",-1)),Re("strong",null,aa(kt.value.det_min),1),Ei[9]||(Ei[9]=nc(", Rate: ",-1)),Re("strong",null,aa(kt.value.detection_rate.toFixed(1))+"%",1)]),Re("div",{class:"flex justify-center"},[Re("button",{onClick:Da,class:"flex items-center gap-3 px-6 py-3 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"},Ei[10]||(Ei[10]=[Ff('<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-854f5f55><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" data-v-854f5f55></path></svg><div class="text-left" data-v-854f5f55><div class="font-medium" data-v-854f5f55>Save Settings</div><div class="text-xs opacity-80" data-v-854f5f55>Apply to configuration</div></div>',2)]))])])):bs("",!0),ei.value?(zi(),Vi("div",$gt,Ei[12]||(Ei[12]=[Re("h4",{class:"font-medium text-secondary mb-2"},"No Optimal Settings Found",-1),Re("p",{class:"text-white/70"},"All tested combinations showed low detection rates. Consider running calibration again or adjusting test parameters.",-1)]))):bs("",!0)])):bs("",!0)]))}}),Ygt=ld(Ggt,[["__scopeId","data-v-854f5f55"]]),Kgt={class:"space-y-6"},Xgt={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},Jgt={class:"flex items-center justify-between mb-4"},Qgt=["disabled"],tvt={class:"bg-white/5 border border-white/10 rounded-lg p-4"},evt={class:"flex flex-wrap gap-2"},rvt=["onClick"],nvt={key:0,class:"w-px h-6 bg-white/20 mx-2 self-center"},ivt=["onClick"],avt={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden"},ovt={key:0,class:"p-8 text-center"},svt={key:1,class:"p-8 text-center"},lvt={class:"text-dark-text mb-4"},uvt={key:2,class:"max-h-[600px] overflow-y-auto"},cvt={key:0,class:"p-8 text-center"},hvt={key:1,class:"divide-y divide-white/5"},fvt={class:"flex-shrink-0 text-dark-text"},dvt={class:"flex-shrink-0 px-2 py-1 text-xs font-medium rounded bg-blue-500/20 text-blue-400"},pvt={class:"text-white flex-1 break-all"},mvt=Th({name:"LogsView",__name:"Logs",setup(d){const l=lo([]),z=lo(new Set),j=lo(new Set(["DEBUG","INFO","WARNING","ERROR"])),J=lo(new Set),mt=lo(new Set),kt=lo(!0),Dt=lo(null);let Gt=null;const re=fa=>{const Li=fa.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR) -/);return Li?Li[1].trim():"Unknown"},pe=fa=>{const Li=fa.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR) - (.+)$/);return Li?Li[1]:fa},Ne=(fa,Li)=>{if(fa.size!==Li.size)return!1;for(const yi of fa)if(!Li.has(yi))return!1;return!0},or=async()=>{try{const fa=await Xh.getLogs();if(fa.logs&&fa.logs.length>0){l.value=fa.logs;const Li=new Set;l.value.forEach(Ni=>{const Ei=re(Ni.message);Li.add(Ei)});const yi=new Set;l.value.forEach(Ni=>{yi.add(Ni.level)}),z.value.size===0&&(z.value=new Set(Li));const ra=!Ne(J.value,Li),Da=!Ne(mt.value,yi);ra&&(J.value=Li),Da&&(mt.value=yi),Dt.value=null}}catch(fa){console.error("Error loading logs:",fa),Dt.value=fa instanceof Error?fa.message:"Failed to load logs"}finally{kt.value=!1}},_r=Yo(()=>l.value.filter(Li=>{const yi=re(Li.message),ra=z.value.has(yi),Da=j.value.has(Li.level);return ra&&Da})),Fr=Yo(()=>Array.from(J.value).sort()),zr=Yo(()=>{const fa=["ERROR","WARNING","WARN","INFO","DEBUG"];return Array.from(mt.value).sort((yi,ra)=>{const Da=fa.indexOf(yi),Ni=fa.indexOf(ra);return Da!==-1&&Ni!==-1?Da-Ni:yi.localeCompare(ra)})}),Wr=fa=>{j.value.has(fa)?j.value.delete(fa):j.value.add(fa),j.value=new Set(j.value)},An=fa=>new Date(fa).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),Ft=fa=>({ERROR:"text-red-400 bg-red-900/20",WARNING:"text-yellow-400 bg-yellow-900/20",WARN:"text-yellow-400 bg-yellow-900/20",INFO:"text-blue-400 bg-blue-900/20",DEBUG:"text-gray-400 bg-gray-900/20"})[fa]||"text-gray-400 bg-gray-900/20",kn=(fa,Li)=>Li?{ERROR:"bg-red-500/20 text-red-400 border-red-500/50",WARNING:"bg-yellow-500/20 text-yellow-400 border-yellow-500/50",WARN:"bg-yellow-500/20 text-yellow-400 border-yellow-500/50",INFO:"bg-blue-500/20 text-blue-400 border-blue-500/50",DEBUG:"bg-gray-500/20 text-gray-400 border-gray-500/50"}[fa]||"bg-primary/20 text-primary border-primary/50":"bg-white/5 text-white/60 border-white/20 hover:bg-white/10",ei=fa=>{z.value.has(fa)?z.value.delete(fa):z.value.add(fa),z.value=new Set(z.value)},jn=()=>{z.value=new Set(J.value)},ai=()=>{z.value=new Set},Qi=()=>{j.value=new Set(mt.value)},Gi=()=>{j.value=new Set},un=()=>{Gt&&clearInterval(Gt),Gt=setInterval(or,5e3)},ia=()=>{Gt&&(clearInterval(Gt),Gt=null)};return t0(()=>{or(),un()}),dg(()=>{ia()}),(fa,Li)=>(zi(),Vi("div",Kgt,[Re("div",Xgt,[Re("div",Jgt,[Li[1]||(Li[1]=Re("div",null,[Re("h1",{class:"text-white text-2xl font-semibold mb-2"},"System Logs"),Re("p",{class:"text-dark-text"},"Real-time system events and diagnostics")],-1)),Re("button",{onClick:or,disabled:kt.value,class:"flex items-center gap-2 px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors disabled:opacity-50"},[(zi(),Vi("svg",{class:Xs(["w-4 h-4",{"animate-spin":kt.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Li[0]||(Li[0]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),nc(" "+aa(kt.value?"Loading...":"Refresh"),1)],8,Qgt)]),Re("div",tvt,[Re("div",{class:"flex flex-wrap items-center gap-3 mb-4"},[Li[2]||(Li[2]=Re("span",{class:"text-white font-medium"},"Filters:",-1)),Re("button",{onClick:jn,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Loggers "),Re("button",{onClick:ai,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Loggers "),Li[3]||(Li[3]=Re("div",{class:"w-px h-4 bg-white/20 mx-1"},null,-1)),Re("button",{onClick:Qi,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Levels "),Re("button",{onClick:Gi,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Levels ")]),Re("div",evt,[(zi(!0),Vi(Ou,null,sf(Fr.value,yi=>(zi(),Vi("button",{key:"logger-"+yi,onClick:ra=>ei(yi),class:Xs(["px-3 py-1 text-xs border rounded-full transition-colors",z.value.has(yi)?"bg-primary/20 text-primary border-primary/50":"bg-white/5 text-white/60 border-white/20 hover:bg-white/10"])},aa(yi),11,rvt))),128)),Fr.value.length>0&&zr.value.length>0?(zi(),Vi("div",nvt)):bs("",!0),(zi(!0),Vi(Ou,null,sf(zr.value,yi=>(zi(),Vi("button",{key:"level-"+yi,onClick:ra=>Wr(yi),class:Xs(["px-3 py-1 text-xs border rounded-full transition-colors font-medium",j.value.has(yi)?kn(yi,!0):kn(yi,!1)])},aa(yi),11,ivt))),128))])])]),Re("div",avt,[kt.value&&l.value.length===0?(zi(),Vi("div",ovt,Li[4]||(Li[4]=[Re("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"},null,-1),Re("p",{class:"text-dark-text"},"Loading system logs...",-1)]))):Dt.value?(zi(),Vi("div",svt,[Li[5]||(Li[5]=Re("div",{class:"text-red-400 mb-4"},[Re("svg",{class:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),Li[6]||(Li[6]=Re("h3",{class:"text-white text-lg font-medium mb-2"},"Error Loading Logs",-1)),Re("p",lvt,aa(Dt.value),1),Re("button",{onClick:or,class:"px-4 py-2 bg-red-500/20 hover:bg-red-500/30 text-red-400 border border-red-500/50 rounded-lg transition-colors"}," Try Again ")])):(zi(),Vi("div",uvt,[_r.value.length===0?(zi(),Vi("div",cvt,Li[7]||(Li[7]=[Ff('<div class="text-dark-text mb-4"><svg class="w-12 h-12 mx-auto mb-4 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></div><h3 class="text-white text-lg font-medium mb-2">No Logs to Display</h3><p class="text-dark-text">No logs match the current filter criteria.</p>',3)]))):(zi(),Vi("div",hvt,[(zi(!0),Vi(Ou,null,sf(_r.value,(yi,ra)=>(zi(),Vi("div",{key:ra,class:"flex items-start gap-4 p-4 hover:bg-white/5 transition-colors font-mono text-sm"},[Re("span",fvt," ["+aa(An(yi.timestamp))+"] ",1),Re("span",dvt,aa(re(yi.message)),1),Re("span",{class:Xs(["flex-shrink-0 px-2 py-1 text-xs font-medium rounded",Ft(yi.level)])},aa(yi.level),3),Re("span",pvt,aa(pe(yi.message)),1)]))),128))]))]))])]))}}),gvt=Th({name:"HelpView",__name:"Help",setup(d){return(l,z)=>(zi(),Vi("div",null,z[0]||(z[0]=[Ff('<div class="bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-8"><h1 class="text-white text-2xl font-semibold mb-6">Help</h1><div class="text-center py-12"><div class="text-dark-text mb-4"><svg class="w-16 h-16 mx-auto mb-4 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div><h2 class="text-white text-lg font-medium mb-2">Help &amp; Documentation</h2><p class="text-dark-text">Find answers to common questions and access user guides.</p></div></div>',1)])))}}),vvt=SX({history:aX("/"),routes:[{path:"/",name:"dashboard",component:Lat},{path:"/neighbors",name:"neighbors",component:sot},{path:"/statistics",name:"statistics",component:upt},{path:"/configuration",name:"configuration",component:bgt},{path:"/cad-calibration",name:"cad-calibration",component:Ygt},{path:"/logs",name:"logs",component:mvt},{path:"/help",name:"help",component:gvt}]}),wM=dK(nrt);wM.use(gK());wM.use(vvt);wM.mount("#app");